//-------------------------------------------------------------------------- // File and Version Information: // $Id: FsmAbsDet.cc,v 1.2 2006/07/13 10:43:45 klausg Exp $ // // Description: // Class FsmAbsDet // // Response of FsmDet for a FsmTrack // // This software was developed for the PANDA collaboration. If you // use all or part of it, please give an appropriate acknowledgement. // // Author List: // Klaus Goetzen Original Author // // Copyright Information: // Copyright (C) 2006 GSI // //------------------------------------------------------------------------ //----------------------- // This Class's Header -- //----------------------- #include "PndFsmRandom.h" #include "PndFsmAbsDet.h" #include "StrTok.h" //------------- // C Headers -- //------------- //--------------- // C++ Headers -- //--------------- #include #include using std::cout; using std::endl; using std::ostream; using std::string; //------------------------------- // Collaborating Class Headers -- //------------------------------- //#include "ErrLogger/ErrLog.hh" //#include "boost/boost/tokenizer.hpp" //----------------------------------------------------------------------- // Local Macros, Typedefs, Structures, Unions and Forward Declarations -- //----------------------------------------------------------------------- //---------------- // Constructors -- //---------------- PndFsmAbsDet::PndFsmAbsDet() { initParameters(); ArgList par; //set default parameter values and parses a parameter list parseParameterList(par); _rand=PndFsmRandom::Instance(); _fdbPDG = TDatabasePDG::Instance(); } PndFsmAbsDet::PndFsmAbsDet(ArgList &par) { initParameters(); //set default parameter values and parses a parameter list //i.e. std::list of the form //"a=1" "b=2" "c=3" parseParameterList(par); _rand=new TRandom3(); _fdbPDG = TDatabasePDG::Instance(); } //-------------- // Destructor -- //-------------- PndFsmAbsDet::~PndFsmAbsDet() { } //-------------- // Operations -- //-------------- bool PndFsmAbsDet::setParameter(std::string &name, double value) { return false; } bool PndFsmAbsDet::setParameter(std::string &name, std::string &value) { return false; } void PndFsmAbsDet::initParameters() { _detName = "default"; } void PndFsmAbsDet::print(std::ostream &o) { o<<"Detector:"< of the form ("a=1","b=2","c=3","d=4") // Default values for the parameters CStrTok tokenizer; char csrc[200]; if (par.size() != 0) { //cout <<"Parameters for detector <"<<_detName<<">"<data(); strcpy(csrc,src); char* token = tokenizer.GetFirst(csrc,"="); string name(token); //cout <<"variable: -" << name << "- "; token = tokenizer.GetNext("="); double value = atof(token); string strvalue(token); //cout <<"value: -"<"< > tokenizer; boost::char_separator sep("="); tokenizer tokens(*argIt, sep); tokenizer::iterator tok_iter = tokens.begin(); string name(*tok_iter); ++tok_iter; double value=atof((*tok_iter).c_str()); //cout <<"<"< = "< in PndFsmAbsDet::parseParameterList" << endl; } } */ //print(std::cout); }