|
ATLAS Offline Software
|
Go to the documentation of this file.
32 const std::string&
name,
33 const IInterface*
parent ) :
41 "Name of the reference McEventCollection" );
45 "Name of the 'to-be-validated' TruthParticleContainer" );
49 "Tool to write the TruthParticleContainer into a "
69 ATH_MSG_ERROR(
"Could not configure the McAod writer tools !!");
70 return StatusCode::FAILURE;
73 return StatusCode::SUCCESS;
79 return StatusCode::SUCCESS;
87 nullptr == mcEvents ) {
90 return StatusCode::FAILURE;
99 nullptr == mcParts ) {
100 ATH_MSG_ERROR(
"Could not retrieve TruthParticleContainer at ["
102 return StatusCode::FAILURE;
115 if (
nullptr == mcEvents ) {
116 ATH_MSG_ERROR(
"NULL pointer to reference McEventCollection !!");
117 return StatusCode::FAILURE;
120 if (
nullptr == mcParts ) {
122 "TruthParticleContainer !!");
123 return StatusCode::FAILURE;
126 if ( mcEvents->
empty() ) {
128 return mcParts->
empty() ? StatusCode::SUCCESS : StatusCode::FAILURE;
131 const HepMC::GenEvent * genEvt = (*mcEvents)[0];
132 if (
nullptr == genEvt ) {
134 return StatusCode::FAILURE;
137 int particles_size=genEvt->particles_size();
138 if (
static_cast<int>( mcParts->
size() ) != particles_size ) {
139 ATH_MSG_ERROR(
"TruthParticleContainer and McEventCollection don't have "\
140 "the same number of particles !!" <<
endmsg
141 <<
"\tTruthParticleContainer: " << mcParts->
size() <<
endmsg
142 <<
"\tHepMC::GenEvent: " << particles_size);
143 return StatusCode::FAILURE;
147 ATH_MSG_WARNING(
"Could NOT write out the TruthParticleContainer through the IIOMcAodTool !!");
155 auto hepMc =
mc->genParticle();
157 if ( hepMc->momentum() != HepMC::FourVector(
mc->hlv().x(),
mc->hlv().y(),
mc->hlv().z(),
mc->hlv().t()) ) {
158 ATH_MSG_ERROR(
"TruthParticle and GenParticle-link don't have same 4-mom !!");
159 return StatusCode::FAILURE;
164 if ( hepMc->momentum() != genPart->momentum() ) {
165 ATH_MSG_ERROR(
"GenParticle-link and GenParticle from McEvtColl "\
166 "don't have same 4-mom !!");
167 return StatusCode::FAILURE;
172 return StatusCode::SUCCESS;
182 return StatusCode::FAILURE;
188 ATH_MSG_ERROR(
"Could not set property [" << prop.name() <<
"] for tool ["
192 return StatusCode::FAILURE;
194 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
Const iterator class for DataVector/DataList.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
#define ATH_MSG_VERBOSE(x)
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
GenParticle * barcode_to_particle(const GenEvent *e, int id)
::StatusCode StatusCode
StatusCode definition for legacy code.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
#define ATH_MSG_WARNING(x)
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.