CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
DQMRootSource Class Reference
Inheritance diagram for DQMRootSource:
edm::InputSource

Classes

class  RunLumiPHIDKey
 
class  RunPHIDKey
 

Public Member Functions

 DQMRootSource (edm::ParameterSet const &, const edm::InputSourceDescription &)
 
 ~DQMRootSource () override
 
- Public Member Functions inherited from edm::InputSource
std::shared_ptr< ActivityRegistryactReg () const
 Accessor for Activity Registry. More...
 
std::shared_ptr< BranchIDListHelper const > branchIDListHelper () const
 Accessors for branchIDListHelper. More...
 
std::shared_ptr< BranchIDListHelper > & branchIDListHelper ()
 
void closeFile (FileBlock *, bool cleaningUpAfterException)
 close current file More...
 
void doBeginJob ()
 Called by framework at beginning of job. More...
 
virtual void doBeginLumi (LuminosityBlockPrincipal &lbp, ProcessContext const *)
 Called by framework at beginning of lumi block. More...
 
virtual void doBeginRun (RunPrincipal &rp, ProcessContext const *)
 Called by framework at beginning of run. More...
 
void doEndJob ()
 Called by framework at end of job. More...
 
ProcessingController::ForwardState forwardState () const
 
bool goToEvent (EventID const &eventID)
 
 InputSource (ParameterSet const &, InputSourceDescription const &)
 Constructor. More...
 
 InputSource (InputSource const &)=delete
 
void issueReports (EventID const &eventID, StreamID streamID)
 issue an event report More...
 
LuminosityBlockNumber_t luminosityBlock () const
 Accessor for current luminosity block number. More...
 
std::shared_ptr< LuminosityBlockAuxiliaryluminosityBlockAuxiliary () const
 Called by the framework to merge or insert lumi in principal cache. More...
 
int maxEvents () const
 
int maxLuminosityBlocks () const
 
ModuleDescription const & moduleDescription () const
 Accessor for 'module' description. More...
 
ItemType nextItemType ()
 Advances the source to the next item. More...
 
InputSourceoperator= (InputSource const &)=delete
 
ProcessConfiguration const & processConfiguration () const
 Accessor for Process Configuration. More...
 
std::string const & processGUID () const
 Accessor for global process identifier. More...
 
ProcessHistoryRegistry const & processHistoryRegistry () const
 Accessors for process history registry. More...
 
ProcessHistoryRegistryprocessHistoryRegistry ()
 
ProcessingMode processingMode () const
 RunsLumisAndEvents (default), RunsAndLumis, or Runs. More...
 
std::shared_ptr< ProductRegistry const > productRegistry () const
 Accessors for product registry. More...
 
std::shared_ptr< ProductRegistry > & productRegistry ()
 
bool randomAccess () const
 
void readAndMergeLumi (LuminosityBlockPrincipal &lbp)
 Read next luminosity block (same as a prior lumi) More...
 
void readAndMergeRun (RunPrincipal &rp)
 Read next run (same as a prior run) More...
 
void readEvent (EventPrincipal &ep, StreamContext &)
 Read next event. More...
 
bool readEvent (EventPrincipal &ep, EventID const &, StreamContext &)
 Read a specific event. More...
 
std::unique_ptr< FileBlockreadFile ()
 Read next file. More...
 
void readLuminosityBlock (LuminosityBlockPrincipal &lumiPrincipal, HistoryAppender &historyAppender)
 Read next luminosity block (new lumi) More...
 
std::shared_ptr< LuminosityBlockAuxiliaryreadLuminosityBlockAuxiliary ()
 Read next luminosity block Auxilary. More...
 
void readRun (RunPrincipal &runPrincipal, HistoryAppender &historyAppender)
 Read next run (new run) More...
 
std::shared_ptr< RunAuxiliaryreadRunAuxiliary ()
 Read next run Auxiliary. More...
 
ProcessHistoryID const & reducedProcessHistoryID () const
 
virtual void registerProducts ()
 Register any produced products. More...
 
int remainingEvents () const
 
int remainingLuminosityBlocks () const
 
void repeat ()
 Reset the remaining number of events/lumis to the maximum number. More...
 
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader ()
 Returns nullptr if no resource shared between the Source and a DelayedReader. More...
 
ProcessingController::ReverseState reverseState () const
 
void rewind ()
 Begin again at the first event. More...
 
RunNumber_t run () const
 Accessor for current run number. More...
 
std::shared_ptr< RunAuxiliaryrunAuxiliary () const
 Called by the framework to merge or insert run in principal cache. More...
 
void setLuminosityBlockNumber_t (LuminosityBlockNumber_t lb)
 Set the luminosity block ID. More...
 
void setRunNumber (RunNumber_t r)
 Set the run number. More...
 
void skipEvents (int offset)
 
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper () const
 Accessors for thinnedAssociationsHelper. More...
 
std::shared_ptr< ThinnedAssociationsHelper > & thinnedAssociationsHelper ()
 
Timestamp const & timestamp () const
 Accessor for the current time, as seen by the input source. More...
 
virtual ~InputSource () noexcept(false)
 Destructor. More...
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::InputSource
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

void closeFile_ () override
 
 DQMRootSource (const DQMRootSource &)=delete
 
edm::InputSource::ItemType getNextItemType () override
 
void logFileAction (char const *msg, char const *fileName) const
 
const DQMRootSourceoperator= (const DQMRootSource &)=delete
 
void readElements ()
 
void readEvent_ (edm::EventPrincipal &) override
 
std::unique_ptr< edm::FileBlockreadFile_ () override
 
void readLuminosityBlock_ (edm::LuminosityBlockPrincipal &lbCache) override
 
std::shared_ptr< edm::LuminosityBlockAuxiliaryreadLuminosityBlockAuxiliary_ () override
 
void readNextItemType ()
 
void readRun_ (edm::RunPrincipal &rpCache) override
 
std::shared_ptr< edm::RunAuxiliaryreadRunAuxiliary_ () override
 
bool setupFile (unsigned int iIndex)
 
bool skipIt (edm::RunNumber_t, edm::LuminosityBlockNumber_t) const
 

Private Attributes

edm::InputFileCatalog m_catalog
 
std::unique_ptr< TFile > m_file
 
size_t m_fileIndex
 
unsigned int m_filterOnRun
 
std::vector< edm::ProcessHistoryIDm_historyIDs
 
edm::JobReport::Token m_jrToken
 
bool m_justOpenedFileSoNeedToGenerateRunTransition
 
unsigned int m_lastSeenLumi2
 
edm::ProcessHistoryID m_lastSeenReducedPHID
 
edm::ProcessHistoryID m_lastSeenReducedPHID2
 
unsigned int m_lastSeenRun
 
unsigned int m_lastSeenRun2
 
edm::LuminosityBlockAuxiliary m_lumiAux
 
std::set< MonitorElement * > m_lumiElements
 
std::vector< edm::LuminosityBlockRangem_lumisToProcess
 
std::list< unsigned int >::iterator m_nextIndexItr
 
edm::InputSource::ItemType m_nextItemType
 
std::list< unsigned int > m_orderedIndices
 
std::list< unsigned int >::iterator m_presentIndexItr
 
size_t m_presentlyOpenFileIndex
 
std::vector< edm::ProcessHistoryIDm_reducedHistoryIDs
 
edm::RunAuxiliary m_runAux
 
std::set< MonitorElement * > m_runElements
 
std::vector< RunLumiToRange > m_runlumiToRange
 
std::vector< edm::RunNumber_tm_runsToProcess
 
bool m_shouldReadMEs
 
bool m_skipBadFiles
 
std::vector< boost::shared_ptr< TreeReaderBase > > m_treeReaders
 
std::vector< TTree * > m_trees
 

Additional Inherited Members

- Public Types inherited from edm::InputSource
enum  ItemType {
  IsInvalid, IsStop, IsFile, IsRun,
  IsLumi, IsEvent, IsRepeat, IsSynchronize
}
 
enum  ProcessingMode { Runs, RunsAndLumis, RunsLumisAndEvents }
 
- Public Attributes inherited from edm::InputSource
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> postEventReadFromSourceSignal_
 
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> preEventReadFromSourceSignal_
 
- Protected Member Functions inherited from edm::InputSource
void decreaseRemainingEventsBy (int iSkipped)
 
bool eventCached () const
 
bool newLumi () const
 
bool newRun () const
 
ProcessHistoryRegistryprocessHistoryRegistryForUpdate ()
 
ProductRegistryproductRegistryUpdate ()
 
void reset () const
 
void resetEventCached ()
 
void resetLuminosityBlockAuxiliary (bool isNewLumi=true) const
 
void resetNewLumi ()
 
void resetNewRun ()
 
void resetRunAuxiliary (bool isNewRun=true) const
 
void setEventCached ()
 Called by the framework to merge or ached() const {return eventCached_;}. More...
 
void setLuminosityBlockAuxiliary (LuminosityBlockAuxiliary *lbp)
 
void setNewLumi ()
 
void setNewRun ()
 
void setRunAuxiliary (RunAuxiliary *rp)
 
void setTimestamp (Timestamp const &theTime)
 To set the current time, as seen by the input source. More...
 
virtual void skip (int offset)
 
ItemType state () const
 

Detailed Description

Definition at line 303 of file DQMRootSource.cc.

Constructor & Destructor Documentation

DQMRootSource::DQMRootSource ( edm::ParameterSet const &  iPSet,
const edm::InputSourceDescription iDesc 
)

Definition at line 444 of file DQMRootSource.cc.

References edm::InputFileCatalog::fileNames(), edm::InputSource::IsStop, kFloatIndex, kIntIndex, kStringIndex, kTH1DIndex, kTH1FIndex, kTH1SIndex, kTH2DIndex, kTH2FIndex, kTH2SIndex, kTH3FIndex, kTProfile2DIndex, kTProfileIndex, m_catalog, m_fileIndex, m_lumisToProcess, m_nextItemType, m_runsToProcess, m_treeReaders, and edm::sortAndRemoveOverlaps().

444  :
445  edm::InputSource(iPSet,iDesc),
446  m_catalog(iPSet.getUntrackedParameter<std::vector<std::string> >("fileNames"),
447  iPSet.getUntrackedParameter<std::string>("overrideCatalog")),
449  m_fileIndex(0),
451  m_trees(kNIndicies,static_cast<TTree*>(nullptr)),
452  m_treeReaders(kNIndicies,boost::shared_ptr<TreeReaderBase>()),
454  m_lastSeenRun(0),
456  m_lastSeenRun2(0),
457  m_lastSeenLumi2(0),
458  m_filterOnRun(iPSet.getUntrackedParameter<unsigned int>("filterOnRun", 0)),
459  m_skipBadFiles(iPSet.getUntrackedParameter<bool>("skipBadFiles", false)),
460  m_lumisToProcess(iPSet.getUntrackedParameter<std::vector<edm::LuminosityBlockRange> >("lumisToProcess",std::vector<edm::LuminosityBlockRange>())),
462  m_shouldReadMEs(true)
463 {
465  for(std::vector<edm::LuminosityBlockRange>::const_iterator itr = m_lumisToProcess.begin(); itr!=m_lumisToProcess.end(); ++itr)
466  m_runsToProcess.push_back(itr->startRun());
467 
468  if(m_fileIndex ==m_catalog.fileNames().size()) {
470  } else{
471  m_treeReaders[kIntIndex].reset(new TreeSimpleReader<Long64_t>());
472  m_treeReaders[kFloatIndex].reset(new TreeSimpleReader<double>());
473  m_treeReaders[kStringIndex].reset(new TreeObjectReader<std::string>());
474  m_treeReaders[kTH1FIndex].reset(new TreeObjectReader<TH1F>());
475  m_treeReaders[kTH1SIndex].reset(new TreeObjectReader<TH1S>());
476  m_treeReaders[kTH1DIndex].reset(new TreeObjectReader<TH1D>());
477  m_treeReaders[kTH2FIndex].reset(new TreeObjectReader<TH2F>());
478  m_treeReaders[kTH2SIndex].reset(new TreeObjectReader<TH2S>());
479  m_treeReaders[kTH2DIndex].reset(new TreeObjectReader<TH2D>());
480  m_treeReaders[kTH3FIndex].reset(new TreeObjectReader<TH3F>());
481  m_treeReaders[kTProfileIndex].reset(new TreeObjectReader<TProfile>());
482  m_treeReaders[kTProfile2DIndex].reset(new TreeObjectReader<TProfile2D>());
483  }
484 }
edm::InputSource::ItemType m_nextItemType
unsigned int m_lastSeenRun2
std::vector< edm::RunNumber_t > m_runsToProcess
std::vector< boost::shared_ptr< TreeReaderBase > > m_treeReaders
size_t m_presentlyOpenFileIndex
unsigned int m_filterOnRun
bool m_justOpenedFileSoNeedToGenerateRunTransition
edm::InputFileCatalog m_catalog
edm::ProcessHistoryID m_lastSeenReducedPHID2
std::vector< TTree * > m_trees
std::vector< std::string > const & fileNames() const
unsigned int m_lastSeenLumi2
std::vector< edm::LuminosityBlockRange > m_lumisToProcess
edm::ProcessHistoryID m_lastSeenReducedPHID
std::vector< EventRange > & sortAndRemoveOverlaps(std::vector< EventRange > &eventRange)
Definition: EventRange.cc:102
unsigned int m_lastSeenRun
DQMRootSource::~DQMRootSource ( )
override

