Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCL::INCL Class Reference

#include <G4INCLCascade.hh>

Public Member Functions

 INCL (Config const *const config)
 ~INCL ()
 INCL (const INCL &rhs)
 Dummy copy constructor to silence Coverity warning.
INCLoperator= (const INCL &rhs)
 Dummy assignment operator to silence Coverity warning.
G4bool prepareReaction (const ParticleSpecies &projectileSpecies, const G4double kineticEnergy, const G4int A, const G4int Z, const G4int S)
G4bool initializeTarget (const G4int A, const G4int Z, const G4int S, AnnihilationType theAType)
G4double initUniverseRadiusForAntiprotonAtRest (const G4int A, const G4int Z)
const EventInfoprocessEvent ()
const EventInfoprocessEvent (ParticleSpecies const &projectileSpecies, const G4double kineticEnergy, const G4int targetA, const G4int targetZ, const G4int targetS)
void finalizeGlobalInfo (Random::SeedVector const &initialSeeds)
const GlobalInfogetGlobalInfo () const

Detailed Description

Definition at line 56 of file G4INCLCascade.hh.

Constructor & Destructor Documentation

◆ INCL() [1/2]

G4INCL::INCL::INCL ( Config const *const config)

Definition at line 84 of file G4INCLCascade.cc.

85 :propagationModel(0), theA(208), theZ(82), theS(0),
86 targetInitSuccess(false),
87 maxImpactParameter(0.),
88 maxUniverseRadius(0.),
89 maxInteractionDistance(0.),
90 fixedImpactParameter(0.),
91 theConfig(config),
92 nucleus(NULL),
93 forceTransparent(false),
94 minRemnantSize(4)
95 {
96 // Set the logger object.
97#ifdef INCLXX_IN_GEANT4_MODE
99#else // INCLXX_IN_GEANT4_MODE
100 Logger::initialize(theConfig);
101#endif // INCLXX_IN_GEANT4_MODE
102
103 // Set the random number generator algorithm. The system can support
104 // multiple different generator algorithms in a completely
105 // transparent way.
106 Random::initialize(theConfig);
107
108 // Select the Pauli and CDPP blocking algorithms
109 Pauli::initialize(theConfig);
110
111 // Set the cross-section set
112 CrossSections::initialize(theConfig);
113
114 // Set the phase-space generator
116
117 // Select the Coulomb-distortion algorithm:
119
120 // Select the clustering algorithm:
121 Clustering::initialize(theConfig);
122
123 // Initialize the INCL particle table:
124 ParticleTable::initialize(theConfig);
125
126 // Initialize the value of cutNN in BinaryCollisionAvatar
127 BinaryCollisionAvatar::setCutNN(theConfig->getCutNN());
128
129 // Initialize the value of strange cross section bias
130 BinaryCollisionAvatar::setBias(theConfig->getBias());
131
132 // Propagation model is responsible for finding avatars and
133 // transporting the particles. In principle this step is "hidden"
134 // behind an abstract interface and the rest of the system does not
135 // care how the transportation and avatar finding is done. This
136 // should allow us to "easily" experiment with different avatar
137 // finding schemes and even to support things like curved
138 // trajectories in the future.
139 propagationModel = new StandardPropagationModel(theConfig->getLocalEnergyBBType(),theConfig->getLocalEnergyPiType(),theConfig->getHadronizationTime());
140 if(theConfig->getCascadeActionType() == AvatarDumpActionType)
141 cascadeAction = new AvatarDumpAction();
142 else
143 cascadeAction = new CascadeAction();
144 cascadeAction->beforeRunAction(theConfig);
145
146 theGlobalInfo.cascadeModel = theConfig->getVersionString();
147 theGlobalInfo.deexcitationModel = theConfig->getDeExcitationString();
148#ifdef INCL_ROOT_USE
149 theGlobalInfo.rootSelection = theConfig->getROOTSelectionString();
150#endif
151
152#ifndef INCLXX_IN_GEANT4_MODE
153 // Fill in the global information
154 theGlobalInfo.At = theConfig->getTargetA();
155 theGlobalInfo.Zt = theConfig->getTargetZ();
156 theGlobalInfo.St = theConfig->getTargetS();
157 const ParticleSpecies theSpecies = theConfig->getProjectileSpecies();
158 theGlobalInfo.Ap = theSpecies.theA;
159 theGlobalInfo.Zp = theSpecies.theZ;
160 theGlobalInfo.Sp = theSpecies.theS;
161 theGlobalInfo.Ep = theConfig->getProjectileKineticEnergy();
162 theGlobalInfo.biasFactor = theConfig->getBias();
163#endif
164
165 fixedImpactParameter = theConfig->getImpactParameter();
166 }
static void setBias(const G4double b)
Set the global bias factor.
static void setCutNN(const G4double c)
struct config_s config
void initialize(Config const *const theConfig)
Initialize the clustering model based on the Config object.
void initialize(Config const *const theConfig)
Initialize the Coulomb-distortion algorithm.
void initialize(Config const *const theConfig)
void initVerbosityLevelFromEnvvar()
void initialize(Config const *const theConfig=0)
Initialize the particle table.
void initialize(Config const *const aConfig)
Initialise blockers according to a Config object.
void initialize(Config const *const theConfig)
void initialize(Config const *const)
Initialize generator according to a Config object.

Referenced by INCL(), and operator=().

◆ ~INCL()

G4INCL::INCL::~INCL ( )

Definition at line 168 of file G4INCLCascade.cc.

168 {
170#ifndef INCLXX_IN_GEANT4_MODE
171 NuclearMassTable::deleteTable();
172#endif
179#ifndef INCLXX_IN_GEANT4_MODE
180 Logger::deleteLoggerSlave();
181#endif
184 cascadeAction->afterRunAction();
185 delete cascadeAction;
186 delete propagationModel;
187 delete theConfig;
188 }
static void deleteBackupParticles()
Release the memory allocated for the backup particles.
void deleteClusteringModel()
Delete the clustering model.
void deleteCoulomb()
Delete the Coulomb-distortion object.
void clearCache()
Clear the INuclearPotential cache.
void deleteBlockers()
Delete blockers.

