24 #include "TClonesArray.h"
25 #include "TDirectory.h"
37 #include "TStopwatch.h"
49 #include "CbmTofHit.h"
51 #include "TDatabasePDG.h"
83 const Double_t& pt)
const {
85 if (ret < 0.) ret = 0.;
86 if (ret > 1.) ret = 1.;
100 ,
fV(4. / 3. * TMath::
Pi() * R_ * R_ * R_)
106 mass = TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass();
119 for (
double pt = 0.5 * dpt; pt < 6.; pt += dpt) {
121 tmpr = pt * tmpmt * TMath::CosH(
y)
122 * TMath::Exp(-tmpmt * TMath::CosH(
y) /
fT);
125 double tp = tmpmt * TMath::CosH(
y +
ycm);
143 y =
y - TMath::ATanH(
v);
145 for (
double pt = 0.5 * dpt; pt < 6.; pt += dpt) {
147 tmpr = pt * tmpmt * TMath::CosH(
y)
148 * TMath::Exp(-tmpmt * TMath::CosH(
y) /
fT);
151 double tp = tmpmt * TMath::CosH(
y +
ycm);
162 double dndybinlab(
double ymin,
double ymax,
int itery)
const {
163 double dy = (ymax - ymin) / itery;
164 double ty = 0., ret = 0., ret2 = 0.;
165 for (
int iy = 0; iy < itery; ++iy) {
166 ty = ymin + dy * iy + dy * 0.5;
177 * TMath::Exp(-tmpmt * TMath::CosH(
y) /
fT);
180 double tp = tmpmt * TMath::CosH(
y +
ycm);
192 y =
y - TMath::ATanH(
v);
195 * TMath::Exp(-tmpmt * TMath::CosH(
y) /
fT);
198 double tp = tmpmt * TMath::CosH(
y +
ycm);
211 double dpt = (ptmax - ptmin) / iterpt;
212 double dy = (ymax - ymin) / itery;
213 double ty = 0., tpt = 0., ret = 0., ret2 = 0.;
218 ymin = ymin - TMath::ATanH(
v);
219 for (
int ipt = 0; ipt < iterpt; ++ipt) {
220 tpt = ptmin + dpt * ipt + dpt * 0.5;
222 for (
int iy = 0; iy < itery; ++iy) {
223 ty = ymin + dy * iy + dy * 0.5;
225 /
TMath::Pi() * tpt * tmpmt * TMath::CosH(ty)
226 * TMath::Exp(-tmpmt * TMath::CosH(ty) /
fT);
230 double tp = tmpmt * TMath::CosH(ty +
ycm);
241 return sqrt(pt * pt +
m *
m);
246 return sqrt(pt * pt +
m *
m);
251 double ret1 = 0., ret2 = 0.;
252 double ymin = -3., ymax = 6.;
254 double dy = (ymax - ymin) / itery;
255 double ptmin = 0., ptmax = 3.;
257 double dpt = (ptmax - ptmin) / iterpt;
258 double ty = 0., tpt = 0., tmp = 0.;
260 for (
int iy = 0; iy < itery; ++iy) {
261 ty = ymin + (iy + 0.5) * dy;
262 for (
int ipt = 0; ipt < iterpt; ++ipt) {
263 tpt = ptmin + (ipt + 0.5) * dpt;
266 * TMath::CosH(ty -
ycm) /
fT);
270 tp =
sqrt(
mass *
mass * TMath::SinH(ty) * TMath::SinH(ty)
271 + tpt * tpt * TMath::CosH(ty) * TMath::CosH(ty));
279 if (
af->
ys.size() == 0)
return -1.;
280 double ret1 = 0., ret2 = 0.;
281 double tmp = 0., tp = 0.;
282 for (
unsigned int i = 0;
i <
af->
ys.size(); ++
i) {
290 if (
rf != NULL) tmp *=
rf->
f(tp);
300 double ret1 = 0., ret2 = 0.;
301 double ymin = -3., ymax = 6.;
303 double dy = (ymax - ymin) / itery;
304 double ptmin = 0., ptmax = 3.;
306 double dpt = (ptmax - ptmin) / iterpt;
307 double ty = 0., tpt = 0., tmp = 0.;
309 for (
int iy = 0; iy < itery; ++iy) {
310 ty = ymin + (iy + 0.5) * dy;
311 for (
int ipt = 0; ipt < iterpt; ++ipt) {
312 tpt = ptmin + (ipt + 0.5) * dpt;
315 * TMath::CosH(ty -
ycm) /
fT);
319 tp =
sqrt(
mass *
mass * TMath::SinH(ty) * TMath::SinH(ty)
320 + tpt * tpt * TMath::CosH(ty) * TMath::CosH(ty));
328 if (
af->
ys.size() == 0)
return -1.;
329 double ret1 = 0., ret2 = 0.;
330 double tmp = 0., tp = 0.;
331 for (
unsigned int i = 0;
i <
af->
ys.size(); ++
i) {
339 if (
rf != NULL) tmp *=
rf->
f(tp);
347 double T()
const {
return fT; }
348 double V()
const {
return fV; }
379 double systerr = 0.)
const {
382 double tmpval = 0., tmpval2 = 0., tmpvar = 0.;
387 for (
int n = 0; n <
dndyHist->GetNbinsX(); n++) {
388 tmpval =
dndyHist->GetBinContent(n);
393 /
dndyHist->GetXaxis()->GetBinWidth(n);
394 tmpvar =
sqrt(tmpvar * tmpvar + systerr * systerr * tmpval * tmpval);
396 dndyHist->GetXaxis()->GetBinUpEdge(n),
398 chi2 += (tmpval - tmpval2) * (tmpval - tmpval2) / tmpvar
414 double systerr = 0.)
const {
418 double tmpval = 0., tmpval2 = 0., tmpvar = 0.;
419 for (
int nx = 0; nx <
dndydptHist->GetNbinsX(); nx++) {
420 for (
int ny = 0; ny <
dndydptHist->GetNbinsY(); ny++) {
430 sqrt(tmpvar * tmpvar + systerr * systerr * tmpval * tmpval);
438 chi2 += (tmpval - tmpval2) * (tmpval - tmpval2) / tmpvar
471 , fRecoLevel(recoLevel)
472 , fTrackNumber(trackNumber)
475 , flistStsTracksMatch(0)
483 , flsitGlobalTracks(0)
489 , AcceptanceSTSTOF() {
496 ycm = 0.5 *
log((1. + betacm) / (1. - betacm));
498 for (
int part = 0; part < p_sz; ++part)
499 ComputeThermalDependence(part);
507 for (
int part = 0; part < p_sz; ++part) {
508 globalmtavMC[part] = 0.;
509 globalmt2avMC[part] = 0.;
510 globalfavMC[part] = 0.;
511 globalf2avMC[part] = 0.;
512 globalmtmomerrMC[part] = 0.;
513 globalnTracksMC[part] = 0;
523 for (
int part = 0; part < p_sz; ++part) {
524 globalmtavReco[part] = 0.;
525 globalmt2avReco[part] = 0.;
526 globalfavReco[part] = 0.;
527 globalf2avReco[part] = 0.;
529 globalmtmomerrReco[part] = 0.;
530 globalnTracksReco[part] = 0;
535 TDirectory* currentDir = gDirectory;
537 gDirectory->cd(
"Models");
539 histodir = gDirectory;
541 gDirectory->mkdir(
"BoltzmannDistribution");
542 gDirectory->cd(
"BoltzmannDistribution");
543 gDirectory->mkdir(
"All tracks");
544 gDirectory->cd(
"All tracks");
545 gDirectory->mkdir(
"PerEvent");
546 gDirectory->cd(
"PerEvent");
553 for (
int part = 0; part < p_sz; ++part) {
554 gDirectory->mkdir(
p_names[part]);
556 hTempFullMC[part] =
new TH1F(
"Temperature " +
p_names_gr[part],
557 "Event-by-event temperature",
561 hTempFullMC[part]->SetXTitle(
"T (GeV)");
562 hTempFullMC[part]->SetYTitle(
"Entries");
564 hTempErrStatFullMC[part] =
565 new TH1F(
"Temperature statistical error" +
p_names_gr[part],
566 "Event-by-event temperature statistical error",
570 hTempErrStatFullMC[part]->SetXTitle(
"T (GeV)");
571 hTempErrStatFullMC[part]->SetYTitle(
"Entries");
573 hTempErrMomFullMC[part] =
574 new TH1F(
"Temperature momentum error" +
p_names_gr[part],
575 "Event-by-event temperature momentum error",
579 hTempErrMomFullMC[part]->SetXTitle(
"T (GeV)");
580 hTempErrMomFullMC[part]->SetYTitle(
"Entries");
582 hRadFullMC[part] =
new TH1F(
"Fireball radius " +
p_names_gr[part],
583 "Event-by-event radius",
587 hRadFullMC[part]->SetXTitle(
"R (fm)");
588 hRadFullMC[part]->SetYTitle(
"Entries");
590 hRadErrStatFullMC[part] =
591 new TH1F(
"Fireball radius statistical error " +
p_names_gr[part],
592 "Event-by-event radius statistical error",
596 hRadErrStatFullMC[part]->SetXTitle(
"R (fm)");
597 hRadErrStatFullMC[part]->SetYTitle(
"Entries");
599 hRadErrMomFullMC[part] =
600 new TH1F(
"Fireball radius momentum error " +
p_names_gr[part],
601 "Event-by-event radius momentum error",
605 hRadErrMomFullMC[part]->SetXTitle(
"R (fm)");
606 hRadErrMomFullMC[part]->SetYTitle(
"Entries");
608 gDirectory->cd(
"..");
610 gDirectory->cd(
"..");
611 gDirectory->cd(
"..");
612 gDirectory->cd(
"..");
614 gDirectory->cd(
"BoltzmannDistribution");
615 gDirectory->cd(
"All tracks");
616 gDirectory->mkdir(
"Global");
617 gDirectory->cd(
"Global");
622 for (
int part = 0; part < p_sz; ++part) {
623 gDirectory->mkdir(
p_names[part]);
626 hfyMC[part] =
new TH1F(
627 "dndy " +
p_names_gr[part],
"Rapidity distribution", 100, -5., 5.);
628 hfyMCmodel[part] =
new TH1F(
"dndy " +
p_names_gr[part] +
" model",
629 "Rapidity distribution",
633 hfdndydptMC[part] =
new TH2F(
"dndydpt " +
p_names_gr[part],
641 hfdndydptMCmodel[part] =
new TH2F(
"dndydpt " +
p_names_gr[part] +
" model",
650 gDirectory->cd(
"..");
652 gDirectory->cd(
"..");
653 gDirectory->cd(
"..");
654 gDirectory->cd(
"..");
656 gDirectory->cd(
"BoltzmannDistribution");
657 gDirectory->mkdir(
"Reconstructible tracks");
658 gDirectory->cd(
"Reconstructible tracks");
659 gDirectory->mkdir(
"PerEvent");
660 gDirectory->cd(
"PerEvent");
662 for (
int part = 0; part < p_sz; ++part) {
663 gDirectory->mkdir(
p_names[part]);
665 hTempFullReco[part] =
new TH1F(
"Temperature " +
p_names_gr[part],
666 "Event-by-event temperature",
670 hTempFullReco[part]->SetXTitle(
"T (GeV)");
671 hTempFullReco[part]->SetYTitle(
"Entries");
673 hTempErrStatFullReco[part] =
674 new TH1F(
"Temperature statistical error " +
p_names_gr[part],
675 "Event-by-event temperature statistical error ",
679 hTempErrStatFullReco[part]->SetXTitle(
"T (GeV)");
680 hTempErrStatFullReco[part]->SetYTitle(
"Entries");
682 hTempErrMomFullReco[part] =
683 new TH1F(
"Temperature momentum error " +
p_names_gr[part],
684 "Event-by-event temperature momentum error",
688 hTempErrMomFullReco[part]->SetXTitle(
"T (GeV)");
689 hTempErrMomFullReco[part]->SetYTitle(
"Entries");
692 hRadFullReco[part] =
new TH1F(
"Fireball radius " +
p_names_gr[part],
693 "Event-by-event radius",
697 hRadFullReco[part]->SetXTitle(
"R (fm)");
698 hRadFullReco[part]->SetYTitle(
"Entries");
700 hRadErrStatFullReco[part] =
701 new TH1F(
"Fireball radius statistical error " +
p_names_gr[part],
702 "Event-by-event radius statistical error ",
706 hRadErrStatFullReco[part]->SetXTitle(
"R (fm)");
707 hRadErrStatFullReco[part]->SetYTitle(
"Entries");
709 hRadErrMomFullReco[part] =
710 new TH1F(
"Fireball radius momentum error " +
p_names_gr[part],
711 "Event-by-event radius momentum error",
715 hRadErrMomFullReco[part]->SetXTitle(
"R (fm)");
716 hRadErrMomFullReco[part]->SetYTitle(
"Entries");
718 gDirectory->cd(
"..");
721 gDirectory->cd(
"..");
722 gDirectory->cd(
"..");
723 gDirectory->cd(
"..");
725 gDirectory->cd(
"BoltzmannDistribution");
726 gDirectory->cd(
"Reconstructible tracks");
727 gDirectory->mkdir(
"Global");
728 gDirectory->cd(
"Global");
729 for (
int part = 0; part < p_sz; ++part) {
730 gDirectory->mkdir(
p_names[part]);
733 hfyReco[part] =
new TH1F(
734 "dndy " +
p_names_gr[part],
"Rapidity distribution", 100, -5., 5.);
735 hfyRecomodel[part] =
new TH1F(
"dndy " +
p_names_gr[part] +
" model",
736 "Rapidity distribution",
740 hfdndydptReco[part] =
new TH2F(
"dndydpt " +
p_names_gr[part],
748 hfdndydptRecomodel[part] =
749 new TH2F(
"dndydpt " +
p_names_gr[part] +
" model",
758 gDirectory->cd(
"..");
760 gDirectory->cd(
"..");
761 gDirectory->cd(
"..");
762 gDirectory->cd(
"..");
764 gDirectory->cd(
"BoltzmannDistribution");
765 gDirectory->mkdir(
"Reconstructible tracks corrected");
766 gDirectory->cd(
"Reconstructible tracks corrected");
767 gDirectory->mkdir(
"PerEvent");
768 gDirectory->cd(
"PerEvent");
769 for (
int part = 0; part < p_sz; ++part) {
770 gDirectory->mkdir(
p_names[part]);
772 hTempFullRecoCor[part] =
new TH1F(
"Temperature " +
p_names_gr[part],
773 "Event-by-event temperature",
777 hTempFullRecoCor[part]->SetXTitle(
"T (GeV)");
778 hTempFullRecoCor[part]->SetYTitle(
"Entries");
780 hTempErrStatFullRecoCor[part] =
781 new TH1F(
"Temperature statistical error " +
p_names_gr[part],
782 "Event-by-event temperature statistical error ",
786 hTempErrStatFullRecoCor[part]->SetXTitle(
"T (GeV)");
787 hTempErrStatFullRecoCor[part]->SetYTitle(
"Entries");
789 hTempErrMomFullRecoCor[part] =
790 new TH1F(
"Temperature momentum error " +
p_names_gr[part],
791 "Event-by-event temperature momentum error",
795 hTempErrMomFullRecoCor[part]->SetXTitle(
"T (GeV)");
796 hTempErrMomFullRecoCor[part]->SetYTitle(
"Entries");
798 hRadFullRecoCor[part] =
new TH1F(
"Fireball radius " +
p_names_gr[part],
799 "Event-by-event radius",
803 hRadFullRecoCor[part]->SetXTitle(
"R (fm)");
804 hRadFullRecoCor[part]->SetYTitle(
"Entries");
806 hRadErrStatFullRecoCor[part] =
807 new TH1F(
"Fireball radius statistical error " +
p_names_gr[part],
808 "Event-by-event radius statistical error ",
812 hRadErrStatFullRecoCor[part]->SetXTitle(
"R (fm)");
813 hRadErrStatFullRecoCor[part]->SetYTitle(
"Entries");
815 hRadErrMomFullRecoCor[part] =
816 new TH1F(
"Fireball radius momentum error " +
p_names_gr[part],
817 "Event-by-event radius momentum error",
821 hRadErrMomFullRecoCor[part]->SetXTitle(
"R (fm)");
822 hRadErrMomFullRecoCor[part]->SetYTitle(
"Entries");
824 gDirectory->cd(
"..");
826 gDirectory->cd(
"..");
827 gDirectory->cd(
"..");
828 gDirectory->cd(
"..");
830 gDirectory->cd(
"BoltzmannDistribution");
831 gDirectory->cd(
"Reconstructible tracks corrected");
832 gDirectory->mkdir(
"Global");
833 gDirectory->cd(
"Global");
834 for (
int part = 0; part < p_sz; ++part) {
835 gDirectory->mkdir(
p_names[part]);
838 hfyRecoCor[part] =
new TH1F(
839 "dndy " +
p_names_gr[part],
"Rapidity distribution", 100, -5., 5.);
840 hfyRecoCormodel[part] =
new TH1F(
"dndy " +
p_names_gr[part] +
" model",
841 "Rapidity distribution",
845 hfdndydptRecoCor[part] =
new TH2F(
"dndydpt " +
p_names_gr[part],
853 hfdndydptRecoCormodel[part] =
854 new TH2F(
"dndydpt " +
p_names_gr[part] +
" model",
863 gDirectory->cd(
"..");
865 gDirectory->cd(
"..");
866 gDirectory->cd(
"..");
867 gDirectory->cd(
"..");
869 gDirectory = currentDir;
879 double ymin = 0., ymax = 6.;
880 double ptmin = 0., ptmax = 2.5;
883 func.
probs.resize(0);
884 ifstream fin(filename.Data());
885 fin >> func.
dy >> func.
dpt;
886 double ty, tpt, prob;
889 func.
probs.resize(0);
890 while (fin >> ty >> tpt >> prob) {
891 if (tpt < ptmin || tpt > ptmax || ty < ymin || ty > ymax)
continue;
892 func.
ys.push_back(ty);
893 func.
pts.push_back(tpt);
894 func.
probs.push_back(prob);
906 flistStsTracks =
dynamic_cast<TClonesArray*
>(fManger->GetObject(
"StsTrack"));
907 flistTofPts =
dynamic_cast<TClonesArray*
>(fManger->GetObject(
"TofPoint"));
917 Error(
"CbmThermalModelNoFlow::ReInit",
"vertex not found!");
923 dynamic_cast<TClonesArray*
>(fManger->GetObject(
"StsTrackMatch"));
924 flistMCTracks =
dynamic_cast<TClonesArray*
>(fManger->GetObject(
"MCTrack"));
927 flistStsPts =
dynamic_cast<TClonesArray*
>(fManger->GetObject(
"StsPoint"));
928 flistTofPts =
dynamic_cast<TClonesArray*
>(fManger->GetObject(
"TofPoint"));
933 dynamic_cast<TClonesArray*
>(fManger->GetObject(
"GlobalTrack"));
934 flistTofHits =
dynamic_cast<TClonesArray*
>(fManger->GetObject(
"TofHit"));
949 vector<CbmStsTrack> vRTracks;
950 vector<CbmMCTrack> vRTracksMC;
953 vRTracks.resize(nTracks);
954 for (
int iTr = 0; iTr < nTracks; iTr++)
957 vRTracksMC.resize(nTracksMC);
958 for (
int iTr = 0; iTr < nTracksMC; iTr++)
965 vector<int> vTrackPDG(vRTracks.size(), -1);
967 for (
int iTr = 0; iTr < nTracks; iTr++) {
982 Fatal(
"KF Particle Finder",
"No GlobalTrack array!");
985 Fatal(
"KF Particle Finder",
"No TOF hits array!");
988 const Double_t m2P = 0.885;
989 const Double_t m2K = 0.245;
990 const Double_t m2Pi = 0.019479835;
992 Double_t sP[3][5] = {
993 {0.0337428, -0.013939, 0.00567602, -0.000202229, 4.07531e-06},
994 {0.00717827, -0.00257353, 0.00389851, -9.83097e-05, 1.33011e-06},
995 {0.001348, 0.00220126, 0.0023619, 7.35395e-05, -4.06706e-06}};
1018 const Int_t PdgHypo[4] = {2212, 321, 211, -11};
1025 if (stsTrackIndex < 0)
continue;
1031 const FairTrackParam* stsPar = vRTracks[stsTrackIndex].GetParamFirst();
1033 stsPar->Momentum(mom);
1035 Double_t p = mom.Mag();
1036 Int_t q = stsPar->GetQp() > 0 ? 1 : -1;
1039 if (!((l > 800.) && (l < 1400.)))
continue;
1044 if (tofHitIndex >= 0) {
1045 vTrackPDG[stsTrackIndex] = -211;
1049 if (!tofHit)
continue;
1055 if (!((time > 29.) && (time < 50.)))
continue;
1059 p * p * (1. / ((l / time / 29.9792458) * (l / time / 29.9792458)) - 1.);
1062 sigma[0] = sP[0][0] + sP[0][1] * p + sP[0][2] * p * p
1063 + sP[0][3] * p * p * p + sP[0][4] * p * p * p * p;
1064 sigma[1] = sP[1][0] + sP[1][1] * p + sP[1][2] * p * p
1065 + sP[1][3] * p * p * p + sP[1][4] * p * p * p * p;
1066 sigma[2] = sP[2][0] + sP[2][1] * p + sP[2][2] * p * p
1067 + sP[2][3] * p * p * p + sP[2][4] * p * p * p * p;
1070 dm2[0] =
fabs(m2 - m2P) / sigma[0];
1071 dm2[1] =
fabs(m2 - m2K) / sigma[1];
1072 dm2[2] =
fabs(m2 - m2Pi) / sigma[2];
1075 Double_t dm2min = dm2[2];
1091 if (p > 12.)
continue;
1093 if (dm2[1] < dm2min) {
1097 if (dm2[0] < dm2min) {
1102 if (dm2min > 2) iPdg = -1;
1104 if (dm2[1] < dm2min) {
1108 if ((dm2min > 3) && (dm2[0] < dm2min)) {
1113 if (dm2min > 2) iPdg = -1;
1116 if (iPdg > -1) vTrackPDG[stsTrackIndex] = q * PdgHypo[iPdg];
1132 for (Int_t iSts = 0; iSts <
flistStsPts->GetEntriesFast(); iSts++) {
1135 MCTrackSortedArray[StsPoint->GetTrackID()].
StsArray.push_back(StsPoint);
1138 for (Int_t iTof = 0; iTof <
flistTofPts->GetEntriesFast(); iTof++) {
1141 MCTrackSortedArray[TofPoint->GetTrackID()].
TofArray.push_back(TofPoint);
1146 int* TrRecons =
new int[
flistMCTracks->GetEntriesFast() + 1];
1149 double mtavMC[
p_sz];
1150 double mtavReco[
p_sz];
1151 double mt2avMC[
p_sz];
1152 double mt2avReco[
p_sz];
1153 double mtmomerrMC[
p_sz];
1154 double mtmomerrReco[
p_sz];
1156 int nTracksPaAllMC[
p_sz];
1157 int nTracksReco[
p_sz];
1158 for (
int part = 0; part <
p_sz; ++part) {
1161 mtmomerrMC[part] = 0.;
1162 mtavReco[part] = 0.;
1163 mt2avReco[part] = 0.;
1164 mtmomerrReco[part] = 0.;
1165 nTracksPaAllMC[part] = 0;
1166 nTracksReco[part] = 0;
1169 for (iTr = 0; iTr < nTracksMC; iTr++) {
1181 vector<FairTrackParam> paramsinit;
1182 for (
int iTrs = 0; iTrs < nTracks; iTrs++) {
1183 paramsinit.push_back(*(vRTracks[iTrs].GetParamFirst()));
1186 vector<L1FieldRegion> vField;
1191 for (iTr = 0; iTr < nTracksMC; iTr++) {
1193 for (
int part = 0; part <
p_sz; ++part) {
1194 if (vRTracksMC[iTr].GetPdgCode() ==
pdgIds[part]
1195 && vRTracksMC[iTr].GetMotherId() == -1) {
1196 tmpmt =
sqrt(vRTracksMC[iTr].GetMass() * vRTracksMC[iTr].GetMass()
1197 + vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1198 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy());
1199 nTracksPaAllMC[part]++;
1203 tempCrit(vRTracksMC[iTr].GetRapidity(),
1204 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1205 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1206 vRTracksMC[iTr].GetMass());
1208 tempCrit(vRTracksMC[iTr].GetRapidity(),
1209 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1210 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1211 vRTracksMC[iTr].GetMass())
1213 vRTracksMC[iTr].GetRapidity(),
1214 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1215 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1216 vRTracksMC[iTr].GetMass());
1217 mtmomerrMC[part] += 0.;
1219 hfyMC[part]->Fill(vRTracksMC[iTr].GetRapidity());
1221 vRTracksMC[iTr].GetRapidity(),
1222 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1223 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()));
1229 tempCrit(vRTracksMC[iTr].GetRapidity(),
1230 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1231 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1232 vRTracksMC[iTr].GetMass());
1234 tempCrit(vRTracksMC[iTr].GetRapidity(),
1235 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1236 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1237 vRTracksMC[iTr].GetMass())
1239 vRTracksMC[iTr].GetRapidity(),
1240 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1241 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1242 vRTracksMC[iTr].GetMass());
1244 chi2func(vRTracksMC[iTr].GetRapidity(),
1245 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1246 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1247 vRTracksMC[iTr].GetMass());
1249 chi2func(vRTracksMC[iTr].GetRapidity(),
1250 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1251 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1252 vRTracksMC[iTr].GetMass())
1254 vRTracksMC[iTr].GetRapidity(),
1255 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1256 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1257 vRTracksMC[iTr].GetMass());
1262 nTracksReco[part]++;
1266 vRTracksMC[iTr].GetRapidity(),
1267 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1268 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1269 vRTracksMC[iTr].GetMass());
1272 vRTracksMC[iTr].GetRapidity(),
1273 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1274 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1275 vRTracksMC[iTr].GetMass())
1277 vRTracksMC[iTr].GetRapidity(),
1278 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1279 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1280 vRTracksMC[iTr].GetMass());
1281 mtmomerrReco[part] += 0.;
1287 vRTracksMC[iTr].GetRapidity(),
1288 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1289 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1290 vRTracksMC[iTr].GetMass());
1293 vRTracksMC[iTr].GetRapidity(),
1294 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1295 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1296 vRTracksMC[iTr].GetMass())
1298 vRTracksMC[iTr].GetRapidity(),
1299 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1300 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1301 vRTracksMC[iTr].GetMass());
1303 vRTracksMC[iTr].GetRapidity(),
1304 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1305 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1306 vRTracksMC[iTr].GetMass());
1309 vRTracksMC[iTr].GetRapidity(),
1310 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1311 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1312 vRTracksMC[iTr].GetMass())
1314 vRTracksMC[iTr].GetRapidity(),
1315 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1316 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1317 vRTracksMC[iTr].GetMass());
1321 hfyReco[part]->Fill(vRTracksMC[iTr].GetRapidity());
1323 vRTracksMC[iTr].GetRapidity(),
1324 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1325 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()));
1327 hfyRecoCor[part]->Fill(vRTracksMC[iTr].GetRapidity());
1329 vRTracksMC[iTr].GetRapidity(),
1330 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1331 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()));
1343 for (
int iTrs = 0; iTrs < nTracks; iTrs++) {
1344 if (vTrackPDG[iTrs] != -1) {
1349 for (
int part = 0; part <
p_sz; ++part) {
1350 if (vTrackPDG[iTrs] ==
pdgIds[part]
1351 && vRTracksMC[iTr].GetMotherId() == -1) {
1356 tmpmt =
sqrt(vRTracksMC[iTr].GetMass() * vRTracksMC[iTr].GetMass()
1357 + vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1358 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy());
1359 nTracksReco[part]++;
1363 vRTracksMC[iTr].GetRapidity(),
1364 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1365 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1366 vRTracksMC[iTr].GetMass());
1369 vRTracksMC[iTr].GetRapidity(),
1370 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1371 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1372 vRTracksMC[iTr].GetMass())
1374 vRTracksMC[iTr].GetRapidity(),
1375 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1376 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1377 vRTracksMC[iTr].GetMass());
1378 mtmomerrReco[part] += 0.;
1383 vRTracksMC[iTr].GetRapidity(),
1384 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1385 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1386 vRTracksMC[iTr].GetMass());
1389 vRTracksMC[iTr].GetRapidity(),
1390 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1391 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1392 vRTracksMC[iTr].GetMass())
1394 vRTracksMC[iTr].GetRapidity(),
1395 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1396 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1397 vRTracksMC[iTr].GetMass());
1400 vRTracksMC[iTr].GetRapidity(),
1401 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1402 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1403 vRTracksMC[iTr].GetMass());
1406 vRTracksMC[iTr].GetRapidity(),
1407 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1408 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1409 vRTracksMC[iTr].GetMass())
1411 vRTracksMC[iTr].GetRapidity(),
1412 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1413 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()),
1414 vRTracksMC[iTr].GetMass());
1417 hfyReco[part]->Fill(vRTracksMC[iTr].GetRapidity());
1419 vRTracksMC[iTr].GetRapidity(),
1420 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1421 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()));
1423 hfyRecoCor[part]->Fill(vRTracksMC[iTr].GetRapidity());
1425 vRTracksMC[iTr].GetRapidity(),
1426 sqrt(vRTracksMC[iTr].GetPx() * vRTracksMC[iTr].GetPx()
1427 + vRTracksMC[iTr].GetPy() * vRTracksMC[iTr].GetPy()));
1439 for (
int iTrs = 0; iTrs < nTracks; iTrs++) {
1440 if (vTrackPDG[iTrs] != -1) {
1445 vRTracks[iTrs].GetParamFirst()->Momentum(tmpv);
1446 for (
int part = 0; part <
p_sz; ++part) {
1448 sqrt(TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1449 * TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1450 + tmpv.Pt() * tmpv.Pt());
1455 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1456 * TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1457 + tmpv.Mag() * tmpv.Mag())
1460 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1461 * TDatabasePDG::Instance()
1462 ->GetParticle(
pdgIds[part])
1464 + tmpv.Mag() * tmpv.Mag())
1466 if (!(tmpmt > 0. && tmpmt < 10.))
break;
1467 if (vTrackPDG[iTrs] ==
pdgIds[part]
1468 && vRTracksMC[iTr].GetMotherId() == -1) {
1470 Double_t covMatrix[15];
1471 vRTracks[iTrs].GetParamFirst()->CovMatrix(covMatrix);
1473 vRTracks[iTrs].GetParamFirst()->GetQp(),
1474 vRTracks[iTrs].GetParamFirst()->GetTx(),
1475 vRTracks[iTrs].GetParamFirst()->GetTy(),
1477 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1479 if (!(tmperr > 0. && tmperr < 0.1))
break;
1482 nTracksReco[part]++;
1488 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1489 * TDatabasePDG::Instance()
1490 ->GetParticle(
pdgIds[part])
1492 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1498 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1499 * TDatabasePDG::Instance()
1500 ->GetParticle(
pdgIds[part])
1502 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass())
1507 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1508 * TDatabasePDG::Instance()
1509 ->GetParticle(
pdgIds[part])
1511 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1515 vRTracks[iTrs].GetParamFirst()->GetQp(),
1516 vRTracks[iTrs].GetParamFirst()->GetTx(),
1517 vRTracks[iTrs].GetParamFirst()->GetTy(),
1519 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1526 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1527 * TDatabasePDG::Instance()
1528 ->GetParticle(
pdgIds[part])
1530 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1536 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1537 * TDatabasePDG::Instance()
1538 ->GetParticle(
pdgIds[part])
1540 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass())
1545 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1546 * TDatabasePDG::Instance()
1547 ->GetParticle(
pdgIds[part])
1549 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1554 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1555 * TDatabasePDG::Instance()
1556 ->GetParticle(
pdgIds[part])
1558 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1564 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1565 * TDatabasePDG::Instance()
1566 ->GetParticle(
pdgIds[part])
1568 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass())
1573 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1574 * TDatabasePDG::Instance()
1575 ->GetParticle(
pdgIds[part])
1577 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1579 vRTracks[iTrs].GetParamFirst()->GetQp(),
1580 vRTracks[iTrs].GetParamFirst()->GetTx(),
1581 vRTracks[iTrs].GetParamFirst()->GetTy(),
1583 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1585 hfyReco[part]->Fill(tmprapid);
1589 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1590 * TDatabasePDG::Instance()
1591 ->GetParticle(
pdgIds[part])
1598 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1599 * TDatabasePDG::Instance()
1600 ->GetParticle(
pdgIds[part])
1610 for (
int iTrs = 0; iTrs < nTracks; iTrs++) {
1611 if (vTrackPDG[iTrs] != -1) {
1616 vRTracks[iTrs].GetParamFirst()->Momentum(tmpv);
1617 for (
int part = 0; part <
p_sz; ++part) {
1619 sqrt(TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1620 * TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1621 + tmpv.Pt() * tmpv.Pt());
1626 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1627 * TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1628 + tmpv.Mag() * tmpv.Mag())
1631 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1632 * TDatabasePDG::Instance()
1633 ->GetParticle(
pdgIds[part])
1635 + tmpv.Mag() * tmpv.Mag())
1637 if (!(tmpmt > 0. && tmpmt < 10.))
break;
1642 if (vTrackPDG[iTrs] ==
pdgIds[part]
1647 Double_t covMatrix[15];
1648 vRTracks[iTrs].GetParamFirst()->CovMatrix(covMatrix);
1650 vRTracks[iTrs].GetParamFirst()->GetQp(),
1651 vRTracks[iTrs].GetParamFirst()->GetTx(),
1652 vRTracks[iTrs].GetParamFirst()->GetTy(),
1654 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1656 if (!(tmperr > 0. && tmperr < 0.1))
break;
1658 nTracksReco[part]++;
1664 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1665 * TDatabasePDG::Instance()
1666 ->GetParticle(
pdgIds[part])
1668 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1674 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1675 * TDatabasePDG::Instance()
1676 ->GetParticle(
pdgIds[part])
1678 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass())
1683 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1684 * TDatabasePDG::Instance()
1685 ->GetParticle(
pdgIds[part])
1687 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1691 vRTracks[iTrs].GetParamFirst()->GetQp(),
1692 vRTracks[iTrs].GetParamFirst()->GetTx(),
1693 vRTracks[iTrs].GetParamFirst()->GetTy(),
1695 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1703 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1704 * TDatabasePDG::Instance()
1705 ->GetParticle(
pdgIds[part])
1707 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1713 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1714 * TDatabasePDG::Instance()
1715 ->GetParticle(
pdgIds[part])
1717 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass())
1722 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1723 * TDatabasePDG::Instance()
1724 ->GetParticle(
pdgIds[part])
1726 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1730 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1731 * TDatabasePDG::Instance()
1732 ->GetParticle(
pdgIds[part])
1734 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1740 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1741 * TDatabasePDG::Instance()
1742 ->GetParticle(
pdgIds[part])
1744 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass())
1749 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1750 * TDatabasePDG::Instance()
1751 ->GetParticle(
pdgIds[part])
1753 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1755 vRTracks[iTrs].GetParamFirst()->GetQp(),
1756 vRTracks[iTrs].GetParamFirst()->GetTx(),
1757 vRTracks[iTrs].GetParamFirst()->GetTy(),
1759 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1761 hfyReco[part]->Fill(tmprapid);
1765 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1766 * TDatabasePDG::Instance()
1767 ->GetParticle(
pdgIds[part])
1774 - TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()
1775 * TDatabasePDG::Instance()
1776 ->GetParticle(
pdgIds[part])
1785 for (
int part = 0; part <
p_sz; ++part) {
1786 mtavMC[part] /= nTracksPaAllMC[part];
1787 mt2avMC[part] /= nTracksPaAllMC[part];
1790 for (
int part = 0; part <
p_sz; ++part) {
1797 *
sqrt((mt2avMC[part] - mtavMC[part] * mtavMC[part])
1798 / (nTracksPaAllMC[part] - 1)));
1801 / nTracksPaAllMC[part]);
1805 nTracksPaAllMC[part],
1806 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()));
1808 *
sqrt((mt2avMC[part] - mtavMC[part] * mtavMC[part])
1809 / (nTracksPaAllMC[part] - 1));
1810 double tmp1 = 0., tmp2 = 0.;
1811 double tmpNerr =
sqrt(nTracksPaAllMC[part]);
1814 nTracksPaAllMC[part],
1815 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1818 nTracksPaAllMC[part],
1819 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1821 sqrt(tmp1 * tmp1 * tmpTerr * tmpTerr + tmp2 * tmp2 * tmpNerr * tmpNerr);
1825 *
sqrt(mtmomerrMC[part]) / nTracksPaAllMC[part];
1826 tmpRerr =
sqrt(tmp1 * tmp1 * tmpTerr * tmpTerr
1827 + tmp2 * tmp2 * tmpNerr * tmpNerr * 0.);
1833 for (
int part = 0; part <
p_sz; ++part) {
1834 mtavReco[part] /= nTracksReco[part];
1835 mt2avReco[part] /= nTracksReco[part];
1838 for (
int part = 0; part <
p_sz; ++part) {
1855 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()));
1859 *
sqrt((mt2avReco[part] - mtavReco[part] * mtavReco[part])
1860 / (nTracksReco[part] - 1));
1861 double tmp1 = 0., tmp2 = 0.;
1862 double tmpNerr =
sqrt(nTracksReco[part]);
1866 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1870 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
1872 sqrt(tmp1 * tmp1 * tmpTerr * tmpTerr + tmp2 * tmp2 * tmpNerr * tmpNerr);
1878 *
sqrt(mtmomerrReco[part]) / nTracksReco[part];
1880 sqrt(tmp1 * tmp1 * tmpTerr * tmpTerr + tmp2 * tmp2 * tmpNerr * tmpNerr);
1890 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass(),
1895 *
sqrt((mt2avReco[part] - mtavReco[part] * mtavReco[part])
1896 / (nTracksReco[part] - 1));
1897 tmp1 = 0., tmp2 = 0.;
1898 tmpNerr =
sqrt(nTracksReco[part]);
1902 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass(),
1907 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass(),
1910 sqrt(tmp1 * tmp1 * tmpTerr * tmpTerr + tmp2 * tmp2 * tmpNerr * tmpNerr);
1917 *
sqrt(mtmomerrReco[part]) / nTracksReco[part];
1918 tmpRerr =
sqrt(tmp1 * tmp1 * tmpTerr * tmpTerr
1919 + tmp2 * tmp2 * tmpNerr * tmpNerr * 0.);
1927 delete[] MCTrackSortedArray;
1933 return sqrt(pt * pt +
m *
m);
1938 return sqrt(pt * pt +
m *
m);
1942 TString work = getenv(
"VMCWORKDIR");
1944 work +
"/KF/KFModelParameters/";
1948 std::vector<double> mtall, Tvecall;
1950 std::cout <<
"Computing dependencies of ThermalModel...";
1954 std::vector<double> Tvec, mtacc, NPart;
1958 for (
int i = 0;; ++
i) {
1959 double tmpT = dT * (0.5 +
i);
1960 if (tmpT > Tmax)
break;
1962 Tvec.push_back(tmpT);
1964 tmpT, TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()));
1967 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass(),
1971 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass(),
1977 mtTall[part] =
new TSpline3(
"mtTall", &Tvec[0], &mtall[0], Tvec.size());
1978 mtTsts[part] =
new TSpline3(
"mtTacc", &Tvec[0], &mtacc[0], Tvec.size());
1979 Npartsts[part] =
new TSpline3(
"Npart", &Tvec[0], &NPart[0], Tvec.size());
1988 for (
int i = 0;; ++
i) {
1989 double tmpT = dT * (0.5 +
i);
1990 if (tmpT > Tmax)
break;
1992 Tvec.push_back(tmpT);
1996 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass(),
2000 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass(),
2004 mtTststof[part] =
new TSpline3(
"mtTacc", &Tvec[0], &mtacc[0], Tvec.size());
2005 Npartststof[part] =
new TSpline3(
"Npart", &Tvec[0], &NPart[0], Tvec.size());
2015 std::cout <<
" Done!\n";
2019 double ret1 = 0., ret2 = 0.;
2020 vector<double> xlag, wlag, xleg, wleg;
2023 for (Int_t
i = 0;
i < 32;
i++) {
2024 for (Int_t j = 0; j < 32; j++) {
2028 tmpf = xlag[
i] *
sqrt(xlag[
i] * xlag[
i] +
m *
m)
2029 * TMath::CosH(xleg[j] -
ycm)
2030 *
exp(-
sqrt(xlag[
i] * xlag[
i] +
m *
m) * TMath::CosH(xleg[j] -
ycm)
2032 ret1 += wlag[
i] * wleg[j] * tmpf;
2033 ret2 += wlag[
i] * wleg[j] * tmpf *
tempCrit(xleg[j], xlag[
i],
m);
2040 double ret1 = 0., ret2 = 0.;
2041 double ymin = -3., ymax = 6.;
2043 double dy = (ymax - ymin) / itery;
2044 double ptmin = 0., ptmax = 3.;
2046 double dpt = (ptmax - ptmin) / iterpt;
2047 double ty = 0., tpt = 0., tmp = 0.;
2048 for (
int iy = 0; iy < itery; ++iy) {
2049 ty = ymin + (iy + 0.5) * dy;
2050 for (
int ipt = 0; ipt < iterpt; ++ipt) {
2051 tpt = ptmin + (ipt + 0.5) * dpt;
2052 tmp = tpt *
sqrt(tpt * tpt +
m *
m) * cosh(ty -
ycm)
2065 return 0.99 - 0.98 *
exp(-p * p / 2. / 0.135 / 0.135);
2067 return 0.98 - 0.88 *
exp(-p * p / 2. / 0.2 / 0.2);
2074 double ret1 = 0., ret2 = 0.;
2075 vector<double> xlag, wlag, xleg, wleg;
2079 for (Int_t
i = 0;
i < 32;
i++) {
2080 for (Int_t j = 0; j < 32; j++) {
2084 double tp =
sqrt(xlag[
i] * xlag[
i] +
m *
m) * TMath::CosH(xleg[j]);
2085 tp =
sqrt(tp * tp -
m *
m);
2087 xlag[
i] *
sqrt(xlag[
i] * xlag[
i] +
m *
m) * TMath::CosH(xleg[j] -
ycm)
2088 *
exp(-
sqrt(xlag[
i] * xlag[
i] +
m *
m) * TMath::CosH(xleg[j] -
ycm) / T)
2090 ret1 += wlag[
i] * wleg[j] * tmpf;
2091 ret2 += wlag[
i] * wleg[j] * tmpf *
tempCrit(xleg[j], xlag[
i],
m);
2101 if (accfunc.
ys.size() == 0)
return -1.;
2102 double ret1 = 0., ret2 = 0.;
2103 double tmp = 0., tp = 0.;
2104 for (
unsigned int i = 0;
i < accfunc.
ys.size(); ++
i) {
2106 tp =
sqrt(tp * tp -
m *
m);
2108 * cosh(accfunc.
ys[
i] -
ycm)
2110 * cosh(accfunc.
ys[
i] -
ycm) / T)
2123 double ret1 = 0., ret2 = 0.;
2124 vector<double> xlag, wlag, xleg, wleg;
2127 for (Int_t
i = 0;
i < 32;
i++) {
2128 for (Int_t j = 0; j < 32; j++) {
2132 double tp =
sqrt(xlag[
i] * xlag[
i] +
m *
m) * TMath::CosH(xleg[j]);
2133 tp =
sqrt(tp * tp -
m *
m);
2135 xlag[
i] *
sqrt(xlag[
i] * xlag[
i] +
m *
m) * TMath::CosH(xleg[j] -
ycm)
2136 *
exp(-
sqrt(xlag[
i] * xlag[
i] +
m *
m) * TMath::CosH(xleg[j] -
ycm) / T)
2138 ret2 += wlag[
i] * wleg[j] * tmpf;
2152 if (
fusePID == 2 && tofHits == 0)
return 0;
2153 vector<int> hitz(0);
2154 for (
int hit = 0; hit < stsHits; ++hit) {
2156 static_cast<int>((inTrack->
GetStsPoint(hit)->GetZ() + 5.) / 10.));
2158 sort(hitz.begin(), hitz.end());
2159 for (
int hit1 = 0; hit1 < stsHits - 3; ++hit1) {
2160 int station1 = hitz[hit1];
2161 int hitsConsecutive = 1;
2162 for (
int hit2 = hit1 + 1; hit2 < stsHits && hitsConsecutive < 4; ++hit2) {
2163 int station2 = hitz[hit2];
2164 if (station2 == station1)
continue;
2165 if (station2 - station1 > 1)
break;
2166 if (station2 - station1 == 1) {
2168 station1 = station2;
2171 if (hitsConsecutive == 4)
return 1;
2222 double left = 0., right = 1., center;
2226 for (
int i = 0;
i < iters; ++
i) {
2227 center = (left + right) / 2.;
2229 if (valleft * valcenter > 0)
2234 return (left + right) / 2.;
2239 double left = 0., right = 0.45, center;
2241 mtTall[part]->Eval(left) - mt;
2243 for (
int i = 0;
i < iters; ++
i) {
2244 center = (left + right) / 2.;
2245 valcenter =
mtTall[part]->Eval(center) - mt;
2246 if (valleft * valcenter > 0)
2251 return (left + right) / 2.;
2266 double left = 0., right = 0.45, center;
2267 double valleft = mtT->Eval(left) - mt;
2269 for (
int i = 0;
i < iters; ++
i) {
2270 center = (left + right) / 2.;
2271 valcenter = mtT->Eval(center) - mt;
2272 if (valleft * valcenter > 0)
2277 return (left + right) / 2.;
2294 double left = 0., right = 1., center;
2298 for (
int i = 0;
i < iters; ++
i) {
2299 center = (left + right) / 2.;
2301 if (valleft * valcenter > 0)
2306 return (left + right) * 0.5 * cosh(
y);
2313 +
sqrt((0.5 * mt - mo) * (0.5 * mt - mo) + 2 * mo * (mt - mo)));
2320 double left = 0., right = 10., center;
2324 for (
int i = 0;
i < iters; ++
i) {
2325 center = (left + right) / 2.;
2327 if (valleft * valcenter > 0)
2332 return (left + right) / 2.;
2340 double tmpTxy = Tx * Tx + Ty * Ty;
2341 double mt =
sqrt(mo * mo + tmpTxy / qp / qp / (tmpTxy + 1.));
2342 double ddqp = -2. / qp / qp / qp * tmpTxy / (tmpTxy + 1.);
2343 double ddTx = 2. * Tx / qp / qp / (tmpTxy + 1.) * (tmpTxy + 1.);
2344 double ddTy = 2. * Ty / qp / qp / (tmpTxy + 1.) * (tmpTxy + 1.);
2347 return (1. / 4. / mt / mt)
2348 * (ddqp * ddqp * covMatrix[14] + ddTx * ddTx * covMatrix[9]
2349 + ddTy * ddTy * covMatrix[12]
2351 * (ddqp * ddTx * covMatrix[11] + ddqp * ddTy * covMatrix[13]
2352 + ddTx * ddTy * covMatrix[10]));
2356 return mt * (mo * mo + 2. * mo * T + 2 * T * T)
2357 - (mo * mo * mo + 3 * mo * mo * T + 6 * mo * T * T + 6 * T * T * T);
2365 return mt * (2 * mo * dT + 4 * T * dT) + mo * mo + 2 * mo * T + 2 * T * T
2366 - (3. * mo * mo * dT + 12 * mo * T * dT + 18. * T * T * dT);
2370 ofstream fout(
"ThermalModel.txt");
2371 for (
int part = 0; part <
p_sz; ++part) {
2383 printf(
"%10s\t%10s\t%10s\t%10s\n",
"Type",
"All",
"Reco",
"Reco cor");
2384 fout <<
"MC Tracks:" << endl;
2385 fout <<
"Particle\tTemperature\tError\tRadius\tError\tchi2/ndf\n";
2386 for (
int part = 0; part <
p_sz; ++part) {
2393 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
2398 double tmp1MC = 0., tmp2MC = 0.;
2403 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
2407 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
2408 double tmpRMCerr =
sqrt(tmp1MC * tmp1MC * tmpTMCerr * tmpTMCerr
2409 + tmp2MC * tmp2MC * tmpNMCerr * tmpNMCerr);
2411 tmpTMC, TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
2416 fout <<
p_names[part].Data() <<
"\t" << tmpTMC <<
"\t" << tmpTMCerr
2417 <<
"\t" << tmpRMC <<
"\t" << tmpRMCerr <<
"\t" << tmpchi2ndf <<
"\n";
2423 fout <<
"Reco level " <<
fRecoLevel <<
":" << endl;
2424 fout <<
"Particle\tTemperature\tError stat.\tError mom.\tError "
2425 "tot.\tRadius\tError stat.\tError mom.\tError tot.\tchi2/ndf\n";
2426 for (
int part = 0; part <
p_sz; ++part) {
2437 "%s Temperature\t%10lf\t%10lf\t%10lf\n",
2447 "%s Radius\t%10lf\t%10lf\t%10lf\n",
2451 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()),
2454 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()),
2458 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass(),
2460 printf(
"%lf\t%lf\n",
2461 Npart[part]->Eval(tmpT3),
2467 tmpT1, TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
2468 double tmpchi2ndfMC =
2478 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass(),
2485 double tmp1Re = 0., tmp2Re = 0.;
2490 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass(),
2495 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass(),
2497 double tmpRReerr =
sqrt(tmp1Re * tmp1Re * tmpTReerr * tmpTReerr
2498 + tmp2Re * tmp2Re * tmpNReerr * tmpNReerr);
2503 double tmpTReerrmom =
2506 double tmpRReerrmom =
sqrt(tmp1Re * tmp1Re * tmpTReerrmom * tmpTReerrmom);
2509 tmpT2, TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass());
2510 double tmpchi2ndfRecoUn =
2518 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass(),
2525 fout <<
p_names[part].Data() <<
"\t" << tmpTRe <<
"\t" << tmpTReerr
2526 <<
"\t" << tmpTReerrmom <<
"\t"
2527 <<
sqrt(tmpTReerr * tmpTReerr + tmpTReerrmom * tmpTReerrmom) <<
"\t"
2528 << tmpRRe <<
"\t" << tmpRReerr <<
"\t" << tmpRReerrmom <<
"\t"
2529 <<
sqrt(tmpRReerr * tmpRReerr + tmpRReerrmom * tmpRReerrmom) <<
"\t"
2530 << tmpchi2ndf <<
"\n";
2532 printf(
"%lf\t%lf\t%lf\n", tmpchi2ndfMC, tmpchi2ndfRecoUn, tmpchi2ndf);
2540 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()),
2545 for (
int n = 0; n <
hfyMC[part]->GetNbinsX(); n++) {
2549 * (
hfyMC[part]->GetXaxis()->GetBinUpEdge(n)
2550 -
hfyMC[part]->GetXaxis()->GetBinLowEdge(n)));
2553 for (
int nx = 0; nx <
hfdndydptMC[part]->GetNbinsX(); nx++) {
2554 for (
int ny = 0; ny <
hfdndydptMC[part]->GetNbinsY(); ny++) {
2566 *
hfdndydptMC[part]->GetYaxis()->GetBinWidth(ny));
2575 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()),
2580 for (
int n = 0; n <
hfyReco[part]->GetNbinsX(); n++) {
2584 *
static_cast<double>(
events)
2585 * (
hfyReco[part]->GetXaxis()->GetBinUpEdge(n)
2586 -
hfyReco[part]->GetXaxis()->GetBinLowEdge(n)));
2589 for (
int nx = 0; nx <
hfdndydptReco[part]->GetNbinsX(); nx++) {
2590 for (
int ny = 0; ny <
hfdndydptReco[part]->GetNbinsY(); ny++) {
2601 *
static_cast<double>(
events)
2619 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass(),
2625 for (
int n = 0; n <
hfyRecoCor[part]->GetNbinsX(); n++) {
2629 *
static_cast<double>(
events)
2630 * (
hfyRecoCor[part]->GetXaxis()->GetBinUpEdge(n)
2631 -
hfyRecoCor[part]->GetXaxis()->GetBinLowEdge(n)));
2648 *
static_cast<double>(
events)
2656 cout <<
"MC chi2/ndf = "
2663 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()),
2669 cout <<
"MC YPtchi2/ndf = "
2676 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()),
2684 cout <<
"Reco uncor chi2/ndf = "
2691 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()),
2698 cout <<
"Reco uncor YPtchi2/ndf = "
2705 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass()),
2714 cout <<
"Reco chi2/ndf = "
2721 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass(),
2729 cout <<
"Reco YPtchi2/ndf = "
2736 TDatabasePDG::Instance()->GetParticle(
pdgIds[part])->Mass(),