Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:25

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // INCL++ intra-nuclear cascade model
0027 // Alain Boudard, CEA-Saclay, France
0028 // Joseph Cugnon, University of Liege, Belgium
0029 // Jean-Christophe David, CEA-Saclay, France
0030 // Pekka Kaitaniemi, CEA-Saclay, France, and Helsinki Institute of Physics, Finland
0031 // Sylvie Leray, CEA-Saclay, France
0032 // Davide Mancusi, CEA-Saclay, France
0033 //
0034 #define INCLXX_IN_GEANT4_MODE 1
0035 
0036 #include "globals.hh"
0037 
0038 #ifndef G4INCLConfig_hh
0039 #define G4INCLConfig_hh 1
0040 
0041 #include "G4INCLParticleSpecies.hh"
0042 #include "G4INCLConfigEnums.hh"
0043 #include "G4INCLRandomSeedVector.hh"
0044 #include <iostream>
0045 #include <string>
0046 #include <sstream>
0047 // #include <cassert>
0048 
0049 class ConfigParser;
0050 
0051 namespace G4INCL {
0052 
0053   /**
0054    * The INCL configuration object
0055    *
0056    * The Config object keeps track of various INCL physics options
0057    * (e.g. which Pauli blocking scheme to use, whether to use local
0058    * energy option or not, etc.
0059    */
0060   class Config {
0061   public:
0062     /// \brief Default constructor
0063     Config();
0064 
0065     /// \brief Default destructor
0066     ~Config();
0067 
0068     /// \brief Initialise the members
0069     void init();
0070 
0071     /// \brief Return a summary of the run configuration.
0072     std::string summary();
0073 
0074     /// \brief Get the verbosity.
0075     G4int getVerbosity() const { return verbosity; }
0076 
0077     /// \brief Get the run title.
0078     std::string const &getCalculationTitle() const { return title; }
0079 
0080     /// \brief Get the output file root.
0081     std::string const &getOutputFileRoot() const { return outputFileRoot; }
0082 
0083     /// \brief Get the number of shots.
0084     G4int getNumberOfShots() const { return nShots; }
0085 
0086     /// \brief Natural targets.
0087     G4bool isNaturalTarget() const { return naturalTarget; }
0088 
0089     /** \brief Get the target mass number.
0090      *
0091      * Note that A==0 means natural target. You should first check the
0092      * isNaturalTarget() method.
0093      */
0094     G4int getTargetA() const { return targetSpecies.theA; }
0095 
0096     /// \brief Get the target charge number.
0097     G4int getTargetZ() const { return targetSpecies.theZ; }
0098 
0099     /// \brief Get the target strangess number.
0100     G4int getTargetS() const { return targetSpecies.theS; }
0101 
0102     /// \brief Set target mass number
0103     void setTargetA(G4int A) { targetSpecies.theA = A; }
0104 
0105     /// \brief Set target charge number
0106     void setTargetZ(G4int Z) { targetSpecies.theZ = Z; }
0107 
0108     /// \brief Set target strangess number
0109     void setTargetS(G4int S) { targetSpecies.theS = S; }
0110 
0111     /// \brief Get the projectile type
0112     ParticleType getProjectileType() const { return projectileSpecies.theType; }
0113 
0114     /// \brief Get the projectile species
0115     ParticleSpecies getProjectileSpecies() const { return projectileSpecies; }
0116 
0117     /// \brief Set the projectile species
0118     void setProjectileSpecies(ParticleSpecies const &pars) { projectileSpecies=pars; }
0119 
0120     /// \brief Get the projectile kinetic energy.
0121     G4double getProjectileKineticEnergy() const { return projectileKineticEnergy; }
0122 
0123     /// \brief Set the projectile kinetic energy.
0124     void setProjectileKineticEnergy(G4double const kinE) { projectileKineticEnergy=kinE; }
0125 
0126     /// \brief Get the number of the verbose event.
0127     G4int getVerboseEvent() const { return verboseEvent; }
0128 
0129     /// \brief Get the INCL version ID.
0130     static std::string const getVersionID();
0131 
0132     /// \brief Get the INCL version hash.
0133     static std::string const getVersionHash();
0134 
0135     /// \brief Get the INCL version string.
0136     static std::string const getVersionString() {
0137       std::stringstream ss;
0138       ss << getVersionID() << "-" << getVersionHash();
0139       return ss.str();
0140     }
0141 
0142     /// \brief Get the seeds for the random-number generator.
0143     Random::SeedVector getRandomSeeds() const {
0144       return randomSeedVector;
0145     }
0146 
0147     /// \brief Get the Pauli-blocking algorithm.
0148     PauliType getPauliType() const { return pauliType; }
0149 
0150     /// \brief Do we want CDPP?
0151     G4bool getCDPP() const { return CDPP; }
0152 
0153     /// \brief Get the Coulomb-distortion algorithm.
0154     CoulombType getCoulombType() const { return coulombType; }
0155 
0156     /// \brief Set the Coulomb-distortion algorithm.
0157     void setCoulombType(CoulombType const c) { coulombType = c; }
0158 
0159     /// \brief Get the type of the potential for nucleons.
0160     PotentialType getPotentialType() const { return potentialType; }
0161 
0162     /// \brief Set the type of the potential for nucleons.
0163     void setPotentialType(PotentialType type) { potentialType = type; }
0164 
0165     /// \brief Do we want the pion potential?
0166     G4bool getPionPotential() const { return pionPotential; }
0167 
0168     /// \brief Set the type of the potential for nucleons.
0169     void setPionPotential(const G4bool pionPot) { pionPotential = pionPot; }
0170 
0171     /// \brief Get the type of local energy for N-N avatars.
0172     LocalEnergyType getLocalEnergyBBType() const { return localEnergyBBType; }
0173 
0174     /// \brief Set the type of local energy for N-N avatars.
0175     void setLocalEnergyBBType(const LocalEnergyType t) { localEnergyBBType=t; }
0176 
0177     /// \brief Get the type of local energy for pi-N and decay avatars.
0178     LocalEnergyType getLocalEnergyPiType() const { return localEnergyPiType; }
0179 
0180     /// \brief Set the type of local energy for N-N avatars.
0181     void setLocalEnergyPiType(const LocalEnergyType t) { localEnergyPiType=t; }
0182 
0183     /// \brief Get the log file name.
0184     std::string const &getLogFileName() const { return logFileName; }
0185 
0186     /// \brief Get the de-excitation model.
0187     DeExcitationType getDeExcitationType() const { return deExcitationType; }
0188 
0189     /// \brief Get the de-excitation string.
0190     std::string getDeExcitationString() const { return deExcitationString; }
0191 
0192     /// \brief Get the clustering algorithm.
0193     ClusterAlgorithmType getClusterAlgorithm() const { return clusterAlgorithmType; }
0194 
0195     /// \brief Set the clustering algorithm.
0196     void setClusterAlgorithm(ClusterAlgorithmType const c) { clusterAlgorithmType = c; }
0197 
0198     /// \brief Get the maximum mass for production of clusters.
0199     G4int getClusterMaxMass() const { return clusterMaxMass; }
0200 
0201     /// \brief Set the maximum mass for production of clusters.
0202     void setClusterMaxMass(const G4int clm){ clusterMaxMass=clm; }
0203 
0204     /// \brief Get back-to-spectator
0205     G4bool getBackToSpectator() const { return backToSpectator; }
0206 
0207     /// \brief Set back-to-spectator
0208     void setBackToSpectator(const G4bool b) { backToSpectator = b; }
0209 
0210     /// \brief Whether to use real masses
0211     G4bool getUseRealMasses() const { return useRealMasses; }
0212 
0213     /// \brief Set whether to use real masses
0214     void setUseRealMasses(G4bool use) { useRealMasses = use; }
0215 
0216     /// \brief Set the INCLXX datafile path
0217     void setINCLXXDataFilePath(std::string const &path) { INCLXXDataFilePath=path; }
0218     
0219     /// \brief Set the ABLAXX datafile path
0220 #ifdef INCL_DEEXCITATION_ABLAXX
0221     void setABLAXXDataFilePath(std::string const &path) { ablaxxDataFilePath=path; }
0222 #endif    
0223 
0224     std::string const &getINCLXXDataFilePath() const {
0225       return INCLXXDataFilePath;
0226     }
0227 
0228 #ifdef INCL_DEEXCITATION_ABLAXX
0229     std::string const &getABLAXXDataFilePath() const {
0230       return ablaxxDataFilePath;
0231     }
0232 #endif
0233 
0234 #ifdef INCL_DEEXCITATION_ABLA07
0235     std::string const &getABLA07DataFilePath() const {
0236       return abla07DataFilePath;
0237     }
0238 #endif
0239 #ifdef INCL_DEEXCITATION_GEMINIXX
0240     std::string const &getGEMINIXXDataFilePath() const {
0241       return geminixxDataFilePath;
0242     }
0243 #endif
0244 
0245     G4double getImpactParameter() const { return impactParameter; }
0246 
0247     /// \brief Get the separation-energy type
0248     SeparationEnergyType getSeparationEnergyType() const { return separationEnergyType; }
0249 
0250     /// \brief Get the Fermi-momentum type
0251     FermiMomentumType getFermiMomentumType() const { return fermiMomentumType; }
0252 
0253     /// \brief Set the Fermi-momentum type
0254     void setFermiMomentumType(FermiMomentumType const f) { fermiMomentumType=f; }
0255 
0256     /// \brief Get the Fermi momentum
0257     G4double getFermiMomentum() const { return fermiMomentum; }
0258 
0259     /// \brief Set the Fermi momentum
0260     void setFermiMomentum(const G4double p) { fermiMomentum = p; }
0261 
0262     G4double getCutNN() const { return cutNN; }
0263 
0264 #ifdef INCL_ROOT_USE
0265     std::string const &getROOTSelectionString() const {
0266       return rootSelectionString;
0267     }
0268 #endif
0269 
0270 #ifdef INCL_DEEXCITATION_FERMI_BREAKUP
0271     G4int getMaxMassFermiBreakUp() const {
0272       return maxMassFermiBreakUp;
0273     }
0274 
0275     G4int getMaxChargeFermiBreakUp() const {
0276       return maxChargeFermiBreakUp;
0277     }
0278 #endif
0279 
0280     /// \brief Get the r-p correlation coefficient
0281     G4double getRPCorrelationCoefficient(const ParticleType t) const {
0282 // assert(t==Proton || t==Neutron);
0283       return ((t==Proton) ? rpCorrelationCoefficientProton : rpCorrelationCoefficientNeutron);
0284     }
0285 
0286     /// \brief Set the r-p correlation coefficient
0287     void setRPCorrelationCoefficient(const ParticleType t, const G4double corrCoeff) {
0288 // assert(t==Proton || t==Neutron);
0289       if(t==Proton)
0290         rpCorrelationCoefficientProton=corrCoeff;
0291       else
0292         rpCorrelationCoefficientNeutron=corrCoeff;
0293     }
0294 
0295     /// \brief Set the r-p correlation coefficient
0296     void setRPCorrelationCoefficient(const G4double corrCoeff) {
0297       setRPCorrelationCoefficient(Proton,corrCoeff);
0298       setRPCorrelationCoefficient(Neutron,corrCoeff);
0299     }
0300 
0301     /// \brief Get the neutron-skin thickness
0302     G4double getNeutronSkin() const { return neutronSkin; }
0303 
0304     /// \brief Set the neutron-skin thickness
0305     void setNeutronSkin(const G4double d) { neutronSkin=d; }
0306 
0307     /// \brief Get the neutron-halo size
0308     G4double getNeutronHalo() const { return neutronHalo; }
0309 
0310     /// \brief Set the neutron-halo size
0311     void setNeutronHalo(const G4double d) { neutronHalo=d; }
0312 
0313     /// \brief True if we should use refraction
0314     G4bool getRefraction() const { return refraction; }
0315 
0316     /// \brief Set the refraction variable
0317     void setRefraction(const G4bool r) { refraction = r; }
0318 
0319     /// \brief Get the RNG type
0320     RNGType getRNGType() const { return rngType; }
0321 
0322     /// \brief Set the RNG type
0323     void setRNGType(RNGType const r) { rngType=r; }
0324 
0325     /// \brief Get the phase-space-generator type
0326     PhaseSpaceGeneratorType getPhaseSpaceGeneratorType() const { return phaseSpaceGeneratorType; }
0327 
0328     /// \brief Set the phase-space-generator type
0329     void setPhaseSpaceGeneratorType(PhaseSpaceGeneratorType const p) { phaseSpaceGeneratorType=p; }
0330 
0331     /// \brief Get the cascade-action type
0332     CascadeActionType getCascadeActionType() const { return cascadeActionType; }
0333 
0334     /// \brief Set the cascade-action type
0335     void setCascadeActionType(CascadeActionType const c) { cascadeActionType=c; }
0336 
0337     /// \brief Get the autosave frequency
0338     unsigned int getAutosaveFrequency() const { return autosaveFrequency; }
0339 
0340     /// \brief Set the autosave frequency
0341     void setAutosaveFrequency(const unsigned int f) { autosaveFrequency=f; }
0342 
0343     /// \brief Get the Cross Section type
0344     CrossSectionsType getCrossSectionsType() const { return crossSectionsType; }
0345 
0346     /// \brief Get the maximum number of pions for multipion collisions
0347     G4int getMaxNumberMultipions() const { return maxNumberMultipions; }
0348 
0349     /// \brief Set the maximum number of pions for multipion collisions
0350     void setMaxNumberMultipions(const G4int n) { maxNumberMultipions=n; }
0351 
0352     /// \brief Set the Cross Section type
0353     void setCrossSectionsType(CrossSectionsType const c) { crossSectionsType=c; }
0354 
0355     /// \brief Get the hadronization time
0356     G4double getHadronizationTime() const { return hadronizationTime; }
0357 
0358     /// \brief Set the hadronization time
0359     void setHadronizationTime(const G4double t) { hadronizationTime=t; }
0360 
0361 #ifdef INCL_ROOT_USE
0362     G4bool getConciseROOTTree() const { return conciseROOTTree; }
0363 #endif
0364 
0365     G4bool getInverseKinematics() const { return inverseKinematics; }
0366     
0367     G4bool getsrcPairConfig() const { return srcPairCorrelations; }
0368     
0369     G4float getsrcPairDist() const { return srcPairDistance; }
0370 
0371     /// \brief Get the decay time threshold time
0372     G4double getDecayTimeThreshold() const { return decayTimeThreshold; }
0373 
0374     /// \brief Set decay time threshold time
0375     void setDecayTimeThreshold(const G4double t) { decayTimeThreshold=t; }
0376 
0377     /// \brief Get the bias
0378     G4double getBias() const { return bias; }
0379 
0380     /// \brief Get the pbar at rest annihilation threshold
0381     G4double getAtrestThreshold() const { return atrestThreshold; }
0382 
0383     /// \brief Set the pbar at rest annihilation threshold
0384     void setAtrestThreshold(const G4double t) { atrestThreshold=t; }
0385 
0386   private:
0387 
0388     G4int verbosity;
0389     std::string inputFileName;
0390     std::string title;
0391     std::string outputFileRoot;
0392     std::string fileSuffix;
0393     std::string logFileName;
0394 
0395     G4int nShots;
0396 
0397     std::string targetString;
0398     ParticleSpecies targetSpecies;
0399     G4bool naturalTarget;
0400 
0401     std::string projectileString;
0402     ParticleSpecies projectileSpecies;
0403     G4double projectileKineticEnergy;
0404 
0405     G4int verboseEvent;
0406 
0407     std::string randomSeeds;
0408     Random::SeedVector randomSeedVector;
0409 
0410     std::string pauliString;
0411     PauliType pauliType;
0412     G4bool CDPP;
0413 
0414     std::string coulombString;
0415     CoulombType coulombType;
0416 
0417     std::string potentialString;
0418     PotentialType potentialType;
0419     G4bool pionPotential;
0420 
0421     std::string localEnergyBBString;
0422     LocalEnergyType localEnergyBBType;
0423 
0424     std::string localEnergyPiString;
0425     LocalEnergyType localEnergyPiType;
0426 
0427     std::string deExcitationModelList;
0428     std::string deExcitationOptionDescription;
0429     std::string deExcitationString;
0430     DeExcitationType deExcitationType;
0431 #ifdef INCL_DEEXCITATION_ABLAXX
0432     std::string ablaxxDataFilePath;
0433 #endif
0434 #ifdef INCL_DEEXCITATION_ABLA07
0435     std::string abla07DataFilePath;
0436 #endif
0437 #ifdef INCL_DEEXCITATION_GEMINIXX
0438     std::string geminixxDataFilePath;
0439 #endif
0440     std::string INCLXXDataFilePath;
0441 
0442     std::string clusterAlgorithmString;
0443     ClusterAlgorithmType clusterAlgorithmType;
0444 
0445     G4int clusterMaxMass;
0446 
0447     G4bool backToSpectator;
0448 
0449     G4bool useRealMasses;
0450 
0451     G4double impactParameter;
0452 
0453     std::string separationEnergyString;
0454     SeparationEnergyType separationEnergyType;
0455 
0456     std::string fermiMomentumString;
0457     FermiMomentumType fermiMomentumType;
0458 
0459     G4double fermiMomentum;
0460 
0461     G4double cutNN;
0462 
0463     G4bool ann;
0464     
0465     G4double bias;
0466 
0467     G4double atrestThreshold;
0468 
0469 #ifdef INCL_ROOT_USE
0470     std::string rootSelectionString;
0471 #endif
0472 
0473 #ifdef INCL_DEEXCITATION_FERMI_BREAKUP
0474     G4int maxMassFermiBreakUp;
0475     G4int maxChargeFermiBreakUp;
0476 #endif
0477 
0478     G4double rpCorrelationCoefficient;
0479     G4double rpCorrelationCoefficientProton;
0480     G4double rpCorrelationCoefficientNeutron;
0481 
0482     G4double neutronSkin;
0483     G4double neutronHalo;
0484 
0485     G4bool refraction;
0486 
0487     std::string randomNumberGenerator;
0488     RNGType rngType;
0489 
0490     std::string phaseSpaceGenerator;
0491     PhaseSpaceGeneratorType phaseSpaceGeneratorType;
0492 
0493     unsigned int autosaveFrequency;
0494 
0495     std::string crossSectionsString;
0496     CrossSectionsType crossSectionsType;
0497     G4int maxNumberMultipions;
0498 
0499     std::string cascadeAction;
0500     CascadeActionType cascadeActionType;
0501 
0502     G4double hadronizationTime;
0503 
0504 #ifdef INCL_ROOT_USE
0505     G4bool conciseROOTTree;
0506 #endif
0507 
0508     G4bool inverseKinematics;
0509     
0510     G4bool srcPairCorrelations;
0511     
0512     G4float srcPairDistance;
0513 
0514     G4double decayTimeThreshold;
0515 
0516     friend class ::ConfigParser;
0517   };
0518 
0519 }
0520 
0521 #endif