◆ INCL() [2/2]

G4INCL::INCL::INCL ( const INCL & rhs)

Dummy copy constructor to silence Coverity warning.

Member Function Documentation

◆ finalizeGlobalInfo()

void G4INCL::INCL::finalizeGlobalInfo ( Random::SeedVector const & initialSeeds)

Definition at line 1390 of file G4INCLCascade.cc.

1390 {
1391 const G4double normalisationFactor = theGlobalInfo.geometricCrossSection /
1392 ((G4double) theGlobalInfo.nShots);
1393 theGlobalInfo.nucleonAbsorptionCrossSection = normalisationFactor *
1394 ((G4double) theGlobalInfo.nNucleonAbsorptions);
1395 theGlobalInfo.pionAbsorptionCrossSection = normalisationFactor *
1396 ((G4double) theGlobalInfo.nPionAbsorptions);
1397 theGlobalInfo.reactionCrossSection = normalisationFactor *
1398 ((G4double) (theGlobalInfo.nShots - theGlobalInfo.nTransparents));
1399 theGlobalInfo.errorReactionCrossSection = normalisationFactor *
1400 std::sqrt((G4double) (theGlobalInfo.nShots - theGlobalInfo.nTransparents));
1401 theGlobalInfo.forcedCNCrossSection = normalisationFactor *
1402 ((G4double) theGlobalInfo.nForcedCompoundNucleus);
1403 theGlobalInfo.errorForcedCNCrossSection = normalisationFactor *
1404 std::sqrt((G4double) (theGlobalInfo.nForcedCompoundNucleus));
1405 theGlobalInfo.completeFusionCrossSection = normalisationFactor *
1406 ((G4double) theGlobalInfo.nCompleteFusion);
1407 theGlobalInfo.errorCompleteFusionCrossSection = normalisationFactor *
1408 std::sqrt((G4double) (theGlobalInfo.nCompleteFusion));
1409 theGlobalInfo.energyViolationInteractionCrossSection = normalisationFactor *
1410 ((G4double) theGlobalInfo.nEnergyViolationInteraction);
1411
1412 theGlobalInfo.initialRandomSeeds.assign(initialSeeds.begin(), initialSeeds.end());
1413
1414 Random::SeedVector theSeeds = Random::getSeeds();
1415 theGlobalInfo.finalRandomSeeds.assign(theSeeds.begin(), theSeeds.end());
1416 }
double G4double
Definition G4Types.hh:83
SeedVector getSeeds()

◆ getGlobalInfo()

const GlobalInfo & G4INCL::INCL::getGlobalInfo ( ) const
inline

Definition at line 90 of file G4INCLCascade.hh.

90{ return theGlobalInfo; }

◆ initializeTarget()

G4bool G4INCL::INCL::initializeTarget ( const G4int A,
const G4int Z,
const G4int S,
AnnihilationType theAType )

Definition at line 395 of file G4INCLCascade.cc.

395 {
396 delete nucleus;
397
398 if (theAType==PType || theAType==NType || theAType==DNbarNPbarPType || theAType==DNbarNPbarNType ||theAType==DNbarPPbarPType || theAType==DNbarPPbarNType) {
399 G4double newmaxUniverseRadius=0.;
400 if (theAType==PType) newmaxUniverseRadius=initUniverseRadiusForAntiprotonAtRest(A+1, Z+1);
401 else if (theAType==NType) newmaxUniverseRadius=initUniverseRadiusForAntiprotonAtRest(A+1, Z);
402 else if (theAType==DNbarPPbarPType) newmaxUniverseRadius=initUniverseRadiusForAntiprotonAtRest(A+2, Z+2);
403 else if (theAType==DNbarNPbarNType) newmaxUniverseRadius=initUniverseRadiusForAntiprotonAtRest(A+2, Z);
404 else if (theAType==DNbarNPbarPType || theAType==DNbarPPbarNType) newmaxUniverseRadius=initUniverseRadiusForAntiprotonAtRest(A+2, Z+1);
405 nucleus = new Nucleus(A, Z, S, theConfig, newmaxUniverseRadius, theAType);
406 }
407 else{
408 nucleus = new Nucleus(A, Z, S, theConfig, maxUniverseRadius, theAType);
409 }
410 nucleus->getStore()->getBook().reset();
411 nucleus->initializeParticles();
412 propagationModel->setNucleus(nucleus);
413 return true;
414 }
G4double S(G4double temp)
const G4double A[17]
G4double initUniverseRadiusForAntiprotonAtRest(const G4int A, const G4int Z)
@ DNbarNPbarNType
@ DNbarNPbarPType
@ DNbarPPbarPType
@ DNbarPPbarNType

Referenced by prepareReaction().

◆ initUniverseRadiusForAntiprotonAtRest()

G4double G4INCL::INCL::initUniverseRadiusForAntiprotonAtRest ( const G4int A,
const G4int Z )

Definition at line 1534 of file G4INCLCascade.cc.

1534 {
1535 G4double rMax = 0.0;
1536 if(A==0) {
1537 IsotopicDistribution const &anIsotopicDistribution =
1539 IsotopeVector theIsotopes = anIsotopicDistribution.getIsotopes();
1540 for(IsotopeIter i=theIsotopes.begin(), e=theIsotopes.end(); i!=e; ++i) {
1541 const G4double pMaximumRadius = ParticleTable::getMaximumNuclearRadius(Proton, i->theA, Z);
1542 const G4double nMaximumRadius = ParticleTable::getMaximumNuclearRadius(Neutron, i->theA, Z);
1543 const G4double maximumRadius = std::max(pMaximumRadius, nMaximumRadius);
1544 rMax = std::max(maximumRadius, rMax);
1545 }
1546 } else {
1547 const G4double pMaximumRadius = ParticleTable::getMaximumNuclearRadius(Proton, A, Z);
1548 const G4double nMaximumRadius = ParticleTable::getMaximumNuclearRadius(Neutron, A, Z);
1549 const G4double maximumRadius = std::max(pMaximumRadius, nMaximumRadius);
1550 rMax = std::max(maximumRadius, rMax);
1551 }
1552 return rMax;
1553 }
G4double getMaximumNuclearRadius(const ParticleType t, const G4int A, const G4int Z)
IsotopicDistribution const & getNaturalIsotopicDistribution(const G4int Z)
IsotopeVector::iterator IsotopeIter
std::vector< Isotope > IsotopeVector

