1 #ifndef RECOTOOL_CFALGO3DANGLE_CXX 2 #define RECOTOOL_CFALGO3DANGLE_CXX 34 if(clusters.size()==2 || clusters.size()==1)
return -1;
38 int plane_0 = clusters.at(0)->Plane();
39 int plane_1 = clusters.at(1)->Plane();
40 int plane_2 = clusters.at(2)->Plane();
41 double angle_2d_0 = clusters.at(0)->GetParams().angle_2d;
42 double angle_2d_1 = clusters.at(1)->GetParams().angle_2d;
43 double angle_2d_2 = clusters.at(2)->GetParams().angle_2d;
44 auto hits_0 = clusters.at(0)->GetParams().N_Hits ;
45 auto hits_1 = clusters.at(1)->GetParams().N_Hits ;
46 auto hits_2 = clusters.at(2)->GetParams().N_Hits ;
48 auto sumCharge0 = clusters.at(0)->GetParams().sum_charge;
49 auto sumCharge1 = clusters.at(1)->GetParams().sum_charge;
50 auto sumCharge2 = clusters.at(2)->GetParams().sum_charge;
61 double max_phi(0), middle_phi(0), min_phi(0);
62 double max_theta(0), middle_theta(0), min_theta(0);
64 double max_ratio(0), middle_ratio(0), min_ratio(0);
67 double max_hits(0), middle_hits(0), min_hits(0) ;
72 geou.
Get3DaxisN(plane_0,plane_1,angle_2d_0,angle_2d_1,phi_01,theta_01);
73 geou.
Get3DaxisN(plane_1,plane_2,angle_2d_1,angle_2d_2,phi_12,theta_12);
74 geou.
Get3DaxisN(plane_2,plane_0,angle_2d_2,angle_2d_0,phi_02,theta_02);
83 SetMaxMiddleMin(theta_01,theta_12,theta_02,max_theta,middle_theta,min_theta);
89 double ratio_max_min = 1;
90 double ratio_max_middle = 1;
93 double ratio_theta1 = 1;
94 double ratio_theta2 = 1;
104 for(
int i=0; i<2 ; i++){
105 while(min_phi + 360 < max_phi +
_phi_cut && min_phi +360 > max_phi -
_phi_cut)
108 SetMaxMiddleMin(max_phi, middle_phi, min_phi,max_phi,middle_phi,min_phi);
112 ratio_theta2 = min_theta / max_theta;
113 ratio_theta1 = middle_theta / max_theta;
114 ratio_phi = min_phi / max_phi ;
117 SetMaxMiddleMin(ratio_phi, ratio_theta1, ratio_theta2, max_ratio, middle_ratio, min_ratio);
119 ratio_max_min = min_hits / max_hits ;
120 ratio_max_middle = middle_hits / max_hits ;
122 ratio = max_ratio * sumCharge1* sumCharge2 * sumCharge0;
125 if( ratio_max_min <0.3)
126 ratio *= ratio_max_min ;
130 if( theta_01 == -999 || theta_12 == -999 || theta_02 == -999)
135 std::cout<<
"\nNhits planes 0, 1, 2: " <<clusters.at(0)->GetParams().N_Hits<<
", "<<clusters.at(1)->GetParams().N_Hits
136 <<
", "<<clusters.at(2)->GetParams().N_Hits ;
137 std::cout<<
"\nTheta1 , Theta2 : "<<ratio_theta1<<
", "<<ratio_theta2;
138 std::cout<<
"\nPhi Ratio: "<<ratio_phi;
139 std::cout<<
"\nHits ratio mid : "<<ratio_max_middle ;
141 std::cout<<
"\nTotal is: " <<ratio<<
" ***************";
144 std::cout<<
"\n\n0: 2dAngle: "<<clusters.at(0)->GetParams().cluster_angle_2d<<std::endl;
145 std::cout<<
"1: 2dAngle: "<<clusters.at(1)->GetParams().cluster_angle_2d<<std::endl;
146 std::cout<<
"2: 2dAngle: "<<clusters.at(2)->GetParams().cluster_angle_2d<<std::endl;
147 std::cout<<
"\nTheta,Phi MaxMM : "<<max_theta<<
", "<<middle_theta<<
", "<<min_theta<<
"\n\t\t" 148 <<max_phi<<
", "<<middle_phi<<
", "<<min_phi;
150 std::cout<<
"\nStart End Points: "<<clusters.at(0)->GetParams().start_point.t<<
", "<<clusters.at(0)->GetParams().end_point.t<<
"\n\t\t" 151 <<clusters.at(1)->GetParams().start_point.t<<
", "<<clusters.at(1)->GetParams().end_point.t<<
"\n\t\t " 152 <<clusters.at(2)->GetParams().start_point.t<<
", "<<clusters.at(2)->GetParams().end_point.t;
193 if(first > second && first > third){
196 else if (first > second && first < third){
201 else if (first > third && first < second){
206 else if(first <second && first <third)
210 if (max == first && second > third){
214 else if (max ==first && third > second){
219 if(min ==first && second > third){
223 else if(min ==first && third > second){
230 if( first == second && first > third ){
235 else if( first == second && first < third){
241 else if( first ==third && first > second){
247 else if( first == third && first < second){
253 else if( second ==third && second < first){
259 else if( second == third && second > first){
Class def header for a class CFAlgo3DAngle.
Int_t Get3DaxisN(Int_t iplane0, Int_t iplane1, Double_t omega0, Double_t omega1, Double_t &phi, Double_t &theta) const