ATLAS Offline Software
Loading...
Searching...
No Matches
TruthParticleBase.cxx
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5*/
6
7// TruthParticleBase.cxx
8// Implementation file for class TruthParticleBase
9// Author: S.Binet<binet@cern.ch>
11
12
13// STL includes
14#include <ostream>
15#include <sstream>
16#include <iomanip>
17
18// McParticleEvent includes
20
22// Public methods:
24
25// Constructors
27
33
39
42{
43 if ( this != &rhs ) {
44 m_charge = rhs.m_charge;
46 m_abc = rhs.m_abc;
47 }
48 return *this;
49}
50
56
57
58// Destructor
60
63
65// Const methods:
67
68const Trk::RecVertex*
70{
71 return 0;
72}
73
77{
79 return origin;
80}
81
82
83std::ostream& TruthParticleBase::dump( std::ostream& out ) const
84{
85 std::stringstream buf;
86 buf << "[dataType] = " << this->dataType() << "\n"
87
88 << "[charge ] = "
89 << std::setw(5) << std::boolalpha << this->hasCharge()
90 << std::scientific << std::right << std::setw(16) << std::setprecision(8)
91 << this->charge() << "\n"
92
93 << "[pdg-Id ] = " << std::setw(5) << std::boolalpha << this->hasPdgId()
94 << std::fixed << std::right << std::setw(16) << std::setprecision(8)
95 << this->pdgId() << "\n"
96
97 << "[origin ] = --Null ptr-- ";
98
99 out << buf.str();
100
101 //Dump the AthenaBarCode Part
102 m_abc.dump(out);
103
104 return out;
105}
106
108// I/O functions
110std::ostream& operator<<( std::ostream& out, const TruthParticleBase& o )
111{
112 return o.dump( out );
113}
std::ostream & operator<<(std::ostream &out, const TruthParticleBase &o)
Trk::RecVertex inherits from Trk::Vertex.
Definition RecVertex.h:44
bool hasPdgId() const
method to check if particle id information is available
ParticleDataType::DataType dataType() const
Return enum indicating real data, fast, or full simulation Return Type has a DataType enum with the f...
HepMC::ConstGenParticlePtr m_genParticle
The HepMC::GenParticle we are proxying.
const ElementLink< VxContainer > & originLink() const
Return the ElementLink to particle Origin.
AthenaBarCodeImpl m_abc
The AthenaBarCodeImpl held to provide unique identification throughout the whole Atlas EDM.
ChargeType m_charge
The charge of this TruthParticle.
int pdgId() const
Return eparticle id.
bool hasCharge() const
method to check if charge information is available
TruthParticleBase & operator=(const TruthParticleBase &rhs)
Assignment operator:
const Trk::RecVertex * origin() const
Return a RecVertex corresponding to particle Origin.
std::ostream & dump(std::ostream &out) const
Print IParticle content.
ChargeType charge() const
returns charge as a typedef ChargeType currently Charge Type is a double for jets this may be changed...
TruthParticleBase()
Default constructor:
~TruthParticleBase()
Destructor:
GenParticle * GenParticlePtr
Definition GenParticle.h:37