]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STARLIGHT/starlight/include/inputParameters.h
Updated STARLIGHT from r176 ro r188 (http://starlight.hepforge.org/svn/)
[u/mrichter/AliRoot.git] / STARLIGHT / starlight / include / inputParameters.h
index fc0ec98d13218e24cd1320460d3000049253763b..34d8cc113a229fbd0006d239a52deaf844429693 100644 (file)
@@ -20,9 +20,9 @@
 ///////////////////////////////////////////////////////////////////////////
 //
 // File and Version Information:
-// $Rev:: 176                         $: revision of last commit
-// $Author:: jseger                   $: author of last commit
-// $Date:: 2014-06-20 22:15:20 +0200 #$: date of last commit
+// $Rev:: 181                         $: revision of last commit
+// $Author:: jnystrand                $: author of last commit
+// $Date:: 2014-09-12 00:37:55 +0200 #$: date of last commit
 //
 // Description:
 //
@@ -78,6 +78,7 @@ public:
         _parameters.add(this);
     }
     virtual ~parameterbase() {}
+
     virtual std::string validationkey() = 0;
 
     template<typename T>
@@ -107,17 +108,9 @@ class parameter : public parameterbase
 public:
 
     // Constructor
-    parameter(const std::string& name_,
-             T value_,
-             bool required_ = true) 
-      :parameterbase()
-      ,_name(name_)
-      , _value(value_)
-      , _validate(validate)
-      , _required(required_) {}
-
-      virtual ~parameter() {}
+    parameter(const std::string &name, T value, bool required = true) :parameterbase(),_name(name), _value(value), _validate(validate), _required(required) {}
 
+    virtual ~parameter() {}
 //     T operator()() const {
 //         return _value;
 //     }
@@ -135,7 +128,7 @@ public:
     
     void setValue(T v) { _value = v; }
     
-    void setName(std::string name_) { _name = name_; }
+    void setName(std::string name) { _name = name; }
     
     void setRequired(bool r) { _required = r; }
     
@@ -146,7 +139,7 @@ public:
     }
 
     template<typename S, bool v>
-    friend std::ostream& operator<<(std::ostream& os, const parameter<S,v>& par);
+    inline friend std::ostream& operator<<(std::ostream& os, const parameter<S,v>& par);
 
 
 
