3 #include <qautils/QAHistManagerDef.h>
14 #include <CLHEP/Vector/LorentzVector.h>
22 #include <TDatabasePDG.h>
42 , m_truth_info(nullptr)
43 , m_g4particle(nullptr)
44 , m_df_module_name(
"myFinder")
48 , m_write_nTuple(
true)
49 , m_write_QAHists(
true)
84 ";Mother p_{x} [GeV/c];Entries", 100, 0, 10);
87 ";Mother p_{y} [GeV/c];Entries", 100, 0, 10);
90 ";Mother p_{z} [GeV/c];Entries", 100, 0, 10);
93 ";Mother p_{E} [GeV];Entries", 100, 0, 10);
96 ";Mother p_{T} [GeV/c];Entries", 100, 0, 10);
99 ";Mother #eta;Entries", 1000, -10, 10);
102 for (
unsigned int i = 0;
i < 4; ++
i)
106 h =
new TH1I(TString(
get_histo_prefix()) + TString(track_number) +
"_PDG_ID",
128 ";Track pT [GeV/c];Entries", 50, 0, 5);
131 ";Track Eta;Entries", 1000, -10, 10);
139 ";#delta p_{x} [GeV/c];Entries", 100, -3, 3);
142 ";#delta p_{y} [GeV/c];Entries", 100, -3, 3);
145 ";#delta p_{z} [GeV/c];Entries", 100, -3, 3);
148 ";#delta p_{E} [GeV];Entries", 100, -3, 3);
152 ";Accept p_{x} 1pcnt;Entries", 2, 0, 1);
155 ";Accept p_{y} 1pcnt;Entries", 2, 0, 1);
158 ";Accept p_{z} 1pcnt;Entries", 2, 0, 1);
161 ";Accept p_{E} 1pcnt;Entries", 2, 0, 1);
165 ";Accept p_{x} 5pcnt;Entries", 2, 0, 1);
168 ";Accept p_{y} 5pcnt;Entries", 2, 0, 1);
171 ";Accept p_{z} 5pcnt;Entries", 2, 0, 1);
174 ";Accept p_{E} 5pcnt;Entries", 2, 0, 1);
178 ";Accept p_{x} 15pcnt;Entries", 2, 0, 1);
181 ";Accept p_{y} 15pcnt;Entries", 2, 0, 1);
184 ";Accept p_{z} 15pcnt;Entries", 2, 0, 1);
187 ";Accept p_{E} 15pcnt;Entries", 2, 0, 1);
191 ";Accept p_{T};Entries", 2, 0, 1);
194 ";Accept #eta;Entries", 2, 0, 1);
205 CLHEP::HepLorentzVector daughterSumLV;
215 assert(h_daughter_sum_mass);
217 assert(h_mother_decayLength);
219 assert(h_mother_decayTime);
242 assert(h_accept_px_1percent);
244 assert(h_accept_py_1percent);
246 assert(h_accept_pz_1percent);
248 assert(h_accept_pE_1percent);
250 assert(h_accept_px_5percent);
252 assert(h_accept_py_5percent);
254 assert(h_accept_pz_5percent);
256 assert(h_accept_pE_5percent);
258 assert(h_accept_px_15percent);
260 assert(h_accept_py_15percent);
262 assert(h_accept_pz_15percent);
264 assert(h_accept_pE_15percent);
350 if (motherBarcodes.size() == 1)
352 m_truth_info = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
355 std::cout <<
"QAG4SimulationTruthDecay: Missing node G4TruthInfo" << std::endl;
359 unsigned int trackCounter = 0;
363 float daughter_x = 0;
364 float daughter_y = 0;
365 float daughter_z = 0;
369 iter != range.second; ++iter)
393 mother_x = mother_vtx->
get_x();
394 mother_y = mother_vtx->
get_y();
395 mother_z = mother_vtx->
get_z();
414 daughterSumLV += daughterLV;
416 m_track_eta[trackCounter] = daughterLV.pseudoRapidity();
425 daughter_x = daughter_vtx->
get_x();
426 daughter_y = daughter_vtx->
get_y();
427 daughter_z = daughter_vtx->
get_z();
460 m_mother_decayLength = sqrt(pow(daughter_x - mother_x, 2) + pow(daughter_y - mother_y, 2) + pow(daughter_z - mother_z, 2));
553 std::cout <<
"You have more than one good decay in this event, this processing is not yet supported" << std::endl;
579 m_tree =
new TTree(
"QAG4SimulationTruthDecay",
"QAG4SimulationTruthDecay");
580 m_tree->OptimizeBaskets();
581 m_tree->SetAutoSave(-5e6);
585 m_tree->Branch(
"mother_mass", &
m_mother_mass,
"mother_mass/F");
589 m_tree->Branch(
"mother_px", &
m_mother_px,
"mother_px/F");
590 m_tree->Branch(
"mother_py", &
m_mother_py,
"mother_py/F");
591 m_tree->Branch(
"mother_pz", &
m_mother_pz,
"mother_pz/F");
592 m_tree->Branch(
"mother_pE", &
m_mother_pE,
"mother_pE/F");
593 m_tree->Branch(
"mother_pT", &
m_mother_pT,
"mother_pT/F");
594 m_tree->Branch(
"mother_eta", &
m_mother_eta,
"mother_eta/F");
601 m_tree->Branch(TString(track_number) +
"_PDG_ID", &
m_track_pdg_id[
i], TString(track_number) +
"_PDG_ID/I");
602 m_tree->Branch(TString(track_number) +
"_px", &
m_track_px[i], TString(track_number) +
"_px/F");
603 m_tree->Branch(TString(track_number) +
"_py", &
m_track_py[i], TString(track_number) +
"_py/F");
604 m_tree->Branch(TString(track_number) +
"_pz", &
m_track_pz[i], TString(track_number) +
"_pz/F");
605 m_tree->Branch(TString(track_number) +
"_pE", &
m_track_pE[i], TString(track_number) +
"_pE/F");
606 m_tree->Branch(TString(track_number) +
"_pT", &
m_track_pT[i], TString(track_number) +
"_pT/F");
607 m_tree->Branch(TString(track_number) +
"_eta", &
m_track_eta[i], TString(track_number) +
"_eta/F");
608 m_tree->Branch(TString(track_number) +
"_mass", &
m_track_mass[i], TString(track_number) +
"_mass/F");
609 m_tree->Branch(TString(track_number) +
"_mother_barcode", &
m_track_mother_barcode[i], TString(track_number) +
"_mother_barcode/I");
612 m_tree->Branch(
"delta_px", &
m_delta_px,
"delta_px/F");
613 m_tree->Branch(
"delta_py", &
m_delta_py,
"delta_py/F");
614 m_tree->Branch(
"delta_pz", &
m_delta_pz,
"delta_pz/F");
615 m_tree->Branch(
"delta_pE", &
m_delta_pE,
"delta_pE/F");
632 m_tree->Branch(
"accept_pT", &
m_accept_pT,
"accept_pT/O");
633 m_tree->Branch(
"accept_eta", &
m_accept_eta,
"accept_eta/O");
645 m_decayMap = findNode::getClass<DecayFinderContainer_v1>(topNode, node_name.c_str());
657 std::vector<int> m_motherBarcodes;
663 m_decayMap = findNode::getClass<DecayFinderContainer_v1>(topNode, node_name.c_str());
667 Decay decay = iter->second;
669 m_motherBarcodes.push_back(decay[0].first.second);
672 return m_motherBarcodes;
677 return min <= value && value <= max;