]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/EMCAL/AliEmcalContainer.h
expand particle map when needed
[u/mrichter/AliRoot.git] / PWG / EMCAL / AliEmcalContainer.h
1 #ifndef AliEmcalContainer_H
2 #define AliEmcalContainer_H
3
4 //
5 // container with name, TClonesArray
6 //
7
8 class TLorentzVector;
9 class AliVEvent;
10 class AliNamedArrayI;
11
12 #include <TNamed.h>
13 #include <TClonesArray.h>
14
15 class AliEmcalContainer : public TNamed {
16  public:
17   AliEmcalContainer();
18   AliEmcalContainer(const char *name); 
19   virtual ~AliEmcalContainer(){;}
20
21   TClonesArray               *GetArray()                          { return fClArray                   ; }
22   const TString&              GetArrayName()                const { return fClArrayName               ; }
23   Int_t                       GetCurrentID()                const { return fCurrentID-1               ; }
24   Bool_t                      GetIsParticleLevel()          const { return fIsParticleLevel           ; }
25   Int_t                       GetIndexFromLabel(Int_t lab)  const;
26   Int_t                       GetNEntries()                 const { return fClArray->GetEntriesFast() ; }
27   virtual void                GetMomentum(TLorentzVector &mom, Int_t i) const = 0;
28   void                        ResetCurrentID(Int_t i=0)           { fCurrentID = i                    ; }
29   virtual void                SetArray(AliVEvent *event);
30   void                        SetArrayName(const char *n)         { fClArrayName = n                  ; }
31   void                        SetIsParticleLevel(Bool_t b)        { fIsParticleLevel = b              ; }
32   void                        SortArray()                         { fClArray->Sort()                  ; }
33
34  protected:
35   TString                     fClArrayName;             // name of branch
36   TString                     fClassName;               // name of the class in the TClonesArray
37   Bool_t                      fIsParticleLevel;         // whether or not it is a particle level object collection
38   TClonesArray               *fClArray;                 //!TClonesArray
39   Int_t                       fCurrentID;               //!current ID for automatic loops
40   AliNamedArrayI             *fLabelMap;                //!Label-Index map
41   Double_t                    fVertex[3];               //!event vertex array
42
43  private:
44   AliEmcalContainer(const AliEmcalContainer& obj); // copy constructor
45   AliEmcalContainer& operator=(const AliEmcalContainer& other); // assignment
46
47   ClassDef(AliEmcalContainer,3);
48 };
49 #endif