13#include "Gaudi/Property.h"
16#include "CLHEP/Units/SystemOfUnits.h"
42 ISvcLocator* pSvcLocator ) :
53 "List of validation tools to be ran on the events" );
55 m_valTools.push_back(
"GenAodValidationTool/GenAodValidation" );
56 m_valTools.push_back(
"SpclMcValidationTool/SpclMcValidation" );
60 "Name of the TruthParticleContainer to be read" );
64 "Seed for the STL random generator" );
80 (
"Initializing pseudo-random generator..."
88 (
"Could not retrieve McAod validation tools !!" <<
endmsg
90 return StatusCode::FAILURE;
93 return StatusCode::SUCCESS;
101 (
"==> Finalizing validation AlgTools (" <<
m_valTools.size() <<
")...");
103 for ( IValidationTools_t::iterator
108 ATH_MSG_INFO (
"-> finalizing [" << iTool->typeAndName() <<
"]:");
109 if ( (*iTool)->finalize().isFailure() ) {
111 (
"Could not finalize validation tool ["
112 << iTool->typeAndName() <<
"] !!");
117 (
"==> Finalizing validation AlgTools (" <<
m_valTools.size()
119 return StatusCode::SUCCESS;
127 const double random = std::rand() * 1.;
134 (
"Could not retrieve the TruthParticleContainer at ["
136 return StatusCode::FAILURE;
145 (
"Could not retrieve the (auto-symlinked) DV<INav4Mom> at ["
149 (
"Successfully exercised the auto-symlink feature "\
150 "with [DV<INavigable4MomentumCollection>]");
160 (
"Could not retrieve the (auto-symlinked) DV<IP> at ["
164 (
"Successfully exercised the auto-symlink feature with [DV<IParticle>]");
174 (
"Could not retrieve the (auto-symlinked) IPC at ["
178 (
"Successfully exercised the auto-symlink feature "\
179 "with [IParticleContainer]");
185 itr != mcParts->
end();
192 bool validationIsOK =
true;
193 ATH_MSG_DEBUG (
"Checking the event with the validation AlgTools...");
195 for ( IValidationTools_t::iterator
200 ATH_MSG_DEBUG (
"\tvalidation with [" << iTool->typeAndName() <<
"]...");
201 if ( !(*iTool)->execute().isSuccess() ) {
203 (
"Event FAILED validation criteria of ["
204 << iTool->typeAndName() <<
"] !!");
205 validationIsOK =
false;
209 if ( !validationIsOK ) {
211 return StatusCode::FAILURE;
214 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 ~McAodValidationAlg()
Destructor:
unsigned int m_seed
Random generator seed.
IValidationTools_t m_valTools
Validation tools to be ran on the events.
McAodValidationAlg()
Default constructor:
virtual StatusCode finalize() override
virtual StatusCode initialize() override
Athena Algorithm's Hooks.
virtual StatusCode execute() override
StringProperty m_truthParticlesName
Location of the TruthParticleContainer to read.
(HepMC) Monte Carlo particle.