30#include "G4ParticleDefinition.hh"
31#include "G4DynamicParticle.hh"
32#include "G4TouchableHistory.hh"
34#include "G4TransportationManager.hh"
35#include "G4LogicalVolumeStore.hh"
49 G4cout <<
"Initializing TrackProcessorUserActionPassBack" << G4endl;
53 if (m_config.particleBroker.retrieve().isFailure()) {
54 G4ExceptionDescription description;
55 description << G4String(
"TrackProcessorUserActionPassBack: ") +
"Could not retrieve ISF Particle Broker: " << m_config.particleBroker;
56 G4Exception(
"iGeant4::TrackProcessorUserActionPassBack",
"NoISFParticleBroker", FatalException, description);
62 if ( !m_config.geoIDSvc.empty() ) {
63 if (m_config.geoIDSvc.retrieve().isFailure()) {
64 G4ExceptionDescription description;
65 description << G4String(
"TrackProcessorUserActionPassBack: ") +
"Could not retrieve ISF GeoID Svc: " << m_config.geoIDSvc;
66 G4Exception(
"iGeant4::TrackProcessorUserActionPassBack",
"NoISFGeoIDSvc", FatalException, description);
70 m_geoIDSvcQuick = &(*m_config.geoIDSvc);
80 G4Track* aTrack = aStep->GetTrack();
81 G4TrackStatus aTrackStatus = aTrack->GetTrackStatus();
84 const G4StepPoint *postStep = aStep->GetPostStepPoint();
92 const G4ThreeVector &postPos = postStep->GetPosition();
107 if ( nextGeoID==curGeoID ) {
145 if ( aTrack->GetKineticEnergy() <
m_config.passBackEkinThreshold ) {
149 if (
m_config.killBoundaryParticlesBelowThreshold ) {
150 aTrack->SetTrackStatus( fStopAndKill );
154 }
else if ( aTrackStatus!=fAlive && aTrackStatus != fStopButAlive ) {
174 const std::vector<const G4Track*> *secondaryVector = aStep->GetSecondaryInCurrentStep();
176 for (
auto* aConstTrack_2nd : *secondaryVector ) {
181 const G4ThreeVector& pos_2nd = aTrack_2nd->GetPosition();
185 if( nextGeoID_2nd!=curGeoID ) {
189 if ( aTrack_2nd->GetKineticEnergy() <
m_config.passBackEkinThreshold ) {
193 if (
m_config.killBoundaryParticlesBelowThreshold ) {
195 aTrack_2nd->SetTrackStatus( fStopAndKill );
210 generationZeroGenParticle );
227 description << G4String(
"newTruthBinding: ") +
"No TrackInformation associated with G4Track (trackID: "
228 << aTrack->GetTrackID() <<
", track pos: "<<aTrack->GetPosition() <<
", mom: "<<aTrack->GetMomentum()
229 <<
", parentID " << aTrack->GetParentID() <<
")";
230 G4Exception(
"iGeant4::TrackProcessorUserActionPassBack",
"NoTrackInformation", FatalException,
description);
267 aTrack->SetTrackStatus( fStopAndKill );
Define macros for attributes used to control the static checker.
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
#define ATLAS_THREAD_SAFE
ISF::ISFParticleContainer m_storedSecondaries
AtlasG4EventUserInfo * m_atlasG4EvtUserInfo
event-global G4 UserInformation
ISF::IParticleBroker * m_particleBrokerQuick
quick access avoiding gaudi overhead
ISF::ISFParticle * newISFParticle(G4Track *aTrack, const ISF::ISFParticle *parent, HepMC::GenParticlePtr currentGenParticle, AtlasDetDescr::AtlasRegion nextGeoID)
ISF::TruthBinding * newTruthBinding(const G4Track *aTrack, HepMC::GenParticlePtr currentGenParticle) const
create a new TruthBinding object for the given G4Track (may return 0 if unable)
TrackProcessorUserActionPassBack(const Config &config)
void ISFSteppingAction(const G4Step *, ISF::ISFParticle *curISP) override final
Called by the base class after the G4Track->ISFParticle association has been established.
ISF::IGeoIDSvc * m_geoIDSvcQuick
quick access avoiding gaudi overhead
void returnParticleToISF(G4Track *aTrack, const ISF::ISFParticle *parentISP, HepMC::GenParticlePtr currentGenParticle, AtlasDetDescr::AtlasRegion nextGeoID)
kills the given G4Track, converts it into an ISFParticle and returns it to the ISF particle broker
The generic ISF particle definition,.
const TruthBinding * getTruthBinding() const
pointer to the simulation truth - optional, can be 0
void setNextSimID(SimSvcID simID)
register the next SimSvcID
SimSvcID nextSimID() const
the next simulation service the particle will be sent to
void setNextGeoID(AtlasDetDescr::AtlasRegion geoID)
register the next AtlasDetDescr::AtlasRegion
AtlasDetDescr::AtlasRegion nextGeoID() const
next geoID the particle will be simulated in
void setTruthBinding(TruthBinding *truth)
static VTrackInformation * getISFTrackInfo(const G4Track &aTrack)
return a valid UserInformation object of the G4Track for use within the ISF
static ISF::ISFParticle * convertG4TrackToISFParticle(const G4Track &aTrack, const ISF::ISFParticle &parent, ISF::TruthBinding *truth=nullptr)
convert the given G4Track into an ISFParticle
static TrackInformation * attachTrackInfoToNewG4Track(G4Track &aTrack, ISF::ISFParticle &baseIsp, VTrackInformation::TrackClassification classification, HepMC::GenParticlePtr generationZeroGenParticle=nullptr)
attach a new TrackInformation object to the given new (!) G4Track (the G4Track must not have a UserIn...
std::string description
glabal timer - how long have I taken so far?
AtlasRegion
A simple enum of ATLAS regions and sub-detectors.
GenParticle * GenParticlePtr