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 spareBits () const
 retrieve the spare bits
void setSpareBits (unsigned int value)
 set the spare bits
unsigned int channelID () const
 retrieve the channelID
void setChannelID (unsigned int value)
 set the channelID
unsigned int lhcbID () const
 Retrieve const the internal representation.
unsigned int detectorType () const
 Retrieve the LHCb detector type bits.
void setDetectorType (unsigned int value)
 Update the LHCb detector type bits.

Private Types

enum  channelIDType {
  veloType = 1, stType, otType, richType,
  caloType, muonType
}
 types of sub-detector channel ID More...
enum  lhcbIDBits { detectorTypeBits = 0, channelIDBits = 4, spareBitsBits = 28 }
 Offsets of bitfield lhcbID. More...
enum  lhcbIDMasks { detectorTypeMask = 0xFL, channelIDMask = 0xFFFFFF0L, spareBitsMask = 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 Fri Mar 4 16:52:48 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 131 of file LHCbID.h.

00131                     { veloType=1,
00132                       stType,
00133                       otType,
00134                       richType,
00135                       caloType,
00136                       muonType };

enum LHCbID::lhcbIDBits [private]
 

Offsets of bitfield lhcbID.

Enumeration values:
detectorTypeBits 
channelIDBits 
spareBitsBits 

Definition at line 139 of file LHCbID.h.

00139                  {detectorTypeBits = 0,
00140                   channelIDBits    = 4,
00141                   spareBitsBits    = 28};

enum LHCbID::lhcbIDMasks [private]
 

Bitmasks for bitfield lhcbID.

Enumeration values:
detectorTypeMask 
channelIDMask 
spareBitsMask 

Definition at line 144 of file LHCbID.h.

00144                   {detectorTypeMask = 0xFL,
00145                    channelIDMask    = 0xFFFFFF0L,
00146                    spareBitsMask    = 0xF0000000L};


Constructor & Destructor Documentation

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

Constructor from VeloChannelID.

Definition at line 159 of file LHCbID.h.

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

00159                                                  : m_lhcbID(0) 
00160 {
00161 
00162   setDetectorType( veloType );
00163   setChannelID( chanID );
00164           
00165 }

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

Constructor from ITChannelID.

Definition at line 167 of file LHCbID.h.

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

00167                                                : m_lhcbID(0) 
00168 {
00169 
00170   setDetectorType( stType );
00171   setChannelID( ((chanID.uniqueWafer()-1)>>4) + (chanID.strip()-1) );
00172           
00173 }

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

Constructor from OTChannelID.

Definition at line 175 of file LHCbID.h.

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

00175                                                : m_lhcbID(0) 
00176 {
00177 
00178   setDetectorType( otType );
00179   setChannelID( chanID );
00180         
00181 }

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

Constructor from RichSmartID.

Definition at line 183 of file LHCbID.h.

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

00183                                                : m_lhcbID(0) 
00184 {
00185 
00186   unsigned int richData = chanID.dataBitsOnly();
00187   if( chanID.pixelDataAreValid() ) richData += 0x8000000;
00188   setDetectorType( richType );
00189   setChannelID( richData );
00190          
00191 }

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

Constructor from CaloCellID.

Definition at line 193 of file LHCbID.h.

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

00193                                               : m_lhcbID(0) 
00194 {
00195 
00196   setDetectorType( caloType );
00197   setChannelID( chanID.ccid() );
00198          
00199 }

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 306 of file LHCbID.h.

References channelID(), and isCalo().

00307 {
00308 
00309   return isCalo() ? channelID() : 0xF0000000;
00310          
00311 }

unsigned int LHCbID::channelID  )  const [inline]
 

retrieve the channelID

Definition at line 331 of file LHCbID.h.

References channelIDBits, channelIDMask, isOT(), isVelo(), m_lhcbID, and spareBitsMask.

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

00332 {
00333 
00334   unsigned int mask = channelIDMask | spareBitsMask;
00335   if ( isVelo() || isOT() ) mask = channelIDMask;
00336   return (unsigned int)((m_lhcbID & mask) >> channelIDBits);
00337          
00338 }

unsigned int LHCbID::detectorType  )  const [inline]
 

Retrieve the LHCb detector type bits.

Definition at line 219 of file LHCbID.h.

References detectorTypeBits, detectorTypeMask, and m_lhcbID.

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

00220 {
00221   return (unsigned int)((m_lhcbID & detectorTypeMask) >> detectorTypeBits);
00222 }

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

Fill the ASCII output stream.

Definition at line 207 of file LHCbID.h.

References m_lhcbID.

00208 {
00209   s << "{ " << "lhcbID :        " << m_lhcbID << std::endl << " }";
00210   return s;
00211 }

bool LHCbID::isCalo  )  const [inline]
 

return true if this is a Calo identifier

Definition at line 299 of file LHCbID.h.

References caloType, and detectorType().

Referenced by caloID().

00300 {
00301 
00302   return (caloType == detectorType()) ? true : false;
00303          
00304 }

bool LHCbID::isOT  )  const [inline]
 

