Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4AdjointSimManager.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4AdjointCrossSurfChecker implementation
27//
28// --------------------------------------------------------------------
29// Class Name: G4AdjointCrossSurfChecker
30// Author: L. Desorgher, 2007-2009
31// Organisation: SpaceIT GmbH
32// Contract: ESA contract 21435/08/NL/AT
33// Customer: ESA/ESTEC
34// --------------------------------------------------------------------
35
37
44#include "G4ParticleTable.hh"
45#include "G4PhysicsLogVector.hh"
46#include "G4Run.hh"
47#include "G4RunManager.hh"
48#include "G4UserEventAction.hh"
49#include "G4UserRunAction.hh"
54
55// --------------------------------------------------------------------
56//
57G4ThreadLocal G4AdjointSimManager* G4AdjointSimManager::instance = nullptr;
58
59// --------------------------------------------------------------------
60//
61G4AdjointSimManager::G4AdjointSimManager()
62{
63 theAdjointPrimaryGeneratorAction = new G4AdjointPrimaryGeneratorAction();
64 theAdjointSteppingAction = new G4AdjointSteppingAction();
65 theAdjointTrackingAction = new G4AdjointTrackingAction(theAdjointSteppingAction);
66 theAdjointStackingAction = new G4AdjointStackingAction(theAdjointTrackingAction);
67 theAdjointTrackingAction->SetListOfPrimaryFwdParticles(
68 theAdjointPrimaryGeneratorAction->GetListOfPrimaryFwdParticles());
69
70 theMessenger = new G4AdjointSimMessenger(this);
71}
72
73// --------------------------------------------------------------------
74//
75G4AdjointSimManager::~G4AdjointSimManager()
76{
77 delete theAdjointRunAction;
78 delete theAdjointPrimaryGeneratorAction;
79 delete theAdjointSteppingAction;
80 delete theAdjointEventAction;
81 delete theAdjointTrackingAction;
82 delete theAdjointStackingAction;
83 delete theMessenger;
84}
85
86// --------------------------------------------------------------------
87//
89{
90 if (instance == nullptr) instance = new G4AdjointSimManager;
91 return instance;
92}
93
94// --------------------------------------------------------------------
95//
97{
98 if (G4RunManager::GetRunManager()->GetRunManagerType() != G4RunManager::sequentialRM)
99 return; // only for sequential mode
100 if (welcome_message) {
101 G4cout << "****************************************************************" << std::endl;
102 G4cout << "*** Geant4 Reverse/Adjoint Monte Carlo mode ***" << std::endl;
103 G4cout << "*** Author: L.Desorgher ***" << std::endl;
104 G4cout << "*** Company: SpaceIT GmbH, Bern, Switzerland ***" << std::endl;
105 G4cout << "*** Sponsored by: ESA/ESTEC contract contract 21435/08/NL/AT ***" << std::endl;
106 G4cout << "****************************************************************" << std::endl;
107 welcome_message = false;
108 }
109
110 // Switch to adjoint simulation mode
111 //---------------------------------------------------------
113
114 // Make the run
115 //------------
116 nb_evt_of_last_run = nb_evt;
118 G4int(nb_evt * theAdjointPrimaryGeneratorAction->GetNbOfAdjointPrimaryTypes()));
119
120 // Back to Fwd Simulation Mode
121 //--------------------------------
123}
124
125// --------------------------------------------------------------------
126//
127void G4AdjointSimManager::SetRestOfAdjointActions()
128{
129 G4RunManager* theRunManager = G4RunManager::GetRunManager();
130
131 if (!user_action_already_defined) DefineUserActions();
132
133 // Replace the user action by the adjoint actions
134 //-------------------------------------------------
135
136 theRunManager->G4RunManager::SetUserAction(theAdjointEventAction);
137 theRunManager->G4RunManager::SetUserAction(theAdjointSteppingAction);
138 theRunManager->G4RunManager::SetUserAction(theAdjointTrackingAction);
139}
140
141// --------------------------------------------------------------------
142//
144{
145 // Replace the user defined actions by the adjoint actions
146 //---------------------------------------------------------
147 SetAdjointActions();
148
149 // Update the list of primaries
150 //-----------------------------
151 theAdjointPrimaryGeneratorAction->UpdateListOfPrimaryParticles();
152 adjoint_sim_mode = true;
153 ID_of_last_particle_that_reach_the_ext_source = 0;
154}
155
156// --------------------------------------------------------------------
157//
159{
160 // Restore the user defined actions
161 //--------------------------------
162 ResetUserActions();
163 adjoint_sim_mode = false;
164}
165
166// --------------------------------------------------------------------
167//
168void G4AdjointSimManager::SetAdjointActions()
169{
170 G4RunManager* theRunManager = G4RunManager::GetRunManager();
171
172 if (!user_action_already_defined) DefineUserActions();
173
174 // Replace the user action by the adjoint actions
175 //-------------------------------------------------
176 theRunManager->G4RunManager::SetUserAction(this);
177 theRunManager->G4RunManager::SetUserAction(theAdjointPrimaryGeneratorAction);
178 theRunManager->G4RunManager::SetUserAction(theAdjointStackingAction);
179 if (use_user_StackingAction)
180 theAdjointStackingAction->SetUserFwdStackingAction(fUserStackingAction);
181 else
182 theAdjointStackingAction->SetUserFwdStackingAction(nullptr);
183 theRunManager->G4RunManager::SetUserAction(theAdjointEventAction);
184 theRunManager->G4RunManager::SetUserAction(theAdjointSteppingAction);
185 theRunManager->G4RunManager::SetUserAction(theAdjointTrackingAction);
186 if (use_user_TrackingAction)
187 theAdjointTrackingAction->SetUserForwardTrackingAction(fUserTrackingAction);
188 else
189 theAdjointTrackingAction->SetUserForwardTrackingAction(nullptr);
190}
191
192// --------------------------------------------------------------------
193//
194void G4AdjointSimManager::SetAdjointPrimaryRunAndStackingActions()
195{
196 G4RunManager* theRunManager = G4RunManager::GetRunManager();
197
198 if (!user_action_already_defined) DefineUserActions();
199
200 // Replace the user action by the adjoint actions
201 //-------------------------------------------------
202
203 theRunManager->G4RunManager::SetUserAction(theAdjointRunAction);
204 theRunManager->G4RunManager::SetUserAction(theAdjointPrimaryGeneratorAction);
205 theRunManager->G4RunManager::SetUserAction(theAdjointStackingAction);
206 if (use_user_StackingAction)
207 theAdjointStackingAction->SetUserFwdStackingAction(fUserStackingAction);
208 else
209 theAdjointStackingAction->SetUserFwdStackingAction(nullptr);
210}
211
212// --------------------------------------------------------------------
213//
214void G4AdjointSimManager::ResetUserActions()
215{
216 G4RunManager* theRunManager = G4RunManager::GetRunManager();
217
218 // Restore the user defined actions
219 //-------------------------------
220 theRunManager->G4RunManager::SetUserAction(fUserRunAction);
221 theRunManager->G4RunManager::SetUserAction(fUserEventAction);
222 theRunManager->G4RunManager::SetUserAction(fUserSteppingAction);
223 theRunManager->G4RunManager::SetUserAction(fUserTrackingAction);
224 theRunManager->G4RunManager::SetUserAction(fUserPrimaryGeneratorAction);
225 theRunManager->G4RunManager::SetUserAction(fUserStackingAction);
226}
227
228// --------------------------------------------------------------------
229//
230void G4AdjointSimManager::ResetRestOfUserActions()
231{
232 G4RunManager* theRunManager = G4RunManager::GetRunManager();
233
234 // Restore the user defined actions
235 //-------------------------------
236
237 theRunManager->G4RunManager::SetUserAction(fUserEventAction);
238 theRunManager->G4RunManager::SetUserAction(fUserSteppingAction);
239 theRunManager->G4RunManager::SetUserAction(fUserTrackingAction);
240}
241
242// --------------------------------------------------------------------
243//
244void G4AdjointSimManager::ResetUserPrimaryRunAndStackingActions()
245{
246 G4RunManager* theRunManager = G4RunManager::GetRunManager();
247 // Restore the user defined actions
248 //-------------------------------
249 theRunManager->G4RunManager::SetUserAction(fUserRunAction);
250 theRunManager->G4RunManager::SetUserAction(fUserPrimaryGeneratorAction);
251 theRunManager->G4RunManager::SetUserAction(fUserStackingAction);
252}
253
254// --------------------------------------------------------------------
255//
256void G4AdjointSimManager::DefineUserActions()
257{
258 G4RunManager* theRunManager = G4RunManager::GetRunManager();
259 fUserTrackingAction = const_cast<G4UserTrackingAction*>(theRunManager->GetUserTrackingAction());
260 fUserEventAction = const_cast<G4UserEventAction*>(theRunManager->GetUserEventAction());
261 fUserSteppingAction = const_cast<G4UserSteppingAction*>(theRunManager->GetUserSteppingAction());
262 theAdjointSteppingAction->SetUserForwardSteppingAction(fUserSteppingAction);
263 fUserPrimaryGeneratorAction =
265 fUserRunAction = const_cast<G4UserRunAction*>(theRunManager->GetUserRunAction());
266 fUserStackingAction = const_cast<G4UserStackingAction*>(theRunManager->GetUserStackingAction());
267 user_action_already_defined = true;
268}
269
270// --------------------------------------------------------------------
271//
273{
274 return theAdjointTrackingAction->GetIsAdjointTrackingMode();
275}
276
277// --------------------------------------------------------------------
278//
280{
281 adjoint_tracking_mode = aBool;
282
283 if (adjoint_tracking_mode) {
284 SetRestOfAdjointActions();
285 theAdjointStackingAction->SetAdjointMode(true);
286 theAdjointStackingAction->SetKillTracks(false);
287 }
288 else {
289 ResetRestOfUserActions();
290 theAdjointStackingAction->SetAdjointMode(false);
292 theAdjointStackingAction->SetKillTracks(false);
294 }
295 else
296 theAdjointStackingAction->SetKillTracks(true);
297 }
298}
299
300// --------------------------------------------------------------------
301//
306
307// --------------------------------------------------------------------
308//
309std::vector<G4ParticleDefinition*>* G4AdjointSimManager::GetListOfPrimaryFwdParticles()
310{
311 return theAdjointPrimaryGeneratorAction->GetListOfPrimaryFwdParticles();
312}
313
314// --------------------------------------------------------------------
315//
317{
318 return theAdjointPrimaryGeneratorAction->GetListOfPrimaryFwdParticles()->size();
319}
320
321// --------------------------------------------------------------------
322//
327
328// --------------------------------------------------------------------
329//
334
335// --------------------------------------------------------------------
336//
338{
339 return theAdjointTrackingAction->GetEkinAtEndOfLastAdjointTrack(i);
340}
341
342// --------------------------------------------------------------------
343//
345{
346 return theAdjointTrackingAction->GetEkinNucAtEndOfLastAdjointTrack(i);
347}
348
349// --------------------------------------------------------------------
350//
352{
353 return theAdjointTrackingAction->GetWeightAtEndOfLastAdjointTrack(i);
354}
355
356// --------------------------------------------------------------------
357//
359{
360 return theAdjointTrackingAction->GetCosthAtEndOfLastAdjointTrack(i);
361}
362
363// --------------------------------------------------------------------
364//
369
370// --------------------------------------------------------------------
371//
376
377// --------------------------------------------------------------------
378//
380{
381 return theAdjointTrackingAction->GetLastFwdParticleIndex(i);
382}
383
384// --------------------------------------------------------------------
385//
390
391// --------------------------------------------------------------------
392//
397
398// --------------------------------------------------------------------
399//
401{
402 last_pos = theAdjointSteppingAction->GetLastPosition();
403 last_direction = theAdjointSteppingAction->GetLastMomentum();
404 last_direction /= last_direction.mag();
405 last_cos_th = last_direction.z();
406 G4ParticleDefinition* aPartDef = theAdjointSteppingAction->GetLastPartDef();
407
408 last_fwd_part_name = aPartDef->GetParticleName();
409
410 last_fwd_part_name.erase(0, 4);
411
412 last_fwd_part_PDGEncoding =
414
415 std::vector<G4ParticleDefinition*>* aList =
416 theAdjointPrimaryGeneratorAction->GetListOfPrimaryFwdParticles();
417 last_fwd_part_index = -1;
418 G4int i = 0;
419 while (i < (G4int)aList->size() && last_fwd_part_index < 0) {
420 if ((*aList)[i]->GetParticleName() == last_fwd_part_name) last_fwd_part_index = i;
421 ++i;
422 }
423
424 last_ekin = theAdjointSteppingAction->GetLastEkin();
425 last_ekin_nuc = last_ekin;
426 if (aPartDef->GetParticleType() == "adjoint_nucleus") {
427 nb_nuc = static_cast<G4double>(aPartDef->GetBaryonNumber());
428 last_ekin_nuc /= nb_nuc;
429 }
430
431 last_weight = theAdjointSteppingAction->GetLastWeight();
432
433 last_pos_vec.push_back(last_pos);
434 last_direction_vec.push_back(last_direction);
435 last_ekin_vec.push_back(last_ekin);
436 last_ekin_nuc_vec.push_back(last_ekin_nuc);
437 last_cos_th_vec.push_back(last_cos_th);
438 last_weight_vec.push_back(last_weight);
439 last_fwd_part_PDGEncoding_vec.push_back(last_fwd_part_PDGEncoding);
440 last_fwd_part_index_vec.push_back(last_fwd_part_index);
441 ID_of_last_particle_that_reach_the_ext_source++;
442 ID_of_last_particle_that_reach_the_ext_source_vec.push_back(
443 ID_of_last_particle_that_reach_the_ext_source);
444}
445
446// --------------------------------------------------------------------
447//
449{
450 G4double area;
451 return G4AdjointCrossSurfChecker::GetInstance()->AddaSphericalSurface("ExternalSource", radius,
452 pos, area);
453}
454
455// --------------------------------------------------------------------
456//
458 G4double radius, const G4String& volume_name)
459{
460 G4double area;
461 G4ThreeVector center;
463 ->AddaSphericalSurfaceWithCenterAtTheCenterOfAVolume("ExternalSource", radius, volume_name,
464 center, area);
465}
466
467// --------------------------------------------------------------------
468//
470{
471 G4double area;
473 volume_name, area);
474}
475
476// --------------------------------------------------------------------
477//
479{
480 theAdjointSteppingAction->SetExtSourceEMax(Emax);
481}
482
483// --------------------------------------------------------------------
484//
486{
487 G4double area;
489 radius, pos, area);
490 theAdjointPrimaryGeneratorAction->SetSphericalAdjointPrimarySource(radius, pos);
491 area_of_the_adjoint_source = area;
492 return aBool;
493}
494
495// --------------------------------------------------------------------
496//
498 G4double radius, const G4String& volume_name)
499{
500 G4double area;
501 G4ThreeVector center;
502 G4bool aBool =
504 "AdjointSource", radius, volume_name, center, area);
505 theAdjointPrimaryGeneratorAction->SetSphericalAdjointPrimarySource(radius, center);
506 area_of_the_adjoint_source = area;
507 return aBool;
508}
509
510// --------------------------------------------------------------------
511//
513{
514 G4double area;
516 "AdjointSource", volume_name, area);
517 area_of_the_adjoint_source = area;
518 if (aBool) {
519 theAdjointPrimaryGeneratorAction->SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume(volume_name);
520 }
521 return aBool;
522}
523
524// --------------------------------------------------------------------
525//
527{
528 theAdjointPrimaryGeneratorAction->SetEmin(Emin);
529}
530
531// --------------------------------------------------------------------
532//
534{
535 theAdjointPrimaryGeneratorAction->SetEmax(Emax);
536}
537
538// --------------------------------------------------------------------
539//
541{
542 theAdjointPrimaryGeneratorAction->ConsiderParticleAsPrimary(particle_name);
543}
544
545// --------------------------------------------------------------------
546//
548{
549 theAdjointPrimaryGeneratorAction->NeglectParticleAsPrimary(particle_name);
550}
551
552// --------------------------------------------------------------------
553//
555 G4ParticleDefinition* fwdIon)
556{
557 theAdjointPrimaryGeneratorAction->SetPrimaryIon(adjointIon, fwdIon);
558}
559
560// --------------------------------------------------------------------
561//
563{
564 return theAdjointPrimaryGeneratorAction->GetPrimaryIonName();
565}
566
567// --------------------------------------------------------------------
568//
570{
571 theAdjointPrimaryWeight = aWeight;
572 theAdjointSteppingAction->SetPrimWeight(aWeight);
573}
574
575// --------------------------------------------------------------------
576//
578{
579 theAdjointEventAction = anAction;
580}
581
582// --------------------------------------------------------------------
583//
585{
586 theAdjointSteppingAction->SetUserAdjointSteppingAction(anAction);
587}
588
589// --------------------------------------------------------------------
590//
592{
593 theAdjointStackingAction->SetUserAdjointStackingAction(anAction);
594}
595
596// --------------------------------------------------------------------
597//
599{
600 theAdjointRunAction = anAction;
601}
602
603// --------------------------------------------------------------------
604//
606{
607 theAdjointPrimaryGeneratorAction->SetNbPrimaryFwdGammasPerEvent(nb);
608}
609
610// --------------------------------------------------------------------
611//
613{
614 theAdjointPrimaryGeneratorAction->SetNbAdjointPrimaryGammasPerEvent(nb);
615}
616
617// --------------------------------------------------------------------
618//
623
624// --------------------------------------------------------------------
625//
627{
628 fUserRunAction->BeginOfRunAction(aRun);
629}
630
631// --------------------------------------------------------------------
632//
634{
635 if (!adjoint_sim_mode) {
636 if (fUserRunAction != nullptr) fUserRunAction->EndOfRunAction(aRun);
637 }
638 else if (theAdjointRunAction != nullptr)
639 theAdjointRunAction->EndOfRunAction(aRun);
640}
641
642// --------------------------------------------------------------------
643//
648
649// --------------------------------------------------------------------
650//
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4GLOB_DLL std::ostream G4cout
double z() const
double mag() const
G4bool AddaSphericalSurface(const G4String &SurfaceName, G4double radius, G4ThreeVector pos, G4double &area)
G4bool AddanExtSurfaceOfAvolume(const G4String &SurfaceName, const G4String &volume_name, G4double &area)
static G4AdjointCrossSurfChecker * GetInstance()
G4bool AddaSphericalSurfaceWithCenterAtTheCenterOfAVolume(const G4String &SurfaceName, G4double radius, const G4String &volume_name, G4ThreeVector &center, G4double &area)
std::vector< G4ParticleDefinition * > * GetListOfPrimaryFwdParticles()
void ConsiderParticleAsPrimary(const G4String &particle_name)
void SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume(const G4String &volume_name)
void SetSphericalAdjointPrimarySource(G4double radius, G4ThreeVector pos)
G4ParticleDefinition * GetLastGeneratedFwdPrimaryParticle()
void NeglectParticleAsPrimary(const G4String &particle_name)
void SetPrimaryIon(G4ParticleDefinition *adjointIon, G4ParticleDefinition *fwdIon)
void SetAdjointStackingAction(G4UserStackingAction *anAction)
G4bool DefineAdjointSourceOnTheExtSurfaceOfAVolume(const G4String &volume_name)
const G4String & GetPrimaryIonName()
G4bool DefineExtSourceOnTheExtSurfaceOfAVolume(const G4String &volume_name)
G4double GetEkinAtEndOfLastAdjointTrack(std::size_t i=0)
G4int GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack(std::size_t i=0)
G4bool GetDidAdjParticleReachTheExtSource()
std::vector< G4ParticleDefinition * > * GetListOfPrimaryFwdParticles()
void RunAdjointSimulation(G4int nb_evt)
G4double GetCosthAtEndOfLastAdjointTrack(std::size_t i=0)
void BeginOfRunAction(const G4Run *aRun) override
const G4String & GetFwdParticleNameAtEndOfLastAdjointTrack()
G4bool DefineSphericalExtSourceWithCentreAtTheCentreOfAVolume(G4double radius, const G4String &volume_name)
void SetNbAdjointPrimaryGammasPerEvent(G4int)
void SetAdjointTrackingMode(G4bool aBool)
void ConsiderParticleAsPrimary(const G4String &particle_name)
std::size_t GetNbOfPrimaryFwdParticles()
void SetAdjointRunAction(G4UserRunAction *anAction)
void SetExtSourceEmax(G4double Emax)
void SetAdjointSourceEmax(G4double Emax)
void RegisterAdjointPrimaryWeight(G4double aWeight)
void SetAdjointSourceEmin(G4double Emin)
G4double GetWeightAtEndOfLastAdjointTrack(std::size_t i=0)
void ResetDidOneAdjPartReachExtSourceDuringEvent()
void SetAdjointEventAction(G4UserEventAction *anAction)
void NeglectParticleAsPrimary(const G4String &particle_name)
G4bool DefineSphericalAdjointSourceWithCentreAtTheCentreOfAVolume(G4double radius, const G4String &volume_name)
void SetNbAdjointPrimaryElectronsPerEvent(G4int)
static G4AdjointSimManager * GetInstance()
G4int GetFwdParticleIndexAtEndOfLastAdjointTrack(std::size_t i=0)
G4double GetEkinNucAtEndOfLastAdjointTrack(std::size_t i=0)
void SetNbOfPrimaryFwdGammasPerEvent(G4int)
G4ThreeVector GetDirectionAtEndOfLastAdjointTrack(std::size_t i=0)
G4ParticleDefinition * GetLastGeneratedFwdPrimaryParticle()
void SetAdjointSteppingAction(G4UserSteppingAction *anAction)
G4bool DefineSphericalExtSource(G4double radius, G4ThreeVector pos)
G4ThreeVector GetPositionAtEndOfLastAdjointTrack(std::size_t i=0)
std::size_t GetNbOfAdointTracksReachingTheExternalSurface()
G4bool DefineSphericalAdjointSource(G4double radius, G4ThreeVector pos)
void SetPrimaryIon(G4ParticleDefinition *adjointIon, G4ParticleDefinition *fwdIon)
void EndOfRunAction(const G4Run *aRun) override
void SetUserFwdStackingAction(G4UserStackingAction *anAction)
void SetUserAdjointStackingAction(G4UserStackingAction *anAction)
G4ParticleDefinition * GetLastPartDef()
void SetUserForwardSteppingAction(G4UserSteppingAction *anAction)
void SetExtSourceEMax(G4double Emax)
void SetUserAdjointSteppingAction(G4UserSteppingAction *anAction)
void SetPrimWeight(G4double weight)
G4double GetEkinAtEndOfLastAdjointTrack(std::size_t i=0)
void SetListOfPrimaryFwdParticles(std::vector< G4ParticleDefinition * > *aListOfParticles)
G4double GetEkinNucAtEndOfLastAdjointTrack(std::size_t i=0)
G4ThreeVector GetPositionAtEndOfLastAdjointTrack(std::size_t i=0)
const G4String & GetFwdParticleNameAtEndOfLastAdjointTrack()
G4int GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack(std::size_t i=0)
G4double GetWeightAtEndOfLastAdjointTrack(std::size_t i=0)
std::size_t GetNbOfAdointTracksReachingTheExternalSurface()
G4ThreeVector GetDirectionAtEndOfLastAdjointTrack(std::size_t i=0)
G4int GetLastFwdParticleIndex(std::size_t i=0)
G4double GetCosthAtEndOfLastAdjointTrack(std::size_t i=0)
void SetUserForwardTrackingAction(G4UserTrackingAction *anAction)
const G4String & GetParticleType() const
const G4String & GetParticleName() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
const G4UserTrackingAction * GetUserTrackingAction() const
const G4VUserPrimaryGeneratorAction * GetUserPrimaryGeneratorAction() const
const G4UserEventAction * GetUserEventAction() const
static G4RunManager * GetRunManager()
virtual void BeamOn(G4int n_event, const char *macroFile=nullptr, G4int n_select=-1)
const G4UserStackingAction * GetUserStackingAction() const
const G4UserSteppingAction * GetUserSteppingAction() const
const G4UserRunAction * GetUserRunAction() const
Definition G4Run.hh:49
virtual void EndOfRunAction(const G4Run *)
virtual void BeginOfRunAction(const G4Run *)
#define G4ThreadLocal
Definition tls.hh:77