ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_Barrel_EIC.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_Barrel_EIC.C
1 #ifndef MACRO_G4BARREL_C
2 #define MACRO_G4BARREL_C
3 
6 #include <g4main/PHG4Reco.h>
8 #include "GlobalVariables.C"
9 
10 #include <string>
11 
12 R__LOAD_LIBRARY(libg4detectors.so)
13 
14 using namespace std;
15 
16 namespace Enable
17 {
18  bool BARREL = false;
19  bool BARREL_OVERLAPCHECK = false;
20 } // namespace Enable
21 //-----------------------------------------------------------------------------------//
22 void BarrelInit()
23 {
24 }
25 
26 void BarrelFastKalmanFilterConfigSVTX(PHG4TrackFastSim * kalman_filter, int ilay, double radius, bool addproj)
27 {
28 
29  // import Kalman filter config (lines 226 to 246 here: https://github.com/eic/g4lblvtx/blob/master/macros/auxiliary_studies/simplified_geometry/Fun4All_G4_simplified_v2.C):
30 
31  // add Vertexing Layers
32  kalman_filter->add_phg4hits(
33  Form("G4HIT_SVTX_%d",ilay), // const std::string& phg4hitsNames,
35  999., // radial-resolution [cm]
36  10. / 10000. / sqrt(12.), // azimuthal-resolution [cm]
37  10. / 10000. / sqrt(12.), // z-resolution [cm]
38  1, // efficiency,
39  0 // noise hits
40  );
41  kalman_filter->add_cylinder_state(Form("SVTX_%d",ilay), radius);
42  if(addproj)TRACKING::ProjectionNames.insert(Form("SVTX_%d",ilay));
43 }
44 
45 void BarrelFastKalmanFilterConfigBARR(PHG4TrackFastSim * kalman_filter, int ilay, double radius, bool addproj)
46 {
47  // add Barrel Layers
48  kalman_filter->add_phg4hits(
49  Form("G4HIT_BARR_%d",ilay), // const std::string& phg4hitsNames,
51  999., // radial-resolution [cm]
52  10. / 10000. / sqrt(12.), // azimuthal-resolution [cm]
53  10. / 10000. / sqrt(12.), // z-resolution [cm]
54  1, // efficiency,
55  0 // noise hits
56  );
57  kalman_filter->add_cylinder_state(Form("BARR_%d",ilay), radius);
58  if(addproj)TRACKING::ProjectionNames.insert(Form("BARR_%d",ilay));
59 
60 }
61 
62 
63 //-----------------------------------------------------------------------------------//
64 void Barrel(PHG4Reco *g4Reco, int det_ver = 3)
65 {
67  // import Geometry (lines 111 to 148 in https://github.com/eic/g4lblvtx/blob/master/macros/auxiliary_studies/simplified_geometry/Fun4All_G4_simplified_v2.C):
68  PHG4CylinderSubsystem *cyl(nullptr);
69 
70  //---------------------------
71  // Vertexing
72  double si_vtx_r_pos[] = {3.6, 4.8, 12.3};
73  const int nVtxLayers = sizeof(si_vtx_r_pos) / sizeof(*si_vtx_r_pos);
74  for (int ilayer = 0; ilayer < nVtxLayers; ilayer++)
75  {
76  cyl = new PHG4CylinderSubsystem("SVTX", ilayer);
77  cyl->set_string_param("material", "G4_Si");
78  cyl->set_double_param("radius", si_vtx_r_pos[ilayer]);
79  cyl->set_double_param("thickness", 0.05 / 100. * 9.37);
80  cyl->set_double_param("place_z", 0.);
81  cyl->set_double_param("length", 27);
82  cyl->SetActive();
83 // cyl->SuperDetector("SVTX"); breakout SVTX into individual layers
84  cyl->OverlapCheck(OverlapCheck);
85  g4Reco->registerSubsystem(cyl);
86 
87  BarrelFastKalmanFilterConfigSVTX(TRACKING::FastKalmanFilter, ilayer, si_vtx_r_pos[ilayer],true);
90  }
91  //---------------------------
92  // Barrel
93 
94  double z_e_length[] = {-38.5, -52.0};
95  double z_h_length[] = {38.5, 52.0};
96  double si_r_pos[] = {30., 40.00}; // Modified on 29th Oct to account for new struture design
97  const int nTrckLayers = sizeof(si_r_pos) / sizeof(*si_r_pos);
98  double mat_barr[] = {0.25,0.55};
99  for (int ilayer = 0; ilayer < nTrckLayers; ilayer++)
100  {
101  //cout << "Radius " << ilayer + 1 << ": " << si_r_pos[ilayer] << "cms \t e-length : " << z_e_length[ilayer] << "cms \t h-length : " << z_h_length[ilayer] << "cms"<< endl;
102  //cout << "eslope : " << e_slope1 << " \n hslope : " << h_slope1 << " \n zleft : " << z_e_length[ilayer] << "\n zright : " << z_h_length[ilayer] << " \n radius : " << si_r_pos[ilayer] << endl ;
103  cyl = new PHG4CylinderSubsystem("BARR", ilayer);
104  cyl->set_string_param("material", "G4_Si");
105  cyl->set_double_param("radius", si_r_pos[ilayer]);
106  cyl->set_double_param("thickness", mat_barr[ilayer] / 100. * 9.37);
107  cyl->set_double_param("place_z", (z_h_length[ilayer] + z_e_length[ilayer])/2);
108  cyl->set_double_param("length", (z_h_length[ilayer] - z_e_length[ilayer]));
109  cyl->SetActive();
110  cyl->OverlapCheck(OverlapCheck);
111 // cyl->SuperDetector("BARR"); breakout BARR into individual layers
112  g4Reco->registerSubsystem(cyl);
113 
114  BarrelFastKalmanFilterConfigBARR(TRACKING::FastKalmanFilter, ilayer, si_r_pos[ilayer],true);
117  }
118 
119  return si_r_pos[1];
120 }
121 
122 #endif
123