ATLAS Offline Software
Loading...
Searching...
No Matches
Base.cxx
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7// Base.cxx
8// Implementation file for class Base
9// Author: S.Binet<binet@cern.ch>
11
12
13// STL includes
14#include <ostream>
15#include <sstream>
16#include <iomanip>
17
18// ParticleEvent includes
20
21namespace ParticleEvent {
22
24// Public methods:
26
27// Constructors
29
30// Destructor
32
34// Const methods:
36
37const ElementLink<VxContainer>&
39{
40 return m_origin;
41}
42
43std::ostream&
44Base::dump( std::ostream& out ) const
45{
46 std::stringstream buf;
47 buf << "[dataType] = " << this->dataType() << "\n"
48
49 << "[charge ] = "
50 << std::setw(5) << std::boolalpha << this->hasCharge()
51 << std::scientific << std::right << std::setw(16) << std::setprecision(8)
52 << this->charge() << "\n"
53
54 << "[pdg-Id ] = " << std::setw(5) << std::boolalpha << this->hasPdgId()
55 << std::fixed << std::right << std::setw(16) << std::setprecision(8)
56 << this->pdgId() << "\n"
57
58 << "[origin ] = ";
59 if ( this->origin() ) { this->origin()->dump( buf );
60 } else { buf << " --Null ptr-- ";
61 }
62
63 this->getAthenaBarCodeImpl().dump(buf);
64
65 return out << buf.str();
66}
67
69// I/O functions
71std::ostream& operator<<( std::ostream& out, const Base& o )
72{
73 return o.dump( out );
74}
75
76} //> end namespace ParticleEvent
std::ostream & dump(std::ostream &out) const
bool hasCharge() const
method to check if charge information is available
Definition Base.h:218
ParticleDataType::DataType dataType() const
Return enum indicating real data, fast, or full simulation Return Type has a DataType enum with the f...
Definition Base.h:204
std::ostream & dump(std::ostream &out) const
Print IParticle content.
Definition Base.cxx:44
const AthenaBarCodeImpl & getAthenaBarCodeImpl() const
Definition Base.h:96
const Trk::RecVertex * origin() const
Return a RecVertex corresponding to particle Origin.
Definition Base.h:210
const ElementLink< VxContainer > & originLink() const
Return the ElementLink to particle Origin.
Definition Base.cxx:38
ElementLink< VxContainer > m_origin
Persistent pointer to the origin of this particle.
Definition Base.h:127
bool hasPdgId() const
method to check if particle id information is available
Definition Base.h:230
int pdgId() const
Return enum indicating particle id the enum file is available in Event/EventKernel/PdtPdg....
Definition Base.h:236
ChargeType charge() const
returns charge as a typedef ChargeType currently Charge Type is a double for jets this may be changed...
Definition Base.h:224
virtual MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.
Definition RecVertex.cxx:46
std::ostream & operator<<(std::ostream &out, const Base &base)
Definition Base.cxx:71