Skip to content

Commit

Permalink
Merge pull request #4086 from deguio/fixDQMStoreForNonRootObj
Browse files Browse the repository at this point in the history
support multithreading also for int, float and string
  • Loading branch information
davidlange6 committed Jun 3, 2014
2 parents 0a28283 + d942e0f commit 7929f6f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
12 changes: 6 additions & 6 deletions DQMServices/Core/src/DQMStore.cc
Expand Up @@ -783,7 +783,7 @@ DQMStore::book(const std::string &dir,
print_trace(dir, name);

// Check if the request monitor element already exists.
if (MonitorElement *me = findObject(dir, name))
if (MonitorElement *me = findObject(dir, name, run_, 0, streamId_, moduleId_))
{
if (verbose_ > 1)
{
Expand All @@ -801,8 +801,8 @@ DQMStore::book(const std::string &dir,
{
// Create it and return for initialisation.
assert(dirs_.count(dir));
MonitorElement nme(&*dirs_.find(dir), name);
return &const_cast<MonitorElement &>(*data_.insert(nme).first);
MonitorElement proto(&*dirs_.find(dir), name, run_, streamId_, moduleId_);
return &const_cast<MonitorElement &>(*data_.insert(proto).first);
}
}

Expand All @@ -813,7 +813,7 @@ DQMStore::bookInt(const std::string &dir, const std::string &name)
{
if (collateHistograms_)
{
if (MonitorElement *me = findObject(dir, name))
if (MonitorElement *me = findObject(dir, name, run_, 0, streamId_, moduleId_))
{
me->Fill(0);
return me;
Expand Down Expand Up @@ -843,7 +843,7 @@ DQMStore::bookFloat(const std::string &dir, const std::string &name)
{
if (collateHistograms_)
{
if (MonitorElement *me = findObject(dir, name))
if (MonitorElement *me = findObject(dir, name, run_, 0, streamId_, moduleId_))
{
me->Fill(0.);
return me;
Expand Down Expand Up @@ -875,7 +875,7 @@ DQMStore::bookString(const std::string &dir,
{
if (collateHistograms_)
{
if (MonitorElement *me = findObject(dir, name))
if (MonitorElement *me = findObject(dir, name, run_, 0, streamId_, moduleId_))
return me;
}

Expand Down
17 changes: 10 additions & 7 deletions DQMServices/FwkIO/plugins/DQMRootSource.cc
Expand Up @@ -190,13 +190,14 @@ namespace {
const std::string& name = iElement->getFullname();
if(name.find("EventInfo/processedEvents") != std::string::npos) {
iElement->Fill(iValue+iElement->getIntValue());
} else {
if(name.find("EventInfo/iEvent") != std::string::npos ||
} else if(name.find("EventInfo/iEvent") != std::string::npos ||
name.find("EventInfo/iLumiSection") != std::string::npos) {
if(iValue > iElement->getIntValue()) {
iElement->Fill(iValue);
}
}
}
else {
iElement->Fill(iValue);
}
}

Expand All @@ -206,13 +207,15 @@ namespace {
return e;
}
void mergeWithElement(MonitorElement* iElement, double& iValue) {
//no merging
//no merging, take the last one
iElement->Fill(iValue);
}
MonitorElement* createElement(DQMStore& iStore, const char* iName, std::string* iValue) {
return iStore.bookString(iName,*iValue);
}
void mergeWithElement(MonitorElement* , std::string* ) {
//no merging
void mergeWithElement(MonitorElement* iElement, std::string* iValue) {
//no merging, take the last one
iElement->Fill(*iValue);
}

void splitName(const std::string& iFullName, std::string& oPath,const char*& oName) {
Expand Down Expand Up @@ -289,7 +292,7 @@ namespace {
template<class T>
class TreeSimpleReader : public TreeReaderBase {
public:
TreeSimpleReader():m_tree(0),m_fullName(0),m_buffer(),m_tag(0){
TreeSimpleReader():m_tree(0),m_fullName(0),m_buffer(0),m_tag(0){
}
virtual MonitorElement* doRead(ULong64_t iIndex, DQMStore& iStore,bool iIsLumi) override {
m_tree->GetEntry(iIndex);
Expand Down

0 comments on commit 7929f6f

Please sign in to comment.