File indexing completed on 2025-08-05 08:20:35
0001 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
0002 #include <caloreco/RawTowerCalibration.h>
0003
0004 #include <fun4all/SubsysReco.h>
0005 #include <fun4all/Fun4AllDstOutputManager.h>
0006 #include <fun4all/Fun4AllDummyInputManager.h>
0007 #include <fun4all/Fun4AllInputManager.h>
0008 #include <fun4all/Fun4AllOutputManager.h>
0009 #include <fun4all/Fun4AllServer.h>
0010
0011 #include <g4calo/RawTowerBuilder.h>
0012 #include <g4calo/RawTowerDigitizer.h>
0013
0014 #include <g4caloprototype/Prototype2RawTowerBuilder.h>
0015 #include <g4detectors/PHG4BlockSubsystem.h>
0016 #include <g4detectors/PHG4FullProjSpacalCellReco.h>
0017 #include <g4caloprototype/PHG4Prototype2HcalCellReco.h>
0018 #include <g4caloprototype/PHG4Prototype2InnerHcalSubsystem.h>
0019 #include <g4caloprototype/PHG4Prototype2OuterHcalSubsystem.h>
0020 #include <g4caloprototype/PHG4SpacalPrototypeSubsystem.h>
0021
0022 #include <g4eval/PHG4DSTReader.h>
0023
0024 #include <g4histos/G4HitNtuple.h>
0025
0026 #include <g4main/PHG4ParticleGun.h>
0027 #include <g4main/PHG4Reco.h>
0028 #include <g4main/PHG4ParticleGenerator.h>
0029 #include <g4main/PHG4SimpleEventGenerator.h>
0030 #include <g4main/PHG4TruthSubsystem.h>
0031
0032 #include <phool/recoConsts.h>
0033
0034 #include <qa_modules/QAHistManagerDef.h>
0035 #include <qa_modules/QAG4SimulationCalorimeter.h>
0036
0037 R__LOAD_LIBRARY(libcalo_reco.so)
0038 R__LOAD_LIBRARY(libfun4all.so)
0039 R__LOAD_LIBRARY(libg4calo.so)
0040 R__LOAD_LIBRARY(libg4caloprototype.so)
0041 R__LOAD_LIBRARY(libg4eval.so)
0042 R__LOAD_LIBRARY(libg4histos.so)
0043 R__LOAD_LIBRARY(libg4testbench.so)
0044 R__LOAD_LIBRARY(libqa_modules.so)
0045
0046 #endif
0047
0048 void Fun4All_G4_Prototype3(int nEvents = 1)
0049 {
0050
0051 gSystem->Load("libfun4all");
0052 gSystem->Load("libg4caloprototype");
0053 gSystem->Load("libg4testbench");
0054 gSystem->Load("libg4histos");
0055 gSystem->Load("libg4eval.so");
0056 gSystem->Load("libqa_modules");
0057 gSystem->Load("libg4calo");
0058 gSystem->Load("libcalo_reco");
0059
0060 bool cemc_on = true;
0061 bool cemc_cell = cemc_on && true;
0062 bool cemc_twr = cemc_cell && true;
0063 bool cemc_digi = cemc_twr && true;
0064 bool cemc_twrcal = cemc_digi && true;
0065 bool ihcal_on = true;
0066 bool ihcal_cell = ihcal_on && false;
0067 bool ihcal_twr = ihcal_cell && false;
0068 bool ihcal_digi = ihcal_twr && false;
0069 bool ihcal_twrcal = ihcal_digi && false;
0070 bool ohcal_on = true;
0071 bool ohcal_cell = ohcal_on && false;
0072 bool ohcal_twr = ohcal_cell && false;
0073 bool ohcal_digi = ohcal_twr && false;
0074 bool ohcal_twrcal = ohcal_digi && false;
0075 bool cryo_on = true;
0076 bool bh_on = false;
0077 bool dstreader = true;
0078 bool hit_ntuple = false;
0079 bool dstoutput = false;
0080
0081
0082
0083
0084 Fun4AllServer *se = Fun4AllServer::instance();
0085 se->Verbosity(1);
0086 recoConsts *rc = recoConsts::instance();
0087
0088
0089
0090
0091
0092 double theta = 90-46.4;
0093
0094 double add_place_x = 183.-173.93+2.54/2.;
0095
0096 PHG4SimpleEventGenerator *gen = new PHG4SimpleEventGenerator();
0097 gen->add_particles("e-", 1);
0098 gen->set_vertex_distribution_mean(0.0, 0.0, 0);
0099 gen->set_vertex_distribution_width(0.0, .7, .7);
0100 gen->set_vertex_distribution_function(PHG4SimpleEventGenerator::Gaus,
0101 PHG4SimpleEventGenerator::Gaus,
0102 PHG4SimpleEventGenerator::Gaus);
0103 double angle = theta*TMath::Pi()/180.;
0104 double eta = -1.*TMath::Log(TMath::Tan(angle/2.));
0105 gen->set_eta_range(eta-0.001,eta+0.001);
0106 gen->set_phi_range(-0.001, 0.001);
0107 const double momentum = 32;
0108 gen->set_p_range(momentum,momentum, momentum*2e-2);
0109 se->registerSubsystem(gen);
0110
0111 PHG4ParticleGenerator *pgen = new PHG4ParticleGenerator();
0112 pgen->set_name("geantino");
0113
0114 pgen->set_vtx(0, 0, 0);
0115
0116 angle = theta*TMath::Pi()/180.;
0117 eta = -1.*TMath::Log(TMath::Tan(angle/2.));
0118 pgen->set_eta_range(0.2*eta, 1.8*eta);
0119
0120
0121
0122
0123 pgen->set_phi_range(-20/180.*TMath::Pi(), 20/180.*TMath::Pi());
0124 pgen->set_mom_range(1, 1);
0125
0126
0127
0128 PHG4ParticleGun *gun = new PHG4ParticleGun();
0129 gun->set_name("geantino");
0130
0131 gun->set_vtx(0, 0, 0);
0132 angle = theta*TMath::Pi()/180.;
0133 gun->set_mom(sin(angle),0.,cos(angle));
0134
0135
0136
0137 PHG4Reco* g4Reco = new PHG4Reco();
0138 g4Reco->set_field(0);
0139
0140
0141
0142
0143
0144 if (cemc_on)
0145 {
0146 PHG4SpacalPrototypeSubsystem *cemc;
0147 cemc = new PHG4SpacalPrototypeSubsystem("CEMC");
0148 cemc->SetActive();
0149 cemc->SuperDetector("CEMC");
0150 cemc->SetAbsorberActive();
0151 cemc->OverlapCheck(true);
0152
0153
0154 cemc->UseCalibFiles(PHG4DetectorSubsystem::xml);
0155 cemc->SetCalibrationFileDir(string(getenv("CALIBRATIONROOT")) + string("/Prototype3/Geometry/") );
0156
0157
0158
0159
0160
0161 g4Reco->registerSubsystem(cemc);
0162 }
0163
0164
0165
0166 if (ihcal_on)
0167 {
0168 PHG4Prototype2InnerHcalSubsystem *innerhcal = new PHG4Prototype2InnerHcalSubsystem("HCalIn");
0169 innerhcal->set_int_param("hi_eta",1);
0170 innerhcal->set_double_param("place_x",add_place_x);
0171 innerhcal->set_double_param("place_z",144);
0172 innerhcal->SetActive();
0173 innerhcal->SetAbsorberActive();
0174 innerhcal->SetAbsorberTruth(1);
0175 innerhcal->OverlapCheck(true);
0176 innerhcal->SuperDetector("HCALIN");
0177 g4Reco->registerSubsystem(innerhcal);
0178 }
0179 if (ohcal_on)
0180 {
0181 PHG4Prototype2OuterHcalSubsystem *outerhcal = new PHG4Prototype2OuterHcalSubsystem("HCalOut");
0182 outerhcal->set_int_param("hi_eta",1);
0183 outerhcal->set_double_param("place_x",add_place_x);
0184 outerhcal->set_double_param("place_z",229.5);
0185 outerhcal->SetActive();
0186 outerhcal->SetAbsorberActive();
0187 outerhcal->SetAbsorberTruth(1);
0188 outerhcal->OverlapCheck(true);
0189 outerhcal->SuperDetector("HCALOUT");
0190 g4Reco->registerSubsystem(outerhcal);
0191 }
0192 if (cryo_on)
0193 {
0194 double place_z = 175.;
0195
0196 PHG4BlockSubsystem *cryo1 = new PHG4BlockSubsystem("cryo1",1);
0197 cryo1->set_double_param("size_x",0.95);
0198 cryo1->set_double_param("size_y",60.96);
0199 cryo1->set_double_param("size_z",60.96);
0200 cryo1->set_double_param("place_x",141.96+0.95/2.+add_place_x);
0201 cryo1->set_double_param("place_z",place_z);
0202 cryo1->set_string_param("material","G4_Al");
0203 cryo1->SetActive();
0204 cryo1->SuperDetector("CRYO");
0205 g4Reco->registerSubsystem(cryo1);
0206
0207 PHG4BlockSubsystem *cryo2 = new PHG4BlockSubsystem("cryo2",2);
0208 cryo2->set_double_param("size_x",8.89);
0209 cryo2->set_double_param("size_y",60.96);
0210 cryo2->set_double_param("size_z",60.96);
0211 cryo2->set_double_param("place_x",150.72+8.89/2.+add_place_x);
0212 cryo2->set_double_param("place_z",place_z);
0213 cryo2->set_string_param("material","G4_Al");
0214 cryo2->SetActive();
0215 cryo2->SuperDetector("CRYO");
0216 g4Reco->registerSubsystem(cryo2);
0217
0218 PHG4BlockSubsystem *cryo3 = new PHG4BlockSubsystem("cryo3",3);
0219 cryo3->set_double_param("size_x",2.54);
0220 cryo3->set_double_param("size_y",60.96);
0221 cryo3->set_double_param("size_z",60.96);
0222 cryo3->set_double_param("place_x",173.93+2.54/2.+add_place_x);
0223 cryo3->set_double_param("place_z",place_z);
0224 cryo3->set_string_param("material","G4_Al");
0225 cryo3->SetActive();
0226 cryo3->SuperDetector("CRYO");
0227 g4Reco->registerSubsystem(cryo3);
0228 }
0229 if (bh_on)
0230 {
0231
0232 PHG4BlockSubsystem *bh[5];
0233
0234
0235 bh[0] = new PHG4BlockSubsystem("bh1",1);
0236 bh[0]->set_double_param("size_x",270.);
0237 bh[0]->set_double_param("size_y",0.01);
0238 bh[0]->set_double_param("size_z",165.);
0239 bh[0]->set_double_param("place_x",270./2.);
0240 bh[0]->set_double_param("place_y",125./2.);
0241
0242 bh[1] = new PHG4BlockSubsystem("bh2",2);
0243 bh[1]->set_double_param("size_x",270.);
0244 bh[1]->set_double_param("size_y",0.01);
0245 bh[1]->set_double_param("size_z",165.);
0246 bh[1]->set_double_param("place_x",270./2.);
0247 bh[1]->set_double_param("place_y",-125./2.);
0248
0249 bh[2] = new PHG4BlockSubsystem("bh3",3);
0250 bh[2]->set_double_param("size_x",200.);
0251 bh[2]->set_double_param("size_y",125.);
0252 bh[2]->set_double_param("size_z",0.01);
0253 bh[2]->set_double_param("place_x",200./2.);
0254 bh[2]->set_double_param("place_z",165./2.);
0255
0256 bh[3] = new PHG4BlockSubsystem("bh4",4);
0257 bh[3]->set_double_param("size_x",270.);
0258 bh[3]->set_double_param("size_y",125.);
0259 bh[3]->set_double_param("size_z",0.01);
0260 bh[3]->set_double_param("place_x",270./2.);
0261 bh[3]->set_double_param("place_z",-165./2.);
0262
0263 bh[4] = new PHG4BlockSubsystem("bh5",5);
0264 bh[4]->set_double_param("size_x",0.01);
0265 bh[4]->set_double_param("size_y",125.);
0266 bh[4]->set_double_param("size_z",165.);
0267 bh[4]->set_double_param("place_x",270.);
0268 for (int i=0; i<5; i++)
0269 {
0270 bh[i]->BlackHole();
0271 bh[i]->SetActive();
0272 bh[i]->SuperDetector("BlackHole");
0273 bh[i]->OverlapCheck(true);
0274 g4Reco->registerSubsystem(bh[i]);
0275 }
0276 }
0277 PHG4TruthSubsystem *truth = new PHG4TruthSubsystem();
0278 g4Reco->registerSubsystem(truth);
0279
0280 se->registerSubsystem( g4Reco );
0281
0282
0283
0284 if (cemc_cell)
0285 {
0286 PHG4FullProjSpacalCellReco *cemc_cells = new PHG4FullProjSpacalCellReco("CEMCCYLCELLRECO");
0287 cemc_cells->Detector("CEMC");
0288 cemc_cells->set_timing_window(0.,60.);
0289 cemc_cells->get_light_collection_model().load_data_file(string(getenv("CALIBRATIONROOT")) + string("/CEMC/LightCollection/Prototype2Module.xml"),"data_grid_light_guide_efficiency","data_grid_fiber_trans");
0290
0291 se->registerSubsystem(cemc_cells);
0292 }
0293 if (cemc_twr)
0294 {
0295 RawTowerBuilder *TowerBuilder = new RawTowerBuilder("EmcRawTowerBuilder");
0296 TowerBuilder->Detector("CEMC");
0297 TowerBuilder->set_sim_tower_node_prefix("SIM");
0298 se->registerSubsystem(TowerBuilder);
0299 }
0300 const double sampling_fraction = 0.0190134;
0301 const double photoelectron_per_GeV = 500;
0302 const double ADC_per_photoelectron_HG = 3.8;
0303 const double ADC_per_photoelectron_LG = 0.24;
0304
0305
0306 if (cemc_digi)
0307 {
0308 RawTowerDigitizer *TowerDigitizer = new RawTowerDigitizer("EmcRawTowerDigitizerLG");
0309 TowerDigitizer->Detector("CEMC");
0310 TowerDigitizer->set_raw_tower_node_prefix("RAW_LG");
0311 TowerDigitizer->set_digi_algorithm(RawTowerDigitizer::kSimple_photon_digitalization);
0312 TowerDigitizer->set_pedstal_central_ADC(0);
0313 TowerDigitizer->set_pedstal_width_ADC(1);
0314 TowerDigitizer->set_photonelec_ADC(1. / ADC_per_photoelectron_LG);
0315 TowerDigitizer->set_photonelec_yield_visible_GeV(photoelectron_per_GeV / sampling_fraction);
0316 TowerDigitizer->set_zero_suppression_ADC(-1000);
0317 se->registerSubsystem(TowerDigitizer);
0318
0319 TowerDigitizer = new RawTowerDigitizer("EmcRawTowerDigitizerHG");
0320 TowerDigitizer->Detector("CEMC");
0321 TowerDigitizer->set_raw_tower_node_prefix("RAW_HG");
0322 TowerDigitizer->set_digi_algorithm(
0323 RawTowerDigitizer::kSimple_photon_digitalization);
0324 TowerDigitizer->set_pedstal_central_ADC(0);
0325 TowerDigitizer->set_pedstal_width_ADC(15);
0326 TowerDigitizer->set_photonelec_ADC(1. / ADC_per_photoelectron_HG);
0327 TowerDigitizer->set_photonelec_yield_visible_GeV(photoelectron_per_GeV / sampling_fraction);
0328 TowerDigitizer->set_zero_suppression_ADC(-1000);
0329 se->registerSubsystem(TowerDigitizer);
0330 }
0331 if (cemc_twrcal)
0332 {
0333 RawTowerCalibration *TowerCalibration = new RawTowerCalibration("EmcRawTowerCalibrationLG");
0334 TowerCalibration->Detector("CEMC");
0335 TowerCalibration->set_raw_tower_node_prefix("RAW_LG");
0336 TowerCalibration->set_calib_tower_node_prefix("CALIB_LG");
0337 TowerCalibration->set_calib_algorithm(RawTowerCalibration::kSimple_linear_calibration);
0338 TowerCalibration->set_calib_const_GeV_ADC(1. / ADC_per_photoelectron_LG / photoelectron_per_GeV);
0339 TowerCalibration->set_pedstal_ADC(0);
0340 TowerCalibration->set_zero_suppression_GeV(-1);
0341 se->registerSubsystem(TowerCalibration);
0342
0343
0344 TowerCalibration = new RawTowerCalibration("EmcRawTowerCalibrationHG");
0345 TowerCalibration->Detector("CEMC");
0346 TowerCalibration->set_raw_tower_node_prefix("RAW_HG");
0347 TowerCalibration->set_calib_tower_node_prefix("CALIB_HG");
0348 TowerCalibration->set_calib_algorithm(
0349 RawTowerCalibration::kSimple_linear_calibration);
0350 TowerCalibration->set_calib_const_GeV_ADC(1. / ADC_per_photoelectron_HG / photoelectron_per_GeV);
0351 TowerCalibration->set_pedstal_ADC(0);
0352 TowerCalibration->set_zero_suppression_GeV(-1);
0353 se->registerSubsystem(TowerCalibration);
0354 }
0355
0356
0357
0358
0359 if (ihcal_cell)
0360 {
0361 PHG4Prototype2HcalCellReco *hccell = new PHG4Prototype2HcalCellReco("HCALinCellReco");
0362 hccell->Detector("HCALIN");
0363 se->registerSubsystem(hccell);
0364 }
0365 if (ihcal_twr)
0366 {
0367 Prototype2RawTowerBuilder *hcaltwr = new Prototype2RawTowerBuilder("HCALinRawTowerBuilder");
0368 hcaltwr->Detector("HCALIN");
0369 hcaltwr->set_sim_tower_node_prefix("SIM");
0370 se->registerSubsystem(hcaltwr);
0371 }
0372
0373
0374 if (ohcal_cell)
0375 {
0376 PHG4Prototype2HcalCellReco *hccell = new PHG4Prototype2HcalCellReco("HCALoutCellReco");
0377 hccell->Detector("HCALOUT");
0378 se->registerSubsystem(hccell);
0379 }
0380 if (ohcal_twr)
0381 {
0382 Prototype2RawTowerBuilder *hcaltwr = new Prototype2RawTowerBuilder("HCALoutRawTowerBuilder");
0383 hcaltwr->Detector("HCALOUT");
0384 hcaltwr->set_sim_tower_node_prefix("SIM");
0385 se->registerSubsystem(hcaltwr);
0386 }
0387
0388
0389
0390
0391
0392
0393
0394
0395
0396
0397
0398
0399
0400
0401
0402
0403
0404
0405
0406 RawTowerDigitizer *TowerDigitizer = NULL;
0407 if (ihcal_digi)
0408 {
0409 TowerDigitizer = new RawTowerDigitizer("HCALinTowerDigitizerLG");
0410 TowerDigitizer->Detector("HCALIN");
0411 TowerDigitizer->set_raw_tower_node_prefix("RAW_LG");
0412 TowerDigitizer->set_digi_algorithm(RawTowerDigitizer::kSimple_photon_digitalization);
0413 TowerDigitizer->set_pedstal_central_ADC(0);
0414 TowerDigitizer->set_pedstal_width_ADC(1);
0415 TowerDigitizer->set_photonelec_ADC(32. / 5.);
0416 TowerDigitizer->set_photonelec_yield_visible_GeV(32. / 5 / (0.4e-3));
0417 TowerDigitizer->set_zero_suppression_ADC(-1000);
0418 se->registerSubsystem(TowerDigitizer);
0419
0420 TowerDigitizer = new RawTowerDigitizer("HCALinTowerDigitizerHG");
0421 TowerDigitizer->Detector("HCALIN");
0422 TowerDigitizer->set_raw_tower_node_prefix("RAW_HG");
0423 TowerDigitizer->set_digi_algorithm(RawTowerDigitizer::kSimple_photon_digitalization);
0424 TowerDigitizer->set_pedstal_central_ADC(0);
0425 TowerDigitizer->set_pedstal_width_ADC(1);
0426 TowerDigitizer->set_photonelec_ADC(1. / 5.);
0427 TowerDigitizer->set_photonelec_yield_visible_GeV(1. / 5 / (0.4e-3 / 32));
0428 TowerDigitizer->set_zero_suppression_ADC(-1000);
0429 se->registerSubsystem(TowerDigitizer);
0430 }
0431 if (ohcal_digi)
0432 {
0433 TowerDigitizer = new RawTowerDigitizer("HCALoutTowerDigitizerLG");
0434 TowerDigitizer->Detector("HCALOUT");
0435 TowerDigitizer->set_raw_tower_node_prefix("RAW_LG");
0436 TowerDigitizer->set_digi_algorithm(RawTowerDigitizer::kSimple_photon_digitalization);
0437 TowerDigitizer->set_pedstal_central_ADC(0);
0438 TowerDigitizer->set_pedstal_width_ADC(1);
0439 TowerDigitizer->set_photonelec_ADC(16. / 5.);
0440 TowerDigitizer->set_photonelec_yield_visible_GeV(16. / 5 / (0.2e-3));
0441 TowerDigitizer->set_zero_suppression_ADC(-1000);
0442 se->registerSubsystem(TowerDigitizer);
0443
0444 TowerDigitizer = new RawTowerDigitizer("HCALoutTowerDigitizerHG");
0445 TowerDigitizer->Detector("HCALOUT");
0446 TowerDigitizer->set_raw_tower_node_prefix("RAW_HG");
0447 TowerDigitizer->set_digi_algorithm(RawTowerDigitizer::kSimple_photon_digitalization);
0448 TowerDigitizer->set_pedstal_central_ADC(0);
0449 TowerDigitizer->set_pedstal_width_ADC(1);
0450 TowerDigitizer->set_photonelec_ADC(1. / 5.);
0451 TowerDigitizer->set_photonelec_yield_visible_GeV(1. / 5 / (0.2e-3 / 16));
0452 TowerDigitizer->set_zero_suppression_ADC(-1000);
0453 se->registerSubsystem(TowerDigitizer);
0454 }
0455
0456
0457
0458
0459 const double visible_sample_fraction_HCALIN = 7.19505e-02 ;
0460 const double visible_sample_fraction_HCALOUT = 0.0313466 ;
0461 RawTowerCalibration *TowerCalibration = NULL;
0462 if (ihcal_twrcal)
0463 {
0464 TowerCalibration = new RawTowerCalibration("HCALinRawTowerCalibrationLG");
0465 TowerCalibration->Detector("HCALIN");
0466 TowerCalibration->set_raw_tower_node_prefix("RAW_LG");
0467 TowerCalibration->set_calib_tower_node_prefix("CALIB_LG");
0468 TowerCalibration->set_calib_algorithm(RawTowerCalibration::kSimple_linear_calibration);
0469 TowerCalibration->set_calib_const_GeV_ADC(0.4e-3 / visible_sample_fraction_HCALIN);
0470 TowerCalibration->set_pedstal_ADC(0);
0471 TowerCalibration->set_zero_suppression_GeV(-1);
0472 se->registerSubsystem(TowerCalibration);
0473
0474 TowerCalibration = new RawTowerCalibration("HCALinRawTowerCalibrationHG");
0475 TowerCalibration->Detector("HCALIN");
0476 TowerCalibration->set_raw_tower_node_prefix("RAW_HG");
0477 TowerCalibration->set_calib_tower_node_prefix("CALIB_HG");
0478 TowerCalibration->set_calib_algorithm(RawTowerCalibration::kSimple_linear_calibration);
0479 TowerCalibration->set_calib_const_GeV_ADC(0.4e-3 / 32 / visible_sample_fraction_HCALIN);
0480 TowerCalibration->set_pedstal_ADC(0);
0481 TowerCalibration->set_zero_suppression_GeV(-1);
0482 se->registerSubsystem(TowerCalibration);
0483 }
0484 if (ohcal_twrcal)
0485 {
0486 TowerCalibration = new RawTowerCalibration("HCALoutRawTowerCalibrationLG");
0487 TowerCalibration->Detector("HCALOUT");
0488 TowerCalibration->set_raw_tower_node_prefix("RAW_LG");
0489 TowerCalibration->set_calib_tower_node_prefix("CALIB_LG");
0490 TowerCalibration->set_calib_algorithm(RawTowerCalibration::kSimple_linear_calibration);
0491 TowerCalibration->set_calib_const_GeV_ADC(0.2e-3 / visible_sample_fraction_HCALOUT);
0492 TowerCalibration->set_pedstal_ADC(0);
0493 TowerCalibration->set_zero_suppression_GeV(-1);
0494 se->registerSubsystem(TowerCalibration);
0495
0496 TowerCalibration = new RawTowerCalibration("HCALoutRawTowerCalibrationHG");
0497 TowerCalibration->Detector("HCALOUT");
0498 TowerCalibration->set_raw_tower_node_prefix("RAW_HG");
0499 TowerCalibration->set_calib_tower_node_prefix("CALIB_HG");
0500 TowerCalibration->set_calib_algorithm(RawTowerCalibration::kSimple_linear_calibration);
0501 TowerCalibration->set_calib_const_GeV_ADC(0.2e-3 / 16 / visible_sample_fraction_HCALOUT);
0502 TowerCalibration->set_pedstal_ADC(0);
0503 TowerCalibration->set_zero_suppression_GeV(-1);
0504 se->registerSubsystem(TowerCalibration);
0505 }
0506
0507
0508
0509 if (cemc_on)
0510 {
0511 se->registerSubsystem(new QAG4SimulationCalorimeter("CEMC",QAG4SimulationCalorimeter::kProcessG4Hit));
0512 }
0513 if (ihcal_on)
0514 {
0515
0516
0517 }
0518 if (ohcal_on)
0519 {
0520
0521 }
0522
0523
0524
0525 if (hit_ntuple)
0526 {
0527 G4HitNtuple *hit = new G4HitNtuple("G4HitNtuple","g4hitntuple.root");
0528 hit->AddNode("HCALIN", 0);
0529 hit->AddNode("HCALOUT", 1);
0530 hit->AddNode("CRYO", 2);
0531 hit->AddNode("BlackHole", 3);
0532 hit->AddNode("ABSORBER_HCALIN", 10);
0533 hit->AddNode("ABSORBER_HCALOUT", 11);
0534 se->registerSubsystem(hit);
0535 }
0536
0537
0538
0539
0540
0541
0542
0543
0544
0545
0546
0547
0548 if (dstreader)
0549 {
0550 PHG4DSTReader* ana = new PHG4DSTReader(string("DSTReader.root"));
0551 ana->set_save_particle(true);
0552 ana->set_load_all_particle(false);
0553 ana->set_load_active_particle(false);
0554 ana->set_save_vertex(true);
0555 ana->set_tower_zero_sup(-1000);
0556
0557
0558
0559
0560
0561
0562
0563 if (cemc_twr)
0564 ana->AddTower("SIM_CEMC");
0565 if (cemc_digi)
0566 ana->AddTower("RAW_LG_CEMC");
0567 if (cemc_twrcal)
0568 ana->AddTower("CALIB_LG_CEMC");
0569 if (cemc_digi)
0570 ana->AddTower("RAW_HG_CEMC");
0571 if (cemc_twrcal)
0572 ana->AddTower("CALIB_HG_CEMC");
0573
0574 if (ohcal_twr)
0575 ana->AddTower("SIM_HCALOUT");
0576 if (ihcal_twr)
0577 ana->AddTower("SIM_HCALIN");
0578
0579 if (ihcal_digi)
0580 ana->AddTower("RAW_LG_HCALIN");
0581 if (ihcal_digi)
0582 ana->AddTower("RAW_HG_HCALIN");
0583 if (ohcal_digi)
0584 ana->AddTower("RAW_LG_HCALOUT");
0585 if (ohcal_digi)
0586 ana->AddTower("RAW_HG_HCALOUT");
0587
0588 if (ihcal_twrcal)
0589 ana->AddTower("CALIB_LG_HCALIN");
0590 if (ihcal_twrcal)
0591 ana->AddTower("CALIB_HG_HCALIN");
0592 if (ohcal_twrcal)
0593 ana->AddTower("CALIB_LG_HCALOUT");
0594 if (ohcal_twrcal)
0595 ana->AddTower("CALIB_HG_HCALOUT");
0596
0597 if (bh_on)
0598 ana->AddNode("BlackHole");
0599
0600 se->registerSubsystem(ana);
0601 }
0602
0603
0604
0605
0606
0607
0608
0609
0610
0611 if (dstoutput)
0612 {
0613 Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT","G4Prototype3New.root");
0614 se->registerOutputManager(out);
0615 }
0616
0617 Fun4AllInputManager *in = new Fun4AllDummyInputManager( "JADE");
0618 se->registerInputManager( in );
0619 if (nEvents <= 0)
0620 {
0621 return;
0622 }
0623 se->run(nEvents);
0624
0625 se->End();
0626
0627 QAHistManagerDef::saveQARootFile("G4Prototype2_qa.root");
0628
0629
0630
0631 delete se;
0632 gSystem->Exit(0);
0633 }