20 #include <g4hough/SvtxCluster.h>
21 #include <g4hough/SvtxClusterMap.h>
22 #include <g4hough/SvtxTrack.h>
23 #include <g4hough/SvtxVertexMap.h>
30 #include <calobase/RawCluster.h>
31 #include <calobase/RawClusterContainer.h>
32 #include <calobase/RawTower.h>
33 #include <calobase/RawTowerContainer.h>
34 #include <calobase/RawTowerGeomContainer.h>
45 #include <TLorentzVector.h>
104 "PHCompositeNode",
"DST"));
107 std::cerr <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
109 "Failed to find DST node in EmcRawTowerBuilder::CreateNodes");
122 "G4HIT_ABSORBER_HCALOUT");
125 "G4HIT_ABSORBER_HCALIN");
128 "G4HIT_ABSORBER_CEMC");
132 UpsilonPair *upsilon_pair = findNode::getClass<UpsilonPair>(dstNode,
135 if (not upsilon_pair)
140 upsilon_pair,
"UpsilonPair",
"PHObject");
141 dstNode->addNode(node);
148 _trk = findNode::getClass<EMCalTrk>(dstNode,
"EMCalTrk");
155 "EMCalTrk",
"PHObject");
156 dstNode->addNode(node);
167 cout <<
"EMCalAna::End - write to " <<
_filename << endl;
172 for (
unsigned int i = 0;
i < hm->
nHistos();
i++)
179 TTree *T_Index =
new TTree(
"T_Index",
"T_Index");
190 cout <<
"EMCalAna::get_HistoManager - Making PHTFileServer " <<
_filename
196 cout <<
"EMCalAna::Init - Process sampling fraction" << endl;
201 cout <<
"EMCalAna::Init - Process tower occupancies" << endl;
206 cout <<
"EMCalAna::Init - Process trakcs" << endl;
211 cout <<
"EMCalAna::Init - Process kProcessUpslisonTrig" << endl;
221 cout <<
"EMCalAna::process_event() entered" << endl;
250 cout <<
"EMCalAna::process_event_UpslisonTrig() entered" << endl;
252 UpsilonPair *upsilon_pair = findNode::getClass<UpsilonPair>(topNode,
255 static const double upsilon_mass = 9460.30e-3;
273 findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
279 set<int> e_pos_candidate;
280 set<int> e_neg_candidate;
283 iter != primary_range.second; ++iter)
290 if (particle->
get_pid() == -11)
294 map<double, pair<int, int> > mass_diff_id_map;
295 for (set<int>::const_iterator i_e_pos = e_pos_candidate.begin();
296 i_e_pos != e_pos_candidate.end(); ++i_e_pos)
297 for (set<int>::const_iterator i_e_neg = e_neg_candidate.begin();
298 i_e_neg != e_neg_candidate.end(); ++i_e_neg)
300 TLorentzVector vpos(particle_map[*i_e_pos]->get_px(),
301 particle_map[*i_e_pos]->get_py(), particle_map[*i_e_pos]->get_pz(),
302 particle_map[*i_e_pos]->get_e());
303 TLorentzVector vneg(particle_map[*i_e_neg]->get_px(),
304 particle_map[*i_e_neg]->get_py(), particle_map[*i_e_neg]->get_pz(),
305 particle_map[*i_e_neg]->get_e());
307 TLorentzVector invar = vpos + vneg;
309 const double mass = invar.M();
311 const double mass_diff = fabs(mass - upsilon_mass);
313 mass_diff_id_map[mass_diff] = make_pair(*i_e_pos, *i_e_neg);
316 if (mass_diff_id_map.size() <= 0)
320 const pair<int, int> best_upsilon_pair = mass_diff_id_map.begin()->second;
323 TLorentzVector gvpos(particle_map[best_upsilon_pair.first]->get_px(),
324 particle_map[best_upsilon_pair.first]->get_py(),
325 particle_map[best_upsilon_pair.first]->get_pz(),
326 particle_map[best_upsilon_pair.first]->get_e());
327 TLorentzVector gvneg(particle_map[best_upsilon_pair.second]->get_px(),
328 particle_map[best_upsilon_pair.second]->get_py(),
329 particle_map[best_upsilon_pair.second]->get_pz(),
330 particle_map[best_upsilon_pair.second]->get_e());
331 TLorentzVector ginvar = gvpos + gvneg;
332 upsilon_pair->
gmass = ginvar.M();
334 eval_trk(particle_map[best_upsilon_pair.first], *upsilon_pair->
get_trk(0),
336 eval_trk(particle_map[best_upsilon_pair.second],
337 *upsilon_pair->
get_trk(1), topNode);
340 TLorentzVector vpos(upsilon_pair->
get_trk(0)->
px,
342 TLorentzVector vneg(upsilon_pair->
get_trk(1)->
px,
346 TLorentzVector invar = vpos + vneg;
347 upsilon_pair->
mass = invar.M();
350 const bool eta_pos_cut = fabs(gvpos.Eta()) < 1.0;
351 const bool eta_neg_cut = fabs(gvneg.Eta()) < 1.0;
352 const bool reco_upsilon_mass = fabs(upsilon_pair->
mass - upsilon_mass) < 0.2;
353 upsilon_pair->
good_upsilon = eta_pos_cut and eta_neg_cut and reco_upsilon_mass;
381 findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
384 SvtxClusterMap *clustermap = findNode::getClass<SvtxClusterMap>(topNode,
391 std::set<PHG4Hit *> g4hits = trutheval->
all_truth_hits(g4particle);
398 float gvx = vtx->
get_x();
399 float gvy = vtx->
get_y();
400 float gvz = vtx->
get_z();
412 gfpx = outerhit->
get_px(1);
413 gfpy = outerhit->
get_py(1);
414 gfpz = outerhit->
get_pz(1);
415 gfx = outerhit->
get_x(1);
416 gfy = outerhit->
get_y(1);
417 gfz = outerhit->
get_z(1);
420 int gembed = trutheval->
get_embed(g4particle);
430 unsigned int layers = 0x0;
433 float dca2dsigma = NAN;
445 trackID = track->
get_id();
455 unsigned int cluster_id = *iter;
456 SvtxCluster *cluster = clustermap->get(cluster_id);
457 unsigned int layer = cluster->get_layer();
459 layers |= (0x1 <<
layer);
468 pcax = track->
get_x();
469 pcay = track->
get_y();
470 pcaz = track->
get_z();
554 string detector =
"InvalidDetector";
556 if (calo_id ==
kCEMC)
574 string towergeonodename =
"TOWERGEOM_" +
detector;
584 string towernodename =
"TOWER_CALIB_" +
detector;
586 topNode, towernodename.c_str());
591 cout << __PRETTY_FUNCTION__ <<
" - info - handling track track p = ("
593 << track->
get_pz() <<
"), v = (" << track->
get_x() <<
", "
594 << track->
get_z() <<
", " << track->
get_z() <<
")"
611 std::vector<double>
point;
612 point.assign(3, -9999.);
618 double phi = atan2(y, x);
619 double eta = asinh(z / sqrt(x * x + y * y));
620 cout << __PRETTY_FUNCTION__ <<
" - info - handling track proj. (" << x
621 <<
", " << y <<
", " << z <<
")"
622 <<
", eta " << eta <<
", phi"
626 std::vector<double>
point;
627 point.assign(3, -9999.);
632 double phi = atan2(y, x);
633 double eta = asinh(z / sqrt(x * x + y * y));
634 cout << __PRETTY_FUNCTION__ <<
" - info - handling track proj. (" << x
635 <<
", " << y <<
", " << z <<
")"
636 <<
", eta " << eta <<
", phi"
640 std::vector<double>
point;
641 point.assign(3, -9999.);
646 double phi = atan2(y, x);
647 double eta = asinh(z / sqrt(x * x + y * y));
648 cout << __PRETTY_FUNCTION__ <<
" - info - handling track proj. (" << x
649 <<
", " << y <<
", " << z <<
")"
650 <<
", eta " << eta <<
", phi"
654 std::vector<double>
point;
655 point.assign(3, -9999.);
660 double phi = atan2(y, x);
661 double eta = asinh(z / sqrt(x * x + y * y));
662 cout << __PRETTY_FUNCTION__ <<
" - info - handling track proj. (" << x
663 <<
", " << y <<
", " << z <<
")"
664 <<
", eta " << eta <<
", phi"
668 std::vector<double>
point;
669 point.assign(3, -9999.);
674 double phi = atan2(y, x);
675 double eta = asinh(z / sqrt(x * x + y * y));
676 cout << __PRETTY_FUNCTION__ <<
" - info - handling track proj. (" << x
677 <<
", " << y <<
", " << z <<
")"
678 <<
", eta " << eta <<
", phi"
682 std::vector<double>
point;
683 point.assign(3, -9999.);
688 double phi = atan2(y, x);
689 double eta = asinh(z / sqrt(x * x + y * y));
690 cout << __PRETTY_FUNCTION__ <<
" - info - handling track proj. (" << x
691 <<
", " << y <<
", " << z <<
")"
692 <<
", eta " << eta <<
", phi"
696 std::vector<double>
point;
697 point.assign(3, -9999.);
702 double phi = atan2(y, x);
703 double eta = asinh(z / sqrt(x * x + y * y));
704 cout << __PRETTY_FUNCTION__ <<
" - info - handling track proj. (" << x
705 <<
", " << y <<
", " << z <<
")"
706 <<
", eta " << eta <<
", phi"
710 std::vector<double>
point;
711 point.assign(3, -9999.);
716 double phi = atan2(y, x);
717 double eta = asinh(z / sqrt(x * x + y * y));
718 cout << __PRETTY_FUNCTION__ <<
" - info - handling track proj. (" << x
719 <<
", " << y <<
", " << z <<
")"
720 <<
", eta " << eta <<
", phi"
724 std::vector<double>
point;
725 point.assign(3, -9999.);
730 double phi = atan2(y, x);
731 double eta = asinh(z / sqrt(x * x + y * y));
732 cout << __PRETTY_FUNCTION__ <<
" - info - handling track proj. (" << x
733 <<
", " << y <<
", " << z <<
")"
734 <<
", eta " << eta <<
", phi"
738 std::vector<double>
point;
739 point.assign(3, -9999.);
744 double phi = atan2(y, x);
745 double eta = asinh(z / sqrt(x * x + y * y));
746 cout << __PRETTY_FUNCTION__ <<
" - info - handling track proj. (" << x
747 <<
", " << y <<
", " << z <<
")"
748 <<
", eta " << eta <<
", phi"
755 std::vector<double>
point;
756 point.assign(3, -9999.);
759 if (std::isnan(point[0]) or std::isnan(point[1]) or std::isnan(point[2]))
761 cout << __PRETTY_FUNCTION__ <<
"::" <<
Name()
762 <<
" - Error - track extrapolation failure:";
767 assert(not std::isnan(point[0]));
768 assert(not std::isnan(point[1]));
769 assert(not std::isnan(point[2]));
776 double phi = atan2(y, x);
777 double eta = asinh(z / sqrt(x * x + y * y));
784 if (bineta > 1 and bineta < cemc_towergeo->get_etabins() - 1)
792 const double etabin_shift = (cemc_towergeo->
get_etacenter(bineta) -
eta) / etabin_width;
793 const double phibin_shift = (fmod(
794 cemc_towergeo->
get_phicenter(binphi) - phi + 5 * M_PI, 2 * M_PI) -
799 cout << __PRETTY_FUNCTION__ <<
" - info - handling track proj. (" << x
800 <<
", " << y <<
", " << z <<
")"
801 <<
", eta " << eta <<
", phi" << phi
802 <<
", bineta " << bineta <<
" - ["
804 << cemc_towergeo->
get_etabounds(bineta).second <<
"], etabin_shift = "
805 << etabin_shift <<
", binphi " << binphi <<
" - ["
807 << cemc_towergeo->
get_phibounds(binphi).second <<
"], phibin_shift = "
808 << phibin_shift << endl;
810 const int bin_search_range = (trk.
Max_N_Tower - 1) / 2;
811 for (
int iphi = binphi - bin_search_range; iphi <= binphi + bin_search_range;
814 for (
int ieta = bineta - bin_search_range;
815 ieta <= bineta + bin_search_range; ++ieta)
835 cout << __PRETTY_FUNCTION__ <<
" - info - processing tower"
836 <<
", bineta " << ieta <<
" - ["
842 << cemc_towergeo->
get_phibounds(wrapphi).second <<
"]" << endl;
849 cout << __PRETTY_FUNCTION__ <<
" - info - tower " << ieta <<
" "
850 << wrapphi <<
" energy = " << tower->
get_energy() << endl;
855 if (calo_id ==
kCEMC)
858 [ieta - (bineta - bin_search_range)]
859 [iphi - (binphi - bin_search_range)]
860 = ieta - bineta + etabin_shift;
862 [ieta - (bineta - bin_search_range)]
863 [iphi - (binphi - bin_search_range)]
864 = iphi - binphi + phibin_shift;
866 [ieta - (bineta - bin_search_range)]
867 [iphi - (binphi - bin_search_range)]
873 [ieta - (bineta - bin_search_range)]
874 [iphi - (binphi - bin_search_range)]
875 = ieta - bineta + etabin_shift;
877 [ieta - (bineta - bin_search_range)]
878 [iphi - (binphi - bin_search_range)]
879 = iphi - binphi + phibin_shift;
881 [ieta - (bineta - bin_search_range)]
882 [iphi - (binphi - bin_search_range)]
904 cout <<
"EMCalAna::process_event_Trk() entered" << endl;
912 _trk = findNode::getClass<EMCalTrk>(topNode,
"EMCalTrk");
916 findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
921 assert(range.first != range.second);
938 <<
"EMCalAna::get_HistoManager - Making Fun4AllHistoManager EMCalAna_HISTOS"
955 "_h_CEMC_SF", 1000, 0, .2));
957 "_h_HCALIN_SF", 1000, 0, .2));
959 "_h_HCALOUT_SF", 1000, 0, .2));
961 "_h_CEMC_VSF", 1000, 0, .2));
963 "_h_HCALIN_VSF", 1000, 0, .2));
965 "_h_HCALOUT_VSF", 1000, 0, .2));
968 "EMCalAna_h_CEMC_RZ;Z (cm);R (cm)", 1200, -300, 300, 600, -000, 300));
970 "EMCalAna_h_HCALIN_RZ;Z (cm);R (cm)", 1200, -300, 300, 600, -000, 300));
972 "EMCalAna_h_HCALOUT_RZ;Z (cm);R (cm)", 1200, -300, 300, 600, -000, 300));
975 "EMCalAna_h_CEMC_XY;X (cm);Y (cm)", 1200, -300, 300, 1200, -300, 300));
977 "EMCalAna_h_HCALIN_XY;X (cm);Y (cm)", 1200, -300, 300, 1200, -300, 300));
979 "EMCalAna_h_HCALOUT_XY;X (cm);Y (cm)", 1200, -300, 300, 1200, -300, 300));
983 "EMCalAna_h_CEMC_TOWER_EVis", 100, 0 - .5, 100 - .5));
985 "EMCalAna_h_CEMC_BLOCK_ETotal", 100, 0 - .5, 100 - .5));
993 cout <<
"EMCalAna::process_event_SF() entered" << endl;
1000 double e_hcin = 0.0, e_hcout = 0.0, e_cemc = 0.0;
1001 double ev_hcin = 0.0, ev_hcout = 0.0, ev_cemc = 0.0;
1002 double ea_hcin = 0.0, ea_hcout = 0.0, ea_cemc = 0.0;
1006 TH2F *hrz = (TH2F *) hm->
getHisto(
"EMCalAna_h_HCALOUT_RZ");
1008 TH2F *hxy = (TH2F *) hm->
getHisto(
"EMCalAna_h_HCALOUT_XY");
1014 hit_iter != hcalout_hit_range.second; hit_iter++)
1016 PHG4Hit *this_hit = hit_iter->second;
1031 TH2F *hrz = (TH2F *) hm->
getHisto(
"EMCalAna_h_HCALIN_RZ");
1033 TH2F *hxy = (TH2F *) hm->
getHisto(
"EMCalAna_h_HCALIN_XY");
1039 hit_iter != hcalin_hit_range.second; hit_iter++)
1041 PHG4Hit *this_hit = hit_iter->second;
1056 TH2F *hrz = (TH2F *) hm->
getHisto(
"EMCalAna_h_CEMC_RZ");
1058 TH2F *hxy = (TH2F *) hm->
getHisto(
"EMCalAna_h_CEMC_XY");
1064 hit_iter != cemc_hit_range.second; hit_iter++)
1066 PHG4Hit *this_hit = hit_iter->second;
1084 hcalout_abs_hit_range.first;
1085 hit_iter != hcalout_abs_hit_range.second;
1088 PHG4Hit *this_hit = hit_iter->second;
1100 hit_iter != hcalin_abs_hit_range.second; hit_iter++)
1102 PHG4Hit *this_hit = hit_iter->second;
1114 hit_iter != cemc_abs_hit_range.second; hit_iter++)
1116 PHG4Hit *this_hit = hit_iter->second;
1123 h = (TH1F *) hm->
getHisto(
"EMCalAna_h_CEMC_SF");
1125 h->Fill(e_cemc / (e_cemc + ea_cemc) + 1
e-9);
1126 h = (TH1F *) hm->
getHisto(
"EMCalAna_h_CEMC_VSF");
1128 h->Fill(ev_cemc / (e_cemc + ea_cemc) + 1
e-9);
1130 h = (TH1F *) hm->
getHisto(
"EMCalAna_h_HCALOUT_SF");
1132 h->Fill(e_hcout / (e_hcout + ea_hcout) + 1
e-9);
1133 h = (TH1F *) hm->
getHisto(
"EMCalAna_h_HCALOUT_VSF");
1135 h->Fill(ev_hcout / (e_hcout + ea_hcout) + 1
e-9);
1137 h = (TH1F *) hm->
getHisto(
"EMCalAna_h_HCALIN_SF");
1139 h->Fill(e_hcin / (e_hcin + ea_hcin) + 1
e-9);
1140 h = (TH1F *) hm->
getHisto(
"EMCalAna_h_HCALIN_VSF");
1142 h->Fill(ev_hcin / (e_hcin + ea_hcin) + 1
e-9);
1147 TH1 *EMCalAna_h_CEMC_BLOCK_EVis = (TH1 *) hm->
getHisto(
"EMCalAna_h_CEMC_BLOCK_EVis");
1148 assert(EMCalAna_h_CEMC_BLOCK_EVis);
1149 TH1 *EMCalAna_h_CEMC_BLOCK_ETotal = (TH1F *) hm->
getHisto(
"EMCalAna_h_CEMC_BLOCK_ETotal");
1150 assert(EMCalAna_h_CEMC_BLOCK_ETotal);
1153 const string geonodename =
"CYLINDERGEOM_" +
detector;
1154 const string seggeonodename =
"CYLINDERCELLGEOM_" +
detector;
1159 cout <<
"EMCalAna::process_event_SF - Fatal Error - Could not locate sim geometry node "
1160 << geonodename << endl;
1174 cout <<
"EMCalAna::process_event_SF - Fatal Error - could not locate cell geometry node "
1175 << seggeonodename << endl;
1186 hit_iter != cemc_hit_range.second; hit_iter++)
1188 PHG4Hit *this_hit = hit_iter->second;
1194 const int &tower_ID_z = tower_z_phi_ID.first;
1198 cout <<
"EMCalAna::process_event_SF - got scint hit from tower scint_id = " << scint_id
1199 <<
", decoder.tower_ID = " << decoder.
tower_ID
1200 <<
", decoder.sector_ID = " << decoder.
sector_ID
1201 <<
" and decoder tower_ID_z = " << tower_ID_z << endl;
1206 assert(etabin >= 0 and etabin <= 100);
1208 const double e_cemc = this_hit->
get_edep();
1211 EMCalAna_h_CEMC_BLOCK_EVis->Fill(etabin, ev_cemc);
1212 EMCalAna_h_CEMC_BLOCK_ETotal->Fill(etabin, e_cemc);
1216 _cemc_abs_hit_container->getHits();
1218 hit_iter != cemc_abs_hit_range.second; hit_iter++)
1220 PHG4Hit *this_hit = hit_iter->second;
1226 const int &tower_ID_z = tower_z_phi_ID.first;
1230 cout <<
"EMCalAna::process_event_SF - got absorber hit from tower scint_id = " << scint_id
1231 <<
", decoder.tower_ID = " << decoder.
tower_ID
1232 <<
", decoder.sector_ID = " << decoder.
sector_ID
1233 <<
" and decoder tower_ID_z = " << tower_ID_z << endl;
1236 if (tower_ID_z > 10)
1240 assert(etabin >= 0 and etabin <= 100);
1242 const double ea_cemc = this_hit->
get_edep();
1243 EMCalAna_h_CEMC_BLOCK_ETotal->Fill(etabin, ea_cemc);
1257 "h_CEMC_TOWER_1x1", 5000, 0, 50));
1259 "EMCalAna_h_CEMC_TOWER_1x1_max", 5000, 0, 50));
1260 hm->
registerHisto(
new TH1F(
"EMCalAna_h_CEMC_TOWER_1x1_max_trigger_ADC",
1261 "EMCalAna_h_CEMC_TOWER_1x1_max_trigger_ADC", 5000, 0, 50));
1264 "h_CEMC_TOWER_2x2", 5000, 0, 50));
1266 "EMCalAna_h_CEMC_TOWER_2x2_max", 5000, 0, 50));
1267 hm->
registerHisto(
new TH1F(
"EMCalAna_h_CEMC_TOWER_2x2_max_trigger_ADC",
1268 "EMCalAna_h_CEMC_TOWER_2x2_max_trigger_ADC", 5000, 0, 50));
1269 hm->
registerHisto(
new TH1F(
"EMCalAna_h_CEMC_TOWER_2x2_slide2_max_trigger_ADC",
1270 "EMCalAna_h_CEMC_TOWER_2x2_slide2_max_trigger_ADC", 5000, 0, 50));
1273 "h_CEMC_TOWER_3x3", 5000, 0, 50));
1275 "EMCalAna_h_CEMC_TOWER_3x3_max", 5000, 0, 50));
1276 hm->
registerHisto(
new TH1F(
"EMCalAna_h_CEMC_TOWER_3x3_max_trigger_ADC",
1277 "EMCalAna_h_CEMC_TOWER_3x3_max_trigger_ADC", 5000, 0, 50));
1280 "h_CEMC_TOWER_4x4", 5000, 0, 50));
1282 "EMCalAna_h_CEMC_TOWER_4x4_max", 5000, 0, 50));
1283 hm->
registerHisto(
new TH1F(
"EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC",
1284 "EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC", 5000, 0, 50));
1285 hm->
registerHisto(
new TH1F(
"EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC",
1286 "EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC", 5000, 0, 50));
1289 "h_CEMC_TOWER_4x4", 5000, 0, 50));
1291 "EMCalAna_h_CEMC_TOWER_5x5_max", 5000, 0, 50));
1292 hm->
registerHisto(
new TH1F(
"EMCalAna_h_CEMC_TOWER_5x5_max_trigger_ADC",
1293 "EMCalAna_h_CEMC_TOWER_5x5_max_trigger_ADC", 5000, 0, 50));
1303 cout <<
"EMCalAna::process_event_SF() entered" << endl;
1305 string towernodename =
"TOWER_CALIB_" +
detector;
1308 towernodename.c_str());
1311 std::cout <<
PHWHERE <<
": Could not find node " << towernodename.c_str()
1315 string towergeomnodename =
"TOWERGEOM_" +
detector;
1317 topNode, towergeomnodename.c_str());
1320 cout <<
PHWHERE <<
": Could not find node " << towergeomnodename.c_str()
1325 static const double trigger_ADC_bin = 45. / 256.;
1326 static const int max_size = 5;
1327 map<int, string> size_label;
1328 size_label[1] =
"1x1";
1329 size_label[2] =
"2x2";
1330 size_label[3] =
"3x3";
1331 size_label[4] =
"4x4";
1332 size_label[5] =
"5x5";
1333 map<int, double> max_energy;
1334 map<int, double> max_energy_trigger_ADC;
1335 map<int, double> slide2_max_energy_trigger_ADC;
1336 map<int, TH1F *> energy_hist_list;
1337 map<int, TH1F *> max_energy_hist_list;
1338 map<int, TH1F *> max_energy_trigger_ADC_hist_list;
1339 map<int, TH1F *> slide2_max_energy_trigger_ADC_hist_list;
1345 max_energy[
size] = 0;
1346 max_energy_trigger_ADC[
size] = 0;
1350 h = (TH1F *) hm->
getHisto(
"EMCalAna_h_CEMC_TOWER_" + size_label[
size]);
1352 energy_hist_list[
size] =
h;
1354 "EMCalAna_h_CEMC_TOWER_" + size_label[size] +
"_max");
1356 max_energy_hist_list[
size] =
h;
1359 "EMCalAna_h_CEMC_TOWER_" + size_label[size] +
"_max_trigger_ADC");
1361 max_energy_trigger_ADC_hist_list[
size] =
h;
1363 if (size == 2 or size == 4)
1366 slide2_max_energy_trigger_ADC[
size] = 0;
1369 "EMCalAna_h_CEMC_TOWER_" + size_label[size] +
"_slide2_max_trigger_ADC");
1371 slide2_max_energy_trigger_ADC_hist_list[
size] =
h;
1375 for (
int binphi = 0; binphi < towergeom->
get_phibins(); ++binphi)
1377 for (
int bineta = 0; bineta < towergeom->
get_etabins(); ++bineta)
1382 double energy_trigger_ADC = 0;
1383 double slide2_energy_trigger_ADC = 0;
1385 for (
int iphi = binphi; iphi < binphi +
size; ++iphi)
1387 for (
int ieta = bineta; ieta < bineta +
size; ++ieta)
1406 const double e_trigger_ADC =
round(
1407 e_intput / trigger_ADC_bin) *
1411 energy_trigger_ADC += e_trigger_ADC;
1413 if ((size == 2 or size == 4) and (binphi % 2 == 0) and (bineta % 2 == 0))
1417 slide2_energy_trigger_ADC += e_trigger_ADC;
1423 energy_hist_list[
size]->Fill(energy);
1425 if (energy > max_energy[size])
1427 if (energy_trigger_ADC > max_energy_trigger_ADC[size])
1428 max_energy_trigger_ADC[
size] = energy_trigger_ADC;
1430 if ((size == 2 or size == 4) and (binphi % 2 == 0) and (bineta % 2 == 0))
1434 if (slide2_energy_trigger_ADC > slide2_max_energy_trigger_ADC[size])
1435 slide2_max_energy_trigger_ADC[
size] =
1436 slide2_energy_trigger_ADC;
1445 max_energy_hist_list[
size]->Fill(max_energy[
size]);
1446 max_energy_trigger_ADC_hist_list[
size]->Fill(
1447 max_energy_trigger_ADC[size]);
1449 if (size == 2 or size == 4)
1452 slide2_max_energy_trigger_ADC_hist_list[
size]->Fill(
1453 slide2_max_energy_trigger_ADC[size]);