1 #ifndef CellIDEncoder_h
2 #define CellIDEncoder_h 1
4 #include "EVENT/LCCollection.h"
5 #include "UTIL/BitField64.h"
6 #include "IMPL/LCFlagImpl.h"
14 class SimCalorimeterHit ;
15 class RawCalorimeterHit ;
16 class CalorimeterHit ;
19 class TrackerRawData ;
22 class TrackerHitPlane ;
23 class TrackerHitZCylinder ;
36 template<>
int CellIDEncoder_cellID1Bit<EVENT::SimCalorimeterHit>() ;
39 template<>
int CellIDEncoder_cellID1Bit<EVENT::RawCalorimeterHit>() ;
42 template<>
int CellIDEncoder_cellID1Bit<EVENT::CalorimeterHit>() ;
45 template<>
int CellIDEncoder_cellID1Bit<EVENT::TrackerData>() ;
48 template<>
int CellIDEncoder_cellID1Bit<EVENT::TrackerPulse>() ;
51 template<>
int CellIDEncoder_cellID1Bit<EVENT::TrackerRawData>() ;
54 template<>
int CellIDEncoder_cellID1Bit<EVENT::TrackerHit>() ;
57 template<>
int CellIDEncoder_cellID1Bit<EVENT::TrackerHitPlane>() ;
60 template<>
int CellIDEncoder_cellID1Bit<EVENT::TrackerHitZCylinder>() ;
63 template<>
int CellIDEncoder_cellID1Bit<EVENT::SimTrackerHit>() ;
71 hit->setCellID0( low ) ;
72 hit->setCellID1( high ) ;
117 inline void setCellID( T* hit) {
126 int bit = CellIDEncoder_cellID1Bit<typename T::lcobject_type>() ;
unsigned highestBit() const
Highest bit used in fields [0-63].
Definition: BitField64.cc:109
CellIDEncoder(const std::string &cellIDEncoding, EVENT::LCCollection *col)
Constructor, sets collection parameter LCIO::CellIDEncoding to the given encoding string...
Definition: CellIDEncoder.h:106
A bit field of 64bits that allows convenient declaration and manipulation of sub fields of various wi...
Definition: BitField64.h:132
virtual void setFlag(int flag)=0
Set the flag word.
virtual int getFlag() const =0
Returns flag word for collection.
virtual LCParameters & parameters()=0
Parameters defined for this collection.
void CellIDEncoder_setCellID(T *hit, int low, int high)
Helper function that sets cellid1 and cellid2.
Definition: CellIDEncoder.h:69
unsigned highWord() const
The high word, bits 32-63.
Definition: BitField64.h:221
Implementation of helper class to create and interpret the 32-bit flag word in LCCollections.
Definition: LCFlagImpl.h:15
virtual void setValue(const std::string &key, int value)=0
Set integer value for the given key.
Specialization for SimTrackerHits that have only one cellID.
Definition: CellIDEncoder.h:100
unsigned lowWord() const
The low word, bits 0-31.
Definition: BitField64.h:217
The generic collection used in LCIO.
Definition: LCCollection.h:29
int CellIDEncoder_cellID1Bit()
Helper function that returns the bit for cellid1 through template specialization or -1 if no cellid1 ...
Definition: CellIDEncoder.h:33
virtual void setBit(int bit)
Sets bit to 1.
Definition: LCFlagImpl.cc:18
void setCellIDFlag()
Helper method that sets/unsets the proper bit for storing a second cellid word.
Definition: CellIDEncoder.h:124