11 #include "FairGeoNode.h"
24 fPosition_plate = 2000;
25 fThickness_plate = 20;
26 fNumber_focusing_part = 128;
27 fReflectThreshold = 0.8;
31 a2 = -14.37217*1.0E-4;
32 a3 = -2.044957*1.0E-6;
33 a4 = -1.998331*1.0E-8;
34 a5 = -1.109226*1.0E-10;
43 TVector3 Cylinder_point(1,0,0);
45 if(
fVerbose > 1) cout<<
"-I- PndGeoDskFLG::Propagate, Cylinder_point=("<<Cylinder_point.X()<<
","<<Cylinder_point.Y()<<
","<<Cylinder_point.Z()<<endl;
49 Int_t N_reflection = Int_t((Cylinder_point.Z()- z_inner_edge_plate)/
fThickness_plate);
51 if(N_reflection%2==1) z_plate_edge = - z_plate_edge;
52 if(
fVerbose > 1) cout<<
"-I- PndGeoDskFLG::Propagate, N_reflection: "<<N_reflection<<
" z of photon, when penetrates plate: "<<z_plate_edge<<endl;
55 Int_t i_phi = Int_t(Cylinder_point.Phi()/dphi);
57 if(Cylinder_point.Phi()<0) i_phi = i_phi-1;
59 Double_t phi_foucsing_part = i_phi*dphi;
60 if(
fVerbose > 1) cout<<
"-I- PndGeoDskFLG::Propagate, i_phi: "<<i_phi<<
" "<<phi_foucsing_part<<
" dphi: "<<dphi<<
" Cylinder_point.Phi(): "<<Cylinder_point.Phi()<<endl;
63 TVector3 dir_in_focusing_coor(
sin(dir.Theta())*
cos(dir.Phi()-phi_foucsing_part),
cos(dir.Theta()),
sin(dir.Theta())*
sin(dir.Phi()-phi_foucsing_part));
64 if(
fVerbose > 1) cout<<
"-I- PndGeoDskFLG::Propagate,theta, phi in new coordinate: "<<dir_in_focusing_coor.Theta()<<
" "<<dir_in_focusing_coor.Phi()<<endl;
69 TVector3 StartPoint(-70, -55+z_plate_edge, 0);
72 cout<<
"-I- PndGeoDskFLG::Propagate, start Point: "<<StartPoint.X()<<
" "<<StartPoint.Y()<<
" "<<StartPoint.Z()<<endl;
75 TVector3 Direction = dir_in_focusing_coor;
76 if(Direction.Phi()< 25./180*(
TMath::Pi()) ||Direction.Phi()>50./180*(
TMath::Pi()) )
return;
78 Int_t i_loop = 0, max_loop = 2000;
79 TVector3 NextPoint = StartPoint;
81 NextPoint = NextPoint + Direction*StepLength;
83 if(
fVerbose>1)cout<<
"NextPoint: "<<NextPoint.X()<<
" "<<NextPoint.Y()<<
" "<<NextPoint.Z()<<endl;
85 NextPoint = NextPoint - Direction*StepLength;
89 NextPoint = NextPoint + Direction*StepLength;
91 if(
fVerbose>1)cout<<
"NextPoint: "<<NextPoint.X()<<
" "<<NextPoint.Y()<<
" "<<NextPoint.Z()<<endl;
93 NextPoint = NextPoint - Direction*StepLength;
97 NextPoint = NextPoint + Direction*StepLength;
99 if(
fVerbose>1)cout<<
"NextPoint: "<<NextPoint.X()<<
" "<<NextPoint.Y()<<
" "<<NextPoint.Z()<<endl;
101 NextPoint = NextPoint - Direction*StepLength;
104 Direction.SetPhi( 2*phi_prime - Direction.Phi());
109 NextPoint = NextPoint + Direction*StepLength;
111 if(
fVerbose>1)cout<<
"NextPoint: "<<NextPoint.X()<<
" "<<NextPoint.Y()<<
" "<<NextPoint.Z()<<endl;
113 NextPoint = NextPoint - Direction*StepLength;
117 NextPoint = NextPoint + Direction*StepLength;
119 if(
fVerbose>1)cout<<
"NextPoint: "<<NextPoint.X()<<
" "<<NextPoint.Y()<<
" "<<NextPoint.Z()<<endl;
121 NextPoint = NextPoint - Direction*StepLength;
125 NextPoint = NextPoint + Direction*StepLength;
127 if(
fVerbose>1)cout<<
"NextPoint: "<<NextPoint.X()<<
" "<<NextPoint.Y()<<
" "<<NextPoint.Z()<<endl;
129 NextPoint = NextPoint - Direction*StepLength;
132 Double_t distance_pixel =
sqrt((NextPoint.X()-95)*(NextPoint.X()-95)+(NextPoint.Y()+23.2129)*(NextPoint.Y()+23.2129));
135 i_Pixel = Int_t(distance_pixel);
145 Double_t B_x = 2*slope*(pos.Y()-pos.X()*slope);
149 if((B_x*B_x-4*A_xx*C_const)<0){ cout<<
" -E- PndGeoDskFLG::LineCylinderInteraction, no solution? check it"<<endl;
return;}
150 double x_cylinder, y_cylinder, z_cylinder;
152 else {x_cylinder = (-1*B_x+
sqrt(B_x*B_x-4*A_xx*C_const))/(2*A_xx); }
154 y_cylinder = x_cylinder*slope + (pos.Y()-pos.X()*slope);
155 z_cylinder =
sqrt((y_cylinder-pos.Y())*(y_cylinder-pos.Y()) + (x_cylinder-pos.X())*(x_cylinder-pos.X()))/tan(dir.Theta())+pos.Z();
157 pos_interaction.SetXYZ(x_cylinder,y_cylinder,z_cylinder);
167 return (y1 < (
a0 +
a1*x1 +
a2*x1*x1 +
a3*x1*x1*x1 +
a4*x1*x1*x1*x1 +
a5*x1*x1*x1*x1*x1));
173 Double_t x1 = 67.0518, y1 = -100.0000;
177 return (y > (
y0 + (y1-
y0)/(x1-x0)*(x-x0)));
186 return atan(
a0*0. +
a1 + 2*
a2*x1 + 3*
a3*x1*x1 + 4*
a4*x1*x1*x1 + 5*
a5*x1*x1*x1*x1);
friend F32vec4 cos(const F32vec4 &a)
friend F32vec4 sqrt(const F32vec4 &a)
friend F32vec4 sin(const F32vec4 &a)
void LineCylinderInteraction(TVector3 pos, TVector3 dir, TVector3 &pos_interaction)
double fRadius
disc radius [cm]
Double_t SlopeCurveFunction(TVector3 Point)
Bool_t LineFunction(TVector3 Point)
Bool_t CurveFunction(TVector3 Point)
Double_t fThickness_plate
void Propagate(TVector3 pos, TVector3 dir, Int_t &i_FLG, Int_t &i_Pixel)
Int_t fNumber_focusing_part