Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

LHCbID Class Reference

#include <LHCbID.h>

List of all members.

Public Member Functions

 LHCbID (const VeloChannelID &chanID)
 Constructor from VeloChannelID.
 LHCbID (const ITChannelID &chanID)
 Constructor from ITChannelID.
 LHCbID (const OTChannelID &chanID)
 Constructor from OTChannelID.
 LHCbID (const RichSmartID &chanID)
 Constructor from RichSmartID.
 LHCbID (const CaloCellID &chanID)
 Constructor from CaloCellID.
 LHCbID ()
 Default Constructor.
virtual ~LHCbID ()
 Default Destructor.
virtual std::ostream & fillStream (std::ostream &s) const
 Fill the ASCII output stream.
bool operator== (const LHCbID &chanID) const
 comparison equality
bool isVelo () const
 return true if this is a Velo identifier
VeloChannelID veloID () const
 return the VeloChannelID
bool isST () const
 return true if this is a Silicon Tracker identifier
ITChannelID stID () const
 return the ITChannelID
bool isOT () const
 return true if this is a Outer Tracker identifier
OTChannelID otID () const
 return the OTChannelID
bool isRich () const
 return true if this is a Rich identifier
RichSmartID richID () const
 return the richSmartID
bool isCalo () const
 return true if this is a Calo identifier
CaloCellID caloID () const
 return the CaloCellID
unsigned int channelID () const
 return the internal channel ID
void setSpareBits (unsigned int value)
 set the spare bits
unsigned int spareBits () const
 retrieve the spare bits
unsigned int lhcbID () const
 Retrieve const the internal representation.
void setChannelID (unsigned int value)
 Update the detector channelID bits.
unsigned int detectorType () const
 Retrieve the LHCb detector type bits.
void setDetectorType (unsigned int value)
 Update the LHCb detector type bits.

Protected Types

enum  SpecificMask { veloMask = 0x1FFFFFL, otMask = 0x3FFFFFFL }
 enumeration of the specific mask More...
enum  SpecificBits { veloBits = 21, otBits = 26 }
 enumeration of the specific bits More...

Private Types

enum  channelIDType {
  veloType = 1, stType, otType, richType,
  caloType, muonType
}
 types of sub-detector channel ID More...
enum  lhcbIDBits { channelIDBits = 0, detectorTypeBits = 28 }
 Offsets of bitfield lhcbID. More...
enum  lhcbIDMasks { channelIDMask = 0xFFFFFFFL, detectorTypeMask = 0xF0000000L }
 Bitmasks for bitfield lhcbID. More...

Private Attributes

unsigned int m_lhcbID
 the internal representation

Friends

std::ostream & operator<< (std::ostream &str, const LHCbID &obj)
 Operator overloading for stringoutput.


Detailed Description

LHCb wide channel identifier

Author:
Marco Cattaneo created Thu Apr 7 21:10:57 2005

Definition at line 40 of file LHCbID.h.


Member Enumeration Documentation

enum LHCbID::channelIDType [private]
 

types of sub-detector channel ID

Enumeration values:
veloType 
stType 
otType 
richType 
caloType 
muonType 

Definition at line 138 of file LHCbID.h.

00138                     { veloType=1,
00139                       stType,
00140                       otType,
00141                       richType,
00142                       caloType,
00143                       muonType };

enum LHCbID::lhcbIDBits [private]
 

Offsets of bitfield lhcbID.

Enumeration values:
channelIDBits 
detectorTypeBits 

Definition at line 146 of file LHCbID.h.

00146                  {channelIDBits    = 0,
00147                   detectorTypeBits = 28};

enum LHCbID::lhcbIDMasks [private]
 

Bitmasks for bitfield lhcbID.

Enumeration values:
channelIDMask 
detectorTypeMask 

Definition at line 150 of file LHCbID.h.

00150                   {channelIDMask    = 0xFFFFFFFL,
00151                    detectorTypeMask = 0xF0000000L};

