00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // $Id: G4AdjointSteppingAction.hh 67009 2013-01-29 16:00:21Z gcosmo $ 00027 // 00029 // Class Name: G4AdjointSteppingAction 00030 // Author: L. Desorgher 00031 // Contract: ESA contract 21435/08/NL/AT 00032 // Organisation: SpaceIT GmbH 00033 // Customer: ESA/ESTEC 00035 // 00036 // CHANGE HISTORY 00037 // -------------- 00038 // ChangeHistory: 00039 // -15/01/2007 Creation by L. Desorgher 00040 // -01/11/2009 Some cleaning and adding of documentation for the first Release in the Geant4 toolkit, L. Desorgher 00041 // -04/11/2009 Adding the possibility to use user stepping action, L. Desorgher 00042 // -20/11/2009 Correct the stop of adjoint particles tracking when it reenters the adjoint source. 00043 // 00044 // 00045 //------------------------------------------------------------- 00046 // Documentation: 00047 // Stepping action used in the adjoint simulation. 00048 // It is responsible to stop the adjoint tracking phase when: 00049 // -a)The adjoint track reaches the external surface. 00050 // -b)The being tracked adjoint dynamic particle get an energy higher than the maximum energy of the external source. 00051 // -c)The adjoint track enters the volume delimited by the adjoint source. 00052 // In the case a) the info (energy,weight,...) of the adjoint dynamic particle associated to the track 00053 // when crossing the external source is registered and in the next event a forward primary is generated. In the other cases b) and c) 00054 // The next generated fwd particle is killed before being tracked and the next tracking of an adjoint particle is started directly. 00055 // 00056 00057 #ifndef G4AdjointSteppingAction_h 00058 #define G4AdjointSteppingAction_h 1 00059 00060 #include "G4UserSteppingAction.hh" 00061 #include "globals.hh" 00062 #include "G4ThreeVector.hh" 00063 00064 class G4AdjointCrossSurfChecker; 00065 class G4ParticleDefinition; 00066 00067 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00068 00069 class G4AdjointSteppingAction : public G4UserSteppingAction 00070 { 00071 public: 00072 G4AdjointSteppingAction(); 00073 ~G4AdjointSteppingAction(); 00074 00075 void UserSteppingAction(const G4Step*); 00076 00077 inline void SetExtSourceEMax(G4double Emax){ext_sourceEMax=Emax;} 00078 inline void SetStartEvent(G4bool aBool){start_event =aBool;} 00079 inline G4bool GetDidAdjParticleReachTheExtSource(){return did_adj_part_reach_ext_source;} 00080 inline G4ThreeVector GetLastMomentum(){return last_momentum;} 00081 inline G4ThreeVector GetLastPosition(){return last_pos;} 00082 inline G4double GetLastEkin(){return last_ekin;} 00083 inline G4double GetLastWeight(){return last_weight;} 00084 inline void SetPrimWeight(G4double weight){prim_weight=weight;} 00085 inline G4ParticleDefinition* GetLastPartDef(){return last_part_def;} 00086 inline void SetUserAdjointSteppingAction( G4UserSteppingAction* anAction) {theUserAdjointSteppingAction = anAction;} 00087 00088 private: 00089 00090 G4double ext_sourceEMax; 00091 G4AdjointCrossSurfChecker* theG4AdjointCrossSurfChecker; 00092 G4bool start_event; 00093 00094 G4bool did_adj_part_reach_ext_source; 00095 G4ThreeVector last_momentum, last_pos; 00096 G4double last_ekin; 00097 G4double last_weight ; 00098 G4double prim_weight ; 00099 G4ParticleDefinition* last_part_def; 00100 G4UserSteppingAction* theUserAdjointSteppingAction; 00101 00102 }; 00103 #endif 00104