AliPhysics  d497547 (d497547)
 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;
10 class AliVEvent;
11 class AliNamedArrayI;
12 class AliVParticle;
13 
14 #include <TNamed.h>
15 #include <TClonesArray.h>
16 
17 #if !(defined(__CINT__) || defined(__MAKECINT__))
20 #endif
21 
75 class AliEmcalContainer : public TObject {
76  public:
81  enum RejectionReason {
82  // General
83  kNullObject = 1<<0,
84  kPtCut = 1<<1,
85  kAcceptanceCut = 1<<2,
86  kMCLabelCut = 1<<3,
87  kBitMapCut = 1<<4,
88  kHFCut = 1<<5,
89  // leave bit 6 free for future implementations
90 
91  // AliParticleContainer
92  kNotHybridTrack = 1<<7,
93  kMCFlag = 1<<8,
94  kMCGeneratorCut = 1<<9,
95  kChargeCut = 1<<10,
96  kMinDistanceTPCSectorEdgeCut = 1<<11,
97  // leave bit 12 free for future implementations
98 
99  // AliClusterContainer
100  kIsEMCalCut = 1<<13,
101  kTimeCut = 1<<14,
102  kEnergyCut = 1<<15,
103  kExoticCut = 1<<16,
104  // leave bit 17 free for future implementations
105 
106  // AliJetContainer
107  kAreaCut = 1<<18,
108  kAreaEmcCut = 1<<19,
109  kZLeadingChCut = 1<<20,
110  kZLeadingEmcCut = 1<<21,
111  kNEFCut = 1<<22,
112  kMinLeadPtCut = 1<<23,
113  kMaxTrackPtCut = 1<<24,
114  kMaxClusterPtCut = 1<<25,
115  kFlavourCut = 1<<26,
116  kTagStatus = 1<<27,
117  kMinNConstituents = 1<<28,
118  kOverlapTpcHole = 1<<29
119  };
120 
121  AliEmcalContainer();
122  AliEmcalContainer(const char *name);
123  virtual ~AliEmcalContainer(){;}
124 
125  virtual TObject *operator[](int index) const = 0;
126 
127  virtual Bool_t ApplyKinematicCuts(const AliTLorentzVector& mom, UInt_t &rejectionReason) const;
128  TClonesArray *GetArray() const { return fClArray ; }
129  const TString& GetArrayName() const { return fClArrayName ; }
130  const TString& GetClassName() const { return fClassName ; }
131  TClass *GetClass() const { return fClArray == 0 ? 0 : fClArray->GetClass(); }
132  Double_t GetMinE() const { return fMinE ; }
133  Double_t GetMaxE() const { return fMaxE ; }
134  Double_t GetMinPt() const { return fMinPt ; }
135  Double_t GetMaxPt() const { return fMaxPt ; }
136  Double_t GetMinEta() const { return fMinEta ; }
137  Double_t GetMaxEta() const { return fMaxEta ; }
138  Double_t GetMinPhi() const { return fMinPhi ; }
139  Double_t GetMaxPhi() const { return fMaxPhi ; }
140  Double_t GetEtaSwing() const { return fMaxEta - fMinEta; }
141  Double_t GetPhiSwing() const { return fMaxPhi - fMinPhi; }
142  Double_t GetAcceptance() const { return GetEtaSwing() * GetPhiSwing(); }
143  Int_t GetCurrentID() const { return fCurrentID ; }
144  Bool_t GetIsParticleLevel() const { return fIsParticleLevel ; }
145  Int_t GetIndexFromLabel(Int_t lab) const;
146  Int_t GetNEntries() const { return fClArray ? fClArray->GetEntriesFast() : 0 ; }
147  virtual Bool_t GetMomentum(TLorentzVector &mom, Int_t i) const = 0;
148  virtual Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i) const = 0;
149  virtual Bool_t GetNextMomentum(TLorentzVector &mom) = 0;
150  virtual Bool_t GetNextAcceptMomentum(TLorentzVector &mom) = 0;
151  virtual Bool_t AcceptObject(Int_t i, UInt_t &rejectionReason) const = 0;
152  virtual Bool_t AcceptObject(const TObject* obj, UInt_t &rejectionReason) const = 0;
153  Int_t GetNAcceptEntries() const;
154  void ResetCurrentID(Int_t i=-1) { fCurrentID = i ; }
155  virtual void SetArray(const AliVEvent *event);
156  void SetArrayName(const char *n) { fClArrayName = n ; }
157  void SetBitMap(UInt_t m) { fBitMap = m ; }
158  void SetIsParticleLevel(Bool_t b) { fIsParticleLevel = b ; }
159  void SortArray() { fClArray->Sort() ; }
160 
161  TClass* GetLoadedClass() { return fLoadedClass ; }
162  virtual void NextEvent() {;}
163  void SetMinMCLabel(Int_t s) { fMinMCLabel = s ; }
164  void SetMaxMCLabel(Int_t s) { fMaxMCLabel = s ; }
165  void SetMCLabelRange(Int_t min, Int_t max) { SetMinMCLabel(min) ; SetMaxMCLabel(max) ; }
166  void SetELimits(Double_t min, Double_t max) { fMinE = min ; fMaxE = max ; }
167  void SetMinE(Double_t min) { fMinE = min ; }
168  void SetMaxE(Double_t max) { fMaxE = max ; }
169  void SetPtLimits(Double_t min, Double_t max) { fMinPt = min ; fMaxPt = max ; }
170  void SetMinPt(Double_t min) { fMinPt = min ; }
171  void SetMaxPt(Double_t max) { fMaxPt = max ; }
172  void SetEtaLimits(Double_t min, Double_t max) { fMaxEta = max ; fMinEta = min ; }
173  void SetPhiLimits(Double_t min, Double_t max) { fMaxPhi = max ; fMinPhi = min ; }
174  void SetMassHypothesis(Double_t m) { fMassHypothesis = m ; }
175  void SetClassName(const char *clname);
176  void SetIsEmbedding(Bool_t b) { fIsEmbedding = b ; }
177  Bool_t GetIsEmbedding() const { return fIsEmbedding; }
178 
179  const char* GetName() const { return fName.Data() ; }
180  void SetName(const char* n) { fName = n ; }
181 
182  static Double_t RelativePhi(Double_t ang1, Double_t ang2);
183  static Bool_t SamePart(const AliVParticle* part1, const AliVParticle* part2, Double_t dist = 1.e-4);
184  static UShort_t GetRejectionReasonBitPosition(UInt_t rejectionReason);
185 
186 #if !(defined(__CINT__) || defined(__MAKECINT__))
187  const AliEmcalIterableContainer all() const;
188  const AliEmcalIterableContainer accepted() const;
189 
190  const AliEmcalIterableMomentumContainer all_momentum() const;
191  const AliEmcalIterableMomentumContainer accepted_momentum() const;
192 #endif
193 
194  protected:
203  virtual TString GetDefaultArrayName(const AliVEvent * const ev) const { return ""; }
204 
205  TString fName;
206  TString fClArrayName;
207  TString fBaseClassName;
208  Bool_t fIsParticleLevel;
209  UInt_t fBitMap;
210  Double_t fMinPt;
211  Double_t fMaxPt;
212  Double_t fMaxE;
213  Double_t fMinE;
214  Double_t fMinEta;
215  Double_t fMaxEta;
216  Double_t fMinPhi;
217  Double_t fMaxPhi;
218  Int_t fMinMCLabel;
219  Int_t fMaxMCLabel;
220  Double_t fMassHypothesis;
221  Bool_t fIsEmbedding;
222  TClonesArray *fClArray;
223  Int_t fCurrentID;
224  AliNamedArrayI *fLabelMap;
225  Double_t fVertex[3];
226  TClass *fLoadedClass;
227 
228  private:
229  TString fClassName;
230 
231  AliEmcalContainer(const AliEmcalContainer& obj); // copy constructor
232  AliEmcalContainer& operator=(const AliEmcalContainer& other); // assignment
233 
235  ClassDef(AliEmcalContainer,9);
237 };
238 #endif
double Double_t
Definition: External.C:58
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
Container implementing iterable functionality of the EMCAL containers.
unsigned short UShort_t
Definition: External.C:28
bool Bool_t
Definition: External.C:53