20 m_h_n_vert =
new TH1D(
"h_n_vert",
"n_vert", 100,200, 1500);
24 m_h_n_part =
new TH1D(
"h_n_part",
"n_part", 100,1000, 10000);
32 m_h_n_part_prim =
new TH1D(
"h_n_part_prim",
"n_part prim", 100,200, 1500);
36 m_h_n_vert_sec =
new TH1D(
"h_n_vert_sec",
"n_vert sec", 100,0, 1000);
40 m_h_n_part_sec =
new TH1D(
"h_n_part_sec",
"n_part sec", 100,0, 5000);
44 m_h_vtx_x =
new TH1D(
"h_vtx_x",
"vtx_x", 100,-1300, 1300);
48 m_h_vtx_y =
new TH1D(
"h_vtx_y",
"vtx_y", 100,-1200, 1200);
52 m_h_vtx_z =
new TH1D(
"h_vtx_z",
"vtx_z", 100,-5000, 5000);
56 m_h_vtx_r =
new TH1D(
"h_vtx_r",
"vtx_r", 100,0, 1160);
60 m_h_vtx_prim_xy =
new TH2D(
"h_vtx_prim_xy",
"vtx_prim_xy", 100,-100, 100, 100,-100, 100);
64 m_h_vtx_prim_zr =
new TH2D(
"h_vtx_prim_zr",
"vtx_prim_zr", 100,-1500, 1500, 100,0, 150);
68 m_h_vtx_sec_xy =
new TH2D(
"h_vtx_sec_xy",
"vtx_sec_xy", 100,-1200, 1200, 100,-1200, 1200);
72 m_h_vtx_sec_zr =
new TH2D(
"h_vtx_sec_zr",
"vtx_sec_zr", 100,-6000, 6000, 100,0, 1160);
80 m_h_truth_px =
new TH1D(
"h_truth_px",
"truth_px", 100,0, 4000);
84 m_h_truth_py =
new TH1D(
"h_truth_py",
"truth_py", 100,0, 4000);
88 m_h_truth_pz =
new TH1D(
"h_truth_pz",
"truth_pz", 100,0, 4000);
92 m_h_truth_pt =
new TH1D(
"h_truth_pt",
"truth_pt", 100,0, 4000);
96 m_h_truth_eta =
new TH1D(
"h_truth_eta",
"truth_eta", 50,-10, 10);
100 m_h_truth_phi =
new TH1D(
"h_truth_phi",
"truth_phi", 25,-3.1416, 3.1416);
104 m_h_barcode =
new TH1D(
"h_truth_barcode",
"truth_barcode", 100,0, 300000);
112 m_h_part_pdgid =
new TH1D(
"h_part_pdgid",
"part pdgid", 100,-5000, 5000);
120 m_h_part_eta =
new TH1D(
"h_part_eta",
"part eta", 100,-10, 10);
124 m_h_part_phi =
new TH1D(
"h_part_phi",
"part phi", 100,-3.2, 3.2);
128 m_h_part_p =
new TH1D(
"h_part_p",
"part p", 100,0, 5000);
133 m_tree =
new TTree(
"Truth",
"Truth");
152 return StatusCode::SUCCESS;
174 const EventContext& ctx{Gaudi::Hive::currentContext()};
180 if (currentGenEventIter != mcCollection->end()) {
184 const auto &
barcodes = (*currentGenEventIter)->attribute<HepMC::GenEventBarcodes> (
"barcodes");
185 std::map<int,int> id_to_barcode_map;
187 for (
const auto& vtx: (*currentGenEventIter)->vertices()) {
188 int bcode = id_to_barcode_map[vtx->id()];
190 for (HepMC::GenEvent::vertex_const_iterator vtxit=(*currentGenEventIter)->vertices_begin(); vtxit!=(*currentGenEventIter)->vertices_end(); ++vtxit) {
194 double x = vtx->position().x();
195 double y = vtx->position().y();
196 double z = vtx->position().z();
197 double r = std::sqrt(
x*
x+
y*
y);
228 for (
auto currentGenParticle: *(*currentGenEventIter)) {
229 const HepMC::FourVector
mom = currentGenParticle->momentum();
231 int currentGenParticlebarcode = id_to_barcode_map[currentGenParticle->id()];
249 m_barcode->push_back(currentGenParticlebarcode);
250 m_status->push_back(currentGenParticle->status());
252 int pdg = currentGenParticle->pdg_id();
286 return StatusCode::SUCCESS;