ATLAS Offline Software
Base.cxx
Go to the documentation of this file.
1 
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
19 #include "ParticleEvent/Lib/Base.h"
20 
21 namespace ParticleEvent {
22 
24 // Public methods:
26 
27 // Constructors
29 
30 // Destructor
32 
34 // Const methods:
36 
39 {
40  return m_origin;
41 }
42 
43 std::ostream&
44 Base::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
71 std::ostream& operator<<( std::ostream& out, const Base& o )
72 {
73  return o.dump( out );
74 }
75 
76 } //> end namespace ParticleEvent
ParticleEvent
Definition: Base.h:31
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
ParticleEvent::Base::hasCharge
bool hasCharge() const
method to check if charge information is available
Definition: Base.h:218
ParticleEvent::Base::charge
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
ParticleEvent::Base::m_origin
ElementLink< VxContainer > m_origin
Persistent pointer to the origin of this particle.
Definition: Base.h:127
Base.h
ParticleEvent::Base::pdgId
int pdgId() const
Return enum indicating particle id the enum file is available in Event/EventKernel/PdtPdg....
Definition: Base.h:236
ParticleEvent::Base
Definition: Base.h:34
Trk::RecVertex::dump
virtual MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.
Definition: RecVertex.cxx:56
ParticleEvent::Base::getAthenaBarCodeImpl
const AthenaBarCodeImpl & getAthenaBarCodeImpl() const
Definition: Base.h:96
ParticleEvent::Base::hasPdgId
bool hasPdgId() const
method to check if particle id information is available
Definition: Base.h:230
ParticleEvent::operator<<
std::ostream & operator<<(std::ostream &out, const Base &base)
Definition: Base.cxx:71
ParticleEvent::Base::dataType
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
ParticleEvent::Base::dump
std::ostream & dump(std::ostream &out) const
Print IParticle content.
Definition: Base.cxx:44
AthenaBarCodeImpl::dump
std::ostream & dump(std::ostream &out) const
Definition: AthenaBarCodeImpl.cxx:172
ParticleEvent::Base::origin
const Trk::RecVertex * origin() const
Return a RecVertex corresponding to particle Origin
Definition: Base.h:210
ParticleEvent::Base::originLink
const ElementLink< VxContainer > & originLink() const
Return the ElementLink to particle Origin
Definition: Base.cxx:38