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 {
virtual ~ITruthSvc() { }
/** 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 */
virtual StatusCode initializeTruthCollection() = 0;
......
......@@ -155,10 +155,11 @@ StatusCode ISF::TruthSvc::releaseEvent() {
/** 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
ti.setPassWholeVertices(m_passWholeVertex);
ti.setPassWholeVertices(passWholeVertex);
// the GeoID
AtlasDetDescr::AtlasRegion geoID = ti.geoID();
......@@ -201,7 +202,7 @@ void ISF::TruthSvc::registerTruthIncident( ISF::ITruthIncident& ti) const {
ATH_MSG_VERBOSE("At least one TruthStrategy passed.");
// at least one truth strategy returned true
// -> record incident
recordIncidentToMCTruth( ti);
recordIncidentToMCTruth(ti, passWholeVertex);
} else {
// none of the truth strategies returned true
......@@ -231,7 +232,7 @@ void ISF::TruthSvc::registerTruthIncident( ISF::ITruthIncident& ti) const {
}
/** 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
ATH_MSG_INFO("Starting recordIncidentToMCTruth(...)");
#endif
......@@ -335,7 +336,7 @@ void ISF::TruthSvc::recordIncidentToMCTruth( ISF::ITruthIncident& ti) const {
std::vector<HepMC::GenParticle*> matchedChildParticles;
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) {
HepMC::GenParticle *p = nullptr;
......
......@@ -76,7 +76,7 @@ namespace ISF {
StatusCode finalize() override final;
/** 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 */
StatusCode initializeTruthCollection() override final;
......@@ -86,7 +86,7 @@ namespace ISF {
private:
/** 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 */
HepMC::GenVertex *createGenVertexFromTruthIncident( ITruthIncident& truthincident,
bool replaceExistingGenVertex=false) const;
......
......@@ -355,7 +355,7 @@ namespace ISFTesting {
.Times(1)
.WillOnce(::testing::Return(nullptr));
recordIncidentToMCTruth(ti);
recordIncidentToMCTruth(ti,false);
HepMC::GenVertex* generated = anEvent->barcode_to_vertex(-2); //Find a nicer way to get this.
ASSERT_EQ( vtxPosition, generated->position() );
ASSERT_EQ( 1021, generated->id() );
......
......@@ -10,36 +10,36 @@
// ISF includes
#include "ISF_Event/ISFParticle.h"
#include "ISF_Event/ISFParticleContainer.h"
#include "ISF_Event/ISFParticleVector.h"
namespace Trk{
class Track;
}
namespace ISF {
/**
@class IPunchThroughTool
Interface for a tool which takes a ISF::ISFParticle as input
and returns a vector of ISFParticles
@author Elmar.Ritsch@cern.ch , Anna.Usanova@cern.ch
*/
class IPunchThroughTool : virtual public IAlgTool {
public:
/** Virtual destructor */
virtual ~IPunchThroughTool(){}
/// Creates the InterfaceID and interfaceID() method
DeclareInterfaceID(IPunchThroughTool, 1, 0);
/** 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
#endif
......@@ -47,7 +47,7 @@ ISF::NativeFastCaloSimSvc::NativeFastCaloSimSvc(const std::string& name,ISvcLoca
m_theContainer(0),
m_particleBroker ("ISF_ParticleBroker",name)
{
// where to go
// where to go
declareProperty("OwnPolicy", m_ownPolicy) ;
declareProperty("CaloCellMakerTools_setup" , m_caloCellMakerTools_setup) ;
declareProperty("CaloCellMakerTools_simulate", m_caloCellMakerTools_simulate) ;
......@@ -67,7 +67,7 @@ ISF::NativeFastCaloSimSvc::NativeFastCaloSimSvc(const std::string& name,ISvcLoca
"Run the FastShowerCellBuilders on the McTruth at the end of the event" );
}
ISF::NativeFastCaloSimSvc::~NativeFastCaloSimSvc()
ISF::NativeFastCaloSimSvc::~NativeFastCaloSimSvc()
{}
/** framework methods */
......@@ -76,19 +76,19 @@ StatusCode ISF::NativeFastCaloSimSvc::initialize()
ATH_MSG_INFO ( m_screenOutputPrefix << "Initializing ...");
// access tools and store them
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_setup).isFailure() )
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_setup).isFailure() )
return StatusCode::FAILURE;
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_simulate).isFailure() )
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_simulate).isFailure() )
return StatusCode::FAILURE;
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_release).isFailure() )
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_release).isFailure() )
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());
return StatusCode::FAILURE;
}
}
ATH_MSG_DEBUG( m_screenOutputPrefix << " Output CaloCellContainer Name " << m_caloCellsOutputName );
if (m_ownPolicy==SG::OWN_ELEMENTS){
ATH_MSG_INFO( m_screenOutputPrefix << "...will OWN its cells." );
......@@ -118,16 +118,16 @@ StatusCode ISF::NativeFastCaloSimSvc::finalize()
}
StatusCode ISF::NativeFastCaloSimSvc::setupEvent()
{
{
ATH_MSG_DEBUG ( m_screenOutputPrefix << "setup Event");
if (!m_caloCellHack) {
m_theContainer = new CaloCellContainer(static_cast<SG::OwnershipPolicy>(m_ownPolicy));
StatusCode sc=StatusCode::SUCCESS;
sc=evtStore()->record(m_theContainer,m_caloCellsOutputName);
if (sc.isFailure()) {
ATH_MSG_FATAL( m_screenOutputPrefix << "cannot record CaloCellContainer " << m_caloCellsOutputName );
return StatusCode::FAILURE;
......@@ -145,7 +145,7 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent()
else {
// take CaloCellContainer from input and cast away constness
const CaloCellContainer * theConstContainer ;
StatusCode sc=StatusCode::SUCCESS;
sc=evtStore()->retrieve(theConstContainer,m_caloCellsOutputName);
if (sc.isFailure() || theConstContainer==0)
......@@ -160,9 +160,9 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent()
ToolHandleArray<ICaloCellMakerTool>::iterator itrTool=m_caloCellMakerTools_setup.begin();
ToolHandleArray<ICaloCellMakerTool>::iterator endTool=m_caloCellMakerTools_setup.end();
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();
if (m_chrono) m_chrono -> chronoStart( chronoName);
StatusCode sc = (*itrTool)->process(m_theContainer);
if (m_chrono) {
......@@ -172,7 +172,7 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent()
if (sc.isFailure()) {
ATH_MSG_ERROR( m_screenOutputPrefix << "Error executing tool " << itrTool->name() );
}
}
}
/*
......@@ -185,7 +185,7 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent()
if(fcs->setupEvent().isFailure()) {
ATH_MSG_ERROR( m_screenOutputPrefix << "Error executing tool " << itrTool->name() << " in setupEvent");
return StatusCode::FAILURE;
}
}
}
}
*/
......@@ -194,7 +194,7 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent()
}
StatusCode ISF::NativeFastCaloSimSvc::releaseEvent()
{
{
ATH_MSG_DEBUG ( m_screenOutputPrefix << "release Event");
// the return value
......@@ -206,7 +206,7 @@ StatusCode ISF::NativeFastCaloSimSvc::releaseEvent()
if ( m_batchProcessMcTruth) {
// -> run the FastShowerCellBuilder tools
// (in Python they should be configured to pick up the modified truth collection)
//ZH commented out these to avoid warnings at the moment
//ToolHandleArray<ICaloCellMakerTool>::iterator itrTool=m_caloCellMakerTools_simulate.begin();
//ToolHandleArray<ICaloCellMakerTool>::iterator endTool=m_caloCellMakerTools_simulate.end();
......@@ -214,14 +214,14 @@ StatusCode ISF::NativeFastCaloSimSvc::releaseEvent()
for (;itrTool!=endTool;++itrTool) {
FastShowerCellBuilderTool* fcs=dynamic_cast< FastShowerCellBuilderTool* >(&(*(*itrTool)));
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;
}
ATH_MSG_VERBOSE( m_screenOutputPrefix << "Calling tool " << itrTool->name() );
ATH_MSG_VERBOSE( m_screenOutputPrefix << "Calling tool " << itrTool->name() );
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;
}
}
......@@ -243,15 +243,15 @@ StatusCode ISF::NativeFastCaloSimSvc::releaseEvent()
}
}
*/
// (3.) run release tools in a loop
//
itrTool=m_caloCellMakerTools_release.begin();
endTool=m_caloCellMakerTools_release.end();
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();
if (m_chrono) m_chrono -> chronoStart( chronoName);
sc = (*itrTool)->process(m_theContainer);
if (m_chrono) {
......@@ -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)
if (m_doPunchThrough) {
// 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
if (isfpVec) {
ISF::ISFParticleContainer::const_iterator partIt = isfpVec->begin();
ISF::ISFParticleContainer::const_iterator partItEnd = isfpVec->end();
for ( ; partIt!=partItEnd; ++partIt) {
m_particleBroker->push( *partIt, &isfp);
for (ISF::ISFParticle *particle : *isfpVec) {
m_particleBroker->push( particle, &isfp);
}
}
}
......@@ -321,13 +319,13 @@ StatusCode ISF::NativeFastCaloSimSvc::processOneParticle( const ISF::ISFParticle
for (;itrTool!=endTool;++itrTool) {
FastShowerCellBuilderTool* fcs=dynamic_cast< FastShowerCellBuilderTool* >(&(*(*itrTool)));
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;
}
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();
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()) );
......@@ -338,7 +336,7 @@ StatusCode ISF::NativeFastCaloSimSvc::processOneParticle( const ISF::ISFParticle
//sc = (*itrTool)->process(m_theContainer);
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;
}
......@@ -350,4 +348,3 @@ StatusCode ISF::NativeFastCaloSimSvc::processOneParticle( const ISF::ISFParticle
// ATH_MSG_VERBOSE ( m_screenOutputPrefix << "kill the particle in the end");
return sc;
}
......@@ -114,6 +114,7 @@ def getFastCaloSimSvcV2(name="ISF_FastCaloSimSvcV2", **kwargs):
kwargs.setdefault("RandomStream" , ISF_FastCaloSimFlags.RandomStreamName())
kwargs.setdefault("RandomSvc" , simFlags.RandomSvc.get_Value() )
kwargs.setdefault("ParticleTruthSvc" , simFlags.TruthStrategy.TruthServiceName() )
return CfgMgr.ISF__FastCaloSimSvcV2(name, **kwargs )
......
......@@ -15,7 +15,7 @@
// ISF includes
#include "ISF_Event/ISFParticle.h"
#include "ISF_Event/ISFParticleContainer.h"
#include "ISF_Event/ISFParticleVector.h"
// HepMC include needed for FastCaloSim
#include "HepMC/GenParticle.h"
......@@ -53,7 +53,7 @@ ISF::FastCaloSimSvc::FastCaloSimSvc(const std::string& name,ISvcLocator* svc) :
m_theContainer(0),
m_particleBroker ("ISF_ParticleBroker",name)
{
// where to go
// where to go
declareProperty("OwnPolicy", m_ownPolicy) ;
declareProperty("CaloCellMakerTools_setup" , m_caloCellMakerTools_setup) ;
declareProperty("CaloCellMakerTools_simulate", m_caloCellMakerTools_simulate) ;
......@@ -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" );
}
ISF::FastCaloSimSvc::~FastCaloSimSvc()
ISF::FastCaloSimSvc::~FastCaloSimSvc()
{}
/** framework methods */
......@@ -83,23 +83,23 @@ StatusCode ISF::FastCaloSimSvc::initialize()
ATH_MSG_INFO ( m_screenOutputPrefix << "Initializing ...");
// access tools and store them
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_setup).isFailure() )
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_setup).isFailure() )
return StatusCode::FAILURE;
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_simulate).isFailure() )
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_simulate).isFailure() )
return StatusCode::FAILURE;
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_release).isFailure() )
if ( retrieveTools<ICaloCellMakerTool>(m_caloCellMakerTools_release).isFailure() )
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());
return StatusCode::FAILURE;
}
}
// Get TimedExtrapolator
// Get TimedExtrapolator
if (!m_extrapolator.empty() && m_extrapolator.retrieve().isFailure())
return StatusCode::FAILURE;
ATH_MSG_DEBUG( m_screenOutputPrefix << " Output CaloCellContainer Name " << m_caloCellsOutputName );
if (m_ownPolicy==SG::OWN_ELEMENTS){
ATH_MSG_INFO( m_screenOutputPrefix << "...will OWN its cells." );
......@@ -129,16 +129,16 @@ StatusCode ISF::FastCaloSimSvc::finalize()
}
StatusCode ISF::FastCaloSimSvc::setupEvent()
{
{
ATH_MSG_DEBUG ( m_screenOutputPrefix << "setup Event");
if (!m_caloCellHack) {
m_theContainer = new CaloCellContainer(static_cast<SG::OwnershipPolicy>(m_ownPolicy));
StatusCode sc=StatusCode::SUCCESS;
sc=evtStore()->record(m_theContainer,m_caloCellsOutputName);
if (sc.isFailure()) {
ATH_MSG_FATAL( m_screenOutputPrefix << "cannot record CaloCellContainer " << m_caloCellsOutputName );
return StatusCode::FAILURE;
......@@ -156,7 +156,7 @@ StatusCode ISF::FastCaloSimSvc::setupEvent()
else {
// take CaloCellContainer from input and cast away constness
const CaloCellContainer * theConstContainer ;
StatusCode sc=StatusCode::SUCCESS;
sc=evtStore()->retrieve(theConstContainer,m_caloCellsOutputName);
if (sc.isFailure() || theConstContainer==0)
......@@ -171,9 +171,9 @@ StatusCode ISF::FastCaloSimSvc::setupEvent()
ToolHandleArray<ICaloCellMakerTool>::iterator itrTool=m_caloCellMakerTools_setup.begin();
ToolHandleArray<ICaloCellMakerTool>::iterator endTool=m_caloCellMakerTools_setup.end();
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();
if (m_chrono) m_chrono -> chronoStart( chronoName);
StatusCode sc = (*itrTool)->process(m_theContainer);
if (m_chrono) {
......@@ -183,7 +183,7 @@ StatusCode ISF::FastCaloSimSvc::setupEvent()
if (sc.isFailure()) {
ATH_MSG_ERROR( m_screenOutputPrefix << "Error executing tool " << itrTool->name() );
}
}
}
// loop on simulate tools
......@@ -195,7 +195,7 @@ StatusCode ISF::FastCaloSimSvc::setupEvent()
if(fcs->setupEvent().isFailure()) {
ATH_MSG_ERROR( m_screenOutputPrefix << "Error executing tool " << itrTool->name() << " in setupEvent");
return StatusCode::FAILURE;
}
}
}
}
......@@ -203,7 +203,7 @@ StatusCode ISF::FastCaloSimSvc::setupEvent()
}
StatusCode ISF::FastCaloSimSvc::releaseEvent()
{
{
ATH_MSG_DEBUG ( m_screenOutputPrefix << "release Event");
// the return value
......@@ -220,14 +220,14 @@ StatusCode ISF::FastCaloSimSvc::releaseEvent()
for (;itrTool!=endTool;++itrTool) {
FastShowerCellBuilderTool* fcs=dynamic_cast< FastShowerCellBuilderTool* >(&(*(*itrTool)));
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;
}
ATH_MSG_VERBOSE( m_screenOutputPrefix << "Calling tool " << itrTool->name() );
ATH_MSG_VERBOSE( m_screenOutputPrefix << "Calling tool " << itrTool->name() );
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;
}
}
......@@ -246,15 +246,15 @@ StatusCode ISF::FastCaloSimSvc::releaseEvent()
}
}
}
// (3.) run release tools in a loop
//
itrTool=m_caloCellMakerTools_release.begin();
endTool=m_caloCellMakerTools_release.end();
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();
if (m_chrono) m_chrono -> chronoStart( chronoName);
sc = (*itrTool)->process(m_theContainer);
if (m_chrono) {
......@@ -267,7 +267,7 @@ StatusCode ISF::FastCaloSimSvc::releaseEvent()
}
}
return StatusCode::SUCCESS;
return StatusCode::SUCCESS;
}
......@@ -283,12 +283,12 @@ StatusCode ISF::FastCaloSimSvc::simulate(const ISF::ISFParticle& isfp)
if (m_doPunchThrough) {
// 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
if (isfpVec) {
ISF::ISFParticleContainer::const_iterator partIt = isfpVec->begin();
ISF::ISFParticleContainer::const_iterator partItEnd = isfpVec->end();
ISF::ISFParticleVector::const_iterator partIt = isfpVec->begin();
ISF::ISFParticleVector::const_iterator partItEnd = isfpVec->end();
for ( ; partIt!=partItEnd; ++partIt) {
m_particleBroker->push( *partIt, &isfp);
}
......@@ -328,19 +328,19 @@ StatusCode ISF::FastCaloSimSvc::processOneParticle( const ISF::ISFParticle& isfp
for (;itrTool!=endTool;++itrTool) {
FastShowerCellBuilderTool* fcs=dynamic_cast< FastShowerCellBuilderTool* >(&(*(*itrTool)));
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;
}
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();
if (m_chrono) m_chrono->chronoStart( chronoName);
//sc = (*itrTool)->process(m_theContainer);
if(fcs->process_particle(m_theContainer,hitVector,
isfp.momentum(),isfp.mass(),isfp.pdgCode(),isfp.barcode()).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" );
return StatusCode::FAILURE;
}
......@@ -353,10 +353,10 @@ StatusCode ISF::FastCaloSimSvc::processOneParticle( const ISF::ISFParticle& isfp
if((*it).trackParms) {
delete (*it).trackParms;
(*it).trackParms=0;
}
}
}
delete hitVector;
}
}
// ATH_MSG_VERBOSE ( m_screenOutputPrefix << "kill the particle in the end");
return StatusCode::SUCCESS;
......@@ -368,7 +368,7 @@ std::vector<Trk::HitInfo>* ISF::FastCaloSimSvc::caloHits(const ISF::ISFParticle&
// Start calo extrapolation
ATH_MSG_VERBOSE ("[ fastCaloSim transport ] processing particle "<<isp.pdgCode() );
std::vector<Trk::HitInfo>* hitVector = new std::vector<Trk::HitInfo>;
std::vector<Trk::HitInfo>* hitVector = new std::vector<Trk::HitInfo>;
int absPdg = abs(isp.pdgCode());
bool charged = isp.charge()*isp.charge() > 0 ;
......@@ -381,13 +381,13 @@ std::vector<Trk::HitInfo>* ISF::FastCaloSimSvc::caloHits(const ISF::ISFParticle&
if ( absPdg == 999 ) pHypothesis = Trk::geantino;
// choose the extrapolator
//const Trk::ITimedExtrapolator* processor = &(*m_extrapolator);
//const Trk::ITimedExtrapolator* processor = &(*m_extrapolator);
// input parameters : curvilinear parameters
Trk