#ifndef _PESQ_HH_ #define _PESQ_HH_ /** \class PESQ Holds a single corrected strip in integer form. A PAD. At present the bank is uncompressed, however, in the future the bank will be compressed. Note that one can vary the numbers of PESQ banks stored thought a talk-to from the PESQ_Module. \author Benn Tannenbaum benn@physics.ucla.edu \date 25 August 2000 \date 1 November 2001 Benn Tannenbaum Changed from a StreamableObject to a StorableObject to reduce CPU overhead and disk usage. \date 1 November 2001 Benn Tannenbaum Changed theLocation and theEnergy from int to unsigned short int to reduce size. */ #include #include #include #include "Edm/StreamableObject.hh" #include "Rtypes.h" #include "TBuffer.h" class EventRecord; // Class Declaration class PESQ : public StreamableObject { public: PESQ(); // Default Constructor PESQ( const PESQ& ); // Copy Constructor #ifndef __CINT__ PESQ( int address, int nstrips, std::vector energies ); #endif ~PESQ(); PESQ& operator = (const PESQ&); bool operator == (const PESQ&) const; bool operator != (const PESQ&) const; /*=========================================================================*\ * StreamableObject requirements \*=========================================================================*/ void Streamer(TBuffer& iobuffer) ; bool postread( EventRecord* p_record) ; bool prewrite( EventRecord* p_record) ; void print(std::ostream& os = std::cout) const ; // VERSION INFORMATION : static Version_t class_version() {return _VERSION;} static Version_t read_version() {return _READ_VERSION;} static void set_read_version(int ver) {_READ_VERSION = ver;} /** returns the address*/ inline int Address() const {return _address;} /** returns the plug. 1 = east, 0 = west*/ inline int Plug() const {return (_address >> 12) & 1;} /** returns the layer*/ inline int Layer() const {return (_address >> 11) & 1;} /** returns octant number*/ inline int Octant() const {return (_address >> 8) & 7;} /** returns the strip*/ inline int FirstStrip() const {return _address & 255;} /** returns the number of strips*/ inline int NStrips() const {return _nstrips;} /**returns the energy of one strip*/ inline int Energy(int strip) const {return _energies[strip];} //=========================================================================== // Private section //=========================================================================== private: // unsigned short int _theLocation; // unsigned short int _theEnergy; unsigned short _address; unsigned char _nstrips; // For some reason root doesn't understand vector, // but it's fine with vector. Go figure. #ifndef __CINT__ std::vector _energies; #endif // EDM VERSION : static const Version_t _VERSION; // Version currently being read in: static Version_t _READ_VERSION; friend std::ostream& operator << (std::ostream& os, const PESQ& thePesq); }; #endif // !_PESQ_HH_