enum LHCbID::SpecificBits [protected]
 

enumeration of the specific bits

Enumeration values:
veloBits 
otBits 

Definition at line 132 of file LHCbID.h.

00132                    { veloBits=21,
00133                      otBits=26 };

enum LHCbID::SpecificMask [protected]
 

enumeration of the specific mask

Enumeration values:
veloMask 
otMask 

Definition at line 129 of file LHCbID.h.

00129                    { veloMask= 0x1FFFFFL,
00130                      otMask=0x3FFFFFFL };


Constructor & Destructor Documentation

LHCbID::LHCbID const VeloChannelID &  chanID  )  [inline]
 

Constructor from VeloChannelID.

Definition at line 164 of file LHCbID.h.

References setChannelID(), setDetectorType(), and veloType.

00164                                                  : m_lhcbID(0) 
00165 {
00166 
00167   setDetectorType( veloType );
00168   setChannelID( chanID );
00169           
00170 }

LHCbID::LHCbID const ITChannelID &  chanID  )  [inline]
 

Constructor from ITChannelID.

Definition at line 172 of file LHCbID.h.

References setChannelID(), setDetectorType(), and stType.

00172                                                : m_lhcbID(0) 
00173 {
00174 
00175   setDetectorType( stType );
00176   setChannelID( ((chanID.uniqueWafer()-1)>>4) + (chanID.strip()-1) );
00177           
00178 }

LHCbID::LHCbID const OTChannelID &  chanID  )  [inline]
 

Constructor from OTChannelID.

Definition at line 180 of file LHCbID.h.

References otType, setChannelID(), and setDetectorType().

00180                                                : m_lhcbID(0) 
00181 {
00182 
00183   setDetectorType( otType );
00184   setChannelID( chanID );
00185         
00186 }

LHCbID::LHCbID const RichSmartID &  chanID  )  [inline]
 

Constructor from RichSmartID.

Definition at line 188 of file LHCbID.h.

References richType, setChannelID(), and setDetectorType().

00188                                                : m_lhcbID(0) 
00189 {
00190 
00191   unsigned int richData = chanID.dataBitsOnly();
00192   if( chanID.pixelDataAreValid() ) richData += 0x8000000;
00193   setDetectorType( richType );
00194   setChannelID( richData );
00195          
00196 }

LHCbID::LHCbID const CaloCellID &  chanID  )  [inline]
 

Constructor from CaloCellID.

Definition at line 198 of file LHCbID.h.

References caloType, setChannelID(), and setDetectorType().

00198                                               : m_lhcbID(0) 
00199 {
00200 
00201   setDetectorType( caloType );
00202   setChannelID( chanID.ccid() );
00203          
00204 }

LHCbID::LHCbID  )  [inline]
 

Default Constructor.

Definition at line 60 of file LHCbID.h.

References m_lhcbID.

00060 : m_lhcbID(0) {}

virtual LHCbID::~LHCbID  )  [inline, virtual]
 

Default Destructor.

Definition at line 63 of file LHCbID.h.

00063 {}


Member Function Documentation

CaloCellID LHCbID::caloID  )  const [inline]
 

return the CaloCellID

Definition at line 318 of file LHCbID.h.

References channelID(), and isCalo().

00319 {
00320 
00321   return isCalo() ? channelID() : 0xF0000000;
00322          
00323 }

unsigned int LHCbID::channelID  )  const [inline]
 

return the internal channel ID

Definition at line 325 of file LHCbID.h.

References channelIDBits, channelIDMask, isOT(), isVelo(), m_lhcbID, otMask, and veloMask.

Referenced by caloID(), TrFitTrack2TrackCnv::execute(), otID(), richID(), stID(), and veloID().

