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 "THashList.h"
24 #include "TH1.h"
25 #include "TH2.h"
26 #include "TProfile.h"
27 
28 // user include files
36 //#include "FWCore/Utilities/interface/GlobalIdentifier.h"
38 
41 
46 
49 
54 
57 
62 
65 
66 #include "format.h"
67 
68 namespace {
69  //utility function to check the consistency of the axis labels
70  //taken from TH1::CheckBinLabels
71  bool CheckBinLabels(const TAxis* a1, const TAxis * a2)
72  {
73  // check that axis have same labels
74  THashList *l1 = (const_cast<TAxis*>(a1))->GetLabels();
75  THashList *l2 = (const_cast<TAxis*>(a2))->GetLabels();
76 
77  if (!l1 && !l2 )
78  return true;
79  if (!l1 || !l2 ) {
80  return false;
81  }
82  // check now labels sizes are the same
83  if (l1->GetSize() != l2->GetSize() ) {
84  return false;
85  }
86  for (int i = 1; i <= a1->GetNbins(); ++i) {
87  TString label1 = a1->GetBinLabel(i);
88  TString label2 = a2->GetBinLabel(i);
89  if (label1 != label2) {
90  return false;
91  }
92  }
93  return true;
94  }
95 
96  //adapter functions
97  MonitorElement* createElement(DQMStore& iStore, const char* iName, TH1F* iHist) {
98  //std::cout <<"create: hist size "<<iName <<" "<<iHist->GetEffectiveEntries()<<std::endl;
99  return iStore.book1D(iName, iHist);
100  }
101  //NOTE: the merge logic comes from DataFormats/Histograms/interface/MEtoEDMFormat.h
102  void mergeTogether(TH1* iOriginal,TH1* iToAdd) {
103  if(iOriginal->TestBit(TH1::kCanRebin)==true && iToAdd->TestBit(TH1::kCanRebin) ==true) {
104  TList list;
105  list.Add(iToAdd);
106  if( -1 == iOriginal->Merge(&list)) {
107  edm::LogError("MergeFailure")<<"Failed to merge DQM element "<<iOriginal->GetName();
108  }
109  } else {
110  if (iOriginal->GetNbinsX() == iToAdd->GetNbinsX() &&
111  iOriginal->GetXaxis()->GetXmin() == iToAdd->GetXaxis()->GetXmin() &&
112  iOriginal->GetXaxis()->GetXmax() == iToAdd->GetXaxis()->GetXmax() &&
113  iOriginal->GetNbinsY() == iToAdd->GetNbinsY() &&
114  iOriginal->GetYaxis()->GetXmin() == iToAdd->GetYaxis()->GetXmin() &&
115  iOriginal->GetYaxis()->GetXmax() == iToAdd->GetYaxis()->GetXmax() &&
116  iOriginal->GetNbinsZ() == iToAdd->GetNbinsZ() &&
117  iOriginal->GetZaxis()->GetXmin() == iToAdd->GetZaxis()->GetXmin() &&
118  iOriginal->GetZaxis()->GetXmax() == iToAdd->GetZaxis()->GetXmax() &&
119  CheckBinLabels(iOriginal->GetXaxis(),iToAdd->GetXaxis()) &&
120  CheckBinLabels(iOriginal->GetYaxis(),iToAdd->GetYaxis()) &&
121  CheckBinLabels(iOriginal->GetZaxis(),iToAdd->GetZaxis())) {
122  iOriginal->Add(iToAdd);
123  } else {
124  edm::LogError("MergeFailure")<<"Found histograms with different axis limits or different labels'"<<iOriginal->GetName()<<"' not merged.";
125  }
126  }
127  }
128 
129  void mergeWithElement(MonitorElement* iElement, TH1F* iHist) {
130  //std::cout <<"merge: hist size "<<iElement->getName() <<" "<<iHist->GetEffectiveEntries()<<std::endl;
131  mergeTogether(iElement->getTH1F(),iHist);
132  }
133  MonitorElement* createElement(DQMStore& iStore, const char* iName, TH1S* iHist) {
134  return iStore.book1S(iName, iHist);
135  }
136  void mergeWithElement(MonitorElement* iElement, TH1S* iHist) {
137  mergeTogether(iElement->getTH1S(),iHist);
138  }
139  MonitorElement* createElement(DQMStore& iStore, const char* iName, TH1D* iHist) {
140  return iStore.book1DD(iName, iHist);
141  }
142  void mergeWithElement(MonitorElement* iElement, TH1D* iHist) {
143  mergeTogether(iElement->getTH1D(),iHist);
144  }
145  MonitorElement* createElement(DQMStore& iStore, const char* iName, TH2F* iHist) {
146  return iStore.book2D(iName, iHist);
147  }
148  void mergeWithElement(MonitorElement* iElement, TH2F* iHist) {
149  mergeTogether(iElement->getTH2F(),iHist);
150  }
151  MonitorElement* createElement(DQMStore& iStore, const char* iName, TH2S* iHist) {
152  return iStore.book2S(iName, iHist);
153  }
154  void mergeWithElement(MonitorElement* iElement, TH2S* iHist) {
155  mergeTogether(iElement->getTH2S(),iHist);
156  }
157  MonitorElement* createElement(DQMStore& iStore, const char* iName, TH2D* iHist) {
158  return iStore.book2DD(iName, iHist);
159  }
160  void mergeWithElement(MonitorElement* iElement, TH2D* iHist) {
161  mergeTogether(iElement->getTH2D(),iHist);
162  }
163  MonitorElement* createElement(DQMStore& iStore, const char* iName, TH3F* iHist) {
164  return iStore.book3D(iName, iHist);
165  }
166  void mergeWithElement(MonitorElement* iElement, TH3F* iHist) {
167  mergeTogether(iElement->getTH3F(),iHist);
168  }
169  MonitorElement* createElement(DQMStore& iStore, const char* iName, TProfile* iHist) {
170  return iStore.bookProfile(iName, iHist);
171  }
172  void mergeWithElement(MonitorElement* iElement, TProfile* iHist) {
173  mergeTogether(iElement->getTProfile(),iHist);
174  }
175  MonitorElement* createElement(DQMStore& iStore, const char* iName, TProfile2D* iHist) {
176  return iStore.bookProfile2D(iName, iHist);
177  }
178  void mergeWithElement(MonitorElement* iElement, TProfile2D* iHist) {
179  mergeTogether(iElement->getTProfile2D(),iHist);
180  }
181 
182  MonitorElement* createElement(DQMStore& iStore, const char* iName, Long64_t& iValue) {
183  MonitorElement* e = iStore.bookInt(iName);
184  e->Fill(iValue);
185  return e;
186  }
187 
188  //NOTE: the merge logic comes from DataFormats/Histograms/interface/MEtoEDMFormat.h
189  void mergeWithElement(MonitorElement* iElement, Long64_t& iValue) {
190  const std::string& name = iElement->getFullname();
191  if(name.find("EventInfo/processedEvents") != std::string::npos) {
192  iElement->Fill(iValue+iElement->getIntValue());
193  } else if(name.find("EventInfo/iEvent") != std::string::npos ||
194  name.find("EventInfo/iLumiSection") != std::string::npos) {
195  if(iValue > iElement->getIntValue()) {
196  iElement->Fill(iValue);
197  }
198  }
199  else {
200  iElement->Fill(iValue);
201  }
202  }
203 
204  MonitorElement* createElement(DQMStore& iStore, const char* iName, double& iValue) {
205  MonitorElement* e = iStore.bookFloat(iName);
206  e->Fill(iValue);
207  return e;
208  }
209  void mergeWithElement(MonitorElement* iElement, double& iValue) {
210  //no merging, take the last one
211  iElement->Fill(iValue);
212  }
213  MonitorElement* createElement(DQMStore& iStore, const char* iName, std::string* iValue) {
214  return iStore.bookString(iName,*iValue);
215  }
216  void mergeWithElement(MonitorElement* iElement, std::string* iValue) {
217  //no merging, take the last one
218  iElement->Fill(*iValue);
219  }
220 
221  void splitName(const std::string& iFullName, std::string& oPath,const char*& oName) {
222  oPath = iFullName;
223  size_t index = oPath.find_last_of('/');
224  if(index == std::string::npos) {
225  oPath = std::string();
226  oName = iFullName.c_str();
227  } else {
228  oPath.resize(index);
229  oName = iFullName.c_str()+index+1;
230  }
231  }
232 
233  struct RunLumiToRange {
234  unsigned int m_run, m_lumi,m_historyIDIndex;
235  ULong64_t m_beginTime;
236  ULong64_t m_endTime;
237  ULong64_t m_firstIndex, m_lastIndex; //last is inclusive
238  unsigned int m_type; //A value in TypeIndex
239  };
240 
241  class TreeReaderBase {
242  public:
243  TreeReaderBase() {}
244  virtual ~TreeReaderBase() {}
245 
246  MonitorElement* read(ULong64_t iIndex, DQMStore& iStore, bool iIsLumi){
247  return doRead(iIndex,iStore,iIsLumi);
248  }
249  virtual void setTree(TTree* iTree) =0;
250  protected:
251  TTree* m_tree;
252  private:
253  virtual MonitorElement* doRead(ULong64_t iIndex, DQMStore& iStore, bool iIsLumi)=0;
254  };
255 
256  template<class T>
257  class TreeObjectReader: public TreeReaderBase {
258  public:
259  TreeObjectReader():m_tree(0),m_fullName(0),m_buffer(0),m_tag(0){
260  }
261  virtual MonitorElement* doRead(ULong64_t iIndex, DQMStore& iStore, bool iIsLumi) override {
262  m_tree->GetEntry(iIndex);
263  MonitorElement* element = iStore.get(*m_fullName);
264  if(0 == element) {
266  const char* name;
267  splitName(*m_fullName, path,name);
268  iStore.setCurrentFolder(path);
269  element = createElement(iStore,name,m_buffer);
270  if(iIsLumi) { element->setLumiFlag();}
271  } else {
272  mergeWithElement(element,m_buffer);
273  }
274  if(0!= m_tag) {
275  iStore.tag(element,m_tag);
276  }
277  return element;
278  }
279  virtual void setTree(TTree* iTree) override {
280  m_tree = iTree;
281  m_tree->SetBranchAddress(kFullNameBranch,&m_fullName);
282  m_tree->SetBranchAddress(kFlagBranch,&m_tag);
283  m_tree->SetBranchAddress(kValueBranch,&m_buffer);
284  }
285  private:
286  TTree* m_tree;
287  std::string* m_fullName;
288  T* m_buffer;
289  uint32_t m_tag;
290  };
291 
292  template<class T>
293  class TreeSimpleReader : public TreeReaderBase {
294  public:
295  TreeSimpleReader():m_tree(0),m_fullName(0),m_buffer(0),m_tag(0){
296  }
297  virtual MonitorElement* doRead(ULong64_t iIndex, DQMStore& iStore,bool iIsLumi) override {
298  m_tree->GetEntry(iIndex);
299  MonitorElement* element = iStore.get(*m_fullName);
300  if(0 == element) {
302  const char* name;
303  splitName(*m_fullName, path,name);
304  iStore.setCurrentFolder(path);
305  element = createElement(iStore,name,m_buffer);
306  if(iIsLumi) { element->setLumiFlag();}
307  } else {
308  mergeWithElement(element, m_buffer);
309  }
310  if(0!=m_tag) {
311  iStore.tag(element,m_tag);
312  }
313  return element;
314  }
315  virtual void setTree(TTree* iTree) override {
316  m_tree = iTree;
317  m_tree->SetBranchAddress(kFullNameBranch,&m_fullName);
318  m_tree->SetBranchAddress(kFlagBranch,&m_tag);
319  m_tree->SetBranchAddress(kValueBranch,&m_buffer);
320  }
321  private:
322  TTree* m_tree;
323  std::string* m_fullName;
324  T m_buffer;
325  uint32_t m_tag;
326  };
327 
328 }
329 
331 {
332 
333  public:
335  virtual ~DQMRootSource();
336 
337  // ---------- const member functions ---------------------
338 
339  // ---------- static member functions --------------------
340 
341  // ---------- member functions ---------------------------
342  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
343 
344  private:
345 
346  DQMRootSource(const DQMRootSource&); // stop default
347 
348  class RunPHIDKey {
349  public:
350  RunPHIDKey(edm::ProcessHistoryID const& phid, unsigned int run) :
351  processHistoryID_(phid), run_(run) { }
353  unsigned int run() const { return run_; }
354  bool operator<(RunPHIDKey const& right) const {
355  if (processHistoryID_ == right.processHistoryID()) {
356  return run_ < right.run();
357  }
358  return processHistoryID_ < right.processHistoryID();
359  }
360  private:
362  unsigned int run_;
363  };
364 
366  public:
367  RunLumiPHIDKey(edm::ProcessHistoryID const& phid, unsigned int run, unsigned int lumi) :
368  processHistoryID_(phid), run_(run), lumi_(lumi) { }
370  unsigned int run() const { return run_; }
371  unsigned int lumi() const { return lumi_; }
372  bool operator<(RunLumiPHIDKey const& right) const {
373  if (processHistoryID_ == right.processHistoryID()) {
374  if (run_ == right.run()) {
375  return lumi_ < right.lumi();
376  }
377  return run_ < right.run();
378  }
379  return processHistoryID_ < right.processHistoryID();
380  }
381  private:
383  unsigned int run_;
384  unsigned int lumi_;
385  };
386 
387  virtual edm::InputSource::ItemType getNextItemType() override;
388  //NOTE: the following is really read next run auxiliary
389  virtual boost::shared_ptr<edm::RunAuxiliary> readRunAuxiliary_() override ;
390  virtual boost::shared_ptr<edm::LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_() override ;
391  virtual void readRun_(edm::RunPrincipal& rpCache) override;
392  virtual void readLuminosityBlock_(edm::LuminosityBlockPrincipal& lbCache) override;
393  virtual void readEvent_(edm::EventPrincipal&) override ;
394 
395  virtual std::unique_ptr<edm::FileBlock> readFile_() override;
396  virtual void closeFile_() override;
397 
398  void logFileAction(char const* msg, char const* fileName) const;
399 
400  void readNextItemType();
401  bool setupFile(unsigned int iIndex);
402  void readElements();
404 
405  const DQMRootSource& operator=(const DQMRootSource&); // stop default
406 
407  // ---------- member data --------------------------------
412 
413  size_t m_fileIndex;
415  std::list<unsigned int>::iterator m_nextIndexItr;
416  std::list<unsigned int>::iterator m_presentIndexItr;
417  std::vector<RunLumiToRange> m_runlumiToRange;
418  std::auto_ptr<TFile> m_file;
419  std::vector<TTree*> m_trees;
420  std::vector<boost::shared_ptr<TreeReaderBase> > m_treeReaders;
421 
422  std::list<unsigned int> m_orderedIndices;
424  unsigned int m_lastSeenRun;
426  unsigned int m_lastSeenRun2;
427  unsigned int m_lastSeenLumi2;
428  unsigned int m_filterOnRun;
430  std::vector<edm::LuminosityBlockRange> m_lumisToProcess;
431  std::vector<edm::RunNumber_t> m_runsToProcess;
432 
435  std::set<MonitorElement*> m_lumiElements;
436  std::set<MonitorElement*> m_runElements;
437  std::vector<edm::ProcessHistoryID> m_historyIDs;
438  std::vector<edm::ProcessHistoryID> m_reducedHistoryIDs;
439 
441 };
442 
443 //
444 // constants, enums and typedefs
445 //
446 
447 //
448 // static data member definitions
449 //
450 
451 void
454  desc.addUntracked<std::vector<std::string> >("fileNames")
455  ->setComment("Names of files to be processed.");
456  desc.addUntracked<unsigned int>("filterOnRun",0)
457  ->setComment("Just limit the process to the selected run.");
458  desc.addUntracked<bool>("skipBadFiles",false)
459  ->setComment("Skip the file if it is not valid");
460  desc.addUntracked<std::string>("overrideCatalog",std::string())
461  ->setComment("An alternate file catalog to use instead of the standard site one.");
462  std::vector<edm::LuminosityBlockRange> defaultLumis;
463  desc.addUntracked<std::vector<edm::LuminosityBlockRange> >("lumisToProcess",defaultLumis)
464  ->setComment("Skip any lumi inside the specified run:lumi range.");
465 
466  descriptions.addDefault(desc);
467 }
468 //
469 // constructors and destructor
470 //
472  edm::InputSource(iPSet,iDesc),
473  m_catalog(iPSet.getUntrackedParameter<std::vector<std::string> >("fileNames"),
474  iPSet.getUntrackedParameter<std::string>("overrideCatalog")),
475  m_nextItemType(edm::InputSource::IsFile),
476  m_fileIndex(0),
477  m_presentlyOpenFileIndex(0),
478  m_trees(kNIndicies,static_cast<TTree*>(0)),
479  m_treeReaders(kNIndicies,boost::shared_ptr<TreeReaderBase>()),
480  m_lastSeenReducedPHID(),
481  m_lastSeenRun(0),
482  m_lastSeenReducedPHID2(),
483  m_lastSeenRun2(0),
484  m_lastSeenLumi2(0),
485  m_filterOnRun(iPSet.getUntrackedParameter<unsigned int>("filterOnRun", 0)),
486  m_skipBadFiles(iPSet.getUntrackedParameter<bool>("skipBadFiles", false)),
487  m_lumisToProcess(iPSet.getUntrackedParameter<std::vector<edm::LuminosityBlockRange> >("lumisToProcess",std::vector<edm::LuminosityBlockRange>())),
488  m_justOpenedFileSoNeedToGenerateRunTransition(false),
489  m_shouldReadMEs(true)
490 {
492  for(std::vector<edm::LuminosityBlockRange>::const_iterator itr = m_lumisToProcess.begin(); itr!=m_lumisToProcess.end(); ++itr)
493  m_runsToProcess.push_back(itr->startRun());
494 
495  if(m_fileIndex ==m_catalog.fileNames().size()) {
497  } else{
498  m_treeReaders[kIntIndex].reset(new TreeSimpleReader<Long64_t>());
499  m_treeReaders[kFloatIndex].reset(new TreeSimpleReader<double>());
500  m_treeReaders[kStringIndex].reset(new TreeObjectReader<std::string>());
501  m_treeReaders[kTH1FIndex].reset(new TreeObjectReader<TH1F>());
502  m_treeReaders[kTH1SIndex].reset(new TreeObjectReader<TH1S>());
503  m_treeReaders[kTH1DIndex].reset(new TreeObjectReader<TH1D>());
504  m_treeReaders[kTH2FIndex].reset(new TreeObjectReader<TH2F>());
505  m_treeReaders[kTH2SIndex].reset(new TreeObjectReader<TH2S>());
506  m_treeReaders[kTH2DIndex].reset(new TreeObjectReader<TH2D>());
507  m_treeReaders[kTH3FIndex].reset(new TreeObjectReader<TH3F>());
508  m_treeReaders[kTProfileIndex].reset(new TreeObjectReader<TProfile>());
509  m_treeReaders[kTProfile2DIndex].reset(new TreeObjectReader<TProfile2D>());
510  }
511 }
512 
513 // DQMRootSource::DQMRootSource(const DQMRootSource& rhs)
514 // {
515 // // do actual copying here;
516 // }
517 
519 {
520  if(m_file.get() != 0 && m_file->IsOpen()) {
521  m_file->Close();
522  logFileAction(" Closed file ", m_catalog.fileNames()[m_presentlyOpenFileIndex].c_str());
523  }
524 }
525 
526 //
527 // assignment operators
528 //
529 // const DQMRootSource& DQMRootSource::operator=(const DQMRootSource& rhs)
530 // {
531 // //An exception safe implementation is
532 // DQMRootSource temp(rhs);
533 // swap(rhs);
534 //
535 // return *this;
536 // }
537 
538 //
539 // member functions
540 //
542 {
543  //std::cout << "readEvent_" << std::endl;
544 }
545 
547 {
548  //std::cout <<"getNextItemType "<<m_nextItemType<<std::endl;
549  return m_nextItemType;
550 }
551 
552 boost::shared_ptr<edm::RunAuxiliary> DQMRootSource::readRunAuxiliary_()
553 {
554  //std::cout <<"readRunAuxiliary_"<<std::endl;
555  assert(m_nextIndexItr != m_orderedIndices.end());
556  RunLumiToRange runLumiRange = m_runlumiToRange[*m_nextIndexItr];
557 
558  //NOTE: the setBeginTime and setEndTime functions of RunAuxiliary only work if the previous value was invalid
559  // therefore we must copy
560  m_runAux = edm::RunAuxiliary(runLumiRange.m_run,edm::Timestamp(runLumiRange.m_beginTime),edm::Timestamp(runLumiRange.m_endTime));
561  assert(m_historyIDs.size() > runLumiRange.m_historyIDIndex);
562  //std::cout <<"readRunAuxiliary_ "<<m_historyIDs[runLumiRange.m_historyIDIndex]<<std::endl;
563  m_runAux.setProcessHistoryID(m_historyIDs[runLumiRange.m_historyIDIndex]);
564  return boost::shared_ptr<edm::RunAuxiliary>( new edm::RunAuxiliary(m_runAux) );
565 }
566 
567 boost::shared_ptr<edm::LuminosityBlockAuxiliary>
569 {
570  //std::cout <<"readLuminosityBlockAuxiliary_"<<std::endl;
571  assert(m_nextIndexItr != m_orderedIndices.end());
572  const RunLumiToRange runLumiRange = m_runlumiToRange[*m_nextIndexItr];
573  m_lumiAux = edm::LuminosityBlockAuxiliary(edm::LuminosityBlockID(runLumiRange.m_run,runLumiRange.m_lumi),
574  edm::Timestamp(runLumiRange.m_beginTime),
575  edm::Timestamp(runLumiRange.m_endTime));
576  assert(m_historyIDs.size() > runLumiRange.m_historyIDIndex);
577  //std::cout <<"lumi "<<m_lumiAux.beginTime().value()<<" "<<runLumiRange.m_beginTime<<std::endl;
578  m_lumiAux.setProcessHistoryID(m_historyIDs[runLumiRange.m_historyIDIndex]);
579 
580  return boost::shared_ptr<edm::LuminosityBlockAuxiliary>(new edm::LuminosityBlockAuxiliary(m_lumiAux));
581 }
582 
583 void
585 {
586  assert(m_presentIndexItr != m_orderedIndices.end());
587  RunLumiToRange runLumiRange = m_runlumiToRange[*m_presentIndexItr];
588 
590  unsigned int runID =rpCache.id().run();
591  assert(runID == runLumiRange.m_run);
592 
593  m_shouldReadMEs = (m_filterOnRun == 0 ||
594  (m_filterOnRun != 0 && m_filterOnRun == runID));
595  // std::cout <<"readRun_"<<std::endl;
596  // std::cout <<"m_shouldReadMEs " << m_shouldReadMEs <<std::endl;
597 
608  //NOTE: need to reset all run elements at this point
609  if( m_lastSeenRun != runID ||
610  m_lastSeenReducedPHID != m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex) ) {
611  if (m_shouldReadMEs) {
613  std::vector<MonitorElement*> allMEs = (*store).getAllContents("");
614  for(auto const& ME : allMEs) {
615  // We do not want to reset here Lumi products, since a dedicated
616  // resetting is done at every lumi transition.
617  if (ME->getLumiFlag()) continue;
618  if ( !(*store).isCollate() )
619  ME->Reset();
620  }
621  }
622  m_lastSeenReducedPHID = m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex);
623  m_lastSeenRun = runID;
624  }
625 
627 
628  //NOTE: it is possible to have a Run when all we have stored is lumis
629  if(runLumiRange.m_lumi == 0) {
630  readElements();
631  }
632 
633 
635  jr->reportInputRunNumber(rpCache.id().run());
636 
638 }
639 
640 
641 void
643 {
644  assert(m_presentIndexItr != m_orderedIndices.end());
645  RunLumiToRange runLumiRange = m_runlumiToRange[*m_presentIndexItr];
646  assert(runLumiRange.m_run == lbCache.id().run());
647  assert(runLumiRange.m_lumi == lbCache.id().luminosityBlock());
648 
649  //NOTE: need to reset all lumi block elements at this point
650  if( ( m_lastSeenLumi2 != runLumiRange.m_lumi ||
651  m_lastSeenRun2 != runLumiRange.m_run ||
652  m_lastSeenReducedPHID2 != m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex) )
653  && m_shouldReadMEs) {
654 
656  std::vector<MonitorElement*> allMEs = (*store).getAllContents("");
657  for(auto const& ME : allMEs) {
658  // We do not want to reset Run Products here!
659  if (ME->getLumiFlag()) {
660  ME->Reset();
661  }
662  }
663  m_lastSeenReducedPHID2 = m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex);
664  m_lastSeenRun2 = runLumiRange.m_run;
665  m_lastSeenLumi2 = runLumiRange.m_lumi;
666  }
667 
669  readElements();
670 
672  jr->reportInputLumiSection(lbCache.id().run(),lbCache.id().luminosityBlock());
673 
675 
676 }
677 
678 std::unique_ptr<edm::FileBlock>
680  auto const numFiles = m_catalog.fileNames().size();
681  while(m_fileIndex < numFiles && not setupFile(m_fileIndex++)) {}
682 
683  if(m_file.get() == nullptr) {
684  //last file in list was bad
686  return std::unique_ptr<edm::FileBlock>(new edm::FileBlock);
687  }
688 
692 
696  std::string(),
697  std::string(),
698  "DQMRootSource",
699  "source",
700  m_file->GetUUID().AsString(),//edm::createGlobalIdentifier(),
701  std::vector<std::string>()
702  );
703 
704  return std::unique_ptr<edm::FileBlock>(new edm::FileBlock);
705 }
706 
707 void
709  if(m_file.get()==nullptr) { return; }
712 }
713 
716  RunLumiToRange runLumiRange = m_runlumiToRange[*m_presentIndexItr];
717  bool shouldContinue = false;
718  do
719  {
720  shouldContinue = false;
724 
725  if(runLumiRange.m_type == kNoTypesStored) {continue;}
726  boost::shared_ptr<TreeReaderBase> reader = m_treeReaders[runLumiRange.m_type];
727  ULong64_t index = runLumiRange.m_firstIndex;
728  ULong64_t endIndex = runLumiRange.m_lastIndex+1;
729  for (; index != endIndex; ++index)
730  {
731  bool isLumi = runLumiRange.m_lumi !=0;
732  if (m_shouldReadMEs)
733  reader->read(index,*store,isLumi);
734 
735  //std::cout << runLumiRange.m_run << " " << runLumiRange.m_lumi <<" "<<index<< " " << runLumiRange.m_type << std::endl;
736  }
737  if (m_presentIndexItr != m_orderedIndices.end())
738  {
739  //are there more parts to this same run/lumi?
740  const RunLumiToRange nextRunLumiRange = m_runlumiToRange[*m_presentIndexItr];
741  //continue to the next item if that item is either
742  if ( (m_reducedHistoryIDs.at(nextRunLumiRange.m_historyIDIndex) == m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex)) &&
743  (nextRunLumiRange.m_run == runLumiRange.m_run) &&
744  (nextRunLumiRange.m_lumi == runLumiRange.m_lumi) )
745  {
746  shouldContinue= true;
747  runLumiRange = nextRunLumiRange;
748  }
749  }
750  } while(shouldContinue);
751 }
752 
754 {
755  //Do the work of actually figuring out where next to go
756 
757  assert (m_nextIndexItr != m_orderedIndices.end());
758  RunLumiToRange runLumiRange = m_runlumiToRange[*m_nextIndexItr];
759 
761  if (runLumiRange.m_lumi != 0 && m_nextItemType == edm::InputSource::IsRun) {
763  return;
764  }
765  ++m_nextIndexItr;
766  }
767  else
768  {
769  //NOTE: the following makes the iterator not be advanced in the
770  //do while loop below.
771  runLumiRange.m_run=0;
772  }
773 
774  bool shouldContinue = false;
775  do
776  {
777  shouldContinue = false;
779  ++m_nextIndexItr;
780 
781  if (m_nextIndexItr == m_orderedIndices.end())
782  {
783  //go to next file
785  //std::cout <<"going to next file"<<std::endl;
786  if(m_fileIndex == m_catalog.fileNames().size()) {
788  }
789  break;
790  }
791  const RunLumiToRange nextRunLumiRange = m_runlumiToRange[*m_nextIndexItr];
792  //continue to the next item if that item is the same run or lumi as we just did
793  if( (m_reducedHistoryIDs.at(nextRunLumiRange.m_historyIDIndex) == m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex) ) &&
794  (nextRunLumiRange.m_run == runLumiRange.m_run) &&
795  (nextRunLumiRange.m_lumi == runLumiRange.m_lumi) ) {
796  shouldContinue= true;
797  ++m_nextIndexItr;
798  //std::cout <<"advancing " <<nextRunLumiRange.m_run<<" "<<nextRunLumiRange.m_lumi<<std::endl;
799  }
800  } while(shouldContinue);
801 
802  if(m_nextIndexItr != m_orderedIndices.end()) {
807  } else {
809  }
810  }
811 }
812 
813 bool
814 DQMRootSource::setupFile(unsigned int iIndex)
815 {
816  if(m_file.get() != 0 && iIndex > 0) {
817  m_file->Close();
818  logFileAction(" Closed file ", m_catalog.fileNames()[iIndex-1].c_str());
819  }
820  logFileAction(" Initiating request to open file ", m_catalog.fileNames()[iIndex].c_str());
821  m_presentlyOpenFileIndex = iIndex;
822  m_file.reset();
823  std::auto_ptr<TFile> newFile;
824  try {
825  newFile = std::auto_ptr<TFile>(TFile::Open(m_catalog.fileNames()[iIndex].c_str()));
826  } catch(cms::Exception const& e) {
827  if(!m_skipBadFiles) {
829  ex.addContext("Opening DQM Root file");
830  ex <<"\nInput file " << m_catalog.fileNames()[iIndex] << " was not found, could not be opened, or is corrupted.\n";
831  throw ex;
832  }
833  return 0;
834  }
835  if(not newFile->IsZombie()) {
836  logFileAction(" Successfully opened file ", m_catalog.fileNames()[iIndex].c_str());
837  } else {
838  if(!m_skipBadFiles) {
840  ex<<"Input file "<<m_catalog.fileNames()[iIndex].c_str() <<" could not be opened.\n";
841  ex.addContext("Opening DQM Root file");
842  throw ex;
843  }
844  return 0;
845  }
846  //Check file format version, which is encoded in the Title of the TFile
847  if(0 != strcmp(newFile->GetTitle(),"1")) {
849  ex<<"Input file "<<m_catalog.fileNames()[iIndex].c_str() <<" does not appear to be a DQM Root file.\n";
850  }
851 
852  //Get meta Data
853  TDirectory* metaDir = newFile->GetDirectory(kMetaDataDirectoryAbsolute);
854  if(0==metaDir) {
855  if(!m_skipBadFiles) {
857  ex<<"Input file "<<m_catalog.fileNames()[iIndex].c_str() <<" appears to be corrupted since it does not have the proper internal structure.\n"
858  " Check to see if the file was closed properly.\n";
859  ex.addContext("Opening DQM Root file");
860  throw ex;
861  }
862  else {return 0;}
863  }
864  m_file = newFile; //passed all tests so now we want to use this file
865  TTree* parameterSetTree = dynamic_cast<TTree*>(metaDir->Get(kParameterSetTree));
866  assert(0!=parameterSetTree);
867 
869  assert(0!=psr);
870  {
871  std::string blob;
872  std::string* pBlob = &blob;
873  parameterSetTree->SetBranchAddress(kParameterSetBranch,&pBlob);
874  for(unsigned int index = 0; index != parameterSetTree->GetEntries();++index)
875  {
876  parameterSetTree->GetEntry(index);
878  }
879  }
880 
881  {
882  TTree* processHistoryTree = dynamic_cast<TTree*>(metaDir->Get(kProcessHistoryTree));
883  assert(0!=processHistoryTree);
884  unsigned int phIndex = 0;
885  processHistoryTree->SetBranchAddress(kPHIndexBranch,&phIndex);
886  std::string processName;
887  std::string* pProcessName = &processName;
888  processHistoryTree->SetBranchAddress(kProcessConfigurationProcessNameBranch,&pProcessName);
889  std::string parameterSetIDBlob;
890  std::string* pParameterSetIDBlob = &parameterSetIDBlob;
891  processHistoryTree->SetBranchAddress(kProcessConfigurationParameterSetIDBranch,&pParameterSetIDBlob);
892  std::string releaseVersion;
893  std::string* pReleaseVersion = &releaseVersion;
894  processHistoryTree->SetBranchAddress(kProcessConfigurationReleaseVersion,&pReleaseVersion);
895  std::string passID;
896  std::string* pPassID = &passID;
897  processHistoryTree->SetBranchAddress(kProcessConfigurationPassID,&pPassID);
898 
900  std::vector<edm::ProcessConfiguration> configs;
901  configs.reserve(5);
902  m_historyIDs.clear();
903  m_reducedHistoryIDs.clear();
904  for(unsigned int i=0; i != processHistoryTree->GetEntries(); ++i) {
905  processHistoryTree->GetEntry(i);
906  if(phIndex==0) {
907  if(not configs.empty()) {
908  edm::ProcessHistory ph(configs);
909  m_historyIDs.push_back(ph.id());
910  phr.registerProcessHistory(ph);
911  m_reducedHistoryIDs.push_back(phr.reducedProcessHistoryID(ph.id()));
912  }
913  configs.clear();
914  }
915  edm::ParameterSetID psetID(parameterSetIDBlob);
916  edm::ProcessConfiguration pc(processName, psetID,releaseVersion,passID);
917  configs.push_back(pc);
918  }
919  if(not configs.empty()) {
920  edm::ProcessHistory ph(configs);
921  m_historyIDs.push_back(ph.id());
922  phr.registerProcessHistory(ph);
923  m_reducedHistoryIDs.push_back(phr.reducedProcessHistoryID(ph.id()));
924  //std::cout <<"inserted "<<ph.id()<<std::endl;
925  }
926  }
927 
928  //Setup the indices
929  TTree* indicesTree = dynamic_cast<TTree*>(m_file->Get(kIndicesTree));
930  assert(0!=indicesTree);
931 
932  m_runlumiToRange.clear();
933  m_runlumiToRange.reserve(indicesTree->GetEntries());
934  m_orderedIndices.clear();
935 
936  RunLumiToRange temp;
937  indicesTree->SetBranchAddress(kRunBranch,&temp.m_run);
938  indicesTree->SetBranchAddress(kLumiBranch,&temp.m_lumi);
939  indicesTree->SetBranchAddress(kBeginTimeBranch,&temp.m_beginTime);
940  indicesTree->SetBranchAddress(kEndTimeBranch,&temp.m_endTime);
941  indicesTree->SetBranchAddress(kProcessHistoryIndexBranch,&temp.m_historyIDIndex);
942  indicesTree->SetBranchAddress(kTypeBranch,&temp.m_type);
943  indicesTree->SetBranchAddress(kFirstIndex,&temp.m_firstIndex);
944  indicesTree->SetBranchAddress(kLastIndex,&temp.m_lastIndex);
945 
946  //Need to reorder items since if there was a merge done the same Run
947  //and/or Lumi can appear multiple times but we want to process them
948  //all at once
949 
950  //We use a std::list for m_orderedIndices since inserting into the
951  //middle of a std::list does not disrupt the iterators to already
952  //existing entries
953 
954  //The Map is used to see if a Run/Lumi pair has appeared before
955  typedef std::map<RunLumiPHIDKey, std::list<unsigned int>::iterator > RunLumiToLastEntryMap;
956  RunLumiToLastEntryMap runLumiToLastEntryMap;
957 
958  //Need to group all lumis for the same run together and move the run
959  //entry to the beginning
960  typedef std::map<RunPHIDKey, std::pair< std::list<unsigned int>::iterator, std::list<unsigned int>::iterator> > RunToFirstLastEntryMap;
961  RunToFirstLastEntryMap runToFirstLastEntryMap;
962 
963  for (Long64_t index = 0; index != indicesTree->GetEntries(); ++index)
964  {
965  indicesTree->GetEntry(index);
966 // std::cout <<"read r:"<<temp.m_run
967 // <<" l:"<<temp.m_lumi
968 // <<" b:"<<temp.m_beginTime
969 // <<" e:"<<temp.m_endTime
970 // <<" fi:" << temp.m_firstIndex
971 // <<" li:" << temp.m_lastIndex
972 // <<" type:" << temp.m_type << std::endl;
973  m_runlumiToRange.push_back(temp);
974 
975  RunLumiPHIDKey runLumi(m_reducedHistoryIDs.at(temp.m_historyIDIndex), temp.m_run, temp.m_lumi);
976  RunPHIDKey runKey(m_reducedHistoryIDs.at(temp.m_historyIDIndex), temp.m_run);
977 
978  RunLumiToLastEntryMap::iterator itFind = runLumiToLastEntryMap.find(runLumi);
979  if (itFind == runLumiToLastEntryMap.end())
980  {
981  //does not already exist
982  //does the run for this already exist?
983  std::list<unsigned int>::iterator itLastOfRun = m_orderedIndices.end();
984 
985  RunToFirstLastEntryMap::iterator itRunFirstLastEntryFind = runToFirstLastEntryMap.find(runKey);
986  bool needNewEntryInRunFirstLastEntryMap = true;
987  if (itRunFirstLastEntryFind != runToFirstLastEntryMap.end())
988  {
989  needNewEntryInRunFirstLastEntryMap=false;
990  if (temp.m_lumi!=0)
991  {
992  //lumis go to the end
993  itLastOfRun = itRunFirstLastEntryFind->second.second;
994  //we want to insert after this one so must advance the iterator
995  ++itLastOfRun;
996  }
997  else
998  {
999  //runs go at the beginning
1000  itLastOfRun = itRunFirstLastEntryFind->second.first;
1001  }
1002  }
1003  std::list<unsigned int>::iterator iter = m_orderedIndices.insert(itLastOfRun,index);
1004  runLumiToLastEntryMap[runLumi]=iter;
1005  if (needNewEntryInRunFirstLastEntryMap)
1006  runToFirstLastEntryMap[runKey]=std::make_pair(iter,iter);
1007  else
1008  {
1009  if(temp.m_lumi!=0)
1010  {
1011  //lumis go at end
1012  runToFirstLastEntryMap[runKey].second = iter;
1013  }
1014  else
1015  {
1016  //since we haven't yet seen this run/lumi combination it means we haven't yet seen
1017  // a run so we can put this first
1018  runToFirstLastEntryMap[runKey].first = iter;
1019  }
1020  }
1021  }
1022  else
1023  {
1024  //We need to do a merge since the run/lumi already appeared. Put it after the existing entry
1025  //std::cout <<" found a second instance of "<<runLumi.first<<" "<<runLumi.second<<" at "<<index<<std::endl;
1026  std::list<unsigned int>::iterator itNext = itFind->second;
1027  ++itNext;
1028  std::list<unsigned int>::iterator iter = m_orderedIndices.insert(itNext,index);
1029  RunToFirstLastEntryMap::iterator itRunFirstLastEntryFind = runToFirstLastEntryMap.find(runKey);
1030  if (itRunFirstLastEntryFind->second.second == itFind->second)
1031  {
1032  //if the previous one was the last in the run, we need to update to make this one the last
1033  itRunFirstLastEntryFind->second.second = iter;
1034  }
1035  itFind->second = iter;
1036  }
1037  }
1038  m_nextIndexItr = m_orderedIndices.begin();
1040 
1041  if(m_nextIndexItr != m_orderedIndices.end()) {
1042  for( size_t index = 0; index < kNIndicies; ++index) {
1043  m_trees[index] = dynamic_cast<TTree*>(m_file->Get(kTypeNames[index]));
1044  assert(0!=m_trees[index]);
1045  m_treeReaders[index]->setTree(m_trees[index]);
1046  }
1047  }
1048  //After a file open, the framework expects to see a new 'IsRun'
1050 
1051  return 1;
1052 }
1053 
1054 bool
1056  if(!m_runsToProcess.empty() && edm::search_all(m_runsToProcess, run) && lumi==0) {
1057  return false;
1058  }
1059 
1060  edm::LuminosityBlockID lumiID = edm::LuminosityBlockID(run, lumi);
1061  edm::LuminosityBlockRange lumiRange = edm::LuminosityBlockRange(lumiID, lumiID);
1063  if(!m_lumisToProcess.empty() && !binary_search_all(m_lumisToProcess, lumiRange, lt)) {
1064  return true;
1065  }
1066  return false;
1067 }
1068 
1069 
1070 void
1071 DQMRootSource::logFileAction(char const* msg, char const* fileName) const {
1072  edm::LogAbsolute("fileAction") << std::setprecision(0) << edm::TimeOfDay() << msg << fileName;
1074 }
1075 
1076 //
1077 // const member functions
1078 //
1079 
1080 //
1081 // static member functions
1082 //
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:1078
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:928
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:1190
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:1100
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:960
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:865
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:1565
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
#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:894
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:1242
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:1679
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:835
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:1056
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:944
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:639
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)
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:1386