Skip to content
Snippets Groups Projects
Commit e828ab3e authored by Michael Leyhe's avatar Michael Leyhe
Browse files

JpsiGamEtaPiPiNew: Added a jobOption to JpsiGamEtaPiPiParser.cc

parent 80b58010
No related branches found
No related tags found
No related merge requests found
// Bertram Kopf (RUB)
#include "Examples/JpsiGamEtaPiPi/JpsiGamEtaPiPiParser.hh"
#include "Examples/JpsiGamEtaPiPiNew/JpsiGamEtaPiPiParser.hh"
#include "ErrLogger/ErrLogger.hh"
#include <iterator>
#include <iostream>
#include <fstream>
using namespace std;
JpsiGamEtaPiPiParser::JpsiGamEtaPiPiParser(int argc,char **argv):
ParserBase(argc,argv)
......@@ -14,22 +14,24 @@ JpsiGamEtaPiPiParser::JpsiGamEtaPiPiParser(int argc,char **argv):
, _useCommonProductionPhases(false)
, _massMin(0.7)
, _massMax(3.1)
, _jobOption("")
{
po::options_description common("Common Options");
common.add_options()
("massIndependentFit", po::value<bool>(&_massIndependentFit), "enable/disable mass independence in fit")
("commonProdPhases",po::value<bool>(&_useCommonProductionPhases), "enable/disable common production phases")
;
_common->add(common);
po::options_description config("Configuration file options");
config.add_options()
("massRangeMin",po::value<double>(&_massMin), "min of eta pi pi mass range for mass indep. fit")
("massRangeMax",po::value<double>(&_massMax), "max of eta pi pi mass range for mass indep. fit")
;
_config->add(config);
parseCommandLine(argc, argv);
po::options_description common("Common Options");
common.add_options()
("massIndependentFit", po::value<bool>(&_massIndependentFit), "enable/disable mass independence in fit")
("commonProdPhases",po::value<bool>(&_useCommonProductionPhases), "enable/disable common production phases")
;
_common->add(common);
po::options_description config("Configuration file options");
config.add_options()
("massRangeMin",po::value<double>(&_massMin), "min of eta pi pi mass range for mass indep. fit")
("massRangeMax",po::value<double>(&_massMax), "max of eta pi pi mass range for mass indep. fit")
("jobOption",po::value<string>(&_jobOption), "add a jobOption string to all produced files")
;
_config->add(config);
parseCommandLine(argc, argv);
}
......@@ -19,7 +19,7 @@ class JpsiGamEtaPiPiParser : public ParserBase
const bool massIndependentFit() const {return _massIndependentFit; }
const bool useCommonProductionPhases() const {return _useCommonProductionPhases; }
const std::pair<double, double> massRange() const { return std::make_pair( _massMin, _massMax ) ; }
const std::string getjobOption() const {return _jobOption;}
protected:
bool _massIndependentFit;
......@@ -28,6 +28,7 @@ protected:
double _massMin;
double _massMax;
std::string _jobOption;
};
......
......@@ -87,6 +87,8 @@ int main(int __argc,char *__argv[]){
std::string theCfgFile = theAppParams.getConfigFile();
std::string jobOption = theAppParams.getjobOption();
const std::string datFile=theAppParams.dataFile();
const std::string mcFile=theAppParams.mcFile();
Info << "data file: " << datFile ; // << endmsg;
......@@ -179,7 +181,9 @@ int main(int __argc,char *__argv[]){
fitParamsNew defaultVal;
fitParamsNew defaultErr;
theLhPtr->getDefaultParams(defaultVal, defaultErr);
std::ofstream theStreamDefault ( "defaultparams.dat");
std::string defaultparamsname = "defaultparams" + jobOption + ".dat";
std::ofstream theStreamDefault ( defaultparamsname.c_str() );
// std::ofstream theStreamDefault ( "defaultparams.dat");
theFitParamBase->dumpParams(theStreamDefault, defaultVal, defaultErr);
return 0;
......@@ -289,8 +293,10 @@ int main(int __argc,char *__argv[]){
const std::vector<double> finalParamErrorVec=finalUsrParameters.Errors();
fitParamsNew finalFitErrs=theErrorparams;
theFitParamBase->getFitParamVal(finalParamErrorVec, finalFitErrs);
std::ofstream theStream ( "finalResult.dat");
std::string finalResultname = "finalResult" + jobOption + ".dat";
std::ofstream theStream ( finalResultname.c_str() );
//std::ofstream theStream ( "finalResult.dat");
theFitParamBase->dumpParams(theStream, finalFitParams, finalFitErrs);
MnUserCovariance theCovMatrix = min.UserCovariance();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment