#ifndef CESQ_STORABLE_HH #define CESQ_STORABLE_HH /****************************************************************************** * CESQ_Storable class header file * * * *****************************************************************************/ #include #include #include #include //--------------- // C++ Headers -- //--------------- #include "CalorObjects/CESQ.hh" #include "Edm/ConstHandle.hh" #include "Edm/Handle.hh" #include "Edm/StorableObject.hh" #include "StorableContainers/ValueVector.hh" // Root headers: #include "Rtypes.h" //---------------------------------- // Forward Declaration of Classes -- //---------------------------------- class CESQ_Storable; // needed for global typedefs //-------------------------------------------------------- // Global typedef's for EDM2 Handles for the collection -- //-------------------------------------------------------- typedef Handle CESQ_Storable_h; typedef ConstHandle CESQ_Storable_ch; class CESQ_Storable : public StorableObject { public: //-------------------------------------------------------------------------- // typedef's for the collection //-------------------------------------------------------------------------- typedef CESQ value_type; typedef CESQ& reference; typedef const CESQ& const_reference; typedef CESQ* pointer; typedef const CESQ* const_pointer; typedef std::vector cesqVector; typedef cesqVector::iterator iterator; typedef cesqVector::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 Error find(CESQ_Storable_ch & setHandle); static Error find(CESQ_Storable_ch & setHandle, const StorableObject::Selector & selector ); //-------------------------------------------------------------------------- // Constructors //-------------------------------------------------------------------------- // Default constructor : CESQ_Storable(); //Copy constructor : CESQ_Storable(const CESQ_Storable& rhs); //-------------------------------------------------------------------------- // Access to the underlying set of tracks. //-------------------------------------------------------------------------- cesqVector& contents() { return _container.contents(); } const cesqVector& contents() const { return _container.contents(); } //-------------------------------------------------------------------------- // EDM: functions required by StorableObject //-------------------------------------------------------------------------- virtual std::string class_name() const ; virtual Version_t class_version() const; // void Streamer(TBuffer& buf); // Declared by ClassDef() bool postread(EventRecord* p); bool prewrite(EventRecord* p); bool activate(EventRecord* p); bool deactivate(EventRecord* p); // Destructors virtual void destroy(); virtual void deallocate(); void print(std::ostream& os = std::cout) const; protected: // Destructor virtual ~CESQ_Storable(); private: //-------------------------------------------------------------------------- // Private data //-------------------------------------------------------------------------- ValueVector _container; ClassDef(CESQ_Storable, 2) }; #endif //