#ifndef CC2Q_HH #define CC2Q_HH /******************************************************************* Description: CC2Q class header file CC2Q is a Streamable Object Author List: 10/14/2004 Else Lytken : created Revision History: *******************************************************************/ #include #include "Edm/StreamableObject.hh" #include "Rtypes.h" #include "EdmUtilities/BitMask.hh" class CC2Q; typedef unsigned short int uint2; class CC2Q : public StreamableObject { public: CC2Q(); CC2Q( const CC2Q& ); // Copy Constructor CC2Q( uint2 Chid, uint2 Energy); virtual ~CC2Q(){} void print(std::ostream& = std::cout ) const; uint2 chid() const; uint2 energy() const; int module() const; int padNo() const; int we() const; /*=========================================================================*\ * StreamableObject requirements // \*=========================================================================*/ void Streamer(TBuffer& iobuffer) ; virtual bool postread( EventRecord* p_record) ; virtual bool prewrite( EventRecord* p_record) ; //----------------------------------------------------------------------------- // Enumerated constants describing the start word/cluster width bitfields //----------------------------------------------------------------------------- // identical to CCRD_StorableBank enum { pad_nbits = 4, pad_mask = BitMask::nbits04, pad_shift = 0, pad_loval = 0, pad_hival = pad_mask }; enum { westeast_nbits = 1, westeast_mask = BitMask::nbits01, westeast_shift = 4, westeast_loval = 0, westeast_hival = westeast_mask }; enum { module_nbits = 5, module_mask = BitMask::nbits05, module_shift = 8, module_loval = 0, module_hival = module_mask }; private: uint2 _chid; uint2 _energy; }; inline uint2 CC2Q::chid() const{ return(_chid);} inline std::ostream& operator << (std::ostream& os, const CC2Q& inter) { inter.print(os); return os; } inline int CC2Q::module() const { return( (_chid >> module_shift) & module_mask ) ; } inline int CC2Q::padNo() const { return( (_chid >> pad_shift) & pad_mask ) ; } inline int CC2Q::we() const { return( (_chid >> westeast_shift) & westeast_mask ) ; } inline uint2 CC2Q::energy() const { return(_energy); } #endif