00326 {
00327 
00328   unsigned mask = channelIDMask;
00329   unsigned bits  = channelIDBits;
00330   if (isVelo()) mask = veloMask;
00331   if (isOT()) mask = otMask;
00332   unsigned int id = (m_lhcbID & mask) >> bits;
00333   return id;
00334         
00335 }

unsigned int LHCbID::detectorType  )  const [inline]
 

Retrieve the LHCb detector type bits.

Definition at line 231 of file LHCbID.h.

References detectorTypeBits, detectorTypeMask, and m_lhcbID.

Referenced by TrFitTrack2TrackCnv::execute(), isCalo(), isOT(), isRich(), isST(), and isVelo().

00232 {
00233   return (unsigned int)((m_lhcbID & detectorTypeMask) >> detectorTypeBits);
00234 }

std::ostream & LHCbID::fillStream std::ostream &  s  )  const [inline, virtual]
 

Fill the ASCII output stream.

Definition at line 212 of file LHCbID.h.

References m_lhcbID.

00213 {
00214   s << "{ " << "lhcbID :        " << m_lhcbID << std::endl << " }";
00215   return s;
00216 }

bool LHCbID::isCalo  )  const [inline]
 

return true if this is a Calo identifier

Definition at line 311 of file LHCbID.h.

References caloType, and detectorType().

Referenced by caloID().

00312 {
00313 
00314   return (caloType == detectorType()) ? true : false;
00315          
00316 }

bool LHCbID::isOT  )  const [inline]
 

return true if this is a Outer Tracker identifier

Definition at line 278 of file LHCbID.h.

References detectorType(), and otType.

Referenced by channelID(), otID(), setSpareBits(), and spareBits().

00279 {
00280 
00281   return (otType == detectorType()) ? true : false;
00282          
00283 }

bool LHCbID::isRich  )  const [inline]
 

return true if this is a Rich identifier

Definition at line 292 of file LHCbID.h.

References detectorType(), and richType.

Referenced by richID().

00293 {
00294 
00295   return (richType == detectorType()) ? true : false;
00296          
00297 }

bool LHCbID::isST  )  const [inline]
 

return true if this is a Silicon Tracker identifier

Definition at line 264 of file LHCbID.h.

References detectorType(), and stType.

Referenced by stID().

00265 {
00266 
00267   return (stType == detectorType()) ? true : false;
00268          
00269 }

bool LHCbID::isVelo  )  const [inline]
 

return true if this is a Velo identifier

Definition at line 250 of file LHCbID.h.

References detectorType(), and veloType.

Referenced by channelID(), setSpareBits(), spareBits(), and veloID().

00251 {
00252 
00253   return (veloType == detectorType()) ? true : false;
00254          
00255 }

unsigned int LHCbID::lhcbID  )  const [inline]
 

Retrieve const the internal representation.

Definition at line 219 of file LHCbID.h.

References m_lhcbID.

Referenced by TrFitTrack2TrackCnv::execute().

00220 {
00221   return m_lhcbID;
00222 }

bool LHCbID::operator== const LHCbID chanID  )  const [inline]
 

comparison equality

Definition at line 243 of file LHCbID.h.

00244 {
00245 
00246   return (this->lhcbID() == chanID.lhcbID());
00247          
00248 }

OTChannelID LHCbID::otID  )  const [inline]
 

return the OTChannelID

Definition at line 285 of file LHCbID.h.

References channelID(), and isOT().

00286 {
00287 
00288   return isOT() ? channelID() : 0xF0000000;
00289          
00290 }

RichSmartID LHCbID::richID  )  const [inline]
 

return the richSmartID

Definition at line 299 of file LHCbID.h.

References channelID(), and isRich().

00300 {
00301 
00302   unsigned int rID = 0;
00303   if( isRich() ) {
00304     rID = channelID() & 0x7000000;
00305     if( channelID() && 0x8000000 ) rID += 0x7E000000;
00306   }
00307   return rID;
00308          
00309 }

void LHCbID::setChannelID unsigned int  value  )  [inline]
 

Update the detector channelID bits.

