Geant4  10.02.p03
G4VEmAdjointModel Class Referenceabstract

#include <G4VEmAdjointModel.hh>

Inheritance diagram for G4VEmAdjointModel:
Collaboration diagram for G4VEmAdjointModel:

Public Member Functions

 G4VEmAdjointModel (const G4String &nam)
 
virtual ~G4VEmAdjointModel ()
 
virtual void SampleSecondaries (const G4Track &aTrack, G4bool IsScatProjToProjCase, G4ParticleChange *fParticleChange)=0
 
virtual G4double AdjointCrossSection (const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
 
virtual G4double GetAdjointCrossSection (const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
 
virtual G4double DiffCrossSectionPerAtomPrimToSecond (G4double kinEnergyProj, G4double kinEnergyProd, G4double Z, G4double A=0.)
 
virtual G4double DiffCrossSectionPerAtomPrimToScatPrim (G4double kinEnergyProj, G4double kinEnergyScatProj, G4double Z, G4double A=0.)
 
virtual G4double DiffCrossSectionPerVolumePrimToSecond (const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
 
virtual G4double DiffCrossSectionPerVolumePrimToScatPrim (const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyScatProj)
 
virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase (G4double PrimAdjEnergy)
 
virtual G4double GetSecondAdjEnergyMinForScatProjToProjCase (G4double PrimAdjEnergy, G4double Tcut=0)
 
virtual G4double GetSecondAdjEnergyMaxForProdToProjCase (G4double PrimAdjEnergy)
 
virtual G4double GetSecondAdjEnergyMinForProdToProjCase (G4double PrimAdjEnergy)
 
void DefineCurrentMaterial (const G4MaterialCutsCouple *couple)
 
std::vector< std::vector< double > *> ComputeAdjointCrossSectionVectorPerAtomForSecond (G4double kinEnergyProd, G4double Z, G4double A=0., G4int nbin_pro_decade=10)
 
std::vector< std::vector< double > *> ComputeAdjointCrossSectionVectorPerAtomForScatProj (G4double kinEnergyProd, G4double Z, G4double A=0., G4int nbin_pro_decade=10)
 
std::vector< std::vector< double > *> ComputeAdjointCrossSectionVectorPerVolumeForSecond (G4Material *aMaterial, G4double kinEnergyProd, G4int nbin_pro_decade=10)
 
std::vector< std::vector< double > *> ComputeAdjointCrossSectionVectorPerVolumeForScatProj (G4Material *aMaterial, G4double kinEnergyProd, G4int nbin_pro_decade=10)
 
void SetCSMatrices (std::vector< G4AdjointCSMatrix * > *Vec1CSMatrix, std::vector< G4AdjointCSMatrix * > *Vec2CSMatrix)
 
G4ParticleDefinitionGetAdjointEquivalentOfDirectPrimaryParticleDefinition ()
 
G4ParticleDefinitionGetAdjointEquivalentOfDirectSecondaryParticleDefinition ()
 
G4double GetHighEnergyLimit ()
 
G4double GetLowEnergyLimit ()
 
void SetHighEnergyLimit (G4double aVal)
 
void SetLowEnergyLimit (G4double aVal)
 
void DefineDirectEMModel (G4VEmModel *aModel)
 
void SetAdjointEquivalentOfDirectPrimaryParticleDefinition (G4ParticleDefinition *aPart)
 
void SetAdjointEquivalentOfDirectSecondaryParticleDefinition (G4ParticleDefinition *aPart)
 
void SetSecondPartOfSameType (G4bool aBool)
 
G4bool GetSecondPartOfSameType ()
 
void SetUseMatrix (G4bool aBool)
 
void SetUseMatrixPerElement (G4bool aBool)
 
void SetUseOnlyOneMatrixForAllElements (G4bool aBool)
 
void SetApplyCutInRange (G4bool aBool)
 
G4bool GetUseMatrix ()
 
G4bool GetUseMatrixPerElement ()
 
G4bool GetUseOnlyOneMatrixForAllElements ()
 
G4bool GetApplyCutInRange ()
 
G4String GetName ()
 
virtual void SetCSBiasingFactor (G4double aVal)
 

Protected Member Functions

G4double DiffCrossSectionFunction1 (G4double kinEnergyProj)
 
G4double DiffCrossSectionFunction2 (G4double kinEnergyProj)
 
G4double DiffCrossSectionPerVolumeFunctionForIntegrationOverEkinProj (G4double EkinProd)
 
G4double SampleAdjSecEnergyFromCSMatrix (size_t MatrixIndex, G4double prim_energy, G4bool IsScatProjToProjCase)
 
G4double SampleAdjSecEnergyFromCSMatrix (G4double prim_energy, G4bool IsScatProjToProjCase)
 
void SelectCSMatrix (G4bool IsScatProjToProjCase)
 
virtual G4double SampleAdjSecEnergyFromDiffCrossSectionPerAtom (G4double prim_energy, G4bool IsScatProjToProjCase)
 
virtual void CorrectPostStepWeight (G4ParticleChange *fParticleChange, G4double old_weight, G4double adjointPrimKinEnergy, G4double projectileKinEnergy, G4bool IsScatProjToProjCase)
 

Protected Attributes

G4VEmModeltheDirectEMModel
 
G4VParticleChange * pParticleChange
 
const G4String name
 
G4int ASelectedNucleus
 
G4int ZSelectedNucleus
 
G4MaterialSelectedMaterial
 
G4double kinEnergyProdForIntegration
 
G4double kinEnergyScatProjForIntegration
 
G4double kinEnergyProjForIntegration
 
std::vector< G4AdjointCSMatrix *> * pOnCSMatrixForProdToProjBackwardScattering
 
std::vector< G4AdjointCSMatrix *> * pOnCSMatrixForScatProjToProjBackwardScattering
 
std::vector< G4doubleCS_Vs_ElementForScatProjToProjCase
 
std::vector< G4doubleCS_Vs_ElementForProdToProjCase
 
G4double lastCS
 
G4double lastAdjointCSForScatProjToProjCase
 
G4double lastAdjointCSForProdToProjCase
 
G4ParticleDefinitiontheAdjEquivOfDirectPrimPartDef
 
G4ParticleDefinitiontheAdjEquivOfDirectSecondPartDef
 
G4ParticleDefinitiontheDirectPrimaryPartDef
 
G4bool second_part_of_same_type
 
G4double preStepEnergy
 
G4MaterialcurrentMaterial
 
G4MaterialCutsCouplecurrentCouple
 
size_t currentMaterialIndex
 
size_t currentCoupleIndex
 
G4double currentTcutForDirectPrim
 
G4double currentTcutForDirectSecond
 
G4bool ApplyCutInRange
 
G4double mass_ratio_product
 
G4double mass_ratio_projectile
 
G4double HighEnergyLimit
 
G4double LowEnergyLimit
 
G4double CS_biasing_factor
 
G4bool UseMatrix
 
G4bool UseMatrixPerElement
 
G4bool UseOnlyOneMatrixForAllElements
 
size_t indexOfUsedCrossSectionMatrix
 
size_t model_index
 

Detailed Description

Definition at line 72 of file G4VEmAdjointModel.hh.

Constructor & Destructor Documentation

◆ G4VEmAdjointModel()

G4VEmAdjointModel::G4VEmAdjointModel ( const G4String nam)

Definition at line 41 of file G4VEmAdjointModel.cc.

41  :
42 name(nam)
43 // lowLimit(0.1*keV), highLimit(100.0*TeV), fluc(0), name(nam), pParticleChange(0)
44 {
50  currentCouple=0;
51 }
size_t RegisterEmAdjointModel(G4VEmAdjointModel *)
G4VEmModel * theDirectEMModel
G4MaterialCutsCouple * currentCouple
static G4AdjointCSManager * GetAdjointCSManager()
Here is the call graph for this function:

◆ ~G4VEmAdjointModel()

G4VEmAdjointModel::~G4VEmAdjointModel ( )
virtual

Definition at line 54 of file G4VEmAdjointModel.cc.

55 {;}

Member Function Documentation

◆ AdjointCrossSection()

G4double G4VEmAdjointModel::AdjointCrossSection ( const G4MaterialCutsCouple aCouple,
G4double  primEnergy,
G4bool  IsScatProjToProjCase 
)
virtual

Reimplemented in G4AdjointhIonisationModel, G4AdjointBremsstrahlungModel, G4AdjointComptonModel, and G4AdjointPhotoElectricModel.

Definition at line 58 of file G4VEmAdjointModel.cc.

61 {
62  DefineCurrentMaterial(aCouple);
63  preStepEnergy=primEnergy;
64 
65  std::vector<G4double>* CS_Vs_Element = &CS_Vs_ElementForProdToProjCase;
66  if (IsScatProjToProjCase) CS_Vs_Element = &CS_Vs_ElementForScatProjToProjCase;
68  this,
69  primEnergy,
71  IsScatProjToProjCase,
72  *CS_Vs_Element);
73  if (IsScatProjToProjCase) lastAdjointCSForScatProjToProjCase = lastCS;
75 
76 
77 
78  return lastCS;
79 
80 }
G4double lastAdjointCSForScatProjToProjCase
G4Material * currentMaterial
std::vector< G4double > CS_Vs_ElementForProdToProjCase
std::vector< G4double > CS_Vs_ElementForScatProjToProjCase
void DefineCurrentMaterial(const G4MaterialCutsCouple *couple)
G4double currentTcutForDirectSecond
G4double lastAdjointCSForProdToProjCase
static G4AdjointCSManager * GetAdjointCSManager()
G4double ComputeAdjointCS(G4Material *aMaterial, G4VEmAdjointModel *aModel, G4double PrimEnergy, G4double Tcut, G4bool IsScatProjToProjCase, std::vector< G4double > &AdjointCS_for_each_element)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeAdjointCrossSectionVectorPerAtomForScatProj()

std::vector< std::vector< G4double > *> G4VEmAdjointModel::ComputeAdjointCrossSectionVectorPerAtomForScatProj ( G4double  kinEnergyProd,
G4double  Z,
G4double  A = 0.,
G4int  nbin_pro_decade = 10 
)

Definition at line 292 of file G4VEmAdjointModel.cc.

298  ASelectedNucleus=int(A);
299  ZSelectedNucleus=int(Z);
300  kinEnergyScatProjForIntegration = kinEnergyScatProj;
301 
302  //compute the vector of integrated cross sections
303  //-------------------
304 
305  G4double minEProj= GetSecondAdjEnergyMinForScatProjToProjCase(kinEnergyScatProj);
306  G4double maxEProj= GetSecondAdjEnergyMaxForScatProjToProjCase(kinEnergyScatProj);
307  G4double dEmax=maxEProj-kinEnergyScatProj;
308  G4double dEmin=GetLowEnergyLimit();
309  G4double dE1=dEmin;
310  G4double dE2=dEmin;
311 
312 
313  std::vector< double>* log_ESec_vector = new std::vector< double>();
314  std::vector< double>* log_Prob_vector = new std::vector< double>();
315  log_ESec_vector->push_back(std::log(dEmin));
316  log_Prob_vector->push_back(-50.);
317  G4int nbins=std::max( int(std::log10(dEmax/dEmin))*nbin_pro_decade,5);
318  G4double fE=std::pow(dEmax/dEmin,1./nbins);
319 
320 
321 
322 
323 
324  G4double int_cross_section=0.;
325 
326  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
327  while (dE1 <dEmax*0.9999999999999){
328  dE2=dE1*fE;
329  int_cross_section +=integral.Simpson(this,
330  &G4VEmAdjointModel::DiffCrossSectionFunction2,minEProj+dE1,std::min(minEProj+dE2,maxEProj), 5);
331  //G4cout<<"int_cross_section "<<minEProj+dE1<<'\t'<<int_cross_section<<G4endl;
332  log_ESec_vector->push_back(std::log(std::min(dE2,maxEProj-minEProj)));
333  log_Prob_vector->push_back(std::log(int_cross_section));
334  dE1=dE2;
335 
336  }
337 
338 
339  std::vector< std::vector<G4double> *> res_mat;
340  res_mat.clear();
341  if (int_cross_section >0.) {
342  res_mat.push_back(log_ESec_vector);
343  res_mat.push_back(log_Prob_vector);
344  }
345 
346  return res_mat;
347 }
G4double kinEnergyScatProjForIntegration
int G4int
Definition: G4Types.hh:78
virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase(G4double PrimAdjEnergy)
double A(double temperature)
Float_t Z
G4double GetLowEnergyLimit()
G4double DiffCrossSectionFunction2(G4double kinEnergyProj)
virtual G4double GetSecondAdjEnergyMinForScatProjToProjCase(G4double PrimAdjEnergy, G4double Tcut=0)
G4double Simpson(T &typeT, F f, G4double a, G4double b, G4int n)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeAdjointCrossSectionVectorPerAtomForSecond()

std::vector< std::vector< G4double > *> G4VEmAdjointModel::ComputeAdjointCrossSectionVectorPerAtomForSecond ( G4double  kinEnergyProd,
G4double  Z,
G4double  A = 0.,
G4int  nbin_pro_decade = 10 
)

Definition at line 238 of file G4VEmAdjointModel.cc.

243 {
245  ASelectedNucleus= int(A);
246  ZSelectedNucleus=int(Z);
247  kinEnergyProdForIntegration = kinEnergyProd;
248 
249  //compute the vector of integrated cross sections
250  //-------------------
251 
252  G4double minEProj= GetSecondAdjEnergyMinForProdToProjCase(kinEnergyProd);
253  G4double maxEProj= GetSecondAdjEnergyMaxForProdToProjCase(kinEnergyProd);
254  G4double E1=minEProj;
255  std::vector< double>* log_ESec_vector = new std::vector< double>();
256  std::vector< double>* log_Prob_vector = new std::vector< double>();
257  log_ESec_vector->clear();
258  log_Prob_vector->clear();
259  log_ESec_vector->push_back(std::log(E1));
260  log_Prob_vector->push_back(-50.);
261 
262  G4double E2=std::pow(10.,double( int(std::log10(minEProj)*nbin_pro_decade)+1)/nbin_pro_decade);
263  G4double fE=std::pow(10.,1./nbin_pro_decade);
264  G4double int_cross_section=0.;
265 
266  if (std::pow(fE,5.)>(maxEProj/minEProj)) fE = std::pow(maxEProj/minEProj,0.2);
267 
268  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
269  while (E1 <maxEProj*0.9999999){
270  //G4cout<<E1<<'\t'<<E2<<G4endl;
271 
272  int_cross_section +=integral.Simpson(this,
273  &G4VEmAdjointModel::DiffCrossSectionFunction1,E1,std::min(E2,maxEProj*0.99999999), 5);
274  log_ESec_vector->push_back(std::log(std::min(E2,maxEProj)));
275  log_Prob_vector->push_back(std::log(int_cross_section));
276  E1=E2;
277  E2*=fE;
278 
279  }
280  std::vector< std::vector<G4double>* > res_mat;
281  res_mat.clear();
282  if (int_cross_section >0.) {
283  res_mat.push_back(log_ESec_vector);
284  res_mat.push_back(log_Prob_vector);
285  }
286 
287  return res_mat;
288 }
virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy)
G4double DiffCrossSectionFunction1(G4double kinEnergyProj)
double A(double temperature)
virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy)
Float_t Z
G4double Simpson(T &typeT, F f, G4double a, G4double b, G4int n)
double G4double
Definition: G4Types.hh:76
G4double kinEnergyProdForIntegration
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeAdjointCrossSectionVectorPerVolumeForScatProj()