Referenced by initializeTarget().

◆ operator=()

INCL & G4INCL::INCL::operator= ( const INCL & rhs)

Dummy assignment operator to silence Coverity warning.

◆ prepareReaction()

G4bool G4INCL::INCL::prepareReaction ( const ParticleSpecies & projectileSpecies,
const G4double kineticEnergy,
const G4int A,
const G4int Z,
const G4int S )

Definition at line 190 of file G4INCLCascade.cc.

190 {
191 if(A < 0 || A > 300 || Z < 1 || Z > 200) {
192 INCL_ERROR("Unsupported target: A = " << A << " Z = " << Z << " S = " << S << '\n'
193 << "Target configuration rejected." << '\n');
194 return false;
195 }
196 if((projectileSpecies.theType==Composite || projectileSpecies.theType == antiComposite)&&
197 (projectileSpecies.theZ==projectileSpecies.theA || projectileSpecies.theZ==0)) {
198 INCL_ERROR("Unsupported projectile: A = " << projectileSpecies.theA << " Z = " << projectileSpecies.theZ << " S = " << projectileSpecies.theS << '\n'
199 << "Projectile configuration rejected." << '\n');
200 return false;
201 }
202
203 // Reset the forced-transparent flag
204 forceTransparent = false;
205
206 // Initialise the maximum universe radius
207 initUniverseRadius(projectileSpecies, kineticEnergy, A, Z);
208 // Initialise the nucleus
209
210//D
211 //reset
212 G4bool ProtonIsTheVictim = false;
213 G4bool NeutronIsTheVictim = false;
214 G4bool DNbProtonIsTheVictim = false;
215 G4bool DPbProtonIsTheVictim = false;
216 theEventInfo.annihilationP = false;
217 theEventInfo.annihilationN = false;
218 G4bool isModelA = true; //Antideuteron
219
220 //G4double AnnihilationBarrier = kineticEnergy;
221 if((projectileSpecies.theType == antiProton && kineticEnergy <= theConfig->getAtrestThreshold()) || (projectileSpecies.theType == antiNeutron && kineticEnergy <= theConfig->getnbAtrestThreshold())){
222 double SpOverSn;
223 if(projectileSpecies.theType == antiProton)
224 SpOverSn = 1.331;//from experiments with deuteron (E.Klempt)
225 else if(projectileSpecies.theType == antiNeutron)
226 SpOverSn = 1./1.331; //Opposite for antineutron
227 else{
228 SpOverSn = 1;
229 INCL_ERROR("Neither antiProton nor antiNeutron annihilated");
230 }
231 //INCL_WARN("theA number set to A-1 from " << A <<'\n');
232
233 G4double neutronprob;
234 if(theConfig->isNaturalTarget()){ // A = 0 in this case
235 theA = ParticleTable::drawRandomNaturalIsotope(Z) - 1; //43 and 61 are ok (Technetium and Promethium)
236 neutronprob = (theA + 1 - Z)/(theA + 1 - Z + SpOverSn*Z);
237 }
238 else{
239 theA = A - 1;
240 neutronprob = (A - Z)/(A - Z + SpOverSn*Z); //from experiments with deuteron (E.Klempt)
241 }
242
243 theS = S;
244
245 G4double rndm = Random::shoot();
246 if(rndm >= neutronprob){ //proton is annihilated
247 theEventInfo.annihilationP = true;
248 theZ = Z - 1;
249 ProtonIsTheVictim = true;
250 //INCL_WARN("theZ number set to Z-1 from " << Z << '\n');
251 }
252 else{ //neutron is annihilated
253 theEventInfo.annihilationN = true;
254 theZ = Z;
255 NeutronIsTheVictim = true;
256 }
257 } else if(projectileSpecies.theType == antiComposite && kineticEnergy <= theConfig->getdbAtrestThreshold()){
258 if(Z > 30)
259 isModelA=false;
260 else if(Z > 9 && Z <=30){ //Maybe change and add another dependance than Z
261 double rndmA = Random::shoot();
262 if(rndmA > 0.5)//Random threshold : should be improved to take into account the orbit in which the separation takes place.
263 isModelA=false;
264 }
265 if(isModelA){
266 //Antideuteron Model A case : 2 annihilation at the same time
267 double pbarSpOverSn = 1.331;
268 double nbarSpOverSn = 1./1.331;
269 double pbarneutronprob;
270 double nbarneutronprob;
271 if(theConfig->isNaturalTarget()){
273 nbarneutronprob = (theA + 2 - Z)/(theA + 2 - Z + nbarSpOverSn*Z);
274 pbarneutronprob = (theA + 2 - Z)/(theA + 2 - Z + pbarSpOverSn*Z);
275 }
276 else{
277 theA = A - 2;
278 nbarneutronprob = (A - Z)/(A - Z + nbarSpOverSn*Z);
279 pbarneutronprob = (A - Z)/(A - Z + pbarSpOverSn*Z);
280 }
281 theS = S;
282 G4double rndm = Random::shoot(); //for nbar
283 G4double rndm2 = Random::shoot(); //for pbar
284
285 if (rndm >= nbarneutronprob){ // nbarp
286 DNbProtonIsTheVictim = true;
287 if(rndm2 >= pbarneutronprob){ // pbarp
288 theZ = Z - 2;
289 DPbProtonIsTheVictim = true;
290 } else if(rndm2 < pbarneutronprob){ //pbarn
291 theZ = Z - 1;
292 }
293 } else if(rndm < nbarneutronprob){//nbarn
294 if(rndm2 >= pbarneutronprob){ // pbarp
295 theZ = Z - 1;
296 DPbProtonIsTheVictim = true;
297 } else if(rndm2 < pbarneutronprob){ //pbarn
298 theZ = Z;
299 }
300 }
301 } else if (!isModelA){//Model B : Antiproton is detached from antideuteron
302 double SpOverSn = 1.331;
303 double neutronprob;
304 if(theConfig->isNaturalTarget()){
306 neutronprob = (theA + 1 - Z)/(theA + 1 - Z + SpOverSn*Z);
307 }
308 else{
309 theA = A - 1;
310 neutronprob = (A - Z)/(A - Z + SpOverSn*Z);
311 }
312
313 theS = S;
314
315 double rndm = Random::shoot();
316 if(rndm >= neutronprob){ //proton is annihilated
317 theEventInfo.annihilationP = true;
318 theZ = Z - 1;
319 ProtonIsTheVictim = true;
320 }
321 else{ //neutron is annihilated
322 theEventInfo.annihilationN = true;
323 theZ = Z;
324 NeutronIsTheVictim = true;
325 }
326 }
327 }
328 else{ // not annihilation of pbar, nbar, dbar
329 theZ = Z;
330 theS = S;
331 if(theConfig->isNaturalTarget())
332 theA = ParticleTable::drawRandomNaturalIsotope(Z); //change order
333 else
334 theA = A;
335 }
336
337 AnnihilationType theAType = Def;
338 if(ProtonIsTheVictim == true && NeutronIsTheVictim == false)
339 theAType = PType;
340 if(NeutronIsTheVictim == true && ProtonIsTheVictim == false)
341 theAType = NType;
342 if(projectileSpecies.theType == antiComposite && kineticEnergy <= theConfig->getdbAtrestThreshold() && isModelA){
343 if(DNbProtonIsTheVictim == true && DPbProtonIsTheVictim ==true)
344 theAType = DNbarPPbarPType;
345 else if(DNbProtonIsTheVictim == false && DPbProtonIsTheVictim ==true)
346 theAType = DNbarNPbarPType;
347 else if(DNbProtonIsTheVictim == false && DPbProtonIsTheVictim == false)
348 theAType = DNbarNPbarNType;
349 else if(DNbProtonIsTheVictim == true && DPbProtonIsTheVictim ==false)
350 theAType = DNbarPPbarNType;
351 } else if (projectileSpecies.theType == antiComposite && kineticEnergy <= theConfig->getdbAtrestThreshold() && !isModelA){
352 if(ProtonIsTheVictim == true && NeutronIsTheVictim == false)
353 theAType = PType;
354 if(NeutronIsTheVictim == true && ProtonIsTheVictim == false)
355 theAType = NType;
356 }
357
358//D
359
360 initializeTarget(theA, theZ, theS, theAType);
361
362 // Set the maximum impact parameter
363 maxImpactParameter = CoulombDistortion::maxImpactParameter(projectileSpecies, kineticEnergy, nucleus);
364 INCL_DEBUG("Maximum impact parameter initialised: " << maxImpactParameter << '\n');
365
366 // For forced CN events
367 initMaxInteractionDistance(projectileSpecies, kineticEnergy);
368// Set the geometric cross sectiony section
369 if((projectileSpecies.theType == antiProton && kineticEnergy <= theConfig->getAtrestThreshold()) || (projectileSpecies.theType == antiNeutron && kineticEnergy <= theConfig->getnbAtrestThreshold())
370 || (projectileSpecies.theType == antiComposite && kineticEnergy <= theConfig->getdbAtrestThreshold()) ){
371 G4int currentA = A;
372 if(theConfig->isNaturalTarget()){
374 }
375 G4double kineticEnergy2=kineticEnergy;
376 if (kineticEnergy2 <= 0.) kineticEnergy2=0.001;
377 theGlobalInfo.geometricCrossSection = 9.7* //normalization factor from Corradini
378 Math::pi*std::pow((1.840 + 1.120*std::pow(currentA,(1./3.))),2)*
379 (1. + (Z*G4INCL::PhysicalConstants::eSquared*(currentA+1))/(currentA*kineticEnergy2*(1.840 + 1.120*std::pow(currentA,(1./3.)))));
380 //xsection formula was borrowed from Corradini et al. https://doi.org/10.1016/j.physletb.2011.09.069
381 }
382 else{
383 theGlobalInfo.geometricCrossSection =
384 Math::tenPi*std::pow(maxImpactParameter,2);
385 }
386
387 // Set the minimum remnant size
388 if(projectileSpecies.theA > 0)
389 minRemnantSize = std::min(theA, 4);
390 else
391 minRemnantSize = std::min(theA-1, 4);
392 return true;
393 }
#define INCL_ERROR(x)
#define INCL_DEBUG(x)
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4bool initializeTarget(const G4int A, const G4int Z, const G4int S, AnnihilationType theAType)
G4double maxImpactParameter(ParticleSpecies const &p, const G4double kinE, Nucleus const *const n)
Return the maximum impact parameter for Coulomb-distorted trajectories.
const G4double pi
const G4double tenPi
G4int drawRandomNaturalIsotope(const G4int Z)
const G4double eSquared
Coulomb conversion factor [MeV*fm].
G4double shoot()

