Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
F01RunAction Class Reference

#include <Doxymodules_field.h>

Inheritance diagram for F01RunAction:
G4UserRunAction

Public Member Functions

 F01RunAction ()=default
 
 ~F01RunAction () override=default
 
void BeginOfRunAction (const G4Run *aRun) override
 
void EndOfRunAction (const G4Run *aRun) override
 
void ChangeLooperParameters (const G4ParticleDefinition *particleDef)
 
G4TransportationFindTransportation (const G4ParticleDefinition *particleDef, bool reportError=true)
 
void SetNumberOfTrials (G4int val)
 
void SetWarningEnergy (G4double val)
 
void SetImportantEnergy (G4double val)
 
G4int GetNumberOfTrials ()
 
G4double GetWarningEnergy ()
 
G4double GetImportantEnergy ()
 

Private Attributes

G4int fNumberOfTrials = 15
 
G4double fWarningEnergy = 1.0 * CLHEP::kiloelectronvolt
 
G4double fImportantEnergy = 10.0 * CLHEP::kiloelectronvolt
 
G4int fVerboseLevel = 0
 

Detailed Description

Definition at line 43 of file Doxymodules_field.h.

Constructor & Destructor Documentation

◆ F01RunAction()

F01RunAction::F01RunAction ( )
default

◆ ~F01RunAction()

F01RunAction::~F01RunAction ( )
overridedefault

Member Function Documentation

◆ BeginOfRunAction()

void F01RunAction::BeginOfRunAction ( const G4Run aRun)
override

Definition at line 39 of file F01RunAction.cc.

39 {
40 G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
41
42 G4cout << " Calling F01RunAction::ChangeLooperParameters() " << G4endl;
43 ChangeLooperParameters( G4Electron::Definition() );
44}
void ChangeLooperParameters(const G4ParticleDefinition *particleDef)

◆ EndOfRunAction()

void F01RunAction::EndOfRunAction ( const G4Run aRun)
override

Definition at line 103 of file F01RunAction.cc.

103 {
104 if( fVerboseLevel > 1 )
105 G4cout << G4endl << G4endl
106 << " ########### Track Statistics for Transportation process(es) "
107 << " ########### " << G4endl
108 << " ############################################## "
109 << " ####################### " << G4endl << G4endl;
110
111 auto transport= FindTransportation( G4Electron::Definition() );
112 if( transport) {
113 transport->PrintStatistics(G4cout);
114 }
115}
G4int fVerboseLevel
G4Transportation * FindTransportation(const G4ParticleDefinition *particleDef, bool reportError=true)

◆ ChangeLooperParameters()

void F01RunAction::ChangeLooperParameters ( const G4ParticleDefinition particleDef)

Definition at line 48 of file F01RunAction.cc.

50{
51 if( particleDef == nullptr )
52 particleDef = G4Electron::Definition();
53 auto transport= FindTransportation( particleDef );
54
55 // Note that all particles that share the same Transportation
56 // (or Coupled Transportation) process (with this particle)
57 // will be affected by this change
58 // -- to change these parameters by particle type, the values
59 // must instead be changed/reset in a (Start) Tracking Action.
60
61 G4cout << " ChangeLooperParameters called with particle type "
62 << particleDef->GetParticleName()
63 << " transport process: ";
64 if( transport != nullptr ) {
65 G4cout << transport->GetProcessName();
66 } else {
67 G4cout << " UNKNOWN -- it is neither G4Transportation nor G4CoupledTransportation";
68 }
69 G4cout << G4endl;
70
71 if( transport != nullptr ) {
72 if( fWarningEnergy >= 0.0 ){
73 transport->SetThresholdWarningEnergy( fWarningEnergy );
74 G4cout << "-- Changed Threshold Warning Energy (for loopers) = "
75 << fWarningEnergy / CLHEP::MeV << " MeV " << G4endl;
76 }
77 if( fImportantEnergy >= 0.0 ) {
78 transport->SetThresholdImportantEnergy( fImportantEnergy );
79
80 G4cout << "-- Changed Threshold Important Energy (for loopers) = "
81 << fImportantEnergy / CLHEP::MeV << " MeV " << G4endl;
82 }
83
84 if( fNumberOfTrials > 0 ) {
85 transport->SetThresholdTrials( fNumberOfTrials );
86
87 G4cout << "-- Changed number of Trials (for loopers) = " << fNumberOfTrials << G4endl;
88 }
89 }
90
91 if( transport == nullptr ) {
92 if( fWarningEnergy >= 0.0 )
93 G4cerr << " Unknown transport process> Cannot change Warning Energy. " << G4endl;
94 if( fImportantEnergy >= 0.0 )
95 G4cerr << " Unknown transport process> Cannot change 'Important' Energy. " << G4endl;
96 if( fNumberOfTrials > 0 )
97 G4cerr << " Unknown transport process> Cannot change number of trials. " << G4endl;
98 }
99}
G4int fNumberOfTrials
G4double fImportantEnergy
G4double fWarningEnergy

