Skip to content
Snippets Groups Projects

ISFTruthIncident / ISF_Fatras - Improve robustness + fix warnings

Merged John Derek Chapman requested to merge jchapman/athena:FixISFTruthIncident_main into main
1 file
+ 26
19
Compare changes
  • Side-by-side
  • Inline
@@ -11,7 +11,7 @@
#include "ISF_Event/ISFParticle.h"
#include "ISF_Event/ISFTruthIncident.h"
#include "ISF_Interfaces/ITruthSvc.h"
#include "TruthUtils/MagicNumbers.h"
#include "TruthUtils/HepMCHelpers.h"
// iFatras
#include "ISF_FatrasInterfaces/IHadronicInteractionProcessor.h"
#include "ISF_FatrasInterfaces/IPhysicsValidationTool.h"
@@ -258,27 +258,28 @@ ISF::ISFParticleVector iFatras::ProcessSamplingTool::interact(const ISF::ISFPar
// double cTh = 1.-fmin/(1.-fr)/fr;
// first implementation: ctH=1
const int status = 1 + HepMC::SIM_STATUS_THRESHOLD;
const int id = HepMC::UNDEFINED_ID; // This will be set if the child particle is saved to the GenEvent
ISF::ISFParticle* child1 = new ISF::ISFParticle( position,
fr*momentum,
0.,
0.,
22,
1 + HepMC::SIM_STATUS_THRESHOLD,
eCell.time,
*parent,
0 // FIXME hard-coded id
fr*momentum,
0.,
0.,
MC::PHOTON,
status,
eCell.time,
*parent,
id
);
ISF::ISFParticle* child2 = new ISF::ISFParticle( position,
(1-fr)*momentum,
0.,
0.,
22,
1 + HepMC::SIM_STATUS_THRESHOLD,
eCell.time,
*parent,
0 // FIXME hard-coded id
(1-fr)*momentum,
0.,
0.,
MC::PHOTON,
status,
eCell.time,
*parent,
id
);
childVector.push_back(child1);
@@ -323,7 +324,8 @@ ISF::ISFParticleVector iFatras::ProcessSamplingTool::interact(const ISF::ISFPar
ISF::fKillsPrimary );
m_truthRecordSvc->registerTruthIncident( truth);
//Make sure the conversion products get a chance to have correct truth info before pushing into the particle broker
// Make sure the conversion products get a chance to have correct truth info before pushing into the particle broker
// FIXME Check this doesn't cause problems in the TruthSvc
for (unsigned int i=0; i<childVector.size(); i++) {
if (!childVector[i]->getTruthBinding()) {
childVector[i]->setTruthBinding(new ISF::TruthBinding(*parent->getTruthBinding()));
@@ -393,8 +395,13 @@ ISF::ISFParticleVector iFatras::ProcessSamplingTool::interact(const ISF::ISFPar
parent->nextGeoID(), // inherits from the parent
ISF::fKillsPrimary );
m_truthRecordSvc->registerTruthIncident( truth);
// At this point we need to update the properties of the
// ISFParticles produced in the interaction
truth.updateParentAfterIncidentProperties();
truth.updateChildParticleProperties();
//Make sure the conversion products get a chance to have correct truth info before pushing into the particle broker
// FIXME check this doesn't cause problems later
for (unsigned int i=0; i<childVector.size(); i++) {
if (!childVector[i]->getTruthBinding()) {
childVector[i]->setTruthBinding(new ISF::TruthBinding(*parent->getTruthBinding()));
Loading