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: G4AdjointProcessEquivalentToDirectProcess.hh 69844 2013-05-16 09:19:33Z gcosmo $ 00027 // 00029 // Class: G4AdjointProcessEquivalentToDirectProcess 00030 // Author: L. Desorgher 00031 // Organisation: SpaceIT GmbH 00032 // Contract: ESA contract 21435/08/NL/AT 00033 // Customer: ESA/ESTEC 00035 // 00036 // CHANGE HISTORY 00037 // -------------- 00038 // ChangeHistory: 00039 // 25 Sept. 2009 Created by L.Desorgher. Inspired from G4WrapperProcess 00040 // 00041 //------------------------------------------------------------- 00042 // Documentation: 00043 // Adjoint process equivalent to direct process, used for some multiple scattering 00044 // 00045 // 00046 00047 00048 #ifndef G4AdjointProcessEquivalentToDirectProcess_h 00049 #define G4AdjointProcessEquivalentToDirectProcess_h 1 00050 00051 #include "globals.hh" 00052 #include "G4ios.hh" 00053 #include "G4VProcess.hh" 00054 00055 class G4AdjointProcessEquivalentToDirectProcess : public G4VProcess 00056 { 00057 // A virtual class for wrapper process objects. 00058 00059 public: // with description 00060 // constructor requires the process name and type 00061 G4AdjointProcessEquivalentToDirectProcess(const G4String& aName, G4VProcess* aProcess,G4ParticleDefinition* fwd_particle_def); 00062 00063 00064 00065 public: 00066 // destructor 00067 virtual ~G4AdjointProcessEquivalentToDirectProcess(); 00068 00069 00070 public: // with description 00072 // DoIt ///////////////// 00074 virtual G4VParticleChange* PostStepDoIt( 00075 const G4Track& track, 00076 const G4Step& stepData 00077 ); 00078 00079 virtual G4VParticleChange* AlongStepDoIt( 00080 const G4Track& track, 00081 const G4Step& stepData 00082 ); 00083 virtual G4VParticleChange* AtRestDoIt( 00084 const G4Track& track, 00085 const G4Step& stepData 00086 ); 00088 // GPIL ////////////// 00090 virtual G4double AlongStepGetPhysicalInteractionLength( 00091 const G4Track& track, 00092 G4double previousStepSize, 00093 G4double currentMinimumStep, 00094 G4double& proposedSafety, 00095 G4GPILSelection* selection); 00096 00097 virtual G4double AtRestGetPhysicalInteractionLength( 00098 const G4Track& track, 00099 G4ForceCondition* condition 00100 ); 00101 00102 virtual G4double PostStepGetPhysicalInteractionLength( 00103 const G4Track& track, 00104 G4double previousStepSize, 00105 G4ForceCondition* condition 00106 ) ; 00107 00109 virtual G4bool IsApplicable(const G4ParticleDefinition&); 00110 // Returns true if this process object is applicable to 00111 // the particle type 00112 // Process will not be registered to a particle if IsApplicable is false 00113 00114 virtual void BuildPhysicsTable(const G4ParticleDefinition&); 00115 // Messaged by the Particle definition (via the Process manager) 00116 // whenever cross section tables have to be rebuilt (i.e. if new 00117 // materials have been defined). 00118 // It is overloaded by individual processes when they need physics 00119 // tables. 00120 00121 // Processes which Build (for example in their 00122 // constructors) physics tables independent of cuts 00123 // should preferably use a 00124 // private void BuildThePhysicsTable() 00125 // function. Not another BuildPhysicsTable, please. 00126 00127 virtual void PreparePhysicsTable(const G4ParticleDefinition&); 00128 // Messaged by the Particle definition (via the Process manager) 00129 // whenever cross section tables have to be prepare for rebuilt 00130 // (i.e. if new materials have been defined). 00131 // It is overloaded by individual processes when they need physics 00132 // tables. 00133 00134 // Processes which Build physics tables independent of cuts 00135 // (for example in their constructors) 00136 // should preferably use private 00137 // void BuildThePhysicsTable() and void PreparePhysicsTable(). 00138 // Not another BuildPhysicsTable, please. 00139 00140 00141 virtual G4bool StorePhysicsTable(const G4ParticleDefinition* , 00142 const G4String& directory, 00143 G4bool ascii = false); 00144 // Store PhysicsTable in a file. 00145 // (return false in case of failure at I/O ) 00146 00147 virtual G4bool RetrievePhysicsTable( const G4ParticleDefinition* , 00148 const G4String& directory, 00149 G4bool ascii = false); 00150 // Retrieve Physics from a file. 00151 // (return true if the Physics Table can be build by using file) 00152 // (return false if the process has no functionality or in case of failure) 00153 // File name should be defined by each process 00154 // and the file should be placed under the directory specifed by the argument. 00156 virtual void StartTracking(G4Track*); 00157 virtual void EndTracking(); 00158 // inform Start/End of tracking for each track to the physics process 00159 00160 00161 00162 public: 00163 virtual void ResetNumberOfInteractionLengthLeft(); 00164 // reset (determine the value of)NumberOfInteractionLengthLeft 00165 private: 00166 G4ParticleDefinition* theFwdParticleDef; 00167 G4VProcess* theDirectProcess; 00168 00169 }; 00170 00171 00172 #endif