emcTowerContainerv1.h

Go to the documentation of this file.
00001 #ifndef __EMCTOWERCONTAINERV1_H__
00002 #define __EMCTOWERCONTAINERV1_H__
00003 
00004 #ifndef __EMCTOWERCONTAINER_H__
00005 #include "emcTowerContainer.h"
00006 #endif
00007 #ifndef __EMCTOWERCONTENTV1_H__
00008 #include "emcTowerContentv1.h" 
00009 #endif
00010 // this latter include is needed so the compiler knows that it derives from
00011 // emcTowerContent and so the addTower and getTower methods
00012 // are considered as overriding methods and not overloading or hiding ones.
00013 
00014 class TClonesArray;
00015 
00020 class emcTowerContainerv1 : public emcTowerContainer
00021 {
00022 public:
00023 
00024   emcTowerContainerv1();
00025 
00026   emcTowerContainerv1(const emcTowerContainerv1&);
00027 
00028   emcTowerContainerv1& operator=(const emcTowerContainerv1&);
00029 
00030   emcTowerContainerv1* clone(void) const;
00031 
00032   emcTowerContainerv1* create(void) const;
00033   
00034   virtual ~emcTowerContainerv1();
00035 
00036   unsigned int capacity(void) const;
00037 
00038   emcTowerContentv1* addTower(unsigned int i);
00039 
00040   emcTowerContentv1* addTower(unsigned int i, const emcTowerContent&);
00041 
00042   emcTowerContentv1* findTower(int towerID) const;
00043 
00044   emcTowerContentv1* getTower(unsigned int i) const;
00045 
00046   void identify(std::ostream& os=std::cout) const;
00047 
00048   int isValid() const;
00049 
00050   bool removeTower(unsigned int i);
00051 
00052   void Reset();
00053 
00054   bool resize(unsigned int newsize);
00055 
00056   unsigned int size(void) const;
00057 
00058 protected:
00059 
00060   TClonesArray* fEmcTowers;
00061 
00062 private:
00063   void allocate(unsigned int thesize);
00064   void copy(emcTowerContainerv1& dest) const;
00065 
00066   static const unsigned int fgDefaultSize;
00067   static const unsigned int fgMaxSize;
00068 
00069   ClassDef(emcTowerContainerv1,1) // Array of emcTowerContentv1
00070 };
00071 #endif