#ifndef ExClass_H #define ExClass_H #include "TObject.h" #include "TObjArray.h" #include #ifdef WIN32 using namespace std; #endif // The include file which defines the ROOT class stored in the // example TObjArray - see the m_collection data member below #include "CollectionType.h" /** @class ExClass * @brief Example ROOT class. * * @author Heather Kelly * $Header$ */ class ExClass : public TObject { public: ExClass(); virtual ~ExClass(); /// clear lists, free pointers, etc., after read from / write to file virtual void Clear(Option_t *option =""); /// Initialize all data members except the TObjArray void initialize(UInt_t unsignedIntVal, const vector& intVec); inline UInt_t getUnsignedInt() const { return m_unsignedInt; }; /// add an object to our collection void addCollectionElement(CollectionType *p); /// get an entry from our TObjArray CollectionType* getCollectionElement(Int_t index) const; /// return the whole TObjArray to the caller const TObjArray* getCollection() const { return m_collection; }; inline UInt_t getCollectionCount() const { return ((m_collection) ? m_collection->GetEntries() : 0); }; private: /// Some private data member of this ROOT class UInt_t m_unsignedInt; /// Example TObjArray TObjArray *m_collection; /// static array to allow one-time array creation static TObjArray *m_staticCollection; /// Example STL vector used in a ROOT class vector m_exampleVector; // The number, one, denotes the version number for this class. // Initially, we start on version 1. // If later we make changes the this class (and we have already started // generating ROOT files using the old class definition - then // increment the version number. ClassDef(ExClass,1) }; #endif