#include <G4BadIdeaAction.h>
Definition at line 29 of file G4BadIdeaAction.h.
larg4::G4BadIdeaAction::G4BadIdeaAction |
( |
int |
trkOption | ) |
|
Definition at line 21 of file G4BadIdeaAction.cxx.
27 mf::LogWarning(
"G4BadIdeaAction") <<
"instantiating the G4BadIdeaAction \n" 28 <<
"This UserAction is only to be used with " 29 <<
"Geant4 v4.9.4.p02 to solve a stepping bug.\n" 30 <<
"If you are using a different version of G4, " 31 <<
"remove this UserAction from your list in LArG4.cxx";
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
larg4::G4BadIdeaAction::~G4BadIdeaAction |
( |
| ) |
|
|
virtual |
void larg4::G4BadIdeaAction::SteppingAction |
( |
const G4Step * |
step | ) |
|
|
virtual |
- Todo:
- Do not copy the code below. Contact Brian Rebel, Eric Church,
- Todo:
- Bill Seligman and Andrzej Szelc for reasons why not to!
Definition at line 42 of file G4BadIdeaAction.cxx.
51 const double epsilon = 5000. * std::numeric_limits<double>::epsilon();
52 const double stepSize =
step->GetStepLength();
53 G4Track* nonConstTrack =
const_cast<G4Track*
>(
step->GetTrack() );
55 if (
step->GetTrack()->GetCurrentStepNumber() > 5e4
57 && (
step->GetTrack()->GetCurrentStepNumber()%1000) == 1 ){
64 const double kick = 0.001;
66 G4ThreeVector aValue = nonConstTrack->GetPosition();
68 mf::LogWarning(
"G4BadIdeaAction") <<
"##### In endless loop. Kicking particle by " 69 <<
" (+0.001,+0.001,+0.001) --- " 70 <<
" PDG and encoding " 71 <<
step->GetTrack()->GetDynamicParticle()->GetPDGcode()
73 <<
step->GetTrack()->GetDynamicParticle()->GetParticleDefinition()->GetParticleName()
74 <<
" current step number: " 75 <<
step->GetTrack()->GetCurrentStepNumber()
76 <<
" stepsize: " << stepSize
78 << aValue.x() <<
" " << aValue.y() <<
" " << aValue.z();
83 nonConstTrack->SetPosition(aValue);
90 G4StepPoint * thePrePoint =
step->GetPreStepPoint();
91 G4VPhysicalVolume * thePrePV = thePrePoint->GetPhysicalVolume();
92 G4String thePrePVname = thePrePV->GetName();
93 G4StepPoint * thePostPoint =
step->GetPostStepPoint();
94 G4VPhysicalVolume * thePostPV = thePostPoint->GetPhysicalVolume();
95 G4String thePostPVname(
"null");
96 if (thePostPV) thePostPVname = thePostPV->GetName();
98 if (
abs(
step->GetTrack()->GetDynamicParticle()->GetPDGcode()) == 13
99 && thePostPVname.contains(
"volTPCActive")
100 && !thePrePVname.contains(
"volTPCActive")
102 ((G4Track*)nonConstTrack)->SetTrackStatus(fStopAndKill);
std::string translate(errors::ErrorCodes)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
int larg4::G4BadIdeaAction::fNoIncomingMuons |
|
private |
The documentation for this class was generated from the following files: