Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4Particlev2.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4Particlev2.cc
1 #include "PHG4Particlev2.h"
2 
3 #include "PHG4Particle.h" // for PHG4Particle
4 
5 using namespace std;
6 
9  , trkid(0)
10  , vtxid(0)
11  , parentid(0)
12  , primaryid(0xFFFFFFFF)
13  , fe(0.0)
14 {
15 }
16 
17 PHG4Particlev2::PHG4Particlev2(const string &name, const int pid, const double px, const double py, const double pz)
18  : PHG4Particlev1(name, pid, px, py, pz)
19  , trkid(0)
20  , vtxid(0)
21  , parentid(0)
22  , primaryid(0xFFFFFFFF)
23  , fe(0.0)
24 {
25 }
26 
28  : PHG4Particlev1(in)
29  , trkid(in->get_track_id())
30  , vtxid(in->get_vtx_id())
31  , parentid(in->get_parent_id())
32  , primaryid(in->get_primary_id())
33  , fe(in->get_e())
34 {
35 }
36 
37 void PHG4Particlev2::identify(std::ostream &os) const
38 {
39  if (fname.size() > 0)
40  {
41  os << "PHG4Particlev2 name: " << fname << ", ";
42  }
43  else
44  {
45  os << "PHG4Particlev2 name: missing, ";
46  }
47 
48  os << "track id: " << trkid
49  << ", vtxid: " << vtxid
50  << ", parent id: " << parentid
51  << ", primary id: " << primaryid
52  << ", pid: " << fpid
53  << ", px: " << fpx
54  << ", py: " << fpy
55  << ", pz: " << fpz
56  << ", phi: " << atan2(fpy,fpx)
57  << ", eta: " << -1*log(tan(0.5*acos(fpz/sqrt(fpx*fpx+fpy*fpy+fpz*fpz))))
58  << ", e: " << fe << endl;
59  return;
60 }