std::vector< std::vector< G4double > *> G4VEmAdjointModel::ComputeAdjointCrossSectionVectorPerVolumeForScatProj ( G4Material aMaterial,
G4double  kinEnergyProd,
G4int  nbin_pro_decade = 10 
)

Definition at line 402 of file G4VEmAdjointModel.cc.

407  SelectedMaterial= aMaterial;
408  kinEnergyScatProjForIntegration = kinEnergyScatProj;
409 
410  //compute the vector of integrated cross sections
411  //-------------------
412 
413  G4double minEProj= GetSecondAdjEnergyMinForScatProjToProjCase(kinEnergyScatProj);
414  G4double maxEProj= GetSecondAdjEnergyMaxForScatProjToProjCase(kinEnergyScatProj);
415 
416 
417  G4double dEmax=maxEProj-kinEnergyScatProj;
418  G4double dEmin=GetLowEnergyLimit();
419  G4double dE1=dEmin;
420  G4double dE2=dEmin;
421 
422 
423  std::vector< double>* log_ESec_vector = new std::vector< double>();
424  std::vector< double>* log_Prob_vector = new std::vector< double>();
425  log_ESec_vector->push_back(std::log(dEmin));
426  log_Prob_vector->push_back(-50.);
427  G4int nbins=std::max( int(std::log10(dEmax/dEmin))*nbin_pro_decade,5);
428  G4double fE=std::pow(dEmax/dEmin,1./nbins);
429 
430  G4double int_cross_section=0.;
431 
432  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
433  while (dE1 <dEmax*0.9999999999999){
434  dE2=dE1*fE;
435  int_cross_section +=integral.Simpson(this,
436  &G4VEmAdjointModel::DiffCrossSectionFunction2,minEProj+dE1,std::min(minEProj+dE2,maxEProj), 5);
437  log_ESec_vector->push_back(std::log(std::min(dE2,maxEProj-minEProj)));
438  log_Prob_vector->push_back(std::log(int_cross_section));
439  dE1=dE2;
440 
441  }
442 
443 
444 
445 
446 
447  std::vector< std::vector<G4double> *> res_mat;
448  res_mat.clear();
449  if (int_cross_section >0.) {
450  res_mat.push_back(log_ESec_vector);
451  res_mat.push_back(log_Prob_vector);
452  }
453 
454  return res_mat;
455 }
G4double kinEnergyScatProjForIntegration
G4Material * SelectedMaterial
int G4int
Definition: G4Types.hh:78
virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase(G4double PrimAdjEnergy)
G4double GetLowEnergyLimit()
G4double DiffCrossSectionFunction2(G4double kinEnergyProj)
virtual G4double GetSecondAdjEnergyMinForScatProjToProjCase(G4double PrimAdjEnergy, G4double Tcut=0)
G4double Simpson(T &typeT, F f, G4double a, G4double b, G4int n)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeAdjointCrossSectionVectorPerVolumeForSecond()