Referenced by processEvent().

◆ processEvent() [1/2]

const EventInfo & G4INCL::INCL::processEvent ( )
inline

Definition at line 72 of file G4INCLCascade.hh.

72 {
73 return processEvent(
74 theConfig->getProjectileSpecies(),
75 theConfig->getProjectileKineticEnergy(),
76 theConfig->getTargetA(),
77 theConfig->getTargetZ(),
78 theConfig->getTargetS()
79 );
80 }
const EventInfo & processEvent()

Referenced by processEvent().

◆ processEvent() [2/2]

const EventInfo & G4INCL::INCL::processEvent ( ParticleSpecies const & projectileSpecies,
const G4double kineticEnergy,
const G4int targetA,
const G4int targetZ,
const G4int targetS )

Definition at line 416 of file G4INCLCascade.cc.

422 {
423
424 ParticleList starlistH2;
425
426 if (projectileSpecies.theType==antiProton && (targetA==1 || targetA==2) && targetZ==1 && targetS==0) {
427
428 if (targetA==1) {
429 preCascade_pbarH1(projectileSpecies, kineticEnergy);
430 } else {
431 preCascade_pbarH2(projectileSpecies, kineticEnergy);
432 theEventInfo.annihilationP = false;
433 theEventInfo.annihilationN = false;
434
435 G4double SpOverSn = 1.331; //from experiments with deuteron (E.Klempt)
436
437 ThreeVector dummy(0.,0.,0.);
438 G4double rndm = Random::shoot()*(SpOverSn+1);
439 if (rndm <= SpOverSn) { //proton is annihilated
440 theEventInfo.annihilationP = true;
441 Particle *p2 = new Particle(Neutron, dummy, dummy);
442 starlistH2.push_back(p2);
443 //delete p2;
444 } else { //neutron is annihilated
445 theEventInfo.annihilationN = true;
446 Particle *p2 = new Particle(Proton, dummy, dummy);
447 starlistH2.push_back(p2);
448 //delete p2;
449 }
450 }
451
452 // File names
453#ifdef INCLXX_IN_GEANT4_MODE
454 if (!G4FindDataDir("G4INCLDATA") ) {
456 ed << " Data missing: set environment variable G4INCLDATA\n"
457 << " to point to the directory containing data files needed\n"
458 << " by the INCL++ model" << G4endl;
459 G4Exception("G4INCLDataFile::readData()","rawppbarFS.dat, ...", FatalException, ed);
460 }
461 const G4String& dataPath0(G4FindDataDir("G4INCLDATA"));
462 const G4String& dataPathppbar(dataPath0 + "/rawppbarFS.dat");
463 const G4String& dataPathnpbar(dataPath0 + "/rawnpbarFS.dat");
464 const G4String& dataPathppbark(dataPath0 + "/rawppbarFSkaonic.dat");
465 const G4String& dataPathnpbark(dataPath0 + "/rawnpbarFSkaonic.dat");
466
467 const G4String dataPathnbarp(dataPath0 + "/rawnbarpFS.dat");
468 const G4String dataPathnbarn(dataPath0 + "/rawnbarnFS.dat");
469#else
470 std::string path;
471 if (theConfig) path = theConfig->getINCLXXDataFilePath();
472 const std::string& dataPathppbar(path + "/rawppbarFS.dat");
473 INCL_DEBUG("Reading https://doi.org/10.1016/0375-9474(92)90362-N ppbar final states" << dataPathppbar << '\n');
474 const std::string& dataPathnpbar(path + "/rawnpbarFS.dat");
475 INCL_DEBUG("Reading https://doi.org/10.1016/0375-9474(92)90362-N npbar final states" << dataPathnpbar << '\n');
476 const std::string& dataPathppbark(path + "/rawppbarFSkaonic.dat");
477 INCL_DEBUG("Reading https://doi.org/10.1016/j.physrep.2005.03.002 ppbar kaonic final states" << dataPathppbark << '\n');
478 const std::string& dataPathnpbark(path + "/rawnpbarFSkaonic.dat");
479 INCL_DEBUG("Reading https://doi.org/10.1007/BF02818764 and https://link.springer.com/article/10.1007/BF02754930 npbar kaonic final states" << dataPathnpbark << '\n');
480
481 const std::string& dataPathnbarp(path + "/rawnnbarpFS.dat ");
482 INCL_DEBUG("Reading nbarp final states" << dataPathnbarp << '\n');
483 const std::string& dataPathnbarpk(path + "/rawnbarpFSkaonic.dat");
484 INCL_DEBUG("Reading nbarp kaonic final states");
485 const std::string& dataPathnbarn(path + "/rawnbarnFS.dat");
486 INCL_DEBUG("Reading nbarn final states" << dataPathnbarn << '\n');
487#endif
488
489 //read probabilities and particle types from file
490 std::vector<G4double> probabilities; //will store each FS yield
491 std::vector<std::vector<G4String>> particle_types; //will store particle names
492 G4double sum = 0.0; //will contain a sum of probabilities of all FS in the file
493 G4double kaonicFSprob=0.05; //probability to kave kaonic FS
494
495 ParticleList starlist;
496 ThreeVector mommy; //momentum to be assigned later
497
498 G4double rdm = Random::shoot();
499 ThreeVector annihilationPosition(0.,0.,0.);
500 if (rdm < (1.-kaonicFSprob)) { // pionic FS was chosen
501 INCL_DEBUG("pionic pp final state chosen" << '\n');
502 if (targetA==1 || (targetA==2 && theEventInfo.annihilationP))
503 {sum = read_file(dataPathppbar, probabilities, particle_types);}
504 else
505 {sum = read_file(dataPathnpbar, probabilities, particle_types);}
506 rdm = (rdm/(1.-kaonicFSprob))*sum; //99.88 normalize by the sum of probabilities in the file
507 //now get the line number in the file where the FS particles are stored:
508 G4int n = findStringNumber(rdm, std::move(probabilities))-1;
509 if ( n < 0 ) return theEventInfo;
510 for (G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++) {
511 if (particle_types[n][j] == "pi0") {
512 Particle *p = new Particle(PiZero, mommy, annihilationPosition);
513 starlist.push_back(p);
514 } else if (particle_types[n][j] == "pi-") {
515 Particle *p = new Particle(PiMinus, mommy, annihilationPosition);
516 starlist.push_back(p);
517 } else if (particle_types[n][j] == "pi+") {
518 Particle *p = new Particle(PiPlus, mommy, annihilationPosition);
519 starlist.push_back(p);
520 } else if (particle_types[n][j] == "omega") {
521 Particle *p = new Particle(Omega, mommy, annihilationPosition);
522 starlist.push_back(p);
523 } else if (particle_types[n][j] == "eta") {
524 Particle *p = new Particle(Eta, mommy, annihilationPosition);
525 starlist.push_back(p);
526 } else if (particle_types[n][j] == "rho-") {
527 Particle *p = new Particle(PiMinus, mommy, annihilationPosition);
528 starlist.push_back(p);
529 Particle *pp = new Particle(PiZero, mommy, annihilationPosition);
530 starlist.push_back(pp);
531 } else if (particle_types[n][j] == "rho+") {
532 Particle *p = new Particle(PiPlus, mommy, annihilationPosition);
533 starlist.push_back(p);
534 Particle *pp = new Particle(PiZero, mommy, annihilationPosition);
535 starlist.push_back(pp);
536 } else if (particle_types[n][j] == "rho0") {
537 Particle *p = new Particle(PiMinus, mommy, annihilationPosition);
538 starlist.push_back(p);
539 Particle *pp = new Particle(PiPlus, mommy, annihilationPosition);
540 starlist.push_back(pp);
541 } else {
542 INCL_ERROR("Some non-existing FS particle detected when reading pbar FS files");
543 for (G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++) {
544#ifdef INCLXX_IN_GEANT4_MODE
545 G4cout << "gotcha! " << particle_types[n][jj] << G4endl;
546#else
547 std::cout << "gotcha! " << particle_types[n][jj] << std::endl;
548#endif
549 }
550#ifdef INCLXX_IN_GEANT4_MODE
551 G4cout << "Some non-existing FS particle detected when reading pbar FS files" << G4endl;
552#else
553 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
554#endif
555 }
556 }
557 } else {
558 INCL_DEBUG("kaonic pp final state chosen" << '\n');
559 if (targetA==1 || (targetA==2 && theEventInfo.annihilationP))
560 {sum = read_file(dataPathppbark, probabilities, particle_types);}
561 else
562 {sum = read_file(dataPathnpbark, probabilities, particle_types);}
563 rdm = ((1.-rdm)/kaonicFSprob)*sum; //2670 normalize by the sum of probabilities in the file
564 //now get the line number in the file where the FS particles are stored:
565 G4int n = findStringNumber(rdm, std::move(probabilities))-1;
566 if ( n < 0 ) return theEventInfo;
567 for (G4int j = 0; j < static_cast<G4int>(particle_types[n].size()); j++) {
568 if (particle_types[n][j] == "pi0") {
569 Particle *p = new Particle(PiZero, mommy, annihilationPosition);
570 starlist.push_back(p);
571 } else if (particle_types[n][j] == "pi-") {
572 Particle *p = new Particle(PiMinus, mommy, annihilationPosition);
573 starlist.push_back(p);
574 } else if (particle_types[n][j] == "pi+") {
575 Particle *p = new Particle(PiPlus, mommy, annihilationPosition);
576 starlist.push_back(p);
577 } else if (particle_types[n][j] == "omega") {
578 Particle *p = new Particle(Omega, mommy, annihilationPosition);
579 starlist.push_back(p);
580 } else if (particle_types[n][j] == "eta") {
581 Particle *p = new Particle(Eta, mommy, annihilationPosition);
582 starlist.push_back(p);
583 } else if (particle_types[n][j] == "K-") {
584 Particle *p = new Particle(KMinus, mommy, annihilationPosition);
585 starlist.push_back(p);
586 } else if (particle_types[n][j] == "K+") {
587 Particle *p = new Particle(KPlus, mommy, annihilationPosition);
588 starlist.push_back(p);
589 } else if (particle_types[n][j] == "K0") {
590 Particle *p = new Particle(KZero, mommy, annihilationPosition);
591 starlist.push_back(p);
592 } else if (particle_types[n][j] == "K0b") {
593 Particle *p = new Particle(KZeroBar, mommy, annihilationPosition);
594 starlist.push_back(p);
595 } else {
596 INCL_ERROR("Some non-existing FS particle detected when reading pbar FS files");
597 for (G4int jj = 0; jj < static_cast<G4int>(particle_types[n].size()); jj++) {
598#ifdef INCLXX_IN_GEANT4_MODE
599 G4cout << "gotcha! " << particle_types[n][jj] << G4endl;
600#else
601 std::cout << "gotcha! " << particle_types[n][jj] << std::endl;
602#endif
603 }
604#ifdef INCLXX_IN_GEANT4_MODE
605 G4cout << "Some non-existing FS particle detected when reading pbar FS files" << G4endl;
606#else
607 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
608#endif
609 }
610 }
611 }
612
613 //compute energies of mesons with a phase-space model
615 if (starlist.size() < 2) {
616 INCL_ERROR("should never happen, at least 2 final state particles!" << '\n');
617 } else if (starlist.size() == 2) {
618 ParticleIter first = starlist.begin();
619 ParticleIter last = std::next(first, 1);
620 G4double m1 = (*first)->getMass();
621 G4double m2 = (*last)->getMass();
622 G4double s = energyOfMesonStar*energyOfMesonStar;
623 G4double mom1 = std::sqrt(s/4. - (std::pow(m1,2) + std::pow(m2,2))/2. - std::pow(m1,2)*std::pow(m2,2)/s + (std::pow(m1,4) + 2.*std::pow(m1*m2,2) + std::pow(m2,4))/(4.*s));
624 ThreeVector momentello = Random::normVector(mom1);
625 (*first)->setMomentum(momentello);
626 (*first)->adjustEnergyFromMomentum();
627 (*last)->setMomentum(-momentello);
628 (*last)->adjustEnergyFromMomentum();
629 } else {
630 PhaseSpaceGenerator::generate(energyOfMesonStar, starlist);
631 }
632
633 if (targetA==1) postCascade_pbarH1(starlist);
634 else postCascade_pbarH2(starlist,starlistH2);
635
636 theGlobalInfo.nShots++;
637 return theEventInfo;
638 } // pbar on H1/H2
639
640 if ((projectileSpecies.theType==antiNeutron)&& (targetA==1 || targetA==2) && targetZ==1 && targetS==0) {
641
642 if (targetA==1) {
643 preCascade_nbarH1(projectileSpecies, kineticEnergy);
644 } else {
645 preCascade_nbarH2(projectileSpecies, kineticEnergy);
646 theEventInfo.annihilationP = false;
647 theEventInfo.annihilationN = false;
648
649 G4double SpOverSn = 1./1.331; //from experiments with deuteron (E.Klempt)
650
651 ThreeVector dummy(0.,0.,0.);
652 double rndm = Random::shoot()*(SpOverSn+1);
653 if (rndm <= SpOverSn) { //proton is annihilated
654 theEventInfo.annihilationP = true;
655 Particle *p2 = new Particle(Neutron, dummy, dummy);
656 starlistH2.push_back(p2);
657 //delete p2;
658 } else { //neutron is annihilated
659 theEventInfo.annihilationN = true;
660 Particle *p2 = new Particle(Proton, dummy, dummy);
661 starlistH2.push_back(p2);
662 //delete p2;
663 }
664 }
665
666 // File names
667#ifdef INCLXX_IN_GEANT4_MODE
668 if (!G4FindDataDir("G4INCLDATA") ) {
670 ed << " Data missing: set environment variable G4INCLDATA\n"
671 << " to point to the directory containing data files needed\n"
672 << " by the INCL++ model" << G4endl;
673 G4Exception("G4INCLDataFile::readData()","rawpnbarFS.dat, ...", FatalException, ed);
674 }
675 G4String dataPath0{G4FindDataDir("G4INCLDATA")};
676 G4String dataPathnbarp(dataPath0 + "/rawnbarpFS.dat");
677 G4String dataPathnbarn(dataPath0 + "/rawnbarnFS.dat");
678 G4String dataPathnbarnk(dataPath0 + "/rawppbarFSkaonic.dat");
679 G4String dataPathnbarpk(dataPath0 + "/rawnbarpFSkaonic.dat");
680#else
681 G4String path;
682 if (theConfig) path = theConfig->getINCLXXDataFilePath();
683 std::string dataPathnbarn(path + "/rawnbarnFS.dat");
684 INCL_DEBUG("Reading nbarn final states" << dataPathnbarn << '\n');
685 std::string dataPathnbarp(path + "/rawnbarpFS.dat");
686 INCL_DEBUG("Reading nbarp final states" << dataPathnbarp << '\n');
687 std::string dataPathnbarnk(path + "/rawppbarFSkaonic.dat");
688 INCL_DEBUG("Reading nbarn kaonic final states" << dataPathnbarnk << '\n');
689 std::string dataPathnbarpk(path + "/rawnbarpFSkaonic.dat");
690 INCL_DEBUG("Reading nbarp kaonic final states" << dataPathnbarpk << '\n');
691#endif
692 //read probabilities and particle types from file
693 std::vector<double> probabilities; //will store each FS yield
694 std::vector<std::vector<G4String>> particle_types; //will store particle names
695 double sum = 0.0; //will contain a sum of probabilities of all FS in the file
696 double kaonicFSprob=0.05; //probability to kave kaonic FS
697
698 ParticleList starlist;
699 ThreeVector mommy; //momentum to be assigned later
700
701 double rdm = Random::shoot();
702 ThreeVector annihilationPosition(0.,0.,0.);
703 if (rdm < (1.-kaonicFSprob)) { // pionic FS was chosen
704 INCL_DEBUG("pionic nn final state chosen" << '\n');
705 if (targetA==1 || (targetA==2 && theEventInfo.annihilationP))
706 {sum = read_file(dataPathnbarp, probabilities, particle_types);}
707 else
708 {sum = read_file(dataPathnbarn, probabilities, particle_types);}
709 rdm = (rdm/(1.-kaonicFSprob))*sum; //99.88 normalize by the sum of probabilities in the file
710 //now get the line number in the file where the FS particles are stored:
711 G4int n = findStringNumber(rdm, probabilities)-1;
712 if ( n < 0 ) return theEventInfo;
713 for (G4int j = 0; j < static_cast<int>(particle_types[n].size()); j++) {
714 if (particle_types[n][j] == "pi0") {
715 Particle *p = new Particle(PiZero, mommy, annihilationPosition);
716 starlist.push_back(p);
717 } else if (particle_types[n][j] == "pi-") {
718 Particle *p = new Particle(PiMinus, mommy, annihilationPosition);
719 starlist.push_back(p);
720 } else if (particle_types[n][j] == "pi+") {
721 Particle *p = new Particle(PiPlus, mommy, annihilationPosition);
722 starlist.push_back(p);
723 } else if (particle_types[n][j] == "omega") {
724 Particle *p = new Particle(Omega, mommy, annihilationPosition);
725 starlist.push_back(p);
726 } else if (particle_types[n][j] == "eta") {
727 Particle *p = new Particle(Eta, mommy, annihilationPosition);
728 starlist.push_back(p);
729 } else if (particle_types[n][j] == "rho-") {
730 Particle *p = new Particle(PiMinus, mommy, annihilationPosition);
731 starlist.push_back(p);
732 Particle *pp = new Particle(PiZero, mommy, annihilationPosition);
733 starlist.push_back(pp);
734 } else if (particle_types[n][j] == "rho+") {
735 Particle *p = new Particle(PiPlus, mommy, annihilationPosition);
736 starlist.push_back(p);
737 Particle *pp = new Particle(PiZero, mommy, annihilationPosition);
738 starlist.push_back(pp);
739 } else if (particle_types[n][j] == "rho0") {
740 Particle *p = new Particle(PiMinus, mommy, annihilationPosition);
741 starlist.push_back(p);
742 Particle *pp = new Particle(PiPlus, mommy, annihilationPosition);
743 starlist.push_back(pp);
744 } else {
745 INCL_ERROR("Some non-existing FS particle detected when reading pbar FS files");
746 for (int jj = 0; jj < static_cast<int>(particle_types[n].size()); jj++) {
747#ifdef INCLXX_IN_GEANT4_MODE
748 G4cout << "gotcha! " << particle_types[n][jj] << G4endl;
749#else
750 std::cout << "gotcha! " << particle_types[n][jj] << std::endl;
751#endif
752 }
753#ifdef INCLXX_IN_GEANT4_MODE
754 G4cout << "Some non-existing FS particle detected when reading pbar FS files" << G4endl;
755#else
756 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
757#endif
758 }
759 }
760 } else {
761 INCL_DEBUG("kaonic pp final state chosen" << '\n');
762 if (targetA==1 || (targetA==2 && theEventInfo.annihilationP))
763 {sum = read_file(dataPathnbarpk, probabilities, particle_types);}
764 else
765 {sum = read_file(dataPathnbarnk, probabilities, particle_types);}
766 rdm = ((1.-rdm)/kaonicFSprob)*sum; //2670 normalize by the sum of probabilities in the file
767 //now get the line number in the file where the FS particles are stored:
768 G4int n = findStringNumber(rdm, probabilities)-1;
769 if ( n < 0 ) return theEventInfo;
770 for (G4int j = 0; j < static_cast<int>(particle_types[n].size()); j++) {
771 if (particle_types[n][j] == "pi0") {
772 Particle *p = new Particle(PiZero, mommy, annihilationPosition);
773 starlist.push_back(p);
774 } else if (particle_types[n][j] == "pi-") {
775 Particle *p = new Particle(PiMinus, mommy, annihilationPosition);
776 starlist.push_back(p);
777 } else if (particle_types[n][j] == "pi+") {
778 Particle *p = new Particle(PiPlus, mommy, annihilationPosition);
779 starlist.push_back(p);
780 } else if (particle_types[n][j] == "omega") {
781 Particle *p = new Particle(Omega, mommy, annihilationPosition);
782 starlist.push_back(p);
783 } else if (particle_types[n][j] == "eta") {
784 Particle *p = new Particle(Eta, mommy, annihilationPosition);
785 starlist.push_back(p);
786 } else if (particle_types[n][j] == "K-") {
787 Particle *p = new Particle(KMinus, mommy, annihilationPosition);
788 starlist.push_back(p);
789 } else if (particle_types[n][j] == "K+") {
790 Particle *p = new Particle(KPlus, mommy, annihilationPosition);
791 starlist.push_back(p);
792 } else if (particle_types[n][j] == "K0") {
793 Particle *p = new Particle(KZero, mommy, annihilationPosition);
794 starlist.push_back(p);
795 } else if (particle_types[n][j] == "K0b") {
796 Particle *p = new Particle(KZeroBar, mommy, annihilationPosition);
797 starlist.push_back(p);
798 } else {
799 INCL_ERROR("Some non-existing FS particle detected when reading pbar FS files");
800 for (int jj = 0; jj < static_cast<int>(particle_types[n].size()); jj++) {
801#ifdef INCLXX_IN_GEANT4_MODE
802 G4cout << "gotcha! " << particle_types[n][jj] << G4endl;
803#else
804 std::cout << "gotcha! " << particle_types[n][jj] << std::endl;
805#endif
806 }
807#ifdef INCLXX_IN_GEANT4_MODE
808 G4cout << "Some non-existing FS particle detected when reading pbar FS files" << G4endl;
809#else
810 std::cout << "Some non-existing FS particle detected when reading pbar FS files" << std::endl;
811#endif
812 }
813 }
814 }
815
816 //compute energies of mesons with a phase-space model
818 if (starlist.size() < 2) {
819 INCL_ERROR("should never happen, at least 2 final state particles!" << '\n');
820 } else if (starlist.size() == 2) {
821 ParticleIter first = starlist.begin();
822 ParticleIter last = std::next(first, 1);
823 G4double m1 = (*first)->getMass();
824 G4double m2 = (*last)->getMass();
825 G4double s = energyOfMesonStar*energyOfMesonStar;
826 G4double mom1 = std::sqrt(s/4. - (std::pow(m1,2) + std::pow(m2,2))/2. - std::pow(m1,2)*std::pow(m2,2)/s + (std::pow(m1,4) + 2.*std::pow(m1*m2,2) + std::pow(m2,4))/(4.*s));
827 ThreeVector momentello = Random::normVector(mom1);
828 (*first)->setMomentum(momentello);
829 (*first)->adjustEnergyFromMomentum();
830 (*last)->setMomentum(-momentello);
831 (*last)->adjustEnergyFromMomentum();
832 } else {
833 PhaseSpaceGenerator::generate(energyOfMesonStar, starlist);
834 }
835
836 if (targetA==1) postCascade_pbarH1(starlist);
837 else postCascade_pbarH2(starlist,starlistH2);
838
839 theGlobalInfo.nShots++;
840 return theEventInfo;
841 } // nbar on H1/H2
842
843 // ReInitialize the bias vector
845 //Particle::INCLBiasVector.Clear();
847
848 // Set the target and the projectile
849 targetInitSuccess = prepareReaction(projectileSpecies, kineticEnergy, targetA, targetZ, targetS);
850
851 if(!targetInitSuccess) {
852 INCL_WARN("Target initialisation failed for A=" << targetA << ", Z=" << targetZ << ", S=" << targetS << '\n');
853 theEventInfo.transparent=true;
854 return theEventInfo;
855 }
856
857 cascadeAction->beforeCascadeAction(propagationModel);
858
859 const G4bool canRunCascade = preCascade(projectileSpecies, kineticEnergy);
860 if(canRunCascade) {
861 cascade();
862 postCascade(projectileSpecies, kineticEnergy);
863 cascadeAction->afterCascadeAction(nucleus);
864 }
865 updateGlobalInfo();
866 return theEventInfo;
867 }
const char * G4FindDataDir(const char *)
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#define INCL_WARN(x)
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4bool prepareReaction(const ParticleSpecies &projectileSpecies, const G4double kineticEnergy, const G4int A, const G4int Z, const G4int S)
static std::vector< G4double > INCLBiasVector
Time ordered vector of all bias applied.
static G4ThreadLocal G4int nextBiasedCollisionID
G4double getRealMass(const G4INCL::ParticleType t)
Get particle mass (in MeV/c^2).
void generate(const G4double sqrtS, ParticleList &particles)
Generate an event in the CM system.
ThreeVector normVector(G4double norm=1.)
ParticleList::const_iterator ParticleIter
std::vector< Base * > ParticleList
Definition PoPI.hpp:186

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