EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_FST_EIC.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_FST_EIC.C
1 /*---------------------------------------------------------------------*
2  * Barrel tracker designed by LANL EIC team *
3  * See technical notes for details: arXiv:2009.02888 *
4  * Contact Ping and Xuan @LANL for questions: *
5  * Xuan: xuanli@lanl.gov *
6  * Ping: cpwong@lanl.gov *
7  *---------------------------------------------------------------------*/
8 
9 #ifndef MACRO_G4FSTEIC_C
10 #define MACRO_G4FSTEIC_C
11 
12 #include "GlobalVariables.C"
13 
15 
16 #include <g4main/PHG4Reco.h>
17 
18 #include <string>
19 
20 R__LOAD_LIBRARY(libg4detectors.so)
21 
22 int make_LANL_FST_station(const string &name, PHG4Reco *g4Reco, double zpos, double Rmin,
23  double Rmax, double tSilicon);
24 //-----------------------------------------------------------------------------------//
25 namespace Enable
26 {
27  static bool FST = false;
28  bool FST_OVERLAPCHECK = false;
29 } // namespace Enable
30 
31 namespace G4FST
32 {
33  namespace SETTING
34  {
35  bool FSTV0 = false;
36  bool FSTV1 = false;
37  bool FSTV2 = false;
38  bool FSTV3 = false;
39  bool FSTV41 = false;
40  bool FSTV42 = false;
41  bool FSTV4 = false;
42  bool FSTV5 = false;
43  bool FST_TPC = false;
44  } // namespace SETTING
45 } // namespace G4FST
46 
47 //-----------------------------------------------------------------------------------//
48 void FST_Init()
49 {
50  if ((G4FST::SETTING::FSTV0 ? 1 : 0) +
51  (G4FST::SETTING::FSTV1 ? 1 : 0) +
52  (G4FST::SETTING::FSTV2 ? 1 : 0) +
53  (G4FST::SETTING::FSTV3 ? 1 : 0) +
54  (G4FST::SETTING::FSTV4 ? 1 : 0) +
55  (G4FST::SETTING::FSTV41 ? 1 : 0) +
56  (G4FST::SETTING::FSTV42 ? 1 : 0) +
57  (G4FST::SETTING::FSTV5 ? 1 : 0) +
58  (G4FST::SETTING::FST_TPC ? 1 : 0) >
59  1)
60  {
61  cout << "use only G4FST::SETTING::FSTV0=true ";
62  cout << "or G4FST::SETTING::FSTV1=true ";
63  cout << "or G4FST::SETTING::FSTV2=true ";
64  cout << "or G4FST::SETTING::FSTV3=true ";
65  cout << "or G4FST::SETTING::FSTV4=true ";
66  cout << "or G4FST::SETTING::FSTV41=true ";
67  cout << "or G4FST::SETTING::FSTV42=true ";
68  cout << "or G4FST::SETTING::FSTV5=true ";
69  cout << "or G4FST::SETTING::FST_TPC=true " << endl;
70  gSystem->Exit(1);
71  }
72 
75 }
76 //-----------------------------------------------------------------------------------//
77 void FSTSetup(PHG4Reco *g4Reco, const double min_eta = 1.245)
78 {
80  const double mm = .1 * cm;
81  const double um = 1e-3 * mm;
82 
83  //Design from Xuan Li @LANL
84  // Different FST version documented in arXiv:2009.0288
86  { // version 1
87  make_LANL_FST_station("FST_0", g4Reco, 35, 4, 25, 50 * um); //cm
88  make_LANL_FST_station("FST_1", g4Reco, 53, 4.5, 36, 50 * um);
89  make_LANL_FST_station("FST_2", g4Reco, 77, 5, 36, 50 * um);
90  make_LANL_FST_station("FST_3", g4Reco, 101, 6, 38.5, 50 * um);
91  make_LANL_FST_station("FST_4", g4Reco, 125, 6.5, 45, 50 * um);
92  }
93  else if (G4FST::SETTING::FSTV2)
94  { // version 2
95  make_LANL_FST_station("FST_0", g4Reco, 35, 4, 30, 50 * um); //cm
96  make_LANL_FST_station("FST_1", g4Reco, 53, 4.5, 35, 50 * um);
97  make_LANL_FST_station("FST_2", g4Reco, 77, 5, 36, 50 * um);
98  make_LANL_FST_station("FST_3", g4Reco, 101, 6, 38.5, 50 * um);
99  make_LANL_FST_station("FST_4", g4Reco, 270, 6.5, 45, 50 * um);
100  }
101  else if (G4FST::SETTING::FSTV3)
102  { // version 3
103  make_LANL_FST_station("FST_0", g4Reco, 35, 4, 25, 50 * um); //cm
104  make_LANL_FST_station("FST_1", g4Reco, 53, 4.5, 36, 50 * um);
105  make_LANL_FST_station("FST_2", g4Reco, 77, 5, 36, 50 * um);
106  make_LANL_FST_station("FST_3", g4Reco, 101, 6, 38.5, 100 * um);
107  make_LANL_FST_station("FST_4", g4Reco, 125, 6.5, 45, 100 * um);
108  }
109  else if (G4FST::SETTING::FSTV41)
110  { // version 4.1
111  make_LANL_FST_station("FST_0", g4Reco, 35, 4, 25, 50 * um); //cm
112  make_LANL_FST_station("FST_1", g4Reco, 53, 4.5, 36, 50 * um);
113  make_LANL_FST_station("FST_2", g4Reco, 77, 5, 36, 50 * um);
114  make_LANL_FST_station("FST_3", g4Reco, 101, 6, 38.5, 50 * um);
115  make_LANL_FST_station("FST_4", g4Reco, 125, 6.5, 45, 100 * um);
116  make_LANL_FST_station("FST_5", g4Reco, 270, 15, 45, 100 * um);
117  }
118  else if (G4FST::SETTING::FSTV42)
119  { // version 4.2
120  make_LANL_FST_station("FST_0", g4Reco, 35, 4, 25, 50 * um); //cm
121  make_LANL_FST_station("FST_1", g4Reco, 53, 4.5, 36, 50 * um);
122  make_LANL_FST_station("FST_2", g4Reco, 77, 5, 36, 50 * um);
123  make_LANL_FST_station("FST_3", g4Reco, 101, 6, 38.5, 100 * um);
124  make_LANL_FST_station("FST_4", g4Reco, 125, 6.5, 45, 100 * um);
125  make_LANL_FST_station("FST_5", g4Reco, 270, 15, 45, 100 * um);
126  }
127  else if (G4FST::SETTING::FSTV4)
128  { // version 4
129  make_LANL_FST_station("FST_0", g4Reco, 35, 4, 25, 50 * um); //cm
130  make_LANL_FST_station("FST_1", g4Reco, 53, 4.5, 36, 50 * um);
131  make_LANL_FST_station("FST_2", g4Reco, 77, 5, 36, 50 * um);
132  make_LANL_FST_station("FST_3", g4Reco, 101, 6, 38.5, 50 * um);
133  make_LANL_FST_station("FST_4", g4Reco, 125, 6.5, 45, 50 * um);
134  make_LANL_FST_station("FST_5", g4Reco, 270, 15, 45, 50 * um);
135  }
136  else if (G4FST::SETTING::FSTV5)
137  {
138  make_LANL_FST_station("FST_0", g4Reco, 35, 4, 25, 35 * um); //cm
139  make_LANL_FST_station("FST_1", g4Reco, 62.3, 4.5, 42, 35 * um);
140  make_LANL_FST_station("FST_2", g4Reco, 90, 6.5, 43, 35 * um);
141  make_LANL_FST_station("FST_3", g4Reco, 115, 8.9, 44, 85 * um);
142  make_LANL_FST_station("FST_4", g4Reco, 125, 9.5, 45, 85 * um);
143  make_LANL_FST_station("FST_5", g4Reco, 300, 16.8, 45, 85 * um); //optional disk at further location
144  }
145  else if (G4FST::SETTING::FST_TPC)
146  { // tpc version (based on version 4)
147  make_LANL_FST_station("FST_0", g4Reco, 35, 4, 17, 35 * um); //cm
148  make_LANL_FST_station("FST_1", g4Reco, 53, 4.5, 17, 35 * um);
149  make_LANL_FST_station("FST_2", g4Reco, 77, 5, 17, 35 * um);
150  make_LANL_FST_station("FST_3", g4Reco, 101, 7.5, 17, 85 * um);
151  make_LANL_FST_station("FST_4", g4Reco, 125, 9.5, 45, 85 * um);
152  //make_LANL_FST_station("FST_5", g4Reco, 280, 16, 45, 50 * um); //optional disk at further location
153  }
154  else
155  { // Version 0
156  make_LANL_FST_station("FST_0", g4Reco, 35, 4, 30, 100 * um); //cm
157  make_LANL_FST_station("FST_1", g4Reco, 53, 4.5, 35, 100 * um);
158  make_LANL_FST_station("FST_2", g4Reco, 77, 5, 36, 100 * um);
159  make_LANL_FST_station("FST_3", g4Reco, 101, 6, 38.5, 100 * um);
160  make_LANL_FST_station("FST_4", g4Reco, 125, 6.5, 45, 100 * um);
161  }
162 }
163 //-----------------------------------------------------------------------------------//
164 int make_LANL_FST_station(const string &name, PHG4Reco *g4Reco,
165  double zpos, double Rmin, double Rmax, double tSilicon) //silicon thickness
166 {
167  const bool OverlapCheck = Enable::OVERLAPCHECK || Enable::FST_OVERLAPCHECK;
168  // cout
169  // << "make_GEM_station - GEM construction with PHG4SectorSubsystem - make_GEM_station_EdgeReadout of "
170  // << name << endl;
171 
172  // always facing the interaction point
173  double polar_angle = 0;
174  if (zpos < 0)
175  {
176  zpos = -zpos;
177  polar_angle = M_PI;
178  }
179 
180  double min_polar_angle = atan2(Rmin, zpos);
181  double max_polar_angle = atan2(Rmax, zpos);
182 
183  if (max_polar_angle < min_polar_angle)
184  {
185  double t = max_polar_angle;
186  max_polar_angle = min_polar_angle;
187  min_polar_angle = t;
188  }
189 
190  PHG4SectorSubsystem *fst;
191  fst = new PHG4SectorSubsystem(name);
192 
193  fst->SuperDetector(name);
194 
195  fst->get_geometry().set_normal_polar_angle(polar_angle);
197  fst->get_geometry().set_min_polar_angle(min_polar_angle);
198  fst->get_geometry().set_max_polar_angle(max_polar_angle);
201  fst->get_geometry().set_N_Sector(1);
202  fst->get_geometry().set_material("G4_AIR");
203  fst->OverlapCheck(OverlapCheck);
204 
205  const double cm = PHG4Sector::Sector_Geometry::Unit_cm();
206  const double mm = .1 * cm;
207  const double um = 1e-3 * mm;
208  // build up layers
209 
210  fst->get_geometry().AddLayer("SiliconSensor", "G4_Si", tSilicon, true, 100);
211  fst->get_geometry().AddLayer("Metalconnection", "G4_Al", 15 * um, false, 100);
212  fst->get_geometry().AddLayer("HDI", "G4_KAPTON", 20 * um, false, 100);
213  fst->get_geometry().AddLayer("Cooling", "G4_WATER", 100 * um, false, 100);
214  fst->get_geometry().AddLayer("Support", "G4_GRAPHITE", 50 * um, false, 100);
215  fst->get_geometry().AddLayer("Support_Gap", "G4_AIR", 1 * cm, false, 100);
216  fst->get_geometry().AddLayer("Support2", "G4_GRAPHITE", 50 * um, false, 100);
217 
218  g4Reco->registerSubsystem(fst);
219  return 0;
220 }
221 
222 #endif
223 
224 //-----------------------------------------------------------------------------------//