CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
DQMRootOutputModule Class Reference
Inheritance diagram for DQMRootOutputModule:
edm::one::OutputModule<> edm::one::OutputModuleBase edm::EDConsumerBase

Public Member Functions

void beginJob () override
 
 DQMRootOutputModule (edm::ParameterSet const &pset)
 
 ~DQMRootOutputModule () override
 
- Public Member Functions inherited from edm::one::OutputModule<>
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
 OutputModule (edm::ParameterSet const &iPSet)
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::OutputModuleBase
BranchIDLists const * branchIDLists ()
 
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch () const
 
SelectedProductsForBranchType const & keptProducts () const
 
int maxEvents () const
 
const ModuleDescriptionmoduleDescription () const
 
OutputModuleBaseoperator= (OutputModuleBase const &)=delete
 
 OutputModuleBase (OutputModuleBase const &)=delete
 
 OutputModuleBase (ParameterSet const &pset)
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts (ProductRegistry const &preg, ThinnedAssociationsHelper const &)
 
SharedResourcesAcquirersharedResourcesAcquirer ()
 
SubProcessParentageHelper const * subProcessParentageHelper () const
 
ThinnedAssociationsHelper const * thinnedAssociationsHelper () const
 
bool wantAllEvents () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~OutputModuleBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::OutputModuleBase
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

void finishEndFile ()
 
bool isFileOpen () const override
 
void openFile (edm::FileBlock const &) override
 
void reallyCloseFile () override
 
void startEndFile ()
 
void write (edm::EventForOutput const &e) override
 
void writeLuminosityBlock (edm::LuminosityBlockForOutput const &) override
 
void writeRun (edm::RunForOutput const &) override
 

Private Attributes

ULong64_t m_beginTime
 
std::map< unsigned int, unsigned int > m_dqmKindToTypeIndex
 
ULong64_t m_endTime
 
std::unique_ptr< TFile > m_file
 
std::string m_fileName
 
unsigned int m_filterOnRun
 
ULong64_t m_firstIndex
 
std::string m_fullNameBuffer
 
std::string * m_fullNameBufferPtr
 
TTree * m_indicesTree
 
edm::JobReport::Token m_jrToken
 
ULong64_t m_lastIndex
 
std::string m_logicalFileName
 
unsigned int m_lumi
 
unsigned int m_presentHistoryIndex
 
edm::ProcessHistoryRegistry m_processHistoryRegistry
 
unsigned int m_run
 
std::vector< edm::ProcessHistoryIDm_seenHistories
 
std::vector< std::shared_ptr< TreeHelperBase > > m_treeHelpers
 
unsigned int m_type
 

Additional Inherited Members

- Public Types inherited from edm::one::OutputModuleBase
typedef OutputModuleBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::one::OutputModuleBase
void configure (OutputModuleDescription const &desc)
 
ModuleDescription const & description () const
 
void doAccessInputProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)
 
void doBeginJob ()
 
bool doBeginLuminosityBlock (LumiTransitionInfo const &, ModuleCallingContext const *)
 
void doBeginProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)
 
bool doBeginRun (RunTransitionInfo const &, ModuleCallingContext const *)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LumiTransitionInfo const &, ModuleCallingContext const *)
 
void doEndProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)
 
bool doEndRun (RunTransitionInfo const &, ModuleCallingContext const *)
 
