38 , _truth_jet(truth_jet)
44 , _jet_match_dE_Ratio(.5)
52 for (std::set<std::string>::const_iterator it_reco_jets =
_reco_jets.begin();
53 it_reco_jets !=
_reco_jets.end(); ++it_reco_jets)
55 const std::string& reco_jet = *it_reco_jets;
69 assert(it_jetevalstack->second);
79 assert(_jettrutheval);
80 _jettrutheval->set_strict(
true);
81 _jettrutheval->set_verbosity(
Verbosity() + 1);
95 std::cout <<
"QAG4SimulationJet::Init - Process TruthSpectrum " <<
_truth_jet
102 for (std::set<std::string>::const_iterator it_reco_jets =
_reco_jets.begin();
103 it_reco_jets !=
_reco_jets.end(); ++it_reco_jets)
105 const std::string& reco_jet = *it_reco_jets;
107 std::cout <<
"QAG4SimulationJet::Init - Process Reco jet spectrum "
108 << reco_jet << std::endl;
115 for (std::set<std::string>::const_iterator it_reco_jets =
_reco_jets.begin();
116 it_reco_jets !=
_reco_jets.end(); ++it_reco_jets)
118 const std::string& reco_jet = *it_reco_jets;
120 std::cout <<
"QAG4SimulationJet::Init - Process Reco jet spectrum "
121 << reco_jet << std::endl;
132 std::cout <<
"QAG4SimulationJet::process_event() entered" << std::endl;
134 for (jetevalstacks_map::iterator it_jetevalstack =
_jetevalstacks.begin();
137 assert(it_jetevalstack->second);
138 it_jetevalstack->second->next_event(topNode);
146 std::cout <<
"QAG4SimulationJet::process_event - Process TruthSpectrum "
153 for (std::set<std::string>::const_iterator it_reco_jets =
_reco_jets.begin();
154 it_reco_jets !=
_reco_jets.end(); ++it_reco_jets)
156 const std::string& reco_jet = *it_reco_jets;
159 <<
"QAG4SimulationJet::process_event - Process Reco jet spectrum "
160 << reco_jet << std::endl;
167 for (std::set<std::string>::const_iterator it_reco_jets =
_reco_jets.begin();
168 it_reco_jets !=
_reco_jets.end(); ++it_reco_jets)
170 const std::string& reco_jet = *it_reco_jets;
173 <<
"QAG4SimulationJet::process_event - Process Reco jet spectrum "
174 << reco_jet << std::endl;
213 const std::string& reco_jet_name)
215 std::string histo_prefix =
"h_QAG4SimJet_";
217 if (src_jet_name.length() > 0)
219 histo_prefix += src_jet_name;
222 if (reco_jet_name.length() > 0)
224 histo_prefix += reco_jet_name;
232 const std::string& jet_name)
238 const int norm_size = 3;
240 TH1D* h_norm =
new TH1D(
242 " Normalization;Item;Count", norm_size, .5, norm_size + .5);
245 h_norm->GetXaxis()->SetBinLabel(i++,
"Event");
246 h_norm->GetXaxis()->SetBinLabel(i++,
"Inclusive Jets");
247 h_norm->GetXaxis()->SetBinLabel(i++,
"Leading Jets");
248 assert(norm_size >= i - 1);
249 h_norm->GetXaxis()->LabelsOption(
"v");
256 TString(jet_name) +
" leading jet Et, " +
get_eta_range_str() +
";E_{T} (GeV)", 100, 0, 100));
261 TString(jet_name) +
" leading jet #eta, " +
get_eta_range_str() +
";#eta", 50, -1, 1));
268 TH1F* lcomp =
new TH1F(
271 TString(jet_name) +
" leading jet # of component, " +
get_eta_range_str() +
";Number of component;", 100, 1, 3000);
279 TString(jet_name) +
" leading jet mass, " +
get_eta_range_str() +
";Jet Mass (GeV);", 100, 0, 20));
284 TString(jet_name) +
" leading jet EMCal ratio, " +
get_eta_range_str() +
";Energy ratio CEMC/Total;", 100, 0, 1.01));
289 TString(jet_name) +
" leading jet EMCal+HCal_{IN} ratio, " +
get_eta_range_str() +
";Energy ratio (CEMC + HCALIN)/Total;",
298 TString(jet_name) +
" leading jet leakage ratio, " +
get_eta_range_str() +
";Energy ratio, Back leakage/Total;", 100,
304 TString(jet_name) +
" inclusive jet E, " +
get_eta_range_str() +
";Total jet energy (GeV)", 100, 1
e-3, 100);
311 TString(jet_name) +
" inclusive jet #eta, " +
get_eta_range_str() +
";#eta;Jet energy density", 50, -1, 1));
322 const std::string& jet_name,
const bool is_reco_jet)
324 JetMap* jets = findNode::getClass<JetMap>(topNode, jet_name.c_str());
328 <<
"QAG4SimulationJet::process_Spectrum - Error can not find DST JetMap node "
329 << jet_name << std::endl;
336 TH1D* h_norm =
dynamic_cast<TH1D*
>(hm->
getHisto(
339 h_norm->Fill(
"Event", 1);
340 h_norm->Fill(
"Inclusive Jets", jets->
size());
342 TH1F* ie =
dynamic_cast<TH1F*
>(hm->
getHisto(
346 TH1F* ieta =
dynamic_cast<TH1F*
>(hm->
getHisto(
350 TH1F* iphi =
dynamic_cast<TH1F*
>(hm->
getHisto(
355 Jet* leading_jet =
nullptr;
359 Jet* jet = iter->second;
365 if (jet->
get_et() > max_et)
371 ie->Fill(jet->
get_e());
381 <<
"QAG4SimulationJet::process_Spectrum - processing leading jet with # comp = "
382 << leading_jet->
size_comp() << std::endl;
386 h_norm->Fill(
"Leading Jets", 1);
388 TH1F* let =
dynamic_cast<TH1F*
>(hm->
getHisto(
392 TH1F* leta =
dynamic_cast<TH1F*
>(hm->
getHisto(
396 TH1F* lphi =
dynamic_cast<TH1F*
>(hm->
getHisto(
401 TH1F* lcomp =
dynamic_cast<TH1F*
>(hm->
getHisto(
405 TH1F* lmass =
dynamic_cast<TH1F*
>(hm->
getHisto(
409 TH1F* lcemcr =
dynamic_cast<TH1F*
>(hm->
getHisto(
413 TH1F* lemchcalr =
dynamic_cast<TH1F*
>(hm->
getHisto(
417 TH1F* lleak =
dynamic_cast<TH1F*
>(hm->
getHisto(
422 let->Fill(leading_jet->
get_et());
423 leta->Fill(leading_jet->
get_eta());
424 lphi->Fill(leading_jet->
get_phi());
426 lmass->Fill(leading_jet->
get_mass());
430 jetevalstacks_map::iterator it_stack =
_jetevalstacks.find(jet_name);
432 std::shared_ptr<JetEvalStack> eval_stack = it_stack->second;
434 JetRecoEval* recoeval = eval_stack->get_reco_eval();
439 std::cout << __PRETTY_FUNCTION__ <<
"Leading Jet " << jet_name <<
": ";
445 std::cout <<
"leading_jet->get_e() = " << leading_jet->
get_e() << std::endl;
454 leading_jet->
get_e());
467 leading_jet->
get_e());
479 std::set<PHG4Shower*> showers =
_jettrutheval->all_truth_showers(
482 for (std::set<PHG4Shower*>::const_iterator
it = showers.begin();
483 it != showers.end(); ++
it)
487 std::cout << __PRETTY_FUNCTION__ <<
"Leading Truth Jet shower : ";
491 cemc_e += (*it)->get_edep(
493 cemc_e += (*it)->get_edep(
495 cemc_e += (*it)->get_edep(
498 hcalin_e += (*it)->get_edep(
500 hcalin_e += (*it)->get_edep(
504 bh_e += (*it)->get_edep(
506 bh_e += (*it)->get_edep(
512 std::cout <<
"Shower cemc_e sum = "
521 std::cout <<
"Shower hcalin_e sum = "
528 std::cout <<
"Shower bh_e sum = "
542 std::cout <<
"cemc_e sum = " << cemc_e << std::endl;
543 std::cout <<
"hcalin_e sum = " << hcalin_e << std::endl;
544 std::cout <<
"leading_jet->get_e() = " << leading_jet->
get_e() << std::endl;
547 lcemcr->Fill(cemc_e / leading_jet->
get_e());
548 lemchcalr->Fill((cemc_e + hcalin_e) / leading_jet->
get_e());
549 lleak->Fill(bh_e / leading_jet->
get_e());
557 const std::string& reco_jet_name)
564 TString(reco_jet_name) +
" Matching Count, " +
get_eta_range_str() +
";E_{T, Truth} (GeV)", 20, 0, 100, 3, 0.5, 3.5);
565 h->GetYaxis()->SetBinLabel(1,
"Total");
566 h->GetYaxis()->SetBinLabel(2,
"Matched");
567 h->GetYaxis()->SetBinLabel(3,
"Unique Matched");
573 TString(reco_jet_name) +
" Matching Count, " +
get_eta_range_str() +
";E_{T, Reco} (GeV)", 20, 0, 100, 3, 0.5, 3.5);
574 h->GetYaxis()->SetBinLabel(1,
"Total");
575 h->GetYaxis()->SetBinLabel(2,
"Matched");
576 h->GetYaxis()->SetBinLabel(3,
"Unique Matched");
581 TString(reco_jet_name) +
" E_{T} difference, " +
get_eta_range_str() +
";E_{T, Truth} (GeV);E_{T, Reco} / E_{T, Truth}", 20, 0, 100, 100,
587 TString(reco_jet_name) +
" Jet Energy Difference, " +
get_eta_range_str() +
";E_{Truth} (GeV);E_{Reco} / E_{Truth}", 20, 0, 100, 100, 0, 2);
592 TString(reco_jet_name) +
" #eta difference, " +
get_eta_range_str() +
";E_{T, Truth} (GeV);#eta_{Reco} - #eta_{Truth}", 20, 0, 100, 200,
598 TString(reco_jet_name) +
" #phi difference, " +
get_eta_range_str() +
";E_{T, Truth} (GeV);#phi_{Reco} - #phi_{Truth} (rad)", 20, 0, 100,
606 const std::string& reco_jet_name)
615 TH2F* Matching_Count_Truth_Et =
dynamic_cast<TH2F*
>(hm->
getHisto(
618 assert(Matching_Count_Truth_Et);
619 TH2F* Matching_Count_Reco_Et =
dynamic_cast<TH2F*
>(hm->
getHisto(
622 assert(Matching_Count_Reco_Et);
623 TH2F* Matching_dEt =
dynamic_cast<TH2F*
>(hm->
getHisto(
626 assert(Matching_dEt);
627 TH2F* Matching_dE =
dynamic_cast<TH2F*
>(hm->
getHisto(
631 TH2F* Matching_dEta =
dynamic_cast<TH2F*
>(hm->
getHisto(
634 assert(Matching_dEta);
635 TH2F* Matching_dPhi =
dynamic_cast<TH2F*
>(hm->
getHisto(
638 assert(Matching_dPhi);
640 jetevalstacks_map::iterator it_stack =
_jetevalstacks.find(reco_jet_name);
642 std::shared_ptr<JetEvalStack> eval_stack = it_stack->second;
644 JetRecoEval* recoeval = eval_stack->get_reco_eval();
652 <<
"QAG4SimulationJet::process_TruthMatching - Error can not find DST JetMap node "
658 Jet* truthjet =
nullptr;
662 Jet* jet = iter->second;
668 if (jet->
get_et() > max_et)
680 std::cout <<
"QAG4SimulationJet::process_TruthMatching - " <<
_truth_jet
681 <<
" process truth jet ";
685 Matching_Count_Truth_Et->Fill(truthjet->
get_et(),
"Total", 1);
692 std::cout <<
"QAG4SimulationJet::process_TruthMatching - " <<
_truth_jet
693 <<
" inclusively matched with best reco jet: ";
700 Matching_dPhi->Fill(truthjet->
get_et(), dPhi);
705 Matching_dEta->Fill(truthjet->
get_et(), dEta);
709 const double Et_r = recojet->
get_et() / (truthjet->
get_et() + 1
e-9);
710 const double E_r = recojet->
get_e() / (truthjet->
get_e() + 1
e-9);
711 Matching_dEt->Fill(truthjet->
get_et(), Et_r);
712 Matching_dE->Fill(truthjet->
get_et(), E_r);
718 Matching_Count_Truth_Et->Fill(truthjet->
get_et(),
735 std::cout <<
"QAG4SimulationJet::process_TruthMatching - " <<
_truth_jet
736 <<
" uniquely matched with reco jet: ";
748 const double E_r = recojet->
get_e() / (truthjet->
get_e() + 1
e-9);
753 Matching_Count_Truth_Et->Fill(truthjet->
get_et(),
754 "Unique Matched", 1);
767 JetMap* recojets = findNode::getClass<JetMap>(topNode, reco_jet_name);
771 <<
"QAG4SimulationJet::process_TruthMatching - Error can not find DST JetMap node "
772 << reco_jet_name << std::endl;
777 Jet* recojet =
nullptr;
781 Jet* jet = iter->second;
787 if (jet->
get_et() > max_et)
799 std::cout <<
"QAG4SimulationJet::process_TruthMatching - " << reco_jet_name
800 <<
" process reco jet ";
804 Matching_Count_Reco_Et->Fill(recojet->
get_et(),
"Total", 1);
816 const double E_r = recojet->
get_e() / (truthjet->
get_e() + 1
e-9);
822 Matching_Count_Reco_Et->Fill(recojet->
get_et(),
823 "Unique Matched", 1);
843 const double E_r = recojet->
get_e() / (truthjet->
get_e() + 1
e-9);
849 Matching_Count_Reco_Et->Fill(recojet->
get_et(),