std::vector< std::vector< G4double > *> G4VEmAdjointModel::ComputeAdjointCrossSectionVectorPerVolumeForSecond ( G4Material aMaterial,
G4double  kinEnergyProd,
G4int  nbin_pro_decade = 10 
)

Definition at line 350 of file G4VEmAdjointModel.cc.

355  SelectedMaterial= aMaterial;
356  kinEnergyProdForIntegration = kinEnergyProd;
357  //compute the vector of integrated cross sections
358  //-------------------
359 
360  G4double minEProj= GetSecondAdjEnergyMinForProdToProjCase(kinEnergyProd);
361  G4double maxEProj= GetSecondAdjEnergyMaxForProdToProjCase(kinEnergyProd);
362  G4double E1=minEProj;
363  std::vector< double>* log_ESec_vector = new std::vector< double>();
364  std::vector< double>* log_Prob_vector = new std::vector< double>();
365  log_ESec_vector->clear();
366  log_Prob_vector->clear();
367  log_ESec_vector->push_back(std::log(E1));
368  log_Prob_vector->push_back(-50.);
369 
370  G4double E2=std::pow(10.,double( int(std::log10(minEProj)*nbin_pro_decade)+1)/nbin_pro_decade);
371  G4double fE=std::pow(10.,1./nbin_pro_decade);
372  G4double int_cross_section=0.;
373 
374  if (std::pow(fE,5.)>(maxEProj/minEProj)) fE = std::pow(maxEProj/minEProj,0.2);
375 
376  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
377  while (E1 <maxEProj*0.9999999){
378 
379  int_cross_section +=integral.Simpson(this,
380  &G4VEmAdjointModel::DiffCrossSectionFunction1,E1,std::min(E2,maxEProj*0.99999999), 5);
381  log_ESec_vector->push_back(std::log(std::min(E2,maxEProj)));
382  log_Prob_vector->push_back(std::log(int_cross_section));
383  E1=E2;
384  E2*=fE;
385 
386  }
387  std::vector< std::vector<G4double>* > res_mat;
388  res_mat.clear();
389 
390  if (int_cross_section >0.) {
391  res_mat.push_back(log_ESec_vector);
392  res_mat.push_back(log_Prob_vector);
393  }
394 
395 
396 
397  return res_mat;
398 }
virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy)
G4Material * SelectedMaterial
G4double DiffCrossSectionFunction1(G4double kinEnergyProj)
virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy)
G4double Simpson(T &typeT, F f, G4double a, G4double b, G4int n)
double G4double
Definition: G4Types.hh:76
G4double kinEnergyProdForIntegration
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CorrectPostStepWeight()

void G4VEmAdjointModel::CorrectPostStepWeight ( G4ParticleChange *  fParticleChange,
G4double  old_weight,
G4double  adjointPrimKinEnergy,
G4double  projectileKinEnergy,
G4bool  IsScatProjToProjCase 
)
protectedvirtual

Reimplemented in G4AdjointIonIonisationModel, and G4AdjointPhotoElectricModel.

Definition at line 633 of file G4VEmAdjointModel.cc.

638 {
639  G4double new_weight=old_weight;
640  G4double w_corr =1./CS_biasing_factor;
642 
643 
645  if ( !IsScatProjToProjCase) lastCS=lastAdjointCSForProdToProjCase;
646  if ((adjointPrimKinEnergy-preStepEnergy)/preStepEnergy>0.001){ //Is that in all cases needed???
647  G4double post_stepCS=AdjointCrossSection(currentCouple, adjointPrimKinEnergy
648  ,IsScatProjToProjCase );
649  if (post_stepCS>0 && lastCS>0) w_corr*=post_stepCS/lastCS;
650  }
651 
652  new_weight*=w_corr;
653 
654  //G4cout<<"Post step "<<new_weight<<'\t'<<w_corr<<'\t'<<old_weight<<G4endl;
655  new_weight*=projectileKinEnergy/adjointPrimKinEnergy;//This is needed due to the biasing of diff CS
656  //by the factor adjointPrimKinEnergy/projectileKinEnergy
657 
658 
659 
660  fParticleChange->SetParentWeightByProcess(false);
661  fParticleChange->SetSecondaryWeightByProcess(false);
662  fParticleChange->ProposeParentWeight(new_weight);
663 }
G4double lastAdjointCSForScatProjToProjCase
G4double GetPostStepWeightCorrection()
G4MaterialCutsCouple * currentCouple
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
G4double lastAdjointCSForProdToProjCase
double G4double
Definition: G4Types.hh:76
static G4AdjointCSManager * GetAdjointCSManager()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DefineCurrentMaterial()

