11 #include <boost/tokenizer.hpp>
27 #define MIN_EVENT_FRAGMENT_SIZE 16
30 typedef boost::tokenizer<boost::char_separator<char> >
tokenizer;
39 cout <<
"Constructor of XmasToDQMSource called...." << endl;
105 std::map<std::string, std::string, std::less<std::string> >::iterator
i;
111 std::cout <<
"inside DQMSource::Analyze...ready to lock the data mutex" << std::endl;
116 std::cout <<
"inside DQMSource::Analyze...check (...and possible wait) if data queue is empty" << std::endl;
125 std::cout <<
"inside DQMSource::Analyze...data queue has elements...proceeding..." << std::endl;
130 xdata::Table *ref_table =
NULL;
144 if(ref_table !=
NULL)
147 for (
size_t r = 0;
r < ref_table->numberOfRows_;
r++ )
172 if(ref_table->columnData_[
"runNumber"])
192 boost::char_separator<char> sep(
":/.");
193 tokenizer Context_tokens(ref_table->columnData_[
"Context"]->elementAt(
r)->toString(), sep);
201 host_slot = *(++ Context_tokens.begin());
205 if(ref_table->columnData_[
"slotNumber"])
208 host_slot = host_slot +
"_" + ref_table->columnData_[
"slotNumber"]->elementAt(
r)->toString();
218 std::cout <<
"booking new histogram..." << host_slot << std::endl;
223 HostSlotMap[host_slot]->lastTimestamp = ref_table->columnData_[
"timestamp"]->elementAt(
r)->toString();
246 std::istringstream str2num;
271 boost::char_separator<char> histo_sep(
"[,]");
276 for(tokenizer::iterator itok=Histogram_values.begin(); itok!=Histogram_values.end();++itok)
285 std::istringstream istrfloat(s);
287 istrfloat >> bin_value;
293 HostSlotMap[host_slot]->Histogram1D->setBinContent(iwc-1, bin_value);
297 HostSlotMap[host_slot]->Histogram1D->Fill(bin_value);
312 std::istringstream str2num;
321 if(
HostSlotMap[host_slot]->lastTimestamp == ref_table->columnData_[
"timestamp"]->elementAt(
r)->toString())
329 HostSlotMap[host_slot]->lastTimestamp == ref_table->columnData_[
"timestamp"]->elementAt(
r)->toString();
335 boost::char_separator<char> histo_sep(
"[,]");
340 for(tokenizer::iterator itok=Histogram_values.begin(); itok!=Histogram_values.end();++itok)
349 std::istringstream istrfloat(s);
351 istrfloat >> bin_value;
355 HostSlotMap[host_slot]->Histogram1D->setBinContent(iwc-1, bin_value);
359 HostSlotMap[host_slot]->Histogram1D->Fill(bin_value);
376 std::cout <<
"after poping from the data Queue...."<< std::endl;
404 std::cout <<
"after unlocking the mutex...." << std::endl;
edm::ParameterSet parameters_
xdata::Bag< xmas2dqm::wse::FlashlistElements > flashlistMonitor_
T getUntrackedParameter(std::string const &, T const &) const
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
std::map< std::string, struct Data * > HostSlotMap
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
boost::tokenizer< boost::char_separator< char > > tokenizer
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
XmasToDQMSource(const edm::ParameterSet &)
static ToDqm * instance()
void analyze(const edm::Event &e, const edm::EventSetup &c)
Fake Analyze.
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
DQM Client Diagnostic.
std::queue< xdata::Table * > MemoryTable_
void setCurrentFolder(const std::string &fullpath)