545 if (IsScatProjToProjCase){
553 if (EminSec >= EmaxSec)
return 0.;
556 G4bool need_to_compute=
false;
557 if ( aMaterial!= lastMaterial || PrimEnergy != lastPrimaryEnergy || Tcut != lastTcut){
558 lastMaterial =aMaterial;
559 lastPrimaryEnergy = PrimEnergy;
561 listOfIndexOfAdjointEMModelInAction.clear();
562 listOfIsScatProjToProjCase.clear();
563 lastAdjointCSVsModelsAndElements.clear();
564 need_to_compute=
true;
568 if (!need_to_compute){
569 need_to_compute=
true;
570 for (
size_t i=0;i<listOfIndexOfAdjointEMModelInAction.size();i++){
571 size_t ind1=listOfIndexOfAdjointEMModelInAction[i];
572 if (aModel == listOfAdjointEMModel[ind1] && IsScatProjToProjCase == listOfIsScatProjToProjCase[i]){
573 need_to_compute=
false;
574 CS_Vs_Element = lastAdjointCSVsModelsAndElements[ind];
580 if (need_to_compute){
582 for (
size_t i=0;i<listOfAdjointEMModel.size();i++){
583 if (aModel == listOfAdjointEMModel[i]){
589 if (!listOfAdjointEMModel[ind_model]->GetApplyCutInRange()) Tlow =listOfAdjointEMModel[ind_model]->GetLowEnergyLimit();
590 listOfIndexOfAdjointEMModelInAction.push_back(ind_model);
591 listOfIsScatProjToProjCase.push_back(IsScatProjToProjCase);
592 CS_Vs_Element.clear();
594 CS_Vs_Element.push_back(aModel->
AdjointCrossSection(currentCouple,PrimEnergy,IsScatProjToProjCase));
602 if (IsScatProjToProjCase){
603 theCSMatrix=theAdjointCSMatricesForScatProjToProj[ind_model][0];
605 else theCSMatrix=theAdjointCSMatricesForProdToProj[ind_model][0];
607 if (PrimEnergy > Tlow)
610 for (
size_t i=0;i<n_el;i++){
615 CS_Vs_Element.push_back(CS);
619 for (
size_t i=0;i<n_el;i++){
623 if (IsScatProjToProjCase){
624 theCSMatrix=theAdjointCSMatricesForScatProjToProj[ind_model][ind_el];
626 else theCSMatrix=theAdjointCSMatricesForProdToProj[ind_model][ind_el];
628 if (PrimEnergy > Tlow)
637 size_t ind_mat = aMaterial->
GetIndex();
639 if (IsScatProjToProjCase){
640 theCSMatrix=theAdjointCSMatricesForScatProjToProj[ind_model][ind_mat];
642 else theCSMatrix=theAdjointCSMatricesForProdToProj[ind_model][ind_mat];
644 if (PrimEnergy > Tlow)
646 CS_Vs_Element.push_back(CS);
650 lastAdjointCSVsModelsAndElements.push_back(CS_Vs_Element);
656 for (
size_t i=0;i<CS_Vs_Element.size();i++){
657 CS+=CS_Vs_Element[i];
virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy)
G4bool GetUseOnlyOneMatrixForAllElements()
const G4Element * GetElement(G4int iel) const
virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase(G4double PrimAdjEnergy)
const G4double * GetVecNbOfAtomsPerVolume() const
G4bool GetUseMatrixPerElement()
virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy)
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
virtual G4double GetSecondAdjEnergyMinForScatProjToProjCase(G4double PrimAdjEnergy, G4double Tcut=0)
G4bool GetApplyCutInRange()
size_t GetNumberOfElements() const
G4double ComputeAdjointCS(G4Material *aMaterial, G4VEmAdjointModel *aModel, G4double PrimEnergy, G4double Tcut, G4bool IsScatProjToProjCase, std::vector< G4double > &AdjointCS_for_each_element)