Calculate 3d angles from all permutations of the 3 planes. Weight them according to charge profile. Choose the 2 best weights and compare those 2 theta and phi
33 if(clusters.size()==2 || clusters.size()==1)
return -1;
37 int plane_0 = clusters.at(0)->Plane();
38 int plane_1 = clusters.at(1)->Plane();
39 int plane_2 = clusters.at(2)->Plane();
40 double angle_2d_0 = clusters.at(0)->GetParams().angle_2d;
41 double angle_2d_1 = clusters.at(1)->GetParams().angle_2d;
42 double angle_2d_2 = clusters.at(2)->GetParams().angle_2d;
43 auto hits_0 = clusters.at(0)->GetParams().N_Hits ;
44 auto hits_1 = clusters.at(1)->GetParams().N_Hits ;
45 auto hits_2 = clusters.at(2)->GetParams().N_Hits ;
47 auto sumCharge0 = clusters.at(0)->GetParams().sum_charge;
48 auto sumCharge1 = clusters.at(1)->GetParams().sum_charge;
49 auto sumCharge2 = clusters.at(2)->GetParams().sum_charge;
60 double max_phi(0), middle_phi(0), min_phi(0);
61 double max_theta(0), middle_theta(0), min_theta(0);
63 double max_ratio(0), middle_ratio(0), min_ratio(0);
66 double max_hits(0), middle_hits(0), min_hits(0) ;
71 geou.
Get3DaxisN(plane_0,plane_1,angle_2d_0,angle_2d_1,phi_01,theta_01);
72 geou.
Get3DaxisN(plane_1,plane_2,angle_2d_1,angle_2d_2,phi_12,theta_12);
73 geou.
Get3DaxisN(plane_2,plane_0,angle_2d_2,angle_2d_0,phi_02,theta_02);
82 SetMaxMiddleMin(theta_01,theta_12,theta_02,max_theta,middle_theta,min_theta);
88 double ratio_max_min = 1;
89 double ratio_max_middle = 1;
92 double ratio_theta1 = 1;
93 double ratio_theta2 = 1;
103 for(
int i=0; i<2 ; i++){
104 while(min_phi + 360 < max_phi +
_phi_cut && min_phi +360 > max_phi -
_phi_cut)
107 SetMaxMiddleMin(max_phi, middle_phi, min_phi,max_phi,middle_phi,min_phi);
111 ratio_theta2 = min_theta / max_theta;
112 ratio_theta1 = middle_theta / max_theta;
113 ratio_phi = min_phi / max_phi ;
116 SetMaxMiddleMin(ratio_phi, ratio_theta1, ratio_theta2, max_ratio, middle_ratio, min_ratio);
118 ratio_max_min = min_hits / max_hits ;
119 ratio_max_middle = middle_hits / max_hits ;
121 ratio = max_ratio * sumCharge1* sumCharge2 * sumCharge0;
124 if( ratio_max_min <0.3)
125 ratio *= ratio_max_min ;
129 if( theta_01 == -999 || theta_12 == -999 || theta_02 == -999)
134 std::cout<<
"\nNhits planes 0, 1, 2: " <<clusters.at(0)->GetParams().N_Hits<<
", "<<clusters.at(1)->GetParams().N_Hits
135 <<
", "<<clusters.at(2)->GetParams().N_Hits ;
136 std::cout<<
"\nTheta1 , Theta2 : "<<ratio_theta1<<
", "<<ratio_theta2;
137 std::cout<<
"\nPhi Ratio: "<<ratio_phi;
138 std::cout<<
"\nHits ratio mid : "<<ratio_max_middle ;
140 std::cout<<
"\nTotal is: " <<ratio<<
" ***************";
143 std::cout<<
"\n\n0: 2dAngle: "<<clusters.at(0)->GetParams().cluster_angle_2d<<
std::endl;
144 std::cout<<
"1: 2dAngle: "<<clusters.at(1)->GetParams().cluster_angle_2d<<
std::endl;
145 std::cout<<
"2: 2dAngle: "<<clusters.at(2)->GetParams().cluster_angle_2d<<
std::endl;
146 std::cout<<
"\nTheta,Phi MaxMM : "<<max_theta<<
", "<<middle_theta<<
", "<<min_theta<<
"\n\t\t" 147 <<max_phi<<
", "<<middle_phi<<
", "<<min_phi;
149 std::cout<<
"\nStart End Points: "<<clusters.at(0)->GetParams().start_point.t<<
", "<<clusters.at(0)->GetParams().end_point.t<<
"\n\t\t" 150 <<clusters.at(1)->GetParams().start_point.t<<
", "<<clusters.at(1)->GetParams().end_point.t<<
"\n\t\t " 151 <<clusters.at(2)->GetParams().start_point.t<<
", "<<clusters.at(2)->GetParams().end_point.t;
Int_t Get3DaxisN(Int_t iplane0, Int_t iplane1, Double_t omega0, Double_t omega1, Double_t &phi, Double_t &theta) const
QTextStream & endl(QTextStream &s)