1 #ifndef MACRO_G4EEMCHYBRID_C
2 #define MACRO_G4EEMCHYBRID_C
4 #include <GlobalVariables.C>
15 #include <caloreco/RawClusterBuilderFwd.h>
16 #include <caloreco/RawClusterBuilderTemplate.h>
17 #include <caloreco/RawTowerCalibration.h>
45 double Gdz = 20. + 0.1;
91 ostringstream mapping_eemc_1, mapping_eemc_2;
102 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_crystal_200cm_SciGlassBarrel.txt";
104 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_crystal_200cm_CEMCBarrel.txt";
107 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_185cm.txt";
109 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_200cm_CEMCBarrel.txt";
111 cout <<
"*******************************************************************************" << endl;
112 cout <<
"****** ATTENTION no EEMC set as your settings aren't correct ******" << endl;
113 cout <<
"*******************************************************************************" << endl;
116 cout <<
"setting EEMC crystal mapping: " << mapping_eemc_1.str() << endl;
125 mapping_eemc_2 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_glass_200cm_SciGlassBarrel.txt";
127 mapping_eemc_2 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_glass_200cm_CEMCBarrel.txt";
129 cout <<
"*******************************************************************************" << endl;
130 cout <<
"****** requested hybrid option but no glass mapping set ******" << endl;
131 cout <<
"*******************************************************************************" << endl;
135 cout <<
"setting EEMC glass mapping: " << mapping_eemc_2.str() << endl;
160 ostringstream mapping_eemc_1, mapping_eemc_2;
162 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_crystal_200cm_SciGlassBarrel.txt";
164 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_crystal_200cm_CEMCBarrel.txt";
167 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_185cm.txt";
169 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_200cm_CEMCBarrel.txt";
173 const double EEMC_photoelectron_per_GeV_crystal = 15000;
174 const double EEMC_photoelectron_per_GeV_glass = 5000;
177 const double crystal_pedestal_ADC = 0, crystal_zero_suppression_ADC = 0;
178 const double glass_pedestal_ADC = 0, glass_zero_suppression_ADC = 0;
181 tower_EEMC_crystal->
Detector(
"EEMC");
188 TowerDigitizer_EEMC_crystal->
Detector(
"EEMC");
189 TowerDigitizer_EEMC_crystal->
Verbosity(verbosity);
201 TowerCalibration_EEMC_crystal->
Detector(
"EEMC");
202 TowerCalibration_EEMC_crystal->
Verbosity(verbosity);
213 mapping_eemc_2 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_glass_200cm_SciGlassBarrel.txt";
215 mapping_eemc_2 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_glass_200cm_CEMCBarrel.txt";
218 tower_EEMC_glass->
Detector(
"EEMC_glass");
224 TowerDigitizer_EEMC_glass->
Detector(
"EEMC_glass");
225 TowerDigitizer_EEMC_glass->
Verbosity(verbosity);
236 TowerCalibration_EEMC_glass->
Detector(
"EEMC_glass");
237 TowerCalibration_EEMC_glass->
Verbosity(verbosity);
258 ClusterBuilder_crystal->
Detector(
"EEMC");
264 ClusterBuilder_glass->
Detector(
"EEMC_glass");
265 ClusterBuilder_glass->
Verbosity(verbosity);
273 ClusterBuilder_crystal->
Detector(
"EEMC");
274 ClusterBuilder_crystal->
Verbosity(verbosity);
280 ClusterBuilder_glass->
Detector(
"EEMC_glass");
281 ClusterBuilder_glass->
Verbosity(verbosity);
301 string remove_this =
".root";
302 size_t pos = outputroot.find(remove_this);
303 if (pos != string::npos){
304 outputroot.erase(pos, remove_this.length());
306 string outputrootc = outputroot+
"_crystal.root";
307 string outputrootg = outputroot+
"_glass.root";