void G4VEmAdjointModel::DefineCurrentMaterial ( const G4MaterialCutsCouple couple)

Definition at line 692 of file G4VEmAdjointModel.cc.

693 { if(couple != currentCouple) {
694  currentCouple = const_cast<G4MaterialCutsCouple*> (couple);
695  currentMaterial = const_cast<G4Material*> (couple->GetMaterial());
696  currentCoupleIndex = couple->GetIndex();
698  size_t idx=56;
699  currentTcutForDirectSecond =0.00000000001;
704  if (idx <56){
705  const std::vector<G4double>* aVec = G4ProductionCutsTable::GetProductionCutsTable()->GetEnergyCutsVector(idx);
707  }
708  }
709 
710 
711  }
712 }
static G4AdjointGamma * AdjointGamma()
const G4Material * GetMaterial() const
static G4AdjointElectron * AdjointElectron()
size_t GetIndex() const
Definition: G4Material.hh:262
const std::vector< G4double > * GetEnergyCutsVector(size_t pcIdx) const
G4Material * currentMaterial
G4MaterialCutsCouple * currentCouple
static G4ProductionCutsTable * GetProductionCutsTable()
G4ParticleDefinition * theAdjEquivOfDirectSecondPartDef
G4double currentTcutForDirectSecond
static G4AdjointPositron * AdjointPositron()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DefineDirectEMModel()

void G4VEmAdjointModel::DefineDirectEMModel ( G4VEmModel aModel)
inline

Definition at line 193 of file G4VEmAdjointModel.hh.

193 {theDirectEMModel = aModel;}
G4VEmModel * theDirectEMModel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DiffCrossSectionFunction1()

G4double G4VEmAdjointModel::DiffCrossSectionFunction1 ( G4double  kinEnergyProj)
protected

Definition at line 201 of file G4VEmAdjointModel.cc.

201  {
202 
203 
204  G4double bias_factor = CS_biasing_factor*kinEnergyProdForIntegration/kinEnergyProj;
205 
206 
207  if (UseMatrixPerElement ) {
209  }
210  else {
212  }
213 }
virtual G4double DiffCrossSectionPerVolumePrimToSecond(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
virtual G4double DiffCrossSectionPerAtomPrimToSecond(G4double kinEnergyProj, G4double kinEnergyProd, G4double Z, G4double A=0.)
G4Material * SelectedMaterial
double G4double
Definition: G4Types.hh:76
G4double kinEnergyProdForIntegration
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DiffCrossSectionFunction2()

G4double G4VEmAdjointModel::DiffCrossSectionFunction2 ( G4double  kinEnergyProj)
protected

Definition at line 217 of file G4VEmAdjointModel.cc.

217  {
218 
219  G4double bias_factor = CS_biasing_factor*kinEnergyScatProjForIntegration/kinEnergyProj;
220  if (UseMatrixPerElement ) {
222  }
223  else {
225 
226  }
227 
228 }
G4double kinEnergyScatProjForIntegration
virtual G4double DiffCrossSectionPerVolumePrimToScatPrim(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyScatProj)
G4Material * SelectedMaterial
virtual G4double DiffCrossSectionPerAtomPrimToScatPrim(G4double kinEnergyProj, G4double kinEnergyScatProj, G4double Z, G4double A=0.)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DiffCrossSectionPerAtomPrimToScatPrim()

G4double G4VEmAdjointModel::DiffCrossSectionPerAtomPrimToScatPrim ( G4double  kinEnergyProj,
G4double  kinEnergyScatProj,
G4double  Z,
G4double  A = 0. 
)
virtual

Reimplemented in G4AdjointComptonModel.

Definition at line 144 of file G4VEmAdjointModel.cc.

149 { G4double kinEnergyProd = kinEnergyProj - kinEnergyScatProj;
150  G4double dSigmadEprod;
151  if (kinEnergyProd <=0) dSigmadEprod=0;
152  else dSigmadEprod=DiffCrossSectionPerAtomPrimToSecond(kinEnergyProj,kinEnergyProd,Z,A);
153  return dSigmadEprod;
154 
155 }
virtual G4double DiffCrossSectionPerAtomPrimToSecond(G4double kinEnergyProj, G4double kinEnergyProd, G4double Z, G4double A=0.)
double A(double temperature)
Float_t Z
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DiffCrossSectionPerAtomPrimToSecond()

G4double G4VEmAdjointModel::DiffCrossSectionPerAtomPrimToSecond ( G4double  kinEnergyProj,
G4double  kinEnergyProd,
G4double  Z,
G4double  A = 0. 
)
virtual

Reimplemented in G4AdjointhIonisationModel, G4AdjointIonIonisationModel, G4AdjointComptonModel, and G4AdjointeIonisationModel.

Definition at line 112 of file G4VEmAdjointModel.cc.

117 {
118  G4double dSigmadEprod=0;
119  G4double Emax_proj = GetSecondAdjEnergyMaxForProdToProjCase(kinEnergyProd);
120  G4double Emin_proj = GetSecondAdjEnergyMinForProdToProjCase(kinEnergyProd);
121 
122 
123  if (kinEnergyProj>Emin_proj && kinEnergyProj<=Emax_proj){ //the produced particle should have a kinetic energy smaller than the projectile
124 
125  /*G4double Tmax=kinEnergyProj;
126  if (second_part_of_same_type) Tmax = kinEnergyProj/2.;*/
127 
128  G4double E1=kinEnergyProd;
129  G4double E2=kinEnergyProd*1.000001;
130  G4double dE=(E2-E1);
133 
134  dSigmadEprod=(sigma1-sigma2)/dE;
135  }
136  return dSigmadEprod;
137 
138 
139 
140 }
virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy)
G4ParticleDefinition * theDirectPrimaryPartDef
static const G4double dE
G4VEmModel * theDirectEMModel
double A(double temperature)
virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy)
Float_t Z
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:313
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DiffCrossSectionPerVolumeFunctionForIntegrationOverEkinProj()

G4double G4VEmAdjointModel::DiffCrossSectionPerVolumeFunctionForIntegrationOverEkinProj ( G4double  EkinProd)
protected

Definition at line 232 of file G4VEmAdjointModel.cc.