Definition at line 491 of file DQMRootSource.cc.

References edm::InputFileCatalog::fileNames(), logFileAction(), m_catalog, m_file, and m_presentlyOpenFileIndex.

492 {
493  if(m_file.get() != nullptr && m_file->IsOpen()) {
494  m_file->Close();
495  logFileAction(" Closed file ", m_catalog.fileNames()[m_presentlyOpenFileIndex].c_str());
496  }
497 }
void logFileAction(char const *msg, char const *fileName) const
size_t m_presentlyOpenFileIndex
edm::InputFileCatalog m_catalog
std::vector< std::string > const & fileNames() const
std::unique_ptr< TFile > m_file
DQMRootSource::DQMRootSource ( const DQMRootSource )
privatedelete

Member Function Documentation

void DQMRootSource::closeFile_ ( )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 678 of file DQMRootSource.cc.

References edm::JobReport::inputFileClosed(), m_file, m_jrToken, and edm::Primary.

678  {
679  if(m_file.get()==nullptr) { return; }
682 }
edm::JobReport::Token m_jrToken
std::unique_ptr< TFile > m_file
void inputFileClosed(InputType inputType, Token fileToken)
Definition: JobReport.cc:376
void DQMRootSource::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 425 of file DQMRootSource.cc.

References edm::ConfigurationDescriptions::addDefault(), edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.

425  {
427  desc.addUntracked<std::vector<std::string> >("fileNames")
428  ->setComment("Names of files to be processed.");
429  desc.addUntracked<unsigned int>("filterOnRun",0)
430  ->setComment("Just limit the process to the selected run.");
431  desc.addUntracked<bool>("skipBadFiles",false)
432  ->setComment("Skip the file if it is not valid");
433  desc.addUntracked<std::string>("overrideCatalog",std::string())
434  ->setComment("An alternate file catalog to use instead of the standard site one.");
435  std::vector<edm::LuminosityBlockRange> defaultLumis;
436  desc.addUntracked<std::vector<edm::LuminosityBlockRange> >("lumisToProcess",defaultLumis)
437  ->setComment("Skip any lumi inside the specified run:lumi range.");
438 
439  descriptions.addDefault(desc);
440 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void addDefault(ParameterSetDescription const &psetDescription)
edm::InputSource::ItemType DQMRootSource::getNextItemType ( )
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 519 of file DQMRootSource.cc.

References m_nextItemType.

520 {
521  //std::cout <<"getNextItemType "<<m_nextItemType<<std::endl;
522  return m_nextItemType;
523 }
edm::InputSource::ItemType m_nextItemType
void DQMRootSource::logFileAction ( char const *  msg,
char const *  fileName 
) const
private

Definition at line 1058 of file DQMRootSource.cc.

References DEFINE_FWK_INPUT_SOURCE, MillePedeFileConverter_cfg::fileName, and edm::FlushMessageLog().

Referenced by setupFile(), and ~DQMRootSource().

1058  {
1059  edm::LogAbsolute("fileAction") << std::setprecision(0) << edm::TimeOfDay() << msg << fileName;
1061 }
void FlushMessageLog()
tuple msg
Definition: mps_check.py:285
const DQMRootSource& DQMRootSource::operator= ( const DQMRootSource )
privatedelete
void DQMRootSource::readElements ( )
private

Definition at line 684 of file DQMRootSource.cc.

References kNoTypesStored, m_orderedIndices, m_presentIndexItr, m_reducedHistoryIDs, RunInfoPI::m_run, m_runlumiToRange, m_shouldReadMEs, m_treeReaders, matplotRender::reader, and skipIt().

Referenced by readLuminosityBlock_(), and readRun_().

684  {
686  RunLumiToRange runLumiRange = m_runlumiToRange[*m_presentIndexItr];
687  bool shouldContinue = false;
688  do
689  {
690  shouldContinue = false;
694 
695  if(runLumiRange.m_type != kNoTypesStored) {
696  boost::shared_ptr<TreeReaderBase> reader = m_treeReaders[runLumiRange.m_type];
697  ULong64_t index = runLumiRange.m_firstIndex;
698  ULong64_t endIndex = runLumiRange.m_lastIndex+1;
699  for (; index != endIndex; ++index)
700  {
701  bool isLumi = runLumiRange.m_lumi !=0;
702  if (m_shouldReadMEs)
703  reader->read(index,*store,isLumi);
704 
705  //std::cout << runLumiRange.m_run << " " << runLumiRange.m_lumi <<" "<<index<< " " << runLumiRange.m_type << std::endl;
706  }
707  }
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 }
std::vector< boost::shared_ptr< TreeReaderBase > > m_treeReaders
std::list< unsigned int >::iterator m_presentIndexItr
std::vector< edm::ProcessHistoryID > m_reducedHistoryIDs
std::vector< RunLumiToRange > m_runlumiToRange
std::list< unsigned int > m_orderedIndices
bool skipIt(edm::RunNumber_t, edm::LuminosityBlockNumber_t) const
void DQMRootSource::readEvent_ ( edm::EventPrincipal )
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 514 of file DQMRootSource.cc.

515 {
516  //std::cout << "readEvent_" << std::endl;
517 }
std::unique_ptr< edm::FileBlock > DQMRootSource::readFile_ ( )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 649 of file DQMRootSource.cc.

References edm::InputFileCatalog::fileNames(), edm::JobReport::inputFileOpened(), edm::InputSource::IsStop, edm::InputFileCatalog::logicalFileNames(), m_catalog, m_file, m_fileIndex, m_jrToken, m_nextItemType, m_orderedIndices, m_presentIndexItr, RunInfoPI::m_run, m_runlumiToRange, readNextItemType(), setupFile(), skipIt(), and AlCaHLTBitMon_QueryRunRegistry::string.

649  {
650  auto const numFiles = m_catalog.fileNames().size();
651  while(m_fileIndex < numFiles && not setupFile(m_fileIndex++)) {}
652 
653  if(m_file.get() == nullptr) {
654  //last file in list was bad
656  return std::unique_ptr<edm::FileBlock>(new edm::FileBlock);
657  }
658 
662 
666  std::string(),
667  std::string(),
668  "DQMRootSource",
669  "source",
670  m_file->GetUUID().AsString(),//edm::createGlobalIdentifier(),
671  std::vector<std::string>()
672  );
673 
674  return std::unique_ptr<edm::FileBlock>(new edm::FileBlock);
675 }
edm::InputSource::ItemType m_nextItemType
edm::JobReport::Token m_jrToken
void readNextItemType()
std::list< unsigned int >::iterator m_presentIndexItr
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:320
std::vector< RunLumiToRange > m_runlumiToRange
edm::InputFileCatalog m_catalog
std::list< unsigned int > m_orderedIndices
std::vector< std::string > const & logicalFileNames() const
std::vector< std::string > const & fileNames() const
std::unique_ptr< TFile > m_file
bool skipIt(edm::RunNumber_t, edm::LuminosityBlockNumber_t) const
bool setupFile(unsigned int iIndex)
void DQMRootSource::readLuminosityBlock_ ( edm::LuminosityBlockPrincipal lbCache)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 612 of file DQMRootSource.cc.

References edm::LuminosityBlockPrincipal::fillLuminosityBlockPrincipal(), edm::LuminosityBlockPrincipal::id(), edm::LuminosityBlockID::luminosityBlock(), m_lastSeenLumi2, m_lastSeenReducedPHID2, m_lastSeenRun2, m_orderedIndices, m_presentIndexItr, m_reducedHistoryIDs, m_runlumiToRange, m_shouldReadMEs, edm::InputSource::processHistoryRegistryForUpdate(), readElements(), readNextItemType(), edm::JobReport::reportInputLumiSection(), and edm::LuminosityBlockID::run().

613 {
614  assert(m_presentIndexItr != m_orderedIndices.end());
615  RunLumiToRange runLumiRange = m_runlumiToRange[*m_presentIndexItr];
616  assert(runLumiRange.m_run == lbCache.id().run());
617  assert(runLumiRange.m_lumi == lbCache.id().luminosityBlock());
618 
619  //NOTE: need to reset all lumi block elements at this point
620  if( ( m_lastSeenLumi2 != runLumiRange.m_lumi ||
621  m_lastSeenRun2 != runLumiRange.m_run ||
622  m_lastSeenReducedPHID2 != m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex) )
623  && m_shouldReadMEs) {
624 
626  std::vector<MonitorElement*> allMEs = (*store).getAllContents("");
627  //for(auto const& ME : allMEs) {
628  // // We do not want to reset Run Products here!
629  // if (ME->getLumiFlag()) {
630  // ME->Reset();
631  // }
632  //}
633  m_lastSeenReducedPHID2 = m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex);
634  m_lastSeenRun2 = runLumiRange.m_run;
635  m_lastSeenLumi2 = runLumiRange.m_lumi;
636  }
637 
639  readElements();
640 
642  jr->reportInputLumiSection(lbCache.id().run(),lbCache.id().luminosityBlock());
643 
645 
646 }
unsigned int m_lastSeenRun2
void readNextItemType()
std::list< unsigned int >::iterator m_presentIndexItr
std::vector< edm::ProcessHistoryID > m_reducedHistoryIDs
void fillLuminosityBlockPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
std::vector< RunLumiToRange > m_runlumiToRange
void reportInputLumiSection(unsigned int run, unsigned int lumiSectId)
Definition: JobReport.cc:465
edm::ProcessHistoryID m_lastSeenReducedPHID2
std::list< unsigned int > m_orderedIndices
RunNumber_t run() const
unsigned int m_lastSeenLumi2
LuminosityBlockNumber_t luminosityBlock() const
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
Definition: InputSource.h:327
std::shared_ptr< edm::LuminosityBlockAuxiliary > DQMRootSource::readLuminosityBlockAuxiliary_ ( )
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 541 of file DQMRootSource.cc.

References m_historyIDs, m_lumiAux, m_nextIndexItr, m_orderedIndices, m_runlumiToRange, and edm::LuminosityBlockAuxiliary::setProcessHistoryID().

542 {
543  //std::cout <<"readLuminosityBlockAuxiliary_"<<std::endl;
544  assert(m_nextIndexItr != m_orderedIndices.end());
545  const RunLumiToRange runLumiRange = m_runlumiToRange[*m_nextIndexItr];
546  m_lumiAux = edm::LuminosityBlockAuxiliary(edm::LuminosityBlockID(runLumiRange.m_run,runLumiRange.m_lumi),
547  edm::Timestamp(runLumiRange.m_beginTime),
548  edm::Timestamp(runLumiRange.m_endTime));
549  assert(m_historyIDs.size() > runLumiRange.m_historyIDIndex);
550  //std::cout <<"lumi "<<m_lumiAux.beginTime().value()<<" "<<runLumiRange.m_beginTime<<std::endl;
551  m_lumiAux.setProcessHistoryID(m_historyIDs[runLumiRange.m_historyIDIndex]);
552 
553  return std::make_shared<edm::LuminosityBlockAuxiliary>(m_lumiAux);
554 }
std::vector< RunLumiToRange > m_runlumiToRange
edm::LuminosityBlockAuxiliary m_lumiAux
std::vector< edm::ProcessHistoryID > m_historyIDs
std::list< unsigned int > m_orderedIndices
void setProcessHistoryID(ProcessHistoryID const &phid)
std::list< unsigned int >::iterator m_nextIndexItr
void DQMRootSource::readNextItemType ( )
private

Definition at line 725 of file DQMRootSource.cc.

References edm::InputFileCatalog::fileNames(), edm::InputSource::IsFile, edm::InputSource::IsLumi, edm::InputSource::IsRun, edm::InputSource::IsStop, m_catalog, m_fileIndex, m_justOpenedFileSoNeedToGenerateRunTransition, m_lastSeenReducedPHID, m_lastSeenRun, m_nextIndexItr, m_nextItemType, m_orderedIndices, m_reducedHistoryIDs, RunInfoPI::m_run, m_runlumiToRange, and skipIt().

Referenced by readFile_(), readLuminosityBlock_(), and readRun_().

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 }
edm::InputSource::ItemType m_nextItemType
std::vector< edm::ProcessHistoryID > m_reducedHistoryIDs
std::vector< RunLumiToRange > m_runlumiToRange
bool m_justOpenedFileSoNeedToGenerateRunTransition
edm::InputFileCatalog m_catalog
std::list< unsigned int > m_orderedIndices
std::vector< std::string > const & fileNames() const
edm::ProcessHistoryID m_lastSeenReducedPHID
bool skipIt(edm::RunNumber_t, edm::LuminosityBlockNumber_t) const
std::list< unsigned int >::iterator m_nextIndexItr
unsigned int m_lastSeenRun
void DQMRootSource::readRun_ ( edm::RunPrincipal rpCache)
overrideprivatevirtual

