Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4BinaryLightIonReaction Class Reference

#include <G4BinaryLightIonReaction.hh>

+ Inheritance diagram for G4BinaryLightIonReaction:

Public Member Functions

 G4BinaryLightIonReaction (G4VPreCompoundModel *ptr=0)
 
virtual ~G4BinaryLightIonReaction ()
 
G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &theNucleus)
 
void SetPrecompound (G4VPreCompoundModel *ptr)
 
void SetDeExcitation (G4ExcitationHandler *ptr)
 
virtual void ModelDescription (std::ostream &) const
 
- Public Member Functions inherited from G4HadronicInteraction
 G4HadronicInteraction (const G4String &modelName="HadronicModel")
 
virtual ~G4HadronicInteraction ()
 
virtual G4double SampleInvariantT (const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A)
 
virtual G4bool IsApplicable (const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
 
G4double GetMinEnergy () const
 
G4double GetMinEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMinEnergy (G4double anEnergy)
 
void SetMinEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMinEnergy (G4double anEnergy, const G4Material *aMaterial)
 
G4double GetMaxEnergy () const
 
G4double GetMaxEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMaxEnergy (const G4double anEnergy)
 
void SetMaxEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMaxEnergy (G4double anEnergy, const G4Material *aMaterial)
 
G4int GetVerboseLevel () const
 
void SetVerboseLevel (G4int value)
 
const G4StringGetModelName () const
 
void DeActivateFor (const G4Material *aMaterial)
 
void ActivateFor (const G4Material *aMaterial)
 
void DeActivateFor (const G4Element *anElement)
 
void ActivateFor (const G4Element *anElement)
 
G4bool IsBlocked (const G4Material *aMaterial) const
 
G4bool IsBlocked (const G4Element *anElement) const
 
void SetRecoilEnergyThreshold (G4double val)
 
G4double GetRecoilEnergyThreshold () const
 
virtual const std::pair< G4double, G4doubleGetFatalEnergyCheckLevels () const
 
virtual std::pair< G4double, G4doubleGetEnergyMomentumCheckLevels () const
 
void SetEnergyMomentumCheckLevels (G4double relativeLevel, G4double absoluteLevel)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void InitialiseModel ()
 
 G4HadronicInteraction (const G4HadronicInteraction &right)=delete
 
const G4HadronicInteractionoperator= (const G4HadronicInteraction &right)=delete
 
G4bool operator== (const G4HadronicInteraction &right) const =delete
 
G4bool operator!= (const G4HadronicInteraction &right) const =delete
 

Additional Inherited Members

- Protected Member Functions inherited from G4HadronicInteraction
void SetModelName (const G4String &nam)
 
G4bool IsBlocked () const
 
void Block ()
 
- Protected Attributes inherited from G4HadronicInteraction
G4HadFinalState theParticleChange
 
G4int verboseLevel
 
G4double theMinEnergy
 
G4double theMaxEnergy
 
G4bool isBlocked
 

Detailed Description

Definition at line 34 of file G4BinaryLightIonReaction.hh.

Constructor & Destructor Documentation

◆ G4BinaryLightIonReaction()

G4BinaryLightIonReaction::G4BinaryLightIonReaction ( G4VPreCompoundModel * ptr = 0)

Definition at line 55 of file G4BinaryLightIonReaction.cc.

56: G4HadronicInteraction("Binary Light Ion Cascade"),
57 theProjectileFragmentation(ptr),
58 pA(0),pZ(0), tA(0),tZ(0),spectatorA(0),spectatorZ(0),
59 projectile3dNucleus(0),target3dNucleus(0)
60{
61 if(!ptr) {
64 G4VPreCompoundModel* pre = static_cast<G4VPreCompoundModel*>(p);
65 if(!pre) { pre = new G4PreCompoundModel(); }
66 theProjectileFragmentation = pre;
67 }
68 theModel = new G4BinaryCascade(theProjectileFragmentation);
69 theHandler = theProjectileFragmentation->GetExcitationHandler();
70 theBLIR_ID = G4PhysicsModelCatalog::GetModelID("model_G4BinaryLightIonReaction");
71 debug_G4BinaryLightIonReactionResults = G4HadronicParameters::Instance()->GetBinaryDebug();
72}
G4HadronicInteraction * FindModel(const G4String &name)
static G4HadronicInteractionRegistry * Instance()
G4HadronicInteraction(const G4String &modelName="HadronicModel")
static G4HadronicParameters * Instance()
static G4int GetModelID(const G4int modelIndex)
G4ExcitationHandler * GetExcitationHandler() const

◆ ~G4BinaryLightIonReaction()

G4BinaryLightIonReaction::~G4BinaryLightIonReaction ( )
virtual

Definition at line 74 of file G4BinaryLightIonReaction.cc.

75{}

Member Function Documentation

◆ ApplyYourself()

G4HadFinalState * G4BinaryLightIonReaction::ApplyYourself ( const G4HadProjectile & aTrack,
G4Nucleus & theNucleus )
virtual

Reimplemented from G4HadronicInteraction.

Definition at line 92 of file G4BinaryLightIonReaction.cc.

94{
95 if(debug_G4BinaryLightIonReactionResults) G4cerr << " ######### Binary Light Ion Reaction starts ######### " << G4endl;
96 G4ping debug("debug_G4BinaryLightIonReaction");
97 pA=aTrack.GetDefinition()->GetBaryonNumber();
98 pZ=G4lrint(aTrack.GetDefinition()->GetPDGCharge()/eplus);
99 tA=targetNucleus.GetA_asInt();
100 tZ=targetNucleus.GetZ_asInt();
101 G4double timePrimary = aTrack.GetGlobalTime();
102 G4LorentzVector mom(aTrack.Get4Momentum());
103 //G4cout << "proj mom : " << mom << G4endl;
104 G4LorentzRotation toBreit(mom.boostVector());
105
106 G4bool swapped=SetLighterAsProjectile(mom, toBreit);
107 //G4cout << "after swap, swapped? / mom " << swapped << " / " << mom <<G4endl;
108 G4ReactionProductVector * result = 0;
109 G4ReactionProductVector * cascaders=0; //new G4ReactionProductVector;
110// G4double m_nucl(0); // to check energy balance
111
112
113 // G4double m1=G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(pZ,pA);
114 // G4cout << "Entering the decision point "
115 // << (mom.t()-mom.mag())/pA << " "
116 // << pA<<" "<< pZ<<" "
117 // << tA<<" "<< tZ<<G4endl
118 // << " "<<mom.t()-mom.mag()<<" "
119 // << mom.t()- m1<<G4endl;
120 if( (mom.t()-mom.mag())/pA < 50*MeV )
121 {
122 // G4cout << "Using pre-compound only, E= "<<mom.t()-mom.mag()<<G4endl;
123 // m_nucl = mom.mag();
124 cascaders=FuseNucleiAndPrompound(mom);
125 if( !cascaders )
126 {
127
128 // abort!! happens for too low energy for nuclei to fuse
129
130 theResult.Clear();
131 theResult.SetStatusChange(isAlive);
132 theResult.SetEnergyChange(aTrack.GetKineticEnergy());
133 theResult.SetMomentumChange(aTrack.Get4Momentum().vect().unit());
134 return &theResult;
135 }
136 }
137 else
138 {
139 result=Interact(mom,toBreit);
140
141 if(! result )
142 {
143 // abort!!
144
145 G4cerr << "G4BinaryLightIonReaction no final state for: " << G4endl;
146 G4cerr << " Primary " << aTrack.GetDefinition()
147 << ", (A,Z)=(" << aTrack.GetDefinition()->GetBaryonNumber()
148 << "," << aTrack.GetDefinition()->GetPDGCharge()/eplus << ") "
149 << ", kinetic energy " << aTrack.GetKineticEnergy()
150 << G4endl;
151 G4cerr << " Target nucleus (A,Z)=("
152 << (swapped?pA:tA) << ","
153 << (swapped?pZ:tZ) << ")" << G4endl;
154 G4cerr << " if frequent, please submit above information as bug report"
155 << G4endl << G4endl;
156
157 theResult.Clear();
158 theResult.SetStatusChange(isAlive);
159 theResult.SetEnergyChange(aTrack.GetKineticEnergy());
160 theResult.SetMomentumChange(aTrack.Get4Momentum().vect().unit());
161 return &theResult;
162 }
163
164 // Calculate excitation energy,
165 G4double theStatisticalExEnergy = GetProjectileExcitation();
166
167
168 pInitialState = mom;
169 //G4cout << "BLIC: pInitialState from aTrack : " << pInitialState;
170 pInitialState.setT(pInitialState.getT() +
172 //G4cout << "BLIC: target nucleus added : " << pInitialState << G4endl;
173
174 delete target3dNucleus;target3dNucleus=0;
175 delete projectile3dNucleus;projectile3dNucleus=0;
176
178
179 cascaders = new G4ReactionProductVector;
180
181 G4LorentzVector pspectators=SortResult(result,spectators,cascaders);
182 // this also sets spectatorA and spectatorZ
183
184 // pFinalState=std::accumulate(cascaders->begin(),cascaders->end(),pFinalState,ReactionProduct4Mom);
185
186 std::vector<G4ReactionProduct *>::iterator iter;
187
188 // G4cout << "pInitialState, pFinalState / pspectators"<< pInitialState << " / " << pFinalState << " / " << pspectators << G4endl;
189 // if ( spectA-spectatorA !=0 || spectZ-spectatorZ !=0)
190 // {
191 // G4cout << "spect Nucl != spectators: nucl a,z; spect a,z" <<
192 // spectatorA <<" "<< spectatorZ <<" ; " << spectA <<" "<< spectZ << G4endl;
193 // }
194 delete result;
195 result=0;
196 G4LorentzVector momentum(pInitialState-pFinalState);
197 G4int loopcount(0);
198 //G4cout << "BLIC: momentum, pspectators : " << momentum << " / " << pspectators << G4endl;
199 while (std::abs(momentum.e()-pspectators.e()) > 10*MeV) /* Loop checking, 31.08.2015, G.Folger */
200 // see if on loopcount
201 {
202 G4LorentzVector pCorrect(pInitialState-pspectators);
203 //G4cout << "BLIC:: BIC nonconservation? (pInitialState-pFinalState) / spectators :" << momentum << " / " << pspectators << "pCorrect "<< pCorrect<< G4endl;
204 // Correct outgoing casacde particles.... to have momentum of (initial state - spectators)
205 G4bool EnergyIsCorrect=EnergyAndMomentumCorrector(cascaders, pCorrect);
206 if ( ! EnergyIsCorrect && debug_G4BinaryLightIonReactionResults)
207 {
208 G4cout << "Warning - G4BinaryLightIonReaction E/P correction for cascaders failed" << G4endl;
209 }
210 pFinalState=G4LorentzVector(0,0,0,0);
211 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
212 {
213 pFinalState += G4LorentzVector( (*iter)->GetMomentum(), (*iter)->GetTotalEnergy() );
214 }
215 momentum=pInitialState-pFinalState;
216 if (++loopcount > 10 )
217 {
218 break;
219 }
220 }
221
222// Check if Energy/Momemtum is now ok, if not return initial state
223 if ( std::abs(momentum.e()-pspectators.e()) > 10*MeV )
224 {
225 for (iter=spectators->begin();iter!=spectators->end();iter++)
226 {
227 delete *iter;
228 }
229 delete spectators;
230 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
231 {
232 delete *iter;
233 }
234 delete cascaders;
235
236 G4cout << "G4BinaryLightIonReaction.cc: mom check: " << G4endl
237 << " initial - final " << momentum << " 3.mag "<< momentum.vect().mag() << G4endl
238 << " .. pInitialState/pFinalState/spectators " << G4endl
239 << pInitialState << G4endl
240 << pFinalState << G4endl
241 << pspectators << G4endl
242 << " .. A,Z " << spectatorA <<" "<< spectatorZ << G4endl;
243 G4cout << "G4BinaryLightIonReaction invalid final state for: " << G4endl;
244 G4cout << " Primary " << aTrack.GetDefinition()
245 << ", (A,Z)=(" << aTrack.GetDefinition()->GetBaryonNumber()
246 << "," << aTrack.GetDefinition()->GetPDGCharge()/eplus << ") "
247 << ", kinetic energy " << aTrack.GetKineticEnergy()
248 << G4endl;
249 G4cout << " Target nucleus (A,Z)=(" << targetNucleus.GetA_asInt()
250 << "," << targetNucleus.GetZ_asInt() << ")" << G4endl;
251 G4cout << " if frequent, please submit above information as bug report"
252 << G4endl << G4endl;
253#ifdef debug_G4BinaryLightIonReaction
255 ed << "G4BinaryLightIonreaction: Terminate for above error" << G4endl;
256 G4Exception("G4BinaryLightIonreaction::ApplyYourSelf()", "BLIC001", FatalException,
257 ed);
258
259#endif
260 theResult.Clear();
261 theResult.SetStatusChange(isAlive);
262 theResult.SetEnergyChange(aTrack.GetKineticEnergy());
263 theResult.SetMomentumChange(aTrack.Get4Momentum().vect().unit());
264 return &theResult;
265
266 }
267 if (spectatorA > 0 )
268 {
269 // DeExciteSpectatorNucleus() also handles also case of A=1, Z=0,1
270 DeExciteSpectatorNucleus(spectators, cascaders, theStatisticalExEnergy, momentum);
271 } else { // no spectators
272 delete spectators;
273 }
274 }
275 // Rotate to lab
277 toZ.rotateZ(-1*mom.phi());
278 toZ.rotateY(-1*mom.theta());
279 G4LorentzRotation toLab(toZ.inverse());
280
281 // Fill the particle change, while rotating. Boost from projectile breit-frame in case we swapped.
282 // theResult.Clear();
283 theResult.Clear();
284 theResult.SetStatusChange(stopAndKill);
285 G4LorentzVector ptot(0);
286 #ifdef debug_BLIR_result
287 G4LorentzVector p_raw;
288 #endif
289 //G4int i=0;
290
291 G4ReactionProductVector::iterator iter;
292 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
293 {
294 if((*iter)->GetNewlyAdded())
295 {
296 G4DynamicParticle * aNewDP =
297 new G4DynamicParticle((*iter)->GetDefinition(),
298 (*iter)->GetTotalEnergy(),
299 (*iter)->GetMomentum() );
300 G4LorentzVector tmp = aNewDP->Get4Momentum();
301 #ifdef debug_BLIR_result
302 p_raw+= tmp;
303 #endif
304 if(swapped)
305 {
306 tmp*=toBreit.inverse();
307 tmp.setVect(-tmp.vect());
308 }
309 tmp *= toLab;
310 aNewDP->Set4Momentum(tmp);
311 G4HadSecondary aNew = G4HadSecondary(aNewDP);
312 G4double time = 0; //(*iter)->GetCreationTime();
313 //if(time < 0.0) { time = 0.0; }
314 aNew.SetTime(timePrimary + time);
315 //aNew.SetCreatorModelID((*iter)->GetCreatorModelID()); //AR-02Aug2021 : For some reasons, it does NOT work!
316 aNew.SetCreatorModelID(theBLIR_ID);
317
318 theResult.AddSecondary(aNew);
319 ptot += tmp;
320 //G4cout << "BLIC: Secondary " << aNew->GetDefinition()->GetParticleName()
321 // <<" "<< aNew->GetMomentum()<<" "<< aNew->GetTotalEnergy() << G4endl;
322 }
323 delete *iter;
324 }
325 delete cascaders;
326
327#ifdef debug_BLIR_result
328 //G4cout << "Result analysis, secondaries " << theResult.GetNumberOfSecondaries() << G4endl;
329 //G4cout << "p_tot_raw " << p_raw << " sum p final " << ptot << G4endl;
331 GetIonMass(targetNucleus.GetZ_asInt(),targetNucleus.GetA_asInt());
332 // delete? tZ=targetNucleus.GetZ_asInt();
333
334 //G4cout << "BLIC Energy conservation initial/primary/nucleus/final/delta(init-final) "
335 // << aTrack.GetTotalEnergy() + m_nucl <<" "<< aTrack.GetTotalEnergy() <<" "<< m_nucl <<" "<<ptot.e()
336 // <<" "<< aTrack.GetTotalEnergy() + m_nucl - ptot.e() << G4endl;
337 G4cout << "BLIC momentum conservation " << aTrack.Get4Momentum()+ G4LorentzVector(m_nucl)
338 << " ptot " << ptot << " delta " << aTrack.Get4Momentum()+ G4LorentzVector(m_nucl) - ptot
339 << " 3mom.mag() " << (aTrack.Get4Momentum()+ G4LorentzVector(m_nucl) - ptot).vect().mag() << G4endl;
340#endif
341
342 if(debug_G4BinaryLightIonReactionResults) G4cerr << " ######### Binary Light Ion Reaction number ends ######### " << G4endl;
343
344 return &theResult;
345}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
@ isAlive
@ stopAndKill
CLHEP::HepLorentzVector G4LorentzVector
std::vector< G4ReactionProduct * > G4ReactionProductVector
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
Hep3Vector unit() const
double mag() const
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
Hep3Vector vect() const
void setVect(const Hep3Vector &)
G4LorentzVector Get4Momentum() const
void Set4Momentum(const G4LorentzVector &momentum)
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetGlobalTime() const
void SetTime(G4double aT)
void SetCreatorModelID(G4int id)
G4double GetIonMass(G4int Z, G4int A, G4int nL=0, G4int lvl=0) const
G4IonTable * GetIonTable() const
static G4ParticleTable * GetParticleTable()
int G4lrint(double ad)
Definition templates.hh:134

◆ ModelDescription()

void G4BinaryLightIonReaction::ModelDescription ( std::ostream & outFile) const
virtual

Reimplemented from G4HadronicInteraction.

Definition at line 77 of file G4BinaryLightIonReaction.cc.

78{
79 outFile << "G4Binary Light Ion Cascade is an intra-nuclear cascade model\n"
80 << "using G4BinaryCasacde to model the interaction of a light\n"
81 << "nucleus with a nucleus.\n"
82 << "The lighter of the two nuclei is treated like a set of projectiles\n"
83 << "which are transported simultaneously through the heavier nucleus.\n";
84}

◆ SetDeExcitation()

void G4BinaryLightIonReaction::SetDeExcitation ( G4ExcitationHandler * ptr)
inline

Definition at line 74 of file G4BinaryLightIonReaction.hh.

75{
76 theProjectileFragmentation->SetExcitationHandler(ptr);
77 theHandler = ptr;
78}
void SetExcitationHandler(G4ExcitationHandler *ptr)

◆ SetPrecompound()

void G4BinaryLightIonReaction::SetPrecompound ( G4VPreCompoundModel * ptr)
inline

Definition at line 69 of file G4BinaryLightIonReaction.hh.

70{
71 if(ptr) { theProjectileFragmentation = ptr; }
72 theHandler = theProjectileFragmentation->GetExcitationHandler();
73}

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