233 {
235 }
virtual G4double DiffCrossSectionPerVolumePrimToSecond(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
G4Material * SelectedMaterial
G4double kinEnergyProjForIntegration
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DiffCrossSectionPerVolumePrimToScatPrim()

G4double G4VEmAdjointModel::DiffCrossSectionPerVolumePrimToScatPrim ( const G4Material aMaterial,
G4double  kinEnergyProj,
G4double  kinEnergyScatProj 
)
virtual

Definition at line 188 of file G4VEmAdjointModel.cc.

192 { G4double kinEnergyProd = kinEnergyProj - kinEnergyScatProj;
193  G4double dSigmadEprod;
194  if (kinEnergyProd <=0) dSigmadEprod=0;
195  else dSigmadEprod=DiffCrossSectionPerVolumePrimToSecond(aMaterial,kinEnergyProj,kinEnergyProd);
196  return dSigmadEprod;
197 
198 }
virtual G4double DiffCrossSectionPerVolumePrimToSecond(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DiffCrossSectionPerVolumePrimToSecond()

G4double G4VEmAdjointModel::DiffCrossSectionPerVolumePrimToSecond ( const G4Material aMaterial,
G4double  kinEnergyProj,
G4double  kinEnergyProd 
)
virtual

Reimplemented in G4AdjointBremsstrahlungModel.

Definition at line 160 of file G4VEmAdjointModel.cc.

164 {
165  G4double dSigmadEprod=0;
166  G4double Emax_proj = GetSecondAdjEnergyMaxForProdToProjCase(kinEnergyProd);
167  G4double Emin_proj = GetSecondAdjEnergyMinForProdToProjCase(kinEnergyProd);
168 
169 
170  if (kinEnergyProj>Emin_proj && kinEnergyProj<=Emax_proj){
171  /*G4double Tmax=kinEnergyProj;
172  if (second_part_of_same_type) Tmax = kinEnergyProj/2.;*/
173  G4double E1=kinEnergyProd;
174  G4double E2=kinEnergyProd*1.0001;
175  G4double dE=(E2-E1);
176  G4double sigma1=theDirectEMModel->CrossSectionPerVolume(aMaterial,theDirectPrimaryPartDef,kinEnergyProj,E1,1.e20);
177  G4double sigma2=theDirectEMModel->CrossSectionPerVolume(aMaterial,theDirectPrimaryPartDef,kinEnergyProj,E2,1.e20);
178  dSigmadEprod=(sigma1-sigma2)/dE;
179  }
180  return dSigmadEprod;
181 
182 
183 
184 }
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:258
virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy)
G4ParticleDefinition * theDirectPrimaryPartDef
static const G4double dE
G4VEmModel * theDirectEMModel
virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAdjointCrossSection()

G4double G4VEmAdjointModel::GetAdjointCrossSection ( const G4MaterialCutsCouple aCouple,
G4double  primEnergy,
G4bool  IsScatProjToProjCase 
)
virtual

Reimplemented in G4AdjointBremsstrahlungModel, G4AdjointComptonModel, and G4AdjointPhotoElectricModel.

Definition at line 83 of file G4VEmAdjointModel.cc.

86 {
87  return AdjointCrossSection(aCouple, primEnergy,
88  IsScatProjToProjCase);
89 
90  /*
91  //To continue
92  DefineCurrentMaterial(aCouple);
93  preStepEnergy=primEnergy;
94  if (IsScatProjToProjCase){
95  G4double ekin=primEnergy*mass_ratio_projectile;
96  lastCS = G4AdjointCSManager::GetAdjointCSManager()->GetAdjointSigma(ekin, model_index,true, aCouple);
97  lastAdjointCSForScatProjToProjCase = lastCS;
98  //G4cout<<ekin<<std::endl;
99  }
100  else {
101  G4double ekin=primEnergy*mass_ratio_product;
102  lastCS = G4AdjointCSManager::GetAdjointCSManager()->GetAdjointSigma(ekin, model_index,false, aCouple);
103  lastAdjointCSForProdToProjCase = lastCS;
104  //G4cout<<ekin<<std::endl;
105  }
106  return lastCS;
107  */
108 }
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAdjointEquivalentOfDirectPrimaryParticleDefinition()

G4ParticleDefinition* G4VEmAdjointModel::GetAdjointEquivalentOfDirectPrimaryParticleDefinition ( )
inline

Definition at line 181 of file G4VEmAdjointModel.hh.

G4ParticleDefinition * theAdjEquivOfDirectPrimPartDef

◆ GetAdjointEquivalentOfDirectSecondaryParticleDefinition()

G4ParticleDefinition* G4VEmAdjointModel::GetAdjointEquivalentOfDirectSecondaryParticleDefinition ( )
inline

Definition at line 183 of file G4VEmAdjointModel.hh.

G4ParticleDefinition * theAdjEquivOfDirectSecondPartDef

◆ GetApplyCutInRange()

G4bool G4VEmAdjointModel::GetApplyCutInRange ( )
inline

Definition at line 214 of file G4VEmAdjointModel.hh.

214 { return ApplyCutInRange;}
Here is the caller graph for this function:

◆ GetHighEnergyLimit()

G4double G4VEmAdjointModel::GetHighEnergyLimit ( )
inline

Definition at line 185 of file G4VEmAdjointModel.hh.

185 {return HighEnergyLimit;}
Here is the caller graph for this function:

◆ GetLowEnergyLimit()

G4double G4VEmAdjointModel::GetLowEnergyLimit ( )
inline

Definition at line 187 of file G4VEmAdjointModel.hh.

187 {return LowEnergyLimit;}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetName()

G4String G4VEmAdjointModel::GetName ( void  )
inline

Definition at line 216 of file G4VEmAdjointModel.hh.

216 { return name;}
Here is the caller graph for this function:

◆ GetSecondAdjEnergyMaxForProdToProjCase()

G4double G4VEmAdjointModel::GetSecondAdjEnergyMaxForProdToProjCase ( G4double  PrimAdjEnergy)
virtual

Reimplemented in G4AdjointIonIonisationModel, and G4AdjointhIonisationModel.

Definition at line 680 of file G4VEmAdjointModel.cc.

681 { return HighEnergyLimit;
682 }
Here is the caller graph for this function:

◆ GetSecondAdjEnergyMaxForScatProjToProjCase()

G4double G4VEmAdjointModel::GetSecondAdjEnergyMaxForScatProjToProjCase ( G4double  PrimAdjEnergy)
virtual

Reimplemented in G4AdjointIonIonisationModel, G4AdjointhIonisationModel, and G4AdjointComptonModel.

Definition at line 666 of file G4VEmAdjointModel.cc.

667 { G4double maxEProj= HighEnergyLimit;
668  if (second_part_of_same_type) maxEProj=std::min(kinEnergyScatProj*2.,HighEnergyLimit);
669  return maxEProj;
670 }
double G4double
Definition: G4Types.hh:76
Here is the caller graph for this function:

◆ GetSecondAdjEnergyMinForProdToProjCase()

G4double G4VEmAdjointModel::GetSecondAdjEnergyMinForProdToProjCase ( G4double  PrimAdjEnergy)
virtual

Reimplemented in G4AdjointIonIonisationModel, G4AdjointhIonisationModel, and G4AdjointComptonModel.

Definition at line 685 of file G4VEmAdjointModel.cc.

686 { G4double minEProj=PrimAdjEnergy;
687  if (second_part_of_same_type) minEProj=PrimAdjEnergy*2.;
688  return minEProj;
689 }
double G4double
Definition: G4Types.hh:76
Here is the caller graph for this function:

◆ GetSecondAdjEnergyMinForScatProjToProjCase()

G4double G4VEmAdjointModel::GetSecondAdjEnergyMinForScatProjToProjCase ( G4double  PrimAdjEnergy,
G4double  Tcut = 0 
)
virtual

Reimplemented in G4AdjointIonIonisationModel, and G4AdjointhIonisationModel.

Definition at line 673 of file G4VEmAdjointModel.cc.

674 { G4double Emin=PrimAdjEnergy;
675  if (ApplyCutInRange) Emin=PrimAdjEnergy+Tcut;
676  return Emin;
677 }
static const G4double Emin
double G4double
Definition: G4Types.hh:76
Here is the caller graph for this function:

◆ GetSecondPartOfSameType()

G4bool G4VEmAdjointModel::GetSecondPartOfSameType ( )
inline

Definition at line 203 of file G4VEmAdjointModel.hh.

Here is the caller graph for this function:

◆ GetUseMatrix()

G4bool G4VEmAdjointModel::GetUseMatrix ( )
inline

Definition at line 211 of file G4VEmAdjointModel.hh.

211 {return UseMatrix;}
Here is the caller graph for this function:

◆ GetUseMatrixPerElement()

G4bool G4VEmAdjointModel::GetUseMatrixPerElement ( )
inline

Definition at line 212 of file G4VEmAdjointModel.hh.

212 { return UseMatrixPerElement;}
Here is the caller graph for this function:

◆ GetUseOnlyOneMatrixForAllElements()

G4bool G4VEmAdjointModel::GetUseOnlyOneMatrixForAllElements ( )
inline

Definition at line 213 of file G4VEmAdjointModel.hh.

Here is the caller graph for this function:

◆ SampleAdjSecEnergyFromCSMatrix() [1/2]

G4double G4VEmAdjointModel::SampleAdjSecEnergyFromCSMatrix ( size_t  MatrixIndex,
G4double  prim_energy,
G4bool  IsScatProjToProjCase 
)
protected

Definition at line 458 of file G4VEmAdjointModel.cc.

459 {
460 
461 
462  G4AdjointCSMatrix* theMatrix= (*pOnCSMatrixForProdToProjBackwardScattering)[MatrixIndex];
463  if (IsScatProjToProjCase) theMatrix= (*pOnCSMatrixForScatProjToProjBackwardScattering)[MatrixIndex];
464  std::vector< double>* theLogPrimEnergyVector = theMatrix->GetLogPrimEnergyVector();
465 
466  if (theLogPrimEnergyVector->size() ==0){
467  G4cout<<"No data are contained in the given AdjointCSMatrix!"<<G4endl;
468  G4cout<<"The sampling procedure will be stopped."<<G4endl;
469  return 0.;
470 
471  }
472 
474  G4double aLogPrimEnergy = std::log(aPrimEnergy);
475  size_t ind =theInterpolator->FindPositionForLogVector(aLogPrimEnergy,*theLogPrimEnergyVector);
476 
477 
478  G4double aLogPrimEnergy1,aLogPrimEnergy2;
479  G4double aLogCS1,aLogCS2;
480  G4double log01,log02;
481  std::vector< double>* aLogSecondEnergyVector1 =0;
482  std::vector< double>* aLogSecondEnergyVector2 =0;
483  std::vector< double>* aLogProbVector1=0;
484  std::vector< double>* aLogProbVector2=0;
485  std::vector< size_t>* aLogProbVectorIndex1=0;
486  std::vector< size_t>* aLogProbVectorIndex2=0;
487 
488  theMatrix->GetData(ind, aLogPrimEnergy1,aLogCS1,log01, aLogSecondEnergyVector1,aLogProbVector1,aLogProbVectorIndex1);
489  theMatrix->GetData(ind+1, aLogPrimEnergy2,aLogCS2,log02, aLogSecondEnergyVector2,aLogProbVector2,aLogProbVectorIndex2);
490 
491  G4double rand_var = G4UniformRand();
492  G4double log_rand_var= std::log(rand_var);
493  G4double log_Tcut =std::log(currentTcutForDirectSecond);
494  G4double Esec=0;
495  G4double log_dE1,log_dE2;
496  G4double log_rand_var1,log_rand_var2;
497  G4double log_E1,log_E2;
498  log_rand_var1=log_rand_var;
499  log_rand_var2=log_rand_var;
500 
501  G4double Emin=0.;
502  G4double Emax=0.;
503  if (theMatrix->IsScatProjToProjCase()){ //case where Tcut plays a role
506  G4double dE=0;
507  if (Emin < Emax ){
508  if (ApplyCutInRange) {
509  if (second_part_of_same_type && currentTcutForDirectSecond>aPrimEnergy) return aPrimEnergy;
510 
511  log_rand_var1=log_rand_var+theInterpolator->InterpolateForLogVector(log_Tcut,*aLogSecondEnergyVector1,*aLogProbVector1);
512  log_rand_var2=log_rand_var+theInterpolator->InterpolateForLogVector(log_Tcut,*aLogSecondEnergyVector2,*aLogProbVector2);
513 
514  }
515  log_dE1 = theInterpolator->Interpolate(log_rand_var1,*aLogProbVector1,*aLogSecondEnergyVector1,"Lin");
516  log_dE2 = theInterpolator->Interpolate(log_rand_var2,*aLogProbVector2,*aLogSecondEnergyVector2,"Lin");
517  dE=std::exp(theInterpolator->LinearInterpolation(aLogPrimEnergy,aLogPrimEnergy1,aLogPrimEnergy2,log_dE1,log_dE2));
518  }
519 
520  Esec = aPrimEnergy +dE;
521  Esec=std::max(Esec,Emin);
522  Esec=std::min(Esec,Emax);
523 
524  }
525  else { //Tcut condition is already full-filled
526 
527  log_E1 = theInterpolator->Interpolate(log_rand_var,*aLogProbVector1,*aLogSecondEnergyVector1,"Lin");
528  log_E2 = theInterpolator->Interpolate(log_rand_var,*aLogProbVector2,*aLogSecondEnergyVector2,"Lin");
529 
530  Esec = std::exp(theInterpolator->LinearInterpolation(aLogPrimEnergy,aLogPrimEnergy1,aLogPrimEnergy2,log_E1,log_E2));
531  Emin=GetSecondAdjEnergyMinForProdToProjCase(aPrimEnergy);
532  Emax=GetSecondAdjEnergyMaxForProdToProjCase(aPrimEnergy);
533  Esec=std::max(Esec,Emin);
534  Esec=std::min(Esec,Emax);
535 
536  }
537 
538  return Esec;
539 
540 
541 
542 
543 
544 }
virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy)
G4bool GetData(unsigned int i, G4double &aPrimEnergy, G4double &aCS, G4double &log0, std::vector< double > *&aLogSecondEnergyVector, std::vector< double > *&aLogProbVector, std::vector< size_t > *&aLogProbVectorIndex)
virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase(G4double PrimAdjEnergy)
G4double InterpolateForLogVector(G4double &x, std::vector< G4double > &x_vec, std::vector< G4double > &y_vec)
G4double Interpolate(G4double &x, std::vector< G4double > &x_vec, std::vector< G4double > &y_vec, G4String InterPolMethod="Log")
static const G4double dE
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy)
std::vector< double > * GetLogPrimEnergyVector()
size_t FindPositionForLogVector(G4double &x, std::vector< G4double > &x_vec)
virtual G4double GetSecondAdjEnergyMinForScatProjToProjCase(G4double PrimAdjEnergy, G4double Tcut=0)
G4double LinearInterpolation(G4double &x, G4double &x1, G4double &x2, G4double &y1, G4double &y2)
static const G4double Emin
static G4AdjointInterpolator * GetInstance()
static const G4double Emax
#define G4endl
Definition: G4ios.hh:61
G4double currentTcutForDirectSecond
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SampleAdjSecEnergyFromCSMatrix() [2/2]

