ATLAS Offline Software
ForwardTracker/src/Particle.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 #include <sstream>
9 #include <cmath>
10 #include <iomanip>
11 #include <iostream>
12 
13 namespace ForwardTracker {
14 
16  m_position (0., 0., 0.),
17  m_momentum (0),
18  m_charged (false),
19  m_direction (Point(0., 0., 0.)),
20  m_outOfAperture(false),
21  m_debug (false)
22  {}
23 
24  Particle::Particle(double x, double y, double z, double px, double py, double pz, bool charged):
25  m_position (x, y, z),
26  m_momentum (std::sqrt(px*px + py*py + pz*pz)),
27  m_charged (charged),
28  m_direction (Point(px/m_momentum, py/m_momentum, pz/m_momentum)),
29  m_outOfAperture(m_position.perp2() > ForwardTrackerConstants::beamPipeRadius2 ? true : false),
30  m_debug (false)
31  {}
32 
33  std::string Particle::str() const {
34 
35  std::ostringstream ost;
36 
37  ost << " pos" << m_position
38  << " dir" << m_direction
39  << " mom " << m_momentum
40  << " prb" << this->positionRelBeam()
41  << " q " << m_charged
42  << " lost " << m_outOfAperture;
43 
44  if (not m_msg.empty()) ost << "\n msg " << m_msg;
45 
46  return ost.str();
47  }
48 }
ForwardTracker::Particle::m_outOfAperture
bool m_outOfAperture
Definition: ForwardDetectors/ForwardTracker/ForwardTracker/Particle.h:59
python.trigbs_prescaleL1.ost
ost
Definition: trigbs_prescaleL1.py:104
test_pyathena.px
px
Definition: test_pyathena.py:18
ForwardTracker::Particle::Particle
Particle()
Definition: ForwardTracker/src/Particle.cxx:15
Particle.h
ForwardTracker::Particle::m_momentum
double m_momentum
Definition: ForwardDetectors/ForwardTracker/ForwardTracker/Particle.h:56
ForwardTracker::Particle::m_direction
Point m_direction
Definition: ForwardDetectors/ForwardTracker/ForwardTracker/Particle.h:58
perp2
Scalar perp2() const
perp2 method - perpendicular length squared
Definition: AmgMatrixBasePlugin.h:36
x
#define x
ForwardTracker::Point
Definition: ForwardTracker/ForwardTracker/Point.h:15
ForwardTracker::Particle::positionRelBeam
Point positionRelBeam() const
Definition: ForwardDetectors/ForwardTracker/ForwardTracker/Particle.h:26
ForwardTracker::Particle::m_msg
std::string m_msg
Definition: ForwardDetectors/ForwardTracker/ForwardTracker/Particle.h:61
z
#define z
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
Amg::py
@ py
Definition: GeoPrimitives.h:39
ForwardTracker::Particle::m_charged
bool m_charged
Definition: ForwardDetectors/ForwardTracker/ForwardTracker/Particle.h:57
ForwardTracker::Particle::str
std::string str() const
Definition: ForwardTracker/src/Particle.cxx:33
ForwardTracker::ForwardTrackerConstants
Definition: ForwardTrackerConstants.h:15
y
#define y
ForwardTrackerConstants.h
ForwardTracker::Particle::m_position
Point m_position
Definition: ForwardDetectors/ForwardTracker/ForwardTracker/Particle.h:54
ForwardTracker
Definition: ForwardTracker/ForwardTracker/Beamline.h:12
CP::charged
@ charged
Definition: Reconstruction/PFlow/PFlowUtils/PFlowUtils/PFODefs.h:11