ATLAS Offline Software
Loading...
Searching...
No Matches
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
13namespace 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)),
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}
Scalar perp2() const
perp2 method - perpendicular length squared
#define y
#define x
STL namespace.