Commit 0a544cbc authored by Rachid Mazini's avatar Rachid Mazini
Browse files

Merge branch 'mpt_addTruthRecord' into '21.0'

Add truth incident to FCS muon punch through sim

See merge request !43301
parents c018055a 93f8fa84
...@@ -39,7 +39,7 @@ namespace ISF { ...@@ -39,7 +39,7 @@ namespace ISF {
virtual ~ITruthSvc() { } virtual ~ITruthSvc() { }
/** Register a truth incident */ /** Register a truth incident */
virtual void registerTruthIncident( ITruthIncident& truthincident) const = 0; virtual void registerTruthIncident( ITruthIncident& truthincident, bool saveAllChildren=false) const = 0;
/** Initialize the Truth Svc at the beginning of each event */ /** Initialize the Truth Svc at the beginning of each event */
virtual StatusCode initializeTruthCollection() = 0; virtual StatusCode initializeTruthCollection() = 0;
......
...@@ -155,10 +155,11 @@ StatusCode ISF::TruthSvc::releaseEvent() { ...@@ -155,10 +155,11 @@ StatusCode ISF::TruthSvc::releaseEvent() {
/** Register a truth incident */ /** Register a truth incident */
void ISF::TruthSvc::registerTruthIncident( ISF::ITruthIncident& ti) const { void ISF::TruthSvc::registerTruthIncident( ISF::ITruthIncident& ti, bool saveAllChildren) const {
const bool passWholeVertex = m_passWholeVertex || saveAllChildren;
// pass whole vertex or individual child particles // pass whole vertex or individual child particles
ti.setPassWholeVertices(m_passWholeVertex); ti.setPassWholeVertices(passWholeVertex);
// the GeoID // the GeoID
AtlasDetDescr::AtlasRegion geoID = ti.geoID(); AtlasDetDescr::AtlasRegion geoID = ti.geoID();
...@@ -201,7 +202,7 @@ void ISF::TruthSvc::registerTruthIncident( ISF::ITruthIncident& ti) const { ...@@ -201,7 +202,7 @@ void ISF::TruthSvc::registerTruthIncident( ISF::ITruthIncident& ti) const {
ATH_MSG_VERBOSE("At least one TruthStrategy passed."); ATH_MSG_VERBOSE("At least one TruthStrategy passed.");
// at least one truth strategy returned true // at least one truth strategy returned true
// -> record incident // -> record incident
recordIncidentToMCTruth( ti); recordIncidentToMCTruth(ti, passWholeVertex);
} else { } else {
// none of the truth strategies returned true // none of the truth strategies returned true
...@@ -231,7 +232,7 @@ void ISF::TruthSvc::registerTruthIncident( ISF::ITruthIncident& ti) const { ...@@ -231,7 +232,7 @@ void ISF::TruthSvc::registerTruthIncident( ISF::ITruthIncident& ti) const {
} }
/** Record the given truth incident to the MC Truth */ /** Record the given truth incident to the MC Truth */
void ISF::TruthSvc::recordIncidentToMCTruth( ISF::ITruthIncident& ti) const { void ISF::TruthSvc::recordIncidentToMCTruth( ISF::ITruthIncident& ti, bool passWholeVertex) const {
#ifdef DEBUG_TRUTHSVC #ifdef DEBUG_TRUTHSVC
ATH_MSG_INFO("Starting recordIncidentToMCTruth(...)"); ATH_MSG_INFO("Starting recordIncidentToMCTruth(...)");
#endif #endif
...@@ -335,7 +336,7 @@ void ISF::TruthSvc::recordIncidentToMCTruth( ISF::ITruthIncident& ti) const { ...@@ -335,7 +336,7 @@ void ISF::TruthSvc::recordIncidentToMCTruth( ISF::ITruthIncident& ti) const {
std::vector<HepMC::GenParticle*> matchedChildParticles; std::vector<HepMC::GenParticle*> matchedChildParticles;
for ( unsigned short i=0; i<numSec; ++i) { for ( unsigned short i=0; i<numSec; ++i) {
bool writeOutChild = isQuasiStableVertex || m_passWholeVertex || ti.childPassedFilters(i); bool writeOutChild = isQuasiStableVertex || passWholeVertex || ti.childPassedFilters(i);
if (writeOutChild) { if (writeOutChild) {
HepMC::GenParticle *p = nullptr; HepMC::GenParticle *p = nullptr;
......
...@@ -76,7 +76,7 @@ namespace ISF { ...@@ -76,7 +76,7 @@ namespace ISF {
StatusCode finalize() override final; StatusCode finalize() override final;
/** Register a truth incident */ /** Register a truth incident */
void registerTruthIncident( ITruthIncident& truthincident) const override final; void registerTruthIncident( ITruthIncident& truthincident, bool saveAllChildren=false) const override final;
/** Initialize the Truth Svc at the beginning of each event */ /** Initialize the Truth Svc at the beginning of each event */
StatusCode initializeTruthCollection() override final; StatusCode initializeTruthCollection() override final;
...@@ -86,7 +86,7 @@ namespace ISF { ...@@ -86,7 +86,7 @@ namespace ISF {
private: private:
/** Record the given truth incident to the MC Truth */ /** Record the given truth incident to the MC Truth */
void recordIncidentToMCTruth( ITruthIncident& truthincident) const; void recordIncidentToMCTruth( ITruthIncident& truthincident, bool passWholeVertex) const;
/** Record and end vertex to the MC Truth for the parent particle */ /** Record and end vertex to the MC Truth for the parent particle */
HepMC::GenVertex *createGenVertexFromTruthIncident( ITruthIncident& truthincident, HepMC::GenVertex *createGenVertexFromTruthIncident( ITruthIncident& truthincident,
bool replaceExistingGenVertex=false) const; bool replaceExistingGenVertex=false) const;
......
...@@ -355,7 +355,7 @@ namespace ISFTesting { ...@@ -355,7 +355,7 @@ namespace ISFTesting {
.Times(1) .Times(1)
.WillOnce(::testing::Return(nullptr)); .WillOnce(::testing::Return(nullptr));
recordIncidentToMCTruth(ti); recordIncidentToMCTruth(ti,false);
HepMC::GenVertex* generated = anEvent->barcode_to_vertex(-2); //Find a nicer way to get this. HepMC::GenVertex* generated = anEvent->barcode_to_vertex(-2); //Find a nicer way to get this.
ASSERT_EQ( vtxPosition, generated->position() ); ASSERT_EQ( vtxPosition, generated->position() );
ASSERT_EQ( 1021, generated->id() ); ASSERT_EQ( 1021, generated->id() );
......
...@@ -10,36 +10,36 @@ ...@@ -10,36 +10,36 @@
// ISF includes // ISF includes
#include "ISF_Event/ISFParticle.h" #include "ISF_Event/ISFParticle.h"
#include "ISF_Event/ISFParticleContainer.h" #include "ISF_Event/ISFParticleVector.h"
namespace Trk{ namespace Trk{
class Track; class Track;
} }
namespace ISF { namespace ISF {
/** /**
@class IPunchThroughTool @class IPunchThroughTool
Interface for a tool which takes a ISF::ISFParticle as input Interface for a tool which takes a ISF::ISFParticle as input
and returns a vector of ISFParticles and returns a vector of ISFParticles
@author Elmar.Ritsch@cern.ch , Anna.Usanova@cern.ch @author Elmar.Ritsch@cern.ch , Anna.Usanova@cern.ch
*/ */
class IPunchThroughTool : virtual public IAlgTool { class IPunchThroughTool : virtual public IAlgTool {
public: public:
/** Virtual destructor */ /** Virtual destructor */
virtual ~IPunchThroughTool(){} virtual ~IPunchThroughTool(){}
/// Creates the InterfaceID and interfaceID() method /// Creates the InterfaceID and interfaceID() method
DeclareInterfaceID(IPunchThroughTool, 1, 0); DeclareInterfaceID(IPunchThroughTool, 1, 0);
/** Creates new vector of ISFParticle out of a given ISFParticle */ /** Creates new vector of ISFParticle out of a given ISFParticle */
virtual const ISF::ISFParticleContainer* computePunchThroughParticles(const ISFParticle& isfp ) const = 0; virtual const ISF::ISFParticleVector* computePunchThroughParticles(const ISFParticle& isfp ) const = 0;
}; };
} // end of namespace } // end of namespace
#endif #endif
...@@ -47,7 +47,7 @@ ISF::NativeFastCaloSimSvc::NativeFastCaloSimSvc(const std::string& name,ISvcLoca ...@@ -47,7 +47,7 @@ ISF::NativeFastCaloSimSvc::NativeFastCaloSimSvc(const std::string& name,ISvcLoca
m_theContainer(0), m_theContainer(0),
m_particleBroker ("ISF_ParticleBroker",name) m_particleBroker ("ISF_ParticleBroker",name)
{ {
// where to go // where to go
declareProperty("OwnPolicy", m_ownPolicy) ; declareProperty("OwnPolicy", m_ownPolicy) ;
declareProperty("CaloCellMakerTools_setup" , m_caloCellMakerTools_setup) ; declareProperty("CaloCellMakerTools_setup" , m_caloCellMakerTools_setup) ;
declareProperty("CaloCellMakerTools_simulate", m_caloCellMakerTools_simulate) ; declareProperty("CaloCellMakerTools_simulate", m_caloCellMakerTools_simulate) ;
...@@ -67,7 +67,7 @@ ISF::NativeFastCaloSimSvc::NativeFastCaloSimSvc(const std::string& name,ISvcLoca ...@@ -67,7 +67,7 @@ ISF::NativeFastCaloSimSvc::NativeFastCaloSimSvc(const std::string& name,ISvcLoca
"Run the FastShowerCellBuilders on the McTruth at the end of the event" ); "Run the FastShowerCellBuilders on the McTruth at the end of the event" );
} }
ISF::NativeFastCaloSimSvc::~NativeFastCaloSimSvc() ISF::NativeFastCaloSimSvc::~NativeFastCaloSimSvc()
{} {}
/** framework methods */ /** framework methods */
...@@ -76,19 +76,19 @@ StatusCode ISF::NativeFastCaloSimSvc::initialize() ...@@ -76,19 +76,19 @@ StatusCode ISF::NativeFastCaloSimSvc::initialize()
ATH_MSG_INFO ( m_screenOutputPrefix << "Initializing ..."); ATH_MSG_INFO ( m_screenOutputPrefix << "Initializing ...");
// access tools and store them // access tools and store them
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_setup).isFailure() ) if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_setup).isFailure() )
return StatusCode::FAILURE; return StatusCode::FAILURE;
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_simulate).isFailure() ) if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_simulate).isFailure() )
return StatusCode::FAILURE; return StatusCode::FAILURE;
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_release).isFailure() ) if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_release).isFailure() )
return StatusCode::FAILURE; return StatusCode::FAILURE;
if (m_doPunchThrough && m_punchThroughTool.retrieve().isFailure() ) if (m_doPunchThrough && m_punchThroughTool.retrieve().isFailure() )
{ {
ATH_MSG_ERROR (m_punchThroughTool.propertyName() << ": Failed to retrieve tool " << m_punchThroughTool.type()); ATH_MSG_ERROR (m_punchThroughTool.propertyName() << ": Failed to retrieve tool " << m_punchThroughTool.type());
return StatusCode::FAILURE; return StatusCode::FAILURE;
} }
ATH_MSG_DEBUG( m_screenOutputPrefix << " Output CaloCellContainer Name " << m_caloCellsOutputName ); ATH_MSG_DEBUG( m_screenOutputPrefix << " Output CaloCellContainer Name " << m_caloCellsOutputName );
if (m_ownPolicy==SG::OWN_ELEMENTS){ if (m_ownPolicy==SG::OWN_ELEMENTS){
ATH_MSG_INFO( m_screenOutputPrefix << "...will OWN its cells." ); ATH_MSG_INFO( m_screenOutputPrefix << "...will OWN its cells." );
...@@ -118,16 +118,16 @@ StatusCode ISF::NativeFastCaloSimSvc::finalize() ...@@ -118,16 +118,16 @@ StatusCode ISF::NativeFastCaloSimSvc::finalize()
} }
StatusCode ISF::NativeFastCaloSimSvc::setupEvent() StatusCode ISF::NativeFastCaloSimSvc::setupEvent()
{ {
ATH_MSG_DEBUG ( m_screenOutputPrefix << "setup Event"); ATH_MSG_DEBUG ( m_screenOutputPrefix << "setup Event");
if (!m_caloCellHack) { if (!m_caloCellHack) {
m_theContainer = new CaloCellContainer(static_cast<SG::OwnershipPolicy>(m_ownPolicy)); m_theContainer = new CaloCellContainer(static_cast<SG::OwnershipPolicy>(m_ownPolicy));
StatusCode sc=StatusCode::SUCCESS; StatusCode sc=StatusCode::SUCCESS;
sc=evtStore()->record(m_theContainer,m_caloCellsOutputName); sc=evtStore()->record(m_theContainer,m_caloCellsOutputName);
if (sc.isFailure()) { if (sc.isFailure()) {
ATH_MSG_FATAL( m_screenOutputPrefix << "cannot record CaloCellContainer " << m_caloCellsOutputName ); ATH_MSG_FATAL( m_screenOutputPrefix << "cannot record CaloCellContainer " << m_caloCellsOutputName );
return StatusCode::FAILURE; return StatusCode::FAILURE;
...@@ -145,7 +145,7 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent() ...@@ -145,7 +145,7 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent()
else { else {
// take CaloCellContainer from input and cast away constness // take CaloCellContainer from input and cast away constness
const CaloCellContainer * theConstContainer ; const CaloCellContainer * theConstContainer ;
StatusCode sc=StatusCode::SUCCESS; StatusCode sc=StatusCode::SUCCESS;
sc=evtStore()->retrieve(theConstContainer,m_caloCellsOutputName); sc=evtStore()->retrieve(theConstContainer,m_caloCellsOutputName);
if (sc.isFailure() || theConstContainer==0) if (sc.isFailure() || theConstContainer==0)
...@@ -160,9 +160,9 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent() ...@@ -160,9 +160,9 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent()
ToolHandleArray<ICaloCellMakerTool>::iterator itrTool=m_caloCellMakerTools_setup.begin(); ToolHandleArray<ICaloCellMakerTool>::iterator itrTool=m_caloCellMakerTools_setup.begin();
ToolHandleArray<ICaloCellMakerTool>::iterator endTool=m_caloCellMakerTools_setup.end(); ToolHandleArray<ICaloCellMakerTool>::iterator endTool=m_caloCellMakerTools_setup.end();
for (;itrTool!=endTool;++itrTool){ for (;itrTool!=endTool;++itrTool){
ATH_MSG_DEBUG( m_screenOutputPrefix << "Calling tool " << itrTool->name() ); ATH_MSG_DEBUG( m_screenOutputPrefix << "Calling tool " << itrTool->name() );
std::string chronoName=this->name()+"_"+ itrTool->name(); std::string chronoName=this->name()+"_"+ itrTool->name();
if (m_chrono) m_chrono -> chronoStart( chronoName); if (m_chrono) m_chrono -> chronoStart( chronoName);
StatusCode sc = (*itrTool)->process(m_theContainer); StatusCode sc = (*itrTool)->process(m_theContainer);
if (m_chrono) { if (m_chrono) {
...@@ -172,7 +172,7 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent() ...@@ -172,7 +172,7 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent()
if (sc.isFailure()) { if (sc.isFailure()) {
ATH_MSG_ERROR( m_screenOutputPrefix << "Error executing tool " << itrTool->name() ); ATH_MSG_ERROR( m_screenOutputPrefix << "Error executing tool " << itrTool->name() );
} }
} }
/* /*
...@@ -185,7 +185,7 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent() ...@@ -185,7 +185,7 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent()
if(fcs->setupEvent().isFailure()) { if(fcs->setupEvent().isFailure()) {
ATH_MSG_ERROR( m_screenOutputPrefix << "Error executing tool " << itrTool->name() << " in setupEvent"); ATH_MSG_ERROR( m_screenOutputPrefix << "Error executing tool " << itrTool->name() << " in setupEvent");
return StatusCode::FAILURE; return StatusCode::FAILURE;
} }
} }
} }
*/ */
...@@ -194,7 +194,7 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent() ...@@ -194,7 +194,7 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent()
} }
StatusCode ISF::NativeFastCaloSimSvc::releaseEvent() StatusCode ISF::NativeFastCaloSimSvc::releaseEvent()
{ {
ATH_MSG_DEBUG ( m_screenOutputPrefix << "release Event"); ATH_MSG_DEBUG ( m_screenOutputPrefix << "release Event");
// the return value // the return value
...@@ -206,7 +206,7 @@ StatusCode ISF::NativeFastCaloSimSvc::releaseEvent() ...@@ -206,7 +206,7 @@ StatusCode ISF::NativeFastCaloSimSvc::releaseEvent()
if ( m_batchProcessMcTruth) { if ( m_batchProcessMcTruth) {
// -> run the FastShowerCellBuilder tools // -> run the FastShowerCellBuilder tools
// (in Python they should be configured to pick up the modified truth collection) // (in Python they should be configured to pick up the modified truth collection)
//ZH commented out these to avoid warnings at the moment //ZH commented out these to avoid warnings at the moment
//ToolHandleArray<ICaloCellMakerTool>::iterator itrTool=m_caloCellMakerTools_simulate.begin(); //ToolHandleArray<ICaloCellMakerTool>::iterator itrTool=m_caloCellMakerTools_simulate.begin();
//ToolHandleArray<ICaloCellMakerTool>::iterator endTool=m_caloCellMakerTools_simulate.end(); //ToolHandleArray<ICaloCellMakerTool>::iterator endTool=m_caloCellMakerTools_simulate.end();
...@@ -214,14 +214,14 @@ StatusCode ISF::NativeFastCaloSimSvc::releaseEvent() ...@@ -214,14 +214,14 @@ StatusCode ISF::NativeFastCaloSimSvc::releaseEvent()
for (;itrTool!=endTool;++itrTool) { for (;itrTool!=endTool;++itrTool) {
FastShowerCellBuilderTool* fcs=dynamic_cast< FastShowerCellBuilderTool* >(&(*(*itrTool))); FastShowerCellBuilderTool* fcs=dynamic_cast< FastShowerCellBuilderTool* >(&(*(*itrTool)));
if(!fcs) { if(!fcs) {
ATH_MSG_WARNING( m_screenOutputPrefix << "tool " << itrTool->name()<< "is not a FastShowerCellBuilderTool" ); ATH_MSG_WARNING( m_screenOutputPrefix << "tool " << itrTool->name()<< "is not a FastShowerCellBuilderTool" );
continue; continue;
} }
ATH_MSG_VERBOSE( m_screenOutputPrefix << "Calling tool " << itrTool->name() ); ATH_MSG_VERBOSE( m_screenOutputPrefix << "Calling tool " << itrTool->name() );
if( fcs->process(m_theContainer).isFailure()) { if( fcs->process(m_theContainer).isFailure()) {
ATH_MSG_WARNING( m_screenOutputPrefix << "batch simulation of FastCaloSim particles failed" ); ATH_MSG_WARNING( m_screenOutputPrefix << "batch simulation of FastCaloSim particles failed" );
sc = StatusCode::FAILURE; sc = StatusCode::FAILURE;
} }
} }
...@@ -243,15 +243,15 @@ StatusCode ISF::NativeFastCaloSimSvc::releaseEvent() ...@@ -243,15 +243,15 @@ StatusCode ISF::NativeFastCaloSimSvc::releaseEvent()
} }
} }
*/ */
// (3.) run release tools in a loop // (3.) run release tools in a loop
// //
itrTool=m_caloCellMakerTools_release.begin(); itrTool=m_caloCellMakerTools_release.begin();
endTool=m_caloCellMakerTools_release.end(); endTool=m_caloCellMakerTools_release.end();
for (;itrTool!=endTool;++itrTool){ for (;itrTool!=endTool;++itrTool){
ATH_MSG_DEBUG( m_screenOutputPrefix << "Calling tool " << itrTool->name() ); ATH_MSG_DEBUG( m_screenOutputPrefix << "Calling tool " << itrTool->name() );
std::string chronoName=this->name()+"_"+ itrTool->name(); std::string chronoName=this->name()+"_"+ itrTool->name();
if (m_chrono) m_chrono -> chronoStart( chronoName); if (m_chrono) m_chrono -> chronoStart( chronoName);
sc = (*itrTool)->process(m_theContainer); sc = (*itrTool)->process(m_theContainer);
if (m_chrono) { if (m_chrono) {
...@@ -264,7 +264,7 @@ StatusCode ISF::NativeFastCaloSimSvc::releaseEvent() ...@@ -264,7 +264,7 @@ StatusCode ISF::NativeFastCaloSimSvc::releaseEvent()
} }
} }
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -280,14 +280,12 @@ StatusCode ISF::NativeFastCaloSimSvc::simulate(const ISF::ISFParticle& isfp) ...@@ -280,14 +280,12 @@ StatusCode ISF::NativeFastCaloSimSvc::simulate(const ISF::ISFParticle& isfp)
if (m_doPunchThrough) { if (m_doPunchThrough) {
// call punch-through simulation // call punch-through simulation
const ISF::ISFParticleContainer* isfpVec = m_punchThroughTool->computePunchThroughParticles(isfp); const ISF::ISFParticleVector* isfpVec = m_punchThroughTool->computePunchThroughParticles(isfp);
// add punch-through particles to the ISF particle broker // add punch-through particles to the ISF particle broker
if (isfpVec) { if (isfpVec) {
ISF::ISFParticleContainer::const_iterator partIt = isfpVec->begin(); for (ISF::ISFParticle *particle : *isfpVec) {
ISF::ISFParticleContainer::const_iterator partItEnd = isfpVec->end(); m_particleBroker->push( particle, &isfp);
for ( ; partIt!=partItEnd; ++partIt) {
m_particleBroker->push( *partIt, &isfp);
} }
} }
} }
...@@ -321,13 +319,13 @@ StatusCode ISF::NativeFastCaloSimSvc::processOneParticle( const ISF::ISFParticle ...@@ -321,13 +319,13 @@ StatusCode ISF::NativeFastCaloSimSvc::processOneParticle( const ISF::ISFParticle
for (;itrTool!=endTool;++itrTool) { for (;itrTool!=endTool;++itrTool) {
FastShowerCellBuilderTool* fcs=dynamic_cast< FastShowerCellBuilderTool* >(&(*(*itrTool))); FastShowerCellBuilderTool* fcs=dynamic_cast< FastShowerCellBuilderTool* >(&(*(*itrTool)));
if(!fcs) { if(!fcs) {
ATH_MSG_WARNING( m_screenOutputPrefix << "tool " << itrTool->name()<< "is not a FastShowerCellBuilderTool" ); ATH_MSG_WARNING( m_screenOutputPrefix << "tool " << itrTool->name()<< "is not a FastShowerCellBuilderTool" );
continue; continue;
} }
ATH_MSG_VERBOSE( m_screenOutputPrefix << "Calling tool " << itrTool->name() ); ATH_MSG_VERBOSE( m_screenOutputPrefix << "Calling tool " << itrTool->name() );
std::string chronoName=this->name()+"_"+ itrTool->name(); std::string chronoName=this->name()+"_"+ itrTool->name();
if (m_chrono) m_chrono->chronoStart( chronoName); if (m_chrono) m_chrono->chronoStart( chronoName);
HepMC::FourVector momentum(isfp.momentum().x(),isfp.momentum().y(),isfp.momentum().z(), sqrt( isfp.mass()*isfp.mass() + isfp.momentum().mag2()) ); HepMC::FourVector momentum(isfp.momentum().x(),isfp.momentum().y(),isfp.momentum().z(), sqrt( isfp.mass()*isfp.mass() + isfp.momentum().mag2()) );
...@@ -338,7 +336,7 @@ StatusCode ISF::NativeFastCaloSimSvc::processOneParticle( const ISF::ISFParticle ...@@ -338,7 +336,7 @@ StatusCode ISF::NativeFastCaloSimSvc::processOneParticle( const ISF::ISFParticle
//sc = (*itrTool)->process(m_theContainer); //sc = (*itrTool)->process(m_theContainer);
if(fcs->process_particle(m_theContainer,part,0).isFailure()) { if(fcs->process_particle(m_theContainer,part,0).isFailure()) {
ATH_MSG_WARNING( m_screenOutputPrefix << "simulation of particle pdgid=" << isfp.pdgCode()<< " failed" ); ATH_MSG_WARNING( m_screenOutputPrefix << "simulation of particle pdgid=" << isfp.pdgCode()<< " failed" );
sc = StatusCode::FAILURE; sc = StatusCode::FAILURE;
} }
...@@ -350,4 +348,3 @@ StatusCode ISF::NativeFastCaloSimSvc::processOneParticle( const ISF::ISFParticle ...@@ -350,4 +348,3 @@ StatusCode ISF::NativeFastCaloSimSvc::processOneParticle( const ISF::ISFParticle
// ATH_MSG_VERBOSE ( m_screenOutputPrefix << "kill the particle in the end"); // ATH_MSG_VERBOSE ( m_screenOutputPrefix << "kill the particle in the end");
return sc; return sc;
} }
...@@ -114,6 +114,7 @@ def getFastCaloSimSvcV2(name="ISF_FastCaloSimSvcV2", **kwargs): ...@@ -114,6 +114,7 @@ def getFastCaloSimSvcV2(name="ISF_FastCaloSimSvcV2", **kwargs):
kwargs.setdefault("RandomStream" , ISF_FastCaloSimFlags.RandomStreamName()) kwargs.setdefault("RandomStream" , ISF_FastCaloSimFlags.RandomStreamName())
kwargs.setdefault("RandomSvc" , simFlags.RandomSvc.get_Value() ) kwargs.setdefault("RandomSvc" , simFlags.RandomSvc.get_Value() )
kwargs.setdefault("ParticleTruthSvc" , simFlags.TruthStrategy.TruthServiceName() )
return CfgMgr.ISF__FastCaloSimSvcV2(name, **kwargs ) return CfgMgr.ISF__FastCaloSimSvcV2(name, **kwargs )
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
// ISF includes // ISF includes
#include "ISF_Event/ISFParticle.h" #include "ISF_Event/ISFParticle.h"
#include "ISF_Event/ISFParticleContainer.h" #include "ISF_Event/ISFParticleVector.h"
// HepMC include needed for FastCaloSim // HepMC include needed for FastCaloSim
#include "HepMC/GenParticle.h" #include "HepMC/GenParticle.h"
...@@ -53,7 +53,7 @@ ISF::FastCaloSimSvc::FastCaloSimSvc(const std::string& name,ISvcLocator* svc) : ...@@ -53,7 +53,7 @@ ISF::FastCaloSimSvc::FastCaloSimSvc(const std::string& name,ISvcLocator* svc) :
m_theContainer(0), m_theContainer(0),
m_particleBroker ("ISF_ParticleBroker",name) m_particleBroker ("ISF_ParticleBroker",name)
{ {
// where to go // where to go
declareProperty("OwnPolicy", m_ownPolicy) ; declareProperty("OwnPolicy", m_ownPolicy) ;
declareProperty("CaloCellMakerTools_setup" , m_caloCellMakerTools_setup) ; declareProperty("CaloCellMakerTools_setup" , m_caloCellMakerTools_setup) ;
declareProperty("CaloCellMakerTools_simulate", m_caloCellMakerTools_simulate) ; declareProperty("CaloCellMakerTools_simulate", m_caloCellMakerTools_simulate) ;
...@@ -74,7 +74,7 @@ ISF::FastCaloSimSvc::FastCaloSimSvc(const std::string& name,ISvcLocator* svc) : ...@@ -74,7 +74,7 @@ ISF::FastCaloSimSvc::FastCaloSimSvc(const std::string& name,ISvcLocator* svc) :
"Run the FastShowerCellBuilders on the McTruth at the end of the event" ); "Run the FastShowerCellBuilders on the McTruth at the end of the event" );
} }
ISF::FastCaloSimSvc::~FastCaloSimSvc() ISF::FastCaloSimSvc::~FastCaloSimSvc()
{} {}
/** framework methods */ /** framework methods */
...@@ -83,23 +83,23 @@ StatusCode ISF::FastCaloSimSvc::initialize() ...@@ -83,23 +83,23 @@ StatusCode ISF::FastCaloSimSvc::initialize()
ATH_MSG_INFO ( m_screenOutputPrefix << "Initializing ..."); ATH_MSG_INFO ( m_screenOutputPrefix << "Initializing ...");
// access tools and store them // access tools and store them
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_setup).isFailure() ) if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_setup).isFailure() )
return StatusCode::FAILURE; return StatusCode::FAILURE;
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_simulate).isFailure() ) if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_simulate).isFailure() )
return StatusCode::FAILURE; return StatusCode::FAILURE;
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_release).isFailure() ) if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_release).isFailure() )
return StatusCode::FAILURE; return StatusCode::FAILURE;
if (m_doPunchThrough && m_punchThroughTool.retrieve().isFailure() ) if (m_doPunchThrough && m_punchThroughTool.retrieve().isFailure() )
{ {
ATH_MSG_ERROR (m_punchThroughTool.propertyName() << ": Failed to retrieve tool " << m_punchThroughTool.type()); ATH_MSG_ERROR (m_punchThroughTool.propertyName() << ": Failed to retrieve tool " << m_punchThroughTool.type());
return StatusCode::FAILURE; return StatusCode::FAILURE;