AliPhysics  8bb951a (8bb951a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliParticleContainer.h
Go to the documentation of this file.
1 #ifndef ALIPARTICLECONTAINER_H
2 #define ALIPARTICLECONTAINER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 #include <iterator>
7 #include <TArrayI.h>
8 #include <AliVParticle.h>
9 
10 class AliVEvent;
11 class AliTLorentzVector;
12 
13 #include "AliEmcalContainer.h"
14 
25  public:
26 
56  class accept_iterator : public std::iterator<std::bidirectional_iterator_tag,
57  AliVParticle,std::ptrdiff_t,
58  AliVParticle **, AliVParticle *&>
59  {
60  public:
61  accept_iterator(const AliParticleContainer *cont, int startpos, bool forward = true);
62  accept_iterator(const accept_iterator &other);
63  virtual ~accept_iterator() {}
65  bool operator!=(const accept_iterator &other) const;
66 
71 
72  AliVParticle *operator*() const;
73 
74  private:
76 
78  TArrayI fAcceptIndices;
80  bool fForward;
81  };
82 
116  class all_iterator : public std::iterator<std::bidirectional_iterator_tag,
117  AliVParticle,std::ptrdiff_t,
118  AliVParticle **, AliVParticle *&>
119  {
120  public:
121  all_iterator(const AliParticleContainer *cont, int startpos, bool forward = true);
122  all_iterator(const all_iterator &other);
123  virtual ~all_iterator() {}
124  all_iterator &operator=(const all_iterator &other);
125  bool operator!=(const all_iterator &other) const;
126 
131 
132  AliVParticle *operator*() const;
133 
134  private:
135  all_iterator();
136 
139  bool fForward;
140  };
141 
143  AliParticleContainer(const char *name);
145 
146  virtual Bool_t ApplyParticleCuts(const AliVParticle* vp, UInt_t &rejectionReason) const;
147  virtual Bool_t ApplyKinematicCuts(const AliTLorentzVector& mom, UInt_t &rejectionReason) const;
148  virtual Bool_t AcceptObject(Int_t i, UInt_t &rejectionReason) const { return AcceptParticle(i, rejectionReason);}
149  virtual Bool_t AcceptObject(const TObject* obj, UInt_t &rejectionReason) const { return AcceptParticle(dynamic_cast<const AliVParticle*>(obj), rejectionReason);}
150  virtual Bool_t AcceptParticle(const AliVParticle* vp, UInt_t &rejectionReason) const ;
151  virtual Bool_t AcceptParticle(Int_t i, UInt_t &rejectionReason) const ;
152  Double_t GetParticlePtCut() const { return GetMinPt() ; }
153  Double_t GetParticleEtaMin() const { return GetMinEta() ; }
154  Double_t GetParticleEtaMax() const { return GetMaxEta() ; }
155  Double_t GetParticlePhiMin() const { return GetMinPhi() ; }
156  Double_t GetParticlePhiMax() const { return GetMaxPhi() ; }
157  void SetParticlePtCut(Double_t cut) { SetMinPt(cut) ; }
158  void SetParticleEtaLimits(Double_t min, Double_t max) { SetEtaLimits(min, max); }
159  void SetParticlePhiLimits(Double_t min, Double_t max) { SetPhiLimits(min, max); }
160  virtual AliVParticle *GetLeadingParticle(const char* opt="") ;
161  virtual AliVParticle *GetParticle(Int_t i=-1) const;
162  virtual AliVParticle *GetAcceptParticle(Int_t i=-1) const;
163  virtual AliVParticle *GetNextAcceptParticle() ;
164  virtual AliVParticle *GetNextParticle() ;
165  virtual Bool_t GetMomentumFromParticle(TLorentzVector &mom, const AliVParticle* part, Double_t mass) const;
166  virtual Bool_t GetMomentumFromParticle(TLorentzVector &mom, const AliVParticle* part) const;
167  virtual Bool_t GetMomentum(TLorentzVector &mom, Int_t i) const;
168  virtual Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i) const;
169  virtual Bool_t GetNextMomentum(TLorentzVector &mom);
170  virtual Bool_t GetNextAcceptMomentum(TLorentzVector &mom);
171  Int_t GetNParticles() const {return GetNEntries();}
172  Int_t GetNAcceptedParticles() const;
174  void SetCharge(Short_t c) { fCharge = c ; }
175  void SelectHIJING(Bool_t s) { if (s) fGeneratorIndex = 0; else fGeneratorIndex = -1; }
176  void SetGeneratorIndex(Short_t i) { fGeneratorIndex = i ; }
177 
178  const char* GetTitle() const;
179 
180  accept_iterator accept_begin() const;
181  accept_iterator accept_end() const;
182  accept_iterator accept_rbegin() const;
183  accept_iterator accept_rend() const;
184 
185  all_iterator begin() const;
186  all_iterator end() const;
187  all_iterator rbegin() const;
188  all_iterator rend() const;
189 
190  protected:
191 
193  Short_t fCharge;
194  Short_t fGeneratorIndex;
195 
196  private:
197  AliParticleContainer(const AliParticleContainer& obj); // copy constructor
198  AliParticleContainer& operator=(const AliParticleContainer& other); // assignment
199 
201  ClassDef(AliParticleContainer,9);
203 
204 };
205 
215 int TestParticleContainerIterator(const AliParticleContainer *const cont, int iteratorType = 0, bool verbose = false);
216 
217 
218 #endif
219 
all_iterator begin() const
void SetParticlePtCut(Double_t cut)
virtual AliVParticle * GetNextAcceptParticle()
int fCurrentPos
Current position inside the container.
virtual Bool_t AcceptObject(Int_t i, UInt_t &rejectionReason) const
virtual Bool_t GetMomentum(TLorentzVector &mom, Int_t i) const
Double_t GetMinPhi() const
all_iterator rend() const
const char * GetTitle() const
accept_iterator accept_begin() const
accept_iterator accept_rbegin() const
AliParticleContainer & operator=(const AliParticleContainer &other)
Double_t GetMaxEta() const
Double_t mass
virtual Bool_t ApplyParticleCuts(const AliVParticle *vp, UInt_t &rejectionReason) const
void SetMinPt(Double_t min)
virtual Bool_t AcceptObject(const TObject *obj, UInt_t &rejectionReason) const
TArrayI fAcceptIndices
Indices of accepted clusters.
void SetEtaLimits(Double_t min, Double_t max)
Double_t GetParticleEtaMin() const
all_iterator rbegin() const
virtual Bool_t GetNextMomentum(TLorentzVector &mom)
Container for particles within the EMCAL framework.
virtual Bool_t GetNextAcceptMomentum(TLorentzVector &mom)
bool fForward
Direction, expressed in forward direction.
Double_t GetMaxPhi() const
stl iterator over all clusters
Double_t GetMinEta() const
bool operator!=(const all_iterator &other) const
Double_t GetMinPt() const
virtual AliVParticle * GetLeadingParticle(const char *opt="")
virtual AliVParticle * GetParticle(Int_t i=-1) const
Base class for container structures within the EMCAL framework.
const AliParticleContainer * fkContainer
Container iterated over.
virtual AliVParticle * GetAcceptParticle(Int_t i=-1) const
accept_iterator accept_rend() const
Short_t fCharge
select particles with charge=fCharge
int fCurrentPos
Current position inside the container.
accept_iterator accept_end() const
virtual Bool_t AcceptParticle(const AliVParticle *vp, UInt_t &rejectionReason) const
stl iterator over accepted clusters
Double_t fMinDistanceTPCSectorEdge
require minimum distance to edge of TPC sector edge
Double_t GetParticlePtCut() const
Short_t fGeneratorIndex
select MC particles with generator index (default = -1 = switch off selection)
const AliParticleContainer * fkContainer
Container iterated over.
bool fForward
Direction, expressed in forward direction.
void SetParticleEtaLimits(Double_t min, Double_t max)
all_iterator end() const
Double_t GetParticlePhiMax() const
virtual Bool_t GetMomentumFromParticle(TLorentzVector &mom, const AliVParticle *part, Double_t mass) const
Double_t GetParticleEtaMax() const
void SetGeneratorIndex(Short_t i)
Double_t GetParticlePhiMin() const
virtual Bool_t ApplyKinematicCuts(const AliTLorentzVector &mom, UInt_t &rejectionReason) const
bool operator!=(const accept_iterator &other) const
accept_iterator & operator=(const accept_iterator &other)
int TestParticleContainerIterator(const AliParticleContainer *const cont, int iteratorType=0, bool verbose=false)
Int_t GetNEntries() const
void SetPhiLimits(Double_t min, Double_t max)
Int_t GetNAcceptedParticles() const
void SetParticlePhiLimits(Double_t min, Double_t max)
void SetMinDistanceTPCSectorEdge(Double_t min)
all_iterator & operator=(const all_iterator &other)
virtual Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i) const
virtual AliVParticle * GetNextParticle()