ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_HToF.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_HToF.C
1 #ifndef MACRO_G4HToF_C
2 #define MACRO_G4HToF_C
3 
4 #include <GlobalVariables.C>
5 
8 
9 #include <g4main/PHG4Reco.h>
11 
12 R__LOAD_LIBRARY(libg4etof.so)
13 //R__LOAD_LIBRARY(libfun4all.so)
14 R__LOAD_LIBRARY(libg4detectors.so)
15 
16 namespace Enable
17 {
18  bool HTOF = false;
19  bool HTOF_GAS = false;
20  bool HTOF_OVERLAPCHECK = true;
21  int HTOF_VERBOSITY = 0;
22 } // namespace Enable
23 
24 namespace HTOF
25 {
26  int f_gas_lyr = 6.; // total number of layers
27  int f_mrpc_lyr = 7.; //total number of layers
28  int b_gas_lyr = 6.; // total number of layers
29  int b_mrpc_lyr = 7.; //total number of layers
30  int pcb_lyr = 3.;
31  int mylar_lyr = 4.;
32  int cu_lyr = 4.;
33  int carbon_lyr = 4.;
34  int honeycomb_lyr = 2.;
35  double z_start = 287.; //cm, starting point from left on +ve Z axis moving away from origin
36  double R_in = 15.0; // cm
37  double R_out = 170.; //cm
38  double gas_gap = 0.0220; // 220 microns
39  double mrpc_thick = 0.04; // 400 microns
40  double pcb_thick = 0.06; // 600 microns
41  double cu_thick = 0.003; // 30 microns, layer over pcb, (1 each on outer pcb and 2 on central pcb = 4)
42  double carbon_thick = 0.01; // 100 microns , 2 layers
43  double mylar_thick = 0.04; // 400 microns, 4 layers
44  double honeycomb_thick = 0.75; // 7.5 mm, 2 honeycomb
45 
47 
48  double z_end = (z_start + tof_width);
49 
50 } // namespace HTOF
51 
52 void HTOFInit()
53 {
57 }
58 
59 void HTOFSetup(PHG4Reco* g4Reco)
60 {
62  bool GasActive = Enable::ABSORBER || Enable::HTOF_GAS;
63  bool OverlapCheck = Enable::OVERLAPCHECK || Enable::HTOF_OVERLAPCHECK;
64 
66  se->Verbosity(verbosity);
67 
68  PHG4ECAPToFSubsystem* hTOF = new PHG4ECAPToFSubsystem("hTOF", 1);
69  hTOF->Verbosity(verbosity);
70  hTOF->set_int_param("n_fgas_layer", HTOF::f_gas_lyr);
71  hTOF->set_int_param("n_bgas_layer", HTOF::b_gas_lyr);
72  hTOF->set_double_param("gas_gap", HTOF::gas_gap);
73  hTOF->set_double_param("glass_thick", HTOF::mrpc_thick);
74  hTOF->set_double_param("Carbon_thick", HTOF::carbon_thick);
75  hTOF->set_double_param("pcb_thick", HTOF::pcb_thick);
76  hTOF->set_double_param("cu_thick", HTOF::cu_thick);
77  hTOF->set_double_param("honeycomb_thick", HTOF::honeycomb_thick);
78  hTOF->set_double_param("mylar_thick", HTOF::mylar_thick);
79  hTOF->set_double_param("Rin", HTOF::R_in);
80  hTOF->set_double_param("Rout", HTOF::R_out);
81  hTOF->set_double_param("z_begin", HTOF::z_start);
82  hTOF->set_int_param("use_g4steps", 1);
83  hTOF->SetActive(1);
84  hTOF->SuperDetector("HTOF");
85  if (GasActive)
86  {
87  hTOF->SetAbsorberActive(1);
88  }
89  hTOF->OverlapCheck(OverlapCheck);
90 
91  g4Reco->registerSubsystem(hTOF);
92 
93  //trd_hcap->OverlapCheck(1);
94 
95  if (verbosity > 1) cout << " HTOF gas layer :" << HTOF::f_gas_lyr << endl;
96 
98  {
99  /*
100  TRACKING::FastKalmanFilter->add_phg4hits(string("G4HIT_") + string(Form("ACTIVEGAS_HTOF")), // const std::string& phg4hitsNames,
101  PHG4TrackFastSim::Vertical_Plane, // const DETECTOR_TYPE phg4dettype,
102  1, //1. / sqrt(12.), // const float radres,
103  5.0e-1,//55e-4, // const float phires,
104  5.0e-1,//55e-4, // const float lonres,
105  1, // const float eff,
106  0); // const float noise
107 
108  */
109  //Reference plane projection at initial R of ToF
110  TRACKING::FastKalmanFilter->add_zplane_state(string("G4HIT_") + string(Form("ACTIVEGAS_HTOF")), HTOF::z_end);
111  TRACKING::ProjectionNames.insert(string("G4HIT_") + string(Form("ACTIVEGAS_HTOF")));
112  }
113  return;
114 }
115 
116 void HTOF_Reco()
117 {
118  gSystem->Load("libfun4all.so");
119  gSystem->Load("libg4detectors.so");
120 
123  //se->Verbosity(INT_MAX-10);
124 
125  return;
126 }
127 
128 #endif