musrfit  1.9.2
msr2data.cpp File Reference
#include "PMusr.h"
#include "PMsr2Data.h"
#include <algorithm>
#include <sstream>
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <limits>
#include <string>
#include <memory>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/lexical_cast.hpp>
Include dependency graph for msr2data.cpp:

Go to the source code of this file.

Functions

bool isNumber (const std::string &s)
 
void msr2data_syntax ()
 
std::string msr2data_validArguments (const std::vector< std::string > &arg)
 
std::string msr2data_outputfile (std::vector< std::string > &arg, bool db=true)
 
bool msr2data_useOption (std::vector< std::string > &arg, const std::string &s)
 
int msr2data_doFitting (std::vector< std::string > &arg, bool &chainfit)
 
int msr2data_doInputCreation (std::vector< std::string > &arg, bool &inputOnly)
 
int msr2data_paramList (std::vector< std::string > &arg, std::vector< unsigned int > &paramList)
 

Function Documentation

◆ isNumber()

bool isNumber ( const std::string &  s)

Checks if a string is an integer

return:

  • true if s is a number string
  • false otherwise
Parameters
sstring

Definition at line 70 of file msr2data.cpp.

Referenced by msr2data_paramList().

◆ msr2data_doFitting()

int msr2data_doFitting ( std::vector< std::string > &  arg,
bool &  chainfit 
)

Filters out the template run number (if present) and check at the same time if only already existing msr-files shall be fitted (no template).

return:

  • template runNo if everything is OK
  • -1 : tag: fit only, do not prepare input files
  • -2 : fatal error - more than one fit-<temp> options are specified
  • -3 : fit-<temp> option found, but <temp> is not a valid number
Parameters
arglist of arguments
chainfitif true

Definition at line 303 of file msr2data.cpp.

◆ msr2data_doInputCreation()

int msr2data_doInputCreation ( std::vector< std::string > &  arg,
bool &  inputOnly 
)

Filters out the template run number from which the new msr-files should be created.

return:

  • template run number, or
  • -3 if the string after 'msr-' is not a number
Parameters
arglist of arguments
inputOnlyflag, if true create msr-files only (no fitting)

Definition at line 356 of file msr2data.cpp.

◆ msr2data_outputfile()

std::string msr2data_outputfile ( std::vector< std::string > &  arg,
bool  db = true 
)

filters out the output file name from the argument string

return:

  • output file name if present in the argument list
  • otherwise 'out.db' (db==true), 'out.dat' (db==false)
Parameters
argargument string list from the msr2data call
dbtrue if output file is a db-file

Definition at line 224 of file msr2data.cpp.

◆ msr2data_paramList()

int msr2data_paramList ( std::vector< std::string > &  arg,
std::vector< unsigned int > &  paramList 
)

Definition at line 384 of file msr2data.cpp.

References isNumber(), and msr2data_syntax().

◆ msr2data_syntax()

void msr2data_syntax ( )

Sends the usage description to the standard output.

Definition at line 86 of file msr2data.cpp.

Referenced by msr2data_paramList().

◆ msr2data_useOption()

bool msr2data_useOption ( std::vector< std::string > &  arg,
const std::string &  s 
)

Checks if option string is present in the argument input list

return:

  • true if option is not present
  • false otherwise
Parameters
arglist of arguments
soption string

Definition at line 274 of file msr2data.cpp.

◆ msr2data_validArguments()

std::string msr2data_validArguments ( const std::vector< std::string > &  arg)

Checks if only valid options appear in the argument list

return:

  • empty string if everything is fine
  • first found wrong argument in case of an error
Parameters
arglist of arguments

Definition at line 181 of file msr2data.cpp.