Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:14

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 //  Gorad (Geant4 Open-source Radiation Analysis and Design)
0027 //
0028 //  Author : Makoto Asai (SLAC National Accelerator Laboratory)
0029 //
0030 //  Development of Gorad is funded by NASA Johnson Space Center (JSC)
0031 //  under the contract NNJ15HK11B.
0032 //
0033 // ********************************************************************
0034 //
0035 // GRPhysicsList.hh
0036 //   Header file of the Gorad Physics List
0037 //
0038 // History
0039 //   September 8th, 2020 : first implementation
0040 //
0041 // ********************************************************************
0042 
0043 #ifndef GRPhysicsList_H
0044 #define GRPhysicsList_H 1
0045 
0046 #include "G4VModularPhysicsList.hh"
0047 class G4PhysListFactory;
0048 class GRPhysicsListMessenger;
0049 class G4Region;
0050 class G4ProductionCuts;
0051  
0052 #include <map>
0053 
0054 class GRPhysicsList : public G4VModularPhysicsList
0055 {
0056   public:
0057     GRPhysicsList();
0058     virtual ~GRPhysicsList();
0059     virtual void ConstructParticle();
0060     virtual void ConstructProcess();
0061     virtual void SetCuts();
0062 
0063   private:
0064     G4String PLName;
0065     G4VModularPhysicsList* physList;
0066     G4PhysListFactory* factory;
0067     GRPhysicsListMessenger* messenger;
0068 
0069   public:
0070     const G4String& GetPLName()
0071     { return PLName; }
0072 
0073   private:
0074     G4String EM_opt;   // EM physics option
0075     G4String Had_opt;  // Hadronic physics option
0076     G4bool addHP;      // add Neutron_HP
0077     G4bool addRDM;     // add Radioactive Decay Module
0078     G4bool addRMC;      // add Reverse Monte Calro
0079     G4bool addOptical; // add optical physics
0080     G4int stepLimit_opt; // Step limiter option (0:charged, 1:neutral, 2:all, 3:e+/e-)
0081     std::map<G4Region*,G4double> localStepLimits; // map of region name and limit value
0082     G4double globalCuts[4];  // for e-, e+ gamma, proton
0083     std::map<G4Region*,G4ProductionCuts*> localCuts; // map of region name and cuts
0084 
0085   public:
0086     void SetEM(G4String& val) { EM_opt = val; }
0087     const G4String& GetEM() const { return EM_opt; }
0088     void SetHad(G4String& val) { Had_opt = val; }
0089     const G4String& GetHad() const { return Had_opt; }
0090     void AddHP(G4bool val = true) { addHP = val; }
0091     G4bool IfHP() const { return addHP; }
0092     void AddRDM(G4bool val = true) { addRDM = val; }
0093     G4bool IfRDM() const { return addRDM; }
0094     void AddRMC(G4bool val = true) { addRMC = val; }
0095     G4bool IfRMC() const { return addRMC; }
0096     void AddOptical(G4bool val = true) { addOptical = val; }
0097     G4bool IfOptical() const { return addOptical; }
0098     void AddStepLimit(G4int val = 0) { stepLimit_opt = val; }
0099     G4int IfStepLimit() const { return stepLimit_opt; }
0100     void SetGlobalStepLimit(G4double);
0101     G4double GetGlobalStepLimit() const;
0102     G4Region* SetLocalStepLimit(const G4String&,G4double);
0103     G4double GetLocalStepLimit(const G4String&) const;
0104     void SetGlobalCuts(G4double);
0105     G4double GetGlobalCuts() const { return GetGlobalCut(0); }
0106     void SetGlobalCut(G4int, G4double); 
0107     G4double GetGlobalCut(G4int i) const { return globalCuts[i]; }
0108     G4Region* SetLocalCuts(const G4String& reg,G4double val)
0109     {
0110       G4Region* regPtr = nullptr;
0111       for(G4int i=0; i<4; i++)
0112       {
0113         regPtr = SetLocalCut(reg,i,val);
0114         if(!regPtr) return regPtr;
0115       }
0116       return regPtr;
0117     }
0118     G4double GetLocalCuts(const G4String& reg) const { return GetLocalCut(reg,0); }
0119     G4Region* SetLocalCut(const G4String&,G4int,G4double);
0120     G4double GetLocalCut(const G4String&,G4int) const;
0121 
0122   private:
0123     void GeneratePLName();
0124     void GeneratePL();
0125     G4Region* FindRegion(const G4String&) const;
0126 
0127   private:
0128     G4bool applyGeomImpBias = false;
0129 
0130   public:
0131     void ApplyGeomImpBias(G4bool val = true)
0132     { applyGeomImpBias = val; }
0133 };
0134 
0135 #endif
0136