If the collate option is not set for the DQMStore, we should indeed be sure to reset all histograms after a run transition, but we should definitely avoid doing it using a local, private copy of the actual content of the DQMStore. Clients are completely free to delete/add MonitorElements from the DQMStore and the local copy stored in the std::set will never notice it until it will try to reset a deleted object. That's why the resetting directly queries the DQMStore for its current content.

Reimplemented from edm::InputSource.

Definition at line 557 of file DQMRootSource.cc.

References edm::RunPrincipal::fillRunPrincipal(), edm::RunPrincipal::id(), m_filterOnRun, m_justOpenedFileSoNeedToGenerateRunTransition, m_lastSeenReducedPHID, m_lastSeenRun, m_orderedIndices, m_presentIndexItr, m_reducedHistoryIDs, m_runlumiToRange, m_shouldReadMEs, edm::InputSource::processHistoryRegistryForUpdate(), readElements(), readNextItemType(), edm::JobReport::reportInputRunNumber(), and edm::RunID::run().

558 {
559  assert(m_presentIndexItr != m_orderedIndices.end());
560  RunLumiToRange runLumiRange = m_runlumiToRange[*m_presentIndexItr];
561 
563  unsigned int runID =rpCache.id().run();
564  assert(runID == runLumiRange.m_run);
565 
566  m_shouldReadMEs = (m_filterOnRun == 0 ||
567  (m_filterOnRun != 0 && m_filterOnRun == runID));
568  // std::cout <<"readRun_"<<std::endl;
569  // std::cout <<"m_shouldReadMEs " << m_shouldReadMEs <<std::endl;
570 
581  //NOTE: need to reset all run elements at this point
582  if( m_lastSeenRun != runID ||
583  m_lastSeenReducedPHID != m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex) ) {
584  if (m_shouldReadMEs) {
586  std::vector<MonitorElement*> allMEs = (*store).getAllContents("");
587  for(auto const& ME : allMEs) {
588  if ( !(*store).isCollate() )
589  ME->Reset();
590  }
591  }
592  m_lastSeenReducedPHID = m_reducedHistoryIDs.at(runLumiRange.m_historyIDIndex);
593  m_lastSeenRun = runID;
594  }
595 
597 
598  //NOTE: it is possible to have a Run when all we have stored is lumis
599  if(runLumiRange.m_lumi == 0) {
600  readElements();
601  }
602 
603 
605  jr->reportInputRunNumber(rpCache.id().run());
606 
608 }
void readNextItemType()
RunNumber_t run() const
Definition: RunID.h:39
void reportInputRunNumber(unsigned int run)
Definition: JobReport.cc:471
std::list< unsigned int >::iterator m_presentIndexItr
unsigned int m_filterOnRun
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
Definition: RunPrincipal.cc:26
std::vector< edm::ProcessHistoryID > m_reducedHistoryIDs
Definition: ME.h:11
std::vector< RunLumiToRange > m_runlumiToRange
bool m_justOpenedFileSoNeedToGenerateRunTransition
std::list< unsigned int > m_orderedIndices
RunID const & id() const
Definition: RunPrincipal.h:64
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
Definition: InputSource.h:327
edm::ProcessHistoryID m_lastSeenReducedPHID
unsigned int m_lastSeenRun
std::shared_ptr< edm::RunAuxiliary > DQMRootSource::readRunAuxiliary_ ( )
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 525 of file DQMRootSource.cc.

References m_historyIDs, m_nextIndexItr, m_orderedIndices, m_runAux, m_runlumiToRange, and edm::RunAuxiliary::setProcessHistoryID().

526 {
527  //std::cout <<"readRunAuxiliary_"<<std::endl;
528  assert(m_nextIndexItr != m_orderedIndices.end());
529  RunLumiToRange runLumiRange = m_runlumiToRange[*m_nextIndexItr];
530 
531  //NOTE: the setBeginTime and setEndTime functions of RunAuxiliary only work if the previous value was invalid
532  // therefore we must copy
533  m_runAux = edm::RunAuxiliary(runLumiRange.m_run,edm::Timestamp(runLumiRange.m_beginTime),edm::Timestamp(runLumiRange.m_endTime));
534  assert(m_historyIDs.size() > runLumiRange.m_historyIDIndex);
535  //std::cout <<"readRunAuxiliary_ "<<m_historyIDs[runLumiRange.m_historyIDIndex]<<std::endl;
536  m_runAux.setProcessHistoryID(m_historyIDs[runLumiRange.m_historyIDIndex]);
537  return std::make_shared<edm::RunAuxiliary>(m_runAux);
538 }
edm::RunAuxiliary m_runAux
std::vector< RunLumiToRange > m_runlumiToRange
std::vector< edm::ProcessHistoryID > m_historyIDs
std::list< unsigned int > m_orderedIndices
std::list< unsigned int >::iterator m_nextIndexItr
void setProcessHistoryID(ProcessHistoryID const &phid)
Definition: RunAuxiliary.h:36
bool DQMRootSource::setupFile ( unsigned int  iIndex)
private

Definition at line 786 of file DQMRootSource.cc.

References cms::Exception::addContext(), mvaPhotonID_Fall17_94X_V1_cff::configs, edm::InputFileCatalog::fileNames(), edm::errors::FileOpenError, edm::errors::FileReadError, edm::threadLocalException::getException(), mps_fire::i, edm::ProcessHistory::id(), edm::pset::Registry::instance(), kBeginTimeBranch, kEndTimeBranch, kFirstIndex, kIndicesTree, kLastIndex, kLumiBranch, kMetaDataDirectoryAbsolute, kNIndicies, kParameterSetBranch, kParameterSetTree, kPHIndexBranch, kProcessConfigurationParameterSetIDBranch, kProcessConfigurationPassID, kProcessConfigurationProcessNameBranch, kProcessConfigurationReleaseVersion, kProcessHistoryIndexBranch, kProcessHistoryTree, kRunBranch, kTypeBranch, kTypeNames, logFileAction(), m_catalog, m_file, m_historyIDs, m_justOpenedFileSoNeedToGenerateRunTransition, m_nextIndexItr, m_orderedIndices, m_presentIndexItr, m_presentlyOpenFileIndex, m_reducedHistoryIDs, m_runlumiToRange, m_skipBadFiles, m_treeReaders, m_trees, eostools::move(), edm::InputSource::processHistoryRegistryForUpdate(), modifiedElectrons_cfi::processName, edm::ProcessHistoryRegistry::reducedProcessHistoryID(), edm::ParameterSet::registerFromString(), edm::ProcessHistoryRegistry::registerProcessHistory(), edm::threadLocalException::setException(), AlCaHLTBitMon_QueryRunRegistry::string, and groupFilesInBlocks::temp.

Referenced by readFile_().

