27 #include "TClonesArray.h"
28 #include "TDirectory.h"
33 #include "TGraphErrors.h"
42 #include "TStopwatch.h"
54 #include "CbmTofHit.h"
56 #include "TDatabasePDG.h"
63 #include "KFPTrackVector.h"
64 #include "KFParticleTopoReconstructor.h"
81 const Double_t& pt)
const {
83 if (ret < 0.) ret = 0.;
84 if (ret > 1.) ret = 1.;
99 KFParticleTopoReconstructor* tr,
101 Bool_t useStatistics,
109 fRecoLevel(recoLevel)
112 fEventStats(EventStats)
119 , fUseStatistics(useStatistics)
128 , IndexTemperature(0)
129 , IndexErrorTemperature(0)
154 , ParticlePDGsTrack()
180 TDirectory* currentDir = gDirectory;
182 gDirectory->cd(
"Models");
184 histodir = gDirectory;
186 gDirectory->mkdir(
"HadronResonanceGasModel");
187 gDirectory->cd(
"HadronResonanceGasModel");
188 gDirectory->mkdir(fModeName);
189 gDirectory->cd(fModeName);
190 TString tname =
"PerEvent";
191 if (fEventStats != 1)
193 TString(
"Each ") + TString::Itoa(fEventStats, 10) + TString(
" events");
194 gDirectory->mkdir(tname);
195 gDirectory->cd(tname);
196 int CurrentIndex = 0;
198 IndexTemperature = CurrentIndex;
199 histo1D[CurrentIndex] =
200 new TH1F(
"Temperature",
"Event-by-event temperature", 300, 0., 0.2 * 1000.);
201 histo1D[CurrentIndex]->SetXTitle(
"T (MeV)");
202 histo1D[CurrentIndex]->SetYTitle(
"Entries");
205 IndexErrorTemperature = CurrentIndex;
206 histo1D[CurrentIndex] =
new TH1F(
"Temperature error",
207 "Event-by-event temperature error",
211 histo1D[CurrentIndex]->SetXTitle(
"Delta T (MeV)");
212 histo1D[CurrentIndex]->SetYTitle(
"Entries");
215 IndexMuB = CurrentIndex;
216 histo1D[CurrentIndex] =
new TH1F(
"Baryon chemical potential",
217 "Event-by-event baryon chemical potential",
221 histo1D[CurrentIndex]->SetXTitle(
"#mu_{B} (MeV)");
222 histo1D[CurrentIndex]->SetYTitle(
"Entries");
225 IndexErrorMuB = CurrentIndex;
226 histo1D[CurrentIndex] =
227 new TH1F(
"Baryon chemical potential error",
228 "Event-by-event baryon chemical potential error",
232 histo1D[CurrentIndex]->SetXTitle(
"Delta #mu_{B} (MeV)");
233 histo1D[CurrentIndex]->SetYTitle(
"Entries");
236 IndexMuS = CurrentIndex;
237 histo1D[CurrentIndex] =
238 new TH1F(
"Strangeness chemical potential",
239 "Event-by-event strangeness chemical potential",
243 histo1D[CurrentIndex]->SetXTitle(
"#mu_{S} (MeV)");
244 histo1D[CurrentIndex]->SetYTitle(
"Entries");
247 IndexErrorMuS = CurrentIndex;
248 histo1D[CurrentIndex] =
249 new TH1F(
"Strangeness chemical potential error",
250 "Event-by-event baryon strangeness potential error",
254 histo1D[CurrentIndex]->SetXTitle(
"Delta #mu_{S} (MeV)");
255 histo1D[CurrentIndex]->SetYTitle(
"Entries");
258 IndexMuQ = CurrentIndex;
259 histo1D[CurrentIndex] =
new TH1F(
"Charge chemical potential",
260 "Event-by-event baryon chemical potential",
264 histo1D[CurrentIndex]->SetXTitle(
"#mu_{Q} (MeV)");
265 histo1D[CurrentIndex]->SetYTitle(
"Entries");
268 IndexErrorMuQ = CurrentIndex;
269 histo1D[CurrentIndex] =
270 new TH1F(
"Charge chemical potential error",
271 "Event-by-event charge chemical potential error",
275 histo1D[CurrentIndex]->SetXTitle(
"Delta muQ (MeV)");
276 histo1D[CurrentIndex]->SetYTitle(
"Entries");
279 IndexnB = CurrentIndex;
280 histo1D[CurrentIndex] =
new TH1F(
281 "Net baryon density",
"Event-by-event net baryon density", 100, 0., 0.2);
282 histo1D[CurrentIndex]->SetXTitle(
"n_{B} (fm^{-3})");
283 histo1D[CurrentIndex]->SetYTitle(
"Entries");
286 IndexEnergy = CurrentIndex;
287 histo1D[CurrentIndex] =
new TH1F(
288 "Energy density",
"Event-by-event energy density", 100, 0., 1. * 1000.);
289 histo1D[CurrentIndex]->SetXTitle(
"#varepsilon (MeV/fm^{3})");
290 histo1D[CurrentIndex]->SetYTitle(
"Entries");
293 IndexEntropy = CurrentIndex;
294 histo1D[CurrentIndex] =
295 new TH1F(
"Entropy density",
"Event-by-event entropy density", 100, 0., 10.);
296 histo1D[CurrentIndex]->SetXTitle(
"s (fm^{-3})");
297 histo1D[CurrentIndex]->SetYTitle(
"Entries");
300 IndexPressure = CurrentIndex;
301 histo1D[CurrentIndex] =
302 new TH1F(
"Pressure",
"Event-by-event pressure", 100, 0., 0.2);
303 histo1D[CurrentIndex]->SetXTitle(
"P (GeV/fm^{3})");
304 histo1D[CurrentIndex]->SetYTitle(
"Entries");
307 IndexEoverN = CurrentIndex;
308 histo1D[CurrentIndex] =
new TH1F(
309 "Energy per hadron",
"Event-by-event energy per hadron", 100, 0., 3.);
310 histo1D[CurrentIndex]->SetXTitle(
"E/N (GeV)");
311 histo1D[CurrentIndex]->SetYTitle(
"Entries");
314 IndexEtaoverS = CurrentIndex;
315 histo1D[CurrentIndex] =
new TH1F(
"Shear viscosity to entropy density ratio",
316 "Event-by-event viscosity to entropy",
320 histo1D[CurrentIndex]->SetXTitle(
"#eta/s");
321 histo1D[CurrentIndex]->SetYTitle(
"Entries");
324 IndexChi2Fit = CurrentIndex;
325 histo1D[CurrentIndex] =
326 new TH1F(
"chi2/ndf",
"Event-by-event chi2/ndf", 100, 0., 20.);
327 histo1D[CurrentIndex]->SetXTitle(
"#chi^{2}/ndf");
328 histo1D[CurrentIndex]->SetYTitle(
"Entries");
332 IndexTmuB = CurrentIndex;
333 histo2D[CurrentIndex] =
new TH2F(
"T-muB",
334 "Event-by-event T-muB",
341 histo2D[CurrentIndex]->SetXTitle(
"#mu_{B} (MeV)");
342 histo2D[CurrentIndex]->SetYTitle(
"T (MeV)");
345 IndexTnB = CurrentIndex;
346 histo2D[CurrentIndex] =
347 new TH2F(
"T-nB",
"Event-by-event T-nB", 100, 0., 0.3, 100, 0., 0.2 * 1000.);
348 histo2D[CurrentIndex]->SetXTitle(
"n_{B} (fm^{-3})");
349 histo2D[CurrentIndex]->SetYTitle(
"T (MeV)");
352 IndexTE = CurrentIndex;
353 histo2D[CurrentIndex] =
new TH2F(
354 "T-en",
"Event-by-event T-en", 100, 0., 0.3 * 1000., 100, 0., 0.2 * 1000.);
355 histo2D[CurrentIndex]->SetXTitle(
"#varepsilon (MeV/fm^{3})");
356 histo2D[CurrentIndex]->SetYTitle(
"T (MeV)");
359 pullT =
new TH1F(
"Pull T",
"Event-by-event pull T", 300, -5., 5.);
360 pullT->SetXTitle(
"Pull T");
361 pullT->SetYTitle(
"Entries");
363 pullmuB =
new TH1F(
"Pull muB",
"Event-by-event pull muB", 300, -5., 5.);
364 pullmuB->SetXTitle(
"Pull muB");
365 pullmuB->SetYTitle(
"Entries");
367 grTmuB =
new TGraphErrors();
368 grTmuB->SetTitle(
"Event-by-event T-muB");
369 grTmuB->GetXaxis()->SetTitle(
"#mu_{B} (MeV)");
370 grTmuB->GetYaxis()->SetTitle(
"T (MeV)");
371 grTmuB->SetName(TString(
"T-muB-") + fModeName);
372 gDirectory->Add(grTmuB);
374 gDirectory->cd(
"..");
375 gDirectory->cd(
"..");
376 gDirectory->cd(
"..");
378 gDirectory = currentDir;
383 ycm = 0.5 *
log((1. + betacm) / (1. - betacm));
387 TString work = getenv(
"VMCWORKDIR");
388 TString dir = work +
"/KF/KFModelParameters/HRGModel/";
401 double ymin = 0., ymax = 6.;
402 double ptmin = 0., ptmax = 2.5;
405 func.
probs.resize(0);
406 ifstream fin(filename.Data());
407 fin >> func.
dy >> func.
dpt;
408 double ty, tpt, prob;
411 func.
probs.resize(0);
412 while (fin >> ty >> tpt >> prob) {
413 if (tpt < ptmin || tpt > ptmax || ty < ymin || ty > ymax)
continue;
414 func.
ys.push_back(ty);
415 func.
pts.push_back(tpt);
416 func.
probs.push_back(prob);
423 flistMCTracks =
dynamic_cast<TClonesArray*
>(fManger->GetObject(
"MCTrack"));
460 double tmpdens = 0., tmpenerd = 0.;
461 double tmpeta = 0., tmpsdens = 0.;
467 || params.
T.
error * 1.e3 > 20. || params.
T.
value > 0.160)
468 std::cout <<
"Fit failed!" << endl;
481 Ts.push_back(params.
T.
value * 1.e3);
523 std::cout <<
"nB = " << tmpdens << endl;
524 std::cout <<
"eta/s = "
554 double Z = 79., B = 197., QBmod = Z / B;
559 double err1 =
sqrt(n1);
560 double err2 =
sqrt(n2);
562 sqrt(err1 * err1 / n2 / n2 + n1 * n1 / n2 / n2 / n2 / n2 * err2 * err2);
563 double rat = n1 / n2;
568 << n1 / n2 <<
" " << terr <<
" " << n1 <<
" " << n2 <<
"\n";
572 if (n1 != 0 && n2 != 0)
579 std::cout <<
"Bad ratio "
582 << n1 / n2 <<
" " << terr <<
" " << n1 <<
" " << n2 <<
"\n";
583 std::cout <<
"Aborting fit\n";
595 return 0.99 - 0.98 *
exp(-p * p / 2. / 0.135 / 0.135);
597 return 0.98 - 0.88 *
exp(-p * p / 2. / 0.2 / 0.2);
604 if (
fusePID == 2 && tofHits == 0)
return 0;
606 for (
int hit = 0; hit < stsHits; ++hit) {
608 static_cast<int>((inTrack->
GetStsPoint(hit)->GetZ() + 5.) / 10.));
610 sort(hitz.begin(), hitz.end());
611 for (
int hit1 = 0; hit1 < stsHits - 3; ++hit1) {
612 int station1 = hitz[hit1];
613 int hitsConsecutive = 1;
614 for (
int hit2 = hit1 + 1; hit2 < stsHits && hitsConsecutive < 4; ++hit2) {
615 int station2 = hitz[hit2];
616 if (station2 == station1)
continue;
617 if (station2 - station1 > 1)
break;
618 if (station2 - station1 == 1) {
623 if (hitsConsecutive == 4)
return 1;
632 for (
unsigned int i = 0;
i <
Ts.size(); ++
i) {
636 grTmuB->GetXaxis()->SetLimits(0., 600.);
639 grTmuB->GetYaxis()->SetLimits(0., 200.);
647 int pIndex1 = -1, pIndex2 = -1;
657 TString(TDatabasePDG::Instance()->GetParticle(pdgid1)->GetName()));
670 TString(TDatabasePDG::Instance()->GetParticle(pdgid2)->GetName()));
681 if (RecoLevel == -1) {
682 vector<CbmMCTrack> vRTracksMC;
684 std::cout <<
"MC tracks: " << nTracksMC <<
"\n";
685 vRTracksMC.resize(nTracksMC);
686 for (
int iTr = 0; iTr < nTracksMC; iTr++)
690 for (
int iTr = 0; iTr < nTracksMC; iTr++) {
694 && vRTracksMC[iTr].GetMotherId() == -1) {
702 for (
int itype = 2; itype <= 3; ++itype) {
704 const kfvector_int& pdgs = tr.PDG();
705 for (
unsigned int ind = 0; ind < pdgs.size(); ++ind) {
706 int iPDG = pdgs[ind];