CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DQMRootSource.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FwkIO
4 // Class : DQMRootSource
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Chris Jones
10 // Created: Tue May 3 11:13:47 CDT 2011
11 //
12 
13 // system include files
14 #include <vector>
15 #include <string>
16 #include <map>
17 #include <memory>
18 #include <list>
19 #include <set>
20 #include "TFile.h"
21 #include "TTree.h"
22 #include "TString.h"
23 #include "TH1.h"
24 #include "TH2.h"
25 #include "TProfile.h"
26 
27 // user include files
35 //#include "FWCore/Utilities/interface/GlobalIdentifier.h"
37 
40 
45 
48 
53 
56 
61 
64 
65 #include "format.h"
66 
67 namespace {
68  //adapter functions
69  MonitorElement* createElement(DQMStore& iStore, const char* iName, TH1F* iHist) {
70  //std::cout <<"create: hist size "<<iName <<" "<<iHist->GetEffectiveEntries()<<std::endl;
71  return iStore.book1D(iName, iHist);
72  }
73  //NOTE: the merge logic comes from DataFormats/Histograms/interface/MEtoEDMFormat.h
74  void mergeTogether(TH1* iOriginal,TH1* iToAdd) {
75  if(iOriginal->TestBit(TH1::kCanRebin)==true && iToAdd->TestBit(TH1::kCanRebin) ==true) {
76  TList list;
77  list.Add(iToAdd);
78  if( -1 == iOriginal->Merge(&list)) {
79  edm::LogError("MergeFailure")<<"Failed to merge DQM element "<<iOriginal->GetName();
80  }
81  } else {
82  if (iOriginal->GetNbinsX() == iToAdd->GetNbinsX() &&
83  iOriginal->GetXaxis()->GetXmin() == iToAdd->GetXaxis()->GetXmin() &&
84  iOriginal->GetXaxis()->GetXmax() == iToAdd->GetXaxis()->GetXmax() &&
85  iOriginal->GetNbinsY() == iToAdd->GetNbinsY() &&
86  iOriginal->GetYaxis()->GetXmin() == iToAdd->GetYaxis()->GetXmin() &&
87  iOriginal->GetYaxis()->GetXmax() == iToAdd->GetYaxis()->GetXmax() &&
88  iOriginal->GetNbinsZ() == iToAdd->GetNbinsZ() &&
89  iOriginal->GetZaxis()->GetXmin() == iToAdd->GetZaxis()->GetXmin() &&
90  iOriginal->GetZaxis()->GetXmax() == iToAdd->GetZaxis()->GetXmax() &&
91  MonitorElement::CheckBinLabels(iOriginal->GetXaxis(),iToAdd->GetXaxis()) &&
92  MonitorElement::CheckBinLabels(iOriginal->GetYaxis(),iToAdd->GetYaxis()) &&
93  MonitorElement::CheckBinLabels(iOriginal->GetZaxis(),iToAdd->GetZaxis())) {
94  iOriginal->Add(iToAdd);
95  } else {
96  edm::LogError("MergeFailure")<<"Found histograms with different axis limits or different labels'"<<iOriginal->GetName()<<"' not merged.";
97  }
98  }
99  }
100 
101  void mergeWithElement(MonitorElement* iElement, TH1F* iHist) {
102  //std::cout <<"merge: hist size "<<iElement->getName() <<" "<<iHist->GetEffectiveEntries()<<std::endl;
103  mergeTogether(iElement->getTH1F(),iHist);
104  }
105  MonitorElement* createElement(DQMStore& iStore, const char* iName, TH1S* iHist) {
106  return iStore.book1S(iName, iHist);
107  }
108  void mergeWithElement(MonitorElement* iElement, TH1S* iHist) {
109  mergeTogether(iElement->getTH1S(),iHist);
110  }
111  MonitorElement* createElement(DQMStore& iStore, const char* iName, TH1D* iHist) {
112  return iStore.book1DD(iName, iHist);
113  }
114  void mergeWithElement(MonitorElement* iElement, TH1D* iHist) {
115  mergeTogether(iElement->getTH1D(),iHist);
116  }
117  MonitorElement* createElement(DQMStore& iStore, const char* iName, TH2F* iHist) {
118  return iStore.book2D(iName, iHist);
119  }
120  void mergeWithElement(MonitorElement* iElement, TH2F* iHist) {
121  mergeTogether(iElement->getTH2F(),iHist);
122  }
123  MonitorElement* createElement(DQMStore& iStore, const char* iName, TH2S* iHist) {
124  return iStore.book2S(iName, iHist);
125  }
126  void mergeWithElement(MonitorElement* iElement, TH2S* iHist) {
127  mergeTogether(iElement->getTH2S(),iHist);
128  }
129  MonitorElement* createElement(DQMStore& iStore, const char* iName, TH2D* iHist) {
130  return iStore.book2DD(iName, iHist);
131  }
132  void mergeWithElement(MonitorElement* iElement, TH2D* iHist) {
133  mergeTogether(iElement->getTH2D(),iHist);
134  }
135  MonitorElement* createElement(DQMStore& iStore, const char* iName, TH3F* iHist) {
136  return iStore.book3D(iName, iHist);
137  }
138  void mergeWithElement(MonitorElement* iElement, TH3F* iHist) {
139  mergeTogether(iElement->getTH3F(),iHist);
140  }
141  MonitorElement* createElement(DQMStore& iStore, const char* iName, TProfile* iHist) {
142  return iStore.bookProfile(iName, iHist);
143  }
144  void mergeWithElement(MonitorElement* iElement, TProfile* iHist) {
145  mergeTogether(iElement->getTProfile(),iHist);
146  }
147  MonitorElement* createElement(DQMStore& iStore, const char* iName, TProfile2D* iHist) {
148  return iStore.bookProfile2D(iName, iHist);
149  }
150  void mergeWithElement(MonitorElement* iElement, TProfile2D* iHist) {
151  mergeTogether(iElement->getTProfile2D(),iHist);
152  }
153 
154  MonitorElement* createElement(DQMStore& iStore, const char* iName, Long64_t& iValue) {
155  MonitorElement* e = iStore.bookInt(iName);
156  e->Fill(iValue);
157  return e;
158  }
159 
160  //NOTE: the merge logic comes from DataFormats/Histograms/interface/MEtoEDMFormat.h
161  void mergeWithElement(MonitorElement* iElement, Long64_t& iValue) {
162  const std::string& name = iElement->getFullname();
163  if(name.find("EventInfo/processedEvents") != std::string::npos) {
164  iElement->Fill(iValue+iElement->getIntValue());
165  } else if(name.find("EventInfo/iEvent") != std::string::npos ||
166  name.find("EventInfo/iLumiSection") != std::string::npos) {
167  if(iValue > iElement->getIntValue()) {
168  iElement->Fill(iValue);
169  }
170  }
171  else {
172  iElement->Fill(iValue);
173  }
174  }
175 
176  MonitorElement* createElement(DQMStore& iStore, const char* iName, double& iValue) {
177  MonitorElement* e = iStore.bookFloat(iName);
178  e->Fill(iValue);
179  return e;
180  }
181  void mergeWithElement(MonitorElement* iElement, double& iValue) {
182  //no merging, take the last one
183  iElement->Fill(iValue);
184  }
185  MonitorElement* createElement(DQMStore& iStore, const char* iName, std::string* iValue) {
186  return iStore.bookString(iName,*iValue);
187  }
188  void mergeWithElement(MonitorElement* iElement, std::string* iValue) {
189  //no merging, take the last one
190  iElement->Fill(*iValue);
191  }
192 
193  void splitName(const std::string& iFullName, std::string& oPath,const char*& oName) {
194  oPath = iFullName;
195  size_t index = oPath.find_last_of('/');
196  if(index == std::string::npos) {
197  oPath = std::string();
198  oName = iFullName.c_str();
199  } else {
200  oPath.resize(index);
201  oName = iFullName.c_str()+index+1;
202  }
203  }
204 
205  struct RunLumiToRange {
206  unsigned int m_run, m_lumi,m_historyIDIndex;
207  ULong64_t m_beginTime;
208  ULong64_t m_endTime;
209  ULong64_t m_firstIndex, m_lastIndex; //last is inclusive
210  unsigned int m_type; //A value in TypeIndex
211  };
212 
213  class TreeReaderBase {
214  public:
215  TreeReaderBase() {}
216  virtual ~TreeReaderBase() {}
217 
218  MonitorElement* read(ULong64_t iIndex, DQMStore& iStore, bool iIsLumi){
219  return doRead(iIndex,iStore,iIsLumi);
220  }
221  virtual void setTree(TTree* iTree) =0;
222  protected:
223  TTree* m_tree;
224  private:
225  virtual MonitorElement* doRead(ULong64_t iIndex, DQMStore& iStore, bool iIsLumi)=0;
226  };
227 
228  template<class T>
229  class TreeObjectReader: public TreeReaderBase {
230  public:
231  TreeObjectReader():m_tree(0),m_fullName(0),m_buffer(0),m_tag(0){
232  }
233  virtual MonitorElement* doRead(ULong64_t iIndex, DQMStore& iStore, bool iIsLumi) override {
234  m_tree->GetEntry(iIndex);
235  MonitorElement* element = iStore.get(*m_fullName);
236  if(0 == element) {
238  const char* name;
239  splitName(*m_fullName, path,name);
240  iStore.setCurrentFolder(path);
241  element = createElement(iStore,name,m_buffer);
242  if(iIsLumi) { element->setLumiFlag();}
243  } else {
244  mergeWithElement(element,m_buffer);
245  }
246  if(0!= m_tag) {
247  iStore.tag(element,m_tag);
248  }
249  return element;
250  }
251  virtual void setTree(TTree* iTree) override {
252  m_tree = iTree;
253  m_tree->SetBranchAddress(kFullNameBranch,&m_fullName);
254  m_tree->SetBranchAddress(kFlagBranch,&m_tag);
255  m_tree->SetBranchAddress(kValueBranch,&m_buffer);
256  }
257  private:
258  TTree* m_tree;
259  std::string* m_fullName;
260  T* m_buffer;
261  uint32_t m_tag;
262  };
263 
264  template<class T>
265  class TreeSimpleReader : public TreeReaderBase {
266  public:
267  TreeSimpleReader():m_tree(0),m_fullName(0),m_buffer(0),m_tag(0){
268  }
269  virtual MonitorElement* doRead(ULong64_t iIndex, DQMStore& iStore,bool iIsLumi) override {
270  m_tree->GetEntry(iIndex);
271  MonitorElement* element = iStore.get(*m_fullName);
272  if(0 == element) {
274  const char* name;
275  splitName(*m_fullName, path,name);
276  iStore.setCurrentFolder(path);
277  element = createElement(iStore,name,m_buffer);
278  if(iIsLumi) { element->setLumiFlag();}
279  } else {
280  mergeWithElement(element, m_buffer);
281  }
282  if(0!=m_tag) {
283  iStore.tag(element,m_tag);
284  }
285  return element;
286  }
287  virtual void setTree(TTree* iTree) override {
288  m_tree = iTree;
289  m_tree->SetBranchAddress(kFullNameBranch,&m_fullName);
290  m_tree->SetBranchAddress(kFlagBranch,&m_tag);
291  m_tree->SetBranchAddress(kValueBranch,&m_buffer);
292  }
293  private:
294  TTree* m_tree;
295  std::string* m_fullName;
296  T m_buffer;
297  uint32_t m_tag;
298  };
299 
300 }
301 
303 {
304 
305  public:
307  virtual ~DQMRootSource();
308 
309  // ---------- const member functions ---------------------
310 
311  // ---------- static member functions --------------------
312 
313  // ---------- member functions ---------------------------
314  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
315 
316  private:
317 
318  DQMRootSource(const DQMRootSource&); // stop default
319 
320  class RunPHIDKey {
321  public:
322  RunPHIDKey(edm::ProcessHistoryID const& phid, unsigned int run) :
323  processHistoryID_(phid), run_(run) { }
325  unsigned int run() const { return run_; }
326  bool operator<(RunPHIDKey const& right) const {
327  if (processHistoryID_ == right.processHistoryID()) {
328  return run_ < right.run();
329  }
330  return processHistoryID_ < right.processHistoryID();
331  }
332  private:
334  unsigned int run_;
335  };
336 
338  public:
339  RunLumiPHIDKey(edm::ProcessHistoryID const& phid, unsigned int run, unsigned int lumi) :
340  processHistoryID_(phid), run_(run), lumi_(lumi) { }
342  unsigned int run() const { return run_; }
343  unsigned int lumi() const { return lumi_; }
344  bool operator<(RunLumiPHIDKey const& right) const {
345  if (processHistoryID_ == right.processHistoryID()) {
346  if (run_ == right.run()) {
347  return lumi_ < right.lumi();
348  }
349  return run_ < right.run();
350  }
351  return processHistoryID_ < right.processHistoryID();
352  }
353  private:
355  unsigned int run_;
356  unsigned int lumi_;
357  };
358 
359  virtual edm::InputSource::ItemType getNextItemType() override;
360  //NOTE: the following is really read next run auxiliary
361  virtual boost::shared_ptr<edm::RunAuxiliary> readRunAuxiliary_() override ;
362  virtual boost::shared_ptr<edm::LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_() override ;
363  virtual void readRun_(edm::RunPrincipal& rpCache) override;
364  virtual void readLuminosityBlock_(edm::LuminosityBlockPrincipal& lbCache) override;
365  virtual void readEvent_(edm::EventPrincipal&) override ;
366 
367  virtual std::unique_ptr<edm::FileBlock> readFile_() override;
368  virtual void closeFile_() override;
369 
370  void logFileAction(char const* msg, char const* fileName) const;
371 
372  void readNextItemType();
373  bool setupFile(unsigned int iIndex);
374  void readElements();
376 
377  const DQMRootSource& operator=(const DQMRootSource&); // stop default
378 
379  // ---------- member data --------------------------------
384 
385  size_t m_fileIndex;
387  std::list<unsigned int>::iterator m_nextIndexItr;
388  std::list<unsigned int>::iterator m_presentIndexItr;
389  std::vector<RunLumiToRange> m_runlumiToRange;
390  std::auto_ptr<TFile> m_file;
391  std::vector<TTree*> m_trees;
392  std::vector<boost::shared_ptr<TreeReaderBase> > m_treeReaders;
393 
394  std::list<unsigned int> m_orderedIndices;
396  unsigned int m_lastSeenRun;
398  unsigned int m_lastSeenRun2;
399  unsigned int m_lastSeenLumi2;
400  unsigned int m_filterOnRun;
402  std::vector<edm::LuminosityBlockRange> m_lumisToProcess;
403  std::vector<edm::RunNumber_t> m_runsToProcess;
404 
407  std::set<MonitorElement*> m_lumiElements;
408  std::set<MonitorElement*> m_runElements;
409  std::vector<edm::ProcessHistoryID> m_historyIDs;
410  std::vector<edm::ProcessHistoryID> m_reducedHistoryIDs;
411 
413 };
414 
415 //
416 // constants, enums and typedefs
417 //
418 
419 //
420 // static data member definitions
421 //
422 
423 void
426  desc.addUntracked<std::vector<std::string> >("fileNames")
427  ->setComment("Names of files to be processed.");
428  desc.addUntracked<unsigned int>("filterOnRun",0)
429  ->setComment("Just limit the process to the selected run.");
430  desc.addUntracked<bool>("skipBadFiles",false)
431  ->setComment("Skip the file if it is not valid");
432  desc.addUntracked<std::string>("overrideCatalog",std::string())
433  ->setComment("An alternate file catalog to use instead of the standard site one.");
434  std::vector<edm::LuminosityBlockRange> defaultLumis;
435  desc.addUntracked<std::vector<edm::LuminosityBlockRange> >("lumisToProcess",defaultLumis)
436  ->setComment("Skip any lumi inside the specified run:lumi range.");
437 
438  descriptions.addDefault(desc);
439 }
440 //
441 // constructors and destructor
442 //
444  edm::InputSource(iPSet,iDesc),
445  m_catalog(iPSet.getUntrackedParameter<std::vector<std::string> >("fileNames"),
446  iPSet.getUntrackedParameter<std::string>("overrideCatalog")),
447  m_nextItemType(edm::InputSource::IsFile),
448  m_fileIndex(0),
449  m_presentlyOpenFileIndex(0),
450  m_trees(kNIndicies,static_cast<TTree*>(0)),
451  m_treeReaders(kNIndicies,boost::shared_ptr<TreeReaderBase>()),
452  m_lastSeenReducedPHID(),
453  m_lastSeenRun(0),
454  m_lastSeenReducedPHID2(),
455  m_lastSeenRun2(0),
456  m_lastSeenLumi2(0),
457  m_filterOnRun(iPSet.getUntrackedParameter<unsigned int>("filterOnRun", 0)),
458  m_skipBadFiles(iPSet.getUntrackedParameter<bool>("skipBadFiles", false)),
459  m_lumisToProcess(iPSet.getUntrackedParameter<std::vector<edm::LuminosityBlockRange> >("lumisToProcess",std::vector<edm::LuminosityBlockRange>())),
460  m_justOpenedFileSoNeedToGenerateRunTransition(false),
461  m_shouldReadMEs(true)
462 {
464  for(std::vector<edm::LuminosityBlockRange>::const_iterator itr = m_lumisToProcess.begin(); itr!=m_lumisToProcess.end(); ++itr)
465  m_runsToProcess.push_back(itr->startRun());
466 
467  if(m_fileIndex ==m_catalog.fileNames().size()) {
469  } else{
470  m_treeReaders[kIntIndex].reset(new TreeSimpleReader<Long64_t>());
471  m_treeReaders[kFloatIndex].reset(new TreeSimpleReader<double>());
472  m_treeReaders[kStringIndex].reset(new TreeObjectReader<std::string>());
473  m_treeReaders[kTH1FIndex].reset(new TreeObjectReader<TH1F>());
474  m_treeReaders[kTH1SIndex].reset(new TreeObjectReader<TH1S>());
475  m_treeReaders[kTH1DIndex].reset(new TreeObjectReader<TH1D>());
476  m_treeReaders[kTH2FIndex].reset(new TreeObjectReader<TH2F>());
477  m_treeReaders[kTH2SIndex].reset(new TreeObjectReader<TH2S>());
478  m_treeReaders[kTH2DIndex].reset(new TreeObjectReader<TH2D>());
479  m_treeReaders[kTH3FIndex].reset(new TreeObjectReader<TH3F>());
480  m_treeReaders[kTProfileIndex].reset(new TreeObjectReader<TProfile>());
481  m_treeReaders[kTProfile2DIndex].reset(new TreeObjectReader<TProfile2D>());
482  }
483 }
484 
485 // DQMRootSource::DQMRootSource(const DQMRootSource& rhs)
486 // {
487 // // do actual copying here;
488 // }
489 
491 {
492  if(m_file.get() != 0 && m_file->IsOpen()) {
493  m_file->Close();
494  logFileAction(" Closed file ", m_catalog.fileNames()[m_presentlyOpenFileIndex].c_str());
495  }
496 }
497 
498 //
499 // assignment operators
500 //
501 // const DQMRootSource& DQMRootSource::operator=(const DQMRootSource& rhs)
502 // {
503 // //An exception safe implementation is
504 // DQMRootSource temp(rhs);
505 // swap(rhs);
506 //
507 // return *this;
508 // }
509 
510 //
511 // member functions
512 //
514 {
515  //std::cout << "readEvent_" << std::endl;
516 }
517 
519 {
520  //std::cout <<"getNextItemType "<<m_nextItemType<<std::endl;
521  return m_nextItemType;
522 }
523 
524 boost::shared_ptr<edm::RunAuxiliary> DQMRootSource::readRunAuxiliary_()
525 {
526  //std::cout <<"readRunAuxiliary_"<<std::endl;
527  assert(m_nextIndexItr != m_orderedIndices.end());
528  RunLumiToRange runLumiRange = m_runlumiToRange[*m_nextIndexItr];
529 
530  //NOTE: the setBeginTime and setEndTime functions of RunAuxiliary only work if the previous value was invalid
531  // therefore we must copy
532  m_runAux = edm::RunAuxiliary(runLumiRange.m_run,edm::Timestamp(runLumiRange.m_beginTime),edm::Timestamp(runLumiRange.m_endTime));
533  assert(m_historyIDs.size() > runLumiRange.m_historyIDIndex);
534  //std::cout <<"readRunAuxiliary_ "<<m_historyIDs[runLumiRange.m_historyIDIndex]<<std::endl;
535  m_runAux.setProcessHistoryID(m_historyIDs[runLumiRange.m_historyIDIndex]);
536  return boost::shared_ptr<edm::RunAuxiliary>( new edm::RunAuxiliary(m_runAux) );
537 }
538 
539 boost::shared_ptr<edm::LuminosityBlockAuxiliary>
541 {
542  //std::cout <<"readLuminosityBlockAuxiliary_"<<std::endl;
543  assert(m_nextIndexItr != m_orderedIndices.end());
544  const RunLumiToRange runLumiRange = m_runlumiToRange[*m_nextIndexItr];
545  m_lumiAux = edm::LuminosityBlockAuxiliary(edm::LuminosityBlockID(runLumiRange.m_run,runLumiRange.m_lumi),
546  edm::Timestamp(runLumiRange.m_beginTime),
547  edm::Timestamp(runLumiRange.m_endTime));
548  assert(m_historyIDs.size() > runLumiRange.m_historyIDIndex);
549  //std::cout <<"lumi "<<m_lumiAux.beginTime().value()<<" "<<runLumiRange.m_beginTime<<std::endl;
550  m_lumiAux.setProcessHistoryID(m_historyIDs[runLumiRange.m_historyIDIndex]);
551 
552  return boost::shared_ptr<edm::LuminosityBlockAuxiliary>(new edm::LuminosityBlockAuxiliary(m_lumiAux));
553 }
554 
555 void
557 {
558  assert(m_presentIndexItr != m_orderedIndices.end());
559  RunLumiToRange runLumiRange = m_runlumiToRange[*m_presentIndexItr];
560 
562  unsigned int runID =rpCache.id().run();
563  assert(runID == runLumiRange.m_run);
564 
565  m_shouldReadMEs = (m_filterOnRun == 0 ||
566  (m_filterOnRun != 0 && m_filterOnRun == runID));
567  // std::cout <<"readRun_"<<std::endl;
568  // std::cout <<"m_shouldReadMEs " << m_shouldReadMEs <<std::endl;
569 
580  //NOTE: need to reset all run elements at this point
581  if( m_lastSeenRun != runID ||
582  m_lastSeenReducedPHID != m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex) ) {
583  if (m_shouldReadMEs) {
585  std::vector<MonitorElement*> allMEs = (*store).getAllContents("");
586  for(auto const& ME : allMEs) {
587  // We do not want to reset here Lumi products, since a dedicated
588  // resetting is done at every lumi transition.
589  if (ME->getLumiFlag()) continue;
590  if ( !(*store).isCollate() )
591  ME->Reset();
592  }
593  }
594  m_lastSeenReducedPHID = m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex);
595  m_lastSeenRun = runID;
596  }
597 
599 
600  //NOTE: it is possible to have a Run when all we have stored is lumis
601  if(runLumiRange.m_lumi == 0) {
602  readElements();
603  }
604 
605 
607  jr->reportInputRunNumber(rpCache.id().run());
608 
610 }
611 
612 
613 void
615 {
616  assert(m_presentIndexItr != m_orderedIndices.end());
617  RunLumiToRange runLumiRange = m_runlumiToRange[*m_presentIndexItr];
618  assert(runLumiRange.m_run == lbCache.id().run());
619  assert(runLumiRange.m_lumi == lbCache.id().luminosityBlock());
620 
621  //NOTE: need to reset all lumi block elements at this point
622  if( ( m_lastSeenLumi2 != runLumiRange.m_lumi ||
623  m_lastSeenRun2 != runLumiRange.m_run ||
624  m_lastSeenReducedPHID2 != m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex) )
625  && m_shouldReadMEs) {
626 
628  std::vector<MonitorElement*> allMEs = (*store).getAllContents("");
629  for(auto const& ME : allMEs) {
630  // We do not want to reset Run Products here!
631  if (ME->getLumiFlag()) {
632  ME->Reset();
633  }
634  }
635  m_lastSeenReducedPHID2 = m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex);
636  m_lastSeenRun2 = runLumiRange.m_run;
637  m_lastSeenLumi2 = runLumiRange.m_lumi;
638  }
639 
641  readElements();
642 
644  jr->reportInputLumiSection(lbCache.id().run(),lbCache.id().luminosityBlock());
645 
647 
648 }
649 
650 std::unique_ptr<edm::FileBlock>
652  auto const numFiles = m_catalog.fileNames().size();
653  while(m_fileIndex < numFiles && not setupFile(m_fileIndex++)) {}
654 
655  if(m_file.get() == nullptr) {
656  //last file in list was bad
658  return std::unique_ptr<edm::FileBlock>(new edm::FileBlock);
659  }
660 
664 
668  std::string(),
669  std::string(),
670  "DQMRootSource",
671  "source",
672  m_file->GetUUID().AsString(),//edm::createGlobalIdentifier(),
673  std::vector<std::string>()
674  );
675 
676  return std::unique_ptr<edm::FileBlock>(new edm::FileBlock);
677 }
678 
679 void
681  if(m_file.get()==nullptr) { return; }
684 }
685 
688  RunLumiToRange runLumiRange = m_runlumiToRange[*m_presentIndexItr];
689  bool shouldContinue = false;
690  do
691  {
692  shouldContinue = false;
696 
697  if(runLumiRange.m_type == kNoTypesStored) {continue;}
698  boost::shared_ptr<TreeReaderBase> reader = m_treeReaders[runLumiRange.m_type];
699  ULong64_t index = runLumiRange.m_firstIndex;
700  ULong64_t endIndex = runLumiRange.m_lastIndex+1;
701  for (; index != endIndex; ++index)
702  {
703  bool isLumi = runLumiRange.m_lumi !=0;
704  if (m_shouldReadMEs)
705  reader->read(index,*store,isLumi);
706 
707  //std::cout << runLumiRange.m_run << " " << runLumiRange.m_lumi <<" "<<index<< " " << runLumiRange.m_type << std::endl;
708  }
709  if (m_presentIndexItr != m_orderedIndices.end())
710  {
711  //are there more parts to this same run/lumi?
712  const RunLumiToRange nextRunLumiRange = m_runlumiToRange[*m_presentIndexItr];
713  //continue to the next item if that item is either
714  if ( (m_reducedHistoryIDs.at(nextRunLumiRange.m_historyIDIndex) == m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex)) &&
715  (nextRunLumiRange.m_run == runLumiRange.m_run) &&
716  (nextRunLumiRange.m_lumi == runLumiRange.m_lumi) )
717  {
718  shouldContinue= true;
719  runLumiRange = nextRunLumiRange;
720  }
721  }
722  } while(shouldContinue);
723 }
724 
726 {
727  //Do the work of actually figuring out where next to go
728 
729  assert (m_nextIndexItr != m_orderedIndices.end());
730  RunLumiToRange runLumiRange = m_runlumiToRange[*m_nextIndexItr];
731 
733  if (runLumiRange.m_lumi != 0 && m_nextItemType == edm::InputSource::IsRun) {
735  return;
736  }
737  ++m_nextIndexItr;
738  }
739  else
740  {
741  //NOTE: the following makes the iterator not be advanced in the
742  //do while loop below.
743  runLumiRange.m_run=0;
744  }
745 
746  bool shouldContinue = false;
747  do
748  {
749  shouldContinue = false;
751  ++m_nextIndexItr;
752 
753  if (m_nextIndexItr == m_orderedIndices.end())
754  {
755  //go to next file
757  //std::cout <<"going to next file"<<std::endl;
758  if(m_fileIndex == m_catalog.fileNames().size()) {
760  }
761  break;
762  }
763  const RunLumiToRange nextRunLumiRange = m_runlumiToRange[*m_nextIndexItr];
764  //continue to the next item if that item is the same run or lumi as we just did
765  if( (m_reducedHistoryIDs.at(nextRunLumiRange.m_historyIDIndex) == m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex) ) &&
766  (nextRunLumiRange.m_run == runLumiRange.m_run) &&
767  (nextRunLumiRange.m_lumi == runLumiRange.m_lumi) ) {
768  shouldContinue= true;
769  ++m_nextIndexItr;
770  //std::cout <<"advancing " <<nextRunLumiRange.m_run<<" "<<nextRunLumiRange.m_lumi<<std::endl;
771  }
772  } while(shouldContinue);
773 
774  if(m_nextIndexItr != m_orderedIndices.end()) {
779  } else {
781  }
782  }
783 }
784 
785 bool
786 DQMRootSource::setupFile(unsigned int iIndex)
787 {
788  if(m_file.get() != 0 && iIndex > 0) {
789  m_file->Close();
790  logFileAction(" Closed file ", m_catalog.fileNames()[iIndex-1].c_str());
791  }
792  logFileAction(" Initiating request to open file ", m_catalog.fileNames()[iIndex].c_str());
793  m_presentlyOpenFileIndex = iIndex;
794  m_file.reset();
795  std::auto_ptr<TFile> newFile;
796  try {
797  newFile = std::auto_ptr<TFile>(TFile::Open(m_catalog.fileNames()[iIndex].c_str()));
798  } catch(cms::Exception const& e) {
799  if(!m_skipBadFiles) {
801  ex.addContext("Opening DQM Root file");
802  ex <<"\nInput file " << m_catalog.fileNames()[iIndex] << " was not found, could not be opened, or is corrupted.\n";
803  throw ex;
804  }
805  return 0;
806  }
807  if(not newFile->IsZombie()) {
808  logFileAction(" Successfully opened file ", m_catalog.fileNames()[iIndex].c_str());
809  } else {
810  if(!m_skipBadFiles) {
812  ex<<"Input file "<<m_catalog.fileNames()[iIndex].c_str() <<" could not be opened.\n";
813  ex.addContext("Opening DQM Root file");
814  throw ex;
815  }
816  return 0;
817  }
818  //Check file format version, which is encoded in the Title of the TFile
819  if(0 != strcmp(newFile->GetTitle(),"1")) {
821  ex<<"Input file "<<m_catalog.fileNames()[iIndex].c_str() <<" does not appear to be a DQM Root file.\n";
822  }
823 
824  //Get meta Data
825  TDirectory* metaDir = newFile->GetDirectory(kMetaDataDirectoryAbsolute);
826  if(0==metaDir) {
827  if(!m_skipBadFiles) {
829  ex<<"Input file "<<m_catalog.fileNames()[iIndex].c_str() <<" appears to be corrupted since it does not have the proper internal structure.\n"
830  " Check to see if the file was closed properly.\n";
831  ex.addContext("Opening DQM Root file");
832  throw ex;
833  }
834  else {return 0;}
835  }
836  m_file = newFile; //passed all tests so now we want to use this file
837  TTree* parameterSetTree = dynamic_cast<TTree*>(metaDir->Get(kParameterSetTree));
838  assert(0!=parameterSetTree);
839 
841  assert(0!=psr);
842  {
843  std::string blob;
844  std::string* pBlob = &blob;
845  parameterSetTree->SetBranchAddress(kParameterSetBranch,&pBlob);
846  for(unsigned int index = 0; index != parameterSetTree->GetEntries();++index)
847  {
848  parameterSetTree->GetEntry(index);
850  }
851  }
852 
853  {
854  TTree* processHistoryTree = dynamic_cast<TTree*>(metaDir->Get(kProcessHistoryTree));
855  assert(0!=processHistoryTree);
856  unsigned int phIndex = 0;
857  processHistoryTree->SetBranchAddress(kPHIndexBranch,&phIndex);
858  std::string processName;
859  std::string* pProcessName = &processName;
860  processHistoryTree->SetBranchAddress(kProcessConfigurationProcessNameBranch,&pProcessName);
861  std::string parameterSetIDBlob;
862  std::string* pParameterSetIDBlob = &parameterSetIDBlob;
863  processHistoryTree->SetBranchAddress(kProcessConfigurationParameterSetIDBranch,&pParameterSetIDBlob);
864  std::string releaseVersion;
865  std::string* pReleaseVersion = &releaseVersion;
866  processHistoryTree->SetBranchAddress(kProcessConfigurationReleaseVersion,&pReleaseVersion);
867  std::string passID;
868  std::string* pPassID = &passID;
869  processHistoryTree->SetBranchAddress(kProcessConfigurationPassID,&pPassID);
870 
872  std::vector<edm::ProcessConfiguration> configs;
873  configs.reserve(5);
874  m_historyIDs.clear();
875  m_reducedHistoryIDs.clear();
876  for(unsigned int i=0; i != processHistoryTree->GetEntries(); ++i) {
877  processHistoryTree->GetEntry(i);
878  if(phIndex==0) {
879  if(not configs.empty()) {
880  edm::ProcessHistory ph(configs);
881  m_historyIDs.push_back(ph.id());
882  phr.registerProcessHistory(ph);
883  m_reducedHistoryIDs.push_back(phr.reducedProcessHistoryID(ph.id()));
884  }
885  configs.clear();
886  }
887  edm::ParameterSetID psetID(parameterSetIDBlob);
888  edm::ProcessConfiguration pc(processName, psetID,releaseVersion,passID);
889  configs.push_back(pc);
890  }
891  if(not configs.empty()) {
892  edm::ProcessHistory ph(configs);
893  m_historyIDs.push_back(ph.id());
894  phr.registerProcessHistory(ph);
895  m_reducedHistoryIDs.push_back(phr.reducedProcessHistoryID(ph.id()));
896  //std::cout <<"inserted "<<ph.id()<<std::endl;
897  }
898  }
899 
900  //Setup the indices
901  TTree* indicesTree = dynamic_cast<TTree*>(m_file->Get(kIndicesTree));
902  assert(0!=indicesTree);
903 
904  m_runlumiToRange.clear();
905  m_runlumiToRange.reserve(indicesTree->GetEntries());
906  m_orderedIndices.clear();
907 
908  RunLumiToRange temp;
909  indicesTree->SetBranchAddress(kRunBranch,&temp.m_run);
910  indicesTree->SetBranchAddress(kLumiBranch,&temp.m_lumi);
911  indicesTree->SetBranchAddress(kBeginTimeBranch,&temp.m_beginTime);
912  indicesTree->SetBranchAddress(kEndTimeBranch,&temp.m_endTime);
913  indicesTree->SetBranchAddress(kProcessHistoryIndexBranch,&temp.m_historyIDIndex);
914  indicesTree->SetBranchAddress(kTypeBranch,&temp.m_type);
915  indicesTree->SetBranchAddress(kFirstIndex,&temp.m_firstIndex);
916  indicesTree->SetBranchAddress(kLastIndex,&temp.m_lastIndex);
917 
918  //Need to reorder items since if there was a merge done the same Run
919  //and/or Lumi can appear multiple times but we want to process them
920  //all at once
921 
922  //We use a std::list for m_orderedIndices since inserting into the
923  //middle of a std::list does not disrupt the iterators to already
924  //existing entries
925 
926  //The Map is used to see if a Run/Lumi pair has appeared before
927  typedef std::map<RunLumiPHIDKey, std::list<unsigned int>::iterator > RunLumiToLastEntryMap;
928  RunLumiToLastEntryMap runLumiToLastEntryMap;
929 
930  //Need to group all lumis for the same run together and move the run
931  //entry to the beginning
932  typedef std::map<RunPHIDKey, std::pair< std::list<unsigned int>::iterator, std::list<unsigned int>::iterator> > RunToFirstLastEntryMap;
933  RunToFirstLastEntryMap runToFirstLastEntryMap;
934 
935  for (Long64_t index = 0; index != indicesTree->GetEntries(); ++index)
936  {
937  indicesTree->GetEntry(index);
938 // std::cout <<"read r:"<<temp.m_run
939 // <<" l:"<<temp.m_lumi
940 // <<" b:"<<temp.m_beginTime
941 // <<" e:"<<temp.m_endTime
942 // <<" fi:" << temp.m_firstIndex
943 // <<" li:" << temp.m_lastIndex
944 // <<" type:" << temp.m_type << std::endl;
945  m_runlumiToRange.push_back(temp);
946 
947  RunLumiPHIDKey runLumi(m_reducedHistoryIDs.at(temp.m_historyIDIndex), temp.m_run, temp.m_lumi);
948  RunPHIDKey runKey(m_reducedHistoryIDs.at(temp.m_historyIDIndex), temp.m_run);
949 
950  RunLumiToLastEntryMap::iterator itFind = runLumiToLastEntryMap.find(runLumi);
951  if (itFind == runLumiToLastEntryMap.end())
952  {
953  //does not already exist
954  //does the run for this already exist?
955  std::list<unsigned int>::iterator itLastOfRun = m_orderedIndices.end();
956 
957  RunToFirstLastEntryMap::iterator itRunFirstLastEntryFind = runToFirstLastEntryMap.find(runKey);
958  bool needNewEntryInRunFirstLastEntryMap = true;
959  if (itRunFirstLastEntryFind != runToFirstLastEntryMap.end())
960  {
961  needNewEntryInRunFirstLastEntryMap=false;
962  if (temp.m_lumi!=0)
963  {
964  //lumis go to the end
965  itLastOfRun = itRunFirstLastEntryFind->second.second;
966  //we want to insert after this one so must advance the iterator
967  ++itLastOfRun;
968  }
969  else
970  {
971  //runs go at the beginning
972  itLastOfRun = itRunFirstLastEntryFind->second.first;
973  }
974  }
975  std::list<unsigned int>::iterator iter = m_orderedIndices.insert(itLastOfRun,index);
976  runLumiToLastEntryMap[runLumi]=iter;
977  if (needNewEntryInRunFirstLastEntryMap)
978  runToFirstLastEntryMap[runKey]=std::make_pair(iter,iter);
979  else
980  {
981  if(temp.m_lumi!=0)
982  {
983  //lumis go at end
984  runToFirstLastEntryMap[runKey].second = iter;
985  }
986  else
987  {
988  //since we haven't yet seen this run/lumi combination it means we haven't yet seen
989  // a run so we can put this first
990  runToFirstLastEntryMap[runKey].first = iter;
991  }
992  }
993  }
994  else
995  {
996  //We need to do a merge since the run/lumi already appeared. Put it after the existing entry
997  //std::cout <<" found a second instance of "<<runLumi.first<<" "<<runLumi.second<<" at "<<index<<std::endl;
998  std::list<unsigned int>::iterator itNext = itFind->second;
999  ++itNext;
1000  std::list<unsigned int>::iterator iter = m_orderedIndices.insert(itNext,index);
1001  RunToFirstLastEntryMap::iterator itRunFirstLastEntryFind = runToFirstLastEntryMap.find(runKey);
1002  if (itRunFirstLastEntryFind->second.second == itFind->second)
1003  {
1004  //if the previous one was the last in the run, we need to update to make this one the last
1005  itRunFirstLastEntryFind->second.second = iter;
1006  }
1007  itFind->second = iter;
1008  }
1009  }
1010  m_nextIndexItr = m_orderedIndices.begin();
1012 
1013  if(m_nextIndexItr != m_orderedIndices.end()) {
1014  for( size_t index = 0; index < kNIndicies; ++index) {
1015  m_trees[index] = dynamic_cast<TTree*>(m_file->Get(kTypeNames[index]));
1016  assert(0!=m_trees[index]);
1017  m_treeReaders[index]->setTree(m_trees[index]);
1018  }
1019  }
1020  //After a file open, the framework expects to see a new 'IsRun'
1022 
1023  return 1;
1024 }
1025 
1026 bool
1028  if(!m_runsToProcess.empty() && edm::search_all(m_runsToProcess, run) && lumi==0) {
1029  return false;
1030  }
1031 
1032  edm::LuminosityBlockID lumiID = edm::LuminosityBlockID(run, lumi);
1033  edm::LuminosityBlockRange lumiRange = edm::LuminosityBlockRange(lumiID, lumiID);
1035  if(!m_lumisToProcess.empty() && !binary_search_all(m_lumisToProcess, lumiRange, lt)) {
1036  return true;
1037  }
1038  return false;
1039 }
1040 
1041 
1042 void
1043 DQMRootSource::logFileAction(char const* msg, char const* fileName) const {
1044  edm::LogAbsolute("fileAction") << std::setprecision(0) << edm::TimeOfDay() << msg << fileName;
1046 }
1047 
1048 //
1049 // const member functions
1050 //
1051 
1052 //
1053 // static member functions
1054 //
const DQMRootSource & operator=(const DQMRootSource &)
TH2S * getTH2S(void) const
TH1S * getTH1S(void) const
edm::InputSource::ItemType m_nextItemType
unsigned int m_lastSeenRun2
int i
Definition: DBlmapReader.cc:9
static const char *const kProcessHistoryTree
Definition: format.h:54
static const char *const kRunBranch
Definition: format.h:41
unsigned int lumi() const
MonitorElement * book2S(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2S histogram.
Definition: DQMStore.cc:1104
static const char *const kTypeNames[]
Definition: format.h:28
edm::JobReport::Token m_jrToken
void readNextItemType()
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
virtual void closeFile_() override
TProfile2D * getTProfile2D(void) const
void logFileAction(char const *msg, char const *fileName) const
RunNumber_t run() const
Definition: RunID.h:43
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
edm::RunAuxiliary m_runAux
void FlushMessageLog()
void reportInputRunNumber(unsigned int run)
Definition: JobReport.cc:554
std::vector< edm::RunNumber_t > m_runsToProcess
std::vector< boost::shared_ptr< TreeReaderBase > > m_treeReaders
edm::ProcessHistoryID const & processHistoryID() const
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
Definition: DQMStore.cc:1216
MonitorElement * book2DD(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D double histogram.
Definition: DQMStore.cc:1126
tuple lumi
Definition: fjr2json.py:35
static const char *const kIndicesTree
Definition: format.h:40
bool registerProcessHistory(ProcessHistory const &processHistory)
std::set< MonitorElement * > m_lumiElements
static const char *const kFirstIndex
Definition: format.h:47
TH3F * getTH3F(void) const
TH1D * getTH1D(void) const
static const char *const kLumiBranch
Definition: format.h:42
size_t m_presentlyOpenFileIndex
std::list< unsigned int >::iterator m_presentIndexItr
unsigned int m_filterOnRun
bool operator<(RunPHIDKey const &right) const
std::set< MonitorElement * > m_runElements
TH2D * getTH2D(void) const
static const char *const kFullNameBranch
Definition: format.h:34
MonitorElement * book1DD(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
Definition: DQMStore.cc:986
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
Definition: RunPrincipal.cc:22
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
std::vector< edm::ProcessHistoryID > m_reducedHistoryIDs
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:891
unsigned int run() const
Token inputFileOpened(std::string const &physicalFileName, std::string const &logicalFileName, std::string const &catalog, std::string const &inputType, std::string const &inputSourceClassName, std::string const &moduleLabel, std::string const &guid, std::vector< std::string > const &branchNames)
Definition: JobReport.cc:393
void Fill(long long x)
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1594
virtual boost::shared_ptr< edm::LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
Definition: ME.h:11
static const char *const kPHIndexBranch
Definition: format.h:55
static const char *const kParameterSetBranch
Definition: format.h:62
virtual edm::InputSource::ItemType getNextItemType() override
void fillLuminosityBlockPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
std::vector< RunLumiToRange > m_runlumiToRange
void addDefault(ParameterSetDescription const &psetDescription)
edm::LuminosityBlockAuxiliary m_lumiAux
tuple path
else: Piece not in the list, fine.
#define DEFINE_FWK_INPUT_SOURCE(type)
std::vector< edm::ProcessHistoryID > m_historyIDs
edm::ProcessHistoryID const & processHistoryID() const
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:920
edm::ProcessHistoryID processHistoryID_
void reportInputLumiSection(unsigned int run, unsigned int lumiSectId)
Definition: JobReport.cc:544
bool m_justOpenedFileSoNeedToGenerateRunTransition
virtual ~DQMRootSource()
edm::InputFileCatalog m_catalog
edm::ProcessHistoryID m_lastSeenReducedPHID2
static const char *const kParameterSetTree
Definition: format.h:61
std::list< unsigned int > m_orderedIndices
RunNumber_t run() const
static const char *const kFlagBranch
Definition: format.h:35
static const char *const kTypeBranch
Definition: format.h:46
std::auto_ptr< TFile > m_file
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
static const char *const kProcessHistoryIndexBranch
Definition: format.h:43
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1268
void setProcessHistoryID(ProcessHistoryID const &phid)
static const char *const kEndTimeBranch
Definition: format.h:45
std::vector< std::string > const & logicalFileNames() const
virtual boost::shared_ptr< edm::RunAuxiliary > readRunAuxiliary_() override
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1708
virtual std::unique_ptr< edm::FileBlock > readFile_() override
const std::string getFullname(void) const
get full name of ME including Pathname
std::vector< TTree * > m_trees
unsigned int run() const
std::size_t Token
Definition: JobReport.h:105
static const char *const kProcessConfigurationPassID
Definition: format.h:59
RunID const & id() const
Definition: RunPrincipal.h:69
static void registerFromString(std::string const &rep)
Definition: ParameterSet.cc:95
static const char *const kMetaDataDirectoryAbsolute
Definition: format.h:51
std::vector< std::string > const & fileNames() const
unsigned int m_lastSeenLumi2
static const char *const kLastIndex
Definition: format.h:48
int64_t getIntValue(void) const
std::vector< edm::LuminosityBlockRange > m_lumisToProcess
bool operator<(RunLumiPHIDKey const &right) const
bool search_all(ForwardSequence const &s, Datum const &d)
Definition: Algorithms.h:46
TH1F * getTH1F(void) const
LuminosityBlockNumber_t luminosityBlock() const
static const char *const kProcessConfigurationReleaseVersion
Definition: format.h:58
void addContext(std::string const &context)
Definition: Exception.cc:227
virtual void readRun_(edm::RunPrincipal &rpCache) override
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
Non-const accessor for process history registry.
Definition: InputSource.h:174
static const char *const kProcessConfigurationProcessNameBranch
Definition: format.h:56
edm::ProcessHistoryID m_lastSeenReducedPHID
static const char *const kBeginTimeBranch
Definition: format.h:44
bool skipIt(edm::RunNumber_t, edm::LuminosityBlockNumber_t) const
< trclass="colgroup">< tdclass="colgroup"colspan=5 > DT local reconstruction</td ></tr >< tr >< td >< ahref="classDTRecHit1DPair.html"> DTRecHit1DPair</a ></td >< td >< ahref="DataFormats_DTRecHit.html"> edm::RangeMap & lt
TProfile * getTProfile(void) const
std::vector< EventRange > & sortAndRemoveOverlaps(std::vector< EventRange > &eventRange)
Definition: EventRange.cc:102
RunPHIDKey(edm::ProcessHistoryID const &phid, unsigned int run)
ProcessHistoryRegistry & processHistoryRegistryUpdate() const
Definition: InputSource.h:348
bool binary_search_all(ForwardSequence const &s, Datum const &d)
wrappers for std::binary_search
Definition: Algorithms.h:76
bool lessThan(EventRange const &lh, EventRange const &rh)
Definition: EventRange.cc:67
RunLumiPHIDKey(edm::ProcessHistoryID const &phid, unsigned int run, unsigned int lumi)
std::list< unsigned int >::iterator m_nextIndexItr
void setProcessHistoryID(ProcessHistoryID const &phid)
Definition: RunAuxiliary.h:36
unsigned int RunNumber_t
Definition: EventRange.h:32
DQMRootSource(edm::ParameterSet const &, const edm::InputSourceDescription &)
volatile std::atomic< bool > shutdown_flag false
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
TH2F * getTH2F(void) const
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:861
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1082
virtual void readEvent_(edm::EventPrincipal &) override
long double T
virtual void readLuminosityBlock_(edm::LuminosityBlockPrincipal &lbCache) override
ProcessHistoryID id() const
unsigned int m_lastSeenRun
void inputFileClosed(InputType inputType, Token fileToken)
Definition: JobReport.cc:453
edm::ProcessHistoryID processHistoryID_
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
Definition: DQMStore.cc:970
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
static Registry * instance()
Definition: Registry.cc:14
Helper class to handle FWLite file input sources.
static const char *const kValueBranch
Definition: format.h:36
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
static const char *const kProcessConfigurationParameterSetIDBranch
Definition: format.h:57
bool setupFile(unsigned int iIndex)
static bool CheckBinLabels(const TAxis *a1, const TAxis *a2)
Check the consistency of the axis labels.
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:1412