| [966] | 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 | //
|
|---|
| [1196] | 26 | // $Id: G4ContinuousGainOfEnergy.hh,v 1.4 2009/11/20 10:31:20 ldesorgh Exp $
|
|---|
| 27 | // GEANT4 tag $Name: geant4-09-03-cand-01 $
|
|---|
| 28 | //
|
|---|
| [966] | 29 | /////////////////////////////////////////////////////////////////////////////////
|
|---|
| [1196] | 30 | // Class: G4ContinuousGainOfEnergy
|
|---|
| [966] | 31 | // Author: L. Desorgher
|
|---|
| 32 | // Organisation: SpaceIT GmbH
|
|---|
| [1196] | 33 | // Contract: ESA contract 21435/08/NL/AT
|
|---|
| [966] | 34 | // Customer: ESA/ESTEC
|
|---|
| 35 | /////////////////////////////////////////////////////////////////////////////////
|
|---|
| 36 | //
|
|---|
| 37 | // CHANGE HISTORY
|
|---|
| 38 | // --------------
|
|---|
| 39 | // ChangeHistory:
|
|---|
| [1196] | 40 | // -10 May 2007 creation by L. Desorgher
|
|---|
| 41 | // -February-March 2009 Update for protons by L.Desorgher
|
|---|
| 42 | // -July August 2009 Update for ion by L.Desorgher
|
|---|
| [966] | 43 | //
|
|---|
| 44 | //-------------------------------------------------------------
|
|---|
| 45 | // Documentation:
|
|---|
| [1196] | 46 | // Continuous process acting on adjoint particles to compute the continuous gain of energy of charged particles when they are tracked back!
|
|---|
| 47 | //
|
|---|
| [966] | 48 | //
|
|---|
| 49 | #ifndef G4ContinuousGainOfEnergy_h
|
|---|
| 50 | #define G4ContinuousGainOfEnergy_h 1
|
|---|
| 51 |
|
|---|
| 52 | #include "G4VContinuousProcess.hh"
|
|---|
| 53 | #include "globals.hh"
|
|---|
| 54 | #include "G4Material.hh"
|
|---|
| 55 | #include "G4MaterialCutsCouple.hh"
|
|---|
| 56 | #include "G4Track.hh"
|
|---|
| 57 | #include "G4UnitsTable.hh"
|
|---|
| 58 | #include "G4ParticleChange.hh"
|
|---|
| 59 | #include "G4VEnergyLossProcess.hh"
|
|---|
| [1196] | 60 | #include "G4ProductionCutsTable.hh"
|
|---|
| [966] | 61 |
|
|---|
| 62 |
|
|---|
| 63 | class G4Step;
|
|---|
| 64 | class G4ParticleDefinition;
|
|---|
| 65 | class G4VEmModel;
|
|---|
| 66 | class G4VEmFluctuationModel;
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 | class G4ContinuousGainOfEnergy : public G4VContinuousProcess
|
|---|
| 71 | {
|
|---|
| 72 | public:
|
|---|
| 73 |
|
|---|
| 74 | G4ContinuousGainOfEnergy(const G4String& name = "EnergyGain",
|
|---|
| 75 | G4ProcessType type = fElectromagnetic);
|
|---|
| 76 |
|
|---|
| 77 | virtual ~G4ContinuousGainOfEnergy();
|
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 | protected:
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 | //------------------------------------------------------------------------
|
|---|
| 84 | // Methods with standard implementation; may be overwritten if needed
|
|---|
| 85 | //------------------------------------------------------------------------
|
|---|
| 86 | protected:
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 | virtual G4double GetContinuousStepLimit(const G4Track& track,
|
|---|
| 90 | G4double previousStepSize,
|
|---|
| 91 | G4double currentMinimumStep,
|
|---|
| 92 | G4double& currentSafety);
|
|---|
| 93 |
|
|---|
| 94 |
|
|---|
| 95 | //------------------------------------------------------------------------
|
|---|
| 96 | // Generic methods common to all processes
|
|---|
| 97 | //------------------------------------------------------------------------
|
|---|
| 98 | public:
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 | void PreparePhysicsTable(const G4ParticleDefinition&);
|
|---|
| 103 |
|
|---|
| 104 | void BuildPhysicsTable(const G4ParticleDefinition&);
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 | G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
|
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 | void SetLossFluctuations(G4bool val);
|
|---|
| 111 | inline void SetIsIntegral(G4bool val){is_integral= val;}
|
|---|
| 112 |
|
|---|
| 113 | inline void SetDirectEnergyLossProcess(G4VEnergyLossProcess* aProcess){theDirectEnergyLossProcess=aProcess;};
|
|---|
| 114 |
|
|---|
| [1196] | 115 | void SetDirectParticle(G4ParticleDefinition* p);
|
|---|
| [966] | 116 |
|
|---|
| 117 | protected:
|
|---|
| 118 |
|
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 | private:
|
|---|
| 123 |
|
|---|
| 124 | void DefineMaterial(const G4MaterialCutsCouple* couple);
|
|---|
| [1196] | 125 | void SetDynamicMassCharge(const G4Track& track, G4double energy);
|
|---|
| [966] | 126 |
|
|---|
| [1196] | 127 |
|
|---|
| [966] | 128 | // hide assignment operator
|
|---|
| 129 |
|
|---|
| 130 | G4ContinuousGainOfEnergy(G4ContinuousGainOfEnergy &);
|
|---|
| 131 | G4ContinuousGainOfEnergy & operator=(const G4ContinuousGainOfEnergy &right);
|
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 | private:
|
|---|
| 135 |
|
|---|
| 136 | const G4Material* currentMaterial;
|
|---|
| 137 | const G4MaterialCutsCouple* currentCouple;
|
|---|
| 138 | size_t currentMaterialIndex;
|
|---|
| [1196] | 139 | size_t currentCoupleIndex;
|
|---|
| [966] | 140 | G4double currentTcut;
|
|---|
| [1196] | 141 | G4double currentCutInRange;
|
|---|
| [966] | 142 | G4double preStepKinEnergy;
|
|---|
| 143 |
|
|---|
| [1196] | 144 |
|
|---|
| [966] | 145 |
|
|---|
| 146 | G4double linLossLimit;
|
|---|
| 147 | G4bool lossFluctuationFlag;
|
|---|
| 148 | G4bool lossFluctuationArePossible;
|
|---|
| 149 |
|
|---|
| 150 | G4VEnergyLossProcess* theDirectEnergyLossProcess;
|
|---|
| 151 | G4ParticleDefinition* theDirectPartDef;
|
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 | G4bool is_integral;
|
|---|
| 155 |
|
|---|
| [1196] | 156 | //adding for Ions
|
|---|
| 157 | //----------------
|
|---|
| 158 | G4bool IsIon;
|
|---|
| 159 | G4double massRatio;
|
|---|
| 160 | G4double chargeSqRatio;
|
|---|
| 161 | G4VEmModel* currentModel;
|
|---|
| 162 | G4double preStepChargeSqRatio;
|
|---|
| 163 | G4double preStepScaledKinEnergy;
|
|---|
| 164 |
|
|---|
| [966] | 165 |
|
|---|
| [1196] | 166 |
|
|---|
| 167 |
|
|---|
| 168 |
|
|---|
| [966] | 169 | };
|
|---|
| 170 |
|
|---|
| 171 | ///////////////////////////////////////////////////////
|
|---|
| 172 | //
|
|---|
| 173 | inline void G4ContinuousGainOfEnergy::DefineMaterial(
|
|---|
| 174 | const G4MaterialCutsCouple* couple)
|
|---|
| 175 | {
|
|---|
| 176 | if(couple != currentCouple) {
|
|---|
| 177 | currentCouple = couple;
|
|---|
| 178 | currentMaterial = couple->GetMaterial();
|
|---|
| [1196] | 179 | currentCoupleIndex = couple->GetIndex();
|
|---|
| 180 | currentMaterialIndex = currentMaterial->GetIndex();
|
|---|
| 181 |
|
|---|
| 182 | size_t idx=1;
|
|---|
| 183 | const std::vector<G4double>* aVec = G4ProductionCutsTable::GetProductionCutsTable()->GetEnergyCutsVector(idx);
|
|---|
| 184 | currentTcut=(*aVec)[currentCoupleIndex];
|
|---|
| 185 | currentCutInRange = couple->GetProductionCuts()->GetProductionCut(theDirectPartDef->GetParticleName());
|
|---|
| 186 | //G4cout<<"Define Material"<<G4endl;
|
|---|
| [966] | 187 | //if(!meanFreePath) ResetNumberOfInteractionLengthLeft();
|
|---|
| 188 | }
|
|---|
| 189 | }
|
|---|
| [1196] | 190 |
|
|---|
| [966] | 191 | #endif
|
|---|