Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions
G4PAIPhotModel Class Reference

#include <G4PAIPhotModel.hh>

Inheritance diagram for G4PAIPhotModel:
G4VEmModel G4VEmFluctuationModel

Public Member Functions

 G4PAIPhotModel (const G4ParticleDefinition *p=0, const G4String &nam="PAI")
 
virtual ~G4PAIPhotModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &)
 
virtual void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel)
 
virtual G4double ComputeDEDXPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy)
 
virtual G4double CrossSectionPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
 
virtual G4double SampleFluctuations (const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double, G4double, G4double)
 
virtual G4double Dispersion (const G4Material *, const G4DynamicParticle *, G4double, G4double)
 
void DefineForRegion (const G4Region *r)
 
G4PAIPhotDataGetPAIPhotData ()
 
G4double ComputeMaxEnergy (G4double scaledEnergy)
 
void SetVerboseLevel (G4int verbose)
 
- Public Member Functions inherited from G4VEmModel
 G4VEmModel (const G4String &nam)
 
virtual ~G4VEmModel ()
 
virtual void InitialiseForMaterial (const G4ParticleDefinition *, const G4Material *)
 
virtual void InitialiseForElement (const G4ParticleDefinition *, G4int Z)
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double ChargeSquareRatio (const G4Track &)
 
