FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairTrajFilter.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 // ********************************************* //
9 // *** D. Kresan 2004-Sep-14 *** //
10 // *** D.Kresan@gsi.de *** //
11 // ********************************************* //
12 
13 #ifndef FAIR_TRAJ_FILTER_H
14 #define FAIR_TRAJ_FILTER_H 1
15 
16 #include <Rtypes.h> // for Double_t, Bool_t, Int_t, etc
17 #include <TGeoTrack.h> // IWYU pragma: keep needed by cint // TODO: is this still relevant for CINT?
18 #include <TMCtls.h> // for multi-threading
19 #include <TMath.h> // for Pi, TwoPi
20 #include <TString.h> // for TString
21 
22 class TClonesArray;
23 class TParticle;
24 
44 {
45  public:
52 
56  virtual ~FairTrajFilter();
57 
62 
63  private:
65  FairTrajFilter& operator=(const FairTrajFilter&);
66 
67  static TMCThreadLocal FairTrajFilter* fgInstance;
68 
69  Double_t fVxMin;
70  Double_t fVxMax;
71  Double_t fVyMin;
72  Double_t fVyMax;
73  Double_t fVzMin;
74  Double_t fVzMax;
75 
76  Double_t fPMin;
77  Double_t fPMax;
78  Double_t fThetaMin;
79  Double_t fThetaMax;
80  Double_t fPhiMin;
81  Double_t fPhiMax;
82 
83  Double_t fPxMin;
84  Double_t fPxMax;
85  Double_t fPyMin;
86  Double_t fPyMax;
87  Double_t fPzMin;
88  Double_t fPzMax;
89 
90  Double_t fPtMin;
91  Double_t fPtMax;
92  Double_t fRapidityMin;
93  Double_t fRapidityMax;
94 
95  Int_t fKinCutType;
96 
97  Double_t fEtotMin;
98  Double_t fEtotMax;
99 
100  Bool_t fStorePrim;
101  Bool_t fStoreSec;
102 
103  Double_t fStepSizeMin;
104 
108  TClonesArray* fTrackCollection;
109 
110  TGeoTrack* fCurrentTrk;
111 
112  public:
113  TGeoTrack* AddTrack(Int_t trackId, Int_t pdgCode);
114  TGeoTrack* AddTrack(TParticle* p);
115  TGeoTrack* CheckAddTrack(Int_t trackId, TParticle* p);
116  TGeoTrack* GetCurrentTrk() { return fCurrentTrk; }
117 
118  void Init(TString brName = "GeoTracks", TString folderName = "MCGeoTrack");
119  void Reset();
125  static FairTrajFilter* Instance();
126 
132  Bool_t IsAccepted(const TParticle* p) const;
133 
141  void SetVertexCut(Double_t vxMin = -2000.,
142  Double_t vyMin = -2000.,
143  Double_t vzMin = -2000.,
144  Double_t vxMax = 2000.,
145  Double_t vyMax = 2000.,
146  Double_t vzMax = 2000.);
147 
156  void SetMomentumCutP(Double_t pMin = 0.,
157  Double_t thetaMin = 0.,
158  Double_t phiMin = 0.,
159  Double_t pMax = 1e10,
160  Double_t thetaMax = TMath::Pi(),
161  Double_t phiMax = TMath::TwoPi());
162 
171  void SetMomentumCutD(Double_t pxMin = -1e10,
172  Double_t pyMin = -1e10,
173  Double_t pzMin = -1e10,
174  Double_t pxMax = 1e10,
175  Double_t pyMax = 1e10,
176  Double_t pzMax = 1e10);
177 
184  void SetPtRapidityCut(Double_t ptMin = 0.,
185  Double_t ptMax = 1e10,
186  Double_t rapidityMin = -1e10,
187  Double_t rapidityMax = 1e10);
188 
194  void SetEnergyCut(Double_t etotMin = 0., Double_t etotMax = 1e10);
195 
200  inline void SetStorePrimaries(Bool_t storePrim = kTRUE) { fStorePrim = storePrim; };
201 
206  inline void SetStoreSecondaries(Bool_t storeSec = kTRUE) { fStoreSec = storeSec; };
207 
213  void SetStepSizeCut(Double_t stepSizeMin = 0.);
214 
219  void GetVertexCut(Double_t& vxMin,
220  Double_t& vyMin,
221  Double_t& vzMin,
222  Double_t& vxMax,
223  Double_t& vyMax,
224  Double_t& vzMax) const;
225 
230  void GetMomentumCutP(Double_t& pMin,
231  Double_t& thetaMin,
232  Double_t& phiMin,
233  Double_t& pMax,
234  Double_t& thetaMax,
235  Double_t& phiMax) const;
236 
241  void GetMomentumCutD(Double_t& pxMin,
242  Double_t& pyMin,
243  Double_t& pzMin,
244  Double_t& pxMax,
245  Double_t& pyMax,
246  Double_t& pzMax) const;
247 
252  void GetPtRapidityCut(Double_t& ptMin, Double_t& ptMax, Double_t& rapidityMin, Double_t& rapidityMax) const;
253 
258  void GetEnergyCut(Double_t& etotMin, Double_t& etotMax) const;
259 
264  inline Bool_t IsPrimariesStored() const { return fStorePrim; };
265 
270  inline Bool_t IsSecondariesStored() const { return fStoreSec; };
271 
277  inline Double_t GetStepSizeCut() const { return fStepSizeMin; };
278 
279  TGeoTrack* GetTrack(Int_t trackId);
280 };
281 
282 #endif
void SetStepSizeCut(Double_t stepSizeMin=0.)
void GetMomentumCutP(Double_t &pMin, Double_t &thetaMin, Double_t &phiMin, Double_t &pMax, Double_t &thetaMax, Double_t &phiMax) const
void SetMomentumCutP(Double_t pMin=0., Double_t thetaMin=0., Double_t phiMin=0., Double_t pMax=1e10, Double_t thetaMax=TMath::Pi(), Double_t phiMax=TMath::TwoPi())
Double_t GetStepSizeCut() const
Bool_t IsAccepted(const TParticle *p) const
void SetMomentumCutD(Double_t pxMin=-1e10, Double_t pyMin=-1e10, Double_t pzMin=-1e10, Double_t pxMax=1e10, Double_t pyMax=1e10, Double_t pzMax=1e10)
ClassDef(FairTrajFilter, 1)
virtual ~FairTrajFilter()
void GetMomentumCutD(Double_t &pxMin, Double_t &pyMin, Double_t &pzMin, Double_t &pxMax, Double_t &pyMax, Double_t &pzMax) const
Bool_t IsPrimariesStored() const
Bool_t IsSecondariesStored() const
TGeoTrack * GetCurrentTrk()
TGeoTrack * GetTrack(Int_t trackId)
TGeoTrack * CheckAddTrack(Int_t trackId, TParticle *p)
void SetStoreSecondaries(Bool_t storeSec=kTRUE)
static FairTrajFilter * Instance()
void SetStorePrimaries(Bool_t storePrim=kTRUE)
void GetEnergyCut(Double_t &etotMin, Double_t &etotMax) const
TGeoTrack * AddTrack(Int_t trackId, Int_t pdgCode)
void SetVertexCut(Double_t vxMin=-2000., Double_t vyMin=-2000., Double_t vzMin=-2000., Double_t vxMax=2000., Double_t vyMax=2000., Double_t vzMax=2000.)
void GetPtRapidityCut(Double_t &ptMin, Double_t &ptMax, Double_t &rapidityMin, Double_t &rapidityMax) const
void SetEnergyCut(Double_t etotMin=0., Double_t etotMax=1e10)
void GetVertexCut(Double_t &vxMin, Double_t &vyMin, Double_t &vzMin, Double_t &vxMax, Double_t &vyMax, Double_t &vzMax) const
void SetPtRapidityCut(Double_t ptMin=0., Double_t ptMax=1e10, Double_t rapidityMin=-1e10, Double_t rapidityMax=1e10)
void Init(TString brName="GeoTracks", TString folderName="MCGeoTrack")