#ifndef PESQ_Coll_hh #define PESQ_Coll_hh /** \class PESQ_Coll This class holds all of the corrected, integerized strips for an event. \author Benn Tannenbaum benn@physics.ucla.edu I have no idea what most of these things do. They are copied from other, existing collections. It works! That's all I can say. \date 1 November 2001 Benn Tannenbaum Changed from a StorableObject to a Streamable Object */ #include "CalorObjects/PESQ.hh" #include #include "TBuffer.h" #include "Edm/ConstHandle.hh" #include "Edm/Handle.hh" #include "Edm/StorableObject.hh" #include "StorableContainers/ValueVector.hh" //---------------------------------- // Forward Declaration of Classes -- //---------------------------------- class PESQ_Coll; // needed for global typedefs //-------------------------------------------------------- // Global typedef's for EDM2 Handles for the collection -- //-------------------------------------------------------- typedef Handle PESQ_Coll_h; typedef ConstHandle PESQ_Coll_ch; typedef std::vector PESQ_List; class PESQ_Coll : public StorableObject { public: //-------------------------------------------------------------------------- // typedef's for the collection //-------------------------------------------------------------------------- PESQ_List& contents(); const PESQ_List& contents() const; typedef PESQ value_type; typedef PESQ& reference; typedef const PESQ& const_reference; typedef PESQ* pointer; typedef const PESQ* const_pointer; typedef std::vector PESQVector; typedef PESQVector::iterator iterator; typedef PESQVector::const_iterator const_iterator; typedef std::vector::difference_type difference_type; typedef std::vector::size_type size_type; typedef std::vector CollType; typedef CollType collection_type; //-------------------------------------------------------------------------- // Functions to retrieve the collection from the event //-------------------------------------------------------------------------- enum Error{ERROR,OK}; static PESQ_Coll::Error find(PESQ_Coll_ch&); static PESQ_Coll::Error find(PESQ_Coll_ch&, const std::string& description); // Default constructor : PESQ_Coll(); //Copy constructor : PESQ_Coll(const PESQ_Coll& rhs); // Destructor virtual ~PESQ_Coll(){}; // Accessors/Setters: float GetMaxEnergy() const {return _maxEnergy;} float GetThreshold() const {return _threshold;} void SetMaxEnergy(float maxEne) {_maxEnergy = maxEne;} void SetThreshold(float thresh) {_threshold = thresh;} //-------------------------------------------------------------------------- // EDM: functions required by StorableObject //-------------------------------------------------------------------------- virtual std::string class_name(void) const ; virtual Version_t class_version(void) const; virtual void print(std::ostream& os) const; // void Streamer(TBuffer& buf); // Declared by ClassDef() virtual bool postread(EventRecord* p); virtual bool prewrite(EventRecord* p); virtual bool activate(EventRecord* p); virtual bool deactivate(EventRecord* p); void readFromBuffer(TBuffer& iobuffer); void writeToBuffer(TBuffer& iobuffer); // Destructors virtual void destroy(void); virtual void deallocate(void); private: // This is the maximum energy for strips in the collection. // Used in converting energies from float to short int and vice versa. Float_t _maxEnergy; // This is the energy threshold of strips written to the collection, // for later reference. Float_t _threshold; ValueVector _container; ClassDef(PESQ_Coll, 2) }; #endif