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"
83 KFParticleTopoReconstructor* tr,
99 , fRecoLevel(recoLevel)
101 , fEventStats(EventStats)
118 , histo1DIntervals(0)
125 , fMass(TDatabasePDG::Instance()->GetParticle(fPDGID)->Mass())
129 , paramGlobalInterval(0)
130 , param2GlobalInterval(0)
132 , paramLocalInterval(0)
135 , totalGlobalInterval(0)
136 , totalLocalInterval(0)
158 TDirectory* currentDir = gDirectory;
162 gDirectory->cd(
"Models");
164 histodir = gDirectory;
167 sprintf(ccc,
"BoltzmannDistribution %s", name.Data());
168 gDirectory->mkdir(ccc);
170 gDirectory->mkdir(fModeName);
171 gDirectory->cd(fModeName);
172 TString tname =
"PerEvent";
173 if (fEventStats != 1)
175 TString(
"Each ") + TString::Itoa(fEventStats, 10) + TString(
" events");
176 gDirectory->mkdir(tname);
177 gDirectory->cd(tname);
181 int CurrentIndex = 0;
183 IndexT = CurrentIndex;
184 histo1D[CurrentIndex] =
new TH1F(
"T",
"Event-by-event T", 100, 0., 0.4);
185 histo1D[CurrentIndex]->SetXTitle(
"T (GeV)");
186 histo1D[CurrentIndex]->SetYTitle(
"Entries");
189 IndexMt = CurrentIndex;
190 histo1D[CurrentIndex] =
new TH1F(
"f(m_{T})",
"mt distribution", 200, 0., 2.5);
191 histo1D[CurrentIndex]->SetXTitle(
"m_{T} - m_{0} (GeV)");
192 histo1D[CurrentIndex]->SetYTitle(
"Entries");
195 IndexModelMt = CurrentIndex;
196 histo1D[CurrentIndex] =
197 new TH1F(
"Model f(m_{T})",
"Model mt distribution", 200, 0., 2.5);
198 histo1D[CurrentIndex]->SetXTitle(
"m_{T} - m_{0} (GeV)");
199 histo1D[CurrentIndex]->SetYTitle(
"Entries");
202 IndexMt2 = CurrentIndex;
203 histo1D[CurrentIndex] =
204 new TH1F(
"f2(m_{T})",
"mt2 distribution", 40, 0., 2.5);
205 histo1D[CurrentIndex]->SetXTitle(
"m_{T} - m_{0} (GeV)");
206 histo1D[CurrentIndex]->SetYTitle(
207 "#frac{1}{N} #frac{dN}{m_{T} dm_{T}} [(GeV)^{-2}]");
210 IndexModelMt2 = CurrentIndex;
211 histo1D[CurrentIndex] =
212 new TH1F(
"Model f2(m_{T})",
"Model mt2 distribution", 200, 0., 2.5);
213 histo1D[CurrentIndex]->SetXTitle(
"m_{T} - m_{0} (GeV)");
214 histo1D[CurrentIndex]->SetYTitle(
215 "#frac{1}{N} #frac{dN}{m_{T} dm_{T}} [(GeV)^{-2}]");
218 IndexModelMt4Pi = CurrentIndex;
219 histo1D[CurrentIndex] =
220 new TH1F(
"Model f2(m_{T}) 4Pi",
"Model mt2 distribution", 200, 0., 2.5);
221 histo1D[CurrentIndex]->SetXTitle(
"m_{T} - m_{0} (GeV)");
222 histo1D[CurrentIndex]->SetYTitle(
223 "#frac{1}{N} #frac{dN}{m_{T} dm_{T}} [(GeV)^{-2}]");
226 histodndy =
new TH1F(
"dN/dy",
"Rapidity distribution", 40, -3., 3.);
227 histodndy->SetXTitle(
"y");
228 histodndy->SetYTitle(
"dN/dy");
231 new TH1F(
"dN/dy model",
"Rapidity distribution from model", 40, -3., 3.);
232 histodndymodel->SetXTitle(
"y");
233 histodndymodel->SetYTitle(
"dN/dy");
235 grdndyReco =
new TGraphErrors();
236 grdndyReco->SetTitle(
"Rapidity distribution");
237 grdndyReco->GetXaxis()->SetTitle(
"y");
238 grdndyReco->GetYaxis()->SetTitle(
"dN/dy");
239 grdndyReco->SetName(TString(
"dNdy-") + fModeName);
240 gDirectory->Add(grdndyReco);
243 if (fYminv.size() > 0) {
244 histo1DIntervals =
new TH1F**[fYminv.size()];
245 for (
unsigned int ind = 0; ind < fYminv.size(); ++ind) {
246 histo1DIntervals[ind] =
new TH1F*[nHisto1D];
247 char cc[200], cc2[200];
250 sprintf(cc,
"Event-by-event T, %.2lf<y<%.2lf", fYminv[ind], fYmaxv[ind]);
251 sprintf(cc2,
"T, %.2lf<y<%.2lf", fYminv[ind], fYmaxv[ind]);
252 histo1DIntervals[ind][CurrentIndex] =
new TH1F(cc2, cc, 100, 0., 1.);
253 histo1DIntervals[ind][CurrentIndex]->SetXTitle(
"T (GeV)");
254 histo1DIntervals[ind][CurrentIndex]->SetYTitle(
"Entries");
257 sprintf(cc,
"mt distribution, %.2lf<y<%.2lf", fYminv[ind], fYmaxv[ind]);
258 sprintf(cc2,
"f(m_{T}, %.2lf<y<%.2lf", fYminv[ind], fYmaxv[ind]);
259 histo1DIntervals[ind][CurrentIndex] =
new TH1F(cc2, cc, 200, 0., 2.5);
260 histo1DIntervals[ind][CurrentIndex]->SetXTitle(
"m_{T} - m_{0} (GeV)");
261 histo1DIntervals[ind][CurrentIndex]->SetYTitle(
"Entries");
265 cc,
"Model mt distribution, %.2lf<y<%.2lf", fYminv[ind], fYmaxv[ind]);
266 sprintf(cc2,
"Model f(m_{T}), %.2lf<y<%.2lf", fYminv[ind], fYmaxv[ind]);
267 histo1DIntervals[ind][CurrentIndex] =
new TH1F(cc2, cc, 200, 0., 2.5);
268 histo1DIntervals[ind][CurrentIndex]->SetXTitle(
"m_{T} - m_{0} (GeV)");
269 histo1DIntervals[ind][CurrentIndex]->SetYTitle(
"Entries");
272 sprintf(cc,
"mt2 distribution, %.2lf<y<%.2lf", fYminv[ind], fYmaxv[ind]);
273 sprintf(cc2,
"f2(m_{T}, %.2lf<y<%.2lf", fYminv[ind], fYmaxv[ind]);
274 histo1DIntervals[ind][CurrentIndex] =
new TH1F(cc2, cc, 40, 0., 2.5);
275 histo1DIntervals[ind][CurrentIndex]->SetXTitle(
"m_{T} - m_{0} (GeV)");
276 histo1DIntervals[ind][CurrentIndex]->SetYTitle(
277 "#frac{1}{N} #frac{dN}{m_{T} dm_{T}} [(GeV)^{-2}]");
281 cc,
"Model mt2 distribution, %.2lf<y<%.2lf", fYminv[ind], fYmaxv[ind]);
282 sprintf(cc2,
"Model f2(m_{T}), %.2lf<y<%.2lf", fYminv[ind], fYmaxv[ind]);
283 histo1DIntervals[ind][CurrentIndex] =
new TH1F(cc2, cc, 200, 0., 2.5);
284 histo1DIntervals[ind][CurrentIndex]->SetXTitle(
"m_{T} - m_{0} (GeV)");
285 histo1DIntervals[ind][CurrentIndex]->SetYTitle(
286 "#frac{1}{N} #frac{dN}{m_{T} dm_{T}} [(GeV)^{-2}]");
290 "Model mt2 distribution 4Pi, %.2lf<y<%.2lf",
294 cc2,
"Model f2(m_{T}) 4Pi, %.2lf<y<%.2lf", fYminv[ind], fYmaxv[ind]);
295 histo1DIntervals[ind][CurrentIndex] =
new TH1F(cc2, cc, 200, 0., 2.5);
296 histo1DIntervals[ind][CurrentIndex]->SetXTitle(
"m_{T} - m_{0} (GeV)");
297 histo1DIntervals[ind][CurrentIndex]->SetYTitle(
298 "#frac{1}{N} #frac{dN}{m_{T} dm_{T}} [(GeV)^{-2}]");
304 gDirectory->cd(
"..");
305 gDirectory->cd(
"..");
306 gDirectory->cd(
"..");
308 gDirectory = currentDir;
313 ycm = 0.5 *
log((1. + betacm) / (1. - betacm));
318 std::cout <<
"ekin = " << ekin <<
"\n";
319 std::cout <<
"ycm = " << ycm <<
"\n";
323 paramGlobal = paramLocal = 0.;
324 totalGlobal = totalLocal = 0;
325 paramGlobalInterval.resize(0);
326 param2GlobalInterval.resize(0);
327 paramLocalInterval.resize(0);
328 totalGlobalInterval.resize(0);
329 totalLocalInterval.resize(0);
332 if (fRecoLevel == -1 || fRecoLevel > 10)
341 for (
unsigned int ind = 0; ind <
fYminv.size(); ++ind)
361 TDirectory* currentDir = gDirectory;
363 gDirectory->cd(
"Models");
368 sprintf(ccc,
"BoltzmannDistribution %s",
name.Data());
373 TString tname =
"PerEvent";
376 TString(
"Each ") + TString::Itoa(
fEventStats, 10) + TString(
" events");
377 gDirectory->cd(tname);
378 int CurrentIndex = 0;
382 for (
unsigned int ind = 0; ind <
fYminv.size(); ++ind) {
384 sprintf(cc3,
"%.2lf<y<%.2lf",
fYminv[ind],
fYmaxv[ind]);
385 gDirectory->mkdir(cc3);
389 char cc[200], cc2[200];
392 sprintf(cc,
"Event-by-event T, %.2lf<y<%.2lf",
fYminv[ind],
fYmaxv[ind]);
393 sprintf(cc2,
"T, %.2lf<y<%.2lf",
fYminv[ind],
fYmaxv[ind]);
399 sprintf(cc,
"mt distribution, %.2lf<y<%.2lf",
fYminv[ind],
fYmaxv[ind]);
400 sprintf(cc2,
"f(m_{T}, %.2lf<y<%.2lf",
fYminv[ind],
fYmaxv[ind]);
407 cc,
"Model mt distribution, %.2lf<y<%.2lf",
fYminv[ind],
fYmaxv[ind]);
408 sprintf(cc2,
"Model f(m_{T}), %.2lf<y<%.2lf",
fYminv[ind],
fYmaxv[ind]);
414 sprintf(cc,
"mt2 distribution, %.2lf<y<%.2lf",
fYminv[ind],
fYmaxv[ind]);
415 sprintf(cc2,
"f2(m_{T}, %.2lf<y<%.2lf",
fYminv[ind],
fYmaxv[ind]);
419 "#frac{1}{N} #frac{dN}{m_{T} dm_{T}} [(GeV)^{-2}]");
423 cc,
"Model mt2 distribution, %.2lf<y<%.2lf",
fYminv[ind],
fYmaxv[ind]);
424 sprintf(cc2,
"Model f2(m_{T}), %.2lf<y<%.2lf",
fYminv[ind],
fYmaxv[ind]);
428 "#frac{1}{N} #frac{dN}{m_{T} dm_{T}} [(GeV)^{-2}]");
432 "Model mt2 distribution 4Pi, %.2lf<y<%.2lf",
436 cc2,
"Model f2(m_{T}) 4Pi, %.2lf<y<%.2lf",
fYminv[ind],
fYmaxv[ind]);
440 "#frac{1}{N} #frac{dN}{m_{T} dm_{T}} [(GeV)^{-2}]");
443 gDirectory->cd(
"..");
445 grTy =
new TGraphErrors();
446 grTy->SetTitle(
"T(y)");
447 grTy->GetXaxis()->SetTitle(
"y");
448 grTy->GetYaxis()->SetTitle(
"T(y) (MeV)");
450 gDirectory->Add(
grTy);
454 gDirectory->cd(
"..");
455 gDirectory->cd(
"..");
456 gDirectory->cd(
"..");
458 gDirectory = currentDir;
462 flistMCTracks =
dynamic_cast<TClonesArray*
>(fManger->GetObject(
"MCTrack"));
490 for (
unsigned int i = 0;
i <
fYminv.size(); ++
i) {
540 std::vector<double> ys(0), dndys(0), dndyerrs(0);
542 for (
unsigned int ind = 0; ind <
fYminv.size(); ++ind) {
605 std::cout <<
fYminv[ind] <<
"<y<" <<
fYmaxv[ind] <<
"\tT = " << T
608 <<
"\t<m_T>_2 = " << avmt <<
"\n";
614 * TMath::Sqrt((s2 - s1 * s1 / Numb) / (Numb - 1.) / Numb);
616 if (T != T || errT != errT || errT > T / 3.)
continue;
619 grindex, 0. * 0.5 * (
fYmaxv[ind] -
fYminv[ind]), errT * 1.e3);
624 double errA =
modelsY[ind]->GetAerror(
629 std::cout <<
"A = " << A <<
" error = " << errA <<
"\n";
658 if (RecoLevel == -1) {
659 vector<CbmMCTrack> vRTracksMC;
661 std::cout <<
"MC tracks: " << nTracksMC <<
"\n";
662 vRTracksMC.resize(nTracksMC);
663 for (
int iTr = 0; iTr < nTracksMC; iTr++)
667 for (
int iTr = 0; iTr < nTracksMC; iTr++) {
668 if (vRTracksMC[iTr].GetPdgCode() ==
fPDGID
669 && vRTracksMC[iTr].GetMotherId() == -1) {
671 double pt = vRTracksMC[iTr].GetPt();
672 double ty = vRTracksMC[iTr].GetRapidity() -
ycm;
673 double mt = TMath::Sqrt(
674 vRTracksMC[iTr].GetMass() * vRTracksMC[iTr].GetMass() + pt * pt);
683 for (
unsigned int ind = 0; ind <
fYminv.size(); ++ind) {
699 for (
int itype = 2; itype <= 3; ++itype) {
701 const kfvector_int& pdgs = tr.PDG();
702 for (
unsigned int ind = 0; ind < pdgs.size(); ++ind) {
703 int iPDG = pdgs[ind];
707 double pt = tr.Pt(ind);
708 double p = tr.P(ind);
709 double m = TDatabasePDG::Instance()->GetParticle(iPDG)->Mass();
710 double p0 = TMath::Sqrt(
m *
m + p * p);
711 double pz = TMath::Sqrt(p * p - pt * pt);
712 double ty = 0.5 *
log((p0 + pz) / (p0 - pz)) -
ycm;
713 pz = TMath::Sqrt(
m *
m + pt * pt) * TMath::SinH(ty);
714 double mt = TMath::Sqrt(
m *
m + pt * pt);
724 for (
unsigned int ind2 = 0; ind2 <
fYminv.size(); ++ind2) {