AliPhysics  f2694b8 (f2694b8)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
AliParticleContainer.h
Go to the documentation of this file.
1 #ifndef ALIPARTICLECONTAINER_H
2 #define ALIPARTICLECONTAINER_H
3 
4 class AliVEvent;
5 class AliVParticle;
6 class AliVCuts;
7 class AliTLorentzVector;
8 
9 #include <TArrayC.h>
10 
11 #include "AliAODMCParticle.h"
12 #include "AliEmcalTrackSelection.h"
13 #include "AliEmcalContainer.h"
14 
16  public:
17 
19 
20  enum ETrackType_t {
21  kRejected = -1,
26  };
27 
29  AliParticleContainer(const char *name, const char *period = "");
30  virtual ~AliParticleContainer(){;}
31 
32  Bool_t ApplyKinematicCuts(const AliTLorentzVector& mom);
33  virtual Bool_t AcceptObject(Int_t i) { return AcceptParticle(i);}
34  virtual Bool_t AcceptObject(TObject* obj) { return AcceptParticle(dynamic_cast<AliVParticle*>(obj));}
35  virtual Bool_t AcceptParticle(AliVParticle* vp) ;
36  virtual Bool_t AcceptParticle(Int_t i) ;
37  Double_t GetParticlePtCut() const { return fParticlePtCut ; }
38  Double_t GetParticleEtaMin() const { return fParticleMinEta ; }
39  Double_t GetParticleEtaMax() const { return fParticleMaxEta ; }
40  Double_t GetParticlePhiMin() const { return fParticleMinPhi ; }
41  Double_t GetParticlePhiMax() const { return fParticleMaxPhi ; }
42  AliVParticle *GetLeadingParticle(const char* opt="") ;
43  AliVParticle *GetParticle(Int_t i=-1) const;
44  AliVParticle *GetAcceptParticle(Int_t i=-1) ;
45  AliVParticle *GetParticleWithLabel(Int_t lab) const;
46  AliVParticle *GetAcceptParticleWithLabel(Int_t lab) ;
47  AliVParticle *GetNextAcceptParticle(Int_t i=-1) ;
48  AliVParticle *GetNextParticle(Int_t i=-1) ;
49  Bool_t GetMomentum(TLorentzVector &mom, Int_t i);
50  Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i);
51  Bool_t GetNextMomentum(TLorentzVector &mom, Int_t i=-1);
52  Bool_t GetNextAcceptMomentum(TLorentzVector &mom, Int_t i=-1);
53  Int_t GetNParticles() const {return GetNEntries();}
54  Int_t GetNAcceptedParticles() ;
56  Char_t GetTrackType(Int_t i) const { return i >= 0 && i < fTrackTypes.GetSize() ? fTrackTypes[i] : kUndefined ; }
57 
58  void SetArray(AliVEvent *event);
59 
60  void SetClassName(const char *clname);
61  void SetParticlePtCut(Double_t cut) { fParticlePtCut = cut ; }
62  void SetParticleEtaLimits(Double_t min, Double_t max) { fParticleMaxEta = max ; fParticleMinEta = min ; }
63  void SetParticlePhiLimits(Double_t min, Double_t max, Double_t offset=0.) { fParticleMaxPhi = max ; fParticleMinPhi = min ; fPhiOffset = offset;}
65  void SetMinMCLabel(Int_t s) { fMinMCLabel = s ; }
66  void SetMaxMCLabel(Int_t s) { fMaxMCLabel = s ; }
67  void SetMCLabelRange(Int_t min, Int_t max) { SetMinMCLabel(min) ; SetMaxMCLabel(max) ; }
68  void SetMCFlag(UInt_t m) { fMCFlag = m ; }
69  void SelectHIJING(Bool_t s) { if (s) fGeneratorIndex = 0; else fGeneratorIndex = -1; }
70  void SetGeneratorIndex(Short_t i) { fGeneratorIndex = i ; }
71  void SelectPhysicalPrimaries(Bool_t s) { if (s) fMCFlag |= AliAODMCParticle::kPhysicalPrim ;
72  else fMCFlag &= ~AliAODMCParticle::kPhysicalPrim ; }
73  void SetCharge(Short_t c) { fCharge = c ; }
76 
77  void SetTrackCutsPeriod(const char* period) { fTrackCutsPeriod = period; }
78  void AddTrackCuts(AliVCuts *cuts);
79  Int_t GetNumberOfCutObjects() const;
80  AliVCuts *GetTrackCuts(Int_t icut);
81  void SetAODFilterBits(UInt_t bits) { fAODFilterBits = bits ; }
82  void AddAODFilterBit(UInt_t bit) { fAODFilterBits |= bit ; }
83  UInt_t GetAODFilterBits() const { return fAODFilterBits ; }
84 
87 
88  void NextEvent();
89 
90  static void SetDefTrackCutsPeriod(const char* period) { fgDefTrackCutsPeriod = period; }
91  static TString GetDefTrackCutsPeriod() { return fgDefTrackCutsPeriod ; }
92 
93  const char* GetTitle() const;
94 
95  protected:
96  static TString fgDefTrackCutsPeriod;
97 
98  Double_t fParticlePtCut; // cut on particle pt
99  Double_t fParticleMinEta; // cut on particle eta
100  Double_t fParticleMaxEta; // cut on particle eta
101  Double_t fParticleMinPhi; // cut on particle phi
102  Double_t fParticleMaxPhi; // cut on particle phi
103  Double_t fPhiOffset; // phi offset
104  Double_t fMinDistanceTPCSectorEdge; // require minimum distance to edge of TPC sector edge
105  Int_t fMinMCLabel; // minimum MC label
106  Int_t fMaxMCLabel; // maximum MC label
107  UInt_t fMCFlag; // select MC particles with flags
108  Short_t fGeneratorIndex; // select MC particles with generator index (default = -1 = switch off selection)
109  Short_t fCharge; // select particles with charge=fCharge
110  ETrackFilterType_t fTrackFilterType; // track filter type
111  TObjArray *fListOfCuts; // list of track cut objects
112  Bool_t fSelectionModeAny; // accept track if any of the cuts is fulfilled
113  UInt_t fAODFilterBits; // track filter bits
114  TString fTrackCutsPeriod; // period string used to generate track cuts
116  TObjArray *fFilteredTracks;
117  TArrayC fTrackTypes;
118 
119  private:
120  AliParticleContainer(const AliParticleContainer& obj); // copy constructor
121  AliParticleContainer& operator=(const AliParticleContainer& other); // assignment
122 
124 
125 };
126 
127 #endif
128 
ETrackFilterType_t GetTrackFilterType() const
Interface for virtual track selection.
void SetParticlePtCut(Double_t cut)
Bool_t GetNextMomentum(TLorentzVector &mom, Int_t i=-1)
static TString GetDefTrackCutsPeriod()
Double_t fParticlePtCut
default period string used to generate track cuts
AliVParticle * GetParticleWithLabel(Int_t lab) const
const char * GetTitle() const
AliParticleContainer & operator=(const AliParticleContainer &other)
void SetClassName(const char *clname)
Int_t GetNParticles() const
ETrackFilterType_t fTrackFilterType
Char_t GetTrackType(Int_t i) const
void SelectPhysicalPrimaries(Bool_t s)
virtual Bool_t AcceptParticle(AliVParticle *vp)
TArrayC fTrackTypes
tracks filtered using fEmcalTrackSelection
static TString fgDefTrackCutsPeriod
Double_t GetParticleEtaMin() const
void SetFilterHybridTracks(Bool_t f)
UInt_t GetAODFilterBits() const
AliVCuts * GetTrackCuts(Int_t icut)
AliVParticle * GetAcceptParticleWithLabel(Int_t lab)
Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i)
void SetTrackCutsPeriod(const char *period)
void SetArray(AliVEvent *event)
AliEmcalTrackSelection::ETrackFilterType_t ETrackFilterType_t
static void SetDefTrackCutsPeriod(const char *period)
void SetTrackFilterType(ETrackFilterType_t f)
AliVParticle * GetLeadingParticle(const char *opt="")
AliVParticle * GetParticle(Int_t i=-1) const
Bool_t GetNextAcceptMomentum(TLorentzVector &mom, Int_t i=-1)
void AddTrackCuts(AliVCuts *cuts)
Bool_t GetMomentum(TLorentzVector &mom, Int_t i)
void AddAODFilterBit(UInt_t bit)
AliVParticle * GetNextAcceptParticle(Int_t i=-1)
void SetMCLabelRange(Int_t min, Int_t max)
Int_t GetNumberOfCutObjects() const
Double_t GetParticlePtCut() const
AliVParticle * GetNextParticle(Int_t i=-1)
void SetParticleEtaLimits(Double_t min, Double_t max)
TObjArray * fFilteredTracks
track selection object
Bool_t ApplyKinematicCuts(const AliTLorentzVector &mom)
Double_t GetParticlePhiMax() const
Double_t GetParticleEtaMax() const
void SetAODFilterBits(UInt_t bits)
void SetGeneratorIndex(Short_t i)
Double_t GetParticlePhiMin() const
AliEmcalTrackSelection * fEmcalTrackSelection
void SetParticlePhiLimits(Double_t min, Double_t max, Double_t offset=0.)
Int_t GetNEntries() const
virtual Bool_t AcceptObject(Int_t i)
ClassDef(AliParticleContainer, 8)
AliVParticle * GetAcceptParticle(Int_t i=-1)
void SetMinDistanceTPCSectorEdge(Double_t min)
virtual Bool_t AcceptObject(TObject *obj)
Declartion of class AliEmcalTrackSelection.