CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
PFDQMEventSelector Class Reference

#include <PFDQMEventSelector.h>

Inheritance diagram for PFDQMEventSelector:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 PFDQMEventSelector (const edm::ParameterSet &)
 
 ~PFDQMEventSelector () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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
 
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::vector< ModuleDescription const * > &modules, 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)
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
bool filter (edm::Event &, edm::EventSetup const &) override
 
bool openInputFile ()
 

Private Attributes

DQMStoredqmStore_
 
bool fileOpened_
 
std::vector< std::string > folderNames_
 
std::string inputFileName_
 
uint64_t nEvents_
 
uint64_t nSelectedEvents_
 
bool verbose_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- 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>
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 8 of file PFDQMEventSelector.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 10 of file PFDQMEventSelector.h.

◆ MonitorElement

Definition at line 11 of file PFDQMEventSelector.h.

Constructor & Destructor Documentation

◆ PFDQMEventSelector()

PFDQMEventSelector::PFDQMEventSelector ( const edm::ParameterSet pset)

Definition at line 15 of file PFDQMEventSelector.cc.

15  {
16  verbose_ = pset.getParameter<bool>("DebugOn");
17  inputFileName_ = pset.getParameter<std::string>("InputFileName");
18  folderNames_ = pset.getParameter<std::vector<std::string>>("FolderNames");
19 
20  nEvents_ = 0;
21  nSelectedEvents_ = 0;
22  fileOpened_ = false;
23 }

References fileOpened_, folderNames_, inputFileName_, nEvents_, nSelectedEvents_, muonDTDigis_cfi::pset, AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

◆ ~PFDQMEventSelector()

PFDQMEventSelector::~PFDQMEventSelector ( )
override

Definition at line 27 of file PFDQMEventSelector.cc.

27 {}

Member Function Documentation

◆ beginJob()

void PFDQMEventSelector::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 32 of file PFDQMEventSelector.cc.

32  {
33  dqmStore_ = edm::Service<DQMStore>().operator->();
35 }

References dqmStore_, fileOpened_, and openInputFile().

◆ endJob()

void PFDQMEventSelector::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 67 of file PFDQMEventSelector.cc.

67  {
68  if (verbose_)
69  std::cout << " Total Events " << nEvents_ << " Selected Events " << nSelectedEvents_ << std::endl;
70 }

References gather_cfg::cout, nEvents_, nSelectedEvents_, and verbose_.

◆ filter()

bool PFDQMEventSelector::filter ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements edm::EDFilter.

Definition at line 39 of file PFDQMEventSelector.cc.

39  {
40  nEvents_++;
41  if (!fileOpened_)
42  return false;
43 
44  edm::RunNumber_t runNb = iEvent.id().run();
45  edm::EventNumber_t evtNb = iEvent.id().event();
46  edm::LuminosityBlockNumber_t lumiNb = iEvent.id().luminosityBlock();
47  std::ostringstream eventid_str;
48  eventid_str << runNb << "_" << evtNb << "_" << lumiNb;
49 
50  for (std::vector<std::string>::const_iterator ifolder = folderNames_.begin(); ifolder != folderNames_.end();
51  ifolder++) {
52  std::string path = "ParticleFlow/" + (*ifolder) + "/BadEvents";
53  MonitorElement *me = dqmStore_->get(path + "/" + eventid_str.str());
54  if (me) {
56  if (verbose_)
57  std::cout << " Total Events " << nEvents_ << " Selected Events " << nSelectedEvents_ << " Run # : " << runNb
58  << " Event # : " << evtNb << " Luminosity Block # : " << lumiNb << std::endl;
59  return true;
60  }
61  }
62  return false;
63 }

References gather_cfg::cout, dqmStore_, fileOpened_, folderNames_, dqm::implementation::IGetter::get(), iEvent, hlt_dqm_clientPB-live_cfg::me, nEvents_, nSelectedEvents_, castor_dqm_sourceclient_file_cfg::path, AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

◆ openInputFile()

bool PFDQMEventSelector::openInputFile ( )
private

Definition at line 74 of file PFDQMEventSelector.cc.

74  {
75  if (inputFileName_.empty())
76  return false;
77  edm::LogInfo("SiStripOfflineDQM") << "SiStripOfflineDQM::openInputFile: Accessing root File" << inputFileName_;
79  return true;
80 }

References dqmStore_, inputFileName_, dqm::implementation::DQMStore::open(), and dqm::implementation::DQMStore::StripRunDirs.

Referenced by beginJob().

Member Data Documentation

◆ dqmStore_

DQMStore* PFDQMEventSelector::dqmStore_
private

Definition at line 30 of file PFDQMEventSelector.h.

Referenced by beginJob(), filter(), and openInputFile().

◆ fileOpened_

bool PFDQMEventSelector::fileOpened_
private

Definition at line 28 of file PFDQMEventSelector.h.

Referenced by beginJob(), filter(), and PFDQMEventSelector().

◆ folderNames_

std::vector<std::string> PFDQMEventSelector::folderNames_
private

Definition at line 26 of file PFDQMEventSelector.h.

Referenced by filter(), and PFDQMEventSelector().

◆ inputFileName_

std::string PFDQMEventSelector::inputFileName_
private

Definition at line 27 of file PFDQMEventSelector.h.

Referenced by openInputFile(), and PFDQMEventSelector().

◆ nEvents_

uint64_t PFDQMEventSelector::nEvents_
private

Definition at line 23 of file PFDQMEventSelector.h.

Referenced by endJob(), filter(), and PFDQMEventSelector().

◆ nSelectedEvents_

uint64_t PFDQMEventSelector::nSelectedEvents_
private

Definition at line 23 of file PFDQMEventSelector.h.

Referenced by endJob(), filter(), and PFDQMEventSelector().

◆ verbose_

bool PFDQMEventSelector::verbose_
private

Definition at line 24 of file PFDQMEventSelector.h.

Referenced by endJob(), filter(), and PFDQMEventSelector().

edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
dqm::implementation::DQMStore::StripRunDirs
Definition: DQMStore.h:542
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Definition: MessageLogger.h:254
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
edm::LuminosityBlockNumber_t
unsigned int LuminosityBlockNumber_t
Definition: RunLumiEventNumber.h:13
PFDQMEventSelector::nEvents_
uint64_t nEvents_
Definition: PFDQMEventSelector.h:23
PFDQMEventSelector::openInputFile
bool openInputFile()
Definition: PFDQMEventSelector.cc:74
PFDQMEventSelector::verbose_
bool verbose_
Definition: PFDQMEventSelector.h:24
PFDQMEventSelector::fileOpened_
bool fileOpened_
Definition: PFDQMEventSelector.h:28
edm::EventNumber_t
unsigned long long EventNumber_t
Definition: RunLumiEventNumber.h:12
PFDQMEventSelector::folderNames_
std::vector< std::string > folderNames_
Definition: PFDQMEventSelector.h:26
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PFDQMEventSelector::dqmStore_
DQMStore * dqmStore_
Definition: PFDQMEventSelector.h:30
edm::Service
Definition: Service.h:30
iEvent
int iEvent
Definition: GenABIO.cc:224
PFDQMEventSelector::inputFileName_
std::string inputFileName_
Definition: PFDQMEventSelector.h:27
PFDQMEventSelector::nSelectedEvents_
uint64_t nSelectedEvents_
Definition: PFDQMEventSelector.h:23
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
dqm::implementation::DQMStore::open
DQM_DEPRECATED bool open(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:766
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:56
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27