@@ -187,12 +180,11 @@ class inputParameters {
 private:
        // inputParameters is now a singleton
        friend class Singleton<inputParameters>;
-public:
        inputParameters();
-private:
-       ~inputParameters();
 public:
 
+       ~inputParameters();
+
        bool init();
        bool configureFromFile(const std::string &configFileName = "./config/slight.in");
 
@@ -231,16 +223,6 @@ public:
        std::string  pythiaParams          () const { return _pythiaParams.value();           }  ///< returns parameters to be passed to pythia
        bool         pythiaFullEventRecord () const { return _pythiaFullEventRecord.value();  }  ///< returns if the full pythia event record should be printed
        int          xsecCalcMethod        () const { return _xsecCalcMethod.value();         }  ///< returns the method used for the x-sec calculation
-       int          nThreads              () const { return _nThreads.value();               }  ///< returns the number of threads in case method 1 is used for the x-sec calc
-       unsigned int nBinsQKniehl          () const { return _nBinsQKniehl.value();           }  ///< Number of bins in Q used for the transformation to the impact paramter space of the Kniehl function
-        unsigned int nBinsEKniehl          () const { return _nBinsEKniehl.value();           }  ///< Number of bins in photon energy used for the Kniehl function
-        unsigned int nBinsBKniehl          () const { return _nBinsBKniehl.value();           }  ///< Number of bins in impact parameter used for the Kniehl function
-        double       qMaxKniehl            () const { return _qMaxKniehl.value();             }  ///< Max value of Q used for the Kniehl funcion
-        double       eGammaMinKniehl       () const { return _eGammaMinKniehl.value();        }  ///< Min value of gamma energy used for the Kniehl funcion
-        double       eGammaMaxKniehl       () const { return _eGammaMaxKniehl.value();        }  ///< Max value of gamma energy used for the Kniehl funcion
-        double       bMinKniehl            () const { return _bMinKniehl.value();             }  ///< Min value of impact parameter used for the Kniehl funcion
-        double       bMaxKniehl            () const { return _bMaxKniehl.value();             }  ///< Max value of impact parameter used for the Kniehl funcion
-        
        starlightConstants::particleTypeEnum    prodParticleType     () const { return _particleType;    }  ///< returns type of produced particle
        starlightConstants::decayTypeEnum       prodParticleDecayType() const { return _decayType;       }  ///< returns decay type of produced particle
        starlightConstants::interactionTypeEnum interactionType      () const { return _interactionType; }  ///< returns interaction type
@@ -283,15 +265,6 @@ public:
        void setPythiaParams          (std::string v)  {  _pythiaParams = v;           }  ///< returns parameters to be passed to pythia
        void setPythiaFullEventRecord (bool v)  {  _pythiaFullEventRecord = v;  }  ///< returns if the full pythia event record should be prvoided
        void setXsecCalcMethod        (int v)  {  _xsecCalcMethod = v;         }  ///< returns the method used for the x-sec calculation
-       void setNThreads              (int v)  {  _nThreads = v;               }  ///< returns the number of threads in case method 1 is used for the x-sec calc
-       void setNBinsQKniehl          (unsigned int v)  {  _nBinsQKniehl = v;           }  ///< Number of bins in Q used for the transformation to the impact paramter space of the Kniehl function
-        void setNBinsEKniehl          (unsigned int v)  {  _nBinsEKniehl = v;           }  ///< Number of bins in photon energy used for the Kniehl function
-        void setNBinsBKniehl          (unsigned int v)  {  _nBinsBKniehl = v;           }  ///< Number of bins in impact parameter used for the Kniehl function
-        void setQMaxKniehl            (double v)  {  _qMaxKniehl = v;             }  ///< Max value of Q used for the Kniehl funcion
-        void setEGammaMinKniehl       (double v)  {  _eGammaMinKniehl = v;        }  ///< Min value of gamma energy used for the Kniehl funcion
-        void setEGammaMaxKniehl       (double v)  {  _eGammaMaxKniehl = v;        }  ///< Max value of gamma energy used for the Kniehl funcion
-        void setBMinKniehl            (double v)  {  _bMinKniehl = v;             }  ///< Min value of impact parameter used for the Kniehl funcion
-        void setBMaxKniehl            (double v)  {  _bMaxKniehl = v;             }  ///< Max value of impact parameter used for the Kniehl funcion
         
        void setProdParticleType      (starlightConstants::particleTypeEnum v)   { _particleType = v;    }  ///< returns type of produced particle
        void setProdParticleDecayType (starlightConstants::decayTypeEnum v)        { _decayType = v;       }  ///< returns decay type of produced particle
@@ -301,7 +274,7 @@ public:
        // double slopeParameter();
        void setProtonEnergy        (double v)  { _protonEnergy = v; }
        
-/*     template<typename T> */
+       //      template<typename T>
        inline bool setParameter(std::string expression);
        
        std::ostream& print(std::ostream& out) const;  ///< prints parameter summary
@@ -368,31 +341,21 @@ private:
        parameter<double, VALIDITY_CHECK>          _maxGammaEnergy;          ///< maximum gamma energy in case of photo nuclear processes [GeV]
        parameter<std::string,NO_VALIDITY_CHECK>   _pythiaParams;            ///< semi-colon separated parameters to pass to pythia, e.g. "mstj(1)=0;paru(13)=0.1" 
        parameter<bool, NO_VALIDITY_CHECK>         _pythiaFullEventRecord;   ///< if the full pythia event record should be in the output
-       parameter<unsigned int, VALIDITY_CHECK>    _xsecCalcMethod;          ///< Select x-sec calc method. (0 is standard starlight method, 1 must be used for assym. collisions (e.g. p-A), but is slow)
-       parameter<unsigned int, NO_VALIDITY_CHECK> _nThreads;                ///< Number of threads used in the case of using method 1 for calculating the x-sections
-        parameter<unsigned int, VALIDITY_CHECK>    _nBinsQKniehl;            ///< Number of bins in Q used for the transformation to the impact paramter space of the Kniehl function
-        parameter<unsigned int, VALIDITY_CHECK>    _nBinsEKniehl;            ///< Number of bins in photon energy used for the Kniehl function
-        parameter<unsigned int, VALIDITY_CHECK>    _nBinsBKniehl;            ///< Number of bins in impact parameter used for the Kniehl function
-        parameter<double, VALIDITY_CHECK>          _qMaxKniehl;              ///< Max value of Q used for the Kniehl funcion
-        parameter<double, VALIDITY_CHECK>          _eGammaMinKniehl;         ///< Min value of gamma energy used for the Kniehl funcion
-        parameter<double, VALIDITY_CHECK>          _eGammaMaxKniehl;         ///< Max value of gamma energy used for the Kniehl funcion
-        parameter<double, VALIDITY_CHECK>          _bMinKniehl;              ///< Min value of impact parameter used for the Kniehl funcion
-        parameter<double, VALIDITY_CHECK>          _bMaxKniehl;              ///< Max value of impact parameter used for the Kniehl funcion
-        
-       
+       parameter<unsigned int, VALIDITY_CHECK>    _xsecCalcMethod;          ///< Select x-sec calc method. (0 is standard starlight method, 1 must be used for assym. collisions (e.g. p-A), but is slow)      
+
        starlightConstants::particleTypeEnum       _particleType;
        starlightConstants::decayTypeEnum          _decayType;
        starlightConstants::interactionTypeEnum    _interactionType;
 
        double                         _beamLorentzGamma;                    ///< Lorentz gamma factor of the beams in CMS frame, not an input parameter
        
-       inputParser _ip; //!
+       inputParser _ip;
        
 };
 
 #define inputParametersInstance Singleton<inputParameters>::instance()
 
-/* template<typename T> */
+//template<typename T>
 inline 
 bool inputParameters::setParameter(std::string expression)
 {