12 ReadMap(
"ctr_map_p1_0.95.root");
15 fMs_mom =
new TF1(
"",
"expo(0)+expo(2)+expo(4)");
16 fMs_mom->SetParameters(4.40541
e+00, -5.52436
e+00, 2.35058
e+00, -1.02703
e+00, 9.55032
e-01,
26 TF1 *fMs_thickness_17 =
new TF1(
"",
"pol1");
27 fMs_thickness_17->SetParameters(4.5, 0.0357143);
32 TFile *
file = TFile::Open(name);
34 file->GetObject(
"htrr",
fTrrMap);
39 double theta = mom.Theta() * TMath::RadToDeg();
40 return GetInfo(pdg, p, theta, track_err);
52 for (
int i = 0; i <
max; i++) {
60 if (theta < 19.99 || theta > 160.01){
61 std::cout<<
"theta out of [20,160] deg range: "<<theta<<std::endl;
64 double ms_mom_err =
fMs_mom->Eval(p);
66 double alpha = (theta < 90) ? 90 - theta : theta - 90;
70 double ms_err = 0.31 * ms_mom_err * ms_thick_frac;
73 if (theta < 25) theta = 25;
74 if (theta > 153) theta = 153;
78 double ctr =
fTrrMap->GetBinContent(bin);
79 double cctr = sqrt(ctr * ctr + track_err * track_err + ms_err * ms_err) *
83 double true_cangle = acos(sqrt(p * p +
fMass[pid] *
fMass[pid]) / p / 1.46907);
84 true_cangle += gRandom->Gaus(0, cctr);
87 if (true_cangle != true_cangle)
return info;
89 double cangle,
sum = 0, fsum = 0;
92 for (
int i = 0; i <
max; i++) {
93 cangle = acos(sqrt(p * p +
fMass[i] *
fMass[i]) / p / 1.46907);
94 if (cangle != cangle)
continue;
95 delta[i] = fabs(cangle - true_cangle);
97 info.
sigma[i] = (cangle - true_cangle) / cctr;
98 if (i == pid) info.
cangle = cangle;
101 for (
int i = 0; i <
max; i++) {
102 if (delta[i] > 0) info.
probability[i] = sum / delta[i];
113 if (pdg == 11) pid = 0;
114 if (pdg == 13) pid = 1;
115 if (pdg == 211) pid = 2;
116 if (pdg == 321) pid = 3;
117 if (pdg == 2212) pid = 4;