return true if this is a Outer Tracker identifier

Definition at line 266 of file LHCbID.h.

References detectorType(), and otType.

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

00267 {
00268 
00269   return (otType == detectorType()) ? true : false;
00270          
00271 }

bool LHCbID::isRich  )  const [inline]
 

return true if this is a Rich identifier

Definition at line 280 of file LHCbID.h.

References detectorType(), and richType.

Referenced by richID().

00281 {
00282 
00283   return (richType == detectorType()) ? true : false;
00284          
00285 }

bool LHCbID::isST  )  const [inline]
 

return true if this is a Silicon Tracker identifier

Definition at line 252 of file LHCbID.h.

References detectorType(), and stType.

Referenced by stID().

00253 {
00254 
00255   return (stType == detectorType()) ? true : false;
00256          
00257 }

bool LHCbID::isVelo  )  const [inline]
 

return true if this is a Velo identifier

Definition at line 238 of file LHCbID.h.

References detectorType(), and veloType.

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

00239 {
00240 
00241   return (veloType == detectorType()) ? true : false;
00242          
00243 }

unsigned int LHCbID::lhcbID  )  const [inline]
 

Retrieve const the internal representation.

Definition at line 214 of file LHCbID.h.

References m_lhcbID.

Referenced by TrFitTrack2TrackCnv::execute().

00215 {
00216   return m_lhcbID;
00217 }

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

comparison equality

Definition at line 231 of file LHCbID.h.

00232 {
00233 
00234   return (this->lhcbID() == chanID.lhcbID());
00235          
00236 }

OTChannelID LHCbID::otID  )  const [inline]
 

return the OTChannelID

Definition at line 273 of file LHCbID.h.

References channelID(), and isOT().

00274 {
00275 
00276   return isOT() ? channelID() : 0xF0000000;
00277          
00278 }

RichSmartID LHCbID::richID  )  const [inline]
 

return the richSmartID

Definition at line 287 of file LHCbID.h.

References channelID(), and isRich().

00288 {
00289 
00290   unsigned int rID = 0;
00291   if( isRich() ) {
00292     rID = channelID() & 0x7000000;
00293     if( channelID() && 0x8000000 ) rID += 0x7E000000;
00294   }
00295   return rID;
00296          
00297 }

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

set the channelID

Definition at line 340 of file LHCbID.h.

References channelIDBits, channelIDMask, isOT(), isVelo(), m_lhcbID, and spareBitsMask.

Referenced by LHCbID().

00341 {
00342 
00343   unsigned int mask = channelIDMask | spareBitsMask;
00344   if ( isVelo() || isOT() ) mask = channelIDMask;
00345   unsigned int val = (unsigned int)value;
00346   m_lhcbID &= ~mask;
00347   m_lhcbID |= ((((unsigned int)val) << channelIDBits) & mask);
00348          
00349 }

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

Update the LHCb detector type bits.

Definition at line 224 of file LHCbID.h.

References detectorTypeBits, detectorTypeMask, and m_lhcbID.

Referenced by LHCbID().

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

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

set the spare bits

Definition at line 321 of file LHCbID.h.

References isOT(), isVelo(), m_lhcbID, spareBitsBits, and spareBitsMask.

Referenced by TrFitTrack2TrackCnv::execute().

00322 {
00323 
00324   if ( !( isVelo() || isOT() ) ) return;
00325   unsigned int val = (unsigned int)value;
00326   m_lhcbID &= ~spareBitsMask;
00327   m_lhcbID |= ((((unsigned int)val) << spareBitsBits) & spareBitsMask);
00328          
00329 }

unsigned int LHCbID::spareBits  )  const [inline]
 

retrieve the spare bits

Definition at line 313 of file LHCbID.h.

References isOT(), isVelo(), m_lhcbID, spareBitsBits, and spareBitsMask.

Referenced by TrFitTrack2TrackCnv::execute().

00314 {
00315 
00316   if ( !( isVelo() || isOT() ) ) return 0;
00317   return (unsigned int)((m_lhcbID & spareBitsMask) >> spareBitsBits);
00318          
00319 }

ITChannelID LHCbID::stID  )  const [inline]
 

return the ITChannelID

Definition at line 259 of file LHCbID.h.

References channelID(), and isST().

00260 {
00261 
00262   return isST() ? ( ((channelID()&0xFFFF000)<<4)+(channelID()&0xFFF) ) : 0xF0000000;
00263          
00264 }

VeloChannelID LHCbID::veloID  )  const [inline]
 

return the VeloChannelID

Definition at line 245 of file LHCbID.h.

References channelID(), and isVelo().

00246 {
00247 
00248   return isVelo() ? channelID() : 0x0;
00249          
00250 }


Friends And Related Function Documentation

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

Operator overloading for stringoutput.

Definition at line 201 of file LHCbID.h.

00203 {
00204   return obj.fillStream(str);
00205 }


Member Data Documentation

unsigned int LHCbID::m_lhcbID [private]
 

the internal representation

Definition at line 149 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 Mon Apr 4 12:38:53 2005 for New Track Event Model by doxygen 1.4.1