FairRoot/PandaRoot
Public Member Functions | Private Attributes | List of all members
PndGeoDskFLG Class Reference

#include <PndGeoDskFLG.h>

Inheritance diagram for PndGeoDskFLG:

Public Member Functions

 PndGeoDskFLG ()
 
 ~PndGeoDskFLG ()
 
void Propagate (TVector3 pos, TVector3 dir, Int_t &i_FLG, Int_t &i_Pixel)
 
void LineCylinderInteraction (TVector3 pos, TVector3 dir, TVector3 &pos_interaction)
 
Bool_t CurveFunction (TVector3 Point)
 
Double_t SlopeCurveFunction (TVector3 Point)
 
Bool_t LineFunction (TVector3 Point)
 
Double_t radius ()
 
Double_t thickness ()
 
Double_t postion_plate ()
 
Double_t reflect_threshold ()
 

Private Attributes

double fRadius
 disc radius [cm] More...
 
Double_t fPosition_plate
 
Double_t fThickness_plate
 
Int_t fNumber_focusing_part
 
Double_t fReflectThreshold
 
Double_t a0
 
Double_t a1
 
Double_t a2
 
Double_t a3
 
Double_t a4
 
Double_t a5
 
int fVerbose
 

Detailed Description

Definition at line 12 of file PndGeoDskFLG.h.

Constructor & Destructor Documentation

PndGeoDskFLG::PndGeoDskFLG ( )
PndGeoDskFLG::~PndGeoDskFLG ( )
inline

Definition at line 32 of file PndGeoDskFLG.h.

32 {}

Member Function Documentation

Bool_t PndGeoDskFLG::CurveFunction ( TVector3  Point)

Definition at line 161 of file PndGeoDskFLG.cxx.

References a0, a1, a2, a3, a4, a5, and Double_t.

Referenced by Propagate().

163 {
164 Double_t x1 = Point.X();
165 Double_t y1 = Point.Y();
166 
167 return (y1 < (a0 + a1*x1 + a2*x1*x1 + a3*x1*x1*x1 + a4*x1*x1*x1*x1 + a5*x1*x1*x1*x1*x1));
168 }
Double_t a2
Definition: PndGeoDskFLG.h:23
Double_t a3
Definition: PndGeoDskFLG.h:24
Double_t
Double_t a1
Definition: PndGeoDskFLG.h:22
Double_t a4
Definition: PndGeoDskFLG.h:25
Double_t a0
Definition: PndGeoDskFLG.h:21
Double_t a5
Definition: PndGeoDskFLG.h:26
void PndGeoDskFLG::LineCylinderInteraction ( TVector3  pos,
TVector3  dir,
TVector3 &  pos_interaction 
)

Definition at line 139 of file PndGeoDskFLG.cxx.

References Double_t, fRadius, phi, Pi, and sqrt().

Referenced by Propagate().

140 {
141 
142  Double_t phi = dir.Phi();
143  Double_t slope = tan(phi);
144  Double_t A_xx = 1+slope*slope;
145  Double_t B_x = 2*slope*(pos.Y()-pos.X()*slope);
146  Double_t C_const = (pos.Y()-pos.X()*slope)*(pos.Y()-pos.X()*slope) - fRadius*fRadius;
147 
148  //cout<<"phi: "<<phi<<" abc: "<<A_xx<<" "<<B_x<<" "<<C_const<<endl;
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;
151  if((phi>TMath::Pi()/2.&&phi<=TMath::Pi())||(phi>=-1*TMath::Pi()&&phi<-1*TMath::Pi()/2.)) {x_cylinder = (-1*B_x-sqrt(B_x*B_x-4*A_xx*C_const))/(2*A_xx); }
152  else {x_cylinder = (-1*B_x+sqrt(B_x*B_x-4*A_xx*C_const))/(2*A_xx); }
153 
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();
156 
157  pos_interaction.SetXYZ(x_cylinder,y_cylinder,z_cylinder);
158 
159 }
TVector3 pos
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
double fRadius
disc radius [cm]
Definition: PndGeoDskFLG.h:15
Double_t
Double_t Pi
Bool_t PndGeoDskFLG::LineFunction ( TVector3  Point)

Definition at line 170 of file PndGeoDskFLG.cxx.

References Double_t, x, x0, y, and y0.

Referenced by Propagate().

171 {
172 Double_t x0 = 95.0000, y0 = -23.2129;
173 Double_t x1 = 67.0518, y1 = -100.0000;
174 Double_t x = Point.X();
175 Double_t y = Point.Y();
176 
177 return (y > (y0 + (y1-y0)/(x1-x0)*(x-x0)));
178 }
Double_t x0
Definition: checkhelixhit.C:70
Double_t
Double_t y0
Definition: checkhelixhit.C:71
Double_t x
Double_t y
Double_t PndGeoDskFLG::postion_plate ( )
inline

Definition at line 42 of file PndGeoDskFLG.h.

References fPosition_plate.

Referenced by PndDsk::ConstructGeometry().

42 {return fPosition_plate;}
Double_t fPosition_plate
Definition: PndGeoDskFLG.h:16
void PndGeoDskFLG::Propagate ( TVector3  pos,
TVector3  dir,
Int_t &  i_FLG,
Int_t &  i_Pixel 
)

Definition at line 41 of file PndGeoDskFLG.cxx.

References cos(), CurveFunction(), Double_t, fNumber_focusing_part, fPosition_plate, fThickness_plate, fVerbose, LineCylinderInteraction(), LineFunction(), Pi, sin(), SlopeCurveFunction(), and sqrt().

Referenced by PndDskFLGHitProducerIdeal::Exec(), and PndDsk::ProcessHitsCerenkov_FLG().