G4double G4VEmAdjointModel::SampleAdjSecEnergyFromCSMatrix ( G4double  prim_energy,
G4bool  IsScatProjToProjCase 
)
protected

Definition at line 548 of file G4VEmAdjointModel.cc.

549 { SelectCSMatrix(IsScatProjToProjCase);
550  return SampleAdjSecEnergyFromCSMatrix(indexOfUsedCrossSectionMatrix, aPrimEnergy, IsScatProjToProjCase);
551 }
G4double SampleAdjSecEnergyFromCSMatrix(size_t MatrixIndex, G4double prim_energy, G4bool IsScatProjToProjCase)
size_t indexOfUsedCrossSectionMatrix
void SelectCSMatrix(G4bool IsScatProjToProjCase)
Here is the call graph for this function:

◆ SampleAdjSecEnergyFromDiffCrossSectionPerAtom()

G4double G4VEmAdjointModel::SampleAdjSecEnergyFromDiffCrossSectionPerAtom ( G4double  prim_energy,
G4bool  IsScatProjToProjCase 
)
protectedvirtual

Definition at line 580 of file G4VEmAdjointModel.cc.

581 {
582  // here we try to use the rejection method
583  //-----------------------------------------
584 
585  const G4int iimax = 1000;
586  G4double E=0;
587  G4double x,xmin,greject,q;
588  if ( IsScatProjToProjCase){
591  xmin=Emin/Emax;
592  G4double grejmax = DiffCrossSectionPerAtomPrimToScatPrim(Emin,prim_energy,1)*prim_energy;
593 
594  G4int ii =0;
595  do {
596  q = G4UniformRand();
597  x = 1./(q*(1./xmin -1.) +1.);
598  E=x*Emax;
599  greject = DiffCrossSectionPerAtomPrimToScatPrim( E,prim_energy ,1)*prim_energy;
600  ++ii;
601  if(ii >= iimax) { break; }
602  }
603  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
604  while( greject < G4UniformRand()*grejmax );
605 
606  }
607  else {
610  xmin=Emin/Emax;
611  G4double grejmax = DiffCrossSectionPerAtomPrimToSecond(Emin,prim_energy,1);
612  G4int ii =0;
613  do {
614  q = G4UniformRand();
615  x = std::pow(xmin, q);
616  E=x*Emax;
617  greject = DiffCrossSectionPerAtomPrimToSecond( E,prim_energy ,1);
618  ++ii;
619  if(ii >= iimax) { break; }
620  }
621  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
622  while( greject < G4UniformRand()*grejmax );
623 
624 
625 
626  }
627 
628  return E;
629 }
virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy)
virtual G4double DiffCrossSectionPerAtomPrimToSecond(G4double kinEnergyProj, G4double kinEnergyProd, G4double Z, G4double A=0.)
int G4int
Definition: G4Types.hh:78
virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase(G4double PrimAdjEnergy)
#define G4UniformRand()
Definition: Randomize.hh:97
virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy)
virtual G4double DiffCrossSectionPerAtomPrimToScatPrim(G4double kinEnergyProj, G4double kinEnergyScatProj, G4double Z, G4double A=0.)
static const G4double Emin
static const G4double Emax
G4double currentTcutForDirectSecond
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SampleSecondaries()

