CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GFHistArray.h
Go to the documentation of this file.
1 #ifndef __GFHISTARRAY_H
2 #define __GFHISTARRAY_H
3 
4 // ROOT includes
5 #include <TObjArray.h>
6 #include <TH1.h>
7 
8 class TObject;
9 
10 class GFHistArray : public TObjArray{
11  // FIXME: friends needed?
12 friend class TObjArrayIter;
13 friend class TClonesArray;
14 
15 public:
16  explicit GFHistArray(Int_t s = TCollection::kInitCapacity, Int_t lowerBound = 0);
17  virtual ~GFHistArray();
18 
19  // TObject **GetObjectRef(TObject *obj) const;
20 // void Add(TObject *obj) { AddLast(hist); }
21  virtual void AddFirst(TObject *obj);
22  virtual void AddLast(TObject *obj);
23  virtual void AddAll(const TCollection *collection);
24  virtual void AddAll(const GFHistArray *hists);
25  virtual void AddAt(TObject *obj, Int_t idx);
26  virtual void AddAtAndExpand(TObject *obj, Int_t idx);
27  virtual Int_t AddAtFree(TObject *obj);
28  virtual void AddAfter(const TObject *after, TObject *obj);
29  virtual void AddBefore(const TObject *before, TObject *obj);
30  virtual TH1 *RemoveAt(Int_t idx);
31  virtual TH1 *Remove(TObject *obj);
32 
33  TH1 *At(Int_t idx) const;
34  TH1 *UncheckedAt(Int_t i) const;
35  TH1 *Before(const TObject *obj) const;
36  TH1 *After(const TObject *obj) const;
37  TH1 *First() const;
38  TH1 *Last() const;
39  virtual TH1* operator[](Int_t i) const;
40 // virtual TH1*&operator[](Int_t i); ??? warum nicht?
41 
42 protected:
43  Bool_t CheckObjOK (TObject * histObj);
44  private:
45  virtual TObject*& operator[](Int_t i); // invalidate const version, since cannot be overwritten
46 
47  ClassDef(GFHistArray,1) // type safe array of histograms
48 };
49 #endif // __GFHISTARRAY_H
virtual void AddBefore(const TObject *before, TObject *obj)
virtual TH1 * Remove(TObject *obj)
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
virtual void AddAt(TObject *obj, Int_t idx)
GFHistArray(Int_t s=TCollection::kInitCapacity, Int_t lowerBound=0)
friend class TObjArrayIter
Definition: GFHistArray.h:12
TH1 * Before(const TObject *obj) const
TH1 * At(Int_t idx) const
TH1 * Last() const
TH1 * First() const
virtual void AddFirst(TObject *obj)
virtual TH1 * RemoveAt(Int_t idx)
virtual Int_t AddAtFree(TObject *obj)
Bool_t CheckObjOK(TObject *histObj)
TH1 * UncheckedAt(Int_t i) const
virtual void AddAll(const TCollection *collection)
virtual TH1 * operator[](Int_t i) const
list hists
Definition: compare.py:318
virtual void AddAfter(const TObject *after, TObject *obj)
friend class TClonesArray
Definition: GFHistArray.h:13
virtual ~GFHistArray()
TH1 * After(const TObject *obj) const
virtual void AddLast(TObject *obj)