16#include "Gaudi/Property.h"
17#include "GaudiKernel/SystemOfUnits.h"
24#include "AthLinks/ElementLinkVector.h"
42 ISvcLocator* pSvcLocator ) :
52 "Output location of the particles" );
56 "Number of particles to create" );
60 "Output location of a 2-body decay" );
64 "Output location of an Elephantino with 4 legs" );
68 "list of test-names to create data for "
69 "(default: test1,test2,test3)" );
86 return StatusCode::SUCCESS;
92 return StatusCode::SUCCESS;
99 for ( std::vector<std::string>::const_iterator
105 if ( !
makeData(*itr).isSuccess() ) {
107 return StatusCode::FAILURE;
111 return StatusCode::SUCCESS;
116 const std::string testName =
"_"+test;
121 if ( !
evtStore()->record(particles, particlesOutputName).isSuccess() ) {
122 ATH_MSG_ERROR(
"Could not store particles at [{}]", particlesOutputName);
125 return StatusCode::RECOVERABLE;
127 if ( !
evtStore()->setConst(particles).isSuccess() ) {
128 ATH_MSG_WARNING(
"Could not setConst particles at [{}]", particlesOutputName);
133 (i+1) * 10. * Gaudi::Units::GeV,
134 (i+1) * 10. * Gaudi::Units::GeV,
135 (i+2) * 10. * Gaudi::Units::GeV );
136 particles->push_back(p);
140 particles->size(),
static_cast<void*
>(particles));
145 if ( !
evtStore()->record(dcy, decayOutputName).isSuccess() ) {
146 ATH_MSG_ERROR(
"Could not store Decay at [{}] !!", decayOutputName);
149 return StatusCode::RECOVERABLE;
151 if ( !
evtStore()->setConst(dcy).isSuccess() ) {
155 if ( particles->size() < 5 ) {
157 return StatusCode::RECOVERABLE;
173 const double igev = 1. / Gaudi::Units::GeV;
184 if ( !
evtStore()->record(eleph, elephantinoOutputName).isSuccess() ) {
185 ATH_MSG_ERROR(
"Could not store Elephantino at [{}] !!", elephantinoOutputName);
188 return StatusCode::RECOVERABLE;
190 if ( !
evtStore()->setConst(eleph).isSuccess() ) {
191 ATH_MSG_WARNING(
"Could not setConst Elephantino at [{}]", elephantinoOutputName);
195 if ( !
evtStore()->retrieve( iparticles, particlesOutputName).isSuccess() ||
197 ATH_MSG_WARNING(
"Could not retrieve the (symlinked) AthExIParticles at [{}] !!",
198 particlesOutputName);
199 return StatusCode::RECOVERABLE;
202 if ( iparticles->
size() < 9 ) {
204 return StatusCode::RECOVERABLE;
210 if ( iparticles->
size() != particles->size() ) {
214 ATH_MSG_ERROR(
" @iparticles: {}",
static_cast<const void*
>(iparticles));
215 ATH_MSG_ERROR(
" @particles: {}",
static_cast<const void*
>(particles));
217 return StatusCode::FAILURE;
228 eleph->
setLegs( ip1, ip2, ip3, ip4 );
242 return StatusCode::SUCCESS;
DataVector< AthExIParticle > AthExIParticles
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(x,...)
An STL vector of pointers that by default owns its pointed-to elements.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
const AthExParticle * l1() const
const AthExParticle * l2() const
void setDecay(const ElementLink< AthExParticles > &p1, const ElementLink< AthExParticles > &p2, const ElementLink< AthExParticles > &l1, const ElementLink< AthExParticles > &l2)
const AthExParticle * p1() const
const AthExParticle * p2() const
object with 4 legs, so it is best modeled with a vector of ElementLink.
void setEars(const ElementLink< AthExIParticles > &e1, const ElementLink< AthExIParticles > &e4)
const AthExIParticle * ear1() const
const AthExIParticle * leg4() const
const AthExIParticle * leg3() const
const AthExIParticle * leg1() const
const AthExIParticle * leg2() const
void setLegs(const ElementLink< AthExIParticles > &p1, const ElementLink< AthExIParticles > &p2, const ElementLink< AthExIParticles > &p3, const ElementLink< AthExIParticles > &p4)
const AthExIParticle * ear2() const
virtual double px() const =0
AthExIParticle interface.
virtual double px() const
Implementation of the AthExIParticle interface.
StringProperty m_particlesOutputName
Particles output location.
StringProperty m_decayOutputName
Decay object output location.
virtual StatusCode execute(const EventContext &ctx)
Execute method.
StatusCode makeData(const std::string &testName)
make data for a test
virtual StatusCode finalize()
virtual ~CreateData()
Destructor:
virtual StatusCode initialize()
UnsignedIntegerProperty m_nbrParticles
Number of particles to generate.
CreateData()
Default constructor:
std::vector< std::string > m_testNames
list of test-names to create data for (default: test1,test2,test3)
StringProperty m_elephantinoOutputName
Elephantino object output location.
size_type size() const noexcept
Returns the number of elements in the collection.
ElementLink implementation for ROOT usage.