Linear Collider Forum



Home » Analysis and Reconstruction » Tracking & Vertexing » Pulse (and Hit) quailty
Re: Pulse (and Hit) quailty [message #1967 is a reply to message #1966] Thu, 06 May 2010 09:22 Go to previous message
killenberg
Messages: 125
Registered: July 2005
Location: CERN
Hello Christoph,

thanks for your reply. I completely agree that the definition should be done externally. But we should also have it implemented as constants because the source code is much clearer if it reads
if (quality & OVERFLOW) {...}
instead of
if (quality & (1<<4) ) {...}


Quote:

An older, first idea (I'm behind the updating schedule) is at http://www-flc.desy.de/flc/flcwiki/MarlinTPCStructure

Yes, that's the way I would have implemented it. I just proposed the "eye candy" thing because the 1, 10, 100 looked like it.

Quote:

Please don't do the definition of numbers in header files; rather use the initialisation list.

Yes, you are right. However, for static const I sometimes make an exception because

  • They are not real variables. I think the compiler "hardcodes" them during the optimisation anyway and does not even allocate memory for them.
  • You have the variable names and the values in the same place.
  • Doxygen includes the values.
  • You don't need a .cpp and object file.

I usually interpret them as the "C++-version" of #define

Cheers

Martin


Martin Killenberg

CERN
martin.killenberg@cern.ch
 
Read Message
Read Message
Read Message
Previous Topic:LCIO::EVENT::TrackerPulse additions
Next Topic:Questions about fitting in MarlinTPC
Goto Forum:
  


Current Time: Thu Jun 21 07:36:45 Pacific Daylight Time 2018
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.1.
Copyright ©2001-2010 FUDforum Bulletin Board Software