18 double weight[kNPidType];
23 for (
int k=0;k<cand->GetHypHits(); k++) {
24 dE+=cand->GetHypHitdE(k);
25 dx+=cand->GetHypHitdx(k);
26 fmomentum+=cand->GetHypHitMomentum(k);
30 fmomentum/=cand->GetHypHits();
35 CalcLikelihood(weight);
37 cand->SetLikelihood(2212, weight[kProton]);
38 cand->SetLikelihood(211, weight[kPion]);
39 cand->SetLikelihood(321, weight[kKaon]);
40 cand->SetLikelihood(13, weight[kMuon]);
41 cand->SetLikelihood(11, weight[kElectron]);
62 std::cout<<
" energy loss "<<
fenergyloss<<
" part "<<part<<std::endl;
63 std::cout<<
" mean energy loss "<<
MeanEnergyLoss(part)<<
" mpv "<<
mpv(part)<<std::endl;
65 std::cout<<
" weight 1 "<<
width1(part)<<
" weight 2 "<<
width2(part)<<std::endl;
101 static float eb=0.14e-6;
103 static float c=2.99792458e8;
106 float Mass[
kNPidType]={ 0.511e-3, 0.1058, 0.1396, 0.4937, 0.9383 };
108 double sqrBeta=1/(1+pow(Mass[part]/
fmomentum,2));
109 return 4.9312e-05 * (
log(2*Mass[
kElectron]*c*c/eb*sqrBeta/(1-sqrBeta))-sqrBeta)/sqrBeta;
118 return TMath::Gaus(s_mpv, 0, width2,
true);
120 return TMath::Landau(s_mpv, 0, width1,
true);
122 static double x[12] = { 0.96028985649753623, 0.79666647741362674,
123 0.52553240991632899, 0.18343464249564980,
124 0.98940093499164993, 0.94457502307323258,
125 0.86563120238783174, 0.75540440835500303,
126 0.61787624440264375, 0.45801677765722739,
127 0.28160355077925891, 0.09501250983763744};
129 static double w[12] = { 0.10122853629037626, 0.22238103445337447,
130 0.31370664587788729, 0.36268378337836198,
131 0.02715245941175409, 0.06225352393864789,
132 0.09515851168249278, 0.12462897125553387,
133 0.14959598881657673, 0.16915651939500254,
134 0.18260341504492359, 0.18945061045506850};
136 double h, bb, aa,
c1,
c2, u, s8, s16,
f1,
f2;
153 f1 = TMath::Landau(s_mpv+xx, 0, width1,
true)*TMath::Gaus(xx, 0, width2,
true);
155 f2 = TMath::Landau(s_mpv+xx, 0, width1,
true)*TMath::Gaus(xx, 0, width2,
true);
162 f1 = TMath::Landau(s_mpv+xx, 0, width1,
true)*TMath::Gaus(xx, 0, width2,
true);
164 f2 = TMath::Landau(s_mpv+xx, 0, width1,
true)*TMath::Gaus(xx, 0, width2,
true);
165 s16+= w[
i]*(f1 +
f2);
168 if (
TMath::Abs(s16-c2*s8) <= 1e-12*(s16+1) ) {
197 std::cout<<
" proton "<<std::endl;
242 return c0+c1*(x1-
x0)+d1*(x-x1);
246 return c0+c1*(x-
x0)+pow(x0-x,3)*(a3+(x0-
x)*(a4+(x0-x)*a5));
254 return +3.81174e-04+x*(-2.25108e-04+x*+5.45154e-05);
256 return -5.28145e-05+x*(+8.29883e-04+x*-5.35972e-04);
260 return +2.61134e-04+x*(-1.30818e-04+x*+3.44165e-05);
262 return +3.41858e-04+x*(-3.21115e-04+x*+1.37459e-04);
266 return +1.88718e-04+x*(-6.38948e-05+x*+1.78590e-05);
268 return +1.82872e-04+x*(-1.28373e-04+x*+8.01459e-05);
272 return +1.06142e-04+x*(+3.68777e-05+x*-1.00190e-05);
274 return +1.89374e-04+x*(-1.46441e-04+x*+9.10813e-05);
279 return +1.27955e-04+x*(-3.15732e-06+x*+9.64736e-06);
290 return +6.41067e-04+x*(-3.82507e-04+x*+9.03732e-05);
292 return +6.40328e-04-3.21725e-04*x+3.17708e-05*pow(x,-3);
296 return +2.22504e-04+x*(-6.40051e-06+x*+2.14434e-06);
298 return +3.86684e-04-1.61873e-04*x+7.76586e-06*pow(x,-3);
302 return +1.32999e-04+x*(+1.19714e-04+x*-3.53302e-05);
304 return +2.21603e-04-3.21357e-06*x+4.64793e-06*pow(x,-2);
308 return +7.84582e-05+x*(+1.88988e-04+x*-5.49637e-05);
310 return +1.67388e-04+5.67991e-05*x+3.42702e-06*pow(x,-2);
315 return +4.08849e-04-3.56548e-05*x+1.84825e-08*pow(x,-3);
static double width2(PidType particle)
static double fenergyloss
friend F32vec4 log(const F32vec4 &a)
void SetLikelihood(int lundId, double likelihood)
static double MeanEnergyLoss(PidType particle)
static double width1(PidType particle)
static void CalcLikelihood(PndHypPidCand *cand)
static double mpv(PidType particle)
static double LandauGaus(double s_mpv, double width1, double width2)