#include <LHCbID.h>
Public Member Functions | |
LHCbID (const VeloChannelID &chanID, const unsigned int size=0) | |
Constructor from VeloChannelID and optional size. | |
LHCbID (const ITChannelID &chanID, const unsigned int size=0) | |
Constructor from ITChannelID and optional size. | |
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 |
Returns the ChannelID part, for printing... | |
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 | setID (unsigned int value) |
Update the ID bits (to recreate the channelID). | |
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, stMask = 0x3FFFFFFL, otMask = 0x3FFFFFFL } |
enumeration of the specific mask More... | |
enum | SpecificBits { veloBits = 21, stBits = 26, 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 { IDBits = 0, detectorTypeBits = 28 } |
Offsets of bitfield lhcbID. More... | |
enum | lhcbIDMasks { IDMask = 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. |
Definition at line 40 of file LHCbID.h.
|
types of sub-detector channel ID
Definition at line 142 of file LHCbID.h.
|
|
Offsets of bitfield lhcbID.
Definition at line 150 of file LHCbID.h. 00150 {IDBits = 0, 00151 detectorTypeBits = 28};
|
|
Bitmasks for bitfield lhcbID.
Definition at line 154 of file LHCbID.h. 00154 {IDMask = 0xFFFFFFFL, 00155 detectorTypeMask = 0xF0000000L};
|
|
enumeration of the specific bits
Definition at line 135 of file LHCbID.h.
|
|
enumeration of the specific mask
Definition at line 131 of file LHCbID.h.
|
|
Constructor from VeloChannelID and optional size.
Definition at line 168 of file LHCbID.h. References detectorTypeBits, m_lhcbID, veloBits, and veloType. 00170 { 00171 00172 m_lhcbID = (veloType << detectorTypeBits) + 00173 (size << veloBits ) + 00174 chanID; 00175 00176 }
|
|
Constructor from ITChannelID and optional size.
Definition at line 178 of file LHCbID.h. References detectorTypeBits, m_lhcbID, stBits, and stType. 00180 { 00181 00182 m_lhcbID = (stType << detectorTypeBits) + 00183 (size << stBits ) + 00184 ((chanID.uniqueWafer()-1) >>6) + 00185 (chanID.strip()-1) ; 00186 00187 }
|
|
Constructor from OTChannelID.
Definition at line 189 of file LHCbID.h. References detectorTypeBits, m_lhcbID, and otType. 00190 { 00191 00192 m_lhcbID = (otType << detectorTypeBits) + chanID; 00193 00194 }
|
|
Constructor from RichSmartID.
Definition at line 196 of file LHCbID.h. References richType, setDetectorType(), and setID(). 00196 : m_lhcbID(0) 00197 { 00198 00199 unsigned int richData = chanID.dataBitsOnly(); 00200 if( chanID.pixelDataAreValid() ) richData += 0x8000000; 00201 setDetectorType( richType ); 00202 setID( richData ); 00203 00204 }
|
|
Constructor from CaloCellID.
Definition at line 206 of file LHCbID.h. References caloType, setDetectorType(), and setID(). 00206 : m_lhcbID(0) 00207 { 00208 00209 setDetectorType( caloType ); 00210 setID( chanID.ccid() ); 00211 00212 }
|
|
Default Constructor.
Definition at line 62 of file LHCbID.h. References m_lhcbID. 00062 : m_lhcbID(0) {}
|
|
Default Destructor.
Definition at line 65 of file LHCbID.h. 00065 {}
|
|
return the CaloCellID
Definition at line 327 of file LHCbID.h. References IDMask, isCalo(), and m_lhcbID.
|
|
Returns the ChannelID part, for printing...
Definition at line 334 of file LHCbID.h. References IDMask, and m_lhcbID. Referenced by TrFitTrack2TrackCnv::execute().
|
|
Retrieve the LHCb detector type bits.
Definition at line 239 of file LHCbID.h. References detectorTypeBits, detectorTypeMask, and m_lhcbID. Referenced by TrFitTrack2TrackCnv::execute(), isCalo(), isOT(), isRich(), isST(), and isVelo(). 00240 { 00241 return (unsigned int)((m_lhcbID & detectorTypeMask) >> detectorTypeBits); 00242 }
|
|
Fill the ASCII output stream.
Definition at line 220 of file LHCbID.h. References m_lhcbID. 00221 { 00222 s << "{ " << "lhcbID : " << m_lhcbID << std::endl << " }"; 00223 return s; 00224 }
|
|
return true if this is a Calo identifier
Definition at line 320 of file LHCbID.h. References caloType, and detectorType(). Referenced by caloID(). 00321 { 00322 00323 return (caloType == detectorType()); 00324 00325 }
|
|
return true if this is a Outer Tracker identifier
Definition at line 288 of file LHCbID.h. References detectorType(), and otType. Referenced by otID(), setSpareBits(), and spareBits(). 00289 { 00290 00291 return (otType == detectorType()); 00292 00293 }
|
|
return true if this is a Rich identifier
Definition at line 303 of file LHCbID.h. References detectorType(), and richType. Referenced by richID(). 00304 { 00305 00306 return (richType == detectorType()); 00307 00308 }
|
|
return true if this is a Silicon Tracker identifier
Definition at line 273 of file LHCbID.h. References detectorType(), and stType. Referenced by setSpareBits(), spareBits(), and stID(). 00274 { 00275 00276 return (stType == detectorType()); 00277 00278 }
|
|
return true if this is a Velo identifier
Definition at line 258 of file LHCbID.h. References detectorType(), and veloType. Referenced by setSpareBits(), spareBits(), and veloID(). 00259 { 00260 00261 return (veloType == detectorType()); 00262 00263 }
|
|
Retrieve const the internal representation.
Definition at line 227 of file LHCbID.h. References m_lhcbID. Referenced by TrFitTrack2TrackCnv::execute(). 00228 { 00229 return m_lhcbID; 00230 }
|
|
comparison equality
Definition at line 251 of file LHCbID.h. 00252 { 00253 00254 return (this->lhcbID() == chanID.lhcbID()); 00255 00256 }
|
|
return the OTChannelID
Definition at line 295 of file LHCbID.h. References isOT(), m_lhcbID, and otMask. 00296 { 00297 00298 if ( !isOT() ) return 0xF0000000; 00299 return m_lhcbID & otMask; 00300 00301 }
|
|
return the richSmartID
Definition at line 310 of file LHCbID.h. References IDMask, isRich(), and m_lhcbID. 00311 { 00312 00313 if ( !isRich() ) return 0x0; 00314 int id = m_lhcbID & IDMask; 00315 if( id && 0x8000000 ) id = id | 0x7E000000; 00316 return id; 00317 00318 }
|
|
Update the LHCb detector type bits.
Definition at line 244 of file LHCbID.h. References detectorTypeBits, detectorTypeMask, and m_lhcbID. Referenced by LHCbID(). 00245 { 00246 unsigned int val = (unsigned int)value; 00247 m_lhcbID &= ~detectorTypeMask; 00248 m_lhcbID |= ((((unsigned int)val) << detectorTypeBits) & detectorTypeMask); 00249 }
|
|
Update the ID bits (to recreate the channelID).
Definition at line 232 of file LHCbID.h. References IDBits, IDMask, and m_lhcbID. Referenced by LHCbID(). 00233 { 00234 unsigned int val = (unsigned int)value; 00235 m_lhcbID &= ~IDMask; 00236 m_lhcbID |= ((((unsigned int)val) << IDBits) & IDMask); 00237 }
|
|
set the spare bits
Definition at line 341 of file LHCbID.h. References IDBits, IDMask, isOT(), isST(), isVelo(), m_lhcbID, otBits, otMask, stBits, stMask, veloBits, and veloMask. Referenced by TrFitTrack2TrackCnv::execute(), and OTMeasurement::OTMeasurement(). 00342 { 00343 00344 if ( !( isVelo() || isOT() || isST() ) ) return; 00345 unsigned int mask = IDMask; 00346 unsigned int bits = IDBits; 00347 if (isVelo()) { 00348 mask &= (~veloMask); 00349 bits = veloBits; 00350 } else if (isST()) { 00351 mask &= (~stMask); 00352 bits = stBits; 00353 } else if (isOT()) { 00354 mask &= (~otMask); 00355 bits = otBits; 00356 } 00357 m_lhcbID &= ~mask; 00358 m_lhcbID |= ((value << bits) & mask); 00359 00360 }
|
|
retrieve the spare bits
Definition at line 362 of file LHCbID.h. References IDBits, IDMask, isOT(), isST(), isVelo(), m_lhcbID, otBits, otMask, stBits, stMask, veloBits, and veloMask. Referenced by TrFitTrack2TrackCnv::execute(). 00363 { 00364 00365 if ( !( isVelo() || isOT() || isST()) ) return 0; 00366 unsigned int mask = IDMask; 00367 unsigned int bits = IDBits; 00368 if (isVelo()) { 00369 mask &= (~veloMask); 00370 bits = veloBits; 00371 } else if (isST()) { 00372 mask &= (~stMask); 00373 bits = stBits; 00374 } else if (isOT()) { 00375 mask &= (~otMask); 00376 bits = otBits; 00377 } 00378 unsigned int val = ((m_lhcbID & mask) >> bits); 00379 return val; 00380 00381 }
|
|
return the ITChannelID
Definition at line 280 of file LHCbID.h. References isST(), and m_lhcbID. 00281 { 00282 00283 if ( !isST() ) return 0xF0000000; 00284 return ( ( (m_lhcbID & 0x3FFFC00 ) << 6) + ( m_lhcbID & 0x3FF)); 00285 00286 }
|
|
return the VeloChannelID
Definition at line 265 of file LHCbID.h. References isVelo(), m_lhcbID, and veloMask. 00266 { 00267 00268 if ( !isVelo() ) return 0xF0000000; 00269 return ( m_lhcbID & veloMask ); 00270 00271 }
|
|
Operator overloading for stringoutput.
Definition at line 214 of file LHCbID.h. 00216 { 00217 return obj.fillStream(str); 00218 }
|
|
the internal representation
Definition at line 158 of file LHCbID.h. Referenced by caloID(), channelID(), detectorType(), fillStream(), lhcbID(), LHCbID(), otID(), richID(), setDetectorType(), setID(), setSpareBits(), spareBits(), stID(), and veloID(). |