don't lie in the log!
[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   enum RejectionReason {
18     // General
19     kNullObject = 1<<0,
20     kPtCut = 1<<1,
21     kAcceptanceCut = 1<<2,
22     kBitMapCut = 1<<3,
23     // leave bits 4-7 free for future implementations
24     
25     // AliParticleContainer
26     kMCFlag = 1<<8,
27     kMCGeneratorCut = 1<<9,
28     kChargeCut = 1<<10,
29     // leave bits 11-12 free for future implementations
30
31     // AliClusterContainer
32     kIsEMCalCut = 1<<13,
33     kTimeCut = 1<<14,
34     kEnergyCut = 1<<15,
35     // leave bits 16-17 free for future implementations
36
37     // AliJetContainer
38     kAreaCut = 1<<18,
39     kAreaEmcCut = 1<<19,
40     kZLeadingChCut = 1<<20,
41     kZLeadingEmcCut = 1<<21,
42     kNEFCut = 1<<22,
43     kMinLeadPtCut = 1<<23,
44     kMaxTrackPtCut = 1<<24,
45     kMaxClusterPtCut = 1<<25,
46     kFlavourCut = 1<<26,
47     kTagStatus = 1<<27
48   };
49
50   AliEmcalContainer();
51   AliEmcalContainer(const char *name); 
52   virtual ~AliEmcalContainer(){;}
53
54   TClonesArray               *GetArray()                          { return fClArray                   ; }
55   const TString&              GetArrayName()                  const { return fClArrayName               ; }
56   Int_t                       GetCurrentID()                  const { return fCurrentID-1               ; }
57   Bool_t                      GetIsParticleLevel()            const { return fIsParticleLevel           ; }
58   Int_t                       GetIndexFromLabel(Int_t lab)    const;
59   Int_t                       GetNEntries()                   const { return fClArray->GetEntriesFast() ; }
60   virtual void                GetMomentum(TLorentzVector &mom, Int_t i) const = 0;
61   void                        ResetCurrentID(Int_t i=0)             { fCurrentID = i                    ; }
62   virtual void                SetArray(AliVEvent *event);
63   void                        SetArrayName(const char *n)           { fClArrayName = n                  ; }
64   void                        SetIsParticleLevel(Bool_t b)          { fIsParticleLevel = b              ; }
65   void                        SortArray()                           { fClArray->Sort()                  ; }
66   UInt_t                      GetRejectionReason()            const { return fRejectionReason           ; }
67   UInt_t                      TestRejectionReason(UInt_t rs)  const { return fRejectionReason & rs      ; }
68   UShort_t                    GetRejectionReasonBitPosition() const;
69
70  protected:
71   TString                     fClArrayName;             // name of branch
72   TString                     fClassName;               // name of the class in the TClonesArray
73   Bool_t                      fIsParticleLevel;         // whether or not it is a particle level object collection
74   TClonesArray               *fClArray;                 //!TClonesArray
75   Int_t                       fCurrentID;               //!current ID for automatic loops
76   AliNamedArrayI             *fLabelMap;                //!Label-Index map
77   Double_t                    fVertex[3];               //!event vertex array
78   UInt_t                      fRejectionReason;         //!reject reason bit map for the last call to an accept object function
79
80  private:
81   AliEmcalContainer(const AliEmcalContainer& obj); // copy constructor
82   AliEmcalContainer& operator=(const AliEmcalContainer& other); // assignment
83
84   ClassDef(AliEmcalContainer,3);
85 };
86 #endif