42 {
43  TVector3 Cylinder_point(1,0,0);
44  LineCylinderInteraction(pos, dir, Cylinder_point);
45  if(fVerbose > 1) cout<<"-I- PndGeoDskFLG::Propagate, Cylinder_point=("<<Cylinder_point.X()<<","<<Cylinder_point.Y()<<","<<Cylinder_point.Z()<<endl;
46 
47  //now, need to calc how many folder of this line, the position and direction at the edge of cylinder
48  Double_t z_inner_edge_plate = fPosition_plate-fThickness_plate/2;
49  Int_t N_reflection = Int_t((Cylinder_point.Z()- z_inner_edge_plate)/fThickness_plate); //from inner side of plate, thickness: 2cm
50  Double_t z_plate_edge = (Cylinder_point.Z()-z_inner_edge_plate) - N_reflection*fThickness_plate;
51  if(N_reflection%2==1) z_plate_edge = - z_plate_edge; //update start point
52  if(fVerbose > 1) cout<<"-I- PndGeoDskFLG::Propagate, N_reflection: "<<N_reflection<<" z of photon, when penetrates plate: "<<z_plate_edge<<endl;
53 
55  Int_t i_phi = Int_t(Cylinder_point.Phi()/dphi);
56 
57  if(Cylinder_point.Phi()<0) i_phi = i_phi-1;
58 
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;
61 
62  //Coordinate transform: global->certain light guide
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;
65 
66  //new way, use TVector3::Rotate()
67 
68  //now, propagate in light guide
69  TVector3 StartPoint(-70, -55+z_plate_edge, 0); //z = 0 temporary
70  Double_t StepLength = 10; //mm
71  if(fVerbose>1){
72  cout<<"-I- PndGeoDskFLG::Propagate, start Point: "<<StartPoint.X()<<" "<<StartPoint.Y()<<" "<<StartPoint.Z()<<endl;
73  }
74 
75  TVector3 Direction = dir_in_focusing_coor;
76  if(Direction.Phi()< 25./180*(TMath::Pi()) ||Direction.Phi()>50./180*(TMath::Pi()) ) return; //do not deal with this
77 
78  Int_t i_loop = 0, max_loop = 2000;
79  TVector3 NextPoint = StartPoint;
80  do{
81  NextPoint = NextPoint + Direction*StepLength;
82  i_loop++;
83  if(fVerbose>1)cout<<"NextPoint: "<<NextPoint.X()<<" "<<NextPoint.Y()<<" "<<NextPoint.Z()<<endl;
84  }while(CurveFunction(NextPoint)&&i_loop<max_loop);
85  NextPoint = NextPoint - Direction*StepLength; //go back one step
86 
87  StepLength /= 10; //0.1mm
88  do{
89  NextPoint = NextPoint + Direction*StepLength;
90  i_loop++;
91  if(fVerbose>1)cout<<"NextPoint: "<<NextPoint.X()<<" "<<NextPoint.Y()<<" "<<NextPoint.Z()<<endl;
92  }while(CurveFunction(NextPoint)&&i_loop<max_loop);
93  NextPoint = NextPoint - Direction*StepLength; //go back one step
94 
95  StepLength /= 10; //0.01mm
96  do{
97  NextPoint = NextPoint + Direction*StepLength;
98  i_loop++;
99  if(fVerbose>1)cout<<"NextPoint: "<<NextPoint.X()<<" "<<NextPoint.Y()<<" "<<NextPoint.Z()<<endl;
100  }while(CurveFunction(NextPoint)&&i_loop<max_loop);
101  NextPoint = NextPoint - Direction*StepLength; //go back one step
102 
103  Double_t phi_prime = SlopeCurveFunction(NextPoint);
104  Direction.SetPhi( 2*phi_prime - Direction.Phi());
105  if(fVerbose>1)cout<<"slope: "<<SlopeCurveFunction(NextPoint)<<endl;
106 
107  StepLength = 10;
108  do{
109  NextPoint = NextPoint + Direction*StepLength;
110  i_loop++;
111  if(fVerbose>1)cout<<"NextPoint: "<<NextPoint.X()<<" "<<NextPoint.Y()<<" "<<NextPoint.Z()<<endl;
112  }while(LineFunction(NextPoint)&&i_loop<max_loop);//while(NextPoint.X()<100);
113  NextPoint = NextPoint - Direction*StepLength; //go back one step
114 
115  StepLength /=10;
116  do{
117  NextPoint = NextPoint + Direction*StepLength;
118  i_loop++;
119  if(fVerbose>1)cout<<"NextPoint: "<<NextPoint.X()<<" "<<NextPoint.Y()<<" "<<NextPoint.Z()<<endl;
120  }while(LineFunction(NextPoint)&&i_loop<max_loop);//while(NextPoint.X()<100);
121  NextPoint = NextPoint - Direction*StepLength; //go back one step
122 
123  StepLength /=10;
124  do{
125  NextPoint = NextPoint + Direction*StepLength;
126  i_loop++;
127  if(fVerbose>1)cout<<"NextPoint: "<<NextPoint.X()<<" "<<NextPoint.Y()<<" "<<NextPoint.Z()<<endl;
128  }while(LineFunction(NextPoint)&&i_loop<max_loop);//while(NextPoint.X()<100);
129  NextPoint = NextPoint - Direction*StepLength; //go back one step
130 
131  //calc pixel ID, use the distance of last point and (67.0518, -100.0000) , or (95.0000 -23.2129)
132  Double_t distance_pixel = sqrt((NextPoint.X()-95)*(NextPoint.X()-95)+(NextPoint.Y()+23.2129)*(NextPoint.Y()+23.2129));
133 
134  i_FLG = i_phi;
135  i_Pixel = Int_t(distance_pixel); //fixme
136 }
TVector3 pos
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
void LineCylinderInteraction(TVector3 pos, TVector3 dir, TVector3 &pos_interaction)
Double_t fPosition_plate
Definition: PndGeoDskFLG.h:16
Double_t SlopeCurveFunction(TVector3 Point)
Double_t
Bool_t LineFunction(TVector3 Point)
Bool_t CurveFunction(TVector3 Point)
Double_t fThickness_plate
Definition: PndGeoDskFLG.h:17
Int_t fNumber_focusing_part
Definition: PndGeoDskFLG.h:18
Double_t Pi
Double_t PndGeoDskFLG::radius ( )
inline

