EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_Gem_JLeic.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_Gem_JLeic.C
1 #ifndef MACRO_G4GEMJLEIC
2 #define MACRO_G4GEMJLEIC
3 
4 #include <GlobalVariables.C>
5 
7 #include <g4main/PHG4Reco.h>
8 
9 R__LOAD_LIBRARY(libg4detectors.so)
10 
11 namespace Enable
12 {
13  bool GEM = false;
14 }
15 
16 namespace G4GEM
17 {
18  double outer_radius = 115.;
19 }
20 
21 void GemInit()
22 {
24 }
25 
26 void Gem(PHG4Reco* g4Reco)
27 {
28  // here is our silicon:
29  double gem_inner_radius = 0.; // cm
30  double gem_outer_radius = 115.; // cm
31  double size_z = 1.;
33  for (int ilayer = 0; ilayer < 8; ilayer++)
34  {
35  double irad = gem_inner_radius + 1. + 0.5 * ilayer;
36  double orad = G4GEM::outer_radius - 25. + 2. * ilayer;
37  cyl = new PHG4CylinderSubsystem("GemHadron", ilayer);
38  cyl->set_double_param("radius", irad);
39  cyl->set_string_param("material", "G4_CARBON_DIOXIDE");
40  cyl->set_double_param("thickness", orad - irad);
41  cyl->set_int_param("lengthviarapidity", 0);
42  cyl->set_double_param("length", size_z);
43  double place_z = 340. / 2. + 5. + 3. * ilayer;
44  cyl->set_double_param("place_z", place_z);
45  cyl->SetActive();
46  cyl->SuperDetector("GEMHADRON");
47  g4Reco->registerSubsystem(cyl);
49  }
50  for (int ilayer = 0; ilayer < 8; ilayer++)
51  {
52  double irad = gem_inner_radius + 1. + 0.5 * ilayer;
53  double orad = G4GEM::outer_radius - 25. + 2. * ilayer;
54  cyl = new PHG4CylinderSubsystem("GEMELECTRON", ilayer);
55  cyl->set_double_param("radius", gem_inner_radius);
56  cyl->set_string_param("material", "G4_CARBON_DIOXIDE");
57  cyl->set_double_param("thickness", orad - irad);
58  cyl->set_int_param("lengthviarapidity", 0);
59  cyl->set_double_param("length", size_z);
60  double place_z = -340. / 2. - 5. - 3. * ilayer;
61  cyl->set_double_param("place_z", place_z);
62  cyl->SetActive();
63  cyl->SuperDetector("GEMELECTRON");
64  g4Reco->registerSubsystem(cyl);
66  }
67 
68  return;
69 }
70 
71 #endif // MACRO_G4GEMJLEIC