bool doEvent (EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate (PreallocationConfiguration const &)
 
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID ()
 
virtual void preallocLumis (unsigned int)
 
ParameterSetID selectorConfig () const
 
void setEventSelectionInfo (std::map< std::string, std::vector< std::pair< std::string, int >>> const &outputModulePathPositions, bool anyProductProduced)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 195 of file DQMRootOutputModule.cc.

Constructor & Destructor Documentation

◆ DQMRootOutputModule()

DQMRootOutputModule::DQMRootOutputModule ( edm::ParameterSet const &  pset)
explicit

Definition at line 279 of file DQMRootOutputModule.cc.

282  m_fileName(pset.getUntrackedParameter<std::string>("fileName")),
283  m_logicalFileName(pset.getUntrackedParameter<std::string>("logicalFileName")),
284  m_file(nullptr),
285  m_treeHelpers(kNIndicies, std::shared_ptr<TreeHelperBase>()),
287  m_filterOnRun(pset.getUntrackedParameter<unsigned int>("filterOnRun")),
289  m_indicesTree(nullptr) {
290  // Declare dependencies for all Lumi and Run tokens here. In
291  // principle could use the keep statements, but then DQMToken would
292  // have to be made persistent (transient products are ignored),
293  // which would lead to a need to (finally) remove underscores from
294  // DQM module labels.
295  consumesMany<DQMToken, edm::InLumi>();
296  consumesMany<DQMToken, edm::InRun>();
297 }

◆ ~DQMRootOutputModule()

DQMRootOutputModule::~DQMRootOutputModule ( )
override

Definition at line 306 of file DQMRootOutputModule.cc.

306 {}

Member Function Documentation

◆ beginJob()

void DQMRootOutputModule::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::OutputModuleBase.

Definition at line 304 of file DQMRootOutputModule.cc.

304 {}

◆ fillDescriptions()

void DQMRootOutputModule::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 558 of file DQMRootOutputModule.cc.

558  {
560 
561  desc.addUntracked<std::string>("fileName");
562  desc.addUntracked<std::string>("logicalFileName", "");
563  desc.addUntracked<unsigned int>("filterOnRun", 0)
564  ->setComment("Only write the run with this run number. 0 means write all runs.");
565  desc.addOptionalUntracked<int>("splitLevel", 99)
566  ->setComment("UNUSED Only here to allow older configurations written for PoolOutputModule to work.");
567  const std::vector<std::string> keep = {"drop *", "keep DQMToken_*_*_*"};
569 
571  dataSet.setAllowAnything();
572  desc.addUntracked<edm::ParameterSetDescription>("dataset", dataSet)
573  ->setComment("PSet is only used by Data Operations and not by this module.");
574 
575  descriptions.addDefault(desc);
576 }

References edm::ConfigurationDescriptions::addDefault(), EgammaPostProcessor_cfi::dataSet, submitPVResolutionJobs::desc, edm::one::OutputModuleBase::fillDescription(), keep, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ finishEndFile()

void DQMRootOutputModule::finishEndFile ( )
private

Definition at line 543 of file DQMRootOutputModule.cc.

543  {
544  //std::cout << "DQMRootOutputModule::finishEndFile"<< std::endl;
545  m_file->Write();
546  m_file->Close();
549 }

References m_file, m_jrToken, and edm::JobReport::outputFileClosed().

Referenced by reallyCloseFile().

◆ isFileOpen()

bool DQMRootOutputModule::isFileOpen ( ) const
overrideprivatevirtual

Reimplemented from edm::one::OutputModuleBase.

Definition at line 323 of file DQMRootOutputModule.cc.

323 { return nullptr != m_file.get(); }

References m_file.

◆ openFile()

void DQMRootOutputModule::openFile ( edm::FileBlock const &  )
overrideprivatevirtual

Reimplemented from edm::one::OutputModuleBase.

Definition at line 325 of file DQMRootOutputModule.cc.

325  {
326  //NOTE: I need to also set the I/O performance settings
327 
328  m_file = std::make_unique<TFile>(m_fileName.c_str(),
329  "RECREATE",
330  "1" //This is the file format version number
331  );
332 
334  cms::Digest branchHash;
335  std::string guid{m_file->GetUUID().AsString()};
336  std::transform(guid.begin(), guid.end(), guid.begin(), (int (*)(int))std::toupper);
337  m_jrToken = jr->outputFileOpened(m_fileName,
339  std::string(),
340  "DQMRootOutputModule",
342  guid,
343  std::string(),
344  branchHash.digest().toString(),
345  std::vector<std::string>());
346 
348  m_indicesTree->Branch(kRunBranch, &m_run);
349  m_indicesTree->Branch(kLumiBranch, &m_lumi);
353  m_indicesTree->Branch(kTypeBranch, &m_type);
356  m_indicesTree->SetDirectory(m_file.get());
357 
358  unsigned int i = 0;
359  for (std::vector<std::shared_ptr<TreeHelperBase> >::iterator it = m_treeHelpers.begin(), itEnd = m_treeHelpers.end();
360  it != itEnd;
361  ++it, ++i) {
362  //std::cout <<"making "<<kTypeNames[i]<<std::endl;
363  TTree* tree = new TTree(kTypeNames[i], kTypeNames[i]);
364  *it = std::shared_ptr<TreeHelperBase>(makeHelper(i, tree, m_fullNameBufferPtr));
365  tree->SetDirectory(m_file.get()); //TFile takes ownership
366  }
367 
380 }

References edm::one::OutputModuleBase::description(), cms::Digest::digest(), mps_fire::i, createfilelist::int, MonitorElementData::INT, kBeginTimeBranch, kEndTimeBranch, kFirstIndex, kFloatIndex, kIndicesTree, kIntIndex, kLastIndex, kLumiBranch, kProcessHistoryIndexBranch, kRunBranch, kStringIndex, kTH1DIndex, kTH1FIndex, kTH1SIndex, kTH2DIndex, kTH2FIndex, kTH2SIndex, kTH3FIndex, kTProfile2DIndex, kTProfileIndex, kTypeBranch, kTypeNames, m_beginTime, m_dqmKindToTypeIndex, m_endTime, m_file, m_fileName, m_firstIndex, m_fullNameBufferPtr, m_indicesTree, m_jrToken, m_lastIndex, m_logicalFileName, m_lumi, m_presentHistoryIndex, m_run, m_treeHelpers, m_type, makeHelper(), HerwigMaxPtPartonFilter_cfi::moduleLabel, MonitorElementData::REAL, MonitorElementData::STRING, AlCaHLTBitMon_QueryRunRegistry::string, MonitorElementData::TH1D, MonitorElementData::TH1F, MonitorElementData::TH1S, MonitorElementData::TH2D, MonitorElementData::TH2F, MonitorElementData::TH2S, MonitorElementData::TH3F, cms::MD5Result::toString(), MonitorElementData::TPROFILE, MonitorElementData::TPROFILE2D, HcalDetIdTransform::transform(), and trackerHitRTTI::vector.

◆ reallyCloseFile()

void DQMRootOutputModule::reallyCloseFile ( )
overrideprivatevirtual

Reimplemented from edm::one::OutputModuleBase.

Definition at line 485 of file DQMRootOutputModule.cc.

485  {
486  startEndFile();
487  finishEndFile();
488 }

References finishEndFile(), and startEndFile().

◆ startEndFile()

void DQMRootOutputModule::startEndFile ( )
private

Definition at line 490 of file DQMRootOutputModule.cc.

490  {
491  //std::cout << "DQMRootOutputModule::startEndFile"<< std::endl;
492  //fill in the meta data
493  m_file->cd();
494  TDirectory* metaDataDirectory = m_file->mkdir(kMetaDataDirectory);
495 
496  //Write out the Process History
497  TTree* processHistoryTree = new TTree(kProcessHistoryTree, kProcessHistoryTree);
498  processHistoryTree->SetDirectory(metaDataDirectory);
499 
500  unsigned int index = 0;
501  processHistoryTree->Branch(kPHIndexBranch, &index);
503  processHistoryTree->Branch(kProcessConfigurationProcessNameBranch, &processName);
504  std::string parameterSetID;
505  processHistoryTree->Branch(kProcessConfigurationParameterSetIDBranch, &parameterSetID);
506  std::string releaseVersion;
507  processHistoryTree->Branch(kProcessConfigurationReleaseVersion, &releaseVersion);
508  std::string passID;
509  processHistoryTree->Branch(kProcessConfigurationPassID, &passID);
510 
511  for (std::vector<edm::ProcessHistoryID>::iterator it = m_seenHistories.begin(), itEnd = m_seenHistories.end();
512  it != itEnd;
513  ++it) {
515  assert(nullptr != history);
516  index = 0;
517  for (edm::ProcessHistory::collection_type::const_iterator itPC = history->begin(), itPCEnd = history->end();
518  itPC != itPCEnd;
519  ++itPC, ++index) {
520  processName = itPC->processName();
521  releaseVersion = itPC->releaseVersion();
522  passID = itPC->passID();
523  parameterSetID = itPC->parameterSetID().compactForm();
524  processHistoryTree->Fill();
525  }
526  }
527 
528  //Store the ParameterSets
529  TTree* parameterSetsTree = new TTree(kParameterSetTree, kParameterSetTree);
530  parameterSetsTree->SetDirectory(metaDataDirectory);
531  std::string blob;
532  parameterSetsTree->Branch(kParameterSetBranch, &blob);
533 
535  assert(nullptr != psr);
536  for (edm::pset::Registry::const_iterator it = psr->begin(), itEnd = psr->end(); it != itEnd; ++it) {
537  blob.clear();
538  it->second.toString(blob);
539  parameterSetsTree->Fill();
540  }
541 }

References cms::cuda::assert(), edm::ProcessHistory::begin(), edm::pset::Registry::begin(), edm::ProcessHistory::end(), edm::pset::Registry::end(), edm::ProcessHistoryRegistry::getMapped(), edm::pset::Registry::instance(), kMetaDataDirectory, kParameterSetBranch, kParameterSetTree, kPHIndexBranch, kProcessConfigurationParameterSetIDBranch, kProcessConfigurationPassID, kProcessConfigurationProcessNameBranch, kProcessConfigurationReleaseVersion, kProcessHistoryTree, m_file, m_processHistoryRegistry, m_seenHistories, edm::one::OutputModuleBase::processName(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by reallyCloseFile().

◆ write()

void DQMRootOutputModule::write ( edm::EventForOutput const &  e)
overrideprivatevirtual

Implements edm::one::OutputModuleBase.

Definition at line 382 of file DQMRootOutputModule.cc.

382 {}

Referenced by pkg.AbstractPkg::generate().

◆ writeLuminosityBlock()

void DQMRootOutputModule::writeLuminosityBlock ( edm::LuminosityBlockForOutput const &  iLumi)
overrideprivatevirtual

Implements edm::one::OutputModuleBase.

Definition at line 384 of file DQMRootOutputModule.cc.

384  {
385  //std::cout << "DQMRootOutputModule::writeLuminosityBlock"<< std::endl;
386  edm::Service<DQMStore> dstore;
387  m_run = iLumi.id().run();
388  m_lumi = iLumi.id().value();
389  m_beginTime = iLumi.beginTime().value();
390  m_endTime = iLumi.endTime().value();
391  bool shouldWrite = (m_filterOnRun == 0 || (m_filterOnRun != 0 && m_filterOnRun == m_run));
392 
393  if (!shouldWrite)
394  return;
395  std::vector<MonitorElement*> items(dstore->getAllContents("", m_run, m_lumi));
396  for (std::vector<MonitorElement*>::iterator it = items.begin(), itEnd = items.end(); it != itEnd; ++it) {
397  assert((*it)->getScope() == MonitorElementData::Scope::LUMI);
398  std::map<unsigned int, unsigned int>::iterator itFound = m_dqmKindToTypeIndex.find((int)(*it)->kind());
399  assert(itFound != m_dqmKindToTypeIndex.end());
400  m_treeHelpers[itFound->second]->fill(*it);
401  }
402 
403  const edm::ProcessHistoryID& id = iLumi.processHistoryID();
404  std::vector<edm::ProcessHistoryID>::iterator itFind = std::find(m_seenHistories.begin(), m_seenHistories.end(), id);
405  if (itFind == m_seenHistories.end()) {
406  m_processHistoryRegistry.registerProcessHistory(iLumi.processHistory());
408  m_seenHistories.push_back(id);
409  } else {
410  m_presentHistoryIndex = itFind - m_seenHistories.begin();
411  }
412 
413  //Now store the relationship between run/lumi and indices in the other TTrees
414  bool storedLumiIndex = false;
415  unsigned int typeIndex = 0;
416  for (std::vector<std::shared_ptr<TreeHelperBase> >::iterator it = m_treeHelpers.begin(), itEnd = m_treeHelpers.end();
417  it != itEnd;
418  ++it, ++typeIndex) {
419  if ((*it)->wasFilled()) {
420  m_type = typeIndex;
421  (*it)->getRangeAndReset(m_firstIndex, m_lastIndex);
422  storedLumiIndex = true;
423  m_indicesTree->Fill();
424  }
425  }
426  if (not storedLumiIndex) {
427  //need to record lumis even if we stored no MonitorElements since some later DQM modules
428  // look to see what lumis were processed
430  m_firstIndex = 0;
431  m_lastIndex = 0;
432  m_indicesTree->Fill();
433  }
434 
437 }

References cms::cuda::assert(), edm::LuminosityBlockForOutput::beginTime(), edm::LuminosityBlockForOutput::endTime(), spr::find(), dqm::implementation::IGetter::getAllContents(), triggerObjects_cff::id, edm::LuminosityBlockForOutput::id(), mps_monitormerge::items, kNoTypesStored, m_beginTime, m_dqmKindToTypeIndex, m_endTime, m_filterOnRun, m_firstIndex, m_indicesTree, m_jrToken, m_lastIndex, m_lumi, m_presentHistoryIndex, m_processHistoryRegistry, m_run, m_seenHistories, m_treeHelpers, m_type, edm::OccurrenceForOutput::processHistory(), edm::OccurrenceForOutput::processHistoryID(), edm::ProcessHistoryRegistry::registerProcessHistory(), edm::JobReport::reportLumiSection(), edm::LuminosityBlockID::run(), edm::LuminosityBlockID::value(), edm::Timestamp::value(), and trackerHitRTTI::vector.

◆ writeRun()

void DQMRootOutputModule::writeRun ( edm::RunForOutput const &  iRun)
overrideprivatevirtual

Implements edm::one::OutputModuleBase.

Definition at line 439 of file DQMRootOutputModule.cc.

439  {
440  //std::cout << "DQMRootOutputModule::writeRun"<< std::endl;
441  edm::Service<DQMStore> dstore;
442  m_run = iRun.id().run();
443  m_lumi = 0;
444  m_beginTime = iRun.beginTime().value();
445  m_endTime = iRun.endTime().value();
446  bool shouldWrite = (m_filterOnRun == 0 || (m_filterOnRun != 0 && m_filterOnRun == m_run));
447 
448  if (!shouldWrite)
449  return;
450 
451  std::vector<MonitorElement*> items(dstore->getAllContents("", m_run, 0));
452  for (std::vector<MonitorElement*>::iterator it = items.begin(), itEnd = items.end(); it != itEnd; ++it) {
453  assert((*it)->getScope() == MonitorElementData::Scope::RUN);
454  std::map<unsigned int, unsigned int>::iterator itFound = m_dqmKindToTypeIndex.find((int)(*it)->kind());
455  assert(itFound != m_dqmKindToTypeIndex.end());
456  m_treeHelpers[itFound->second]->fill(*it);
457  }
458 
459  const edm::ProcessHistoryID& id = iRun.processHistoryID();
460  std::vector<edm::ProcessHistoryID>::iterator itFind = std::find(m_seenHistories.begin(), m_seenHistories.end(), id);
461  if (itFind == m_seenHistories.end()) {
462  m_processHistoryRegistry.registerProcessHistory(iRun.processHistory());
464  m_seenHistories.push_back(id);
465  } else {
466  m_presentHistoryIndex = itFind - m_seenHistories.begin();
467  }
468 
469  //Now store the relationship between run/lumi and indices in the other TTrees
470  unsigned int typeIndex = 0;
471  for (std::vector<std::shared_ptr<TreeHelperBase> >::iterator it = m_treeHelpers.begin(), itEnd = m_treeHelpers.end();
472  it != itEnd;
473  ++it, ++typeIndex) {
474  if ((*it)->wasFilled()) {
475  m_type = typeIndex;
476  (*it)->getRangeAndReset(m_firstIndex, m_lastIndex);
477  m_indicesTree->Fill();
478  }
479  }
480 
483 }

References cms::cuda::assert(), edm::RunForOutput::beginTime(), edm::RunForOutput::endTime(), spr::find(), dqm::implementation::IGetter::getAllContents(), triggerObjects_cff::id, edm::RunForOutput::id(), mps_monitormerge::items, m_beginTime, m_dqmKindToTypeIndex, m_endTime, m_filterOnRun, m_firstIndex, m_indicesTree, m_jrToken, m_lastIndex, m_lumi, m_presentHistoryIndex, m_processHistoryRegistry, m_run, m_seenHistories, m_treeHelpers, m_type, edm::OccurrenceForOutput::processHistory(), edm::OccurrenceForOutput::processHistoryID(), edm::ProcessHistoryRegistry::registerProcessHistory(), edm::JobReport::reportRunNumber(), edm::RunID::run(), edm::Timestamp::value(), and trackerHitRTTI::vector.

Member Data Documentation

◆ m_beginTime

ULong64_t DQMRootOutputModule::m_beginTime
private

Definition at line 221 of file DQMRootOutputModule.cc.

Referenced by openFile(), writeLuminosityBlock(), and writeRun().

◆ m_dqmKindToTypeIndex

std::map<unsigned int, unsigned int> DQMRootOutputModule::m_dqmKindToTypeIndex
private

Definition at line 229 of file DQMRootOutputModule.cc.

Referenced by openFile(), writeLuminosityBlock(), and writeRun().

◆ m_endTime

ULong64_t DQMRootOutputModule::m_endTime
private

Definition at line 222 of file DQMRootOutputModule.cc.

Referenced by openFile(), writeLuminosityBlock(), and writeRun().

◆ m_file

std::unique_ptr<TFile> DQMRootOutputModule::m_file
private

Definition at line 214 of file DQMRootOutputModule.cc.

Referenced by finishEndFile(), isFileOpen(), openFile(), and startEndFile().

◆ m_fileName

std::string DQMRootOutputModule::m_fileName
private

Definition at line 212 of file DQMRootOutputModule.cc.

Referenced by openFile().

◆ m_filterOnRun

unsigned int DQMRootOutputModule::m_filterOnRun
private

Definition at line 225 of file DQMRootOutputModule.cc.

Referenced by writeLuminosityBlock(), and writeRun().

◆ m_firstIndex

ULong64_t DQMRootOutputModule::m_firstIndex
private

Definition at line 223 of file DQMRootOutputModule.cc.

Referenced by openFile(), writeLuminosityBlock(), and writeRun().

◆ m_fullNameBuffer

std::string DQMRootOutputModule::m_fullNameBuffer
private

Definition at line 227 of file DQMRootOutputModule.cc.

◆ m_fullNameBufferPtr

std::string* DQMRootOutputModule::m_fullNameBufferPtr
private

Definition at line 228 of file DQMRootOutputModule.cc.

Referenced by openFile().

◆ m_indicesTree

TTree* DQMRootOutputModule::m_indicesTree
private

Definition at line 230 of file DQMRootOutputModule.cc.

Referenced by openFile(), writeLuminosityBlock(), and writeRun().

◆ m_jrToken

edm::JobReport::Token DQMRootOutputModule::m_jrToken
private

Definition at line 234 of file DQMRootOutputModule.cc.

Referenced by finishEndFile(), openFile(), writeLuminosityBlock(), and writeRun().

◆ m_lastIndex

ULong64_t DQMRootOutputModule::m_lastIndex
private

Definition at line 224 of file DQMRootOutputModule.cc.

Referenced by openFile(), writeLuminosityBlock(), and writeRun().

◆ m_logicalFileName

std::string DQMRootOutputModule::m_logicalFileName
private

Definition at line 213 of file DQMRootOutputModule.cc.

Referenced by openFile().

◆ m_lumi

unsigned int DQMRootOutputModule::m_lumi
private

Definition at line 218 of file DQMRootOutputModule.cc.

Referenced by openFile(), writeLuminosityBlock(), and writeRun().

◆ m_presentHistoryIndex

unsigned int DQMRootOutputModule::m_presentHistoryIndex
private

Definition at line 220 of file DQMRootOutputModule.cc.

Referenced by openFile(), writeLuminosityBlock(), and writeRun().

◆ m_processHistoryRegistry

edm::ProcessHistoryRegistry DQMRootOutputModule::m_processHistoryRegistry
private

Definition at line 233 of file DQMRootOutputModule.cc.

Referenced by startEndFile(), writeLuminosityBlock(), and writeRun().

◆ m_run

unsigned int DQMRootOutputModule::m_run
private

Definition at line 217 of file DQMRootOutputModule.cc.

Referenced by openFile(), writeLuminosityBlock(), and writeRun().

◆ m_seenHistories

std::vector<edm::ProcessHistoryID> DQMRootOutputModule::m_seenHistories
private

Definition at line 232 of file DQMRootOutputModule.cc.

Referenced by startEndFile(), writeLuminosityBlock(), and writeRun().

◆ m_treeHelpers

std::vector<std::shared_ptr<TreeHelperBase> > DQMRootOutputModule::m_treeHelpers
private

Definition at line 215 of file DQMRootOutputModule.cc.

Referenced by openFile(), writeLuminosityBlock(), and writeRun().

◆ m_type

unsigned int DQMRootOutputModule::m_type
private

Definition at line 219 of file DQMRootOutputModule.cc.

Referenced by openFile(), writeLuminosityBlock(), and writeRun().

edm::one::OutputModule<>
DQMRootOutputModule::m_presentHistoryIndex
unsigned int m_presentHistoryIndex
Definition: DQMRootOutputModule.cc:220
edm::pset::Registry::instance
static Registry * instance()
Definition: Registry.cc:12
kLastIndex
static const char *const kLastIndex
Definition: format.h:66
edm::ProcessHistoryRegistry::registerProcessHistory
bool registerProcessHistory(ProcessHistory const &processHistory)
Definition: ProcessHistoryRegistry.cc:11
DQMRootOutputModule::m_processHistoryRegistry
edm::ProcessHistoryRegistry m_processHistoryRegistry
Definition: DQMRootOutputModule.cc:233
mps_fire.i
i
Definition: mps_fire.py:428
kTProfileIndex
Definition: format.h:33
MonitorElementData::Kind::INT
DQMRootOutputModule::m_endTime
ULong64_t m_endTime
Definition: DQMRootOutputModule.cc:222
cms::Digest::digest
MD5Result digest()
Definition: Digest.cc:171
MonitorElementData::Kind::TH1S
kParameterSetBranch
static const char *const kParameterSetBranch
Definition: format.h:80
MonitorElementData::Kind::TH1F
tree
Definition: tree.py:1
MonitorElementData::Kind::STRING
EgammaPostProcessor_cfi.dataSet
dataSet
Definition: EgammaPostProcessor_cfi.py:6
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
DQMRootOutputModule::m_fullNameBufferPtr
std::string * m_fullNameBufferPtr
Definition: DQMRootOutputModule.cc:228
cms::cuda::assert
assert(be >=bs)
DQMRootOutputModule::m_type
unsigned int m_type
Definition: DQMRootOutputModule.cc:219
kLumiBranch
static const char *const kLumiBranch
Definition: format.h:60
DQMRootOutputModule::finishEndFile
void finishEndFile()
Definition: DQMRootOutputModule.cc:543
dqm::implementation::IGetter::getAllContents
virtual std::vector< dqm::harvesting::MonitorElement * > getAllContents(std::string const &path) const
Definition: DQMStore.cc:609
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
MonitorElementData::Kind::TH2D
kProcessHistoryTree
static const char *const kProcessHistoryTree
Definition: format.h:72
edm::one::OutputModuleBase::OutputModuleBase
OutputModuleBase(ParameterSet const &pset)
Definition: OutputModuleBase.cc:45
mps_monitormerge.items
list items
Definition: mps_monitormerge.py:29
MonitorElementData::Kind::TH2F
kProcessConfigurationParameterSetIDBranch
static const char *const kProcessConfigurationParameterSetIDBranch
Definition: format.h:75
kTypeNames
static const char *const kTypeNames[]
Definition: format.h:39
DQMRootOutputModule::m_lumi
unsigned int m_lumi
Definition: DQMRootOutputModule.cc:218
makeHelper
static TreeHelperBase * makeHelper(unsigned int iTypeIndex, TTree *iTree, std::string *iFullNameBufferPtr)
Definition: DQMRootOutputModule.cc:241
DQMRootOutputModule::m_fileName
std::string m_fileName
Definition: DQMRootOutputModule.cc:212
kNoTypesStored
Definition: format.h:36
cms::Digest
Definition: Digest.h:46
DQMRootOutputModule::m_dqmKindToTypeIndex
std::map< unsigned int, unsigned int > m_dqmKindToTypeIndex
Definition: DQMRootOutputModule.cc:229
edm::pset::Registry::end
const_iterator end() const
Definition: Registry.h:65
kTH3FIndex
Definition: format.h:32
kProcessConfigurationProcessNameBranch
static const char *const kProcessConfigurationProcessNameBranch
Definition: format.h:74
edm::Hash< ProcessHistoryType >
edm::JobReport::outputFileClosed
void outputFileClosed(Token fileToken)
Definition: JobReport.cc:433
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
edm::one::OutputModuleBase::fillDescription
static void fillDescription(ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())
Definition: OutputModuleBase.cc:350
kParameterSetTree
static const char *const kParameterSetTree
Definition: format.h:79
DQMRootOutputModule::m_lastIndex
ULong64_t m_lastIndex
Definition: DQMRootOutputModule.cc:224
kTypeBranch
static const char *const kTypeBranch
Definition: format.h:64
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DQMRootOutputModule::m_fullNameBuffer
std::string m_fullNameBuffer
Definition: DQMRootOutputModule.cc:227
edm::JobReport::reportLumiSection
void reportLumiSection(JobReport::Token token, unsigned int run, unsigned int lumiSectId, unsigned long nEvents=0)
Definition: JobReport.cc:458
kIntIndex
Definition: format.h:23
DQMRootOutputModule::m_filterOnRun
unsigned int m_filterOnRun
Definition: DQMRootOutputModule.cc:225
kTH1FIndex
Definition: format.h:26
DQMRootOutputModule::m_firstIndex
ULong64_t m_firstIndex
Definition: DQMRootOutputModule.cc:223
kMetaDataDirectory
static const char *const kMetaDataDirectory
Definition: format.h:70
kProcessConfigurationReleaseVersion
static const char *const kProcessConfigurationReleaseVersion
Definition: format.h:76
edm::Service
Definition: Service.h:30
createfilelist.int
int
Definition: createfilelist.py:10
edm::ProcessHistory::end
const_iterator end() const
Definition: ProcessHistory.h:63
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
kStringIndex
Definition: format.h:25
kPHIndexBranch
static const char *const kPHIndexBranch
Definition: format.h:73
kTH1SIndex
Definition: format.h:27
edm::JobReport::reportRunNumber
void reportRunNumber(JobReport::Token token, unsigned int run)
Definition: JobReport.cc:469
kTH2SIndex
Definition: format.h:30
kTH2FIndex
Definition: format.h:29
kProcessConfigurationPassID
static const char *const kProcessConfigurationPassID
Definition: format.h:77
DQMRootOutputModule::m_file
std::unique_ptr< TFile > m_file
Definition: DQMRootOutputModule.cc:214
MonitorElementData::Kind::TH1D
kEndTimeBranch
static const char *const kEndTimeBranch
Definition: format.h:63
edm::one::OutputModuleBase::processName
std::string const & processName() const
Definition: OutputModuleBase.h:94
DQMRootOutputModule::m_seenHistories
std::vector< edm::ProcessHistoryID > m_seenHistories
Definition: DQMRootOutputModule.cc:232
DQMRootOutputModule::m_run
unsigned int m_run
Definition: DQMRootOutputModule.cc:217
kTH2DIndex
Definition: format.h:31
kNIndicies
Definition: format.h:35
MonitorElementData::Kind::TH2S
DQMRootOutputModule::m_indicesTree
TTree * m_indicesTree
Definition: DQMRootOutputModule.cc:230
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::one::OutputModuleBase::description
ModuleDescription const & description() const
Definition: OutputModuleBase.cc:340
DQMRootOutputModule::m_treeHelpers
std::vector< std::shared_ptr< TreeHelperBase > > m_treeHelpers
Definition: DQMRootOutputModule.cc:215
MonitorElementData::Kind::TPROFILE2D
MonitorElementData::Kind::TH3F
kBeginTimeBranch
static const char *const kBeginTimeBranch
Definition: format.h:62
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
edm::ProcessHistoryRegistry::getMapped
bool getMapped(ProcessHistoryID const &key, ProcessHistory &value) const
Definition: ProcessHistoryRegistry.cc:29
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
kFirstIndex
static const char *const kFirstIndex
Definition: format.h:65
edm::ProcessHistory::begin
const_iterator begin() const
Definition: ProcessHistory.h:62
kTH1DIndex
Definition: format.h:28
DQMRootOutputModule::startEndFile
void startEndFile()
Definition: DQMRootOutputModule.cc:490
edm::ProcessHistory
Definition: ProcessHistory.h:13
kFloatIndex
Definition: format.h:24
kProcessHistoryIndexBranch
static const char *const kProcessHistoryIndexBranch
Definition: format.h:61
edm::pset::Registry::begin
const_iterator begin() const
Definition: Registry.h:63
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
DQMRootOutputModule::m_jrToken
edm::JobReport::Token m_jrToken
Definition: DQMRootOutputModule.cc:234
edm::pset::Registry::const_iterator
map_type::const_iterator const_iterator
Definition: Registry.h:61
cms::MD5Result::toString
std::string toString() const
Definition: Digest.cc:95
kIndicesTree
static const char *const kIndicesTree
Definition: format.h:58
DQMRootOutputModule::m_beginTime
ULong64_t m_beginTime
Definition: DQMRootOutputModule.cc:221
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
MonitorElementData::Kind::TPROFILE
keep
const int keep
Definition: GenParticlePruner.cc:48
DQMRootOutputModule::m_logicalFileName
std::string m_logicalFileName
Definition: DQMRootOutputModule.cc:213
MonitorElementData::Kind::REAL
kTProfile2DIndex
Definition: format.h:34
edm::pset::Registry
Definition: Registry.h:26
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
kRunBranch
static const char *const kRunBranch
Definition: format.h:59