EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_Barrel_Hcal_JLeic.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_Barrel_Hcal_JLeic.C
1 #ifndef MACRO_G4BARRELHCALJLEIC_C
2 #define MACRO_G4BARRELHCALJLEIC_C
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 BARREL_HCAL = false;
14 }
15 
16 namespace G4BARRELHCAL
17 {
18  double inner_radius = 144.;
19  double outer_radius = inner_radius + 100.;
20  double length = 460.;
21 } // namespace G4BARRELHCAL
22 
24 {
28 }
29 
30 double Barrel_Hcal(PHG4Reco* g4Reco,
31  double radius)
32 {
33  // here is our silicon:
34  double gap = 2.;
35  double thickness = 2.; // cm
36  if (radius > G4BARRELHCAL::inner_radius)
37  {
38  cout << "inconsistency: radius: " << radius
39  << " larger than Barrel Hcal inner radius: " << G4BARRELHCAL::inner_radius << endl;
40  gSystem->Exit(-1);
41  }
42 
45  for (int ilayer = 0; ilayer < 25; ilayer++)
46  {
47  if (radius > G4BARRELHCAL::outer_radius)
48  {
49  continue;
50  }
51  cyl = new PHG4CylinderSubsystem("BARRELHCAL", ilayer);
52  cyl->set_double_param("radius", radius);
53  cyl->set_string_param("material", "G4_Fe");
54  cyl->set_double_param("thickness", thickness);
55  cyl->set_double_param("length", G4BARRELHCAL::length);
56  cyl->SetActive();
57  cyl->SuperDetector("BARRELHCAL");
58  g4Reco->registerSubsystem(cyl);
59  radius += gap + thickness;
60  }
62 }
63 #endif // MACRO_G4BARRELHCALJLEIC_C