ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_B0ECAL.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_B0ECAL.C
1 #ifndef MACRO_G4B0ECAL_C
2 #define MACRO_G4B0ECAL_C
3 
4 #include <GlobalVariables.C>
5 
6 //include our own B0 Raw Tower Builder
7 #include <eicg4b0ecal/B0RawTowerBuilderByHitIndex.h>
8 
10 
12 // Use Forward Cal Cell Reco .
13 
14 #include <eicg4b0ecal/EICG4B0ECALSubsystem.h>
15 // Include our Subsystem
16 
17 //Standard RawTowerDefs.h is modified
18 
19 #include <g4eval/CaloEvaluator.h>
20 
21 #include <g4main/PHG4Reco.h>
22 
25 
26 #include <caloreco/RawClusterBuilderFwd.h>
27 #include <caloreco/RawClusterBuilderTemplate.h>
28 #include <caloreco/RawTowerCalibration.h>
29 
30 #include <fun4all/Fun4AllServer.h>
31 
32 R__LOAD_LIBRARY(libcalo_reco.so)
33 R__LOAD_LIBRARY(libg4calo.so)
34 R__LOAD_LIBRARY(libg4eiccalos.so)
35 R__LOAD_LIBRARY(libg4eval.so)
36 
37 namespace Enable
38 {
39  bool B0ECAL = false;
40  bool B0ECAL_ABSORBER = false;
41  bool B0ECAL_CELL = false;
42  bool B0ECAL_TOWER = false;
43  bool B0ECAL_CLUSTER = false;
44  bool B0ECAL_EVAL = false;
45  bool B0ECAL_OVERLAPCHECK = false;
47 } // namespace Enable
48 
49 
50 namespace G4B0ECAL
51 {
52 
53  double minz = 678;
54  double maxz = 698;
55  double radius = 20;
56 
57  // Default set to B0 Ecal position at IP6
58 
59  // Digitization (default photon digi):
61  // directly pass the energy of sim tower to digitized tower
62  // kNo_digitization
63  // simple digitization with photon statistics, single amplitude ADC conversion and pedestal
64  // kSimple_photon_digitization
65  // digitization with photon statistics on SiPM with an effective pixel N, ADC conversion and pedestal
66  // kSiPM_photon_digitization
67 
68 } // namespace G4B0ECAL
69 
70 void B0ECALInit()
71 {
72 }
73 
74 void B0ECALSetup(PHG4Reco *g4Reco)
75 {
76 //Done in G4_hFarFwdBeamLine.C
77 }
78 
79 void B0ECAL_Cells(int verbosity = 0)
80 {
81  return;
82 }
83 
85 {
87 
89 
90  ostringstream mapping_b0ecal;
91  mapping_b0ecal << getenv("CALIBRATIONROOT") << "/B0Ecal/mapping/B0ECAL_mapping_v1.txt";
92  //mapping_b0ecal << "B0ECAL_mapping_v1.txt";
93 
94  B0RawTowerBuilderByHitIndex *tower_B0ECAL = new B0RawTowerBuilderByHitIndex("TowerBuilder_B0ECAL");
95  tower_B0ECAL->Detector("B0ECAL");
96  tower_B0ECAL->set_sim_tower_node_prefix("SIM");
97  tower_B0ECAL->GeometryTableFile(mapping_b0ecal.str());
98 
99  se->registerSubsystem(tower_B0ECAL);
100 
101 
102  RawTowerDigitizer *TowerDigitizer = new RawTowerDigitizer("B0ECALRawTowerDigitizer");
103  TowerDigitizer->Detector("B0ECAL");
104  TowerDigitizer->Verbosity(verbosity);
106  se->registerSubsystem(TowerDigitizer);
107 
108  RawTowerCalibration *TowerCalibration = new RawTowerCalibration("B0ECALRawTowerCalibration");
109  TowerCalibration->Detector("B0ECAL");
110  TowerCalibration->Verbosity(verbosity);
112  TowerCalibration->set_calib_const_GeV_ADC(1. );
113  TowerCalibration->set_pedstal_ADC(0);
114  se->registerSubsystem(TowerCalibration);
115 }
116 
118 {
121 
122  RawClusterBuilderFwd *ClusterBuilder = new RawClusterBuilderFwd("B0ECALRawClusterBuilderFwd");
123  ClusterBuilder->Detector("B0ECAL");
124  ClusterBuilder->Verbosity(verbosity);
125  ClusterBuilder->set_threshold_energy(0.100);
126  se->registerSubsystem(ClusterBuilder);
127 
128  return;
129 }
130 
131 void B0ECAL_Eval(const std::string &outputfile)
132 {
135 
136  CaloEvaluator *eval = new CaloEvaluator("B0ECALEVALUATOR", "B0ECAL", outputfile.c_str());
137  eval->Verbosity(verbosity);
138  se->registerSubsystem(eval);
139 
140  return;
141 }
142 #endif