virtual void G4VEmAdjointModel::SampleSecondaries ( const G4Track &  aTrack,
G4bool  IsScatProjToProjCase,
G4ParticleChange *  fParticleChange 
)
pure virtual

Implemented in G4AdjointhIonisationModel, G4AdjointIonIonisationModel, G4AdjointPhotoElectricModel, G4AdjointBremsstrahlungModel, G4AdjointeIonisationModel, and G4AdjointComptonModel.

Here is the caller graph for this function:

◆ SelectCSMatrix()

void G4VEmAdjointModel::SelectCSMatrix ( G4bool  IsScatProjToProjCase)
protected

Definition at line 554 of file G4VEmAdjointModel.cc.

555 {
558  else if (!UseOnlyOneMatrixForAllElements) { //Select Material
559  std::vector<G4double>* CS_Vs_Element = &CS_Vs_ElementForScatProjToProjCase;
561  if ( !IsScatProjToProjCase) {
562  CS_Vs_Element = &CS_Vs_ElementForProdToProjCase;
564  }
565  G4double rand_var= G4UniformRand();
566  G4double SumCS=0.;
567  size_t ind=0;
568  for (size_t i=0;i<CS_Vs_Element->size();i++){
569  SumCS+=(*CS_Vs_Element)[i];
570  if (rand_var<=SumCS/lastCS){
571  ind=i;
572  break;
573  }
574  }
576  }
577 }
G4double lastAdjointCSForScatProjToProjCase
size_t GetIndex() const
Definition: G4Element.hh:181
G4Material * currentMaterial
size_t indexOfUsedCrossSectionMatrix
#define G4UniformRand()
Definition: Randomize.hh:97
std::vector< G4double > CS_Vs_ElementForProdToProjCase
std::vector< G4double > CS_Vs_ElementForScatProjToProjCase
const G4Element * GetElement(G4int iel) const
Definition: G4Material.hh:202
G4bool UseOnlyOneMatrixForAllElements
G4double lastAdjointCSForProdToProjCase
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetAdjointEquivalentOfDirectPrimaryParticleDefinition()

void G4VEmAdjointModel::SetAdjointEquivalentOfDirectPrimaryParticleDefinition ( G4ParticleDefinition aPart)

Definition at line 728 of file G4VEmAdjointModel.cc.

729 {
733  if (theAdjEquivOfDirectPrimPartDef->GetParticleName() =="adj_gamma")
735 }
G4ParticleDefinition * theDirectPrimaryPartDef
G4ParticleDefinition * theAdjEquivOfDirectPrimPartDef
const G4String & GetParticleName() const
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
static G4Electron * Electron()
Definition: G4Electron.cc:94
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetAdjointEquivalentOfDirectSecondaryParticleDefinition()

void G4VEmAdjointModel::SetAdjointEquivalentOfDirectSecondaryParticleDefinition ( G4ParticleDefinition aPart)
inline

Definition at line 197 of file G4VEmAdjointModel.hh.

197  {
199  }
G4ParticleDefinition * theAdjEquivOfDirectSecondPartDef

◆ SetApplyCutInRange()

void G4VEmAdjointModel::SetApplyCutInRange ( G4bool  aBool)
inline

Definition at line 210 of file G4VEmAdjointModel.hh.

210 { ApplyCutInRange = aBool;}
Here is the caller graph for this function:

◆ SetCSBiasingFactor()

virtual void G4VEmAdjointModel::SetCSBiasingFactor ( G4double  aVal)
inlinevirtual

Definition at line 217 of file G4VEmAdjointModel.hh.

217 {CS_biasing_factor = aVal;}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCSMatrices()

void G4VEmAdjointModel::SetCSMatrices ( std::vector< G4AdjointCSMatrix * > *  Vec1CSMatrix,
std::vector< G4AdjointCSMatrix * > *  Vec2CSMatrix 
)
inline

Definition at line 174 of file G4VEmAdjointModel.hh.

174  {
177 
178 
179  };
std::vector< G4AdjointCSMatrix *> * pOnCSMatrixForProdToProjBackwardScattering
std::vector< G4AdjointCSMatrix *> * pOnCSMatrixForScatProjToProjBackwardScattering
Here is the caller graph for this function:

◆ SetHighEnergyLimit()

void G4VEmAdjointModel::SetHighEnergyLimit ( G4double  aVal)

Definition at line 715 of file G4VEmAdjointModel.cc.

716 { HighEnergyLimit=aVal;
718 }
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:725
G4VEmModel * theDirectEMModel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetLowEnergyLimit()

void G4VEmAdjointModel::SetLowEnergyLimit ( G4double  aVal)

Definition at line 721 of file G4VEmAdjointModel.cc.

722 {
723  LowEnergyLimit=aVal;
725 }
G4VEmModel * theDirectEMModel
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:732
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetSecondPartOfSameType()

void G4VEmAdjointModel::SetSecondPartOfSameType ( G4bool  aBool)
inline

Definition at line 201 of file G4VEmAdjointModel.hh.

Here is the caller graph for this function:

◆ SetUseMatrix()

void G4VEmAdjointModel::SetUseMatrix ( G4bool  aBool)
inline

Definition at line 205 of file G4VEmAdjointModel.hh.

205 { UseMatrix = aBool;}
Here is the caller graph for this function:

◆ SetUseMatrixPerElement()

void G4VEmAdjointModel::SetUseMatrixPerElement ( G4bool  aBool)
inline

Definition at line 207 of file G4VEmAdjointModel.hh.

207 { UseMatrixPerElement = aBool;}
Here is the caller graph for this function:

◆ SetUseOnlyOneMatrixForAllElements()

void G4VEmAdjointModel::SetUseOnlyOneMatrixForAllElements ( G4bool  aBool)
inline

Definition at line 208 of file G4VEmAdjointModel.hh.

Here is the caller graph for this function:

Member Data Documentation

◆ ApplyCutInRange

G4bool G4VEmAdjointModel::ApplyCutInRange
protected

Definition at line 314 of file G4VEmAdjointModel.hh.

◆ ASelectedNucleus

G4int G4VEmAdjointModel::ASelectedNucleus
protected

Definition at line 269 of file G4VEmAdjointModel.hh.

◆ CS_biasing_factor

G4double G4VEmAdjointModel::CS_biasing_factor
protected

Definition at line 335 of file G4VEmAdjointModel.hh.

◆ CS_Vs_ElementForProdToProjCase

std::vector<G4double> G4VEmAdjointModel::CS_Vs_ElementForProdToProjCase
protected

Definition at line 284 of file G4VEmAdjointModel.hh.

◆ CS_Vs_ElementForScatProjToProjCase

std::vector<G4double> G4VEmAdjointModel::CS_Vs_ElementForScatProjToProjCase
protected

Definition at line 283 of file G4VEmAdjointModel.hh.

◆ currentCouple

G4MaterialCutsCouple* G4VEmAdjointModel::currentCouple
protected

Definition at line 309 of file G4VEmAdjointModel.hh.

◆ currentCoupleIndex

size_t G4VEmAdjointModel::currentCoupleIndex
protected

Definition at line 311 of file G4VEmAdjointModel.hh.

◆ currentMaterial

G4Material* G4VEmAdjointModel::currentMaterial
protected

Definition at line 308 of file G4VEmAdjointModel.hh.

◆ currentMaterialIndex

size_t G4VEmAdjointModel::currentMaterialIndex
protected

Definition at line 310 of file G4VEmAdjointModel.hh.

◆ currentTcutForDirectPrim

G4double G4VEmAdjointModel::currentTcutForDirectPrim
protected

Definition at line 312 of file G4VEmAdjointModel.hh.

◆ currentTcutForDirectSecond

G4double G4VEmAdjointModel::currentTcutForDirectSecond
protected

Definition at line 313 of file G4VEmAdjointModel.hh.

◆ HighEnergyLimit

G4double G4VEmAdjointModel::HighEnergyLimit
protected

Definition at line 328 of file G4VEmAdjointModel.hh.

◆ indexOfUsedCrossSectionMatrix

size_t G4VEmAdjointModel::indexOfUsedCrossSectionMatrix
protected

Definition at line 347 of file G4VEmAdjointModel.hh.

◆ kinEnergyProdForIntegration

G4double G4VEmAdjointModel::kinEnergyProdForIntegration
protected

Definition at line 272 of file G4VEmAdjointModel.hh.

◆ kinEnergyProjForIntegration

G4double G4VEmAdjointModel::kinEnergyProjForIntegration
protected

Definition at line 274 of file G4VEmAdjointModel.hh.

◆ kinEnergyScatProjForIntegration

G4double G4VEmAdjointModel::kinEnergyScatProjForIntegration
protected

Definition at line 273 of file G4VEmAdjointModel.hh.

◆ lastAdjointCSForProdToProjCase

G4double G4VEmAdjointModel::lastAdjointCSForProdToProjCase
protected

Definition at line 288 of file G4VEmAdjointModel.hh.

◆ lastAdjointCSForScatProjToProjCase

G4double G4VEmAdjointModel::lastAdjointCSForScatProjToProjCase
protected

Definition at line 287 of file G4VEmAdjointModel.hh.

◆ lastCS

G4double G4VEmAdjointModel::lastCS
protected

Definition at line 286 of file G4VEmAdjointModel.hh.

◆ LowEnergyLimit

G4double G4VEmAdjointModel::LowEnergyLimit
protected

Definition at line 329 of file G4VEmAdjointModel.hh.

◆ mass_ratio_product

G4double G4VEmAdjointModel::mass_ratio_product
protected

Definition at line 321 of file G4VEmAdjointModel.hh.

◆ mass_ratio_projectile

G4double G4VEmAdjointModel::mass_ratio_projectile
protected

Definition at line 322 of file G4VEmAdjointModel.hh.

◆ model_index

size_t G4VEmAdjointModel::model_index
protected

Definition at line 349 of file G4VEmAdjointModel.hh.

◆ name

const G4String G4VEmAdjointModel::name
protected

Definition at line 264 of file G4VEmAdjointModel.hh.

◆ pOnCSMatrixForProdToProjBackwardScattering

std::vector< G4AdjointCSMatrix* >* G4VEmAdjointModel::pOnCSMatrixForProdToProjBackwardScattering
protected

Definition at line 281 of file G4VEmAdjointModel.hh.

◆ pOnCSMatrixForScatProjToProjBackwardScattering

std::vector< G4AdjointCSMatrix* >* G4VEmAdjointModel::pOnCSMatrixForScatProjToProjBackwardScattering
protected

Definition at line 282 of file G4VEmAdjointModel.hh.

◆ pParticleChange

G4VParticleChange* G4VEmAdjointModel::pParticleChange
protected

Definition at line 256 of file G4VEmAdjointModel.hh.

◆ preStepEnergy

G4double G4VEmAdjointModel::preStepEnergy
protected

Definition at line 304 of file G4VEmAdjointModel.hh.

◆ second_part_of_same_type

G4bool G4VEmAdjointModel::second_part_of_same_type
protected

Definition at line 299 of file G4VEmAdjointModel.hh.

◆ SelectedMaterial

G4Material* G4VEmAdjointModel::SelectedMaterial
protected

Definition at line 271 of file G4VEmAdjointModel.hh.

◆ theAdjEquivOfDirectPrimPartDef

G4ParticleDefinition* G4VEmAdjointModel::theAdjEquivOfDirectPrimPartDef
protected

Definition at line 296 of file G4VEmAdjointModel.hh.

◆ theAdjEquivOfDirectSecondPartDef

G4ParticleDefinition* G4VEmAdjointModel::theAdjEquivOfDirectSecondPartDef
protected

Definition at line 297 of file G4VEmAdjointModel.hh.

◆ theDirectEMModel

G4VEmModel* G4VEmAdjointModel::theDirectEMModel
protected

Definition at line 255 of file G4VEmAdjointModel.hh.

◆ theDirectPrimaryPartDef

G4ParticleDefinition* G4VEmAdjointModel::theDirectPrimaryPartDef
protected

Definition at line 298 of file G4VEmAdjointModel.hh.

◆ UseMatrix

G4bool G4VEmAdjointModel::UseMatrix
protected

Definition at line 340 of file G4VEmAdjointModel.hh.

◆ UseMatrixPerElement

G4bool G4VEmAdjointModel::UseMatrixPerElement
protected

Definition at line 341 of file G4VEmAdjointModel.hh.

◆ UseOnlyOneMatrixForAllElements

G4bool G4VEmAdjointModel::UseOnlyOneMatrixForAllElements
protected

Definition at line 342 of file G4VEmAdjointModel.hh.

◆ ZSelectedNucleus

G4int G4VEmAdjointModel::ZSelectedNucleus
protected

Definition at line 270 of file G4VEmAdjointModel.hh.


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