Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // >> 26 // >> 27 // $Id$ >> 28 // >> 29 // 26 // File name: G4PolarizedCompton 30 // File name: G4PolarizedCompton 27 // 31 // 28 // Author: Andreas Schaelicke 32 // Author: Andreas Schaelicke 29 // based on code by Michel Mair 33 // based on code by Michel Maire / Vladimir IVANTCHENKO 30 // << 31 // Class description 34 // Class description 32 // modified version respecting media and bea << 35 // 33 // using the stokes formalism << 36 // modified version respecting media and beam polarization >> 37 // using the stokes formalism >> 38 // >> 39 // Creation date: 01.05.2005 >> 40 // >> 41 // Modifications: >> 42 // >> 43 // 01-01-05, include polarization description (A.Stahl) >> 44 // 01-01-05, create asymmetry table and determine interactionlength (A.Stahl) >> 45 // 01-05-05, update handling of media polarization (A.Schalicke) >> 46 // 01-05-05, update polarized differential cross section (A.Schalicke) >> 47 // 20-05-05, added polarization transfer (A.Schalicke) >> 48 // 10-06-05, transformation between different reference frames (A.Schalicke) >> 49 // 17-10-05, correct reference frame dependence in GetMeanFreePath (A.Schalicke) >> 50 // 26-07-06, cross section recalculated (P.Starovoitov) >> 51 // 09-08-06, make it work under current geant4 release (A.Schalicke) >> 52 // 11-06-07, add PostStepGetPhysicalInteractionLength (A.Schalicke) >> 53 // ----------------------------------------------------------------------------- 34 54 35 #include "G4PolarizedCompton.hh" << 36 55 >> 56 #include "G4PolarizedCompton.hh" >> 57 #include "G4SystemOfUnits.hh" 37 #include "G4Electron.hh" 58 #include "G4Electron.hh" 38 #include "G4EmParameters.hh" << 59 39 #include "G4KleinNishinaCompton.hh" << 60 #include "G4StokesVector.hh" 40 #include "G4PhysicsTableHelper.hh" << 41 #include "G4PolarizationManager.hh" 61 #include "G4PolarizationManager.hh" 42 #include "G4PolarizedComptonModel.hh" 62 #include "G4PolarizedComptonModel.hh" 43 #include "G4ProductionCutsTable.hh" 63 #include "G4ProductionCutsTable.hh" 44 #include "G4StokesVector.hh" << 64 #include "G4PhysicsTableHelper.hh" 45 #include "G4SystemOfUnits.hh" << 65 #include "G4KleinNishinaCompton.hh" >> 66 #include "G4PolarizedComptonModel.hh" 46 67 47 //....oooOO0OOooo........oooOO0OOooo........oo 68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 48 G4PhysicsTable* G4PolarizedCompton::theAsymmet << 49 69 50 G4PolarizedCompton::G4PolarizedCompton(const G 70 G4PolarizedCompton::G4PolarizedCompton(const G4String& processName, 51 G4Proce << 71 G4ProcessType type): 52 : G4VEmProcess(processName, type) << 72 G4VEmProcess (processName, type), 53 , fType(10) << 73 buildAsymmetryTable(true), 54 , fBuildAsymmetryTable(true) << 74 useAsymmetryTable(true), 55 , fUseAsymmetryTable(true) << 75 isInitialised(false), 56 , fIsInitialised(false) << 76 selectedModel(0), 57 { << 77 mType(10), 58 SetStartFromNullFlag(true); << 78 theAsymmetryTable(NULL) 59 SetBuildTableFlag(true); << 79 { 60 SetSecondaryParticle(G4Electron::Electron()) << 80 SetLambdaBinning(90); >> 81 SetMinKinEnergy(0.1*keV); >> 82 SetMaxKinEnergy(100.0*GeV); 61 SetProcessSubType(fComptonScattering); 83 SetProcessSubType(fComptonScattering); 62 SetMinKinEnergyPrim(1. * MeV); << 84 emModel = 0; 63 SetSplineFlag(true); << 64 fEmModel = nullptr; << 65 } << 66 << 67 //....oooOO0OOooo........oooOO0OOooo........oo << 68 G4PolarizedCompton::~G4PolarizedCompton() { Cl << 69 << 70 //....oooOO0OOooo........oooOO0OOooo........oo << 71 void G4PolarizedCompton::ProcessDescription(st << 72 { << 73 out << "Polarized model for Compton scatteri << 74 << 75 G4VEmProcess::ProcessDescription(out); << 76 } 85 } 77 86 78 //....oooOO0OOooo........oooOO0OOooo........oo 87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 79 void G4PolarizedCompton::CleanTable() << 88 >> 89 G4PolarizedCompton::~G4PolarizedCompton() 80 { 90 { 81 if(theAsymmetryTable) << 91 if (theAsymmetryTable) { 82 { << 83 theAsymmetryTable->clearAndDestroy(); 92 theAsymmetryTable->clearAndDestroy(); 84 delete theAsymmetryTable; 93 delete theAsymmetryTable; 85 theAsymmetryTable = nullptr; << 86 } 94 } 87 } 95 } 88 96 89 //....oooOO0OOooo........oooOO0OOooo........oo 97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 90 G4bool G4PolarizedCompton::IsApplicable(const << 91 { << 92 return (&p == G4Gamma::Gamma()); << 93 } << 94 98 95 //....oooOO0OOooo........oooOO0OOooo........oo << 96 void G4PolarizedCompton::InitialiseProcess(con 99 void G4PolarizedCompton::InitialiseProcess(const G4ParticleDefinition*) 97 { 100 { 98 if(!fIsInitialised) << 101 if(!isInitialised) { 99 { << 102 isInitialised = true; 100 fIsInitialised = true; << 103 SetBuildTableFlag(true); 101 if(0 == fType) << 104 SetSecondaryParticle(G4Electron::Electron()); 102 { << 105 G4double emin = MinKinEnergy(); 103 if(nullptr == EmModel(0)) << 106 G4double emax = MaxKinEnergy(); 104 { << 107 emModel = new G4PolarizedComptonModel(); 105 SetEmModel(new G4KleinNishinaCompton() << 108 if(0 == mType) selectedModel = new G4KleinNishinaCompton(); 106 } << 109 else if(10 == mType) selectedModel = emModel; 107 } << 110 selectedModel->SetLowEnergyLimit(emin); 108 else << 111 selectedModel->SetHighEnergyLimit(emax); 109 { << 112 AddEmModel(1, selectedModel); 110 fEmModel = new G4PolarizedComptonModel() << 113 } 111 SetEmModel(fEmModel); << 112 } << 113 G4EmParameters* param = G4EmParameters::In << 114 EmModel(0)->SetLowEnergyLimit(param->MinKi << 115 EmModel(0)->SetHighEnergyLimit(param->MaxK << 116 AddEmModel(1, EmModel(0)); << 117 } << 118 } 114 } 119 115 120 //....oooOO0OOooo........oooOO0OOooo........oo 116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 117 >> 118 void G4PolarizedCompton::PrintInfo() >> 119 { >> 120 G4cout << " Total cross sections has a good parametrisation" >> 121 << " from 10 KeV to (100/Z) GeV" >> 122 << "\n Sampling according " << selectedModel->GetName() << " model" >> 123 << G4endl; >> 124 } >> 125 >> 126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 127 121 void G4PolarizedCompton::SetModel(const G4Stri 128 void G4PolarizedCompton::SetModel(const G4String& ss) 122 { 129 { 123 if(ss == "Klein-Nishina") << 130 if(ss == "Klein-Nishina") mType = 0; 124 { << 131 if(ss == "Polarized-Compton") mType = 10; 125 fType = 0; << 126 } << 127 if(ss == "Polarized-Compton") << 128 { << 129 fType = 10; << 130 } << 131 } 132 } 132 133 >> 134 >> 135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 133 //....oooOO0OOooo........oooOO0OOooo........oo 136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 134 G4double G4PolarizedCompton::GetMeanFreePath(c << 137 135 G << 138 136 G << 139 >> 140 G4double G4PolarizedCompton::GetMeanFreePath( >> 141 const G4Track& aTrack, >> 142 G4double previousStepSize, >> 143 G4ForceCondition* condition) 137 { 144 { 138 // *** get unploarised mean free path from l 145 // *** get unploarised mean free path from lambda table *** 139 G4double mfp = << 146 G4double mfp = G4VEmProcess::GetMeanFreePath(aTrack, previousStepSize, condition); 140 G4VEmProcess::GetMeanFreePath(aTrack, prev << 141 147 142 if(theAsymmetryTable && fUseAsymmetryTable & << 148 143 { << 149 if (theAsymmetryTable && useAsymmetryTable) { 144 mfp *= ComputeSaturationFactor(aTrack); << 150 // *** get asymmetry, if target is polarized *** 145 } << 151 const G4DynamicParticle* aDynamicGamma = aTrack.GetDynamicParticle(); 146 if(verboseLevel >= 2) << 152 const G4double GammaEnergy = aDynamicGamma->GetKineticEnergy(); 147 { << 153 const G4StokesVector GammaPolarization = aTrack.GetPolarization(); 148 G4cout << "G4PolarizedCompton::MeanFreePat << 154 const G4ParticleMomentum GammaDirection0 = aDynamicGamma->GetMomentumDirection(); 149 << G4endl; << 155 150 } << 156 G4Material* aMaterial = aTrack.GetMaterial(); 151 return mfp; << 157 G4VPhysicalVolume* aPVolume = aTrack.GetVolume(); >> 158 G4LogicalVolume* aLVolume = aPVolume->GetLogicalVolume(); >> 159 >> 160 // G4Material* bMaterial = aLVolume->GetMaterial(); >> 161 G4PolarizationManager * polarizationManger = G4PolarizationManager::GetInstance(); >> 162 >> 163 const G4bool VolumeIsPolarized = polarizationManger->IsPolarized(aLVolume); >> 164 G4StokesVector ElectronPolarization = polarizationManger->GetVolumePolarization(aLVolume); >> 165 >> 166 if (!VolumeIsPolarized || mfp == DBL_MAX) return mfp; >> 167 >> 168 if (verboseLevel>=2) { >> 169 >> 170 G4cout << " Mom " << GammaDirection0 << G4endl; >> 171 G4cout << " Polarization " << GammaPolarization << G4endl; >> 172 G4cout << " MaterialPol. " << ElectronPolarization << G4endl; >> 173 G4cout << " Phys. Volume " << aPVolume->GetName() << G4endl; >> 174 G4cout << " Log. Volume " << aLVolume->GetName() << G4endl; >> 175 G4cout << " Material " << aMaterial << G4endl; >> 176 } >> 177 >> 178 G4int midx= CurrentMaterialCutsCoupleIndex(); >> 179 G4PhysicsVector * aVector=(*theAsymmetryTable)(midx); >> 180 >> 181 G4double asymmetry=0; >> 182 if (aVector) { >> 183 G4bool isOutRange; >> 184 asymmetry = aVector->GetValue(GammaEnergy, isOutRange); >> 185 } else { >> 186 G4cout << " MaterialIndex " << midx << " is out of range \n"; >> 187 asymmetry=0; >> 188 } >> 189 >> 190 // we have to determine angle between particle motion >> 191 // and target polarisation here >> 192 // circ pol * Vec(ElectronPol)*Vec(PhotonMomentum) >> 193 // both vectors in global reference frame >> 194 >> 195 G4double pol=ElectronPolarization*GammaDirection0; >> 196 >> 197 G4double polProduct = GammaPolarization.p3() * pol; >> 198 mfp *= 1. / ( 1. + polProduct * asymmetry ); >> 199 >> 200 if (verboseLevel>=2) { >> 201 G4cout << " MeanFreePath: " << mfp / mm << " mm " << G4endl; >> 202 G4cout << " Asymmetry: " << asymmetry << G4endl; >> 203 G4cout << " PolProduct: " << polProduct << G4endl; >> 204 } >> 205 } >> 206 >> 207 return mfp; 152 } 208 } 153 209 154 //....oooOO0OOooo........oooOO0OOooo........oo << 155 G4double G4PolarizedCompton::PostStepGetPhysic 210 G4double G4PolarizedCompton::PostStepGetPhysicalInteractionLength( 156 const G4Track& aTrack, G4double previousStep << 211 const G4Track& aTrack, >> 212 G4double previousStepSize, >> 213 G4ForceCondition* condition) 157 { 214 { 158 // save previous values << 215 // *** get unploarised mean free path from lambda table *** 159 G4double nLength = theNumberOfInteractionLen << 216 G4double mfp = G4VEmProcess::PostStepGetPhysicalInteractionLength(aTrack, previousStepSize, condition); 160 G4double iLength = currentInteractionLength; << 217 161 << 218 162 // *** compute unpolarized step limit *** << 219 if (theAsymmetryTable && useAsymmetryTable) { 163 // this changes theNumberOfInteractionLength << 220 // *** get asymmetry, if target is polarized *** 164 G4double x = G4VEmProcess::PostStepGetPhysic << 221 const G4DynamicParticle* aDynamicGamma = aTrack.GetDynamicParticle(); 165 aTrack, previousStepSize, condition); << 222 const G4double GammaEnergy = aDynamicGamma->GetKineticEnergy(); 166 G4double x0 = x; << 223 const G4StokesVector GammaPolarization = aTrack.GetPolarization(); 167 G4double satFact = 1.0; << 224 const G4ParticleMomentum GammaDirection0 = aDynamicGamma->GetMomentumDirection(); 168 << 225 169 // *** add corrections on polarisation *** << 226 G4Material* aMaterial = aTrack.GetMaterial(); 170 if(theAsymmetryTable && fUseAsymmetryTable & << 227 G4VPhysicalVolume* aPVolume = aTrack.GetVolume(); 171 { << 228 G4LogicalVolume* aLVolume = aPVolume->GetLogicalVolume(); 172 satFact = ComputeSaturationFact << 229 173 G4double curLength = currentInteractionLen << 230 // G4Material* bMaterial = aLVolume->GetMaterial(); 174 G4double prvLength = iLength * satFact; << 231 G4PolarizationManager * polarizationManger = G4PolarizationManager::GetInstance(); 175 if(nLength > 0.0) << 232 176 { << 233 const G4bool VolumeIsPolarized = polarizationManger->IsPolarized(aLVolume); 177 theNumberOfInteractionLengthLeft = << 234 G4StokesVector ElectronPolarization = polarizationManger->GetVolumePolarization(aLVolume); 178 std::max(nLength - previousStepSize / << 235 179 } << 236 if (!VolumeIsPolarized || mfp == DBL_MAX) return mfp; 180 x = theNumberOfInteractionLengthLeft * cur << 237 181 } << 238 if (verboseLevel>=2) { 182 if(verboseLevel >= 2) << 239 183 { << 240 G4cout << " Mom " << GammaDirection0 << G4endl; 184 G4cout << "G4PolarizedCompton::PostStepGPI << 241 G4cout << " Polarization " << GammaPolarization << G4endl; 185 << x / mm << " mm;" << G4endl << 242 G4cout << " MaterialPol. " << ElectronPolarization << G4endl; 186 << " unpolarized valu << 243 G4cout << " Phys. Volume " << aPVolume->GetName() << G4endl; 187 << x0 / mm << " mm." << G4endl; << 244 G4cout << " Log. Volume " << aLVolume->GetName() << G4endl; 188 } << 245 G4cout << " Material " << aMaterial << G4endl; 189 return x; << 246 } >> 247 >> 248 G4int midx= CurrentMaterialCutsCoupleIndex(); >> 249 G4PhysicsVector * aVector=(*theAsymmetryTable)(midx); >> 250 >> 251 G4double asymmetry=0; >> 252 if (aVector) { >> 253 G4bool isOutRange; >> 254 asymmetry = aVector->GetValue(GammaEnergy, isOutRange); >> 255 } else { >> 256 G4cout << " MaterialIndex " << midx << " is out of range \n"; >> 257 asymmetry=0; >> 258 } >> 259 >> 260 // we have to determine angle between particle motion >> 261 // and target polarisation here >> 262 // circ pol * Vec(ElectronPol)*Vec(PhotonMomentum) >> 263 // both vectors in global reference frame >> 264 >> 265 G4double pol=ElectronPolarization*GammaDirection0; >> 266 >> 267 G4double polProduct = GammaPolarization.p3() * pol; >> 268 mfp *= 1. / ( 1. + polProduct * asymmetry ); >> 269 >> 270 if (verboseLevel>=2) { >> 271 G4cout << " MeanFreePath: " << mfp / mm << " mm " << G4endl; >> 272 G4cout << " Asymmetry: " << asymmetry << G4endl; >> 273 G4cout << " PolProduct: " << polProduct << G4endl; >> 274 } >> 275 } >> 276 >> 277 return mfp; 190 } 278 } 191 279 192 //....oooOO0OOooo........oooOO0OOooo........oo 280 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 193 G4double G4PolarizedCompton::ComputeSaturation << 194 { << 195 G4double factor = 1.0; << 196 281 197 // *** get asymmetry, if target is polarized << 282 void G4PolarizedCompton::PreparePhysicsTable(const G4ParticleDefinition& part) 198 const G4DynamicParticle* aDynamicGamma = aTr << 283 { 199 const G4double GammaEnergy = aDy << 284 G4VEmProcess::PreparePhysicsTable(part); 200 const G4StokesVector GammaPolarization = << 285 if(buildAsymmetryTable) 201 G4StokesVector(aTrack.GetPolarization()); << 286 theAsymmetryTable = G4PhysicsTableHelper::PreparePhysicsTable(theAsymmetryTable); 202 const G4ParticleMomentum GammaDirection0 = << 203 aDynamicGamma->GetMomentumDirection(); << 204 << 205 const G4Material* aMaterial = aTrack.GetMate << 206 G4VPhysicalVolume* aPVolume = aTrack.GetVolu << 207 G4LogicalVolume* aLVolume = aPVolume->GetL << 208 << 209 G4PolarizationManager* polarizationManager = << 210 G4PolarizationManager::GetInstance(); << 211 << 212 const G4bool VolumeIsPolarized = polarizatio << 213 G4StokesVector ElectronPolarization = << 214 polarizationManager->GetVolumePolarization << 215 << 216 if(VolumeIsPolarized) << 217 { << 218 if(verboseLevel >= 2) << 219 { << 220 G4cout << "G4PolarizedCompton::ComputeSa << 221 G4cout << " Mom " << GammaDirection0 << << 222 G4cout << " Polarization " << GammaPolar << 223 G4cout << " MaterialPol. " << ElectronPo << 224 G4cout << " Phys. Volume " << aPVolume-> << 225 G4cout << " Log. Volume " << aLVolume-> << 226 G4cout << " Material " << aMaterial << 227 } << 228 << 229 std::size_t midx = CurrentMa << 230 const G4PhysicsVector* aVector = nullptr; << 231 if(midx < theAsymmetryTable->size()) << 232 { << 233 aVector = (*theAsymmetryTable)(midx); << 234 } << 235 if(aVector) << 236 { << 237 G4double asymmetry = aVector->Value(Gamm << 238 << 239 // we have to determine angle between p << 240 // and target polarisation here << 241 // circ pol * Vec(ElectronPol)*Vec( << 242 // both vectors in global reference fra << 243 << 244 G4double pol = ElectronPolarizati << 245 G4double polProduct = GammaPolarization. << 246 factor /= (1. + polProduct * asymmetry); << 247 if(verboseLevel >= 2) << 248 { << 249 G4cout << " Asymmetry: " << asymme << 250 G4cout << " PolProduct: " << polPro << 251 G4cout << " Factor: " << factor << 252 } << 253 } << 254 else << 255 { << 256 G4ExceptionDescription ed; << 257 ed << "Problem with asymmetry table: mat << 258 << " is out of range or the table is << 259 G4Exception("G4PolarizedComptonModel::Co << 260 JustWarning, ed, ""); << 261 } << 262 } << 263 return factor; << 264 } 287 } 265 288 266 //....oooOO0OOooo........oooOO0OOooo........oo 289 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 290 >> 291 267 void G4PolarizedCompton::BuildPhysicsTable(con 292 void G4PolarizedCompton::BuildPhysicsTable(const G4ParticleDefinition& part) 268 { 293 { 269 // *** build (unpolarized) cross section tab 294 // *** build (unpolarized) cross section tables (Lambda) 270 G4VEmProcess::BuildPhysicsTable(part); 295 G4VEmProcess::BuildPhysicsTable(part); 271 if(fBuildAsymmetryTable && fEmModel) << 296 if(buildAsymmetryTable) 272 { << 297 BuildAsymmetryTable(part); 273 G4bool isMaster = true; << 274 const G4PolarizedCompton* masterProcess = << 275 static_cast<const G4PolarizedCompton*>(G << 276 if(masterProcess && masterProcess != this) << 277 { << 278 isMaster = false; << 279 } << 280 if(isMaster) << 281 { << 282 BuildAsymmetryTable(part); << 283 } << 284 } << 285 } 298 } 286 299 287 //....oooOO0OOooo........oooOO0OOooo........oo 300 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 301 >> 302 288 void G4PolarizedCompton::BuildAsymmetryTable(c 303 void G4PolarizedCompton::BuildAsymmetryTable(const G4ParticleDefinition& part) 289 { 304 { 290 // cleanup old, initialise new table << 291 CleanTable(); << 292 theAsymmetryTable = << 293 G4PhysicsTableHelper::PreparePhysicsTable( << 294 << 295 // Access to materials 305 // Access to materials 296 const G4ProductionCutsTable* theCoupleTable << 306 const G4ProductionCutsTable* theCoupleTable= 297 G4ProductionCutsTable::GetProductionCutsTa << 307 G4ProductionCutsTable::GetProductionCutsTable(); 298 G4int numOfCouples = (G4int)theCoupleTable-> << 308 size_t numOfCouples = theCoupleTable->GetTableSize(); 299 if(!theAsymmetryTable) << 309 for(size_t i=0; i<numOfCouples; ++i) { 300 { << 310 if (!theAsymmetryTable) break; 301 return; << 311 if (theAsymmetryTable->GetFlag(i)) { 302 } << 312 303 G4int nbins = LambdaBinning( << 304 G4double emin = MinKinEnergy() << 305 G4double emax = MaxKinEnergy() << 306 G4PhysicsLogVector* aVector = nullptr; << 307 G4PhysicsLogVector* bVector = nullptr; << 308 << 309 for(G4int i = 0; i < numOfCouples; ++i) << 310 { << 311 if(theAsymmetryTable->GetFlag(i)) << 312 { << 313 // create physics vector and fill it 313 // create physics vector and fill it 314 const G4MaterialCutsCouple* couple = << 314 const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i); 315 theCoupleTable->GetMaterialCutsCouple( << 316 // use same parameters as for lambda 315 // use same parameters as for lambda 317 if(!aVector) << 316 G4PhysicsVector* aVector = LambdaPhysicsVector(couple); 318 { << 317 // modelManager->FillLambdaVector(aVector, couple, startFromNull); 319 aVector = new G4PhysicsLogVector(emin, << 320 bVector = aVector; << 321 } << 322 else << 323 { << 324 bVector = new G4PhysicsLogVector(*aVec << 325 } << 326 318 327 for(G4int j = 0; j <= nbins; ++j) << 319 for (G4int j = 0 ; j < LambdaBinning() ; ++j ) { 328 { << 320 G4double lowEdgeEnergy = aVector->GetLowEdgeEnergy(j); 329 G4double energy = bVector->Energy(j); << 321 G4double tasm=0.; 330 G4double tasm = 0.; << 322 G4double asym = ComputeAsymmetry(lowEdgeEnergy, couple, part, 0., tasm); 331 G4double asym = ComputeAsymmetry(ene << 323 aVector->PutValue(j,asym); 332 bVector->PutValue(j, asym); << 333 } 324 } 334 bVector->FillSecondDerivatives(); << 325 335 G4PhysicsTableHelper::SetPhysicsVector(t << 326 G4PhysicsTableHelper::SetPhysicsVector(theAsymmetryTable, i, aVector); 336 } 327 } 337 } 328 } >> 329 338 } 330 } 339 331 340 //....oooOO0OOooo........oooOO0OOooo........oo 332 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 341 G4double G4PolarizedCompton::ComputeAsymmetry( << 333 342 G4double energy, const G4MaterialCutsCouple* << 334 343 const G4ParticleDefinition& aParticle, G4dou << 335 G4double G4PolarizedCompton::ComputeAsymmetry(G4double energy, >> 336 const G4MaterialCutsCouple* couple, >> 337 const G4ParticleDefinition& aParticle, >> 338 G4double cut, >> 339 G4double & tAsymmetry) 344 { 340 { 345 G4double lAsymmetry = 0.0; 341 G4double lAsymmetry = 0.0; 346 tAsymmetry = 0; << 342 tAsymmetry=0; 347 343 >> 344 // 348 // calculate polarized cross section 345 // calculate polarized cross section 349 G4ThreeVector thePolarization = G4ThreeVecto << 346 // 350 fEmModel->SetTargetPolarization(thePolarizat << 347 G4ThreeVector thePolarization=G4ThreeVector(0.,0.,1.); 351 fEmModel->SetBeamPolarization(thePolarizatio << 348 emModel->SetTargetPolarization(thePolarization); 352 G4double sigma2 = << 349 emModel->SetBeamPolarization(thePolarization); 353 fEmModel->CrossSection(couple, &aParticle, << 350 G4double sigma2=emModel->CrossSection(couple,&aParticle,energy,cut,energy); 354 351 >> 352 // 355 // calculate unpolarized cross section 353 // calculate unpolarized cross section 356 thePolarization = G4ThreeVector(); << 354 // 357 fEmModel->SetTargetPolarization(thePolarizat << 355 thePolarization=G4ThreeVector(); 358 fEmModel->SetBeamPolarization(thePolarizatio << 356 emModel->SetTargetPolarization(thePolarization); 359 G4double sigma0 = << 357 emModel->SetBeamPolarization(thePolarization); 360 fEmModel->CrossSection(couple, &aParticle, << 358 G4double sigma0=emModel->CrossSection(couple,&aParticle,energy,cut,energy); 361 << 359 362 // determine asymmetries << 360 // determine assymmetries 363 if(sigma0 > 0.) << 361 if (sigma0>0.) { 364 { << 362 lAsymmetry=sigma2/sigma0-1.; 365 lAsymmetry = sigma2 / sigma0 - 1.; << 366 } 363 } 367 return lAsymmetry; 364 return lAsymmetry; 368 } 365 } >> 366 >> 367 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 369 368