Back to home page

EIC code displayed by LXR

 
 

    


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

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 #ifndef G4HadronicDeveloperParameters_h
0027 #define G4HadronicDeveloperParameters_h
0028 
0029 #include "globals.hh"
0030 
0031 #include<map>
0032 #include<string>
0033 #include<cfloat>
0034 
0035 
0036 class G4HadronicDeveloperParameters
0037 {
0038    public:
0039       static G4HadronicDeveloperParameters& GetInstance();
0040 
0041    //protected:
0042    private:
0043       G4HadronicDeveloperParameters();
0044       G4HadronicDeveloperParameters( const G4HadronicDeveloperParameters& );
0045       G4HadronicDeveloperParameters &operator=( const G4HadronicDeveloperParameters& );
0046 
0047    public:
0048       G4bool Set( const std::string name , const G4bool );
0049       G4bool Set( const std::string name , const G4int );
0050       G4bool Set( const std::string name , const G4double );
0051       G4bool GetDefault( const std::string name , G4bool& value );
0052       G4bool GetDefault( const std::string name , G4int& value );
0053       G4bool GetDefault( const std::string name , G4double& value );
0054       G4bool Get( const std::string name , G4bool& value );
0055       G4bool Get( const std::string name , G4int& value );
0056       G4bool Get( const std::string name , G4double& value );
0057       G4bool DeveloperGet( const std::string name , G4bool& value );
0058       G4bool DeveloperGet( const std::string name , G4int& value );
0059       G4bool DeveloperGet( const std::string name , G4double& value );
0060       void Dump( const std::string name );
0061 
0062    //protected:
0063    public:
0064       G4bool SetDefault( const std::string name , const G4bool value );
0065       G4bool SetDefault( const std::string name , const G4int value , G4int lower_limit = -INT_MAX , G4int upper_limit = INT_MAX );
0066       G4bool SetDefault( const std::string name , const G4double value , G4double lower_limit = -DBL_MAX , G4double upper_limit = DBL_MAX );
0067 
0068    private:
0069       G4bool get( const std::string name , G4bool& value , G4bool check_change = false );
0070       G4bool get( const std::string name , G4int& value , G4bool check_change = false );
0071       G4bool get( const std::string name , G4double& value , G4bool check_change= false );
0072 
0073       std::map<std::string,G4bool> b_values;
0074       std::map<std::string,const G4bool> b_defaults;
0075 
0076       std::map<std::string,G4int> i_values;
0077       std::map<std::string,const G4int> i_defaults;
0078       std::map<std::string,std::pair<const G4int,const G4int>> i_limits;
0079 
0080       std::map<std::string,G4double> values;
0081       std::map<std::string,const G4double> defaults;
0082       std::map<std::string,std::pair<const G4double,const G4double>> limits;
0083 
0084       G4bool check_value_within_limits( std::pair<const G4double,const G4double>& , G4double );
0085       G4bool check_value_within_limits( std::pair<const G4int,const G4int>& , G4int );
0086 
0087       void issue_no_param( const std::string& name );
0088       void issue_has_changed( const std::string& name );
0089       void issue_non_eligible_value( const std::string& name );
0090       void issue_is_already_defined( const std::string& name );
0091       void issue_is_modified( const std::string& name );
0092 };
0093 
0094 #endif