ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_TRD.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_TRD.C
1 #ifndef MACRO_G4TRD_C
2 #define MACRO_G4TRD_C
3 
4 #include <GlobalVariables.C>
5 
7 #include <g4main/PHG4Reco.h>
10 
11 R__LOAD_LIBRARY(libg4trd.so)
12 R__LOAD_LIBRARY(libg4detectors.so)
13 
14 namespace Enable
15 {
16  bool TRD = false;
17  //bool TRD_ABSORBER = false;
18  bool TRD_GAS = false;
19  bool TRD_OVERLAPCHECK = true;
20  int TRD_VERBOSITY = 0;
21 } // namespace Enable
22 
23 namespace TRD
24 {
25  double R_max = 180.;
26  double R_min = 15.;
27  double z_mid = 200. + 20;
28  double half_length = 6.5; // Mother volume, radiator = 10 cm
29  double z_min = z_mid - half_length;
30  double z_max = z_mid + half_length + 10.;
31 } // namespace TRD
32 void TRDInit()
33 {
37 }
38 
39 void TRDSetup(PHG4Reco* g4Reco)
40 {
43  se->Verbosity(verbosity);
44 
45  //bool AbsorberActive = Enable::ABSORBER || Enable::TRD_ABSORBER;
46  bool GasActive = Enable::ABSORBER || Enable::TRD_GAS;
47  bool OverlapCheck = Enable::OVERLAPCHECK || Enable::TRD_OVERLAPCHECK;
48  PHG4TRDSubsystem* trd_hcap = new PHG4TRDSubsystem("TRD_hcap", 1);
49 
50  trd_hcap->set_double_param("ThicknessZ", 2. * TRD::half_length);
51  trd_hcap->set_double_param("RIn", TRD::R_min);
52  trd_hcap->set_double_param("ROut", TRD::R_max);
53  trd_hcap->set_double_param("PosZ", TRD::z_mid);
54  trd_hcap->set_double_param("det_RIn", TRD::R_min);
55  trd_hcap->set_double_param("det_ROut", TRD::R_max);
56  trd_hcap->SetActive(1);
57  trd_hcap->SuperDetector("TRD");
58  //if(AbsorberActive)
59  if (GasActive)
60  {
61  trd_hcap->SetAbsorberActive(1);
62  }
63  trd_hcap->OverlapCheck(OverlapCheck);
64  g4Reco->registerSubsystem(trd_hcap);
65 
66  if (verbosity > 0)
67  {
68  cout << " Min Z :"
69  << " " << TRD::z_min << " Max Z :" << TRD::z_max << endl;
70  cout << "=======End setting parameters to geometry : ============" << endl;
71  }
73  {
75  TRACKING::ProjectionNames.insert("TRD");
76 
77  //Use hits from absorber (Active Gas volume)
78  TRACKING::FastKalmanFilter->add_phg4hits(string("G4HIT_") + string(Form("ACTIVEGAS_TRD")), // const std::string& phg4hitsNames,
79  PHG4TrackFastSim::Vertical_Plane, // const DETECTOR_TYPE phg4dettype,
80  1. / sqrt(12.), // const float radres,
81  70e-4, // const float phires,
82  100e-4, // const float lonres,
83  1, // const float eff,
84  0);
85  }
86 
87  return;
88 }
89 
90 void TRD_Reco()
91 {
92  gSystem->Load("libfun4all.so");
93  gSystem->Load("libg4detectors.so");
94 
97 
98  return;
99 }
100 #endif