#ifndef CC2Q_STORABLE_HH #define CC2Q_STORABLE_HH /****************************************************************************** * CC2Q_Storable class header file * * * *****************************************************************************/ #include #include #include #include //--------------- // C++ Headers -- //--------------- #include "CalorObjects/CC2Q.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 CC2Q_Storable; // needed for global typedefs //-------------------------------------------------------- // Global typedef's for EDM2 Handles for the collection -- //-------------------------------------------------------- typedef Handle CC2Q_Storable_h; typedef ConstHandle CC2Q_Storable_ch; class CC2Q_Storable : public StorableObject { public: //-------------------------------------------------------------------------- // typedef's for the collection //-------------------------------------------------------------------------- typedef CC2Q value_type; typedef CC2Q& reference; typedef const CC2Q& const_reference; typedef CC2Q* pointer; typedef const CC2Q* const_pointer; typedef std::vector cc2qVector; typedef cc2qVector::iterator iterator; typedef cc2qVector::const_iterator const_iterator; typedef std::vector::difference_type difference_type; //maybe this can be used? 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(CC2Q_Storable_ch & setHandle); static Error find(CC2Q_Storable_ch & setHandle, const StorableObject::Selector & selector ); //-------------------------------------------------------------------------- // Constructors //-------------------------------------------------------------------------- // Default constructor : CC2Q_Storable(); //Copy constructor : CC2Q_Storable(const CC2Q_Storable& rhs); //-------------------------------------------------------------------------- // Access to the underlying set of tracks. //-------------------------------------------------------------------------- cc2qVector& contents() { return _container.contents(); } const cc2qVector& 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; //CP2D's // virtual void print(std::ostream& output = std::cout) const; // virtual void print(const GenericGrandBankIterI2s1& iter) const; // virtual void print(const GenericBlockIterI2s1& iter) const; protected: // Destructor virtual ~CC2Q_Storable(); private: //-------------------------------------------------------------------------- // Private data //-------------------------------------------------------------------------- ValueVector _container; ClassDef(CC2Q_Storable, 2) }; #endif //