AliPhysics  8bb951a (8bb951a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliClusterContainer.h
Go to the documentation of this file.
1 #ifndef AliClusterContainer_H
2 #define AliClusterContainer_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 class TLorentzVector;
7 
8 class AliVEvent;
9 
10 #include <iterator>
11 #include <TArrayI.h>
12 #include <AliVCluster.h>
13 
14 #include "AliEmcalContainer.h"
15 
26  public:
27  typedef enum AliVCluster::VCluUserDefEnergy_t VCluUserDefEnergy_t;
28 
57  class accept_iterator : public std::iterator<std::bidirectional_iterator_tag,
58  AliVCluster,std::ptrdiff_t,
59  AliVCluster **, AliVCluster *&>
60  {
61  public:
62  accept_iterator(const AliClusterContainer *cont, int startpos, bool forward = true);
63  accept_iterator(const accept_iterator &other);
64  virtual ~accept_iterator() {}
66  bool operator!=(const accept_iterator &other) const;
67 
72 
73  AliVCluster *operator*() const;
74 
75  private:
77 
79  TArrayI fAcceptIndices;
81  bool fForward;
82  };
83 
117  class all_iterator : public std::iterator<std::bidirectional_iterator_tag,
118  AliVCluster,std::ptrdiff_t,
119  AliVCluster **, AliVCluster *&>
120  {
121  public:
122  all_iterator(const AliClusterContainer *cont, int startpos, bool forward = true);
123  all_iterator(const all_iterator &other);
124  virtual ~all_iterator() {}
125  all_iterator &operator=(const all_iterator &other);
126  bool operator!=(const all_iterator &other) const;
127 
132 
133  AliVCluster *operator*() const;
134 
135  private:
136  all_iterator();
137 
140  bool fForward;
141  };
142 
144  AliClusterContainer(const char *name);
145  virtual ~AliClusterContainer(){;}
146 
147  virtual Bool_t AcceptObject(Int_t i, UInt_t &rejectionReason) const { return AcceptCluster(i, rejectionReason);}
148  virtual Bool_t AcceptObject(const TObject* obj, UInt_t &rejectionReason) const { return AcceptCluster(dynamic_cast<const AliVCluster*>(obj), rejectionReason);}
149  virtual Bool_t AcceptCluster(Int_t i, UInt_t &rejectionReason) const;
150  virtual Bool_t AcceptCluster(const AliVCluster* vp, UInt_t &rejectionReason) const;
151  virtual Bool_t ApplyClusterCuts(const AliVCluster* clus, UInt_t &rejectionReason) const;
152  AliVCluster *GetAcceptCluster(Int_t i) const;
153  AliVCluster *GetAcceptClusterWithLabel(Int_t lab) const;
154  void SetClusECut(Double_t cut) { SetMinE(cut) ; }
155  void SetClusPtCut(Double_t cut) { SetMinPt(cut) ; }
156  Double_t GetClusPtCut() const { return GetMinPt(); }
157  AliVCluster *GetCluster(Int_t i) const;
158  AliVCluster *GetClusterWithLabel(Int_t lab) const;
159  AliVCluster *GetLeadingCluster(const char* opt="") ;
160  Bool_t GetMomentum(TLorentzVector &mom, const AliVCluster* vc, Double_t mass) const;
161  Bool_t GetMomentum(TLorentzVector &mom, const AliVCluster* clus) const;
162  Bool_t GetMomentum(TLorentzVector &mom, Int_t i) const;
163  Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i) const;
164  Bool_t GetNextMomentum(TLorentzVector &mom);
165  Bool_t GetNextAcceptMomentum(TLorentzVector &mom);
166  AliVCluster *GetNextAcceptCluster();
167  AliVCluster *GetNextCluster();
168  Int_t GetNClusters() const { return GetNEntries(); }
169  Int_t GetNAcceptedClusters() const;
170  void SetClusTimeCut(Double_t min, Double_t max) { fClusTimeCutLow = min ; fClusTimeCutUp = max ; }
171  void SetMinMCLabel(Int_t s) { fMinMCLabel = s ; }
172  void SetMaxMCLabel(Int_t s) { fMaxMCLabel = s ; }
173  void SetMCLabelRange(Int_t min, Int_t max) { SetMinMCLabel(min) ; SetMaxMCLabel(max) ; }
174  void SetExoticCut(Bool_t e) { fExoticCut = e ; }
175 
176  void SetClusUserDefEnergyCut(Int_t t, Double_t cut);
177  Double_t GetClusUserDefEnergyCut(Int_t t) const;
178 
179  void SetClusNonLinCorrEnergyCut(Double_t cut) { SetClusUserDefEnergyCut(AliVCluster::kNonLinCorr, cut); }
180  void SetClusHadCorrEnergyCut(Double_t cut) { SetClusUserDefEnergyCut(AliVCluster::kHadCorr, cut) ; }
182 
184 
185  const char* GetTitle() const;
186 
187  accept_iterator accept_begin() const;
188  accept_iterator accept_end() const;
189  accept_iterator accept_rbegin() const;
190  accept_iterator accept_rend() const;
191 
192  all_iterator begin() const;
193  all_iterator end() const;
194  all_iterator rbegin() const;
195  all_iterator rend() const;
196 
197  protected:
198 
199  Double_t fClusTimeCutLow;
200  Double_t fClusTimeCutUp;
201  Bool_t fExoticCut;
202  Double_t fUserDefEnergyCut[AliVCluster::kLastUserDefEnergy+1];
204 
205  private:
206  AliClusterContainer(const AliClusterContainer& obj); // copy constructor
207  AliClusterContainer& operator=(const AliClusterContainer& other); // assignment
208 
210  ClassDef(AliClusterContainer,5);
212 };
213 
223 int TestClusterContainerIterator(const AliClusterContainer *const cont, int iteratorType = 0, bool verbose = false);
224 
225 #endif
226 
AliVCluster * GetAcceptClusterWithLabel(Int_t lab) const
bool fForward
Direction, expressed in forward direction.
bool fForward
Direction, expressed in forward direction.
virtual Bool_t ApplyClusterCuts(const AliVCluster *clus, UInt_t &rejectionReason) const
Bool_t GetNextAcceptMomentum(TLorentzVector &mom)
const char * GetTitle() const
stl iterator over accepted clusters
all_iterator begin() const
accept_iterator accept_rbegin() const
AliClusterContainer & operator=(const AliClusterContainer &other)
Bool_t GetNextMomentum(TLorentzVector &mom)
void SetMinE(Double_t min)
Double_t mass
bool operator!=(const accept_iterator &other) const
accept_iterator accept_end() const
Double_t fClusTimeCutLow
low time cut for clusters
void SetMinPt(Double_t min)
Double_t fUserDefEnergyCut[AliVCluster::kLastUserDefEnergy+1]
cut on the energy of the cluster after higher level corrections (see AliVCluster.h) ...
const AliClusterContainer * fkContainer
Container iterated over.
accept_iterator accept_begin() const
all_iterator end() const
int fCurrentPos
Current position inside the container.
void SetClusUserDefEnergyCut(Int_t t, Double_t cut)
AliVCluster * GetLeadingCluster(const char *opt="")
Double_t GetClusUserDefEnergyCut(Int_t t) const
Int_t GetDefaultClusterEnergy() const
accept_iterator & operator=(const accept_iterator &other)
enum AliVCluster::VCluUserDefEnergy_t VCluUserDefEnergy_t
virtual Bool_t AcceptObject(Int_t i, UInt_t &rejectionReason) const
Double_t GetClusPtCut() const
Double_t GetMinPt() const
void SetClusNonLinCorrEnergyCut(Double_t cut)
stl iterator over all clusters
all_iterator & operator=(const all_iterator &other)
Base class for container structures within the EMCAL framework.
virtual Bool_t AcceptCluster(Int_t i, UInt_t &rejectionReason) const
AliVCluster * GetAcceptCluster(Int_t i) const
Int_t GetNClusters() const
Int_t GetNAcceptedClusters() const
int fCurrentPos
Current position inside the container.
all_iterator rend() const
Double_t fClusTimeCutUp
up time cut for clusters
AliVCluster * GetCluster(Int_t i) const
Bool_t fExoticCut
reject clusters marked as "exotic"
AliVCluster * GetNextCluster()
bool operator!=(const all_iterator &other) const
Int_t fMinMCLabel
minimum MC label
accept_iterator accept_rend() const
Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i) const
AliVCluster * GetClusterWithLabel(Int_t lab) const
int TestClusterContainerIterator(const AliClusterContainer *const cont, int iteratorType=0, bool verbose=false)
TArrayI fAcceptIndices
Indices of accepted clusters.
void SetMCLabelRange(Int_t min, Int_t max)
Bool_t GetMomentum(TLorentzVector &mom, const AliVCluster *vc, Double_t mass) const
Int_t fMaxMCLabel
maximum MC label
void SetClusPtCut(Double_t cut)
virtual Bool_t AcceptObject(const TObject *obj, UInt_t &rejectionReason) const
Int_t GetNEntries() const
Int_t fDefaultClusterEnergy
default cluster energy: -1 for clus->E(); otherwise clus->GetUserDefEnergy(fDefaultClusterEnergy) ...
const AliClusterContainer * fkContainer
Container iterated over.
all_iterator rbegin() const
void SetClusECut(Double_t cut)
void SetDefaultClusterEnergy(Int_t d)
void SetClusTimeCut(Double_t min, Double_t max)
Container structure for EMCAL clusters.
AliVCluster * GetNextAcceptCluster()
void SetExoticCut(Bool_t e)
void SetClusHadCorrEnergyCut(Double_t cut)