Definition at line 224 of file LHCbID.h.

References channelIDBits, channelIDMask, and m_lhcbID.

Referenced by LHCbID().

00225 {
00226   unsigned int val = (unsigned int)value;
00227   m_lhcbID &= ~channelIDMask;
00228   m_lhcbID |= ((((unsigned int)val) << channelIDBits) & channelIDMask);
00229 }

void LHCbID::setDetectorType unsigned int  value  )  [inline]
 

Update the LHCb detector type bits.

Definition at line 236 of file LHCbID.h.

References detectorTypeBits, detectorTypeMask, and m_lhcbID.

Referenced by LHCbID().

00237 {
00238   unsigned int val = (unsigned int)value;
00239   m_lhcbID &= ~detectorTypeMask;
00240   m_lhcbID |= ((((unsigned int)val) << detectorTypeBits) & detectorTypeMask);
00241 }

void LHCbID::setSpareBits unsigned int  value  )  [inline]
 

set the spare bits

Definition at line 337 of file LHCbID.h.

References channelIDBits, channelIDMask, isOT(), isVelo(), m_lhcbID, otBits, otMask, veloBits, and veloMask.

Referenced by TrFitTrack2TrackCnv::execute().

00338 {
00339 
00340   if ( !( isVelo() || isOT() ) ) return;
00341   unsigned int mask = channelIDMask;
00342   unsigned int bits = channelIDBits;
00343   if (isVelo()) {
00344     mask &= (~veloMask);
00345     bits = veloBits;
00346   } else if (isOT()) {
00347     mask &= (~otMask);
00348     bits = otBits;
00349   }
00350   m_lhcbID &= ~mask;
00351   m_lhcbID |= ((((unsigned int)value) << bits) & mask);
00352         
00353 }

unsigned int LHCbID::spareBits  )  const [inline]
 

retrieve the spare bits

Definition at line 355 of file LHCbID.h.

References channelIDBits, channelIDMask, isOT(), isVelo(), m_lhcbID, otBits, otMask, veloBits, and veloMask.

Referenced by TrFitTrack2TrackCnv::execute().

00356 {
00357 
00358   if ( !( isVelo() || isOT() ) ) return 0;
00359   unsigned int mask = channelIDMask;
00360   unsigned int bits = channelIDBits;
00361   if (isVelo()) {
00362      mask &= (~veloMask);         
00363      bits = veloBits;
00364   } else if (isOT()) {
00365      mask &= (~otMask);   
00366      bits = otBits;
00367   }
00368   unsigned int val = ((m_lhcbID & mask) >> bits);
00369   return val;
00370          
00371 }

ITChannelID LHCbID::stID  )  const [inline]
 

return the ITChannelID

Definition at line 271 of file LHCbID.h.

References channelID(), and isST().

00272 {
00273 
00274   return isST() ? ( ((channelID()&0xFFFF000)<<4)+(channelID()&0xFFF) ) : 0xF0000000;
00275          
00276 }

VeloChannelID LHCbID::veloID  )  const [inline]
 

return the VeloChannelID

Definition at line 257 of file LHCbID.h.

References channelID(), and isVelo().

00258 {
00259 
00260   return isVelo() ? channelID() : 0x0;
00261          
00262 }


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  str,
const LHCbID obj
[friend]
 

Operator overloading for stringoutput.

Definition at line 206 of file LHCbID.h.

00208 {
00209   return obj.fillStream(str);
00210 }


Member Data Documentation

unsigned int LHCbID::m_lhcbID [private]
 

the internal representation

Definition at line 154 of file LHCbID.h.

Referenced by channelID(), detectorType(), fillStream(), lhcbID(), LHCbID(), setChannelID(), setDetectorType(), setSpareBits(), and spareBits().


The documentation for this class was generated from the following file:
Generated on Thu Apr 7 22:43:29 2005 for New Track Event Model by doxygen 1.4.1