◆ FindTransportation()

G4Transportation * F01RunAction::FindTransportation ( const G4ParticleDefinition particleDef,
bool  reportError = true 
)

Definition at line 120 of file F01RunAction.cc.

122{
123 const auto *partPM= particleDef->GetProcessManager();
124
125 G4VProcess* partTransport = partPM->GetProcess("Transportation");
126 auto transport= dynamic_cast<G4Transportation*>(partTransport);
127
128 if( !transport ){
129 partTransport = partPM->GetProcess("CoupledTransportation");
130 auto coupledTransport=
131 dynamic_cast<G4CoupledTransportation*>(partTransport);
132 if( coupledTransport ) {
133 transport= coupledTransport;
134 } else {
135 partTransport = partPM->GetProcess("TransportationWithMsc");
136 auto transportWithMsc=
137 dynamic_cast<G4CoupledTransportation*>(partTransport);
138 if( transportWithMsc ) {
139 transport= transportWithMsc;
140 }
141 }
142 }
143
144 if( reportError && !transport )
145 {
146 G4cerr << "Unable to find Transportation process for particle type "
147 << particleDef->GetParticleName()
148 << " ( PDG code = " << particleDef->GetPDGEncoding() << " ) "
149 << G4endl;
150 }
151
152 return transport;
153}

◆ SetNumberOfTrials()

void F01RunAction::SetNumberOfTrials ( G4int  val)
inline

Definition at line 58 of file F01RunAction.hh.

58{ fNumberOfTrials = val; }

◆ SetWarningEnergy()

void F01RunAction::SetWarningEnergy ( G4double  val)
inline

Definition at line 59 of file F01RunAction.hh.

59{ fWarningEnergy = val; }

◆ SetImportantEnergy()

void F01RunAction::SetImportantEnergy ( G4double  val)
inline

Definition at line 60 of file F01RunAction.hh.

60{ fImportantEnergy = val; }

◆ GetNumberOfTrials()

G4int F01RunAction::GetNumberOfTrials ( )
inline

Definition at line 61 of file F01RunAction.hh.

61{ return fNumberOfTrials; }

◆ GetWarningEnergy()

G4double F01RunAction::GetWarningEnergy ( )
inline

Definition at line 62 of file F01RunAction.hh.

62{ return fWarningEnergy; }

◆ GetImportantEnergy()

G4double F01RunAction::GetImportantEnergy ( )
inline

Definition at line 63 of file F01RunAction.hh.

63{ return fImportantEnergy; }

Member Data Documentation

◆ fNumberOfTrials

G4int F01RunAction::fNumberOfTrials = 15
private

Definition at line 68 of file F01RunAction.hh.

◆ fWarningEnergy

G4double F01RunAction::fWarningEnergy = 1.0 * CLHEP::kiloelectronvolt
private

Definition at line 69 of file F01RunAction.hh.

◆ fImportantEnergy

G4double F01RunAction::fImportantEnergy = 10.0 * CLHEP::kiloelectronvolt
private

Definition at line 70 of file F01RunAction.hh.

◆ fVerboseLevel

G4int F01RunAction::fVerboseLevel = 0
private

Definition at line 75 of file F01RunAction.hh.


The documentation for this class was generated from the following files:

Applications | User Support | Publications | Collaboration