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