#include <McAodWriterTool.h>
|
| static const InterfaceID & | interfaceID () |
| | Inline methods:
|
Definition at line 28 of file McAodWriterTool.h.
◆ StoreGateSvc_t
◆ McAodWriterTool() [1/2]
| McAodWriterTool::McAodWriterTool |
( |
const std::string & | type, |
|
|
const std::string & | name, |
|
|
const IInterface * | parent ) |
Constructor with parameters:
Public methods:
Constructors
Definition at line 41 of file McAodWriterTool.cxx.
43 :
46{
47
48
49
50
53 "Name of the back-end we'll use to write out the "
54 "TruthParticleContainer.\nEx: ascii:mcaod.txt" );
56 this );
57
60 "Input location of the TruthParticleContainer to write out" );
61
62 declareInterface<IIOMcAodTool>(this);
63}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
◆ ~McAodWriterTool()
| McAodWriterTool::~McAodWriterTool |
( |
| ) |
|
|
virtual |
◆ McAodWriterTool() [2/2]
| McAodWriterTool::McAodWriterTool |
( |
| ) |
|
|
protected |
◆ declareGaudiProperty()
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
158 {
161 hndl.documentation());
162
163 }
◆ declareProperty()
Definition at line 145 of file AthCommonDataStore.h.
145 {
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
◆ detStore()
◆ evtStore()
◆ execute()
| StatusCode McAodWriterTool::execute |
( |
| ) |
|
|
virtual |
Implements IIOMcAodTool.
Definition at line 105 of file McAodWriterTool.cxx.
106{
107
110 nullptr == mcParts ) {
113 return StatusCode::RECOVERABLE;
114 }
115
116 return write(mcParts);
117}
#define ATH_MSG_WARNING(x)
Athena::TPCnvVers::Current TruthParticleContainer
ServiceHandle< StoreGateSvc > & evtStore()
retrieve(aClass, aKey=None)
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ finalize()
| StatusCode McAodWriterTool::finalize |
( |
| ) |
|
|
virtual |
◆ initialize()
| StatusCode McAodWriterTool::initialize |
( |
| ) |
|
|
virtual |
Implements IIOMcAodTool.
Definition at line 79 of file McAodWriterTool.cxx.
80{
82
85 return StatusCode::FAILURE;
86 }
87
88
91 }
92
93 return StatusCode::SUCCESS;
94}
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
| const InterfaceID & IIOMcAodTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ msg()
◆ msgLvl()
| bool AthCommonMsg< AlgTool >::msgLvl |
( |
const MSG::Level | lvl | ) |
const |
|
inlineinherited |
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
Definition at line 380 of file AthCommonDataStore.h.
381 {
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
◆ renounceArray()
◆ setupBackend()
| void McAodWriterTool::setupBackend |
( |
Gaudi::Details::PropertyBase & | ioBackendURL | ) |
|
|
protected |
Method to configure the back-end to write out the TruthParticleContainer.
Definition at line 159 of file McAodWriterTool.cxx.
160{
161
162 std::string protocol = "ascii";
164
165
169 }
170
171
173
175
176 if ( std::string::npos != protocolPos ) {
177 protocol =
url.substr( 0, protocolPos );
178 fileName =
url.substr( protocolPos+1, std::string::npos );
179 } else {
180
182 }
183
184
185 std::transform( protocol.begin(), protocol.end(),
186 protocol.begin(),
187 ToLower() );
188
189 if ( "ascii" == protocol ) {
191 std::ios::out | std::ios::trunc );
192
193 } else {
195 << "Will use [ascii] instead...");
196 protocol = "ascii";
198 std::ios::out | std::ios::trunc );
199 }
200
201 ATH_MSG_DEBUG(
"Using protocol [" << protocol <<
"] and write to ["
202 << fileName << "]");
203}
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
Definition at line 308 of file AthCommonDataStore.h.
308 {
309
310
313 for (
auto k :
keys) {
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka
◆ write()
Process the TruthParticleContainer through the I/O backend.
Non-const methods:
Definition at line 123 of file McAodWriterTool.cxx.
124{
125 if ( nullptr == mcParts ) {
127 return StatusCode::RECOVERABLE;
128 }
129
132
133 out <<
"---" << std::setw(5) << mcParts->
size() << std::endl;
134 for (
unsigned int i = 0;
i != mcParts->
size(); ++
i ) {
136 out <<
"P " << std::setprecision(3) << std::setw(10) <<
mc->px()
137 <<
" " << std::setprecision(3) << std::setw(10) <<
mc->py()
138 <<
" " << std::setprecision(3) << std::setw(10) <<
mc->pz()
139 <<
" " << std::setprecision(3) << std::setw(10) <<
mc->e()
140 <<
" " << std::setprecision(3) << std::setw(10) <<
mc->pdgId()
141 <<
" " << std::setprecision(3) << std::setw(10) <<
mc->charge()
142 <<
" " << std::setprecision(3) << std::setw(10) <<
HepMC::barcode(
mc->genParticle())
143 << std::endl;
146 << " : ";
147 for ( unsigned int iCone = 0;
149 ++iCone ) {
150 out <<
" " << std::setprecision(3) << std::setw(10)
152 }
154 }
155
156 return StatusCode::SUCCESS;
157}
size_type size() const noexcept
Returns the number of elements in the collection.
ConeSize
Enum for Cone size indexes (for isolation)
TruthParticle_v1 TruthParticle
Typedef to implementation.
◆ m_detStore
◆ m_evtStore
◆ m_ioBackend
| std::ofstream* McAodWriterTool::m_ioBackend |
|
protected |
◆ m_ioBackendURL
| StringProperty McAodWriterTool::m_ioBackendURL |
|
protected |
URL of the I/O back-end (only "ASCII" for now...) glued with the name of the output file name.
Ex: "ascii:/home/foo/mcaod.txt" If no protocol separator ':' is found, fallback is "ASCII"
Definition at line 88 of file McAodWriterTool.h.
◆ m_truthParticlesName
| StringProperty McAodWriterTool::m_truthParticlesName |
|
protected |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files: