1 #ifndef MACRO_G4EEMCHYBRID_C
2 #define MACRO_G4EEMCHYBRID_C
18 #include <caloreco/RawClusterBuilderFwd.h>
19 #include <caloreco/RawClusterBuilderTemplate.h>
20 #include <caloreco/RawTowerCalibration.h>
48 double Gdz = 20. + 0.1;
100 ostringstream mapping_eemc_1, mapping_eemc_2;
111 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_185_noCarbon.txt";
113 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_185_30cm.txt";
115 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_185cm_EEEMCcarbon.txt";
117 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_185cm_updatedGeo.txt";
119 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_crystal_200cm_SciGlassBarrel.txt";
121 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_crystal_200cm_CEMCBarrel.txt";
124 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_185cm.txt";
126 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_200cm_CEMCBarrel.txt";
128 cout <<
"*******************************************************************************" << endl;
129 cout <<
"****** ATTENTION no EEMC set as your settings aren't correct ******" << endl;
130 cout <<
"*******************************************************************************" << endl;
133 cout <<
"setting EEMC crystal mapping: " << mapping_eemc_1.str() << endl;
141 mapping_eemc_2 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_glass_200cm_SciGlassBarrel.txt";
143 mapping_eemc_2 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_glass_200cm_CEMCBarrel.txt";
145 cout <<
"*******************************************************************************" << endl;
146 cout <<
"****** requested hybrid option but no glass mapping set ******" << endl;
147 cout <<
"*******************************************************************************" << endl;
151 cout <<
"setting EEMC glass mapping: " << mapping_eemc_2.str() << endl;
175 ostringstream mapping_eemc_1, mapping_eemc_2;
178 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_185_noCarbon.txt";
180 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_185_30cm.txt";
182 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_185cm_EEEMCcarbon.txt";
184 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_185cm_updatedGeo_TemporaryTowerFix.txt";
186 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_crystal_200cm_SciGlassBarrel.txt";
188 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_crystal_200cm_CEMCBarrel.txt";
191 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_185cm.txt";
193 mapping_eemc_1 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_purecrystal_200cm_CEMCBarrel.txt";
197 const double EEMC_photoelectron_per_GeV_crystal = 15000;
198 const double EEMC_photoelectron_per_GeV_glass = 5000;
201 const double crystal_pedestal_ADC = 0, crystal_zero_suppression_ADC = 0;
202 const double glass_pedestal_ADC = 0, glass_zero_suppression_ADC = 0;
205 tower_EEMC_crystal->
Detector(
"EEMC");
212 TowerDigitizer_EEMC_crystal->
Detector(
"EEMC");
213 TowerDigitizer_EEMC_crystal->
Verbosity(verbosity);
225 TowerCalibration_EEMC_crystal->
Detector(
"EEMC");
226 TowerCalibration_EEMC_crystal->
Verbosity(verbosity);
237 mapping_eemc_2 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_glass_200cm_SciGlassBarrel.txt";
239 mapping_eemc_2 << getenv(
"CALIBRATIONROOT") <<
"/CrystalCalorimeter/mapping/crystal_mapping/tower_map_glass_200cm_CEMCBarrel.txt";
242 tower_EEMC_glass->
Detector(
"EEMC_glass");
248 TowerDigitizer_EEMC_glass->
Detector(
"EEMC_glass");
249 TowerDigitizer_EEMC_glass->
Verbosity(verbosity);
260 TowerCalibration_EEMC_glass->
Detector(
"EEMC_glass");
261 TowerCalibration_EEMC_glass->
Verbosity(verbosity);
303 ClusterBuilder_crystal->
Detector(
"EEMC");
304 ClusterBuilder_crystal->
Verbosity(verbosity);
310 ClusterBuilder_glass->
Detector(
"EEMC_glass");
311 ClusterBuilder_glass->
Verbosity(verbosity);
330 string outputroot = outputfile;
331 string remove_this =
".root";
332 size_t pos = outputroot.find(remove_this);
333 if (pos != string::npos){
334 outputroot.erase(pos, remove_this.length());
336 string outputrootc = outputroot+
"_crystal.root";
337 string outputrootg = outputroot+
"_glass.root";