Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:56:30

0001 #ifndef __GFHISTARRAY_H
0002 #define __GFHISTARRAY_H
0003 
0004 // ROOT includes
0005 #include <TObjArray.h>
0006 #include <TH1.h>
0007 
0008 class TObject;
0009 
0010 class GFHistArray : public TObjArray{
0011   // FIXME: friends needed?
0012 friend class TObjArrayIter;
0013 friend class TClonesArray;
0014 
0015 public:
0016   explicit GFHistArray(Int_t s = TCollection::kInitCapacity, Int_t lowerBound = 0);
0017   virtual ~GFHistArray();
0018   
0019   //    TObject        **GetObjectRef(TObject *obj) const;
0020 //   void              Add(TObject *obj) { AddLast(hist); }
0021   virtual void     AddFirst(TObject *obj);
0022   virtual void     AddLast(TObject *obj);
0023   virtual void     AddAll(const TCollection *collection);
0024   virtual void     AddAll(const GFHistArray *hists);
0025   virtual void     AddAt(TObject *obj, Int_t idx);
0026   virtual void     AddAtAndExpand(TObject *obj, Int_t idx);
0027   virtual Int_t     AddAtFree(TObject *obj);
0028   virtual void     AddAfter(const TObject *after, TObject *obj);
0029   virtual void     AddBefore(const TObject *before, TObject *obj);
0030   virtual TH1 *RemoveAt(Int_t idx);
0031   virtual TH1 *Remove(TObject *obj);
0032 
0033   TH1         *At(Int_t idx) const;
0034   TH1         *UncheckedAt(Int_t i) const;
0035   TH1         *Before(const TObject *obj) const;
0036   TH1         *After(const TObject *obj) const;
0037   TH1         *First() const;
0038   TH1         *Last() const;
0039   virtual TH1* operator[](Int_t i) const;
0040 //   virtual TH1*&operator[](Int_t i); ??? warum nicht?
0041 
0042 protected:
0043   Bool_t CheckObjOK (TObject * histObj);
0044  private:
0045   virtual TObject*& operator[](Int_t i); // invalidate const version, since cannot be overwritten
0046 
0047   ClassDef(GFHistArray,1) // type safe array of histograms
0048 };
0049 #endif // __GFHISTARRAY_H