#ifndef CPRQCOLL_HH #define CPRQCOLL_HH /****************************************************************************** Description: A storable object which is a collection of CPRQ object Author List: 01/10/2000 Tania Moulik : created Revision History : *******************************************************************************/ #include #include #include #include //--------------- // C++ Headers -- //--------------- #include "Edm/ConstHandle.hh" #include "Edm/Handle.hh" #include "Edm/StorableObject.hh" #include "StorableContainers/ValueVector.hh" #include "CalorObjects/CPRQ.hh" // Root headers: #include "Rtypes.h" //---------------------------------- // Forward Declaration of Classes -- //---------------------------------- class CPRQColl; // needed for global typedefs //-------------------------------------------------------- // Global typedef's for EDM2 Handles for the collection -- //-------------------------------------------------------- typedef Handle CPRQColl_h; typedef ConstHandle CPRQColl_ch; class CPRQColl : public StorableObject { public: //-------------------------------------------------------------------------- // typedef's for the collection //-------------------------------------------------------------------------- typedef CPRQ value_type; typedef CPRQ& reference; typedef const CPRQ& const_reference; typedef CPRQ* pointer; typedef const CPRQ* const_pointer; typedef std::vector cprqVector; typedef cprqVector::iterator iterator; typedef cprqVector::const_iterator const_iterator; typedef std::vector::difference_type difference_type; typedef std::vector::size_type size_type; //-------------------------------------------------------------------------- // Functions to retrieve the collection from the event //-------------------------------------------------------------------------- enum Error { ERROR, OK }; static Error find(CPRQColl_ch & setHandle); static Error find(CPRQColl_ch & setHandle, const StorableObject::Selector & selector ); //-------------------------------------------------------------------------- // Constructors //-------------------------------------------------------------------------- // Default constructor : CPRQColl(); //Copy constructor : CPRQColl(const CPRQColl& rhs); //-------------------------------------------------------------------------- // Access to the underlying set of tracks. //-------------------------------------------------------------------------- cprqVector& contents() { return _container.contents(); } const cprqVector& 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 ~CPRQColl(); private: //-------------------------------------------------------------------------- // Private data //-------------------------------------------------------------------------- ValueVector _container; ClassDef(CPRQColl, 2) }; #endif //