Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:09

0001 #include "PHG4Particlev2.h"
0002 
0003 #include "PHG4Particle.h"  // for PHG4Particle
0004 
0005 #include <cmath>
0006 
0007 PHG4Particlev2::PHG4Particlev2(const std::string &name, const int pid, const double px, const double py, const double pz)
0008   : PHG4Particlev1(name, pid, px, py, pz)
0009 {
0010 }
0011 
0012 PHG4Particlev2::PHG4Particlev2(const PHG4Particle *in)
0013   : PHG4Particlev1(in)
0014   , trkid(in->get_track_id())
0015   , vtxid(in->get_vtx_id())
0016   , parentid(in->get_parent_id())
0017   , primaryid(in->get_primary_id())
0018   , fe(in->get_e())
0019 {
0020 }
0021 
0022 void PHG4Particlev2::identify(std::ostream &os) const
0023 {
0024   if (!fname.empty())
0025   {
0026     os << "PHG4Particlev2 name: " << fname << ", ";
0027   }
0028   else
0029   {
0030     os << "PHG4Particlev2 name: missing, ";
0031   }
0032 
0033   os << "track id: " << trkid
0034      << ", vtxid: " << vtxid
0035      << ", parent id: " << parentid
0036      << ", primary id: " << primaryid
0037      << ", pid: " << fpid
0038      << ", px: " << fpx
0039      << ", py: " << fpy
0040      << ", pz: " << fpz
0041      << ", phi: " << atan2(fpy, fpx)
0042      << ", eta: " << -1 * log(tan(0.5 * acos(fpz / sqrt((fpx * fpx) + (fpy * fpy) + (fpz * fpz)))))
0043      << ", e: " << fe << std::endl;
0044   return;
0045 }