40 : theHadronicInteractionCounter(0)
49 if(0 < theHadronicInteractionCounter) {
50 for(
G4int i=0; i<theHadronicInteractionCounter; ++i) {
51 if(a == theHadronicInteraction[i]) {
return; }
54 theHadronicInteraction.push_back(a);
55 ++theHadronicInteractionCounter;
65 if(1 == theHadronicInteractionCounter) {
return theHadronicInteraction[0]; }
66 else if(0 == theHadronicInteractionCounter) {
67 G4cout <<
"G4EnergyRangeManager::GetHadronicInteraction: "
68 <<
"no models defined for a process" <<
G4endl;
78 G4int cou = 0, memory = 0, memor2 = 0;
79 G4double emi1 = 0.0, ema1 = 0.0, emi2 = 0.0, ema2 = 0.0;
81 for (
G4int i = 0; i<theHadronicInteractionCounter; ++i) {
82 if ( theHadronicInteraction[i]->IsApplicable( aHadProjectile, aTargetNucleus ) ) {
83 G4double low = theHadronicInteraction[i]->GetMinEnergy( aMaterial, anElement );
84 G4double high = theHadronicInteraction[i]->GetMaxEnergy( aMaterial, anElement );
85 if (low <= kineticEnergy && high >= kineticEnergy) {
100 G4cout <<
"No model found out of " << theHadronicInteractionCounter <<
G4endl;
101 for(
G4int j=0; j<theHadronicInteractionCounter; ++j) {
104 <<
", Ehigh= " << hint->
GetMaxEnergy(aMaterial,anElement)
110 hi = theHadronicInteraction[memory];
114 if( (emi2<=emi1 && ema2>=ema1) || (emi2>=emi1 && ema2<=ema1) ) {
115 G4cout <<
"Energy ranges of two models fully overlapping " <<
G4endl;
116 for(
G4int j=0; j<theHadronicInteractionCounter; ++j) {
119 <<
", Ehigh= " << hint->
GetMaxEnergy(aMaterial,anElement)
126 if( (ema1-kineticEnergy) < rand*(ema1-emi2) ) {
132 if( (ema2-kineticEnergy) < rand*(ema2-emi1) ) {
138 hi = theHadronicInteraction[mem];
143 G4cout <<
"More than two competing models for this energy" <<
G4endl;
144 for(
G4int j=0; j<theHadronicInteractionCounter; ++j) {
147 <<
", Ehigh= " << hint->
GetMaxEnergy(aMaterial,anElement)
155std::vector<G4HadronicInteraction*>&
158 return theHadronicInteraction;
164 for (
G4int i = 0 ; i < theHadronicInteractionCounter; i++) {
165 G4cout <<
" HadronicModel " << i <<
":"
166 << theHadronicInteraction[i]->GetModelName() <<
G4endl;
168 G4cout <<
" Minimum Energy "
169 << theHadronicInteraction[i]->GetMinEnergy()/GeV <<
" [GeV], "
171 << theHadronicInteraction[i]->GetMaxEnergy()/GeV <<
" [GeV]"
180 for (
auto & hadi : theHadronicInteraction) {
181 hadi->BuildPhysicsTable( aParticleType );
G4GLOB_DLL std::ostream G4cout
void RegisterMe(G4HadronicInteraction *a)
void BuildPhysicsTable(const G4ParticleDefinition &)
G4HadronicInteraction * GetHadronicInteraction(const G4HadProjectile &aHadProjectile, G4Nucleus &aTargetNucleus, const G4Material *aMaterial, const G4Element *anElement) const
void Dump(G4int verbose=0)
std::vector< G4HadronicInteraction * > & GetHadronicInteractionList()
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4double GetMinEnergy() const
const G4String & GetModelName() const
G4double GetMaxEnergy() const
G4int GetBaryonNumber() const