Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4AdjointSteppingAction.hh
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 // $Id: G4AdjointSteppingAction.hh 102568 2017-02-09 08:37:41Z gcosmo $
27 //
29 // Class Name: G4AdjointSteppingAction
30 // Author: L. Desorgher
31 // Contract: ESA contract 21435/08/NL/AT
32 // Organisation: SpaceIT GmbH
33 // Customer: ESA/ESTEC
35 //
36 // CHANGE HISTORY
37 // --------------
38 // ChangeHistory:
39 // -15/01/2007 Creation by L. Desorgher
40 // -01/11/2009 Some cleaning and adding of documentation for the first Release in the Geant4 toolkit, L. Desorgher
41 // -04/11/2009 Adding the possibility to use user stepping action, L. Desorgher
42 // -20/11/2009 Correct the stop of adjoint particles tracking when it reenters the adjoint source.
43 //
44 //
45 //-------------------------------------------------------------
46 // Documentation:
47 // Stepping action used in the adjoint simulation.
48 // It is responsible to stop the adjoint tracking phase when:
49 // -a)The adjoint track reaches the external surface.
50 // -b)The being tracked adjoint dynamic particle get an energy higher than the maximum energy of the external source.
51 // -c)The adjoint track enters the volume delimited by the adjoint source.
52 // In the case a) the info (energy,weight,...) of the adjoint dynamic particle associated to the track
53 // when crossing the external source is registered and in the next event a forward primary is generated. In the other cases b) and c)
54 // The next generated fwd particle is killed before being tracked and the next tracking of an adjoint particle is started directly.
55 //
56 
57 #ifndef G4AdjointSteppingAction_h
58 #define G4AdjointSteppingAction_h 1
59 
60 #include "G4UserSteppingAction.hh"
61 #include "globals.hh"
62 #include "G4ThreeVector.hh"
63 
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
70 {
71  public:
74 
75  void UserSteppingAction(const G4Step*);
76 
77  inline void SetExtSourceEMax(G4double Emax){ext_sourceEMax=Emax;}
78  inline void SetStartEvent(G4bool aBool){start_event =aBool;}
79  inline G4bool GetDidAdjParticleReachTheExtSource(){return did_adj_part_reach_ext_source;}
80  inline G4ThreeVector GetLastMomentum(){return last_momentum;}
81  inline G4ThreeVector GetLastPosition(){return last_pos;}
82  inline G4double GetLastEkin(){return last_ekin;}
83  inline G4double GetLastWeight(){return last_weight;}
84  inline void SetPrimWeight(G4double weight){prim_weight=weight;}
85  inline G4ParticleDefinition* GetLastPartDef(){return last_part_def;}
87  theUserAdjointSteppingAction = anAction;}
89  theUserFwdSteppingAction = anAction;}
90  inline void SetAdjointTrackingMode(G4bool aBool){is_adjoint_tracking_mode =aBool;}
92  {did_one_adj_part_reach_ext_source_during_event =false;}
93  inline void SetAdjointGeantinoTrackingMode(G4bool aBool){is_adjoint_geantino_tracking_mode =aBool;}
94  private:
95 
96  G4double ext_sourceEMax;
97  G4AdjointCrossSurfChecker* theG4AdjointCrossSurfChecker;
98  G4bool start_event;
99 
100  G4bool did_adj_part_reach_ext_source;
101  G4bool did_one_adj_part_reach_ext_source_during_event;
102  G4ThreeVector last_momentum, last_pos;
103  G4double last_ekin;
104  G4double last_weight ;
105  G4double prim_weight ;
106  G4ParticleDefinition* last_part_def;
107  G4UserSteppingAction* theUserAdjointSteppingAction;
108  G4UserSteppingAction* theUserFwdSteppingAction;
109  G4bool is_adjoint_tracking_mode;
110  G4bool is_adjoint_geantino_tracking_mode;
111 
112 
113 };
114 #endif
115 
void SetAdjointGeantinoTrackingMode(G4bool aBool)
void SetAdjointTrackingMode(G4bool aBool)
bool G4bool
Definition: G4Types.hh:79
void UserSteppingAction(const G4Step *)
Definition: G4Step.hh:76
void SetUserForwardSteppingAction(G4UserSteppingAction *anAction)
void SetPrimWeight(G4double weight)
G4ParticleDefinition * GetLastPartDef()
void SetExtSourceEMax(G4double Emax)
static const G4double Emax
void SetUserAdjointSteppingAction(G4UserSteppingAction *anAction)
double G4double
Definition: G4Types.hh:76