ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
QuirkWatcher Class Reference

#include <QuirkWatcher.h>

Inheritance diagram for QuirkWatcher:
Collaboration diagram for QuirkWatcher:

Public Member Functions

 QuirkWatcher ()
 
virtual ~QuirkWatcher ()
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
virtual G4VParticleChange * PostStepDoIt (const G4Track &track, const G4Step &)
 
virtual G4double AlongStepGetPhysicalInteractionLength (const G4Track &, G4double, G4double, G4double &, G4GPILSelection *)
 
virtual G4double AtRestGetPhysicalInteractionLength (const G4Track &, G4ForceCondition *)
 
virtual G4VParticleChange * AlongStepDoIt (const G4Track &, const G4Step &)
 
virtual G4VParticleChange * AtRestDoIt (const G4Track &, const G4Step &)
 

Private Attributes

G4VParticleChange m_particleChange
 

Detailed Description

Definition at line 11 of file QuirkWatcher.h.

Constructor & Destructor Documentation

◆ QuirkWatcher()

QuirkWatcher::QuirkWatcher ( )

Definition at line 14 of file QuirkWatcher.cxx.

14  : G4VProcess(G4String("QuirkWatcher")) {
15  enableAtRestDoIt = false;
16  enableAlongStepDoIt = false;
17 }

◆ ~QuirkWatcher()

QuirkWatcher::~QuirkWatcher ( )
virtual

Definition at line 19 of file QuirkWatcher.cxx.

19 {}

Member Function Documentation

◆ AlongStepDoIt()

virtual G4VParticleChange* QuirkWatcher::AlongStepDoIt ( const G4Track &  ,
const G4Step &   
)
inlinevirtual

Definition at line 37 of file QuirkWatcher.h.

40  {return 0;}

◆ AlongStepGetPhysicalInteractionLength()

virtual G4double QuirkWatcher::AlongStepGetPhysicalInteractionLength ( const G4Track &  ,
G4double  ,
G4double  ,
G4double &  ,
G4GPILSelection *   
)
inlinevirtual

Definition at line 26 of file QuirkWatcher.h.

32  {return -1.0;}

◆ AtRestDoIt()

virtual G4VParticleChange* QuirkWatcher::AtRestDoIt ( const G4Track &  ,
const G4Step &   
)
inlinevirtual

Definition at line 41 of file QuirkWatcher.h.

44  {return 0;}

◆ AtRestGetPhysicalInteractionLength()

virtual G4double QuirkWatcher::AtRestGetPhysicalInteractionLength ( const G4Track &  ,
G4ForceCondition *   
)
inlinevirtual

Definition at line 33 of file QuirkWatcher.h.

36  {return -1.0;}

◆ PostStepDoIt()

G4VParticleChange * QuirkWatcher::PostStepDoIt ( const G4Track &  track,
const G4Step &   
)
virtual

Definition at line 30 of file QuirkWatcher.cxx.

33  {
34  // Get infracolor string
35  auto part_nc ATLAS_THREAD_SAFE = // track should really be non-const in Geant4 interface
36  const_cast<G4ParticleDefinition*>(track.GetParticleDefinition());
37  Quirk* quirkDef = dynamic_cast<Quirk*>(part_nc);
38  if (quirkDef == 0) {
39  G4Exception("QuirkWatcher::PostStepDoIt", "NonQuirk", FatalErrorInArgument, "QuirkWatcher run on non-quirk particle");
40  std::abort();
41  }
42  InfracolorForce& string = quirkDef->GetStringIn();
43 
44  if (track.GetCurrentStepNumber() > 1 && !string.IsSourceInitialized()) {
45  string.Clear();
46  string.GetReactionForce()->Clear();
47  G4Exception(
48  "QuirkWatcher::PostStepDoIt",
49  "QuirkMissingPartner",
50  EventMustBeAborted,
51  "QuirkWatcher: missing partner for quirk"
52  );
53  }
54 
55  // Update track status
56  G4TrackStatus stat = track.GetTrackStatus();
57  if (stat == fStopButAlive) {
58  stat = fAlive;
59  }
60  if (stat == fAlive || stat == fSuspend) {
61  G4bool passControl = !string.HasNextStringVector();
62  //G4bool passControl = !string.HasNextStringVector() || (string.GetSumStrings().t() < string.GetReactionForce()->GetSumStrings().t());
63  if (passControl) {
64  if (string.IsSourceAlive()) {
65  stat = fSuspend;
66  } else {
67  stat = fStopAndKill;
68  }
69  }
70  }
71  if (stat == fStopAndKill || stat == fKillTrackAndSecondaries) {
72  string.TrackKilled();
73  }
74 
75  m_particleChange.Initialize(track);
76  m_particleChange.ProposeTrackStatus(stat);
77  return &m_particleChange;
78 }

◆ PostStepGetPhysicalInteractionLength()

G4double QuirkWatcher::PostStepGetPhysicalInteractionLength ( const G4Track &  track,
G4double  previousStepSize,
G4ForceCondition *  condition 
)
virtual

Definition at line 21 of file QuirkWatcher.cxx.

25  {
26  *condition = StronglyForced;
27  return DBL_MAX;
28 }

Member Data Documentation

◆ m_particleChange

G4VParticleChange QuirkWatcher::m_particleChange
private

Definition at line 47 of file QuirkWatcher.h.


The documentation for this class was generated from the following files:
Quirk::GetStringIn
const InfracolorForce & GetStringIn() const
Definition: Quirk.h:29
LArG4GenerateShowerLib.condition
condition
Definition: LArG4GenerateShowerLib.py:19
QuirkWatcher::m_particleChange
G4VParticleChange m_particleChange
Definition: QuirkWatcher.h:47
Quirk
Definition: Quirk.h:12
InfracolorForce
Definition: InfracolorForce.h:14
InfracolorForce::Clear
void Clear()
Definition: InfracolorForce.cxx:57
beamspotman.stat
stat
Definition: beamspotman.py:266
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211