virtual G4double GetChargeSquareRatio (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual G4double GetParticleCharge (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void StartTracking (G4Track *)
 
virtual void CorrectionsAlongStep (const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
 
virtual G4double Value (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double MinPrimaryEnergy (const G4Material *, const G4ParticleDefinition *, G4double cut=0.0)
 
virtual G4double MinEnergyCut (const G4ParticleDefinition *, const G4MaterialCutsCouple *)
 
virtual void SetupForMaterial (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
void InitialiseElementSelectors (const G4ParticleDefinition *, const G4DataVector &)
 
std::vector
< G4EmElementSelector * > * 
GetElementSelectors ()
 
void SetElementSelectors (std::vector< G4EmElementSelector * > *)
 
G4double ComputeDEDX (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
G4double CrossSection (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeMeanFreePath (const G4ParticleDefinition *, G4double kineticEnergy, const G4Material *, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, const G4Element *, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4int SelectIsotopeNumber (const G4Element *)
 
const G4ElementSelectRandomAtom (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectRandomAtom (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4int SelectRandomAtomNumber (const G4Material *)
 
void SetParticleChange (G4VParticleChange *, G4VEmFluctuationModel *f=0)
 
void SetCrossSectionTable (G4PhysicsTable *, G4bool isLocal)
 
G4ElementDataGetElementData ()
 
G4PhysicsTableGetCrossSectionTable ()
 
G4VEmFluctuationModelGetModelOfFluctuations ()
 
G4VEmAngularDistributionGetAngularDistribution ()
 
void SetAngularDistribution (G4VEmAngularDistribution *)
 
G4double HighEnergyLimit () const
 
G4double LowEnergyLimit () const
 
G4double HighEnergyActivationLimit () const
 
G4double LowEnergyActivationLimit () const
 
G4double PolarAngleLimit () const
 
G4double SecondaryThreshold () const
 
G4bool LPMFlag () const
 
G4bool DeexcitationFlag () const
 
G4bool ForceBuildTableFlag () const
 
G4bool UseAngularGeneratorFlag () const
 
void SetAngularGeneratorFlag (G4bool)
 
void SetHighEnergyLimit (G4double)
 
void SetLowEnergyLimit (G4double)
 
void SetActivationHighEnergyLimit (G4double)
 
void SetActivationLowEnergyLimit (G4double)
 
G4bool IsActive (G4double kinEnergy)
 
void SetPolarAngleLimit (G4double)
 
void SetSecondaryThreshold (G4double)
 
void SetLPMFlag (G4bool val)
 
void SetDeexcitationFlag (G4bool val)
 
void SetForceBuildTable (G4bool val)
 
void SetMasterThread (G4bool val)
 
G4bool IsMaster () const
 
G4double MaxSecondaryKinEnergy (const G4DynamicParticle *dynParticle)
 
const G4StringGetName () const
 
void SetCurrentCouple (const G4MaterialCutsCouple *)
 
const G4ElementGetCurrentElement () const
 
- Public Member Functions inherited from G4VEmFluctuationModel
 G4VEmFluctuationModel (const G4String &nam)
 
virtual ~G4VEmFluctuationModel ()
 
virtual void InitialiseMe (const G4ParticleDefinition *)
 
virtual void SetParticleAndCharge (const G4ParticleDefinition *, G4double q2)
 
G4String GetName () const
 

Protected Member Functions

G4double MaxSecondaryEnergy (const G4ParticleDefinition *, G4double kinEnergy)
 
- Protected Member Functions inherited from G4VEmModel
G4ParticleChangeForLossGetParticleChangeForLoss ()
 
G4ParticleChangeForGammaGetParticleChangeForGamma ()
 
const G4MaterialCutsCoupleCurrentCouple () const
 
void SetCurrentElement (const G4Element *)
 

Additional Inherited Members

- Protected Attributes inherited from G4VEmModel
G4ElementDatafElementData
 
G4VParticleChangepParticleChange
 
G4PhysicsTablexSectionTable
 
const std::vector< G4double > * theDensityFactor
 
const std::vector< G4int > * theDensityIdx
 
size_t idxTable
 

Detailed Description

Definition at line 64 of file G4PAIPhotModel.hh.

Constructor & Destructor Documentation

G4PAIPhotModel::G4PAIPhotModel ( const G4ParticleDefinition p = 0,
const G4String nam = "PAI" 
)

Definition at line 72 of file G4PAIPhotModel.cc.

References G4Electron::Electron(), G4Positron::Positron(), and G4VEmModel::SetAngularDistribution().

74  fVerbose(0),
75  fModelData(0),
76  fParticle(0)
77 {
78  fElectron = G4Electron::Electron();
79  fPositron = G4Positron::Positron();
80 
81  fParticleChange = 0;
82 
83  if(p) { SetParticle(p); }
84  else { SetParticle(fElectron); }
85 
86  // default generator
88 
89  isInitialised = false;
90 }
G4VEmModel(const G4String &nam)
Definition: G4VEmModel.cc:65
static G4Positron * Positron()
Definition: G4Positron.cc:94
void SetAngularDistribution(G4VEmAngularDistribution *)
Definition: G4VEmModel.hh:585
static G4Electron * Electron()
Definition: G4Electron.cc:94
G4VEmFluctuationModel(const G4String &nam)
G4PAIPhotModel::~G4PAIPhotModel ( )
virtual

Definition at line 94 of file G4PAIPhotModel.cc.

References G4VEmModel::IsMaster().

95 {
96  if(IsMaster()) { delete fModelData; }
97 }
G4bool IsMaster() const
Definition: G4VEmModel.hh:676

Member Function Documentation

G4double G4PAIPhotModel::ComputeDEDXPerVolume ( const G4Material ,
const G4ParticleDefinition p,
G4double  kineticEnergy,
G4double  cutEnergy 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 176 of file G4PAIPhotModel.cc.

References G4VEmModel::CurrentCouple(), G4PAIPhotData::DEDXPerVolume(), MaxSecondaryEnergy(), and G4INCL::Math::min().

180 {
181  G4int coupleIndex = FindCoupleIndex(CurrentCouple());
182  if(0 > coupleIndex) { return 0.0; }
183 
184  G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy);
185 
186  G4double scaledTkin = kineticEnergy*fRatio;
187 
188  return fChargeSquare*fModelData->DEDXPerVolume(coupleIndex, scaledTkin, cut);
189 }
G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy)
int G4int
Definition: G4Types.hh:78
const G4MaterialCutsCouple * CurrentCouple() const
Definition: G4VEmModel.hh:426
G4double DEDXPerVolume(G4int coupleIndex, G4double scaledTkin, G4double cut) const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
double G4double
Definition: G4Types.hh:76
G4double G4PAIPhotModel::ComputeMaxEnergy ( G4double  scaledEnergy)
inline

Definition at line 153 of file G4PAIPhotModel.hh.

References MaxSecondaryEnergy().

Referenced by G4PAIPhotData::Initialise().

154 {
155  return MaxSecondaryEnergy(fParticle, scaledEnergy/fRatio);
156 }
G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy)
G4double G4PAIPhotModel::CrossSectionPerVolume ( const G4Material ,
const G4ParticleDefinition p,
G4double  kineticEnergy,
G4double  cutEnergy,
G4double  maxEnergy 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 193 of file G4PAIPhotModel.cc.

References G4PAIPhotData::CrossSectionPerVolume(), G4VEmModel::CurrentCouple(), MaxSecondaryEnergy(), and G4INCL::Math::min().

198 {
199  G4int coupleIndex = FindCoupleIndex(CurrentCouple());
200 
201  if(0 > coupleIndex) return 0.0;
202 
203  G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
204 
205  if(tmax <= cutEnergy) return 0.0;
206 
207  G4double scaledTkin = kineticEnergy*fRatio;
208  G4double xsc = fChargeSquare*fModelData->CrossSectionPerVolume(coupleIndex,
209  scaledTkin,
210  cutEnergy, tmax);
211  return xsc;
212 }
G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy)
int G4int
Definition: G4Types.hh:78
const G4MaterialCutsCouple * CurrentCouple() const
Definition: G4VEmModel.hh:426
G4double CrossSectionPerVolume(G4int coupleIndex, G4double scaledTkin, G4double tcut, G4double tmax) const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
double G4double
Definition: G4Types.hh:76
void G4PAIPhotModel::DefineForRegion ( const G4Region r)
virtual

Reimplemented from G4VEmModel.

Definition at line 425 of file G4PAIPhotModel.cc.

426 {
427  fPAIRegionVector.push_back(r);
428 }
G4double G4PAIPhotModel::Dispersion ( const G4Material material,
const G4DynamicParticle aParticle,
G4double  tmax,
G4double  step 
)
virtual

Implements G4VEmFluctuationModel.

Definition at line 377 of file G4PAIPhotModel.cc.

References python.hepunit::eplus, G4DynamicParticle::GetCharge(), G4Material::GetElectronDensity(), G4DynamicParticle::GetKineticEnergy(), G4DynamicParticle::GetMass(), and python.hepunit::twopi_mc2_rcl2.

381 {
382  G4double particleMass = aParticle->GetMass();
383  G4double electronDensity = material->GetElectronDensity();
384  G4double kineticEnergy = aParticle->GetKineticEnergy();
385  G4double q = aParticle->GetCharge()/eplus;
386  G4double etot = kineticEnergy + particleMass;
387  G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*particleMass)/(etot*etot);
388  G4double siga = (1.0/beta2 - 0.5) * twopi_mc2_rcl2 * tmax * step
389  * electronDensity * q * q;
390 
391  return siga;
392  /*
393  G4double loss, sumLoss=0., sumLoss2=0., sigma2, meanLoss=0.;
394  for(G4int i = 0; i < fMeanNumber; i++)
395  {
396  loss = SampleFluctuations(material,aParticle,tmax,step,meanLoss);
397  sumLoss += loss;
398  sumLoss2 += loss*loss;
399  }
400  meanLoss = sumLoss/fMeanNumber;
401  sigma2 = meanLoss*meanLoss + (sumLoss2-2*sumLoss*meanLoss)/fMeanNumber;
402  return sigma2;
403  */
404 }
G4double GetKineticEnergy() const
G4double GetElectronDensity() const
Definition: G4Material.hh:215
G4double GetMass() const
G4double GetCharge() const
double G4double
Definition: G4Types.hh:76
G4PAIPhotData * G4PAIPhotModel::GetPAIPhotData ( )
inline

Definition at line 148 of file G4PAIPhotModel.hh.

Referenced by InitialiseLocal().

149 {
150  return fModelData;
151 }
void G4PAIPhotModel::Initialise ( const G4ParticleDefinition p,
const G4DataVector cuts 
)
virtual

Implements G4VEmModel.

Definition at line 101 of file G4PAIPhotModel.cc.

References G4Region::FindCouple(), G4cout, G4endl, G4MaterialCutsCouple::GetIndex(), G4Material::GetMaterialTable(), G4Material::GetNumberOfMaterials(), G4VEmModel::GetParticleChangeForLoss(), G4ParticleDefinition::GetParticleName(), G4VEmModel::HighEnergyLimit(), G4PAIPhotData::Initialise(), G4VEmModel::InitialiseElementSelectors(), G4VEmModel::IsMaster(), G4VEmModel::LowEnergyLimit(), and n.

103 {
104  // if(fVerbose > 0)
105  {
106  G4cout<<"G4PAIPhotModel::Initialise for "<<p->GetParticleName()<<G4endl;
107  }
108 
109  if(isInitialised) { return; }
110  isInitialised = true;
111 
112  SetParticle(p);
113  fParticleChange = GetParticleChangeForLoss();
114 
115  if(IsMaster()) {
116 
118 
119  if(!fModelData) {
120 
121  G4double tmin = LowEnergyLimit()*fRatio;
122  G4double tmax = HighEnergyLimit()*fRatio;
123  fModelData = new G4PAIPhotData(tmin, tmax, fVerbose);
124  }
125  // Prepare initialization
126  const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
127  size_t numOfMat = G4Material::GetNumberOfMaterials();
128  size_t numRegions = fPAIRegionVector.size();
129 
130  for(size_t iReg = 0; iReg < numRegions; ++iReg) {
131  const G4Region* curReg = fPAIRegionVector[iReg];
132  G4Region* reg = const_cast<G4Region*>(curReg);
133 
134  for(size_t jMat = 0; jMat < numOfMat; ++jMat) {
135  G4Material* mat = (*theMaterialTable)[jMat];
136  const G4MaterialCutsCouple* cutCouple = reg->FindCouple(mat);
137  //G4cout << "Couple <" << fCutCouple << G4endl;
138  if(cutCouple) {
139  /*
140  G4cout << "Reg <" <<curReg->GetName() << "> mat <"
141  << fMaterial->GetName() << "> fCouple= "
142  << fCutCouple << " idx= " << fCutCouple->GetIndex()
143  <<" " << p->GetParticleName() <<G4endl;
144  // G4cout << cuts.size() << G4endl;
145  */
146  // check if this couple is not already initialized
147  size_t n = fMaterialCutsCoupleVector.size();
148  if(0 < n) {
149  for(size_t i=0; i<fMaterialCutsCoupleVector.size(); ++i) {
150  if(cutCouple == fMaterialCutsCoupleVector[i]) {
151  break;
152  }
153  }
154  }
155  // initialise data banks
156  fMaterialCutsCoupleVector.push_back(cutCouple);
157  G4double deltaCutInKinEnergy = cuts[cutCouple->GetIndex()];
158  fModelData->Initialise(cutCouple, deltaCutInKinEnergy, this);
159  }
160  }
161  }
162  }
163 }
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:599
G4ParticleChangeForLoss * GetParticleChangeForLoss()
Definition: G4VEmModel.cc:107
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
Definition: G4VEmModel.cc:135
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:592
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:564
std::vector< G4Material * > G4MaterialTable
G4bool IsMaster() const
Definition: G4VEmModel.hh:676
const G4String & GetParticleName() const
void Initialise(const G4MaterialCutsCouple *, G4double cut, G4PAIPhotModel *)
G4GLOB_DLL std::ostream G4cout
G4MaterialCutsCouple * FindCouple(G4Material *mat)
const G4int n
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:571
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void G4PAIPhotModel::InitialiseLocal ( const G4ParticleDefinition ,
G4VEmModel masterModel 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 167 of file G4PAIPhotModel.cc.

References G4VEmModel::GetElementSelectors(), GetPAIPhotData(), and G4VEmModel::SetElementSelectors().

169 {
170  fModelData = static_cast<G4PAIPhotModel*>(masterModel)->GetPAIPhotData();
172 }
G4PAIPhotData * GetPAIPhotData()
std::vector< G4EmElementSelector * > * GetElementSelectors()
Definition: G4VEmModel.hh:760
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
Definition: G4VEmModel.hh:768
G4double G4PAIPhotModel::MaxSecondaryEnergy ( const G4ParticleDefinition p,
G4double  kinEnergy 
)
protectedvirtual

Reimplemented from G4VEmModel.

Definition at line 408 of file G4PAIPhotModel.cc.

References python.hepunit::electron_mass_c2.

Referenced by ComputeDEDXPerVolume(), ComputeMaxEnergy(), CrossSectionPerVolume(), and SampleSecondaries().

410 {
411  SetParticle(p);
412  G4double tmax = kinEnergy;
413  if(p == fElectron) { tmax *= 0.5; }
414  else if(p != fPositron) {
415  G4double ratio= electron_mass_c2/fMass;
416  G4double gamma= kinEnergy/fMass + 1.0;
417  tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
418  (1. + 2.0*gamma*ratio + ratio*ratio);
419  }
420  return tmax;
421 }
float electron_mass_c2
Definition: hepunit.py:274
double G4double
Definition: G4Types.hh:76
G4double G4PAIPhotModel::SampleFluctuations ( const G4MaterialCutsCouple matCC,
const G4DynamicParticle aParticle,
G4double  ,
G4double  step,
G4double  eloss 
)
virtual

Implements G4VEmFluctuationModel.

Definition at line 337 of file G4PAIPhotModel.cc.

References G4DynamicParticle::GetDefinition(), G4DynamicParticle::GetKineticEnergy(), G4PAIPhotData::SampleAlongStepPhotonTransfer(), and G4PAIPhotData::SampleAlongStepPlasmonTransfer().

341 {
342  // return 0.;
343  G4int coupleIndex = FindCoupleIndex(matCC);
344  if(0 > coupleIndex) { return eloss; }
345 
346  SetParticle(aParticle->GetDefinition());
347 
348 
349  // G4cout << "G4PAIPhotModel::SampleFluctuations step(mm)= "<< step/mm
350  // << " Eloss(keV)= " << eloss/keV << " in "
351  // << matCC->GetMaterial()->GetName() << G4endl;
352 
353 
354  G4double Tkin = aParticle->GetKineticEnergy();
355  G4double scaledTkin = Tkin*fRatio;
356 
357  G4double loss = fModelData->SampleAlongStepPhotonTransfer(coupleIndex, Tkin,
358  scaledTkin,
359  step*fChargeSquare);
360  loss += fModelData->SampleAlongStepPlasmonTransfer(coupleIndex, Tkin,
361  scaledTkin,
362  step*fChargeSquare);
363 
364 
365  // G4cout<<" PAIPhotModel::SampleFluctuations loss = "<<loss/keV<<" keV, on step = "
366  // <<step/mm<<" mm"<<G4endl;
367  return loss;
368 
369 }
G4double GetKineticEnergy() const
G4double SampleAlongStepPhotonTransfer(G4int coupleIndex, G4double kinEnergy, G4double scaledTkin, G4double stepFactor) const
G4ParticleDefinition * GetDefinition() const
int G4int
Definition: G4Types.hh:78
G4double SampleAlongStepPlasmonTransfer(G4int coupleIndex, G4double kinEnergy, G4double scaledTkin, G4double stepFactor) const
double G4double
Definition: G4Types.hh:76
void G4PAIPhotModel::SampleSecondaries ( std::vector< G4DynamicParticle * > *  vdp,
const G4MaterialCutsCouple matCC,
const G4DynamicParticle dp,
G4double  tmin,
G4double  maxEnergy 
)
virtual

Implements G4VEmModel.

Definition at line 219 of file G4PAIPhotModel.cc.

References G4cout, G4endl, G4lrint(), G4UniformRand, G4Gamma::Gamma(), G4VEmModel::GetAngularDistribution(), G4DynamicParticle::GetDefinition(), G4DynamicParticle::GetKineticEnergy(), G4MaterialCutsCouple::GetMaterial(), G4DynamicParticle::GetMomentumDirection(), G4PAIPhotData::GetPlasmonRatio(), G4Element::GetZ(), MaxSecondaryEnergy(), G4VParticleChange::ProposeLocalEnergyDeposit(), CLHEP::Hep3Vector::rotateUz(), G4PAIPhotData::SamplePostStepPhotonTransfer(), G4PAIPhotData::SamplePostStepPlasmonTransfer(), G4VEmModel::SelectRandomAtom(), G4DynamicParticle::SetDefinition(), G4DynamicParticle::SetKineticEnergy(), G4DynamicParticle::SetMomentumDirection(), G4ParticleChangeForLoss::SetProposedKineticEnergy(), G4ParticleChangeForLoss::SetProposedMomentumDirection(), python.hepunit::twopi, and CLHEP::Hep3Vector::unit().

224 {
225  G4int coupleIndex = FindCoupleIndex(matCC);
226  if(0 > coupleIndex) { return; }
227 
228  SetParticle(dp->GetDefinition());
229 
230  G4double kineticEnergy = dp->GetKineticEnergy();
231 
232  G4double tmax = MaxSecondaryEnergy(fParticle, kineticEnergy);
233 
234  if( maxEnergy < tmax) tmax = maxEnergy;
235  if( tmin >= tmax) return;
236 
237  G4ThreeVector direction = dp->GetMomentumDirection();
238  G4double scaledTkin = kineticEnergy*fRatio;
239  G4double totalEnergy = kineticEnergy + fMass;
240  G4double totalMomentum = sqrt(kineticEnergy*(totalEnergy + fMass));
241  G4double plRatio = fModelData->GetPlasmonRatio(coupleIndex, scaledTkin);
242 
243  if( G4UniformRand() <= plRatio )
244  {
245  G4double deltaTkin = fModelData->SamplePostStepPlasmonTransfer(coupleIndex, scaledTkin);
246 
247  // G4cout<<"G4PAIPhotModel::SampleSecondaries; dp "<<dp->GetParticleDefinition()->GetParticleName()
248  // <<"; Tkin = "<<kineticEnergy/keV<<" keV; transfer = "<<deltaTkin/keV<<" keV "<<G4endl;
249 
250  if( deltaTkin <= 0. && fVerbose > 0)
251  {
252  G4cout<<"G4PAIPhotModel::SampleSecondary e- deltaTkin = "<<deltaTkin<<G4endl;
253  }
254  if( deltaTkin <= 0.) return;
255 
256  if( deltaTkin > tmax) deltaTkin = tmax;
257 
258  const G4Element* anElement = SelectRandomAtom(matCC,fParticle,kineticEnergy);
259  G4int Z = G4lrint(anElement->GetZ());
260 
261  G4DynamicParticle* deltaRay = new G4DynamicParticle(fElectron,
262  GetAngularDistribution()->SampleDirection(dp, deltaTkin,
263  Z, matCC->GetMaterial()),
264  deltaTkin);
265 
266  // primary change
267 
268  kineticEnergy -= deltaTkin;
269 
270  if( kineticEnergy <= 0. ) // kill primary as local? energy deposition
271  {
272  fParticleChange->SetProposedKineticEnergy(0.0);
273  fParticleChange->ProposeLocalEnergyDeposit(kineticEnergy+deltaTkin);
274  // fParticleChange->ProposeTrackStatus(fStopAndKill);
275  return;
276  }
277  else
278  {
279  G4ThreeVector dir = totalMomentum*direction - deltaRay->GetMomentum();
280  direction = dir.unit();
281  fParticleChange->SetProposedKineticEnergy(kineticEnergy);
282  fParticleChange->SetProposedMomentumDirection(direction);
283  vdp->push_back(deltaRay);
284  }
285  }
286  else // secondary X-ray CR photon
287  {
288  G4double deltaTkin = fModelData->SamplePostStepPhotonTransfer(coupleIndex, scaledTkin);
289 
290  // G4cout<<"PAIPhotonModel PhotonPostStepTransfer = "<<deltaTkin/keV<<" keV"<<G4endl;
291 
292  if( deltaTkin <= 0. )
293  {
294  G4cout<<"G4PAIPhotonModel::SampleSecondary gamma deltaTkin = "<<deltaTkin<<G4endl;
295  }
296  if( deltaTkin <= 0.) return;
297 
298  if( deltaTkin >= kineticEnergy ) // stop primary
299  {
300  deltaTkin = kineticEnergy;
301  kineticEnergy = 0.0;
302  }
303  G4double costheta = 0.; // G4UniformRand(); // VG: ??? for start only
304  G4double sintheta = sqrt((1.+costheta)*(1.-costheta));
305 
306  // direction of the 'Cherenkov' photon
307  G4double phi = twopi*G4UniformRand();
308  G4double dirx = sintheta*cos(phi), diry = sintheta*sin(phi), dirz = costheta;
309 
310  G4ThreeVector deltaDirection(dirx,diry,dirz);
311  deltaDirection.rotateUz(direction);
312 
313  if( kineticEnergy > 0.) // primary change
314  {
315  kineticEnergy -= deltaTkin;
316  fParticleChange->SetProposedKineticEnergy(kineticEnergy);
317  }
318  else // stop primary, but pass X-ray CR
319  {
320  // fParticleChange->ProposeLocalEnergyDeposit(deltaTkin);
321  fParticleChange->SetProposedKineticEnergy(0.0);
322  }
323  // create G4DynamicParticle object for photon ray
324 
325  G4DynamicParticle* photonRay = new G4DynamicParticle;
326  photonRay->SetDefinition( G4Gamma::Gamma() );
327  photonRay->SetKineticEnergy( deltaTkin );
328  photonRay->SetMomentumDirection(deltaDirection);
329 
330  vdp->push_back(photonRay);
331  }
332  return;
333 }
G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy)
G4double SamplePostStepPhotonTransfer(G4int coupleIndex, G4double scaledTkin) const
G4double GetKineticEnergy() const
G4double GetPlasmonRatio(G4int coupleIndex, G4double scaledTkin) const
G4double GetZ() const
Definition: G4Element.hh:131
G4VEmAngularDistribution * GetAngularDistribution()
Definition: G4VEmModel.hh:578
void SetMomentumDirection(const G4ThreeVector &aDirection)
G4ParticleDefinition * GetDefinition() const
int G4int
Definition: G4Types.hh:78
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
#define G4UniformRand()
Definition: Randomize.hh:87
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void SetProposedMomentumDirection(const G4ThreeVector &dir)
void SetKineticEnergy(G4double aEnergy)
int G4lrint(double ad)
Definition: templates.hh:163
Hep3Vector unit() const
G4double SamplePostStepPlasmonTransfer(G4int coupleIndex, G4double scaledTkin) const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.hh:510
const G4Material * GetMaterial() const
void G4PAIPhotModel::SetVerboseLevel ( G4int  verbose)
inline

Definition at line 158 of file G4PAIPhotModel.hh.

159 {
160  fVerbose=verbose;
161 }

The documentation for this class was generated from the following files: