6 #include <TDatabasePDG.h>
13 _pdg =
new TDatabasePDG();
20 bool use_reconstructed_momentum =
false;
21 bool use_truth_momentum =
false;
22 bool use_emission_momentum =
true;
26 int pid[4] = { 11, 211, 321, 2212 };
28 _pdg->GetParticle(pid[0])->Mass(),
29 _pdg->GetParticle(pid[1])->Mass(),
30 _pdg->GetParticle(pid[2])->Mass(),
31 _pdg->GetParticle(pid[3])->Mass()
36 double windowx2 = acos( sqrt( m[1]*m[1] + test_p*test_p ) / index / test_p ) - acos( sqrt( m[2]*m[2] + test_p*test_p ) / index / test_p );
37 double window = windowx2/2;
41 momentum/sqrt( m[0]*m[0] + momentum*momentum ),
42 momentum/sqrt( m[1]*m[1] + momentum*momentum ),
43 momentum/sqrt( m[2]*m[2] + momentum*momentum ),
44 momentum/sqrt( m[3]*m[3] + momentum*momentum )
47 double theta_expect[4] = {
48 acos( 1/( index * beta[0] ) ),
49 acos( 1/( index * beta[1] ) ),
50 acos( 1/( index * beta[2] ) ),
51 acos( 1/( index * beta[3] ) )
56 double counts_cal[4] = {0,0,0,0};
57 if ( use_reconstructed_momentum )
59 cout <<
"Reconstructed momentum function undefined now!" << endl;
65 if ( use_truth_momentum )
67 cout <<
"Truth momentum function undefined now!" << endl;
73 if ( use_emission_momentum )
77 counts_cal[1] = 25.8 * acos( sqrt(178.4 + momentum*momentum) / (2.62*momentum) );
78 counts_cal[2] = 22.08 * acos( sqrt(982600 + momentum*momentum) / (52.93*momentum) );
84 int counts[4] = {0,0,0,0};
85 for (
int i=0;
i<300;
i++){
86 for (
int j=0;
j<4;
j++){
87 if ( angles[
i] > (theta_expect[
j] - window) && angles[
i] < (theta_expect[
j] + window) )
93 long double probs_norm = 0;
94 for (
int k=1;
k<3;
k++)
96 probs[
k] = _poisson->poisson_prob( counts_cal[
k], counts[k] );
97 probs_norm += probs[
k];
99 for (
int k=1;
k<3;
k++)
100 probs[
k] /= probs_norm;
104 double allcounts = counts[0] + counts[1] + counts[2] + counts[3];
105 double allcal = counts_cal[0] + counts_cal[1] + counts_cal[2] + counts_cal[3];
106 if ( allcounts / allcal < 0.2 )
107 cout <<
"WARNING: Very few photons in event. May be an unintended track!" << endl;