20 #include <boost/algorithm/string/split.hpp> 21 #include <boost/algorithm/string_regex.hpp> 36 cout <<
"[DTTPGParamsWriter]Constructor called!" << endl;
46 cout <<
"[DTTPGParamsWriter]Destructor called!" << endl;
54 cout <<
"[DTTPGParamsWriter]Reading data from file." << endl;
56 std::ifstream inputFile_(inputFileName_.c_str());
60 while(std::getline(inputFile_, line)) {
64 pharseLine(line,chId,fine,coarse);
70 std::cout <<
"[DTTPGParamsWriter] Read data for chamber " << chId
71 <<
". File params -> fine: " << fine <<
" coarse: " << coarse
72 <<
". DB params -> fine: " << fineDB <<
" coarse: " << coarseDB << std::endl;
77 std::cout <<
"[DTTPGParamsWriter] # of entries written the the DB: " << nLines << std::endl;
80 std::cout <<
"[DTTPGParamsWriter] # of DB entries != 250. Check you input file!" << std::endl;
93 if (elements.size() != 5) {
94 std::cout <<
"[DTTPGParamsWriter] wrong number of entries in line : " << line <<
" pleas check your input file syntax!" << std::endl;
96 chId =
DTChamberId(atoi(elements[0].c_str()),atoi(elements[1].c_str()),atoi(elements[2].c_str()));
97 fine = atof(elements[3].c_str());
98 coarse = atoi(elements[4].c_str());
106 cout <<
"[DTTPGParamsWriter] Writing ttrig object to DB!" << endl;
108 string delayRecord =
"DTTPGParametersRcd";
T getUntrackedParameter(std::string const &, T const &) const
void endJob() override
Write ttrig in the DB.
void pharseLine(std::string &line, DTChamberId &chId, float &fine, int &coarse)
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
Compute the ttrig by fiting the TB rising edge.
~DTTPGParamsWriter() override
Destructor.
static void writeToDB(std::string record, T *payload)
DTTPGParamsWriter(const edm::ParameterSet &pset)
Constructor.