|
ATLAS Offline Software
|
#include <TrackProcessorUserActionPassBack.h>
|
void | ISFSteppingAction (const G4Step *, ISF::ISFParticle *curISP) override final |
| Called by the base class after the G4Track->ISFParticle association has been established. More...
|
|
ISF::TruthBinding * | newTruthBinding (const G4Track *aTrack, HepMC::GenParticlePtr currentGenParticle) const |
| create a new TruthBinding object for the given G4Track (may return 0 if unable) More...
|
|
ISF::ISFParticle * | newISFParticle (G4Track *aTrack, const ISF::ISFParticle *parent, HepMC::GenParticlePtr currentGenParticle, AtlasDetDescr::AtlasRegion nextGeoID) |
|
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 More...
|
|
void | setupPrimary (G4Track &) |
| Setup the given G4Track as the current primary particle which we'll process. More...
|
|
void | setupSecondary (const G4Track &) |
| Setup the given G4Track as the current secondary particle which we'll process. More...
|
|
void | updateCachedParticleInfo (ISF::ISFParticle *baseISFParticle, HepMC::ConstGenParticlePtr primaryGenParticle, HepMC::GenParticlePtr currentGenParticle) |
| Set the following information as the currently traced particle. More...
|
|
VTrackInformation::TrackClassification | classify (HepMC::ConstGenParticlePtr primaryGenParticle, HepMC::ConstGenParticlePtr generationZeroGenParticle, HepMC::ConstGenParticlePtr currentGenParticle, int regenerationNumber) const |
| Classify the particle represented by the given set of truth links. More...
|
|
◆ TrackProcessorUserActionPassBack()
G4UA::iGeant4::TrackProcessorUserActionPassBack::TrackProcessorUserActionPassBack |
( |
const Config & |
config | ) |
|
Definition at line 44 of file TrackProcessorUserActionPassBack.cxx.
49 G4cout <<
"Initializing TrackProcessorUserActionPassBack" << G4endl;
56 G4Exception(
"iGeant4::TrackProcessorUserActionPassBack",
"NoISFParticleBroker", FatalException,
description);
66 G4Exception(
"iGeant4::TrackProcessorUserActionPassBack",
"NoISFGeoIDSvc", FatalException,
description);
◆ BeginOfEventAction()
void G4UA::iGeant4::TrackProcessorUserActionBase::BeginOfEventAction |
( |
const G4Event * |
| ) |
|
|
finaloverridevirtualinherited |
◆ classify()
Classify the particle represented by the given set of truth links.
Definition at line 208 of file TrackProcessorUserActionBase.cxx.
215 if (currentGenParticle) {
216 if (currentGenParticle == primaryGenParticle) {
219 else if (generationZeroGenParticle == primaryGenParticle && regenerationNumber>0) {
◆ EndOfEventAction()
void G4UA::iGeant4::TrackProcessorUserActionBase::EndOfEventAction |
( |
const G4Event * |
| ) |
|
|
finaloverridevirtualinherited |
◆ ISFSteppingAction()
void G4UA::iGeant4::TrackProcessorUserActionPassBack::ISFSteppingAction |
( |
const G4Step * |
aStep, |
|
|
ISF::ISFParticle * |
curISP |
|
) |
| |
|
finaloverrideprivatevirtual |
Called by the base class after the G4Track->ISFParticle association has been established.
Implements G4UA::iGeant4::TrackProcessorUserActionBase.
Definition at line 77 of file TrackProcessorUserActionPassBack.cxx.
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 ) {
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 ) {
195 aTrack_2nd->SetTrackStatus( fStopAndKill );
210 generationZeroGenParticle );
◆ newISFParticle()
◆ newTruthBinding()
create a new TruthBinding object for the given G4Track (may return 0 if unable)
Definition at line 222 of file TrackProcessorUserActionPassBack.cxx.
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);
◆ PostUserTrackingAction()
void G4UA::iGeant4::TrackProcessorUserActionBase::PostUserTrackingAction |
( |
const G4Track * |
| ) |
|
|
finaloverridevirtualinherited |
◆ PreUserTrackingAction()
void G4UA::iGeant4::TrackProcessorUserActionBase::PreUserTrackingAction |
( |
const G4Track * |
aTrack | ) |
|
|
overridevirtualinherited |
◆ returnParticleToISF()
kills the given G4Track, converts it into an ISFParticle and returns it to the ISF particle broker
Definition at line 261 of file TrackProcessorUserActionPassBack.cxx.
267 aTrack->SetTrackStatus( fStopAndKill );
◆ ReturnSecondaries()
◆ setupPrimary()
void G4UA::iGeant4::TrackProcessorUserActionBase::setupPrimary |
( |
G4Track & |
aTrack | ) |
|
|
privateinherited |
Setup the given G4Track as the current primary particle which we'll process.
Definition at line 111 of file TrackProcessorUserActionBase.cxx.
121 <<
"Started simulation of primary particle which already has a TrackInformation/TrackBarcodeInfo object attached (trackID: "
122 << aTrack.GetTrackID() <<
", track pos: "<<aTrack.GetPosition() <<
", mom: "<<aTrack.GetMomentum()
123 <<
", parentID " << aTrack.GetParentID() <<
")";
124 G4Exception(
"iGeant4::TrackProcessorUserActionBase",
"TrackInformationAlreadyExists", FatalException,
description);
128 auto* primaryPartInfo =
dynamic_cast <PrimaryParticleInformation*
> (aTrack.GetDynamicParticle()->GetPrimaryParticle()->GetUserInformation());
129 if (!primaryPartInfo) {
131 description << G4String(
"PreUserTrackingAction: ") +
"NULL PrimaryParticleInformation pointer for current G4Step (trackID "
132 << aTrack.GetTrackID() <<
", track pos: "<<aTrack.GetPosition() <<
", mom: "<<aTrack.GetMomentum()
133 <<
", parentID " << aTrack.GetParentID() <<
")";
134 G4Exception(
"iGeant4::TrackProcessorUserActionBase",
"NoPPInfo", FatalException,
description);
139 auto* baseISP = primaryPartInfo->GetISFParticle();
142 description << G4String(
"PreUserTrackingAction: ") +
"No ISFParticle associated with primary particle (trackID: "
143 << aTrack.GetTrackID() <<
", track pos: "<<aTrack.GetPosition() <<
", mom: "<<aTrack.GetMomentum()
144 <<
", parentID " << aTrack.GetParentID() <<
")";
145 G4Exception(
"iGeant4::TrackProcessorUserActionBase",
"NoISFParticle", FatalException,
description);
152 description << G4String(
"PreUserTrackingAction: ") +
"No ISF::TruthBinding associated with primary particle (trackID: "
153 << aTrack.GetTrackID() <<
", track pos: "<<aTrack.GetPosition() <<
", mom: "<<aTrack.GetMomentum()
154 <<
", parentID " << aTrack.GetParentID() <<
")";
155 G4Exception(
"iGeant4::TrackProcessorUserActionBase",
"NoISFTruthBinding", FatalException,
description);
159 int regenerationNr = primaryPartInfo->GetRegenerationNr();
165 auto classification =
classify(primaryGenParticle,
166 generationZeroGenParticle,
173 generationZeroGenParticle );
174 newTrackInfo->SetRegenerationNr(regenerationNr);
◆ setupSecondary()
void G4UA::iGeant4::TrackProcessorUserActionBase::setupSecondary |
( |
const G4Track & |
aTrack | ) |
|
|
privateinherited |
◆ updateCachedParticleInfo()
◆ UserSteppingAction()
void G4UA::iGeant4::TrackProcessorUserActionBase::UserSteppingAction |
( |
const G4Step * |
aStep | ) |
|
|
finaloverridevirtualinherited |
Definition at line 62 of file TrackProcessorUserActionBase.cxx.
77 const std::vector<const G4Track*> *secondaryVector = aStep->GetSecondaryInCurrentStep();
78 for (
auto* aConstSecondaryTrack : *secondaryVector ) {
80 G4Track* aSecondaryTrack
ATLAS_THREAD_SAFE =
const_cast<G4Track*
>( aConstSecondaryTrack );
86 if (!particleReturnedToISF) {
91 generationZeroGenParticle );
◆ m_atlasG4EvtUserInfo
◆ m_config
Config G4UA::iGeant4::TrackProcessorUserActionPassBack::m_config |
|
private |
◆ m_curBaseISP
◆ m_geoIDSvcQuick
ISF::IGeoIDSvc* G4UA::iGeant4::TrackProcessorUserActionPassBack::m_geoIDSvcQuick {} |
|
private |
◆ m_particleBrokerQuick
◆ m_storedSecondaries
The documentation for this class was generated from the following files:
std::list< ISF::ISFParticle * > ISFParticleContainer
generic ISFParticle container (not necessarily a std::list!)
void SetCurrentPrimaryGenParticle(HepMC::ConstGenParticlePtr p)
set m_currentPrimaryGenParticle, the pointer to the HepMC::GenParticle used to create the current G4P...
void setNextGeoID(AtlasDetDescr::AtlasRegion geoID)
register the next AtlasDetDescr::AtlasRegion
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...
void setTruthBinding(TruthBinding *truth)
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
virtual void push(ISFParticle *particle, const ISFParticle *parent)=0
hand a new ISF particle to the broker
HepMC::GenParticlePtr getCurrentGenParticle()
pointer to the particle in the simulation truth
VTrackInformation::TrackClassification classify(HepMC::ConstGenParticlePtr primaryGenParticle, HepMC::ConstGenParticlePtr generationZeroGenParticle, HepMC::ConstGenParticlePtr currentGenParticle, int regenerationNumber) const
Classify the particle represented by the given set of truth links.
GenParticle * GenParticlePtr
ISF::IParticleBroker * m_particleBrokerQuick
quick access avoiding gaudi overhead
ISF::IGeoIDSvc * m_geoIDSvcQuick
quick access avoiding gaudi overhead
ISF::TruthBinding * newTruthBinding(const G4Track *aTrack, HepMC::GenParticlePtr currentGenParticle) const
create a new TruthBinding object for the given G4Track (may return 0 if unable)
virtual void ISFSteppingAction(const G4Step *, ISF::ISFParticle *)=0
This method is called by TrackProcessorUserActionBase after the G4Track->ISFParticle association has ...
ServiceHandle< ISF::IGeoIDSvc > geoIDSvc
ISF::ISFParticle * newISFParticle(G4Track *aTrack, const ISF::ISFParticle *parent, HepMC::GenParticlePtr currentGenParticle, AtlasDetDescr::AtlasRegion nextGeoID)
HepMC::GenParticlePtr GetCurrentGenParticle()
return a pointer to the GenParticle corresponding to the current G4Track (if there is one).
double passBackEkinThreshold
properties to define which particles are returned to ISF
ISF::ISFParticleContainer m_storedSecondaries
AtlasDetDescr::AtlasRegion nextGeoID() const
next geoID the particle will be simulated in
HepMC::GenParticlePtr getGenerationZeroGenParticle()
pointer to the simulation truth particle before any regeneration happened (eg.
static AtlasG4EventUserInfo * getAtlasG4EventUserInfo()
return pointer to current AtlasG4EventUserInfo
void setupSecondary(const G4Track &)
Setup the given G4Track as the current secondary particle which we'll process.
static ISF::ISFParticle * convertG4TrackToISFParticle(const G4Track &aTrack, const ISF::ISFParticle &parent, ISF::TruthBinding *truth=nullptr)
convert the given G4Track into an ISFParticle
AtlasG4EventUserInfo * m_atlasG4EvtUserInfo
event-global G4 UserInformation
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
ServiceHandle< ISF::IParticleBroker > particleBroker
void updateCachedParticleInfo(ISF::ISFParticle *baseISFParticle, HepMC::ConstGenParticlePtr primaryGenParticle, HepMC::GenParticlePtr currentGenParticle)
Set the following information as the currently traced particle.
void setNextSimID(SimSvcID simID)
register the next SimSvcID
void setupPrimary(G4Track &)
Setup the given G4Track as the current primary particle which we'll process.
This class is attached to G4PrimaryParticle objects as UserInformation. The member variable m_thePart...
virtual AtlasDetDescr::AtlasRegion identifyGeoID(const Amg::Vector3D &pos) const =0
A static filter that returns the AtlasRegion of the given ISFParticle (position) -> returns ISF::fUnd...
bool killBoundaryParticlesBelowThreshold
#define ATLAS_THREAD_SAFE
ISF::ISFParticle * m_curBaseISP
The most recent ISFParticle ancestor that triggers the currently processed G4Track.
static VTrackInformation * getISFTrackInfo(const G4Track &aTrack)
return a valid UserInformation object of the G4Track for use within the ISF
void SetCurrentGenParticle(HepMC::GenParticlePtr p)
set m_currentGenParticle, the pointer to the GenParticle corresponding to the current G4Track.
unsigned int verboseLevel
const TruthBinding * getTruthBinding() const
pointer to the simulation truth - optional, can be 0
@ isPrimary
true if matched track has a hit in first or second pixel layer
std::string description
glabal timer - how long have I taken so far?