Back to home page

EIC code displayed by LXR

 
 

    


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

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 // Encapsulate all user-configurable parameters with associated envvars
0027 //
0028 // 20120912  M. Kelsey -- Add interface to support UI commands
0029 // 20130304  M. Kelsey -- Add flag to collect and display cascade structure
0030 // 20130308  M. Kelsey -- Add flag to use separate 3-body momentum generators
0031 // 20130421  M. Kelsey -- Add flag for CHECK_ECONS, replacing #ifdef's
0032 // 20130702  M. Kelsey -- Add flag to use N-body phase-space generator
0033 // 20140311  G. Cosmo -- Implement standard (non-const) singleton pattern
0034 // 20141030  M. Kelsey -- Add flag to enable direct pi-N absorption
0035 // 20141211  M. Kelsey -- Change PIN_ABSORPTION flag to double, for energy cut
0036 
0037 #ifndef G4CascadeParameters_hh
0038 #define G4CascadeParameters_hh 1
0039 
0040 #include "globals.hh"
0041 #include <iosfwd>
0042 
0043 class G4CascadeParamMessenger;
0044 
0045 
0046 class G4CascadeParameters {
0047 public:
0048   static const G4CascadeParameters* Instance();     // Singleton
0049   ~G4CascadeParameters();
0050 
0051   // Top-level configuration flags
0052   static G4int verbose()              { return Instance()->VERBOSE_LEVEL; }
0053   static G4bool checkConservation()   { return Instance()->CHECK_ECONS; }
0054   static G4bool usePreCompound()      { return Instance()->USE_PRECOMPOUND; }
0055   static G4bool useAbla()             { return Instance()->USE_ABLA; }
0056   static G4bool doCoalescence()       { return Instance()->DO_COALESCENCE; }
0057   static G4bool showHistory()         { return Instance()->SHOW_HISTORY; }
0058   static G4bool use3BodyMom()         { return Instance()->USE_3BODYMOM; }
0059   static G4bool usePhaseSpace()       { return Instance()->USE_PHASESPACE; }
0060   static G4double piNAbsorption()     { return Instance()->PIN_ABSORPTION; }
0061   static const G4String& randomFile() { return Instance()->RANDOM_FILE; }
0062 
0063   // Nuclear structure parameters
0064   static G4bool useTwoParam()      { return Instance()->TWOPARAM_RADIUS; }
0065   static G4double radiusScale()    { return Instance()->RADIUS_SCALE; } 
0066   static G4double radiusSmall()    { return Instance()->RADIUS_SMALL; }
0067   static G4double radiusAlpha()    { return Instance()->RADIUS_ALPHA; }
0068   static G4double radiusTrailing() { return Instance()->RADIUS_TRAILING; }
0069   static G4double fermiScale()     { return Instance()->FERMI_SCALE; }
0070   static G4double xsecScale()      { return Instance()->XSEC_SCALE; }
0071   static G4double gammaQDScale()   { return Instance()->GAMMAQD_SCALE; }
0072 
0073   // Final-state clustering cuts
0074   static G4double dpMaxDoublet() { return Instance()->DPMAX_DOUBLET; }
0075   static G4double dpMaxTriplet() { return Instance()->DPMAX_TRIPLET; }
0076   static G4double dpMaxAlpha()   { return Instance()->DPMAX_ALPHA; }
0077 
0078   static void DumpConfiguration(std::ostream& os) { Instance()->DumpConfig(os); }
0079 
0080 private:    // Environment variable values, null pointers mean not set
0081   const char* G4CASCADE_VERBOSE;
0082   const char* G4CASCADE_CHECK_ECONS;
0083   const char* G4CASCADE_USE_PRECOMPOUND;
0084   const char* G4CASCADE_USE_ABLA;
0085   const char* G4CASCADE_DO_COALESCENCE;
0086   const char* G4CASCADE_SHOW_HISTORY;
0087   const char* G4CASCADE_USE_3BODYMOM;
0088   const char* G4CASCADE_USE_PHASESPACE;
0089   const char* G4CASCADE_PIN_ABSORPTION;
0090   const char* G4CASCADE_RANDOM_FILE;
0091   const char* G4NUCMODEL_USE_BEST;
0092   const char* G4NUCMODEL_RAD_2PAR;
0093   const char* G4NUCMODEL_RAD_SCALE;
0094   const char* G4NUCMODEL_RAD_SMALL;
0095   const char* G4NUCMODEL_RAD_ALPHA;
0096   const char* G4NUCMODEL_RAD_TRAILING;
0097   const char* G4NUCMODEL_FERMI_SCALE;
0098   const char* G4NUCMODEL_XSEC_SCALE;
0099   const char* G4NUCMODEL_GAMMAQD;
0100   const char* DPMAX_2CLUSTER;
0101   const char* DPMAX_3CLUSTER;
0102   const char* DPMAX_4CLUSTER;
0103 
0104   void Initialize();        // Fill parameter values from envvar strings
0105 
0106   G4int VERBOSE_LEVEL;      // Top-level configuration flags
0107   G4bool CHECK_ECONS;
0108   G4bool USE_PRECOMPOUND;
0109   G4bool USE_ABLA;
0110   G4bool DO_COALESCENCE;
0111   G4bool SHOW_HISTORY;
0112   G4bool USE_3BODYMOM;
0113   G4bool USE_PHASESPACE;
0114   G4double PIN_ABSORPTION;
0115   G4String RANDOM_FILE;
0116 
0117   G4bool BEST_PAR;      // Nuclear structure parameters
0118 //BEST_PAR has been used in a project on hold.
0119 //Currently setting BEST_PAR or G4NUCMODEL_USE_BEST does not improve physics performance.
0120 //Developer can get more information about this from cascade/test/README
0121 
0122   G4bool TWOPARAM_RADIUS;
0123   G4double RADIUS_SCALE;    
0124   G4double RADIUS_SMALL;
0125   G4double RADIUS_ALPHA;
0126   G4double RADIUS_TRAILING;
0127   G4double FERMI_SCALE;
0128   G4double XSEC_SCALE;
0129   G4double GAMMAQD_SCALE;
0130 
0131   G4double DPMAX_DOUBLET;   // Final-state clustering cuts
0132   G4double DPMAX_TRIPLET;
0133   G4double DPMAX_ALPHA;
0134 
0135 private:    // Singleton -- no public constructor
0136   G4CascadeParameters();
0137   void DumpConfig(std::ostream& os) const;
0138 
0139   G4CascadeParamMessenger* messenger;       // For access via UI commands
0140   friend class G4CascadeParamMessenger;
0141 };
0142 
0143 #endif  /* G4CascadeParameters_hh */