| 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 | //
|
|---|
| 27 | // $Id: G4VParticleChange.hh,v 1.16 2007/03/25 22:54:52 kurasige Exp $
|
|---|
| 28 | // GEANT4 tag $Name: geant4-09-04-beta-01 $
|
|---|
| 29 | //
|
|---|
| 30 | //
|
|---|
| 31 | // ------------------------------------------------------------
|
|---|
| 32 | // GEANT 4 class header file
|
|---|
| 33 | //
|
|---|
| 34 | //
|
|---|
| 35 | // ------------------------------------------------------------
|
|---|
| 36 | // Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
|---|
| 37 | //
|
|---|
| 38 | // Class Description
|
|---|
| 39 | // This class is the abstract class for ParticleChange.
|
|---|
| 40 | //-
|
|---|
| 41 | // The ParticleChange class ontains the results after invocation
|
|---|
| 42 | // of a physics process. This includes final states of parent
|
|---|
| 43 | // particle (momentum, energy, etc) and secondary particles generated
|
|---|
| 44 | // by the interaction.
|
|---|
| 45 | // The tracking assumes that all the values of energy and
|
|---|
| 46 | // momentum are in global reference system, therefore all the
|
|---|
| 47 | // needed Lorentz transformations must have been already Done
|
|---|
| 48 | // when filling the data-members of this class.
|
|---|
| 49 | //-
|
|---|
| 50 | //-
|
|---|
| 51 | // This abstract class has following four virtual methods
|
|---|
| 52 | // virtual G4Step* UpdateStepForAtRest(G4Step* Step);
|
|---|
| 53 | // virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
|---|
| 54 | // virtual G4Step* UpdateStepForPostStep(G4Step* Step);
|
|---|
| 55 | // virtual void Initialize(const G4Track&);
|
|---|
| 56 | // The UpdateStep methods return the pointer to the G4Step
|
|---|
| 57 | // after updating the given Step information by using final state
|
|---|
| 58 | // information of the track given by a physics process.
|
|---|
| 59 | // User must add methods to keep the final state information
|
|---|
| 60 | // in his derived class as well as implement UpdateStep methods
|
|---|
| 61 | // which he want to use.
|
|---|
| 62 | //-
|
|---|
| 63 | // The Initialize methods is provided to refresh the final
|
|---|
| 64 | // state information and should be called by each process
|
|---|
| 65 | // at the beginning of DoIt.
|
|---|
| 66 | //
|
|---|
| 67 | // ------------------------------------------------------------
|
|---|
| 68 | // Implement Event Biasing Scheme 9 Nov.,98 H.Kurashige
|
|---|
| 69 | // add CheckIt 13 Apr.,99 H.Kurashige
|
|---|
| 70 | // add accuracy leveles 5 May, 99 H.Kurashige
|
|---|
| 71 | // add check secondaries 11 June, 03 H.Kurashige
|
|---|
| 72 | // add new methods of ProposeXXX 08 May, 04 H.Kurashige
|
|---|
| 73 | // remove obsolete methods of SetXXX 19 Sep, 04 H.Kurashige
|
|---|
| 74 | // add flag for first/last step in volume 30 Oct. 2006 H.Kurashige
|
|---|
| 75 | // add nonIonizingEnergyLoss 26 Mar 2007 H.Kurashige
|
|---|
| 76 | //
|
|---|
| 77 |
|
|---|
| 78 | #ifndef G4VParticleChange_h
|
|---|
| 79 | #define G4VParticleChange_h 1
|
|---|
| 80 |
|
|---|
| 81 | #include "globals.hh"
|
|---|
| 82 | #include "G4ios.hh"
|
|---|
| 83 | #include <cmath>
|
|---|
| 84 |
|
|---|
| 85 | class G4Track;
|
|---|
| 86 | class G4Step;
|
|---|
| 87 |
|
|---|
| 88 | #include "G4TrackFastVector.hh"
|
|---|
| 89 | #include "G4TrackStatus.hh"
|
|---|
| 90 | #include "G4SteppingControl.hh"
|
|---|
| 91 |
|
|---|
| 92 |
|
|---|
| 93 | class G4VParticleChange
|
|---|
| 94 | {
|
|---|
| 95 | public:
|
|---|
| 96 | // default constructor
|
|---|
| 97 | G4VParticleChange();
|
|---|
| 98 |
|
|---|
| 99 | // destructor
|
|---|
| 100 | virtual ~G4VParticleChange();
|
|---|
| 101 |
|
|---|
| 102 | // equal/unequal operator
|
|---|
| 103 | G4bool operator==(const G4VParticleChange &right) const;
|
|---|
| 104 | G4bool operator!=(const G4VParticleChange &right) const;
|
|---|
| 105 | // "equal" means that teo objects have the same pointer.
|
|---|
| 106 |
|
|---|
| 107 | protected:
|
|---|
| 108 | // hide copy constructor and assignment operaor as protected
|
|---|
| 109 | G4VParticleChange(const G4VParticleChange &right);
|
|---|
| 110 | G4VParticleChange & operator=(const G4VParticleChange &right);
|
|---|
| 111 |
|
|---|
| 112 | public: // with description
|
|---|
| 113 | // --- the following methods are for updating G4Step -----
|
|---|
| 114 | virtual G4Step* UpdateStepForAtRest(G4Step* Step);
|
|---|
| 115 | virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
|---|
| 116 | virtual G4Step* UpdateStepForPostStep(G4Step* Step);
|
|---|
| 117 | // Return the pointer to the G4Step after updating the Step information
|
|---|
| 118 | // by using final state information of the track given by a physics
|
|---|
| 119 | // process
|
|---|
| 120 |
|
|---|
| 121 | protected: // with description
|
|---|
| 122 | G4Step* UpdateStepInfo(G4Step* Step);
|
|---|
| 123 | // Update the G4Step specific attributes
|
|---|
| 124 | // (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength)
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 | public: // with description
|
|---|
| 128 | virtual void Initialize(const G4Track&);
|
|---|
| 129 | // This methods will be called by each process at the beginning of DoIt
|
|---|
| 130 | // if necessary.
|
|---|
| 131 |
|
|---|
| 132 | protected:
|
|---|
| 133 | void InitializeTrueStepLength(const G4Track&);
|
|---|
| 134 | void InitializeLocalEnergyDeposit(const G4Track&);
|
|---|
| 135 | void InitializeSteppingControl(const G4Track&);
|
|---|
| 136 | void InitializeParentWeight(const G4Track&);
|
|---|
| 137 |
|
|---|
| 138 | void InitializeStatusChange(const G4Track&);
|
|---|
| 139 | void InitializeSecondaries(const G4Track&);
|
|---|
| 140 | void InitializeStepInVolumeFlags(const G4Track&);
|
|---|
| 141 | // ------------------------------------------------------
|
|---|
| 142 |
|
|---|
| 143 | public: // with description
|
|---|
| 144 | //---- the following methods are for TruePathLength ----
|
|---|
| 145 | G4double GetTrueStepLength() const;
|
|---|
| 146 | void ProposeTrueStepLength(G4double truePathLength);
|
|---|
| 147 | // Get/Propose theTrueStepLength
|
|---|
| 148 |
|
|---|
| 149 | //---- the following methods are for LocalEnergyDeposit ----
|
|---|
| 150 | G4double GetLocalEnergyDeposit() const;
|
|---|
| 151 | void ProposeLocalEnergyDeposit(G4double anEnergyPart);
|
|---|
| 152 | // Get/Propose the locally deposited energy
|
|---|
| 153 |
|
|---|
| 154 | //---- the following methods are for nonIonizingEnergyDeposit ----
|
|---|
| 155 | G4double GetNonIonizingEnergyDeposit() const;
|
|---|
| 156 | void ProposeNonIonizingEnergyDeposit(G4double anEnergyPart);
|
|---|
| 157 | // Get/Propose the non-ionizing deposited energy
|
|---|
| 158 |
|
|---|
| 159 | //---- the following methods are for TrackStatus -----
|
|---|
| 160 | G4TrackStatus GetTrackStatus() const;
|
|---|
| 161 | void ProposeTrackStatus(G4TrackStatus status);
|
|---|
| 162 | // Get/Propose the final TrackStatus of the current particle.
|
|---|
| 163 | // ------------------------------------------------------
|
|---|
| 164 |
|
|---|
| 165 | //---- the following methods are for managements of SteppingControl --
|
|---|
| 166 | G4SteppingControl GetSteppingControl() const;
|
|---|
| 167 | void ProposeSteppingControl(G4SteppingControl StepControlFlag);
|
|---|
| 168 | // Set/Propose a flag to control stepping manager behavier
|
|---|
| 169 | // ------------------------------------------------------
|
|---|
| 170 |
|
|---|
| 171 | //---- the following methods are for managements of initial/last step
|
|---|
| 172 | G4bool GetFirstStepInVolume() const;
|
|---|
| 173 | G4bool GetLastStepInVolume() const;
|
|---|
| 174 | void ProposeFirstStepInVolume(G4bool flag);
|
|---|
| 175 | void ProposeLastStepInVolume(G4bool flag);
|
|---|
| 176 |
|
|---|
| 177 | //---- the following methods are for managements of secondaries --
|
|---|
| 178 | void Clear();
|
|---|
| 179 | // Clear the contents of this objects
|
|---|
| 180 | // This method should be called after the Tracking(Stepping)
|
|---|
| 181 | // manager removes all secondaries in theListOfSecondaries
|
|---|
| 182 |
|
|---|
| 183 | void SetNumberOfSecondaries(G4int totSecondaries);
|
|---|
| 184 | // SetNumberOfSecondaries must be called just before AddSecondary()
|
|---|
| 185 | // in order to secure memory space for theListOfSecondaries
|
|---|
| 186 | // This method resets theNumberOfSecondaries to 0
|
|---|
| 187 | // (that will be incremented at every AddSecondary() call).
|
|---|
| 188 |
|
|---|
| 189 | G4int GetNumberOfSecondaries() const;
|
|---|
| 190 | // Returns the number of secondaries current stored in
|
|---|
| 191 | // G4TrackFastVector.
|
|---|
| 192 |
|
|---|
| 193 | G4Track* GetSecondary(G4int anIndex) const;
|
|---|
| 194 | // Returns the pointer to the generated secondary particle
|
|---|
| 195 | // which is specified by an Index.
|
|---|
| 196 |
|
|---|
| 197 | void AddSecondary(G4Track* aSecondary);
|
|---|
| 198 | // Add a secondary particle to theListOfSecondaries.
|
|---|
| 199 | // ------------------------------------------------------
|
|---|
| 200 |
|
|---|
| 201 | G4double GetParentWeight() const ;
|
|---|
| 202 | // Get weight of the parent (i.e. current) track
|
|---|
| 203 | void ProposeParentWeight(G4double);
|
|---|
| 204 | // Propse new weight of the parent (i.e. current) track
|
|---|
| 205 |
|
|---|
| 206 | void SetParentWeightByProcess(G4bool);
|
|---|
| 207 | G4bool IsParentWeightSetByProcess() const;
|
|---|
| 208 | // If fParentWeightByProcess flag is false (true in default),
|
|---|
| 209 | // G4VParticleChange can change the weight of the parent track,
|
|---|
| 210 | // in any DoIt by using ProposeParentWeight(G4double)
|
|---|
| 211 |
|
|---|
| 212 |
|
|---|
| 213 | void SetSecondaryWeightByProcess(G4bool);
|
|---|
| 214 | G4bool IsSecondaryWeightSetByProcess() const;
|
|---|
| 215 | // If fSecondaryWeightByProcess flag is false (false in default),
|
|---|
| 216 | // G4VParticleChange set the weight of the secondary tracks
|
|---|
| 217 | // equal to the parent weight when the secondary tracks are added.
|
|---|
| 218 |
|
|---|
| 219 | virtual void DumpInfo() const;
|
|---|
| 220 | // Print out information
|
|---|
| 221 |
|
|---|
| 222 | void SetVerboseLevel(G4int vLevel);
|
|---|
| 223 | G4int GetVerboseLevel() const;
|
|---|
| 224 |
|
|---|
| 225 | protected:
|
|---|
| 226 |
|
|---|
| 227 | G4TrackFastVector* theListOfSecondaries;
|
|---|
| 228 | // The vector of secondaries.
|
|---|
| 229 |
|
|---|
| 230 | G4int theNumberOfSecondaries;
|
|---|
| 231 | // The total number of secondaries produced by each process.
|
|---|
| 232 |
|
|---|
| 233 | G4int theSizeOftheListOfSecondaries;
|
|---|
| 234 | // TheSizeOftheListOfSecondaries;
|
|---|
| 235 |
|
|---|
| 236 | G4TrackStatus theStatusChange;
|
|---|
| 237 | // The changed (final) track status of a given particle.
|
|---|
| 238 |
|
|---|
| 239 | G4SteppingControl theSteppingControlFlag;
|
|---|
| 240 | // a flag to control stepping manager behavior
|
|---|
| 241 |
|
|---|
| 242 | G4double theLocalEnergyDeposit;
|
|---|
| 243 | // It represents the part of the energy lost for discrete
|
|---|
| 244 | // or semi-continuous processes which is due to secondaries
|
|---|
| 245 | // not generated because they would have been below their cut
|
|---|
| 246 | // threshold.
|
|---|
| 247 | // The sum of the locally deposited energy + the delta-energy
|
|---|
| 248 | // coming from the continuous processes gives the
|
|---|
| 249 | // total energy loss localized in the current Step.
|
|---|
| 250 |
|
|---|
| 251 | G4double theNonIonizingEnergyDeposit;
|
|---|
| 252 | // non-ionizing energu deposit is defined as
|
|---|
| 253 | // a part of local energy deposit, which does not cause
|
|---|
| 254 | // ionization of atoms
|
|---|
| 255 |
|
|---|
| 256 | G4double theTrueStepLength;
|
|---|
| 257 | // The value of "True" Step Length
|
|---|
| 258 |
|
|---|
| 259 |
|
|---|
| 260 | // flag for initial/last step
|
|---|
| 261 | G4bool theFirstStepInVolume;
|
|---|
| 262 | G4bool theLastStepInVolume;
|
|---|
| 263 |
|
|---|
| 264 |
|
|---|
| 265 | G4int verboseLevel;
|
|---|
| 266 | // The Verbose level
|
|---|
| 267 |
|
|---|
| 268 | public: // with description
|
|---|
| 269 | // CheckIt method is provided for debug
|
|---|
| 270 | virtual G4bool CheckIt(const G4Track&);
|
|---|
| 271 |
|
|---|
| 272 | // CheckIt method is activated
|
|---|
| 273 | // if debug flag is set and 'G4VERBOSE' is defined
|
|---|
| 274 | void ClearDebugFlag();
|
|---|
| 275 | void SetDebugFlag();
|
|---|
| 276 | G4bool GetDebugFlag() const;
|
|---|
| 277 |
|
|---|
| 278 | protected:
|
|---|
| 279 | // CheckSecondary method is provided for debug
|
|---|
| 280 | G4bool CheckSecondary(G4Track&);
|
|---|
| 281 |
|
|---|
| 282 | G4double GetAccuracyForWarning() const;
|
|---|
| 283 | G4double GetAccuracyForException() const;
|
|---|
| 284 |
|
|---|
| 285 | protected:
|
|---|
| 286 | G4bool debugFlag;
|
|---|
| 287 |
|
|---|
| 288 | // accuracy levels
|
|---|
| 289 | static const G4double accuracyForWarning;
|
|---|
| 290 | static const G4double accuracyForException;
|
|---|
| 291 |
|
|---|
| 292 |
|
|---|
| 293 | protected:
|
|---|
| 294 | G4double theParentWeight;
|
|---|
| 295 | G4bool fSetSecondaryWeightByProcess;
|
|---|
| 296 | G4bool fSetParentWeightByProcess;
|
|---|
| 297 | };
|
|---|
| 298 |
|
|---|
| 299 | #include "G4Step.hh"
|
|---|
| 300 | #include "G4Track.hh"
|
|---|
| 301 | #include "G4VParticleChange.icc"
|
|---|
| 302 |
|
|---|
| 303 | #endif
|
|---|