/*************************************************************************** msr2data.cpp Author: Bastian M. Wojek / Andreas Suter e-mail: andreas.suter@psi.ch ***************************************************************************/ /*************************************************************************** * Copyright (C) 2009-2014 by Bastian M. Wojek / Andreas Suter * * andreas.suter@psi.ch * * * * This program 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 2 of the License, or * * (at your option) any later version. * * * * This program 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 this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ // note: msr2data is on purpose implemented in a way that shows string handling can be done solely // using std::string, boost and related standard C++ features // This implies, however, occasionally strange constructs when interoperating with PMusr-classes // which mostly rely on ROOT's TString. #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "git-revision.h" #include "PMsr2Data.h" #include #include #include #include #include #include using namespace std; #include // for to_lower() in std::string using namespace boost::algorithm; #include // for atoi-replacement // #include // for a clean way to check if a file exists //-------------------------------------------------------------------------- /** *

Checks if a string is an integer * *

return: * - true if s is a number string * - false otherwise * * \param s string */ bool isNumber(const string &s) { unsigned int number; try { number = boost::lexical_cast(s); return true; } catch(boost::bad_lexical_cast &) { return false; } } //-------------------------------------------------------------------------- /** *

Sends the usage description to the standard output. */ void msr2data_syntax() { cout << endl << "usage 0: msr2data [--version] | [--help]"; cout << endl << "usage 1: msr2data [-o] [new] [data] [[no]header] [nosummary] [global[+[!]]]"; cout << endl << " [fit [-k] [-t] | fit-