CbmRoot
CbmHRGModel.h
Go to the documentation of this file.
1 /*
2  *====================================================================
3  *
4  * CBM Hadron Resonance Gas
5  *
6  * Authors: V.Vovchenko
7  *
8  * e-mail :
9  *
10  *====================================================================
11  *
12  * Statistical hadron-resonance gas model calculations
13  *
14  *====================================================================
15  */
16 
17 #ifndef _CbmHRGModel_h_
18 #define _CbmHRGModel_h_
19 
21 #include "CbmModelBase.h"
23 #include "TMath.h"
24 #include "ThermalModelFit.h"
25 #include <algorithm>
26 #include <map>
27 #include <vector>
28 
29 class TClonesArray;
30 class CbmVertex;
31 class TDirectory;
32 class TH1F;
33 class TH2F;
34 class TGraphErrors;
35 class TSpline3;
36 class FairRootManager;
37 
38 namespace HRGModelNamespace {
39 
41  Double_t dy, dpt;
42  std::vector<Double_t> ys, pts, probs;
44  void setSpline() { sfunc.setData(ys, pts, probs); }
45  Double_t getAcceptance(const Double_t& y, const Double_t& pt) const;
46  AcceptanceFunction() : dy(), dpt(), ys(), pts(), probs(), sfunc() {}
47  };
48 
50  Double_t p1, p2, p3;
52  double p2_ = 0.,
53  double p3_ = 1.)
54  : p1(p1_), p2(p2_), p3(p3_) {}
55  Double_t f(double p) { return p1 - p2 * TMath::Exp(-p * p / 2. / p3 / p3); }
56  };
57 } // namespace HRGModelNamespace
58 
59 using namespace HRGModelNamespace;
60 
61 class ThermalModelBase;
62 
63 class CbmHRGModel : public CbmModelBase {
64 public:
65  //static const int p_sz = 8;
67  Int_t recoLevel =
68  -1, // -1 - MC Tracks, 0 - Reconstructible MC Tracks, 1 - Reco Tracks with MC Data, 2 - Reco Tracks with Reco Momentum and MC Primary, 3 - Reco Tracks with Reco Momentum and Reco Primary
69  //Int_t usePID = 1, // 1 - MC, 2 - TOF
70  //Int_t trackNumber = 1,
71  Int_t iVerbose = 1,
72  TString Mode = "MC",
73  Int_t EventStats = 1,
74  KFParticleTopoReconstructor* tr = 0,
75  Bool_t useWidth = 0,
76  Bool_t useStatistics = 0,
77  Double_t rad = 0.);
78  ~CbmHRGModel();
79 
80  virtual void ReInit(FairRootManager* fManger);
81  virtual void Init();
82  virtual void Exec();
83  virtual void Finish();
84 
85  void AddRatio(int pdgid1,
86  int pdgid2,
87  /*TString name1="", TString name2="",*/ double SystError = 0.);
88 
90 
91 private:
93  TString filename);
94 
95  Double_t RecEfficiency(Double_t p);
96  bool checkIfReconstructable(CbmKFTrErrMCPoints* inTrack); // 0 - No, 1 - Yes
97 
98  void CalculateMultiplicitiesInEvent(std::vector<int>& Mult,
99  int RecoLevel,
100  bool UpdateGlobal = 0);
101 
102  ThermalModelFitParameters GetThermalParameters(const std::vector<int>& Mults);
103 
104  Float_t ekin;
105  Float_t ycm;
106  Bool_t fUpdate;
107  Int_t fusePID;
108  Int_t fRecoLevel;
109  Int_t fTrackNumber; // 0 - test calculation, only Pions, 1 - UrQMD Au+Au
110  Int_t fEventStats;
111  Int_t events;
112 
113  Bool_t fUseWidth, fUseStatistics;
114  double fRadius;
115 
116 
117  TString fModeName;
118  TString outfileName;
119 
120  TDirectory* histodir;
121 
122  TClonesArray* flistMCTracks;
123 
124  //Int_t events;
125 
126  static const int nHisto1D =
127  15; //T,errT,muB,errmuB,muS,errmuS,muQ,errmuQ,nB,energy,entropy,pressure,energy per particle,etaovers,chi2fit
128  int IndexTemperature, IndexErrorTemperature, IndexMuB, IndexErrorMuB,
129  IndexMuS, IndexErrorMuS, IndexMuQ, IndexErrorMuQ, IndexnB, IndexEnergy,
130  IndexEntropy, IndexPressure, IndexEoverN, IndexEtaoverS, IndexChi2Fit;
131 
132  TH1F* histo1D[nHisto1D];
133 
134  static const int nHisto2D = 3; //T-muB,T-nB,T-energy
135  int IndexTmuB, IndexTnB, IndexTE;
136 
137  TH2F* histo2D[nHisto2D];
138 
139  TGraphErrors* grTmuB;
140  TH1F *pullT, *pullmuB;
141  std::vector<double> Ts, muB, errT, errmuB;
142 
143  std::map<int, int> PDGtoIndex;
144  std::vector<int> ParticlePDGsTrack;
145  std::vector<TString> ParticleNames;
146  std::vector<std::pair<int, int>> RatiosToFit;
147  std::vector<double> SystErrors;
148  std::vector<int> MultGlobal, MultLocal;
149 
151 
154 
156 
158 };
159 
160 #endif
CbmHRGModel::ycm
Float_t ycm
Definition: CbmHRGModel.h:105
CbmHRGModel::Ts
std::vector< double > Ts
Definition: CbmHRGModel.h:141
CbmHRGModel::ParticlePDGsTrack
std::vector< int > ParticlePDGsTrack
Definition: CbmHRGModel.h:144
HRGModelNamespace::AcceptanceFunction::getAcceptance
Double_t getAcceptance(const Double_t &y, const Double_t &pt) const
Definition: CbmHRGModel.cxx:80
CbmHRGModel::fusePID
Int_t fusePID
Definition: CbmHRGModel.h:107
HRGModelNamespace::ReconstructionEfficiencyFunction::p1
Double_t p1
Definition: CbmHRGModel.h:50
CbmHRGModel::SystErrors
std::vector< double > SystErrors
Definition: CbmHRGModel.h:147
CbmHRGModel::fUpdate
Bool_t fUpdate
Definition: CbmHRGModel.h:106
CbmHRGModel::ParticleNames
std::vector< TString > ParticleNames
Definition: CbmHRGModel.h:145
HRGModelNamespace::ReconstructionEfficiencyFunction::f
Double_t f(double p)
Definition: CbmHRGModel.h:55
CbmHRGModel::MultLocal
std::vector< int > MultLocal
Definition: CbmHRGModel.h:148
CbmHRGModel::fEventStats
Int_t fEventStats
Definition: CbmHRGModel.h:110
CbmHRGModel::IndexTemperature
int IndexTemperature
Definition: CbmHRGModel.h:128
CbmHRGModel::model
ThermalModelBase * model
Definition: CbmHRGModel.h:157
HRGModelNamespace::AcceptanceFunction::ys
std::vector< Double_t > ys
Definition: CbmHRGModel.h:42
HRGModelNamespace::AcceptanceFunction::setSpline
void setSpline()
Definition: CbmHRGModel.h:44
CbmKFTrErrMCPoints.h
ThermalModelBase
Definition: ThermalModelBase.h:18
HRGModelNamespace::ReconstructionEfficiencyFunction
Definition: CbmHRGModel.h:49
BilinearSplineFunction::setData
void setData(const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &vals)
Definition: CbmBilinearSplineFunction.h:36
HRGModelNamespace::ReconstructionEfficiencyFunction::p2
Double_t p2
Definition: CbmHRGModel.h:50
CbmHRGModel::fTrackNumber
Int_t fTrackNumber
Definition: CbmHRGModel.h:109
CbmHRGModel::PDGtoIndex
std::map< int, int > PDGtoIndex
Definition: CbmHRGModel.h:143
CbmHRGModel::fModeName
TString fModeName
Definition: CbmHRGModel.h:117
CbmModelBase.h
CbmHRGModel::CbmHRGModel
CbmHRGModel(Int_t recoLevel=-1, Int_t iVerbose=1, TString Mode="MC", Int_t EventStats=1, KFParticleTopoReconstructor *tr=0, Bool_t useWidth=0, Bool_t useStatistics=0, Double_t rad=0.)
ThermalModelFitParameters
Definition: ThermalModelFit.h:79
CbmVertex
Definition: CbmVertex.h:26
CbmHRGModel::TPS
ThermalParticleSystem TPS
Definition: CbmHRGModel.h:155
CbmKFTrErrMCPoints
Definition: CbmKFTrErrMCPoints.h:32
HRGModelNamespace
Definition: CbmHRGModel.cxx:73
CbmHRGModel::RatiosToFit
std::vector< std::pair< int, int > > RatiosToFit
Definition: CbmHRGModel.h:146
CbmHRGModel::ClassDef
ClassDef(CbmHRGModel, 1)
CbmHRGModel::fRadius
double fRadius
Definition: CbmHRGModel.h:114
CbmHRGModel::flistMCTracks
TClonesArray * flistMCTracks
Definition: CbmHRGModel.h:122
CbmModelBase
Definition: CbmModelBase.h:25
CbmHRGModel::events
Int_t events
Definition: CbmHRGModel.h:111
BilinearSplineFunction
Definition: CbmBilinearSplineFunction.h:21
HRGModelNamespace::AcceptanceFunction::dpt
Double_t dpt
Definition: CbmHRGModel.h:41
HRGModelNamespace::AcceptanceFunction::AcceptanceFunction
AcceptanceFunction()
Definition: CbmHRGModel.h:46
HRGModelNamespace::AcceptanceFunction::probs
std::vector< Double_t > probs
Definition: CbmHRGModel.h:42
HRGModelNamespace::ReconstructionEfficiencyFunction::ReconstructionEfficiencyFunction
ReconstructionEfficiencyFunction(double p1_=1., double p2_=0., double p3_=1.)
Definition: CbmHRGModel.h:51
CbmHRGModel
Definition: CbmHRGModel.h:63
HRGModelNamespace::AcceptanceFunction::pts
std::vector< Double_t > pts
Definition: CbmHRGModel.h:42
ThermalParticleSystem
Definition: ThermalParticleSystem.h:7
CbmHRGModel::histodir
TDirectory * histodir
Definition: CbmHRGModel.h:120
CbmHRGModel::operator=
CbmHRGModel & operator=(const CbmHRGModel &)
CbmHRGModel::AcceptanceSTSTOF
HRGModelNamespace::AcceptanceFunction AcceptanceSTSTOF
Definition: CbmHRGModel.h:150
CbmHRGModel::IndexPressure
int IndexPressure
Definition: CbmHRGModel.h:130
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
Acceptance::ReadAcceptanceFunction
int ReadAcceptanceFunction(AcceptanceFunction &func, TString filename)
Definition: Acceptance.cxx:7
CbmHRGModel::IndexTnB
int IndexTnB
Definition: CbmHRGModel.h:135
CbmHRGModel::outfileName
TString outfileName
Definition: CbmHRGModel.h:118
CbmHRGModel::fUseWidth
Bool_t fUseWidth
Definition: CbmHRGModel.h:113
CbmHRGModel::ekin
Float_t ekin
Definition: CbmHRGModel.h:104
CbmHRGModel::CbmHRGModel
CbmHRGModel(const CbmHRGModel &)
CbmBilinearSplineFunction.h
HRGModelNamespace::AcceptanceFunction
Definition: CbmHRGModel.h:40
HRGModelNamespace::AcceptanceFunction::sfunc
BilinearSplineFunction sfunc
Definition: CbmHRGModel.h:43
CbmHRGModel::IndexnB
int IndexnB
Definition: CbmHRGModel.h:129
CbmHRGModel::fRecoLevel
Int_t fRecoLevel
Definition: CbmHRGModel.h:108
ThermalModelFit.h
CbmHRGModel::pullT
TH1F * pullT
Definition: CbmHRGModel.h:140
HRGModelNamespace::AcceptanceFunction::dy
Double_t dy
Definition: CbmHRGModel.h:41
HRGModelNamespace::ReconstructionEfficiencyFunction::p3
Double_t p3
Definition: CbmHRGModel.h:50
CbmHRGModel::grTmuB
TGraphErrors * grTmuB
Definition: CbmHRGModel.h:139