787 {
788  if(m_file.get() != nullptr && 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::unique_ptr<TFile> newFile;
796  try {
797  // ROOT's context management implicitly assumes that a file is opened and
798  // closed on the same thread. To avoid the problem, we declare a local
799  // TContext object; when it goes out of scope, its destructor unregisters
800  // the context, guaranteeing the context is unregistered in the same thread
801  // it was registered in.
802  TDirectory::TContext contextEraser;
803  newFile = std::unique_ptr<TFile>(TFile::Open(m_catalog.fileNames()[iIndex].c_str()));
804 
805  //Since ROOT6, we can not propagate an exception through ROOT's plugin
806  // system so we trap them and then pull from this function
807  std::exception_ptr e = edm::threadLocalException::getException();
808  if(e != std::exception_ptr()) {
809  edm::threadLocalException::setException(std::exception_ptr());
810  std::rethrow_exception(e);
811  }
812 
813  } catch(cms::Exception const& e) {
814  if(!m_skipBadFiles) {
816  ex.addContext("Opening DQM Root file");
817  ex <<"\nInput file " << m_catalog.fileNames()[iIndex] << " was not found, could not be opened, or is corrupted.\n";
818  throw ex;
819  }
820  return false;
821  }
822  if(not newFile->IsZombie()) {
823  logFileAction(" Successfully opened file ", m_catalog.fileNames()[iIndex].c_str());
824  } else {
825  if(!m_skipBadFiles) {
827  ex<<"Input file "<<m_catalog.fileNames()[iIndex].c_str() <<" could not be opened.\n";
828  ex.addContext("Opening DQM Root file");
829  throw ex;
830  }
831  return false;
832  }
833  //Check file format version, which is encoded in the Title of the TFile
834  if(0 != strcmp(newFile->GetTitle(),"1")) {
836  ex<<"Input file "<<m_catalog.fileNames()[iIndex].c_str() <<" does not appear to be a DQM Root file.\n";
837  }
838 
839  //Get meta Data
840  TDirectory* metaDir = newFile->GetDirectory(kMetaDataDirectoryAbsolute);
841  if(nullptr==metaDir) {
842  if(!m_skipBadFiles) {
844  ex<<"Input file "<<m_catalog.fileNames()[iIndex].c_str() <<" appears to be corrupted since it does not have the proper internal structure.\n"
845  " Check to see if the file was closed properly.\n";
846  ex.addContext("Opening DQM Root file");
847  throw ex;
848  }
849  else {return false;}
850  }
851  m_file = std::move(newFile); //passed all tests so now we want to use this file
852  TTree* parameterSetTree = dynamic_cast<TTree*>(metaDir->Get(kParameterSetTree));
853  assert(nullptr!=parameterSetTree);
854 
856  assert(nullptr!=psr);
857  {
858  std::string blob;
859  std::string* pBlob = &blob;
860  parameterSetTree->SetBranchAddress(kParameterSetBranch,&pBlob);
861  for(unsigned int index = 0; index != parameterSetTree->GetEntries();++index)
862  {
863  parameterSetTree->GetEntry(index);
865  }
866  }
867 
868  {
869  TTree* processHistoryTree = dynamic_cast<TTree*>(metaDir->Get(kProcessHistoryTree));
870  assert(nullptr!=processHistoryTree);
871  unsigned int phIndex = 0;
872  processHistoryTree->SetBranchAddress(kPHIndexBranch,&phIndex);
874  std::string* pProcessName = &processName;
875  processHistoryTree->SetBranchAddress(kProcessConfigurationProcessNameBranch,&pProcessName);
876  std::string parameterSetIDBlob;
877  std::string* pParameterSetIDBlob = &parameterSetIDBlob;
878  processHistoryTree->SetBranchAddress(kProcessConfigurationParameterSetIDBranch,&pParameterSetIDBlob);
879  std::string releaseVersion;
880  std::string* pReleaseVersion = &releaseVersion;
881  processHistoryTree->SetBranchAddress(kProcessConfigurationReleaseVersion,&pReleaseVersion);
882  std::string passID;
883  std::string* pPassID = &passID;
884  processHistoryTree->SetBranchAddress(kProcessConfigurationPassID,&pPassID);
885 
887  std::vector<edm::ProcessConfiguration> configs;
888  configs.reserve(5);
889  m_historyIDs.clear();
890  m_reducedHistoryIDs.clear();
891  for(unsigned int i=0; i != processHistoryTree->GetEntries(); ++i) {
892  processHistoryTree->GetEntry(i);
893  if(phIndex==0) {
894  if(not configs.empty()) {
895  edm::ProcessHistory ph(configs);
896  m_historyIDs.push_back(ph.id());
897  phr.registerProcessHistory(ph);
898  m_reducedHistoryIDs.push_back(phr.reducedProcessHistoryID(ph.id()));
899  }
900  configs.clear();
901  }
902  edm::ParameterSetID psetID(parameterSetIDBlob);
903  edm::ProcessConfiguration pc(processName, psetID,releaseVersion,passID);
904  configs.push_back(pc);
905  }
906  if(not configs.empty()) {
907  edm::ProcessHistory ph(configs);
908  m_historyIDs.push_back(ph.id());
909  phr.registerProcessHistory(ph);
910  m_reducedHistoryIDs.push_back(phr.reducedProcessHistoryID(ph.id()));
911  //std::cout <<"inserted "<<ph.id()<<std::endl;
912  }
913  }
914 
915  //Setup the indices
916  TTree* indicesTree = dynamic_cast<TTree*>(m_file->Get(kIndicesTree));
917  assert(nullptr!=indicesTree);
918 
919  m_runlumiToRange.clear();
920  m_runlumiToRange.reserve(indicesTree->GetEntries());
921  m_orderedIndices.clear();
922 
923  RunLumiToRange temp;
924  indicesTree->SetBranchAddress(kRunBranch,&temp.m_run);
925  indicesTree->SetBranchAddress(kLumiBranch,&temp.m_lumi);
926  indicesTree->SetBranchAddress(kBeginTimeBranch,&temp.m_beginTime);
927  indicesTree->SetBranchAddress(kEndTimeBranch,&temp.m_endTime);
928  indicesTree->SetBranchAddress(kProcessHistoryIndexBranch,&temp.m_historyIDIndex);
929  indicesTree->SetBranchAddress(kTypeBranch,&temp.m_type);
930  indicesTree->SetBranchAddress(kFirstIndex,&temp.m_firstIndex);
931  indicesTree->SetBranchAddress(kLastIndex,&temp.m_lastIndex);
932 
933  //Need to reorder items since if there was a merge done the same Run
934  //and/or Lumi can appear multiple times but we want to process them
935  //all at once
936 
937  //We use a std::list for m_orderedIndices since inserting into the
938  //middle of a std::list does not disrupt the iterators to already
939  //existing entries
940 
941  //The Map is used to see if a Run/Lumi pair has appeared before
942  typedef std::map<RunLumiPHIDKey, std::list<unsigned int>::iterator > RunLumiToLastEntryMap;
943  RunLumiToLastEntryMap runLumiToLastEntryMap;
944 
945  //Need to group all lumis for the same run together and move the run
946  //entry to the beginning
947  typedef std::map<RunPHIDKey, std::pair< std::list<unsigned int>::iterator, std::list<unsigned int>::iterator> > RunToFirstLastEntryMap;
948  RunToFirstLastEntryMap runToFirstLastEntryMap;
949 
950  for (Long64_t index = 0; index != indicesTree->GetEntries(); ++index)
951  {
952  indicesTree->GetEntry(index);
953 // std::cout <<"read r:"<<temp.m_run
954 // <<" l:"<<temp.m_lumi
955 // <<" b:"<<temp.m_beginTime
956 // <<" e:"<<temp.m_endTime
957 // <<" fi:" << temp.m_firstIndex
958 // <<" li:" << temp.m_lastIndex
959 // <<" type:" << temp.m_type << std::endl;
960  m_runlumiToRange.push_back(temp);
961 
962  RunLumiPHIDKey runLumi(m_reducedHistoryIDs.at(temp.m_historyIDIndex), temp.m_run, temp.m_lumi);
963  RunPHIDKey runKey(m_reducedHistoryIDs.at(temp.m_historyIDIndex), temp.m_run);
964 
965  RunLumiToLastEntryMap::iterator itFind = runLumiToLastEntryMap.find(runLumi);
966  if (itFind == runLumiToLastEntryMap.end())
967  {
968  //does not already exist
969  //does the run for this already exist?
970  std::list<unsigned int>::iterator itLastOfRun = m_orderedIndices.end();
971 
972  RunToFirstLastEntryMap::iterator itRunFirstLastEntryFind = runToFirstLastEntryMap.find(runKey);
973  bool needNewEntryInRunFirstLastEntryMap = true;
974  if (itRunFirstLastEntryFind != runToFirstLastEntryMap.end())
975  {
976  needNewEntryInRunFirstLastEntryMap=false;
977  if (temp.m_lumi!=0)
978  {
979  //lumis go to the end
980  itLastOfRun = itRunFirstLastEntryFind->second.second;
981  //we want to insert after this one so must advance the iterator
982  ++itLastOfRun;
983  }
984  else
985  {
986  //runs go at the beginning
987  itLastOfRun = itRunFirstLastEntryFind->second.first;
988  }
989  }
990  std::list<unsigned int>::iterator iter = m_orderedIndices.insert(itLastOfRun,index);
991  runLumiToLastEntryMap[runLumi]=iter;
992  if (needNewEntryInRunFirstLastEntryMap)
993  runToFirstLastEntryMap[runKey]=std::make_pair(iter,iter);
994  else
995  {
996  if(temp.m_lumi!=0)
997  {
998  //lumis go at end
999  runToFirstLastEntryMap[runKey].second = iter;
1000  }
1001  else
1002  {
1003  //since we haven't yet seen this run/lumi combination it means we haven't yet seen
1004  // a run so we can put this first
1005  runToFirstLastEntryMap[runKey].first = iter;
1006  }
1007  }
1008  }
1009  else
1010  {
1011  //We need to do a merge since the run/lumi already appeared. Put it after the existing entry
1012  //std::cout <<" found a second instance of "<<runLumi.first<<" "<<runLumi.second<<" at "<<index<<std::endl;
1013  std::list<unsigned int>::iterator itNext = itFind->second;
1014  ++itNext;
1015  std::list<unsigned int>::iterator iter = m_orderedIndices.insert(itNext,index);
1016  RunToFirstLastEntryMap::iterator itRunFirstLastEntryFind = runToFirstLastEntryMap.find(runKey);
1017  if (itRunFirstLastEntryFind->second.second == itFind->second)
1018  {
1019  //if the previous one was the last in the run, we need to update to make this one the last
1020  itRunFirstLastEntryFind->second.second = iter;
1021  }
1022  itFind->second = iter;
1023  }
1024  }
1025  m_nextIndexItr = m_orderedIndices.begin();
1027 
1028  if(m_nextIndexItr != m_orderedIndices.end()) {
1029  for( size_t index = 0; index < kNIndicies; ++index) {
1030  m_trees[index] = dynamic_cast<TTree*>(m_file->Get(kTypeNames[index]));
1031  assert(nullptr!=m_trees[index]);
1032  m_treeReaders[index]->setTree(m_trees[index]);
1033  }
1034  }
1035  //After a file open, the framework expects to see a new 'IsRun'
1037 
1038  return true;
1039 }
static const char *const kProcessHistoryTree
Definition: format.h:54
static const char *const kRunBranch
Definition: format.h:41
static const char *const kTypeNames[]
Definition: format.h:28
void logFileAction(char const *msg, char const *fileName) const
std::vector< boost::shared_ptr< TreeReaderBase > > m_treeReaders
static const char *const kIndicesTree
Definition: format.h:40
bool registerProcessHistory(ProcessHistory const &processHistory)
static const char *const kFirstIndex
Definition: format.h:47
static const char *const kLumiBranch
Definition: format.h:42
size_t m_presentlyOpenFileIndex
std::list< unsigned int >::iterator m_presentIndexItr
std::vector< edm::ProcessHistoryID > m_reducedHistoryIDs
static const char *const kPHIndexBranch
Definition: format.h:55
static const char *const kParameterSetBranch
Definition: format.h:62
std::vector< RunLumiToRange > m_runlumiToRange
std::vector< edm::ProcessHistoryID > m_historyIDs
bool m_justOpenedFileSoNeedToGenerateRunTransition
edm::InputFileCatalog m_catalog
static const char *const kParameterSetTree
Definition: format.h:61
std::list< unsigned int > m_orderedIndices
static const char *const kTypeBranch
Definition: format.h:46
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
static const char *const kProcessHistoryIndexBranch
Definition: format.h:43
static const char *const kEndTimeBranch
Definition: format.h:45
std::vector< TTree * > m_trees
static const char *const kProcessConfigurationPassID
Definition: format.h:59
static void registerFromString(std::string const &rep)
Definition: ParameterSet.cc:79
static const char *const kMetaDataDirectoryAbsolute
Definition: format.h:51
std::vector< std::string > const & fileNames() const
static const char *const kLastIndex
Definition: format.h:48
static const char *const kProcessConfigurationReleaseVersion
Definition: format.h:58
void setException(std::exception_ptr e)
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
Definition: InputSource.h:327
static const char *const kProcessConfigurationProcessNameBranch
Definition: format.h:56
std::unique_ptr< TFile > m_file
static const char *const kBeginTimeBranch
Definition: format.h:44
std::exception_ptr getException()
std::list< unsigned int >::iterator m_nextIndexItr
def move(src, dest)
Definition: eostools.py:511
static Registry * instance()
Definition: Registry.cc:12
static const char *const kProcessConfigurationParameterSetIDBranch
Definition: format.h:57
bool DQMRootSource::skipIt ( edm::RunNumber_t  run,
edm::LuminosityBlockNumber_t  lumi 
) const
private

Definition at line 1042 of file DQMRootSource.cc.

References edm::binary_search_all(), electrons_cff::bool, edm::lessThan(), m_lumisToProcess, m_runsToProcess, and edm::search_all().

Referenced by readElements(), readFile_(), and readNextItemType().

1042  {
1043  if(!m_runsToProcess.empty() && edm::search_all(m_runsToProcess, run) && lumi==0) {
1044  return false;
1045  }
1046 
1048  edm::LuminosityBlockRange lumiRange = edm::LuminosityBlockRange(lumiID, lumiID);
1050  if(!m_lumisToProcess.empty() && !binary_search_all(m_lumisToProcess, lumiRange, lt)) {
1051  return true;
1052  }
1053  return false;
1054 }
std::vector< edm::RunNumber_t > m_runsToProcess
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:436
std::vector< edm::LuminosityBlockRange > m_lumisToProcess
bool search_all(ForwardSequence const &s, Datum const &d)
Definition: Algorithms.h:36
bool binary_search_all(ForwardSequence const &s, Datum const &d)
wrappers for std::binary_search
Definition: Algorithms.h:58
bool lessThan(EventRange const &lh, EventRange const &rh)
Definition: EventRange.cc:67

Member Data Documentation

edm::InputFileCatalog DQMRootSource::m_catalog
private
std::unique_ptr<TFile> DQMRootSource::m_file
private

Definition at line 391 of file DQMRootSource.cc.

Referenced by closeFile_(), readFile_(), setupFile(), and ~DQMRootSource().

size_t DQMRootSource::m_fileIndex
private

Definition at line 386 of file DQMRootSource.cc.

Referenced by DQMRootSource(), readFile_(), and readNextItemType().

unsigned int DQMRootSource::m_filterOnRun
private

Definition at line 401 of file DQMRootSource.cc.

Referenced by readRun_().

std::vector<edm::ProcessHistoryID> DQMRootSource::m_historyIDs
private

Definition at line 410 of file DQMRootSource.cc.

Referenced by readLuminosityBlockAuxiliary_(), readRunAuxiliary_(), and setupFile().

edm::JobReport::Token DQMRootSource::m_jrToken
private

Definition at line 413 of file DQMRootSource.cc.

Referenced by closeFile_(), and readFile_().

bool DQMRootSource::m_justOpenedFileSoNeedToGenerateRunTransition
private

Definition at line 406 of file DQMRootSource.cc.

Referenced by readNextItemType(), readRun_(), and setupFile().

unsigned int DQMRootSource::m_lastSeenLumi2
private

Definition at line 400 of file DQMRootSource.cc.

Referenced by readLuminosityBlock_().

edm::ProcessHistoryID DQMRootSource::m_lastSeenReducedPHID
private

Definition at line 396 of file DQMRootSource.cc.

Referenced by readNextItemType(), and readRun_().

edm::ProcessHistoryID DQMRootSource::m_lastSeenReducedPHID2
private

Definition at line 398 of file DQMRootSource.cc.

Referenced by readLuminosityBlock_().

unsigned int DQMRootSource::m_lastSeenRun
private

Definition at line 397 of file DQMRootSource.cc.

Referenced by readNextItemType(), and readRun_().

unsigned int DQMRootSource::m_lastSeenRun2
private

Definition at line 399 of file DQMRootSource.cc.

Referenced by readLuminosityBlock_().

edm::LuminosityBlockAuxiliary DQMRootSource::m_lumiAux
private

Definition at line 383 of file DQMRootSource.cc.

Referenced by readLuminosityBlockAuxiliary_().

std::set<MonitorElement*> DQMRootSource::m_lumiElements
private

Definition at line 408 of file DQMRootSource.cc.

std::vector<edm::LuminosityBlockRange> DQMRootSource::m_lumisToProcess
private

Definition at line 403 of file DQMRootSource.cc.

Referenced by DQMRootSource(), and skipIt().

std::list<unsigned int>::iterator DQMRootSource::m_nextIndexItr
private
edm::InputSource::ItemType DQMRootSource::m_nextItemType
private

Definition at line 384 of file DQMRootSource.cc.

Referenced by DQMRootSource(), getNextItemType(), readFile_(), and readNextItemType().

std::list<unsigned int> DQMRootSource::m_orderedIndices
private
std::list<unsigned int>::iterator DQMRootSource::m_presentIndexItr
private

Definition at line 389 of file DQMRootSource.cc.

Referenced by readElements(), readFile_(), readLuminosityBlock_(), readRun_(), and setupFile().

size_t DQMRootSource::m_presentlyOpenFileIndex
private

Definition at line 387 of file DQMRootSource.cc.

Referenced by setupFile(), and ~DQMRootSource().

std::vector<edm::ProcessHistoryID> DQMRootSource::m_reducedHistoryIDs
private
edm::RunAuxiliary DQMRootSource::m_runAux
private

Definition at line 382 of file DQMRootSource.cc.

Referenced by readRunAuxiliary_().

std::set<MonitorElement*> DQMRootSource::m_runElements
private

Definition at line 409 of file DQMRootSource.cc.

std::vector<RunLumiToRange> DQMRootSource::m_runlumiToRange
private
std::vector<edm::RunNumber_t> DQMRootSource::m_runsToProcess
private

Definition at line 404 of file DQMRootSource.cc.

Referenced by DQMRootSource(), and skipIt().

bool DQMRootSource::m_shouldReadMEs
private

Definition at line 407 of file DQMRootSource.cc.

Referenced by readElements(), readLuminosityBlock_(), and readRun_().

bool DQMRootSource::m_skipBadFiles
private

Definition at line 402 of file DQMRootSource.cc.

Referenced by setupFile().

std::vector<boost::shared_ptr<TreeReaderBase> > DQMRootSource::m_treeReaders
private

Definition at line 393 of file DQMRootSource.cc.

Referenced by DQMRootSource(), readElements(), and setupFile().

std::vector<TTree*> DQMRootSource::m_trees
private

Definition at line 392 of file DQMRootSource.cc.

Referenced by setupFile().