00001 #include "FitterInterface.hh"
00002 #include "FitterArguments.h"
00003
00004 namespace SctFitter {
00005 using std::string;
00006 using std::list;
00007 using std::endl;
00008
00009 FitterArguments::FitterArguments(int argc, char** argv) :
00010 Arguments(argc, argv), m_strategy("NagFitStrategy"), m_options("NQR"), m_analytic(false)
00011 {
00012 parse();
00013 }
00014 void FitterArguments::parse(){
00015 Arguments::parse();
00016 for (list<string>::iterator i=m_list.begin(); i!=m_list.end(); ++i){
00017 if (*i == "-analytic"){
00018 m_analytic=true;
00019 }else if (*i == "-options"){
00020 m_options=next(i);
00021 } else if (*i == "-strategy"){
00022 m_strategy=next(i);
00023 }
00024 }
00025 if (instanceName()=="") setInstanceName(FitterI::FitterInterface::instanceName);
00026 }
00027 void FitterArguments::printHelp(std::ostream& oss) const{
00028 oss << "FitterArguments:" << endl
00029 << " -strategy <strategy name> : set fit stragety to e.g. RootFitStrategy or NagFitStrategy" <<endl
00030 << " -options <options> : set fit options e.g. NQR" <<endl
00031 << " -analytic (switch) : switch on analytic fitting algorithm" << endl;
00032 Arguments::printHelp(oss);
00033 }
00034
00035 std::string FitterArguments::getStrategyName() const{
00036 return m_strategy;
00037 }
00038
00039 std::string FitterArguments::getFitOptions() const{
00040 return m_options;
00041 }
00042
00043 bool FitterArguments::analytic() const{
00044 return m_analytic;
00045 }
00046 }