37 , m_h_n_generations(0)
47 , m_h_part_pdgid_sec(0)
67 , m_ntupleFileName(
"/TruthHitAnalysis/")
68 ,
m_path(
"/TruthHitAnalysis/")
69 , m_thistSvc(
"THistSvc",
name)
83 m_h_n_vert =
new TH1D(
"h_n_vert",
"n_vert", 100,200, 1500);
87 m_h_n_part =
new TH1D(
"h_n_part",
"n_part", 100,1000, 10000);
95 m_h_n_part_prim =
new TH1D(
"h_n_part_prim",
"n_part prim", 100,200, 1500);
99 m_h_n_vert_sec =
new TH1D(
"h_n_vert_sec",
"n_vert sec", 100,0, 1000);
103 m_h_n_part_sec =
new TH1D(
"h_n_part_sec",
"n_part sec", 100,0, 5000);
107 m_h_vtx_x =
new TH1D(
"h_vtx_x",
"vtx_x", 100,-1300, 1300);
111 m_h_vtx_y =
new TH1D(
"h_vtx_y",
"vtx_y", 100,-1200, 1200);
115 m_h_vtx_z =
new TH1D(
"h_vtx_z",
"vtx_z", 100,-5000, 5000);
119 m_h_vtx_r =
new TH1D(
"h_vtx_r",
"vtx_r", 100,0, 1160);
123 m_h_vtx_prim_xy =
new TH2D(
"h_vtx_prim_xy",
"vtx_prim_xy", 100,-100, 100, 100,-100, 100);
127 m_h_vtx_prim_zr =
new TH2D(
"h_vtx_prim_zr",
"vtx_prim_zr", 100,-1500, 1500, 100,0, 150);
131 m_h_vtx_sec_xy =
new TH2D(
"h_vtx_sec_xy",
"vtx_sec_xy", 100,-1200, 1200, 100,-1200, 1200);
135 m_h_vtx_sec_zr =
new TH2D(
"h_vtx_sec_zr",
"vtx_sec_zr", 100,-6000, 6000, 100,0, 1160);
143 m_h_truth_px =
new TH1D(
"h_truth_px",
"truth_px", 100,0, 4000);
147 m_h_truth_py =
new TH1D(
"h_truth_py",
"truth_py", 100,0, 4000);
151 m_h_truth_pz =
new TH1D(
"h_truth_pz",
"truth_pz", 100,0, 4000);
155 m_h_truth_pt =
new TH1D(
"h_truth_pt",
"truth_pt", 100,0, 4000);
159 m_h_truth_eta =
new TH1D(
"h_truth_eta",
"truth_eta", 50,-10, 10);
163 m_h_truth_phi =
new TH1D(
"h_truth_phi",
"truth_phi", 25,-3.1416, 3.1416);
167 m_h_barcode =
new TH1D(
"h_truth_barcode",
"truth_barcode", 100,0, 300000);
175 m_h_part_pdgid =
new TH1D(
"h_part_pdgid",
"part pdgid", 100,-5000, 5000);
183 m_h_part_eta =
new TH1D(
"h_part_eta",
"part eta", 100,-10, 10);
187 m_h_part_phi =
new TH1D(
"h_part_phi",
"part phi", 100,-3.2, 3.2);
191 m_h_part_p =
new TH1D(
"h_part_p",
"part p", 100,0, 5000);
196 m_tree =
new TTree(
"Truth",
"Truth");
220 return StatusCode::SUCCESS;
243 if (
evtStore()->
retrieve(mcCollection,
"TruthEvent") == StatusCode::SUCCESS) {
245 if (currentGenEventIter != mcCollection->
end()) {
249 const auto &
barcodes = (*currentGenEventIter)->attribute<HepMC::GenEventBarcodes> (
"barcodes");
250 std::map<int,int> id_to_barcode_map;
252 for (
const auto& vtx: (*currentGenEventIter)->vertices()) {
253 int bcode = id_to_barcode_map[vtx->id()];
255 for (HepMC::GenEvent::vertex_const_iterator vtxit=(*currentGenEventIter)->vertices_begin(); vtxit!=(*currentGenEventIter)->vertices_end(); ++vtxit) {
259 double x = vtx->position().x();
260 double y = vtx->position().y();
261 double z = vtx->position().z();
262 double r = std::sqrt(
x*
x+
y*
y);
293 for (
auto currentGenParticle: *(*currentGenEventIter)) {
294 const HepMC::FourVector
mom = currentGenParticle->momentum();
296 int currentGenParticlebarcode = id_to_barcode_map[currentGenParticle->id()];
314 m_barcode->push_back(currentGenParticlebarcode);
315 m_status->push_back(currentGenParticle->status());
317 int pdg = currentGenParticle->pdg_id();
352 return StatusCode::SUCCESS;