Page MenuHomeHEPForge

No OneTemporary

Index: trunk/include/inputParameters.h
===================================================================
--- trunk/include/inputParameters.h (revision 153)
+++ trunk/include/inputParameters.h (revision 154)
@@ -1,178 +1,404 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright 2010
//
// This file is part of starlight.
//
// starlight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// starlight is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with starlight. If not, see <http://www.gnu.org/licenses/>.
//
///////////////////////////////////////////////////////////////////////////
//
// File and Version Information:
// $Rev:: $: revision of last commit
// $Author:: $: author of last commit
// $Date:: $: date of last commit
//
// Description:
//
//
//
///////////////////////////////////////////////////////////////////////////
#ifndef INPUTPARAMETERS_H
#define INPUTPARAMETERS_H
#include "starlightconstants.h"
+#include "inputParser.h"
#include <string>
-//This is where we read in our input values.
+#include <ostream>
+#include <vector>
+#include <sstream>
+class parameterbase;
+
+
+class parameterlist
+{
+public:
+
+ parameterlist() : _parameters(0) {}
+
+ void add(parameterbase* p) {
+ _parameters.push_back(p);
+ }
+
+ // Returns a string with a key of the current state of the parameter list
+ // only
+ inline std::string validationKey();
+
+
+private:
+
+ std::vector<parameterbase*> _parameters;
+
+};
+
+// Base class for parameters, needed to keep a list of parameters
+class parameterbase
+{
+public:
+
+ // Add this to parameter list
+ parameterbase()
+ {
+ _parameters.add(this);
+ }
+ virtual std::string validationkey() = 0;
+
+ template<typename T>
+ std::string toString(T v)
+ {
+ std::stringstream s;
+ s << v;
+ return s.str();
+ }
+ inline friend std::ostream& operator<<(std::ostream& os, const parameterbase& par);
+
+ // List of all parameters
+ static parameterlist _parameters;
+
+
+
+};
+// Need to init the static variable
+// parameterlist parameterbase::_parameters;
+
+
+// The actual parameter class
+// validate parameter specifies if the parameter should be a part of the validity check of the current parameters
+template<typename T, bool validate>
+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) {}
+
+// T operator()() const {
+// return _value;
+// }
+
+ parameter &operator=(T v) { _value = v; return *this;}
+ T* ptr() const {
+ return const_cast<T*>(&_value);
+ }
+
+ T value() const { return _value; }
+
+ std::string name() const { return _name;}
+
+ bool required() const { return _required; }
+
+ void setValue(T v) { _value = v; }
+
+ void setName(std::string name) { _name = name; }
+
+ void setRequired(bool r) { _required = r; }
+
+ // Validation key for this parameter
+ std::string validationkey()
+ {
+ return (_validate ? _name + ":" + toString(_value) + "-" : std::string(""));
+ }
+
+ template<typename S, bool v>
+ inline friend std::ostream& operator<<(std::ostream& os, const parameter<S,v>& par);
+
+
+
+private:
+ std::string _name;
+
+ T _value; // Value
+ bool _validate; // true if a change in the parameter invalidates x-sec tables
+ bool _required; // true if this is required option.
+
+ parameter();
+};
+
+template<typename S, bool v>
+std::ostream& operator<<(std::ostream& os, const parameter<S,v>& par)
+{
+ os << par._value;
+ return os;
+}
+
+std::ostream& operator<<(std::ostream& os, const parameterbase& par)
+{
+ os << par._parameters.validationKey();
+ return os;
+}
+std::string parameterlist::validationKey()
+{
+ std::stringstream s;
+ for(unsigned int i = 0; i < _parameters.size(); ++i)
+ {
+ s << _parameters[i]->validationkey(); // Will print names and values of validation parameters
+ }
+ return s.str();
+}
class inputParameters {
public:
inputParameters();
~inputParameters();
- bool init(const std::string& configFileName = "./config/slight.in");
+ bool init();
+ bool configureFromFile(const std::string &configFileName = "./config/slight.in");
- unsigned int beam1Z () const { return _beam1Z; } ///< returns atomic number of beam particle 1
- unsigned int beam1A () const { return _beam1A; } ///< returns atomic mass number of beam particle 1
- unsigned int beam2Z () const { return _beam2Z; } ///< returns atomic number of beam particle 2
- unsigned int beam2A () const { return _beam2A; } ///< returns atomic mass number of beam particle 2
+ unsigned int beam1Z () const { return _beam1Z.value(); } ///< returns atomic number of beam particle 1
+ unsigned int beam1A () const { return _beam1A.value(); } ///< returns atomic mass number of beam particle 1
+ unsigned int beam2Z () const { return _beam2Z.value(); } ///< returns atomic number of beam particle 2
+ unsigned int beam2A () const { return _beam2A.value(); } ///< returns atomic mass number of beam particle 2
double beamLorentzGamma () const { return _beamLorentzGamma; } ///< returns Lorentz gamma factor of both beams in beam CMS frame
- double beam1LorentzGamma () const { return _beam1LorentzGamma; } ///< returns Lorentz gamma factor of beam 1 in collider frame
- double beam2LorentzGamma () const { return _beam2LorentzGamma; } ///< returns Lorentz gamma factor of beam 2 in collider frame
- double maxW () const { return _maxW; } ///< returns maximum mass W of produced hadronic system [GeV/c^2]
- double minW () const { return _minW; } ///< returns minimum mass W of produced hadronic system [GeV/c^2]
- unsigned int nmbWBins () const { return _nmbWBins; } ///< returns number of W bins in lookup table
- double maxRapidity () const { return _maxRapidity; } ///< returns maximum absolute value of rapidity
- unsigned int nmbRapidityBins () const { return _nmbRapidityBins; } ///< returns number of rapidity bins in lookup table
- bool ptCutEnabled () const { return _ptCutEnabled; } ///< returns cut in pt
- double ptCutMin () const { return _ptCutMin; } ///< returns minimum pt
- double ptCutMax () const { return _ptCutMax; } ///< returns maximum pt
- bool etaCutEnabled () const { return _etaCutEnabled; } ///< returns cut in eta
- double etaCutMin () const { return _etaCutMin; } ///< returns minimum eta
- double etaCutMax () const { return _etaCutMax; } ///< returns maximum eta
- int productionMode () const { return _productionMode; } ///< returns production mode
- unsigned int nmbEvents () const { return _nmbEventsTot; } ///< returns total number of events to generate
- int prodParticleId () const { return _prodParticleId; } ///< returns PDG particle ID of produced particle
- int randomSeed () const { return _randomSeed; } ///< returns seed for random number generator
- int outputFormat () const { return _outputFormat; } ///< returns output format
- int beamBreakupMode () const { return _beamBreakupMode; } ///< returns breakup mode for beam particles
- bool interferenceEnabled () const { return _interferenceEnabled; } ///< returns whether interference is taken into account
- double interferenceStrength () const { return _interferenceStrength; } ///< returns percentage of interference
- bool coherentProduction () const { return _coherentProduction; } ///< returns whether production is coherent or incoherent
- double incoherentFactor () const { return _incoherentFactor; } ///< returns incoherent contribution in vector meson production
- double deuteronSlopePar () const { return _deuteronSlopePar; } ///< returns slope parameter for deuteron form factor [(GeV/c)^{-2}]
- double maxPtInterference () const { return _maxPtInterference; } ///< returns maximum p_T for interference calculation [GeV/c]
- int nmbPtBinsInterference () const { return _nmbPtBinsInterference; } ///< returns number of p_T bins for interference calculation
- double ptBinWidthInterference() const { return _ptBinWidthInterference; } ///< returns width of p_T bins for interference calculation [GeV/c]
- double minGammaEnergy () const { return _minGammaEnergy; } ///< returns minimum gamma energy in case of photo nuclear processes [GeV]
- double maxGammaEnergy () const { return _maxGammaEnergy; } ///< returns maximum gamma energy in case of photo nuclear processes [GeV]
- std::string pythiaParams () const { return _pythiaParams; } ///< returns parameters to be passed to pythia
- bool pythiaFullEventRecord () const { return _pythiaFullEventRecord; } ///< returns if the full pythia event record should be printed
- int xsecCalcMethod () const { return _xsecCalcMethod; } ///< returns the method used for the x-sec calculation
- int nThreads () const { return _nThreads; } ///< returns the number of threads in case method 1 is used for the x-sec calc
-
+ double beam1LorentzGamma () const { return _beam1LorentzGamma.value(); } ///< returns Lorentz gamma factor of beam 1 in collider frame
+ double beam2LorentzGamma () const { return _beam2LorentzGamma.value(); } ///< returns Lorentz gamma factor of beam 2 in collider frame
+ double maxW () const { return _maxW.value(); } ///< returns maximum mass W of produced hadronic system [GeV/c^2]
+ double minW () const { return _minW.value(); } ///< returns minimum mass W of produced hadronic system [GeV/c^2]
+ unsigned int nmbWBins () const { return _nmbWBins.value(); } ///< returns number of W bins in lookup table
+ double maxRapidity () const { return _maxRapidity.value(); } ///< returns maximum absolute value of rapidity
+ unsigned int nmbRapidityBins () const { return _nmbRapidityBins.value(); } ///< returns number of rapidity bins in lookup table
+ bool ptCutEnabled () const { return _ptCutEnabled.value(); } ///< returns cut in pt
+ double ptCutMin () const { return _ptCutMin.value(); } ///< returns minimum pt
+ double ptCutMax () const { return _ptCutMax.value(); } ///< returns maximum pt
+ bool etaCutEnabled () const { return _etaCutEnabled.value(); } ///< returns cut in eta
+ double etaCutMin () const { return _etaCutMin.value(); } ///< returns minimum eta
+ double etaCutMax () const { return _etaCutMax.value(); } ///< returns maximum eta
+ int productionMode () const { return _productionMode.value(); } ///< returns production mode
+ unsigned int nmbEvents () const { return _nmbEventsTot.value(); } ///< returns total number of events to generate
+ int prodParticleId () const { return _prodParticleId.value(); } ///< returns PDG particle ID of produced particle
+ int randomSeed () const { return _randomSeed.value(); } ///< returns seed for random number generator
+ int outputFormat () const { return _outputFormat.value(); } ///< returns output format
+ int beamBreakupMode () const { return _beamBreakupMode.value(); } ///< returns breakup mode for beam particles
+ bool interferenceEnabled () const { return _interferenceEnabled.value(); } ///< returns whether interference is taken into account
+ double interferenceStrength () const { return _interferenceStrength.value(); } ///< returns percentage of interference
+ bool coherentProduction () const { return _coherentProduction.value(); } ///< returns whether production is coherent or incoherent
+ double incoherentFactor () const { return _incoherentFactor.value(); } ///< returns incoherent contribution in vector meson production
+ double deuteronSlopePar () const { return _deuteronSlopePar.value(); } ///< returns slope parameter for deuteron form factor [(GeV/c)^{-2}]
+ double maxPtInterference () const { return _maxPtInterference.value(); } ///< returns maximum p_T for interference calculation [GeV/c]
+ int nmbPtBinsInterference () const { return _nmbPtBinsInterference.value(); } ///< returns number of p_T bins for interference calculation
+ double ptBinWidthInterference() const { return _ptBinWidthInterference.value(); } ///< returns width of p_T bins for interference calculation [GeV/c]
+ double minGammaEnergy () const { return _minGammaEnergy.value(); } ///< returns minimum gamma energy in case of photo nuclear processes [GeV]
+ double maxGammaEnergy () const { return _maxGammaEnergy.value(); } ///< returns maximum gamma energy in case of photo nuclear processes [GeV]
+ 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
// double vmPhotonCoupling();
// double slopeParameter();
- double getProtonEnergy() const { return _protonEnergy; }
+ double protonEnergy () const { return _protonEnergy.value(); }
+ void setBeam1Z (unsigned int v) { _beam1Z = v; } ///< returns atomic number of beam particle 1
+ void setBeam1A (unsigned int v) { _beam1A = v; } ///< returns atomic mass number of beam particle 1
+ void setBeam2Z (unsigned int v) { _beam2Z = v; } ///< returns atomic number of beam particle 2
+ void setBeam2A (unsigned int v) { _beam2A = v; } ///< returns atomic mass number of beam particle 2
+ void setBeamLorentzGamma (double v) { _beamLorentzGamma = v; } ///< returns Lorentz gamma factor of both beams in beam CMS frame
+ void setBeam1LorentzGamma (double v) { _beam1LorentzGamma = v; } ///< returns Lorentz gamma factor of beam 1 in collider frame
+ void setBeam2LorentzGamma (double v) { _beam2LorentzGamma = v; } ///< returns Lorentz gamma factor of beam 2 in collider frame
+ void setMaxW (double v) { _maxW = v; } ///< returns maximum mass W of produced hadronic system [GeV/c^2]
+ void setMinW (double v) { _minW = v; } ///< returns minimum mass W of produced hadronic system [GeV/c^2]
+ void setNmbWBins (unsigned int v) { _nmbWBins = v; } ///< returns number of W bins in lookup table
+ void setMaxRapidity (double v) { _maxRapidity = v; } ///< returns maximum absolute value of rapidity
+ void setNmbRapidityBins (unsigned int v) { _nmbRapidityBins = v; } ///< returns number of rapidity bins in lookup table
+ void setPtCutEnabled (bool v) { _ptCutEnabled = v; } ///< returns cut in pt
+ void setPtCutMin (double v) { _ptCutMin = v; } ///< returns minimum pt
+ void setPtCutMax (double v) { _ptCutMax = v; } ///< returns maximum pt
+ void setEtaCutEnabled (bool v) { _etaCutEnabled = v; } ///< returns cut in eta
+ void setEtaCutMin (double v) { _etaCutMin = v; } ///< returns minimum eta
+ void setEtaCutMax (double v) { _etaCutMax = v; } ///< returns maximum eta
+ void setProductionMode (int v) { _productionMode = v; } ///< returns production mode
+ void setNmbEvents (unsigned int v) { _nmbEventsTot = v; } ///< returns total number of events to generate
+ void setProdParticleId (int v) { _prodParticleId = v; } ///< returns PDG particle ID of produced particle
+ void setRandomSeed (int v) { _randomSeed = v; } ///< returns seed for random number generator
+ void setOutputFormat (int v) { _outputFormat = v; } ///< returns output format
+ void setBeamBreakupMode (int v) { _beamBreakupMode = v; } ///< returns breakup mode for beam particles
+ void setInterferenceEnabled (bool v) { _interferenceEnabled = v; } ///< returns whether interference is taken into account
+ void setInterferenceStrength (double v) { _interferenceStrength = v; } ///< returns percentage of interference
+ void setCoherentProduction (bool v) { _coherentProduction = v; } ///< returns whether production is coherent or incoherent
+ void setIncoherentFactor (double v) { _incoherentFactor = v; } ///< returns incoherent contribution in vector meson production
+ void setDeuteronSlopePar (double v) { _deuteronSlopePar = v; } ///< returns slope parameter for deuteron form factor [(GeV/c)^{-2}]
+ void setMaxPtInterference (double v) { _maxPtInterference = v; } ///< returns maximum p_T for voiderference calculation [GeV/c]
+ void setNmbPtBinsInterference (int v) { _nmbPtBinsInterference = v; } ///< returns number of p_T bins for interference calculation
+ void setPtBinWidthInterference(double v) { _ptBinWidthInterference = v; } ///< returns width of p_T bins for voiderference calculation [GeV/c]
+ void setMinGammaEnergy (double v) { _minGammaEnergy = v; } ///< returns minimum gamma energy in case of photo nuclear processes [GeV]
+ void setMaxGammaEnergy (double v) { _maxGammaEnergy = v; } ///< returns maximum gamma energy in case of photo nuclear processes [GeV]
+ 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
+ void setInteractionType (starlightConstants::interactionTypeEnum v) { _interactionType = v; } ///< returns interaction type
+
+ // double vmPhotonCoupling();
+ // double slopeParameter();
+ void setProtonEnergy (double v) { _protonEnergy = v; }
+
+ template<typename T>
+ inline bool setParameter(std::string expression);
+
std::ostream& print(std::ostream& out) const; ///< prints parameter summary
std::ostream& write(std::ostream& out) const; ///< writes parameters back to an ostream
+
+ std::string parameterValueKey() const; ///< Generates key for the current parameters
private:
+
+// To indicate if the crossection table should be re-calculated if parameter changes
+#define VALIDITY_CHECK true
+#define NO_VALIDITY_CHECK false
+
std::string _configFileName; ///< path to configuration file (default = ./config/slight.in)
// config file parameters
- unsigned int _beam1Z; ///< atomic number of beam particle 1
- unsigned int _beam1A; ///< atomic mass number of beam particle 1
- unsigned int _beam2Z; ///< atomic number of beam particle 2
- unsigned int _beam2A; ///< atomic mass number of beam particle 2
- double _beamLorentzGamma; ///< Lorentz gamma factor of the beams in CMS frame
- double _beam1LorentzGamma; ///< Lorentz gamma factor of beam 1 in collider frame
- double _beam2LorentzGamma; ///< Lorentz gamma factor of beam 2 in collider frame
- double _maxW; ///< maximum mass W of produced hadronic system [GeV/c^2]
- double _minW; ///< minimum mass W of produced hadronic system; if set to -1 default value is taken [GeV/c^2]
- unsigned int _nmbWBins; ///< number of W bins in lookup table
- double _maxRapidity; ///< maximum absolute value of rapidity
- unsigned int _nmbRapidityBins; ///< number of rapidity bins in lookup table
- bool _ptCutEnabled; ///< en/disables cut in pt
- double _ptCutMin; ///< minimum pt, if cut is enabled
- double _ptCutMax; ///< maximum pt, if cut is enabled
- bool _etaCutEnabled; ///< en/disables cut in eta
- double _etaCutMin; ///< minimum eta, if cut is enabled
- double _etaCutMax; ///< maximum eta, if cut is enabled
- int _productionMode; ///< \brief production mode
- ///<
- ///< 1 = photon-photon fusion,
- ///< 2 = narrow vector meson resonance in photon-Pomeron fusion,
- ///< 3 = Breit-Wigner vector meson resonance in photon-Pomeron fusion
- unsigned int _nmbEventsTot; ///< total number of events to generate
- int _prodParticleId; ///< PDG particle ID of produced particle
- int _randomSeed; ///< seed for random number generator
- int _outputFormat; ///< \brief output format
- ///<
- ///< 1 = ASCII
- ///< 2 = GSTARtext,
- ///< 3 = PAW ntuple (not working)
- int _beamBreakupMode; ///< \brief breakup mode for beam particles
- ///<
- ///< 1 = hard sphere nuclei (b > 2R),
- ///< 2 = both nuclei break up (XnXn),
- ///< 3 = a single neutron from each nucleus (1n1n),
- ///< 4 = neither nucleon breaks up (with b > 2R),
- ///< 5 = no hadronic break up (similar to option 1, but with the actual hadronic interaction)
- bool _interferenceEnabled; ///< if true, interference is taken into account
- double _interferenceStrength; ///< percentage of interference: from 0 = none to 1 = full
- bool _coherentProduction; ///< if true, production is coherent, else incoherent
- double _incoherentFactor; ///< allows to scale the incoherent contribution in vector meson production
- double _deuteronSlopePar; ///< slope parameter for deuteron form factor [(GeV/c)^{-2}]
- double _maxPtInterference; ///< maximum p_T for interference calculation [GeV/c]
- int _nmbPtBinsInterference; ///< number of p_T bins for interference calculation
- double _ptBinWidthInterference; ///< width of p_T bins for interference calculation [GeV/c]
- double _protonEnergy;
- double _minGammaEnergy; ///< minimum gamma energy in case of photo nuclear processes [GeV]
- double _maxGammaEnergy; ///< maximum gamma energy in case of photo nuclear processes [GeV]
- std::string _pythiaParams; ///< semi-colon separated parameters to pass to pythia, e.g. "mstj(1)=0;paru(13)=0.1"
- bool _pythiaFullEventRecord; ///< if the full pythia event record should be in the outputu
- int _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)
- int _nThreads; ///< Number of threads used in the case of using method 1 for calculating the x-sections
-
-
- starlightConstants::particleTypeEnum _particleType;
- starlightConstants::decayTypeEnum _decayType;
- starlightConstants::interactionTypeEnum _interactionType;
+ parameter<unsigned int,VALIDITY_CHECK> _beam1Z; ///< atomic number of beam particle 1
+ parameter<unsigned int,VALIDITY_CHECK> _beam1A; ///< atomic mass number of beam particle 1
+ parameter<unsigned int,VALIDITY_CHECK> _beam2Z; ///< atomic number of beam particle 2
+ parameter<unsigned int,VALIDITY_CHECK> _beam2A; ///< atomic mass number of beam particle 2
+ parameter<double, VALIDITY_CHECK> _beam1LorentzGamma; ///< Lorentz gamma factor of beam 1 in collider frame
+ parameter<double, VALIDITY_CHECK> _beam2LorentzGamma; ///< Lorentz gamma factor of beam 2 in collider frame
+ parameter<double, VALIDITY_CHECK> _maxW; ///< maximum mass W of produced hadronic system [GeV/c^2]
+ parameter<double, VALIDITY_CHECK> _minW; ///< minimum mass W of produced hadronic system; if set to -1 default value is taken [GeV/c^2]
+ parameter<unsigned int, VALIDITY_CHECK> _nmbWBins; ///< number of W bins in lookup table
+ parameter<double, VALIDITY_CHECK> _maxRapidity; ///< maximum absolute value of rapidity
+ parameter<unsigned int, VALIDITY_CHECK> _nmbRapidityBins; ///< number of rapidity bins in lookup table
+ parameter<bool, VALIDITY_CHECK> _ptCutEnabled; ///< en/disables cut in pt
+ parameter<double, VALIDITY_CHECK> _ptCutMin; ///< minimum pt, if cut is enabled
+ parameter<double, VALIDITY_CHECK> _ptCutMax; ///< maximum pt, if cut is enabled
+ parameter<bool, VALIDITY_CHECK> _etaCutEnabled; ///< en/disables cut in eta
+ parameter<double, VALIDITY_CHECK> _etaCutMin; ///< minimum eta, if cut is enabled
+ parameter<double, VALIDITY_CHECK> _etaCutMax; ///< maximum eta, if cut is enabled
+ parameter<unsigned int, VALIDITY_CHECK> _productionMode; ///< \brief production mode
+ ///<
+ ///< 1 = photon-photon fusion,
+ ///< 2 = narrow vector meson resonance in photon-Pomeron fusion,
+ ///< 3 = Breit-Wigner vector meson resonance in photon-Pomeron fusion
+ parameter<unsigned int, VALIDITY_CHECK> _nmbEventsTot; ///< total number of events to generate
+ parameter<unsigned int, VALIDITY_CHECK> _prodParticleId; ///< PDG particle ID of produced particle
+ parameter<unsigned int, VALIDITY_CHECK> _randomSeed; ///< seed for random number generator
+ parameter<unsigned int, NO_VALIDITY_CHECK> _outputFormat; ///< \brief output format
+ ///<
+ ///< 1 = ASCII
+ ///< 2 = GSTARtext,
+ ///< 3 = PAW ntuple (not working)
+ parameter<unsigned int, VALIDITY_CHECK> _beamBreakupMode; ///< \brief breakup mode for beam particles
+ ///<
+ ///< 1 = hard sphere nuclei (b > 2R),
+ ///< 2 = both nuclei break up (XnXn),
+ ///< 3 = a single neutron from each nucleus (1n1n),
+ ///< 4 = neither nucleon breaks up (with b > 2R),
+ ///< 5 = no hadronic break up (similar to option 1, but with the actual hadronic interaction)
+ parameter<bool, VALIDITY_CHECK> _interferenceEnabled; ///< if VALIDITY_CHECK, interference is taken into account
+ parameter<double, VALIDITY_CHECK> _interferenceStrength; ///< percentage of interference: from 0 = none to 1 = full
+ parameter<bool, VALIDITY_CHECK> _coherentProduction; ///< if VALIDITY_CHECK, production is coherent, else incoherent
+ parameter<double, VALIDITY_CHECK> _incoherentFactor; ///< allows to scale the incoherent contribution in vector meson production
+ parameter<double, VALIDITY_CHECK> _deuteronSlopePar; ///< slope parameter for deuteron form factor [(GeV/c)^{-2}]
+ parameter<double, VALIDITY_CHECK> _maxPtInterference; ///< maximum p_T for interference calculation [GeV/c]
+ parameter<unsigned int, VALIDITY_CHECK> _nmbPtBinsInterference; ///< number of p_T bins for interference calculation
+ parameter<double, VALIDITY_CHECK> _ptBinWidthInterference; ///< width of p_T bins for interference calculation [GeV/c]
+ parameter<double, VALIDITY_CHECK> _protonEnergy;
+ parameter<double, VALIDITY_CHECK> _minGammaEnergy; ///< minimum gamma energy in case of photo nuclear processes [GeV]
+ 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 outputu
+ 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
+
+
+ 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;
+
};
+template<typename T>
+inline
+bool inputParameters::setParameter(std::string expression)
+{
+
+ return _ip.parseString(expression);
+
+
+}
+
inline
std::ostream&
operator <<(std::ostream& out,
const inputParameters& par)
{
return par.print(out);
}
#endif // INPUTPARAMETERS_H
Index: trunk/src/inputParameters.cpp
===================================================================
--- trunk/src/inputParameters.cpp (revision 153)
+++ trunk/src/inputParameters.cpp (revision 154)
@@ -1,537 +1,572 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright 2010
//
// This file is part of starlight.
//
// starlight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// starlight is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with starlight. If not, see <http://www.gnu.org/licenses/>.
//
///////////////////////////////////////////////////////////////////////////
//
// File and Version Information:
// $Rev:: $: revision of last commit
// $Author:: $: author of last commit
// $Date:: $: date of last commit
//
// Description:
//
//
//
///////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <fstream>
#include "reportingUtils.h"
#include "starlightconstants.h"
#include "inputParameters.h"
#include "inputParser.h"
#include "starlightconfig.h"
#include <cmath>
+#include <cstring>
+#include "randomgenerator.h"
using namespace std;
using namespace starlightConstants;
+parameterlist parameterbase::_parameters;
+
+#define REQUIRED true
+#define NOT_REQUIRED false
//______________________________________________________________________________
inputParameters::inputParameters()
: _configFileName ("slight.in"),
- _beam1Z (0),
- _beam1A (0),
- _beam2Z (0),
- _beam2A (0),
- _beam1LorentzGamma (0),
- _beam2LorentzGamma (0),
- _maxW (0),
- _minW (0),
- _nmbWBins (0),
- _maxRapidity (0),
- _nmbRapidityBins (0),
- _ptCutEnabled (false),
- _ptCutMin (0),
- _ptCutMax (0),
- _etaCutEnabled (false),
- _etaCutMin (0),
- _etaCutMax (0),
- _productionMode (0),
- _nmbEventsTot (0),
- _prodParticleId (0),
- _randomSeed (0),
- _outputFormat (0),
- _beamBreakupMode (0),
- _interferenceEnabled (false),
- _interferenceStrength (0),
- _coherentProduction (false),
- _incoherentFactor (0),
- _deuteronSlopePar (0),
- _maxPtInterference (0),
- _nmbPtBinsInterference (0),
- _ptBinWidthInterference(0),
- _protonEnergy (0),
- _minGammaEnergy (0),
- _maxGammaEnergy (0),
- _pythiaParams (),
- _pythiaFullEventRecord (false),
- _xsecCalcMethod (0),
- _nThreads (1)
-
-{ }
+ _beam1Z ("BEAM_1_Z",0),
+ _beam1A ("BEAM_1_A",0),
+ _beam2Z ("BEAM_2_Z",0),
+ _beam2A ("BEAM_2_A",0),
+ _beam1LorentzGamma ("BEAM_1_GAMMA",0),
+ _beam2LorentzGamma ("BEAM_2_GAMMA",0),
+ _maxW ("W_MAX",0),
+ _minW ("W_MIN",0),
+ _nmbWBins ("W_N_BINS",0),
+ _maxRapidity ("RAP_MAX",0),
+ _nmbRapidityBins ("RAP_N_BINS",0),
+ _ptCutEnabled ("CUT_PT",false),
+ _ptCutMin ("PT_MIN",0),
+ _ptCutMax ("PT_MAX",0),
+ _etaCutEnabled ("CUT_ETA",false),
+ _etaCutMin ("ETA_MIN",0),
+ _etaCutMax ("ETA_MAX",0),
+ _productionMode ("PROD_MODE",0),
+ _nmbEventsTot ("N_EVENTS",0),
+ _prodParticleId ("PROD_PID",0),
+ _randomSeed ("RND_SEED",0),
+ _outputFormat ("OUTPUT_FORMAT",0),
+ _beamBreakupMode ("BREAKUP_MODE",0),
+ _interferenceEnabled ("INTERFERENCE",false),
+ _interferenceStrength ("IF_STRENGTH",0),
+ _coherentProduction ("COHERENT",false),
+ _incoherentFactor ("INCO_FACTOR",0),
+ _deuteronSlopePar ("BFORD",0),
+ _maxPtInterference ("INT_PT_MAX",0),
+ _nmbPtBinsInterference ("INT_PT_N_BINS",0),
+ _ptBinWidthInterference("INT_PT_WIDTH",0),
+ _protonEnergy ("PROTON_ENERGY",0),
+ _minGammaEnergy ("MIN_GAMMA_ENERGY",0),
+ _maxGammaEnergy ("MAX_GAMMA_ENERGY",0),
+ _pythiaParams ("PYTHIA_PARAMS",""),
+ _pythiaFullEventRecord ("PYTHIA_FULL_EVENTRECORD",false, NOT_REQUIRED),
+ _xsecCalcMethod ("XSEC_METHOD",0, NOT_REQUIRED),
+ _nThreads ("N_THREADS",1, NOT_REQUIRED),
+ _nBinsQKniehl ("N_BINS_Q_KNIEHL", 0, NOT_REQUIRED),
+ _nBinsEKniehl ("N_BINS_E_KNIEHL", 0, NOT_REQUIRED),
+ _nBinsBKniehl ("N_BINS_B_KNIEHL", 0, NOT_REQUIRED),
+ _qMaxKniehl ("Q_MAX_KNIEHL", 0, NOT_REQUIRED),
+ _eGammaMinKniehl ("E_GAMMA_MIN_KNIEHL", 0, NOT_REQUIRED),
+ _eGammaMaxKniehl ("E_GAMMA_MAX_KNIEHL", 0, NOT_REQUIRED),
+ _bMinKniehl ("B_MIN_KNIEHL", 0, NOT_REQUIRED),
+ _bMaxKniehl ("B_MAX_KNIEHL", 0, NOT_REQUIRED)
+{
+ // All parameters must be initialised in initialisation list!
+ // If not: error: 'parameter<T, validate>::parameter() [with T = unsigned int, bool validate = true]' is private
+ // or similar
+
+ _ip.addParameter(_beam1Z);
+ _ip.addParameter(_beam2Z);
+ _ip.addParameter(_beam1A);
+ _ip.addParameter(_beam2A);
+
+ _ip.addParameter(_beam1LorentzGamma);
+ _ip.addParameter(_beam2LorentzGamma);
+
+ _ip.addParameter(_maxW);
+ _ip.addParameter(_minW);
+
+ _ip.addParameter(_nmbWBins);
+
+ _ip.addParameter(_maxRapidity);
+ _ip.addParameter(_nmbRapidityBins);
+
+ _ip.addParameter(_ptCutEnabled);
+ _ip.addParameter(_ptCutMin);
+ _ip.addParameter(_ptCutMax);
+
+ _ip.addParameter(_etaCutEnabled);
+ _ip.addParameter(_etaCutMax);
+ _ip.addParameter(_etaCutMin);
+
+ _ip.addParameter(_productionMode);
+ _ip.addParameter(_nmbEventsTot);
+ _ip.addParameter(_prodParticleId);
+ _ip.addParameter(_randomSeed);
+ _ip.addParameter(_outputFormat);
+ _ip.addParameter(_beamBreakupMode);
+ _ip.addParameter(_interferenceEnabled);
+ _ip.addParameter(_interferenceStrength);
+ _ip.addParameter(_coherentProduction);
+ _ip.addParameter(_incoherentFactor);
+ _ip.addParameter(_deuteronSlopePar);
+ _ip.addParameter(_maxPtInterference);
+ _ip.addParameter(_nmbPtBinsInterference);
+ _ip.addParameter(_minGammaEnergy);
+ _ip.addParameter(_maxGammaEnergy);
+ _ip.addParameter(_pythiaParams);
+ _ip.addParameter(_pythiaFullEventRecord);
+ _ip.addParameter(_xsecCalcMethod);
+ _ip.addParameter(_nThreads);
+ _ip.addParameter(_nBinsBKniehl);
+ _ip.addParameter(_nBinsQKniehl);
+ _ip.addParameter(_nBinsEKniehl);
+ _ip.addParameter(_qMaxKniehl);
+ _ip.addParameter(_eGammaMaxKniehl);
+ _ip.addParameter(_eGammaMinKniehl);
+ _ip.addParameter(_bMaxKniehl);
+ _ip.addParameter(_bMinKniehl);
+}
//______________________________________________________________________________
inputParameters::~inputParameters()
{ }
//______________________________________________________________________________
bool
-inputParameters::init(const string& configFileName)
+inputParameters::configureFromFile(const std::string &configFileName)
{
// open config file
_configFileName = configFileName;
-
- double minWConfigFile = 0;
- double maxWConfigFile = 0;
-
- inputParser ip;
- ip.addUintParameter(string("BEAM_1_Z"), &_beam1Z);
- ip.addUintParameter(string("BEAM_2_Z"), &_beam2Z);
- ip.addUintParameter(string("BEAM_1_A"), &_beam1A);
- ip.addUintParameter(string("BEAM_2_A"), &_beam2A);
-
- ip.addDoubleParameter(string("BEAM_1_GAMMA"), &_beam1LorentzGamma);
- ip.addDoubleParameter(string("BEAM_2_GAMMA"), &_beam2LorentzGamma);
-
- ip.addDoubleParameter(string("W_MAX"), &maxWConfigFile);
- ip.addDoubleParameter(string("W_MIN"), &minWConfigFile);
- ip.addUintParameter(string("W_N_BINS"), &_nmbWBins);;
-
- ip.addDoubleParameter(string("RAP_MAX"), &_maxRapidity);
- ip.addUintParameter(string("RAP_N_BINS"), &_nmbRapidityBins);
-
- ip.addBoolParameter(string("CUT_PT"), &_ptCutEnabled);
- ip.addDoubleParameter(string("PT_MIN"), &_ptCutMin);
- ip.addDoubleParameter(string("PT_MAX"), &_ptCutMax);
-
- ip.addBoolParameter(string("CUT_ETA"), &_etaCutEnabled);
- ip.addDoubleParameter(string("ETA_MIN"), &_etaCutMin);
- ip.addDoubleParameter(string("ETA_MAX"), &_etaCutMax);
-
- ip.addIntParameter(string("PROD_MODE"), &_productionMode);
-
- ip.addUintParameter(string("N_EVENTS"), &_nmbEventsTot);
-
- ip.addIntParameter(string("PROD_PID"), &_prodParticleId);
-
- ip.addIntParameter(string("RND_SEED"), &_randomSeed);
-
- ip.addIntParameter(string("OUTPUT_FORMAT"), &_outputFormat);
- ip.addIntParameter(string("BREAKUP_MODE"), &_beamBreakupMode);
+ int nParameters = _ip.parseFile(_configFileName);
- ip.addBoolParameter(string("INTERFERENCE"), &_interferenceEnabled);
- ip.addDoubleParameter(string("IF_STRENGTH"), &_interferenceStrength);
-
- ip.addBoolParameter(string("COHERENT"), &_coherentProduction);
- ip.addDoubleParameter(string("INCO_FACTOR"), &_incoherentFactor);
-
- ip.addDoubleParameter(string("BFORD"), &_deuteronSlopePar);
-
- ip.addDoubleParameter(string("INT_PT_MAX"), &_maxPtInterference);
- ip.addIntParameter(string("INT_PT_N_BINS"), &_nmbPtBinsInterference);
-
- ip.addDoubleParameter(string("MIN_GAMMA_ENERGY"), &_minGammaEnergy, false);
- ip.addDoubleParameter(string("MAX_GAMMA_ENERGY"), &_maxGammaEnergy, false);
-
- ip.addStringParameter(string("PYTHIA_PARAMS"), &_pythiaParams, false);
- ip.addBoolParameter(string("PYTHIA_FULL_EVENTRECORD"), &_pythiaFullEventRecord, false);
-
- ip.addIntParameter(string("XSEC_METHOD"), &_xsecCalcMethod, false);
- ip.addIntParameter(string("N_THREADS"), &_nThreads, false);
-
- int nParameters = ip.parseFile(_configFileName);
if(nParameters == -1)
{
printWarn << "could not open file '" << _configFileName << "'" << endl;
return false;
}
//ip.printParameterInfo(cout);
- if(ip.validateParameters(cerr))
+ if(_ip.validateParameters(cerr))
printInfo << "successfully read input parameters from '" << _configFileName << "'" << endl;
else {
printWarn << "problems reading input parameters from '" << _configFileName << "'" << endl
<< *this;
return false;
}
-
+ return true;
+}
+ bool inputParameters::init()
+ {
+ // Set the seed for the random generator
+ randyInstance.SetSeed(_randomSeed.value());
+
// Calculate beam gamma in CMS frame
- double rap1 = acosh(_beam1LorentzGamma);
- double rap2 = -acosh(_beam2LorentzGamma);
+ double rap1 = acosh(beam1LorentzGamma());
+ double rap2 = -acosh(beam2LorentzGamma());
_beamLorentzGamma = cosh((rap1-rap2)/2);
std::cout << "Rapidity beam 1: " << rap1 << ", rapidity beam 2: " << rap2 << ", rapidity CMS system: " << (rap1+rap2)/2 << ", beam gamma in CMS: " << _beamLorentzGamma<< std::endl;
- _ptBinWidthInterference = _maxPtInterference / _nmbPtBinsInterference;
+ _ptBinWidthInterference = maxPtInterference() / nmbPtBinsInterference();
_protonEnergy = _beamLorentzGamma * protonMass;
// define interaction type
- switch (_productionMode) {
+ switch (productionMode()) {
case 1:
_interactionType = PHOTONPHOTON;
break;
case 2:
_interactionType = PHOTONPOMERONNARROW;
break;
case 3:
_interactionType = PHOTONPOMERONWIDE;
break;
case 4:
_interactionType = PHOTONPOMERONINCOHERENT;
break;
case 5:
_interactionType = PHOTONUCLEARSINGLE;
break;
case 6:
_interactionType = PHOTONUCLEARDOUBLE;
break;
case 7:
_interactionType = PHOTONUCLEARSINGLEPA;
break;
case 8:
_interactionType = PHOTONUCLEARSINGLEPAPY;
break;
+// case 9:
+// _interactionType = PHOTONPHOTONKNIEHL;
+// break;
+// case 10:
+// _interactionType = PHOTONPHOTONKNIEHLMODIFIED;
+// break;
default:
printWarn << "unknown production mode '" << _productionMode << "'" << endl;
return false;
}
//Trying to define the proper Wmins and Wmaxs. a TEMPORARY fix....Better solution=??
double mass = 0;
double width = 0;
double defaultMinW = 0; // default for _minW, unless it is defined later [GeV/c^2]
- switch (_prodParticleId) {
+ switch (prodParticleId()) {
case 11: // e+e- pair
_particleType = ELECTRON;
_decayType = LEPTONPAIR;
defaultMinW = 0.01; // default is 0.01; up to 0.15 is safe for Summer 2000 triggering for e+e- pairs
- _maxW = maxWConfigFile;
break;
case 13: // mu+mu- pair
_particleType = MUON;
_decayType = LEPTONPAIR;
defaultMinW = 2 * muonMass;
- _maxW = maxWConfigFile;
break;
case 15: // tau+tau- pair
_particleType = TAUON;
_decayType = LEPTONPAIR;
defaultMinW = 2 * tauMass;
- _maxW = maxWConfigFile;
break;
+// case 24: // W+W- pair
+// _particleType = W;
+// _decayType = WW;
+// defaultMinW = 2 * muonMass;
+// break;
case 115: // a_2(1320)
_particleType = A2;
_decayType = SINGLEMESON;
- _maxW = maxWConfigFile;
break;
case 221: // eta
_particleType = ETA;
_decayType = SINGLEMESON;
- _maxW = maxWConfigFile;
break;
case 225: // f_2(1270)
_particleType = F2;
defaultMinW = 2*pionChargedMass;
_decayType = SINGLEMESON;
- _maxW = maxWConfigFile;
break;
case 331: // eta'(958)
_particleType = ETAPRIME;
_decayType = SINGLEMESON;
- _maxW = maxWConfigFile;
break;
case 335: // f_2'(1525)
_particleType = F2PRIME;
_decayType = SINGLEMESON;
- _maxW = maxWConfigFile;
break;
case 441: // eta_c(1s)
_particleType = ETAC;
_decayType = SINGLEMESON;
- _maxW = maxWConfigFile;
defaultMinW = etaCMass - 5 * 0.0267;
break;
case 9010221: // f_0(980), was orginally called 10221? updated to standard number
_particleType = F0;
_decayType = SINGLEMESON;
- _maxW = maxWConfigFile;
defaultMinW = 2*pionNeutralMass;
break;
case 33: // Z"/Z03
_particleType = ZOVERZ03;
_decayType = SINGLEMESON;
- _maxW = maxWConfigFile;
break;
+// case 25: // Higgs
+// _particleType = HIGGS;
+// _decayType = SINGLEMESON;
+// break;
case 113: // rho(770)
_particleType = RHO;
_decayType = WIDEVMDEFAULT;
mass = 0.7685;
width = 0.1507;
defaultMinW = 2 * pionChargedMass;
_maxW = mass + 5 * width;
break;
case 913: // rho(770) with direct pi+pi- decay, interference given by ZEUS data
_particleType = RHOZEUS;
_decayType = WIDEVMDEFAULT;
mass = 0.7685;
width = 0.1507;
defaultMinW = 2 * pionChargedMass;
_maxW = mass + 5 * width; // use the same 1.5GeV max mass as ZEUS
break;
case 999: // pi+pi-pi+pi- phase space decay
_particleType = FOURPRONG;
_decayType = WIDEVMDEFAULT;
mass = 1.350;
width = 0.360;
defaultMinW = 4 * pionChargedMass;
_maxW = 3;
break;
case 223: // omega(782)
_particleType = OMEGA;
_decayType = NARROWVMDEFAULT; // will probably be moved to 3-body decay
mass = 0.78194;
width = 0.00843;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
break;
case 333: // phi(1020)
_particleType = PHI;
_decayType = NARROWVMDEFAULT;
mass = 1.019413;
width = 0.00443;
defaultMinW = 2 * kaonChargedMass;
_maxW = mass + 5 * width;
break;
case 443: // J/psi
_particleType = JPSI;
_decayType = NARROWVMDEFAULT;
mass = 3.09692; // JN 3.09688;
width = 0.000091; // JN 0.000087;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
break;
case 443011: // J/psi
_particleType = JPSI_ee;
_decayType = NARROWVMDEFAULT;
mass = 3.09692; // JN 3.09688;
width = 0.000091; // JN 0.000087;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
break;
case 443013: // J/psi
_particleType = JPSI_mumu;
_decayType = NARROWVMDEFAULT;
mass = 3.09692; // JN 3.09688;
width = 0.000091; // JN 0.000087;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
break;
case 444: // J/psi
_particleType = JPSI2S;
_decayType = NARROWVMDEFAULT;
mass = 3.686093;
width = 0.000337;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
break;
case 444011: // J/psi
_particleType = JPSI2S_ee;
_decayType = NARROWVMDEFAULT;
mass = 3.686093;
width = 0.000337;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
break;
case 444013: // J/psi
_particleType = JPSI2S_mumu;
_decayType = NARROWVMDEFAULT;
mass = 3.686093;
width = 0.000337;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
break;
case 553: // Upsilon
_particleType = UPSILON;
_decayType = NARROWVMDEFAULT;
mass = 9.46030;
width = 0.00005402;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
break;
case 553011: // Upsilon
_particleType = UPSILON_ee;
_decayType = NARROWVMDEFAULT;
mass = 9.46030;
width = 0.00005402;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
break;
case 553013: // Upsilon
_particleType = UPSILON_mumu;
_decayType = NARROWVMDEFAULT;
mass = 9.46030;
width = 0.00005402;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
break;
case 554: // Upsilon(2S)
_particleType = UPSILON2S;
_decayType = NARROWVMDEFAULT;
mass = 10.02326;
width = 0.00003198;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
break;
case 554011: // Upsilon(2S)
_particleType = UPSILON2S_ee;
_decayType = NARROWVMDEFAULT;
mass = 10.02326;
width = 0.00003198;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
break;
case 554013: // Upsilon(2S)
_particleType = UPSILON2S_mumu;
_decayType = NARROWVMDEFAULT;
mass = 10.02326;
width = 0.00003198;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
break;
case 555: // Upsilon(3S)
mass = 10.3552;
width = 0.00002032;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
_particleType = UPSILON3S;
_decayType = NARROWVMDEFAULT;
break;
case 555011: // Upsilon(3S)
_particleType = UPSILON3S_ee;
_decayType = NARROWVMDEFAULT;
mass = 10.3552;
width = 0.00002032;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
break;
case 555013: // Upsilon(3S)
_particleType = UPSILON3S_mumu;
_decayType = NARROWVMDEFAULT;
mass = 10.3552;
width = 0.00002032;
defaultMinW = mass - 5 * width;
_maxW = mass + 5 * width;
break;
default:
printWarn << "unknown particle ID " << _prodParticleId << endl;
return false;
} // _prodParticleId
- if (minWConfigFile == -1)
+ if (_minW.value() == -1)
_minW = defaultMinW;
- else
- _minW = minWConfigFile;
printInfo << "using the following " << *this;
return true;
}
//______________________________________________________________________________
ostream&
inputParameters::print(ostream& out) const
{
out << "starlight parameters:" << endl
<< " config file name ...................... '" << _configFileName << "'" << endl
- << " beam 1 atomic number ................... " << _beam1Z << endl
- << " beam 1 atomic mass number .............. " << _beam1A << endl
- << " beam 2 atomic number ................... " << _beam2Z << endl
- << " beam 2 atomic mass number .............. " << _beam2A << endl
+ << " beam 1 atomic number ................... " << _beam1Z.value() << endl
+ << " beam 1 atomic mass number .............. " << _beam1A.value() << endl
+ << " beam 2 atomic number ................... " << _beam2Z.value() << endl
+ << " beam 2 atomic mass number .............. " << _beam2A.value() << endl
<< " Lorentz gamma of beams in CM frame ..... " << _beamLorentzGamma << endl
- << " mass W of produced hadronic system ..... " << _minW << " < W < " << _maxW << " GeV/c^2" << endl
- << " # of W bins ............................ " << _nmbWBins << endl
- << " maximum absolute value for rapidity .... " << _maxRapidity << endl
- << " # of rapidity bins ..................... " << _nmbRapidityBins << endl
- << " cut in pT............................... " << yesNo(_ptCutEnabled) << endl
- << " minumum pT.......................... " << _ptCutMin << " GeV/c" << endl
- << " maximum pT.......................... " << _ptCutMax << " GeV/c" << endl
- << " cut in eta.............................. " << yesNo(_etaCutEnabled) << endl
- << " minumum eta......................... " << _etaCutMin << endl
- << " maximum eta......................... " << _etaCutMax << endl
- << " meson production mode .................. " << _productionMode << endl
- << " number of events to generate ........... " << _nmbEventsTot << endl
- << " PDG ID of produced particle ............ " << _prodParticleId << endl
- << " seed for random generator .............. " << _randomSeed << endl
- << " output format .......................... " << _outputFormat << endl
- << " breakup mode for beam particles ........ " << _beamBreakupMode << endl
- << " interference enabled ................... " << yesNo(_interferenceEnabled) << endl
- << " interference strength .................. " << _interferenceStrength << endl
- << " coherent scattering off nucleus ........ " << yesNo(_coherentProduction) << endl
- << " scaling factor for incoh. VM prod. ..... " << _incoherentFactor << endl
- << " deuteron slope parameter ............... " << _deuteronSlopePar << " (GeV/c)^{-2}" << endl
- << " maximum p_T for interference calc. ..... " << _maxPtInterference << " GeV/c" << endl
- << " # of p_T bins for interference calc. ... " << _nmbPtBinsInterference << endl;
+ << " mass W of produced hadronic system ..... " << _minW.value() << " < W < " << _maxW.value() << " GeV/c^2" << endl
+ << " # of W bins ............................ " << _nmbWBins.value() << endl
+ << " maximum absolute value for rapidity .... " << _maxRapidity.value() << endl
+ << " # of rapidity bins ..................... " << _nmbRapidityBins.value() << endl
+ << " cut in pT............................... " << yesNo(_ptCutEnabled.value()) << endl
+ << " minumum pT.......................... " << _ptCutMin.value() << " GeV/c" << endl
+ << " maximum pT.......................... " << _ptCutMax.value() << " GeV/c" << endl
+ << " cut in eta.............................. " << yesNo(_etaCutEnabled.value()) << endl
+ << " minumum eta......................... " << _etaCutMin.value() << endl
+ << " maximum eta......................... " << _etaCutMax.value() << endl
+ << " meson production mode .................. " << _productionMode.value() << endl
+ << " number of events to generate ........... " << _nmbEventsTot.value() << endl
+ << " PDG ID of produced particle ............ " << _prodParticleId.value() << endl
+ << " seed for random generator .............. " << _randomSeed.value() << endl
+ << " output format .......................... " << _outputFormat.value() << endl
+ << " breakup mode for beam particles ........ " << _beamBreakupMode.value() << endl
+ << " interference enabled ................... " << yesNo(_interferenceEnabled.value()) << endl
+ << " interference strength .................. " << _interferenceStrength.value() << endl
+ << " coherent scattering off nucleus ........ " << yesNo(_coherentProduction.value()) << endl
+ << " scaling factor for incoh. VM prod. ..... " << _incoherentFactor.value() << endl
+ << " deuteron slope parameter ............... " << _deuteronSlopePar.value() << " (GeV/c)^{-2}" << endl
+ << " maximum p_T for interference calc. ..... " << _maxPtInterference.value() << " GeV/c" << endl
+ << " # of p_T bins for interference calc. ... " << _nmbPtBinsInterference.value() << endl;
return out;
}
//______________________________________________________________________________
ostream&
inputParameters::write(ostream& out) const
{
out << "BEAM_1_Z" << beam1Z () <<endl
<< "BEAM_2_Z" << beam1A () <<endl
<< "BEAM_1_A" << beam2Z () <<endl
<< "BEAM_2_A" << beam2A () <<endl
<< "BEAM_GAMMA" << beamLorentzGamma () <<endl
<< "W_MAX" << maxW () <<endl
<< "W_MIN" << minW () <<endl
<< "W_N_BINS" << nmbWBins () <<endl
<< "RAP_MAX" << maxRapidity () <<endl
<< "RAP_N_BINS" << nmbRapidityBins () <<endl
<< "CUT_PT" << ptCutEnabled () <<endl
<< "PT_MIN" << ptCutMin () <<endl
<< "PT_MAX" << ptCutMax () <<endl
<< "CUT_ETA" << etaCutEnabled () <<endl
<< "ETA_MIN" << etaCutMin () <<endl
<< "ETA_MAX" << etaCutMax () <<endl
<< "PROD_MODE" << productionMode () <<endl
<< "N_EVENTS" << nmbEvents () <<endl
<< "PROD_PID" << prodParticleId () <<endl
<< "RND_SEED" << randomSeed () <<endl
<< "OUTPUT_FORMAT" << outputFormat () <<endl
<< "BREAKUP_MODE" << beamBreakupMode () <<endl
<< "INTERFERENCE" << interferenceEnabled () <<endl
<< "IF_STRENGTH" << interferenceStrength () <<endl
<< "COHERENT" << coherentProduction () <<endl
<< "INCO_FACTOR" << incoherentFactor () <<endl
<< "BFORD" << deuteronSlopePar () <<endl
<< "INT_PT_MAX" << maxPtInterference () <<endl
<< "INT_PT_N_BINS" << nmbPtBinsInterference() <<endl;
return out;
}
+
+std::string
+inputParameters::parameterValueKey() const
+{
+
+ // std::stringstream s;
+
+// s <<_beam1A<<_beam1Z<<_beam2A<<_beam1LorentzGamma<<_beam2LorentzGamma<<_maxW<<_minW;
+// <<_nmbWBins<<_maxRapidity<<_nmbRapidityBins<<_
+
+
+ //return s;
+
+ return parameterbase::_parameters.validationKey()
+ ;
+}

File Metadata

Mime Type
text/x-diff
Expires
Sat, Dec 21, 5:39 PM (9 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4023673
Default Alt Text
(63 KB)

Event Timeline