17#include "Gaudi/Property.h"
20#include "CLHEP/Units/SystemOfUnits.h"
41 ISvcLocator* pSvcLocator ) :
52 "List of validation tools to be ran on the events" );
54 m_valTools.push_back(
"GenAodValidationTool/GenAodValidation" );
55 m_valTools.push_back(
"SpclMcValidationTool/SpclMcValidation" );
59 "Name of the TruthParticleContainer to be read" );
63 "Seed for the STL random generator" );
79 (
"Initializing pseudo-random generator..."
87 (
"Could not retrieve McAod validation tools !!" <<
endmsg
89 return StatusCode::FAILURE;
92 return StatusCode::SUCCESS;
100 (
"==> Finalizing validation AlgTools (" <<
m_valTools.size() <<
")...");
102 for ( IValidationTools_t::iterator
107 ATH_MSG_INFO (
"-> finalizing [" << iTool->typeAndName() <<
"]:");
108 if ( (*iTool)->finalize().isFailure() ) {
110 (
"Could not finalize validation tool ["
111 << iTool->typeAndName() <<
"] !!");
116 (
"==> Finalizing validation AlgTools (" <<
m_valTools.size()
118 return StatusCode::SUCCESS;
125 const double random = std::rand() * 1.;
132 (
"Could not retrieve the TruthParticleContainer at ["
134 return StatusCode::FAILURE;
143 (
"Could not retrieve the (auto-symlinked) DV<INav4Mom> at ["
147 (
"Successfully exercised the auto-symlink feature "\
148 "with [DV<INavigable4MomentumCollection>]");
158 (
"Could not retrieve the (auto-symlinked) DV<IP> at ["
162 (
"Successfully exercised the auto-symlink feature with [DV<IParticle>]");
172 (
"Could not retrieve the (auto-symlinked) IPC at ["
176 (
"Successfully exercised the auto-symlink feature "\
177 "with [IParticleContainer]");
183 itr != mcParts->
end();
190 bool validationIsOK =
true;
191 ATH_MSG_DEBUG (
"Checking the event with the validation AlgTools...");
193 for ( IValidationTools_t::iterator
198 ATH_MSG_DEBUG (
"\tvalidation with [" << iTool->typeAndName() <<
"]...");
199 if ( !(*iTool)->execute().isSuccess() ) {
201 (
"Event FAILED validation criteria of ["
202 << iTool->typeAndName() <<
"] !!");
203 validationIsOK =
false;
207 if ( !validationIsOK ) {
209 return StatusCode::FAILURE;
212 return StatusCode::SUCCESS;
#define ATH_MSG_WARNING(x)
DataVector< IParticle > IParticleContainer
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
virtual StatusCode initialize()
Athena Algorithm's Hooks.
virtual ~McAodValidationAlg()
Destructor:
unsigned int m_seed
Random generator seed.
virtual StatusCode finalize()
IValidationTools_t m_valTools
Validation tools to be ran on the events.
McAodValidationAlg()
Default constructor:
virtual StatusCode execute()
StringProperty m_truthParticlesName
Location of the TruthParticleContainer to read.
(HepMC) Monte Carlo particle.