#ifndef TrackerGeometry_h #define TrackerGeometry_h 1 #include #include #include #include class TrackerGeometry { public: //Default Constructor TrackerGeometry(); TrackerGeometry(std::string input_macro_file); TrackerGeometry(TTree * t_geom); TTree* WriteParameters(); //Destructor ~TrackerGeometry(); //some simple get functions //not all variables have a get function //as many of them are used to compute more //important quantities. //No set functions as all variables are obtained //from external files or classes and used to //calculate other variables double get_s_pitch() const { return s_pitch; } double get_s_length() const { return s_length; } int get_strips() const { return strips; } double get_det_width() const { return det_width; } double get_diag() const { return diag; } double get_origin_angle() const { return origin_angle; } double get_x1_zpos() const { return x1_zpos; } double get_u1_zpos() const { return u1_zpos; } double get_v1_zpos() const { return v1_zpos; } double get_x2_zpos() const { return x2_zpos; } double get_u2_zpos() const { return u2_zpos; } double get_v2_zpos() const { return v2_zpos; } double get_x3_zpos() const { return x3_zpos; } double get_u3_zpos() const { return u3_zpos; } double get_v3_zpos() const { return v3_zpos; } double get_x4_zpos() const { return x4_zpos; } double get_u4_zpos() const { return u4_zpos; } double get_v4_zpos() const { return v4_zpos; } double get_TP1_zpos() const { return TP1_zpos; } double get_TP2_zpos() const { return TP2_zpos; } double get_TP3_zpos() const { return TP3_zpos; } double get_TP4_zpos() const { return TP4_zpos; } double get_phantom_zpos() const { return phantom_zpos; } double get_compensator_zpos() const { return compensator_zpos; } double get_calorimeter_zpos() const { return calorimeter_zpos; } double get_phantom_centre_d() const { return phantom_centre_d; } double get_phantom_average_d() const { return phantom_average_d; } double get_phantom_surface_d() const { return phantom_surface_d; } double get_halfPhantomSizeZ() const { return halfPhantomSizeZ; } double get_halfCalorimeterSizeZ() const { return halfCalorimeterSizeZ; } double get_inter_plane_dist() const { return inter_plane_dist; } double get_inter_module_dist() const { return inter_module_dist; } double get_phantom_gap() const { return phantom_gap; } TVector3 get_A_x1() const { return A_x1; } TVector3 get_B_x1() const { return B_x1; } TVector3 get_C_x1() const { return C_x1; } TVector3 get_D_x1() const { return D_x1; } TVector3 get_A_u1() const { return A_u1; } TVector3 get_B_u1() const { return B_u1; } TVector3 get_C_u1() const { return C_u1; } TVector3 get_D_u1() const { return D_u1; } TVector3 get_A_v1() const { return A_v1; } TVector3 get_B_v1() const { return B_v1; } TVector3 get_C_v1() const { return C_v1; } TVector3 get_D_v1() const { return D_v1; } TVector3 get_A_x2() const { return A_x2; } TVector3 get_B_x2() const { return B_x2; } TVector3 get_C_x2() const { return C_x2; } TVector3 get_D_x2() const { return D_x2; } TVector3 get_A_u2() const { return A_u2; } TVector3 get_B_u2() const { return B_u2; } TVector3 get_C_u2() const { return C_u2; } TVector3 get_D_u2() const { return D_u2; } TVector3 get_A_v2() const { return A_v2; } TVector3 get_B_v2() const { return B_v2; } TVector3 get_C_v2() const { return C_v2; } TVector3 get_D_v2() const { return D_v2; } TVector3 get_A_x3() const { return A_x3; } TVector3 get_B_x3() const { return B_x3; } TVector3 get_C_x3() const { return C_x3; } TVector3 get_D_x3() const { return D_x3; } TVector3 get_A_u3() const { return A_u3; } TVector3 get_B_u3() const { return B_u3; } TVector3 get_C_u3() const { return C_u3; } TVector3 get_D_u3() const { return D_u3; } TVector3 get_A_v3() const { return A_v3; } TVector3 get_B_v3() const { return B_v3; } TVector3 get_C_v3() const { return C_v3; } TVector3 get_D_v3() const { return D_v3; } TVector3 get_A_x4() const { return A_x4; } TVector3 get_B_x4() const { return B_x4; } TVector3 get_C_x4() const { return C_x4; } TVector3 get_D_x4() const { return D_x4; } TVector3 get_A_u4() const { return A_u4; } TVector3 get_B_u4() const { return B_u4; } TVector3 get_C_u4() const { return C_u4; } TVector3 get_D_u4() const { return D_u4; } TVector3 get_A_v4() const { return A_v4; } TVector3 get_B_v4() const { return B_v4; } TVector3 get_C_v4() const { return C_v4; } TVector3 get_D_v4() const { return D_v4; } double get_stereo_x1() const { return stereo_x1; } double get_stereo_u1() const { return stereo_u1; } double get_stereo_v1() const { return stereo_v1; } double get_stereo_x2() const { return stereo_x2; } double get_stereo_u2() const { return stereo_u2; } double get_stereo_v2() const { return stereo_v2; } double get_stereo_x3() const { return stereo_x3; } double get_stereo_u3() const { return stereo_u3; } double get_stereo_v3() const { return stereo_v3; } double get_stereo_x4() const { return stereo_x4; } double get_stereo_u4() const { return stereo_u4; } double get_stereo_v4() const { return stereo_v4; } void ComputeParameters(); void PrintGeometry(); TVector3 get_strip_origin(TVector3 det_origin, int strip_no, double stereo_angle); TVector3 build_strip(TVector3 btm, double stereo_angle); void draw_strip(TLine * x_low, TLine * x_mid, TLine * x_high, float x, float y, float z, double stereo_angle); double world_2_det_transform(TVector3 det_origin, TVector3 det_opp_origin, TVector3 hit); bool IsInsideStrip(TVector3 h, TVector3 origin, double stereo_angle); TVector3 get_average_strip_pos(TVector3 det_origin, std::vector strips, double stereo_angle); TVector3 get_average_pos(TVector3 p1, TVector3 p2); TVector3 get_average_pos(std::vector points); private: //initialize geometry parameters void InitParameters(); void InitParameters(std::string input_macro_file); void InitParameters(TTree * geom_tree); //detector parameters double s_pitch; //Strip pitch in mm double s_length; //Length of strips in mm, slightly longer than width (pitch*strips) int strips; //No. of strips on each detector double det_width; double diag; //distance from origin to corner of det. double origin_angle; //angle between vector from origin (det. centre) to det. corner and x axis //lengths and spacing between geometry elements double halfPhantomSizeZ; double halfCalorimeterSizeZ; double inter_plane_dist; double inter_module_dist; double phantom_gap; //geometry positions on z axis double x1_zpos, u1_zpos, v1_zpos, x2_zpos, u2_zpos, v2_zpos; double x3_zpos, u3_zpos, v3_zpos, x4_zpos, u4_zpos, v4_zpos; double TP1_zpos, TP2_zpos, TP3_zpos, TP4_zpos; double phantom_zpos, compensator_zpos, calorimeter_zpos; double phantom_centre_d, phantom_average_d, phantom_surface_d; //position vectors for each detector corner TVector3 A_x1, B_x1, C_x1, D_x1, A_u1, B_u1, C_u1, D_u1, A_v1, B_v1, C_v1, D_v1; TVector3 A_x2, B_x2, C_x2, D_x2, A_u2, B_u2, C_u2, D_u2, A_v2, B_v2, C_v2, D_v2; TVector3 A_x3, B_x3, C_x3, D_x3, A_u3, B_u3, C_u3, D_u3, A_v3, B_v3, C_v3, D_v3; TVector3 A_x4, B_x4, C_x4, D_x4, A_u4, B_u4, C_u4, D_u4, A_v4, B_v4, C_v4, D_v4; //stereo angles for planes double stereo_x1; double stereo_u1; double stereo_v1; double stereo_x2; double stereo_u2; double stereo_v2; double stereo_x3; double stereo_u3; double stereo_v3; double stereo_x4; double stereo_u4; double stereo_v4; }; #endif