78{
79
80 theParticleChange->Clear();
83
84
85
86
87
88
89
90
91
92 const G4double energyThresholdForCharmAndBottomHadrons = 100.0*CLHEP::MeV;
93 if ( thePrimary.
GetKineticEnergy() < energyThresholdForCharmAndBottomHadrons &&
98 theParticleChange->SetStatusChange(
isAlive );
101 return theParticleChange;
102 }
103
104
105
106
107
108
109
110
111
112
113
114
115 const G4double energyThresholdForHyperNuclei = 100.0*CLHEP::MeV;
118 theParticleChange->SetStatusChange(
isAlive );
121 return theParticleChange;
122 }
123
124
125
127
128 if ( theQuasielastic )
129 {
130 if ( theQuasielastic->GetFraction( theNucleus, aPart ) >
G4UniformRand() )
131 {
132
133 G4KineticTrackVector* result= theQuasielastic->Scatter( theNucleus, aPart );
134
135 if ( result )
136 {
137 for ( auto & ptr : *result )
138 {
139 G4DynamicParticle* aNew = new G4DynamicParticle( ptr->GetDefinition(),
140 ptr->Get4Momentum().e(),
141 ptr->Get4Momentum().vect() );
142 theParticleChange->AddSecondary( aNew, ptr->GetCreatorModelID() );
143 delete ptr;
144 }
145 delete result;
146 }
147 else
148 {
149 theParticleChange->SetStatusChange(
isAlive );
152 }
153 return theParticleChange;
154 }
155 }
156
157
158 G4KineticTrackVector* theInitialResult = theHighEnergyGenerator->Scatter( theNucleus, aPart );
159
160
161
162
163 G4int theModelID = theStringModelID;
164 if ( theHighEnergyGenerator->IsQuasiElasticInteraction() ) {
165 theModelID = theFTFQuasiElasticID;
166 } else if ( theHighEnergyGenerator->IsDiffractiveInteraction() ) {
167 theModelID = theFTFDiffractiveID;
168 }
169 for ( auto & ptr : *theInitialResult ) {
170 ptr->SetCreatorModelID( theModelID );
171 }
172
173
174 #ifdef DEBUG_initial_result
177 for ( auto & ptr : *theInitialResult )
178 {
179
180
181 E_out += ptr->Get4Momentum().e();
182 }
184 G4double init_E = aPart.Get4Momentum().e();
185
186
187 const std::vector< G4Nucleon >& thy = theHighEnergyGenerator->GetWoundedNucleus()->GetNucleons();
188
189 G4int resZ( 0 ), resA( 0 );
191 for ( auto & nuc : thy )
192 {
193 if (
nuc.AreYouHit() ) {
194 ++resA;
196 ++resZ;
197 delta_m += CLHEP::proton_mass_c2;
198 } else {
199 delta_m += CLHEP::neutron_mass_c2;
200 }
201 }
202 }
203
207 }
208 G4double E_excit = init_mass + init_E - final_mass - E_out;
209 G4cout <<
" Corrected delta mass " << init_mass - final_mass - delta_m <<
G4endl;
210 G4cout <<
"initial E, mass = " << init_E <<
", " << init_mass <<
G4endl;
211 G4cout <<
" final E, mass = " << E_out <<
", " << final_mass <<
" excitation_E " << E_excit <<
G4endl;
212 #endif
213
215
216 G4V3DNucleus* theProjectileNucleus = theHighEnergyGenerator->GetProjectileNucleus();
217 if ( theProjectileNucleus == nullptr )
218 {
220 const std::vector< G4Nucleon >& they = theHighEnergyGenerator->GetWoundedNucleus()->GetNucleons();
221 for ( auto & nuc : they )
222 {
223 if (
nuc.AreYouHit() ) ++hitCount;
224 }
225 if ( hitCount != theHighEnergyGenerator->GetWoundedNucleus()->GetMassNumber() )
226 {
227 theTransport->SetPrimaryProjectile( thePrimary );
228 theTransportResult = theTransport->Propagate( theInitialResult,
229 theHighEnergyGenerator->GetWoundedNucleus() );
230 if ( theTransportResult == nullptr ) {
231 G4cout <<
"G4TheoFSGenerator: null ptr from transport propagate " <<
G4endl;
232 throw G4HadronicException( __FILE__, __LINE__, "Null ptr from transport propagate" );
233 }
234 }
235 else
236 {
237 theTransportResult = theDecay.Propagate( theInitialResult,
238 theHighEnergyGenerator->GetWoundedNucleus() );
239 if ( theTransportResult == nullptr ) {
240 G4cout <<
"G4TheoFSGenerator: null ptr from decay propagate " <<
G4endl;
241 throw G4HadronicException( __FILE__, __LINE__, "Null ptr from decay propagate" );
242 }
243 }
244 }
245 else
246 {
247 theTransport->SetPrimaryProjectile( thePrimary );
248 theTransportResult = theTransport->PropagateNuclNucl( theInitialResult,
249 theHighEnergyGenerator->GetWoundedNucleus(),
250 theProjectileNucleus );
251 if ( theTransportResult == nullptr ) {
252 G4cout <<
"G4TheoFSGenerator: null ptr from transport propagate " <<
G4endl;
253 throw G4HadronicException( __FILE__, __LINE__, "Null ptr from transport propagate" );
254 }
255 }
256
257
258
259
260
262 if ( theCosmicCoalescence == nullptr ) {
263 theCosmicCoalescence = (G4CRCoalescence*)
265 if ( theCosmicCoalescence == nullptr ) {
266 theCosmicCoalescence = new G4CRCoalescence;
267 }
268 }
269 theCosmicCoalescence->SetP0Coalescence( thePrimary, theHighEnergyGenerator->GetModelName() );
270 theCosmicCoalescence->GenerateDeuterons( theTransportResult );
271 }
272
273
274 for ( auto & ptr : *theTransportResult )
275 {
276 G4DynamicParticle* aNewDP = new G4DynamicParticle( ptr->GetDefinition(),
277 ptr->GetTotalEnergy(),
278 ptr->GetMomentum() );
279 G4HadSecondary aNew = G4HadSecondary( aNewDP );
280 G4double time = std::max( ptr->GetFormationTime(), 0.0 );
281 aNew.
SetTime( timePrimary + time );
285 theParticleChange->AddSecondary( aNew );
286 delete ptr;
287 }
288
289
290 delete theTransportResult;
291
292
293 return theParticleChange;
294}
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetGlobalTime() const
void SetParentResonanceDef(const G4ParticleDefinition *parentDef)
void SetTime(G4double aT)
void SetCreatorModelID(G4int id)
void SetParentResonanceID(const G4int parentID)
G4HadronicInteraction * FindModel(const G4String &name)
static G4HadronicInteractionRegistry * Instance()
static G4HadronicParameters * Instance()
G4double GetIonMass(G4int Z, G4int A, G4int nL=0, G4int lvl=0) const
G4int GetQuarkContent(G4int flavor) const
G4bool IsHypernucleus() const
G4int GetAntiQuarkContent(G4int flavor) const
G4IonTable * GetIonTable() const
static G4ParticleTable * GetParticleTable()
static G4Proton * Proton()