Back to home page

EIC code displayed by LXR

 
 

    


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

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 
0027 #ifndef G4ParticleHPManager_h
0028 #define G4ParticleHPManager_h 1
0029 
0030 // 121031 First implementation done by T. Koi (SLAC/PPA)
0031 // P. Arce, June-2014 Conversion neutron_hp to particle_hp
0032 // V. Ivanchenko, July-2023 Basic revision of particle HP classes
0033 //
0034 #include "G4ParticleHPReactionWhiteBoard.hh"
0035 #include "globals.hh"
0036 
0037 #include <map>
0038 #include <vector>
0039 
0040 class G4ParticleDefinition;
0041 class G4ParticleHPChannel;
0042 class G4ParticleHPChannelList;
0043 class G4ParticleHPMessenger;
0044 class G4ParticleHPVector;
0045 class G4PhysicsTable;
0046 struct E_isoAng;
0047 struct E_P_E_isoAng;
0048 
0049 class G4ParticleHPManager
0050 {
0051   public:
0052     static G4ParticleHPManager* GetInstance();
0053     ~G4ParticleHPManager();
0054 
0055     G4ParticleHPReactionWhiteBoard* GetReactionWhiteBoard();
0056     void OpenReactionWhiteBoard();
0057     void CloseReactionWhiteBoard();
0058 
0059     void GetDataStream(const G4String&, std::istringstream& iss);
0060     void GetDataStream2(const G4String&, std::istringstream& iss);
0061     void SetVerboseLevel(G4int i);
0062     G4int GetVerboseLevel() const { return verboseLevel; };
0063 
0064     void DumpDataSource();
0065 
0066     G4bool GetUseOnlyPhotoEvaporation() const { return USE_ONLY_PHOTONEVAPORATION; };
0067     G4bool GetSkipMissingIsotopes() const { return SKIP_MISSING_ISOTOPES; };
0068     G4bool GetNeglectDoppler() const { return NEGLECT_DOPPLER; };
0069     G4bool GetDoNotAdjustFinalState() const { return DO_NOT_ADJUST_FINAL_STATE; };
0070     G4bool GetProduceFissionFragments() const { return PRODUCE_FISSION_FRAGMENTS; };
0071     G4bool GetUseWendtFissionModel() const { return USE_WENDT_FISSION_MODEL; };
0072     G4bool GetUseNRESP71Model() const { return USE_NRESP71_MODEL; };
0073     G4bool GetUseDBRC() const { return USE_DBRC; };
0074     G4bool GetCheckHPNames() const { return CHECK_HP_NAMES; };
0075     G4bool GetPHPCheck() const { return PHP_CHECK; };
0076     G4bool GetPHCUsePoisson() const { return PHP_USE_POISSON; };
0077     G4bool GetDEBUG() const { return DEBUG; };
0078 
0079     const G4String& GetNeutronHPPath() const { return fDataPath[0]; }; 
0080     const G4String& GetParticleHPPath(const G4ParticleDefinition*) const;
0081     G4int GetPHPIndex(const G4ParticleDefinition*) const;
0082 
0083     void SetUseOnlyPhotoEvaporation(G4bool val) { USE_ONLY_PHOTONEVAPORATION = val; };
0084     void SetSkipMissingIsotopes(G4bool val) { SKIP_MISSING_ISOTOPES = val; };
0085     void SetNeglectDoppler(G4bool val) { NEGLECT_DOPPLER = val; };
0086     void SetDoNotAdjustFinalState(G4bool val) { DO_NOT_ADJUST_FINAL_STATE = val; };
0087     void SetProduceFissionFragments(G4bool val)
0088     {
0089       // Make sure both fission fragment models are not active at same time
0090       PRODUCE_FISSION_FRAGMENTS = USE_WENDT_FISSION_MODEL ? false : val;
0091     };
0092     void SetUseWendtFissionModel(G4bool val)
0093     {
0094       USE_WENDT_FISSION_MODEL = val;
0095       // Make sure both fission fragment models are not active at same time
0096       if (USE_WENDT_FISSION_MODEL) PRODUCE_FISSION_FRAGMENTS = false;
0097     };
0098     void SetUseNRESP71Model(G4bool val) { USE_NRESP71_MODEL = val; };
0099     void SetUseDBRC(G4bool val) { USE_DBRC = val; };
0100 
0101     void DumpSetting();
0102 
0103     void RegisterElasticCrossSections(G4PhysicsTable* val) { theElasticCrossSections = val; };
0104     G4PhysicsTable* GetElasticCrossSections() const { return theElasticCrossSections; };
0105     void RegisterCaptureCrossSections(G4PhysicsTable* val) { theCaptureCrossSections = val; };
0106     G4PhysicsTable* GetCaptureCrossSections() const { return theCaptureCrossSections; };
0107     void RegisterInelasticCrossSections(const G4ParticleDefinition* part, G4PhysicsTable* ptr)
0108     {
0109       theInelasticCrossSections[GetPHPIndex(part)] = ptr;
0110     };
0111     G4PhysicsTable* GetInelasticCrossSections(const G4ParticleDefinition* part) const
0112     {
0113       return theInelasticCrossSections[GetPHPIndex(part)];
0114     };
0115     void RegisterFissionCrossSections(G4PhysicsTable* val) { theFissionCrossSections = val; };
0116     G4PhysicsTable* GetFissionCrossSections() const { return theFissionCrossSections; };
0117 
0118     std::vector<G4ParticleHPChannel*>* GetElasticFinalStates() const { return theElasticFSs; };
0119     void RegisterElasticFinalStates(std::vector<G4ParticleHPChannel*>* val)
0120     {
0121       theElasticFSs = val;
0122     };
0123 
0124     std::vector<G4ParticleHPChannelList*>*
0125     GetInelasticFinalStates(const G4ParticleDefinition* part) const
0126     {
0127       return theInelasticFSs[GetPHPIndex(part)];
0128     };
0129     void RegisterInelasticFinalStates(const G4ParticleDefinition* part,
0130                                       std::vector<G4ParticleHPChannelList*>* ptr)
0131     {
0132       theInelasticFSs[GetPHPIndex(part)] = ptr;
0133     };
0134 
0135     std::vector<G4ParticleHPChannel*>* GetCaptureFinalStates() const { return theCaptureFSs; };
0136     void RegisterCaptureFinalStates(std::vector<G4ParticleHPChannel*>* val)
0137     {
0138       theCaptureFSs = val;
0139     };
0140     std::vector<G4ParticleHPChannel*>* GetFissionFinalStates() const { return theFissionFSs; };
0141     void RegisterFissionFinalStates(std::vector<G4ParticleHPChannel*>* val)
0142     {
0143       theFissionFSs = val;
0144     };
0145 
0146     std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>*
0147     GetThermalScatteringCoherentCrossSections() const
0148     {
0149       return theTSCoherentCrossSections;
0150     };
0151     void RegisterThermalScatteringCoherentCrossSections(
0152       std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* val)
0153     {
0154       theTSCoherentCrossSections = val;
0155     };
0156     std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>*
0157     GetThermalScatteringIncoherentCrossSections() const
0158     {
0159       return theTSIncoherentCrossSections;
0160     };
0161     void RegisterThermalScatteringIncoherentCrossSections(
0162       std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* val)
0163     {
0164       theTSIncoherentCrossSections = val;
0165     };
0166     std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>*
0167     GetThermalScatteringInelasticCrossSections() const
0168     {
0169       return theTSInelasticCrossSections;
0170     };
0171     void RegisterThermalScatteringInelasticCrossSections(
0172       std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* val)
0173     {
0174       theTSInelasticCrossSections = val;
0175     };
0176 
0177     std::map<G4int, std::map<G4double, std::vector<std::pair<G4double, G4double>*>*>*>*
0178     GetThermalScatteringCoherentFinalStates() const
0179     {
0180       return theTSCoherentFinalStates;
0181     };
0182     void RegisterThermalScatteringCoherentFinalStates(
0183       std::map<G4int, std::map<G4double, std::vector<std::pair<G4double, G4double>*>*>*>* val)
0184     {
0185       theTSCoherentFinalStates = val;
0186     };
0187     std::map<G4int, std::map<G4double, std::vector<E_isoAng*>*>*>*
0188     GetThermalScatteringIncoherentFinalStates() const
0189     {
0190       return theTSIncoherentFinalStates;
0191     };
0192     void RegisterThermalScatteringIncoherentFinalStates(
0193       std::map<G4int, std::map<G4double, std::vector<E_isoAng*>*>*>* val)
0194     {
0195       theTSIncoherentFinalStates = val;
0196     };
0197     std::map<G4int, std::map<G4double, std::vector<E_P_E_isoAng*>*>*>*
0198     GetThermalScatteringInelasticFinalStates() const
0199     {
0200       return theTSInelasticFinalStates;
0201     };
0202     void RegisterThermalScatteringInelasticFinalStates(
0203       std::map<G4int, std::map<G4double, std::vector<E_P_E_isoAng*>*>*>* val)
0204     {
0205       theTSInelasticFinalStates = val;
0206     };
0207 
0208     G4double GetMinADBRC() const { return theMinADBRC; };
0209     G4double GetMinEnergyDBRC() const { return theMinEnergyDBRC; };
0210     G4double GetMaxEnergyDBRC() const { return theMaxEnergyDBRC; };
0211     G4double GetMaxEnergyDoppler() const { return theMaxEnergyDoppler; };
0212 
0213     void SetMinADBRC(G4double val) { theMinADBRC = val; };
0214     void SetMinEnergyDBRC(G4double val) { theMinEnergyDBRC = val; };
0215     void SetMaxEnergyDBRC(G4double val) { theMaxEnergyDBRC = val; };
0216     void SetMaxEnergyDoppler(G4double val) { theMaxEnergyDoppler = val; };
0217 
0218     G4ParticleHPManager(G4ParticleHPManager &) = delete;
0219     G4ParticleHPManager & operator=(const G4ParticleHPManager &right) = delete;
0220 
0221   private:
0222     G4ParticleHPManager();
0223     void register_data_file(const G4String&, const G4String&);
0224 
0225     static G4ParticleHPManager* instance;
0226 
0227     std::map<G4String, G4String> mDataEvaluation;
0228 
0229     G4int verboseLevel{1};
0230 
0231     G4ParticleHPMessenger* messenger;
0232     G4bool USE_ONLY_PHOTONEVAPORATION{false};
0233     G4bool SKIP_MISSING_ISOTOPES{false};
0234     G4bool NEGLECT_DOPPLER{false};
0235     G4bool DO_NOT_ADJUST_FINAL_STATE{false};
0236     G4bool PRODUCE_FISSION_FRAGMENTS{false};
0237     G4bool USE_WENDT_FISSION_MODEL{false};
0238     G4bool USE_NRESP71_MODEL{false};
0239     G4bool USE_DBRC{false};
0240     G4bool CHECK_HP_NAMES{false};
0241     G4bool PHP_CHECK{true};
0242     G4bool PHP_USE_POISSON{false};
0243     G4bool DEBUG{false};
0244     G4bool isPrinted{false};
0245 
0246     G4PhysicsTable* theElasticCrossSections{nullptr};
0247     G4PhysicsTable* theCaptureCrossSections{nullptr};
0248     G4PhysicsTable* theInelasticCrossSections[6]{nullptr};
0249     G4PhysicsTable* theFissionCrossSections{nullptr};
0250 
0251     std::vector<G4ParticleHPChannel*>* theElasticFSs{nullptr};
0252     std::vector<G4ParticleHPChannelList*>* theInelasticFSs[6]{nullptr};
0253     std::vector<G4ParticleHPChannel*>* theCaptureFSs{nullptr};
0254     std::vector<G4ParticleHPChannel*>* theFissionFSs{nullptr};
0255 
0256     std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* theTSCoherentCrossSections{nullptr};
0257     std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* theTSIncoherentCrossSections{
0258       nullptr};
0259     std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* theTSInelasticCrossSections{nullptr};
0260 
0261     std::map<G4int, std::map<G4double, std::vector<std::pair<G4double, G4double>*>*>*>*
0262       theTSCoherentFinalStates{nullptr};
0263     std::map<G4int, std::map<G4double, std::vector<E_isoAng*>*>*>* theTSIncoherentFinalStates{
0264       nullptr};
0265     std::map<G4int, std::map<G4double, std::vector<E_P_E_isoAng*>*>*>* theTSInelasticFinalStates{
0266       nullptr};
0267 
0268     G4double theMinADBRC{200.};
0269     G4double theMinEnergyDBRC;
0270     G4double theMaxEnergyDBRC;
0271     G4double theMaxEnergyDoppler;
0272 
0273     G4String fDataPath[6]{""};
0274 };
0275 #endif