Definition at line 40 of file PndGeoDskFLG.h.

References fRadius.

Referenced by PndDsk::ConstructGeometry().

40 {return fRadius;}
double fRadius
disc radius [cm]
Definition: PndGeoDskFLG.h:15
Double_t PndGeoDskFLG::reflect_threshold ( )
inline

Definition at line 43 of file PndGeoDskFLG.h.

References fReflectThreshold.

Referenced by PndDskFLGHitProducerIdeal::Exec(), and PndDsk::ProcessHitsCerenkov_FLG().

43 {return fReflectThreshold;}
Double_t fReflectThreshold
Definition: PndGeoDskFLG.h:19
Double_t PndGeoDskFLG::SlopeCurveFunction ( TVector3  Point)

Definition at line 180 of file PndGeoDskFLG.cxx.

References a0, a1, a2, a3, a4, a5, and Double_t.

Referenced by Propagate().

182 {
183 Double_t x1 = Point.X();
184 //Double_t y1 = Point.Y(); //[R.K. 01/2017] unused variable?
185 
186 return atan(a0*0. + a1 + 2*a2*x1 + 3*a3*x1*x1 + 4*a4*x1*x1*x1 + 5*a5*x1*x1*x1*x1);
187 }
Double_t a2
Definition: PndGeoDskFLG.h:23
Double_t a3
Definition: PndGeoDskFLG.h:24
Double_t
Double_t a1
Definition: PndGeoDskFLG.h:22
Double_t a4
Definition: PndGeoDskFLG.h:25
Double_t a0
Definition: PndGeoDskFLG.h:21
Double_t a5
Definition: PndGeoDskFLG.h:26
Double_t PndGeoDskFLG::thickness ( )
inline

Definition at line 41 of file PndGeoDskFLG.h.

References fThickness_plate.

Referenced by PndDsk::ConstructGeometry().

41 {return fThickness_plate;}
Double_t fThickness_plate
Definition: PndGeoDskFLG.h:17

Member Data Documentation

Double_t PndGeoDskFLG::a0
private

Definition at line 21 of file PndGeoDskFLG.h.

Referenced by CurveFunction(), and SlopeCurveFunction().

Double_t PndGeoDskFLG::a1
private

Definition at line 22 of file PndGeoDskFLG.h.

Referenced by CurveFunction(), and SlopeCurveFunction().

Double_t PndGeoDskFLG::a2
private

Definition at line 23 of file PndGeoDskFLG.h.

Referenced by CurveFunction(), and SlopeCurveFunction().

Double_t PndGeoDskFLG::a3
private

Definition at line 24 of file PndGeoDskFLG.h.

Referenced by CurveFunction(), and SlopeCurveFunction().

Double_t PndGeoDskFLG::a4
private

Definition at line 25 of file PndGeoDskFLG.h.

Referenced by CurveFunction(), and SlopeCurveFunction().

Double_t PndGeoDskFLG::a5
private

Definition at line 26 of file PndGeoDskFLG.h.

Referenced by CurveFunction(), and SlopeCurveFunction().

Int_t PndGeoDskFLG::fNumber_focusing_part
private

Definition at line 18 of file PndGeoDskFLG.h.

Referenced by Propagate().

Double_t PndGeoDskFLG::fPosition_plate
private

Definition at line 16 of file PndGeoDskFLG.h.

Referenced by postion_plate(), and Propagate().

double PndGeoDskFLG::fRadius
private

disc radius [cm]

Definition at line 15 of file PndGeoDskFLG.h.

Referenced by LineCylinderInteraction(), and radius().

Double_t PndGeoDskFLG::fReflectThreshold
private

Definition at line 19 of file PndGeoDskFLG.h.

Referenced by reflect_threshold().

Double_t PndGeoDskFLG::fThickness_plate
private

Definition at line 17 of file PndGeoDskFLG.h.

Referenced by Propagate(), and thickness().

int PndGeoDskFLG::fVerbose
private

Definition at line 28 of file PndGeoDskFLG.h.

Referenced by Propagate().


The documentation for this class was generated from the following files: