62{
if(theInstance == 0) {
71G4AdjointCSManager::G4AdjointCSManager()
72{ CrossSectionMatrixesAreBuilt=
false;
73 TotalSigmaTableAreBuilt=
false;
74 theTotalForwardSigmaTableVector.clear();
75 theTotalAdjointSigmaTableVector.clear();
76 listOfForwardEmProcess.clear();
77 listOfForwardEnergyLossProcess.clear();
78 theListOfAdjointParticlesInAction.clear();
79 EminForFwdSigmaTables.clear();
80 EminForAdjSigmaTables.clear();
81 EkinofFwdSigmaMax.clear();
82 EkinofAdjSigmaMax.clear();
83 listSigmaTableForAdjointModelScatProjToProj.clear();
84 listSigmaTableForAdjointModelProdToProj.clear();
97 LastCSCorrectionFactor =1.;
99 forward_CS_mode =
true;
101 currentParticleDef = 0;
122{listOfAdjointEMModel.push_back(aModel);
123 listSigmaTableForAdjointModelScatProjToProj.push_back(
new G4PhysicsTable);
124 listSigmaTableForAdjointModelProdToProj.push_back(
new G4PhysicsTable);
125 return listOfAdjointEMModel.size() -1;
133 if (anAdjPartDef && aProcess){
137 for (
size_t i=0;i<theListOfAdjointParticlesInAction.size();i++){
138 if (anAdjPartDef->
GetParticleName() == theListOfAdjointParticlesInAction[i]->GetParticleName()) index=i;
140 listOfForwardEmProcess[index]->push_back(aProcess);
148 if (anAdjPartDef && aProcess){
151 for (
size_t i=0;i<theListOfAdjointParticlesInAction.size();i++){
152 if (anAdjPartDef->
GetParticleName() == theListOfAdjointParticlesInAction[i]->GetParticleName()) index=i;
154 listOfForwardEnergyLossProcess[index]->push_back(aProcess);
161 for (
size_t i=0;i<theListOfAdjointParticlesInAction.size();i++){
162 if (aPartDef->
GetParticleName() == theListOfAdjointParticlesInAction[i]->GetParticleName()) index=i;
166 listOfForwardEnergyLossProcess.push_back(
new std::vector<G4VEnergyLossProcess*>());
169 listOfForwardEmProcess.push_back(
new std::vector<G4VEmProcess*>());
170 theListOfAdjointParticlesInAction.push_back(aPartDef);
171 EminForFwdSigmaTables.push_back(std::vector<G4double> ());
172 EminForAdjSigmaTables.push_back(std::vector<G4double> ());
173 EkinofFwdSigmaMax.push_back(std::vector<G4double> ());
174 EkinofAdjSigmaMax.push_back(std::vector<G4double> ());
182 if (CrossSectionMatrixesAreBuilt)
return;
202 theAdjointCSMatricesForScatProjToProj.clear();
203 theAdjointCSMatricesForProdToProj.clear();
207 G4cout<<
"========== Computation of cross section matrices for adjoint models =========="<<
G4endl;
208 for (
size_t i=0; i<listOfAdjointEMModel.size();i++){
212 std::vector<G4AdjointCSMatrix*>* aListOfMat1 =
new std::vector<G4AdjointCSMatrix*>();
213 std::vector<G4AdjointCSMatrix*>* aListOfMat2 =
new std::vector<G4AdjointCSMatrix*>();
214 aListOfMat1->clear();
215 aListOfMat2->clear();
218 std::vector<G4AdjointCSMatrix*>
219 two_matrices=BuildCrossSectionsMatricesForAGivenModelAndElement(aModel,1, 1, 80);
220 aListOfMat1->push_back(two_matrices[0]);
221 aListOfMat2->push_back(two_matrices[1]);
224 for (
size_t j=0; j<theElementTable->size();j++){
225 G4Element* anElement=(*theElementTable)[j];
228 std::vector<G4AdjointCSMatrix*>
229 two_matrices=BuildCrossSectionsMatricesForAGivenModelAndElement(aModel,Z, A, 40);
230 aListOfMat1->push_back(two_matrices[0]);
231 aListOfMat2->push_back(two_matrices[1]);
236 for (
size_t j=0; j<theMaterialTable->size();j++){
238 std::vector<G4AdjointCSMatrix*>
239 two_matrices=BuildCrossSectionsMatricesForAGivenModelAndMaterial(aModel,aMaterial, 40);
240 aListOfMat1->push_back(two_matrices[0]);
241 aListOfMat2->push_back(two_matrices[1]);
245 theAdjointCSMatricesForProdToProj.push_back(*aListOfMat1);
246 theAdjointCSMatricesForScatProjToProj.push_back(*aListOfMat2);
249 else {
G4cout<<
"The model "<<aModel->
GetName()<<
" does not use cross section matrices"<<
G4endl;
250 std::vector<G4AdjointCSMatrix*> two_empty_matrices;
251 theAdjointCSMatricesForProdToProj.push_back(two_empty_matrices);
252 theAdjointCSMatricesForScatProjToProj.push_back(two_empty_matrices);
256 G4cout<<
" All adjoint cross section matrices are computed!"<<
G4endl;
257 G4cout<<
"======================================================================"<<
G4endl;
259 CrossSectionMatrixesAreBuilt =
true;
268{
if (TotalSigmaTableAreBuilt)
return;
275 for (
size_t i=0; i<listOfAdjointEMModel.size();i++){
276 listSigmaTableForAdjointModelScatProjToProj[i]->clearAndDestroy();
277 listSigmaTableForAdjointModelProdToProj[i]->clearAndDestroy();
279 listSigmaTableForAdjointModelScatProjToProj[i]->push_back(
new G4PhysicsLogVector(Tmin, Tmax, nbins));
280 listSigmaTableForAdjointModelProdToProj[i]->push_back(
new G4PhysicsLogVector(Tmin, Tmax, nbins));
286 for (
size_t i=0;i<theListOfAdjointParticlesInAction.size();i++){
288 DefineCurrentParticle(thePartDef);
289 theTotalForwardSigmaTableVector[i]->clearAndDestroy();
290 theTotalAdjointSigmaTableVector[i]->clearAndDestroy();
291 EminForFwdSigmaTables[i].clear();
292 EminForAdjSigmaTables[i].clear();
293 EkinofFwdSigmaMax[i].clear();
294 EkinofAdjSigmaMax[i].clear();
324 for (
size_t k=0; k<listOfForwardEmProcess[i]->size(); k++){
325 totCS+=(*listOfForwardEmProcess[i])[k]->GetLambda(e, couple);
327 for (
size_t k=0; k<listOfForwardEnergyLossProcess[i]->size(); k++){
328 if (thePartDef == theAdjIon) {
329 size_t mat_index = couple->
GetIndex();
330 G4VEmModel* currentModel = (*listOfForwardEnergyLossProcess[i])[k]->SelectModelForMaterial(e,mat_index);
332 (*listOfForwardEnergyLossProcess[i])[k]->SetDynamicMassCharge(massRatio,chargeSqRatio);
335 totCS+=(*listOfForwardEnergyLossProcess[i])[k]->GetLambda(e1, couple);
338 if (totCS>sigma_max){
345 if (totCS>0 && !Emin_found) {
346 EminForFwdSigmaTables[i].push_back(e);
354 EkinofFwdSigmaMax[i].push_back(e_sigma_max);
357 if(!Emin_found) EminForFwdSigmaTables[i].push_back(Tmax);
359 theTotalForwardSigmaTableVector[i]->push_back(aVector);
370 if (totCS>sigma_max){
376 if (totCS>0 && !Emin_found) {
377 EminForAdjSigmaTables[i].push_back(e);
383 EkinofAdjSigmaMax[i].push_back(e_sigma_max);
384 if(!Emin_found) EminForAdjSigmaTables[i].push_back(Tmax);
386 theTotalAdjointSigmaTableVector[i]->push_back(aVector1);
390 TotalSigmaTableAreBuilt =
true;
397{ DefineCurrentMaterial(aCouple);
398 DefineCurrentParticle(aPartDef);
400 return (((*theTotalAdjointSigmaTableVector[currentParticleIndex])[currentMatIndex])->GetValue(Ekin*massRatio, b));
409{ DefineCurrentMaterial(aCouple);
410 DefineCurrentParticle(aPartDef);
412 return (((*theTotalForwardSigmaTableVector[currentParticleIndex])[currentMatIndex])->GetValue(Ekin*massRatio, b));
420{ DefineCurrentMaterial(aCouple);
422 if (is_scat_proj_to_proj)
return (((*listSigmaTableForAdjointModelScatProjToProj[index_model])[currentMatIndex])->GetValue(Ekin_nuc, b));
423 else return (((*listSigmaTableForAdjointModelProdToProj[index_model])[currentMatIndex])->GetValue(Ekin_nuc, b));
429{ DefineCurrentMaterial(aCouple);
430 DefineCurrentParticle(aPartDef);
431 emin_adj = EminForAdjSigmaTables[currentParticleIndex][currentMatIndex]/massRatio;
432 emin_fwd = EminForFwdSigmaTables[currentParticleIndex][currentMatIndex]/massRatio;
441{ DefineCurrentMaterial(aCouple);
442 DefineCurrentParticle(aPartDef);
443 e_sigma_max = EkinofFwdSigmaMax[currentParticleIndex][currentMatIndex];
445 sigma_max =((*theTotalForwardSigmaTableVector[currentParticleIndex])[currentMatIndex])->GetValue(e_sigma_max, b);
446 e_sigma_max/=massRatio;
454{ DefineCurrentMaterial(aCouple);
455 DefineCurrentParticle(aPartDef);
456 e_sigma_max = EkinofAdjSigmaMax[currentParticleIndex][currentMatIndex];
458 sigma_max =((*theTotalAdjointSigmaTableVector[currentParticleIndex])[currentMatIndex])->GetValue(e_sigma_max, b);
459 e_sigma_max/=massRatio;
468 if (forward_CS_mode) {
470 if (LastEkinForCS != PreStepEkin || aPartDef != lastPartDefForCS || aCouple!=currentCouple) {
471 DefineCurrentMaterial(aCouple);
474 LastEkinForCS = PreStepEkin;
475 lastPartDefForCS = aPartDef;
476 if (PrefwdCS >0. && PreadjCS >0.) {
477 forward_CS_is_used =
true;
478 LastCSCorrectionFactor = PrefwdCS/PreadjCS;
481 forward_CS_is_used =
false;
482 LastCSCorrectionFactor = 1.;
487 corr_fac =LastCSCorrectionFactor;
493 forward_CS_is_used =
false;
494 LastCSCorrectionFactor = 1.;
497 fwd_is_used = forward_CS_is_used;
509 if (!forward_CS_is_used || pre_adjCS ==0. || after_fwdCS==0.) {
510 forward_CS_is_used=
false;
512 corr_fac *=std::exp((pre_adjCS-pre_fwdCS)*step_length);
513 LastCSCorrectionFactor = 1.;
516 LastCSCorrectionFactor = after_fwdCS/pre_adjCS;
527 return 1./LastCSCorrectionFactor;
536 G4bool IsScatProjToProjCase,
537 std::vector<G4double>& CS_Vs_Element)
543 if (IsScatProjToProjCase){
551 if (EminSec >= EmaxSec)
return 0.;
554 G4bool need_to_compute=
false;
555 if ( aMaterial!= lastMaterial || PrimEnergy != lastPrimaryEnergy || Tcut != lastTcut){
556 lastMaterial =aMaterial;
557 lastPrimaryEnergy = PrimEnergy;
559 listOfIndexOfAdjointEMModelInAction.clear();
560 listOfIsScatProjToProjCase.clear();
561 lastAdjointCSVsModelsAndElements.clear();
562 need_to_compute=
true;
566 if (!need_to_compute){
567 need_to_compute=
true;
568 for (
size_t i=0;i<listOfIndexOfAdjointEMModelInAction.size();i++){
569 size_t ind1=listOfIndexOfAdjointEMModelInAction[i];
570 if (aModel == listOfAdjointEMModel[ind1] && IsScatProjToProjCase == listOfIsScatProjToProjCase[i]){
571 need_to_compute=
false;
572 CS_Vs_Element = lastAdjointCSVsModelsAndElements[ind];
578 if (need_to_compute){
580 for (
size_t i=0;i<listOfAdjointEMModel.size();i++){
581 if (aModel == listOfAdjointEMModel[i]){
587 if (!listOfAdjointEMModel[ind_model]->GetApplyCutInRange()) Tlow =listOfAdjointEMModel[ind_model]->GetLowEnergyLimit();
588 listOfIndexOfAdjointEMModelInAction.push_back(ind_model);
589 listOfIsScatProjToProjCase.push_back(IsScatProjToProjCase);
590 CS_Vs_Element.clear();
592 CS_Vs_Element.push_back(aModel->
AdjointCrossSection(currentCouple,PrimEnergy,IsScatProjToProjCase));
600 if (IsScatProjToProjCase){
601 theCSMatrix=theAdjointCSMatricesForScatProjToProj[ind_model][0];
603 else theCSMatrix=theAdjointCSMatricesForProdToProj[ind_model][0];
605 if (PrimEnergy > Tlow)
608 for (
size_t i=0;i<n_el;i++){
613 CS_Vs_Element.push_back(CS);
617 for (
size_t i=0;i<n_el;i++){
621 if (IsScatProjToProjCase){
622 theCSMatrix=theAdjointCSMatricesForScatProjToProj[ind_model][ind_el];
624 else theCSMatrix=theAdjointCSMatricesForProdToProj[ind_model][ind_el];
626 if (PrimEnergy > Tlow)
635 size_t ind_mat = aMaterial->
GetIndex();
637 if (IsScatProjToProjCase){
638 theCSMatrix=theAdjointCSMatricesForScatProjToProj[ind_model][ind_mat];
640 else theCSMatrix=theAdjointCSMatricesForProdToProj[ind_model][ind_mat];
642 if (PrimEnergy > Tlow)
644 CS_Vs_Element.push_back(CS);
648 lastAdjointCSVsModelsAndElements.push_back(CS_Vs_Element);
654 for (
size_t i=0;i<CS_Vs_Element.size();i++){
655 CS+=CS_Vs_Element[i];
666 G4bool IsScatProjToProjCase)
667{ std::vector<G4double> CS_Vs_Element;
672 for (
size_t i=0;i<CS_Vs_Element.size();i++){
673 SumCS+=CS_Vs_Element[i];
674 if (rand_var<=SumCS/CS){
693 DefineCurrentMaterial(aCouple);
696 std::vector<G4double> CS_Vs_Element;
698 for (
size_t i=0; i<listOfAdjointEMModel.size();i++){
701 if (!listOfAdjointEMModel[i]->GetApplyCutInRange()) Tlow =listOfAdjointEMModel[i]->GetLowEnergyLimit();
716 if ( Ekin<=listOfAdjointEMModel[i]->GetHighEnergyLimit() && Ekin>=listOfAdjointEMModel[i]->GetLowEnergyLimit()){
717 if (aPartDef == listOfAdjointEMModel[i]->GetAdjointEquivalentOfDirectPrimaryParticleDefinition()){
719 listOfAdjointEMModel[i],
720 Ekin, Tlow,
true,CS_Vs_Element);
722 (*listSigmaTableForAdjointModelScatProjToProj[i])[currentMatIndex]->PutValue(eindex,CS);
724 if (aPartDef == listOfAdjointEMModel[i]->GetAdjointEquivalentOfDirectSecondaryParticleDefinition()){
726 listOfAdjointEMModel[i],
727 Ekin, Tlow,
false, CS_Vs_Element);
729 (*listSigmaTableForAdjointModelProdToProj[i])[currentMatIndex]->PutValue(eindex,CS);
734 (*listSigmaTableForAdjointModelScatProjToProj[i])[currentMatIndex]->PutValue(eindex,0.);
735 (*listSigmaTableForAdjointModelProdToProj[i])[currentMatIndex]->PutValue(eindex,0.);
745std::vector<G4AdjointCSMatrix*>
747 G4int nbin_pro_decade)
763 G4double fE=std::pow(10.,1./nbin_pro_decade);
764 G4double E2=std::pow(10.,
double(
int(std::log10(EkinMin)*nbin_pro_decade)+1)/nbin_pro_decade)/fE;
766 while (E1 <EkinMaxForProd){
767 E1=std::max(EkinMin,E2);
768 E1=std::min(EkinMaxForProd,E1);
770 if (aMat.size()>=2) {
771 std::vector< double>* log_ESecVec=aMat[0];
772 std::vector< double>* log_CSVec=aMat[1];
773 G4double log_adjointCS=log_CSVec->back();
775 for (
size_t j=0;j<log_CSVec->size();j++) {
776 if (j==0) (*log_CSVec)[j] = 0.;
777 else (*log_CSVec)[j]=std::log(1.-std::exp((*log_CSVec)[j]-log_adjointCS) +1e-50);
779 (*log_CSVec)[log_CSVec->size()-1]=(*log_CSVec)[log_CSVec->size()-2]-std::log(1000.);
780 theCSMatForProdToProjBackwardScattering->
AddData(std::log(E1),log_adjointCS,log_ESecVec,log_CSVec,0);
789 E2=std::pow(10.,
double(
int(std::log10(EkinMin)*nbin_pro_decade)+1)/nbin_pro_decade)/fE;
791 while (E1 <EkinMaxForScat){
792 E1=std::max(EkinMin,E2);
793 E1=std::min(EkinMaxForScat,E1);
795 if (aMat.size()>=2) {
796 std::vector< double>* log_ESecVec=aMat[0];
797 std::vector< double>* log_CSVec=aMat[1];
798 G4double log_adjointCS=log_CSVec->back();
800 for (
size_t j=0;j<log_CSVec->size();j++) {
801 if (j==0) (*log_CSVec)[j] = 0.;
802 else (*log_CSVec)[j]=std::log(1.-std::exp((*log_CSVec)[j]-log_adjointCS)+1e-50);
804 (*log_CSVec)[log_CSVec->size()-1]=(*log_CSVec)[log_CSVec->size()-2]-std::log(1000.);
805 theCSMatForScatProjToProjBackwardScattering->
AddData(std::log(E1),log_adjointCS,log_ESecVec,log_CSVec,0);
812 std::vector<G4AdjointCSMatrix*> res;
814 res.push_back(theCSMatForProdToProjBackwardScattering);
815 res.push_back(theCSMatForScatProjToProjBackwardScattering);
836std::vector<G4AdjointCSMatrix*>
837G4AdjointCSManager::BuildCrossSectionsMatricesForAGivenModelAndMaterial(
G4VEmAdjointModel* aModel,
839 G4int nbin_pro_decade)
860 G4double fE=std::pow(10.,1./nbin_pro_decade);
861 G4double E2=std::pow(10.,
double(
int(std::log10(EkinMin)*nbin_pro_decade)+1)/nbin_pro_decade)/fE;
863 while (E1 <EkinMaxForProd){
864 E1=std::max(EkinMin,E2);
865 E1=std::min(EkinMaxForProd,E1);
867 if (aMat.size()>=2) {
868 std::vector< double>* log_ESecVec=aMat[0];
869 std::vector< double>* log_CSVec=aMat[1];
870 G4double log_adjointCS=log_CSVec->back();
873 for (
size_t j=0;j<log_CSVec->size();j++) {
875 if (j==0) (*log_CSVec)[j] = 0.;
876 else (*log_CSVec)[j]=std::log(1.-std::exp((*log_CSVec)[j]-log_adjointCS));
879 (*log_CSVec)[log_CSVec->size()-1]=(*log_CSVec)[log_CSVec->size()-2]-std::log(1000.);
880 theCSMatForProdToProjBackwardScattering->
AddData(std::log(E1),log_adjointCS,log_ESecVec,log_CSVec,0);
892 E2=std::pow(10.,
double(
int(std::log10(EkinMin)*nbin_pro_decade)+1)/nbin_pro_decade)/fE;
894 while (E1 <EkinMaxForScat){
895 E1=std::max(EkinMin,E2);
896 E1=std::min(EkinMaxForScat,E1);
898 if (aMat.size()>=2) {
899 std::vector< double>* log_ESecVec=aMat[0];
900 std::vector< double>* log_CSVec=aMat[1];
901 G4double log_adjointCS=log_CSVec->back();
903 for (
size_t j=0;j<log_CSVec->size();j++) {
905 if (j==0) (*log_CSVec)[j] = 0.;
906 else (*log_CSVec)[j]=std::log(1.-std::exp((*log_CSVec)[j]-log_adjointCS));
910 (*log_CSVec)[log_CSVec->size()-1]=(*log_CSVec)[log_CSVec->size()-2]-std::log(1000.);
912 theCSMatForScatProjToProjBackwardScattering->
AddData(std::log(E1),log_adjointCS,log_ESecVec,log_CSVec,0);
924 std::vector<G4AdjointCSMatrix*> res;
927 res.push_back(theCSMatForProdToProjBackwardScattering);
928 res.push_back(theCSMatForScatProjToProjBackwardScattering);
948 else if (theFwdPartDef ==theFwdIon)
return theAdjIon;
959 else if (theAdjPartDef == theAdjIon)
return theFwdIon;
966 if(couple != currentCouple) {
969 currentMatIndex = couple->
GetIndex();
972 LastCSCorrectionFactor =1.;
980 if(aPartDef != currentParticleDef) {
984 if (aPartDef == theAdjIon) massRatio = proton_mass_c2/aPartDef->
GetPDGMass();
985 currentParticleIndex=1000000;
986 for (
size_t i=0;i<theListOfAdjointParticlesInAction.size();i++){
987 if (aPartDef == theListOfAdjointParticlesInAction[i]) currentParticleIndex=i;
1001 if (theLogPrimEnergyVector->size() ==0){
1002 G4cout<<
"No data are contained in the given AdjointCSMatrix!"<<
G4endl;
1007 G4double log_Tcut = std::log(Tcut);
1008 G4double log_E =std::log(aPrimEnergy);
1010 if (aPrimEnergy <= Tcut || log_E > theLogPrimEnergyVector->back())
return 0.;
1017 G4double aLogPrimEnergy1,aLogPrimEnergy2;
1020 std::vector< double>* aLogSecondEnergyVector1 =0;
1021 std::vector< double>* aLogSecondEnergyVector2 =0;
1022 std::vector< double>* aLogProbVector1=0;
1023 std::vector< double>* aLogProbVector2=0;
1024 std::vector< size_t>* aLogProbVectorIndex1=0;
1025 std::vector< size_t>* aLogProbVectorIndex2=0;
1028 anAdjointCSMatrix->
GetData(ind, aLogPrimEnergy1,aLogCS1,log01, aLogSecondEnergyVector1,aLogProbVector1,aLogProbVectorIndex1);
1029 anAdjointCSMatrix->
GetData(ind+1, aLogPrimEnergy2,aLogCS2,log02, aLogSecondEnergyVector2,aLogProbVector2,aLogProbVectorIndex2);
1031 G4double log_minimum_prob1, log_minimum_prob2;
1032 log_minimum_prob1=theInterpolator->
InterpolateForLogVector(log_Tcut,*aLogSecondEnergyVector1,*aLogProbVector1);
1033 log_minimum_prob2=theInterpolator->
InterpolateForLogVector(log_Tcut,*aLogSecondEnergyVector2,*aLogProbVector2);
1034 aLogCS1+= log_minimum_prob1;
1035 aLogCS2+= log_minimum_prob2;
1039 return std::exp(log_adjointCS);
std::vector< G4Element * > G4ElementTable
std::vector< G4Material * > G4MaterialTable
G4DLLIMPORT std::ostream G4cout
void BuildTotalSigmaTables()
size_t RegisterEmAdjointModel(G4VEmAdjointModel *)
void RegisterAdjointParticle(G4ParticleDefinition *aPartDef)
G4ParticleDefinition * GetForwardParticleEquivalent(G4ParticleDefinition *theAdjPartDef)
void GetMaxAdjTotalCS(G4ParticleDefinition *aPartDef, const G4MaterialCutsCouple *aCouple, G4double &e_sigma_max, G4double &sigma_max)
G4double GetCrossSectionCorrection(G4ParticleDefinition *aPartDef, G4double PreStepEkin, const G4MaterialCutsCouple *aCouple, G4bool &fwd_is_used, G4double &fwd_TotCS)
G4double GetTotalForwardCS(G4ParticleDefinition *aPartDef, G4double Ekin, const G4MaterialCutsCouple *aCouple)
G4double ComputeTotalAdjointCS(const G4MaterialCutsCouple *aMatCutCouple, G4ParticleDefinition *aPart, G4double PrimEnergy)
G4ParticleDefinition * GetAdjointParticleEquivalent(G4ParticleDefinition *theFwdPartDef)
G4Element * SampleElementFromCSMatrices(G4Material *aMaterial, G4VEmAdjointModel *aModel, G4double PrimEnergy, G4double Tcut, G4bool IsScatProjToProjCase)
G4double GetContinuousWeightCorrection(G4ParticleDefinition *aPartDef, G4double PreStepEkin, G4double AfterStepEkin, const G4MaterialCutsCouple *aCouple, G4double step_length)
G4double GetPostStepWeightCorrection()
void GetEminForTotalCS(G4ParticleDefinition *aPartDef, const G4MaterialCutsCouple *aCouple, G4double &emin_adj, G4double &emin_fwd)
static G4AdjointCSManager * GetAdjointCSManager()
G4double GetTotalAdjointCS(G4ParticleDefinition *aPartDef, G4double Ekin, const G4MaterialCutsCouple *aCouple)
G4double GetAdjointSigma(G4double Ekin_nuc, size_t index_model, G4bool is_scat_proj_to_proj, const G4MaterialCutsCouple *aCouple)
void RegisterEmProcess(G4VEmProcess *aProcess, G4ParticleDefinition *aPartDef)
void BuildCrossSectionMatrices()
void RegisterEnergyLossProcess(G4VEnergyLossProcess *aProcess, G4ParticleDefinition *aPartDef)
void GetMaxFwdTotalCS(G4ParticleDefinition *aPartDef, const G4MaterialCutsCouple *aCouple, G4double &e_sigma_max, G4double &sigma_max)
G4double ComputeAdjointCS(G4Material *aMaterial, G4VEmAdjointModel *aModel, G4double PrimEnergy, G4double Tcut, G4bool IsScatProjToProjCase, std::vector< G4double > &AdjointCS_for_each_element)
G4bool GetData(unsigned int i, G4double &aPrimEnergy, G4double &aCS, G4double &log0, std::vector< double > *&aLogSecondEnergyVector, std::vector< double > *&aLogProbVector, std::vector< size_t > *&aLogProbVectorIndex)
std::vector< double > * GetLogPrimEnergyVector()
G4bool IsScatProjToProjCase()
void AddData(G4double aPrimEnergy, G4double aCS, std::vector< double > *aLogSecondEnergyVector, std::vector< double > *aLogProbVector, size_t n_pro_decade=0)
static G4AdjointElectron * AdjointElectron()
static G4AdjointGamma * AdjointGamma()
G4double LinearInterpolation(G4double &x, G4double &x1, G4double &x2, G4double &y1, G4double &y2)
static G4AdjointInterpolator * GetInstance()
size_t FindPositionForLogVector(G4double &x, std::vector< G4double > &x_vec)
G4double InterpolateForLogVector(G4double &x, std::vector< G4double > &x_vec, std::vector< G4double > &y_vec)
static G4AdjointProton * AdjointProton()
static G4Electron * Electron()
static const G4ElementTable * GetElementTable()
const G4Material * GetMaterial() const
static const G4MaterialTable * GetMaterialTable()
const G4Element * GetElement(G4int iel) const
size_t GetNumberOfElements() const
const G4double * GetVecNbOfAtomsPerVolume() const
G4double GetPDGMass() const
const G4String & GetParticleName() const
size_t GetVectorLength() const
virtual G4double GetLowEdgeEnergy(size_t binNumber) const
void PutValue(size_t index, G4double theValue)
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
size_t GetTableSize() const
const std::vector< G4double > * GetEnergyCutsVector(size_t pcIdx) const
static G4ProductionCutsTable * GetProductionCutsTable()
static G4Proton * Proton()
G4bool GetSecondPartOfSameType()
void SetCSMatrices(std::vector< G4AdjointCSMatrix * > *Vec1CSMatrix, std::vector< G4AdjointCSMatrix * > *Vec2CSMatrix)
G4bool GetUseOnlyOneMatrixForAllElements()
virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy)
std::vector< std::vector< double > * > ComputeAdjointCrossSectionVectorPerAtomForSecond(G4double kinEnergyProd, G4double Z, G4double A=0., G4int nbin_pro_decade=10)
G4double GetLowEnergyLimit()
G4bool GetApplyCutInRange()
virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase(G4double PrimAdjEnergy)
std::vector< std::vector< double > * > ComputeAdjointCrossSectionVectorPerVolumeForSecond(G4Material *aMaterial, G4double kinEnergyProd, G4int nbin_pro_decade=10)
virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy)
G4bool GetUseMatrixPerElement()
std::vector< std::vector< double > * > ComputeAdjointCrossSectionVectorPerVolumeForScatProj(G4Material *aMaterial, G4double kinEnergyProd, G4int nbin_pro_decade=10)
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
std::vector< std::vector< double > * > ComputeAdjointCrossSectionVectorPerAtomForScatProj(G4double kinEnergyProd, G4double Z, G4double A=0., G4int nbin_pro_decade=10)
G4double GetHighEnergyLimit()
virtual G4double GetSecondAdjEnergyMinForScatProjToProjCase(G4double PrimAdjEnergy, G4double Tcut=0)
virtual G4double GetChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)