ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ParticleFlowElementv1.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ParticleFlowElementv1.cc
2 
3 #include <cmath>
4 #include <iostream>
5 
7  : _mom() , _e(NAN)
8 {
9  for (int i = 0; i < 3; ++i) _mom[i] = NAN;
10 
11  _id = 0;
12 
13  _type = ParticleFlowElement::PFLOWTYPE::UNASSIGNED;
14 }
15 
16 void ParticleFlowElementv1::identify(std::ostream& os) const
17 {
18  os << "-- ParticleFlowElement v1 : ";
19  os << " id: " << get_id() << ", type: " << get_type() << ",";
20  os << " (px, py, pz, e) = (" << get_px() << ", " << get_py() << ", ";
21  os << get_pz() << ", " << get_e() << ") GeV" << std::endl;
22 
23  return;
24 }
25 
27 {
28  for (int i = 0; i < 3; ++i) _mom[i] = NAN;
29  _e = NAN;
30 }
31 
33 {
34  for (int i = 0; i < 3; ++i)
35  {
36  if (std::isnan(_mom[i])) return 0;
37  }
38  if (std::isnan(_e)) return 0;
39 
40  return 1;
41 }
42 
44 {
45  return sqrt(get_px() * get_px() + get_py() * get_py() + get_pz() * get_pz());
46 }
47 
49 {
50  return sqrt(get_px() * get_px() + get_py() * get_py());
51 }
52 
54 {
55  return get_pt() / get_p() * get_e();
56 }
57 
59 {
60  return asinh(get_pz() / get_pt());
61 }
62 
64 {
65  return atan2(get_py(), get_px());
66 }
67 
69 {
70 
71  return sqrt( get_e() * get_e() - get_px() * get_px() + get_py() * get_py() + get_pz() * get_pz() );
72 
73 }
74