ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
TruthParticleID
McParticleEvent
src
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
19
#include "
McParticleEvent/TruthParticleBase.h
"
20
22
// Public methods:
24
25
// Constructors
27
28
TruthParticleBase::TruthParticleBase
() :
29
m_charge
( -999. ),
30
m_genParticle
( 0 ),
31
m_abc
()
32
{}
33
34
TruthParticleBase::TruthParticleBase
(
const
TruthParticleBase
& rhs ) :
35
m_charge
( rhs.
m_charge
),
36
m_genParticle
( rhs.
m_genParticle
),
37
m_abc
( rhs.
m_abc
)
38
{}
39
40
TruthParticleBase
&
41
TruthParticleBase::operator=
(
const
TruthParticleBase
& rhs )
42
{
43
if
(
this
!= &rhs ) {
44
m_charge
= rhs.
m_charge
;
45
m_genParticle
= rhs.
m_genParticle
;
46
m_abc
= rhs.
m_abc
;
47
}
48
return
*
this
;
49
}
50
51
TruthParticleBase::TruthParticleBase
(
const
HepMC::GenParticlePtr
mc
) :
52
m_charge
( -999. ),
53
m_genParticle
(
mc
),
54
m_abc
()
55
{}
56
57
58
// Destructor
60
61
TruthParticleBase::~TruthParticleBase
()
62
{}
63
65
// Const methods:
67
68
const
Trk::RecVertex
*
69
TruthParticleBase::origin
()
const
70
{
71
return
0;
72
}
73
75
const
ElementLink<VxContainer>
&
76
TruthParticleBase::originLink
()
const
77
{
78
static
const
ElementLink<VxContainer>
origin
;
79
return
origin
;
80
}
81
82
83
std::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
110
std::ostream&
operator<<
( std::ostream& out,
const
TruthParticleBase
& o )
111
{
112
return
o.
dump
( out );
113
}
operator<<
std::ostream & operator<<(std::ostream &out, const TruthParticleBase &o)
Definition
TruthParticleBase.cxx:110
TruthParticleBase.h
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
Trk::RecVertex
Trk::RecVertex inherits from Trk::Vertex.
Definition
RecVertex.h:44
TruthParticleBase
Definition
TruthParticleBase.h:34
TruthParticleBase::hasPdgId
bool hasPdgId() const
method to check if particle id information is available
Definition
TruthParticleBase.h:168
TruthParticleBase::dataType
ParticleDataType::DataType dataType() const
Return enum indicating real data, fast, or full simulation Return Type has a DataType enum with the f...
Definition
TruthParticleBase.h:150
TruthParticleBase::m_genParticle
HepMC::ConstGenParticlePtr m_genParticle
The HepMC::GenParticle we are proxying.
Definition
TruthParticleBase.h:137
TruthParticleBase::originLink
const ElementLink< VxContainer > & originLink() const
Return the ElementLink to particle Origin.
Definition
TruthParticleBase.cxx:76
TruthParticleBase::m_abc
AthenaBarCodeImpl m_abc
The AthenaBarCodeImpl held to provide unique identification throughout the whole Atlas EDM.
Definition
TruthParticleBase.h:141
TruthParticleBase::m_charge
ChargeType m_charge
The charge of this TruthParticle.
Definition
TruthParticleBase.h:134
TruthParticleBase::pdgId
int pdgId() const
Return eparticle id.
Definition
TruthParticleBase.h:174
TruthParticleBase::hasCharge
bool hasCharge() const
method to check if charge information is available
Definition
TruthParticleBase.h:156
TruthParticleBase::operator=
TruthParticleBase & operator=(const TruthParticleBase &rhs)
Assignment operator:
Definition
TruthParticleBase.cxx:41
TruthParticleBase::origin
const Trk::RecVertex * origin() const
Return a RecVertex corresponding to particle Origin.
Definition
TruthParticleBase.cxx:69
TruthParticleBase::dump
std::ostream & dump(std::ostream &out) const
Print IParticle content.
Definition
TruthParticleBase.cxx:83
TruthParticleBase::charge
ChargeType charge() const
returns charge as a typedef ChargeType currently Charge Type is a double for jets this may be changed...
Definition
TruthParticleBase.h:162
TruthParticleBase::TruthParticleBase
TruthParticleBase()
Default constructor:
Definition
TruthParticleBase.cxx:28
TruthParticleBase::~TruthParticleBase
~TruthParticleBase()
Destructor:
Definition
TruthParticleBase.cxx:61
HepMC::GenParticlePtr
HepMC3::GenParticlePtr GenParticlePtr
Definition
GenParticle.h:19
mc
Definition
mc.Ep4_simple_OO.py:1
Generated on
for ATLAS Offline Software by
1.17.0