CbmRoot
CbmFastSim.h
Go to the documentation of this file.
1 #ifndef CBMFASTSIM_H
2 #define CBMFASTSIM_H 1
3 
4 
5 #include "FairTask.h"
6 #include "TClonesArray.h"
7 #include "TH1.h"
8 #include "TH2.h"
9 #include "TH3.h"
10 #include "TMatrixD.h"
11 #include "TString.h"
12 #include "TVector3.h"
13 #include <list>
14 #include <string>
15 
16 class TObjectArray;
17 class TRandom3;
18 class TLorentzVector;
19 class TParticle;
20 class TF1;
21 class TH2;
22 class TProfile3D;
23 class THnBase;
24 class TDatabasePDG;
26 
27 class CbmFastSim : public FairTask {
28 
29 public:
30  enum EParticleType { kEle = 0, kPio, kKao, kPro, kMuo, kGam };
31 
37  kLastDim
38  };
39 
41  CbmFastSim(bool persist = true);
42 
44  ~CbmFastSim();
45 
46  void Register();
47 
49  virtual InitStatus Init();
50  virtual void InitTask();
51 
52  virtual void Finish();
53 
54 
56  virtual void Exec(Option_t* opt);
57 
58  void SetLookupEfficiency(THnBase* nom, THnBase* denom, EParticleType part);
59  void SetLookupResolutionP(TH2F* obj, EParticleType part) { fRFp[part] = obj; }
60  void SetEfficiencyMethod(EEfficiencyMethod method) { fMethod = method; }
61 
62  void SetSeed(unsigned int seed = 65539);
63 
64 private:
65  TRandom3* fRand;
66  TDatabasePDG* fdbPdg;
67  static const Int_t fgkNParts = 8; // numer of different particle species
68  EEfficiencyMethod fMethod = kIgnoreFluct; // efficiency caluclations
69 
71  Bool_t PassEfficiencyFilter(Int_t pdg, Double_t* vals, Int_t* coord);
72  Double_t GetEfficiency(Int_t idx, Double_t* vals, Int_t* coord);
73 
74  Bool_t Smearing(TLorentzVector* p4, Int_t pdg);
75  Double_t AnalyzeMap(TH2F* map, Double_t refValue);
76 
77  virtual Bool_t IsSelected(TObject* sel, Int_t opt);
78 
80  TClonesArray* fFastTracks = NULL;
81 
83  THnBase* fEFF[fgkNParts]; // efficiency(nominator) map
84  THnBase* fEFFdenom[fgkNParts]; // denominator map
85  TH1* fEFFproj[fgkNParts][10]; // projections (method dependent)
86 
87  TH2F* fRFp[fgkNParts]; // smearing matrix
88 
90  virtual void SetParContainers();
91 
92  CbmFastSim(const CbmFastSim& obj);
94 
96 };
97 
98 #endif
CbmFastSim::fRand
TRandom3 * fRand
Definition: CbmFastSim.h:65
CbmFastSim::Exec
virtual void Exec(Option_t *opt)
Definition: CbmFastSim.cxx:211
CbmFastSim::kPio
@ kPio
Definition: CbmFastSim.h:30
PairAnalysisFunction
Definition: PairAnalysisFunction.h:22
CbmFastSim::fMethod
EEfficiencyMethod fMethod
Definition: CbmFastSim.h:68
CbmFastSim::fgkNParts
static const Int_t fgkNParts
Definition: CbmFastSim.h:67
CbmFastSim::ClassDef
ClassDef(CbmFastSim, 1)
CbmFastSim::kAverage
@ kAverage
Definition: CbmFastSim.h:35
CbmFastSim::fFastTracks
TClonesArray * fFastTracks
Definition: CbmFastSim.h:80
CbmFastSim::GetEfficiency
Double_t GetEfficiency(Int_t idx, Double_t *vals, Int_t *coord)
Definition: CbmFastSim.cxx:523
CbmFastSim::SetParContainers
virtual void SetParContainers()
Definition: CbmFastSim.cxx:184
CbmFastSim::kEle
@ kEle
Definition: CbmFastSim.h:30
CbmFastSim::kInterpolate
@ kInterpolate
Definition: CbmFastSim.h:34
CbmFastSim::fRFp
TH2F * fRFp[fgkNParts]
Definition: CbmFastSim.h:87
CbmFastSim::EParticleType
EParticleType
Definition: CbmFastSim.h:30
CbmFastSim::Smearing
Bool_t Smearing(TLorentzVector *p4, Int_t pdg)
Definition: CbmFastSim.cxx:365
CbmFastSim::Init
virtual InitStatus Init()
Definition: CbmFastSim.cxx:104
CbmFastSim::AnalyzeMap
Double_t AnalyzeMap(TH2F *map, Double_t refValue)
Definition: CbmFastSim.cxx:409
CbmFastSim::IsSelected
virtual Bool_t IsSelected(TObject *sel, Int_t opt)
Definition: CbmFastSim.cxx:594
CbmFastSim::Register
void Register()
Definition: CbmFastSim.cxx:90
CbmFastSim
Definition: CbmFastSim.h:27
CbmFastSim::kFactorize
@ kFactorize
Definition: CbmFastSim.h:36
CbmFastSim::PassEfficiencyFilter
Bool_t PassEfficiencyFilter(Int_t pdg, Double_t *vals, Int_t *coord)
Definition: CbmFastSim.cxx:305
CbmFastSim::~CbmFastSim
~CbmFastSim()
Definition: CbmFastSim.cxx:74
CbmFastSim::SetEfficiencyMethod
void SetEfficiencyMethod(EEfficiencyMethod method)
Definition: CbmFastSim.h:60
CbmFastSim::fEFFdenom
THnBase * fEFFdenom[fgkNParts]
Definition: CbmFastSim.h:84
CbmFastSim::SetLookupEfficiency
void SetLookupEfficiency(THnBase *nom, THnBase *denom, EParticleType part)
Definition: CbmFastSim.cxx:455
CbmFastSim::fdbPdg
TDatabasePDG * fdbPdg
Definition: CbmFastSim.h:66
CbmFastSim::CbmFastSim
CbmFastSim(bool persist=true)
Definition: CbmFastSim.cxx:55
CbmFastSim::kLastDim
@ kLastDim
Definition: CbmFastSim.h:37
CbmFastSim::Finish
virtual void Finish()
Definition: CbmFastSim.cxx:203
CbmFastSim::kPro
@ kPro
Definition: CbmFastSim.h:30
CbmFastSim::CbmFastSim
CbmFastSim(const CbmFastSim &obj)
CbmFastSim::kMuo
@ kMuo
Definition: CbmFastSim.h:30
CbmFastSim::InitTask
virtual void InitTask()
Definition: CbmFastSim.cxx:101
CbmFastSim::kIgnoreFluct
@ kIgnoreFluct
Definition: CbmFastSim.h:33
CbmFastSim::SetLookupResolutionP
void SetLookupResolutionP(TH2F *obj, EParticleType part)
Definition: CbmFastSim.h:59
CbmFastSim::fEFF
THnBase * fEFF[fgkNParts]
Definition: CbmFastSim.h:83
CbmFastSim::EEfficiencyMethod
EEfficiencyMethod
Definition: CbmFastSim.h:32
CbmFastSim::fEFFproj
TH1 * fEFFproj[fgkNParts][10]
Definition: CbmFastSim.h:85
CbmFastSim::operator=
CbmFastSim & operator=(const CbmFastSim &obj)
CbmFastSim::SetSeed
void SetSeed(unsigned int seed=65539)
Definition: CbmFastSim.cxx:195
CbmFastSim::kKao
@ kKao
Definition: CbmFastSim.h:30
CbmFastSim::kGam
@ kGam
Definition: CbmFastSim.h:30