diff --git a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx index ae3db7b6d9bbe8f47caf1fffc81bfbe29e975c77..e240494871b225a33d5bbcaeab991472e04bd819 100644 --- a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx +++ b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx @@ -377,37 +377,37 @@ StatusCode NtupleDumperAlg::initialize() m_tree->Branch("truth_dec_z", &m_truth_dec_z); m_tree->Branch("truth_isFiducial", &m_truth_isFiducial); - // m_tree->Branch("truth_st0_x", &m_truth_st_x[0]); - // m_tree->Branch("truth_st0_y", &m_truth_st_y[0]); - // m_tree->Branch("truth_st0_z", &m_truth_st_z[0]); + m_tree->Branch("truth_st0_x", &m_truth_st_x[0]); + m_tree->Branch("truth_st0_y", &m_truth_st_y[0]); + m_tree->Branch("truth_st0_z", &m_truth_st_z[0]); - // m_tree->Branch("truth_st1_x", &m_truth_st_x[1]); - // m_tree->Branch("truth_st1_y", &m_truth_st_y[1]); - // m_tree->Branch("truth_st1_z", &m_truth_st_z[1]); + m_tree->Branch("truth_st1_x", &m_truth_st_x[1]); + m_tree->Branch("truth_st1_y", &m_truth_st_y[1]); + m_tree->Branch("truth_st1_z", &m_truth_st_z[1]); - // m_tree->Branch("truth_st2_x", &m_truth_st_x[2]); - // m_tree->Branch("truth_st2_y", &m_truth_st_y[2]); - // m_tree->Branch("truth_st2_z", &m_truth_st_z[2]); + m_tree->Branch("truth_st2_x", &m_truth_st_x[2]); + m_tree->Branch("truth_st2_y", &m_truth_st_y[2]); + m_tree->Branch("truth_st2_z", &m_truth_st_z[2]); - // m_tree->Branch("truth_st3_x", &m_truth_st_x[3]); - // m_tree->Branch("truth_st3_y", &m_truth_st_y[3]); - // m_tree->Branch("truth_st3_z", &m_truth_st_z[3]); + m_tree->Branch("truth_st3_x", &m_truth_st_x[3]); + m_tree->Branch("truth_st3_y", &m_truth_st_y[3]); + m_tree->Branch("truth_st3_z", &m_truth_st_z[3]); - // m_tree->Branch("truth_st0_px", &m_truth_st_px[0]); - // m_tree->Branch("truth_st0_py", &m_truth_st_py[0]); - // m_tree->Branch("truth_st0_pz", &m_truth_st_pz[0]); + m_tree->Branch("truth_st0_px", &m_truth_st_px[0]); + m_tree->Branch("truth_st0_py", &m_truth_st_py[0]); + m_tree->Branch("truth_st0_pz", &m_truth_st_pz[0]); - // m_tree->Branch("truth_st1_px", &m_truth_st_px[1]); - // m_tree->Branch("truth_st1_py", &m_truth_st_py[1]); - // m_tree->Branch("truth_st1_pz", &m_truth_st_pz[1]); + m_tree->Branch("truth_st1_px", &m_truth_st_px[1]); + m_tree->Branch("truth_st1_py", &m_truth_st_py[1]); + m_tree->Branch("truth_st1_pz", &m_truth_st_pz[1]); - // m_tree->Branch("truth_st2_px", &m_truth_st_px[2]); - // m_tree->Branch("truth_st2_py", &m_truth_st_py[2]); - // m_tree->Branch("truth_st2_pz", &m_truth_st_pz[2]); + m_tree->Branch("truth_st2_px", &m_truth_st_px[2]); + m_tree->Branch("truth_st2_py", &m_truth_st_py[2]); + m_tree->Branch("truth_st2_pz", &m_truth_st_pz[2]); - // m_tree->Branch("truth_st3_px", &m_truth_st_px[3]); - // m_tree->Branch("truth_st3_py", &m_truth_st_py[3]); - // m_tree->Branch("truth_st3_pz", &m_truth_st_pz[3]); + m_tree->Branch("truth_st3_px", &m_truth_st_px[3]); + m_tree->Branch("truth_st3_py", &m_truth_st_py[3]); + m_tree->Branch("truth_st3_pz", &m_truth_st_pz[3]); // for mother + daughter particle truth infomation @@ -817,19 +817,19 @@ StatusCode NtupleDumperAlg::execute(const EventContext &ctx) const m_truth_dec_y.push_back(999999); m_truth_dec_z.push_back(999999); } - // auto positions = m_fiducialParticleTool->getTruthPositions(particle->barcode()); - // for (int station = 0; station < 4; ++station) { - // m_truth_st_x[station].push_back(positions[station].x()); - // m_truth_st_y[station].push_back(positions[station].y()); - // m_truth_st_z[station].push_back(positions[station].z()); - // } + auto positions = m_fiducialParticleTool->getTruthPositions(particle->barcode()); + for (int station = 0; station < 4; ++station) { + m_truth_st_x[station].push_back(positions[station].x()); + m_truth_st_y[station].push_back(positions[station].y()); + m_truth_st_z[station].push_back(positions[station].z()); + } - // auto momenta = m_fiducialParticleTool->getTruthMomenta(particle->barcode()); - // for (int station = 0; station < 4; ++station) { - // m_truth_st_px[station].push_back(momenta[station].x()); - // m_truth_st_py[station].push_back(momenta[station].y()); - // m_truth_st_pz[station].push_back(momenta[station].z()); - // } + auto momenta = m_fiducialParticleTool->getTruthMomenta(particle->barcode()); + for (int station = 0; station < 4; ++station) { + m_truth_st_px[station].push_back(momenta[station].x()); + m_truth_st_py[station].push_back(momenta[station].y()); + m_truth_st_pz[station].push_back(momenta[station].z()); + } // Find the M d0 and d1 truth information for dark photon @@ -1655,16 +1655,16 @@ NtupleDumperAlg::clearTree() const m_truth_isFiducial.clear(); - // for (int station = 0; station < 4; ++station) { - // m_truth_st_x[station].clear(); - // m_truth_st_y[station].clear(); - // m_truth_st_z[station].clear(); - // } - // for (int station = 0; station < 4; ++station) { - // m_truth_st_px[station].clear(); - // m_truth_st_py[station].clear(); - // m_truth_st_pz[station].clear(); - // } + for (int station = 0; station < 4; ++station) { + m_truth_st_x[station].clear(); + m_truth_st_y[station].clear(); + m_truth_st_z[station].clear(); + } + for (int station = 0; station < 4; ++station) { + m_truth_st_px[station].clear(); + m_truth_st_py[station].clear(); + m_truth_st_pz[station].clear(); + } m_truthM_P.clear(); diff --git a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h index 2782faf0991919795644d340c04075445780d9cf..762879a5f65b1541bd989405af8b647c4e20192c 100644 --- a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h +++ b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h @@ -380,12 +380,12 @@ private: mutable std::vector<double> m_truth_prod_y; mutable std::vector<double> m_truth_prod_z; - // mutable std::array<std::vector<double>, 4> m_truth_st_x; // vector of the x components of the simulated hits of the truth particle for each station [first 10 MC particles] - // mutable std::array<std::vector<double>, 4> m_truth_st_y; // vector of the y components of the simulated hits of the truth particle for each station [first 10 MC particles] - // mutable std::array<std::vector<double>, 4> m_truth_st_z; // vector of the z components of the simulated hits of the truth particle for each station [first 10 MC particles] - // mutable std::array<std::vector<double>, 4> m_truth_st_px; // x components of the true momentum at each station [first 10 MC particles] - // mutable std::array<std::vector<double>, 4> m_truth_st_py; // y components of the true momentum at each station [first 10 MC particles] - // mutable std::array<std::vector<double>, 4> m_truth_st_pz; // z components of the true momentum at each station [first 10 MC particles] + mutable std::array<std::vector<double>, 4> m_truth_st_x; // vector of the x components of the simulated hits of the truth particle for each station [first 10 MC particles] + mutable std::array<std::vector<double>, 4> m_truth_st_y; // vector of the y components of the simulated hits of the truth particle for each station [first 10 MC particles] + mutable std::array<std::vector<double>, 4> m_truth_st_z; // vector of the z components of the simulated hits of the truth particle for each station [first 10 MC particles] + mutable std::array<std::vector<double>, 4> m_truth_st_px; // x components of the true momentum at each station [first 10 MC particles] + mutable std::array<std::vector<double>, 4> m_truth_st_py; // y components of the true momentum at each station [first 10 MC particles] + mutable std::array<std::vector<double>, 4> m_truth_st_pz; // z components of the true momentum at each station [first 10 MC particles] mutable std::vector<int> m_truth_pdg; // pdg of first 10 truth particles mutable std::vector<bool> m_truth_isFiducial; /// Vector of boolean showing whether a truth particle is fiducial for the first 10 particles