AliPhysics  b3a51e4 (b3a51e4)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalContainer.h
Go to the documentation of this file.
2 
3 #ifndef ALIEMCALCONTAINER_H
4 #define ALIEMCALCONTAINER_H
5 /* Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
6  * See cxx source for full Copyright notice */
7 
8 class TLorentzVector;
9 class AliTLorentzVector;
10 class AliVEvent;
11 class AliNamedArrayI;
12 class AliVParticle;
13 
14 #include <TNamed.h>
15 #include <TClonesArray.h>
16 
18 
72 class AliEmcalContainer : public TObject {
73  public:
78  enum RejectionReason {
79  // General
80  kNullObject = 1<<0,
81  kPtCut = 1<<1,
82  kAcceptanceCut = 1<<2,
83  kMCLabelCut = 1<<3,
84  kBitMapCut = 1<<4,
85  kHFCut = 1<<5,
86  // leave bit 6 free for future implementations
87 
88  // AliParticleContainer
89  kNotHybridTrack = 1<<7,
90  kMCFlag = 1<<8,
91  kMCGeneratorCut = 1<<9,
92  kChargeCut = 1<<10,
93  kMinDistanceTPCSectorEdgeCut = 1<<11,
94  // leave bit 12 free for future implementations
95 
96  // AliClusterContainer
97  kIsEMCalCut = 1<<13,
98  kTimeCut = 1<<14,
99  kEnergyCut = 1<<15,
100  kExoticCut = 1<<16,
101  // leave bit 17 free for future implementations
102 
103  // AliJetContainer
104  kAreaCut = 1<<18,
105  kAreaEmcCut = 1<<19,
106  kZLeadingChCut = 1<<20,
107  kZLeadingEmcCut = 1<<21,
108  kNEFCut = 1<<22,
109  kMinLeadPtCut = 1<<23,
110  kMaxTrackPtCut = 1<<24,
111  kMaxClusterPtCut = 1<<25,
112  kFlavourCut = 1<<26,
113  kTagStatus = 1<<27,
114  kMinNConstituents = 1<<28,
115  kOverlapTpcHole = 1<<29
116  };
117 
118  AliEmcalContainer();
119  AliEmcalContainer(const char *name);
120  virtual ~AliEmcalContainer(){;}
121 
122  virtual TObject *operator[](int index) const = 0;
123 
124  virtual Bool_t ApplyKinematicCuts(const AliTLorentzVector& mom, UInt_t &rejectionReason) const;
125  TClonesArray *GetArray() const { return fClArray ; }
126  const TString& GetArrayName() const { return fClArrayName ; }
127  const TString& GetClassName() const { return fClassName ; }
128  Double_t GetMinE() const { return fMinE ; }
129  Double_t GetMaxE() const { return fMaxE ; }
130  Double_t GetMinPt() const { return fMinPt ; }
131  Double_t GetMaxPt() const { return fMaxPt ; }
132  Double_t GetMinEta() const { return fMinEta ; }
133  Double_t GetMaxEta() const { return fMaxEta ; }
134  Double_t GetMinPhi() const { return fMinPhi ; }
135  Double_t GetMaxPhi() const { return fMaxPhi ; }
136  Int_t GetCurrentID() const { return fCurrentID ; }
137  Bool_t GetIsParticleLevel() const { return fIsParticleLevel ; }
138  Int_t GetIndexFromLabel(Int_t lab) const;
139  Int_t GetNEntries() const { return fClArray->GetEntriesFast() ; }
140  virtual Bool_t GetMomentum(TLorentzVector &mom, Int_t i) const = 0;
141  virtual Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i) const = 0;
142  virtual Bool_t GetNextMomentum(TLorentzVector &mom) = 0;
143  virtual Bool_t GetNextAcceptMomentum(TLorentzVector &mom) = 0;
144  virtual Bool_t AcceptObject(Int_t i, UInt_t &rejectionReason) const = 0;
145  virtual Bool_t AcceptObject(const TObject* obj, UInt_t &rejectionReason) const = 0;
146  Int_t GetNAcceptEntries() const;
147  void ResetCurrentID(Int_t i=-1) { fCurrentID = i ; }
148  virtual void SetArray(const AliVEvent *event);
149  void SetArrayName(const char *n) { fClArrayName = n ; }
150  void SetBitMap(UInt_t m) { fBitMap = m ; }
151  void SetIsParticleLevel(Bool_t b) { fIsParticleLevel = b ; }
152  void SortArray() { fClArray->Sort() ; }
153  UShort_t GetRejectionReasonBitPosition(UInt_t rejectionReason) const;
154  TClass* GetLoadedClass() { return fLoadedClass ; }
155  virtual void NextEvent() {;}
156  void SetMinMCLabel(Int_t s) { fMinMCLabel = s ; }
157  void SetMaxMCLabel(Int_t s) { fMaxMCLabel = s ; }
158  void SetMCLabelRange(Int_t min, Int_t max) { SetMinMCLabel(min) ; SetMaxMCLabel(max) ; }
159  void SetELimits(Double_t min, Double_t max) { fMinE = min ; fMaxE = max ; }
160  void SetMinE(Double_t min) { fMinE = min ; }
161  void SetMaxE(Double_t max) { fMaxE = max ; }
162  void SetPtLimits(Double_t min, Double_t max) { fMinPt = min ; fMaxPt = max ; }
163  void SetMinPt(Double_t min) { fMinPt = min ; }
164  void SetMaxPt(Double_t max) { fMaxPt = max ; }
165  void SetEtaLimits(Double_t min, Double_t max) { fMaxEta = max ; fMinEta = min ; }
166  void SetPhiLimits(Double_t min, Double_t max) { fMaxPhi = max ; fMinPhi = min ; }
167  void SetMassHypothesis(Double_t m) { fMassHypothesis = m ; }
168  void SetClassName(const char *clname);
169 
170  const char* GetName() const { return fName.Data() ; }
171  void SetName(const char* n) { fName = n ; }
172 
173  static Double_t RelativePhi(Double_t ang1, Double_t ang2);
174  static Bool_t SamePart(const AliVParticle* part1, const AliVParticle* part2, Double_t dist = 1.e-4);
175 
176  const AliEmcalIterableContainer all() const;
177  const AliEmcalIterableContainer accepted() const;
178 
179  protected:
180  TString fName;
181  TString fClArrayName;
182  TString fBaseClassName;
183  Bool_t fIsParticleLevel;
184  UInt_t fBitMap;
185  Double_t fMinPt;
186  Double_t fMaxPt;
187  Double_t fMaxE;
188  Double_t fMinE;
189  Double_t fMinEta;
190  Double_t fMaxEta;
191  Double_t fMinPhi;
192  Double_t fMaxPhi;
193  Int_t fMinMCLabel;
194  Int_t fMaxMCLabel;
195  Double_t fMassHypothesis;
196  TClonesArray *fClArray;
197  Int_t fCurrentID;
198  AliNamedArrayI *fLabelMap;
199  Double_t fVertex[3];
200  TClass *fLoadedClass;
201 
202  private:
203  TString fClassName;
204 
205  AliEmcalContainer(const AliEmcalContainer& obj); // copy constructor
206  AliEmcalContainer& operator=(const AliEmcalContainer& other); // assignment
207 
209  ClassDef(AliEmcalContainer,8);
211 };
212 #endif
Container implementing iterable functionality of the EMCAL containers.