ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_BMMG.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_BMMG.C
1 #ifndef MACRO_G4BMMG_C
2 #define MACRO_G4BMMG_C
3 
4 #include <GlobalVariables.C>
5 
9 #include <g4main/PHG4Reco.h>
11 
12 R__LOAD_LIBRARY(libg4barrelmmg.so)
13 R__LOAD_LIBRARY(libfun4all.so)
14 R__LOAD_LIBRARY(libg4testbench.so)
15 R__LOAD_LIBRARY(libg4detectors.so)
16 
17 namespace Enable
18 {
19  bool BMMG = false;
20  bool use_2Dreadout = true;
21  bool BMMG_OVERLAPCHECK = true;
22  int BMMG_VERBOSITY = 0;
23 } // namespace Enable
24 
25 namespace BMMG
26 {
27  const int n_layer = 3;
28 
29  const double rad[BMMG::n_layer] = {45., 47.4, 67.4}; // approximate radial location
30  const double len[BMMG::n_layer] = {140, 150, 280.0};
31 } // namespace BMMG
32 
33 void BMMGInit(int verbosity = 1)
34 {
38 }
39 
40 void BMMGSetup(PHG4Reco* g4Reco)
41 {
44  se->Verbosity(verbosity);
45 
46  bool OverlapCheck = Enable::OVERLAPCHECK || Enable::BMMG_OVERLAPCHECK;
47 
48  gSystem->Load("libfun4all");
49  gSystem->Load("libg4detectors.so");
50  gSystem->Load("libg4testbench.so");
51  gSystem->Load("libg4trackfastsim.so");
52 
53  PHG4CylinderStripSubsystem* barrel_mmg;
54  double gap_betweenCZ = 1.5;
55  double Gap_betweenlayer = 1.5;
56  double thickness = 0.36499;
57  int nCZlayer = 2;
59  {
60  gap_betweenCZ = 0;
61  nCZlayer = 1;
62  }
63 
64  const double prapidity = 1;
65 
66  for (int ilayer = 0; ilayer < BMMG::n_layer; ilayer++)
67  {
68  barrel_mmg = new PHG4CylinderStripSubsystem(Form("BMT_%d", ilayer), ilayer);
69  barrel_mmg->set_double_param("radius", BMMG::rad[ilayer]);
70  barrel_mmg->set_string_param("gas", "myMMGas");
71  //barrel_mmg->set_double_param("steplimits", 300e-4);
72  barrel_mmg->set_double_param("phi0", 15 * ilayer);
73  barrel_mmg->set_double_param("gap", gap_betweenCZ);
74  barrel_mmg->SetActive();
75  barrel_mmg->SuperDetector("BMT");
76  barrel_mmg->set_int_param("lengthviarapidity", 0);
77  barrel_mmg->set_double_param("gas1thickness", 0.15);
78  barrel_mmg->set_double_param("length", BMMG::len[ilayer]);
79  barrel_mmg->set_double_param("deadzone", 0.2);
80  barrel_mmg->set_int_param("nhit", 1);
81  barrel_mmg->OverlapCheck(true);
82  barrel_mmg->set_int_param("use_2Dreadout", Enable::use_2Dreadout);
83  g4Reco->registerSubsystem(barrel_mmg);
84  } // ilayer loop
85 
87  {
89  {
91  "G4HIT_BMT", // const std::string& phg4hitsNames,
92  PHG4TrackFastSim::Cylinder, // const DETECTOR_TYPE phg4dettype,
93  2.5 / 2 / sqrt(12), //1./sqrt(12), // radial-resolution , only used for Vertical Plane Detector Type
94  75e-4, //150e-4, // azimuthal-resolution [cm]
95  75e-4, //150e-4, // z-resolution [cm]
96  1, // efficiency,
97  0); // noise hits
98  }
99  else
100  {
102  "G4HIT_CZBMT", // const std::string& phg4hitsNames,
103  PHG4TrackFastSim::Cylinder, // const DETECTOR_TYPE phg4dettype,
104  2.5 / 2 / sqrt(12), //1/sqrt(12), // radial-resolution [cm], only used for Vertical Plane Detector Type
105  75e-4, //150e-4, // azimuthal-resolution [cm]
106  75e-4, //150e-4, // z-resolution [cm]
107  1, // efficiency,
108  0); // noise hits
109  }
110  }
111 
112  return;
113 }
114 
116 {
117  gSystem->Load("libfun4all.so");
118  gSystem->Load("libg4detectors.so");
119 
122 
123  return;
124 }
125 #endif