File indexing completed on 2025-10-16 08:21:02
0001 #include "TruthNeutralMesonv1.h"
0002
0003 #include <phool/phool.h>
0004
0005 #include <iostream>
0006
0007 void TruthNeutralMesonv1::Reset()
0008 {
0009 m_pid = 0;
0010 m_parent_pid = 0;
0011 m_is_prompt = true;
0012 m_mother_is_eta = false;
0013 m_is_eta_3pi0 = false;
0014 m_is_eta_pi0pipm = false;
0015
0016 m_e = 0;
0017 m_pt = 0;
0018 m_eta = 0;
0019 m_phi = 0;
0020 m_p = 0;
0021
0022 m_n_photons = 0;
0023 for (int i = 0; i < 2; ++i)
0024 {
0025 m_photon_e[i] = 0;
0026 m_photon_pt[i] = 0;
0027 m_photon_eta[i] = 0;
0028 m_photon_phi[i] = 0;
0029 m_photon_p[i] = 0;
0030 m_photon_converted[i] = false;
0031 }
0032 }
0033
0034 void TruthNeutralMesonv1::identify(std::ostream& os) const
0035 {
0036 os << "TruthNeutralMesonv1:"
0037 << " pid = " << m_pid
0038 << " origin prompt / feed-down pid = " << m_is_prompt << " / " << m_parent_pid
0039 << " mother_is_eta = " << m_mother_is_eta
0040 << " e = " << m_e
0041 << " pt = " << m_pt
0042 << " eta = " << m_eta
0043 << " phi = " << m_phi
0044 << " p = " << m_p
0045 << " n_photons = " << m_n_photons
0046 << std::endl;
0047
0048 for (int i = 0; i < m_n_photons; ++i)
0049 {
0050 os << " Photon[" << i << "] "
0051 << " e = " << m_photon_e[i]
0052 << " pt = " << m_photon_pt[i]
0053 << " eta = " << m_photon_eta[i]
0054 << " phi = " << m_photon_phi[i]
0055 << " p = " << m_photon_p[i]
0056 << std::endl;
0057 }
0058 }
0059
0060 void TruthNeutralMesonv1::add_photon(float e, float pt, float eta, float phi, float p, bool isconv)
0061 {
0062 if (m_n_photons >= 2)
0063 {
0064 std::cout << PHWHERE << " Tried to add more than 2 photons!" << std::endl;
0065 return;
0066 }
0067
0068 m_photon_e[m_n_photons] = e;
0069 m_photon_pt[m_n_photons] = pt;
0070 m_photon_eta[m_n_photons] = eta;
0071 m_photon_phi[m_n_photons] = phi;
0072 m_photon_p[m_n_photons] = p;
0073 m_photon_converted[m_n_photons] = isconv;
0074
0075 ++m_n_photons;
0076 }