CMS 3D CMS Logo

List of all members | 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 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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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

- 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
 
- 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 8 of file PFDQMEventSelector.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file PFDQMEventSelector.cc.

References fileOpened_, folderNames_, edm::ParameterSet::getParameter(), inputFileName_, nEvents_, nSelectedEvents_, AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

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

Definition at line 28 of file PFDQMEventSelector.cc.

28 {}

Member Function Documentation

void PFDQMEventSelector::beginJob ( void  )
overrideprivatevirtual
void PFDQMEventSelector::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 68 of file PFDQMEventSelector.cc.

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

68  {
69  if (verbose_)
70  std::cout << " Total Events " << nEvents_ << " Selected Events " << nSelectedEvents_ << std::endl;
71 }
bool PFDQMEventSelector::filter ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements edm::EDFilter.

Definition at line 40 of file PFDQMEventSelector.cc.

References gather_cfg::cout, dqmStore_, edm::EventID::event(), fileOpened_, folderNames_, DQMStore::get(), edm::EventBase::id(), edm::EventID::luminosityBlock(), nEvents_, nSelectedEvents_, callgraph::path, edm::EventID::run(), AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

40  {
41  nEvents_++;
42  if (!fileOpened_)
43  return false;
44 
45  edm::RunNumber_t runNb = iEvent.id().run();
46  edm::EventNumber_t evtNb = iEvent.id().event();
48  std::ostringstream eventid_str;
49  eventid_str << runNb << "_" << evtNb << "_" << lumiNb;
50 
51  for (std::vector<std::string>::const_iterator ifolder = folderNames_.begin(); ifolder != folderNames_.end();
52  ifolder++) {
53  std::string path = "ParticleFlow/" + (*ifolder) + "/BadEvents";
54  MonitorElement *me = dqmStore_->get(path + "/" + eventid_str.str());
55  if (me) {
57  if (verbose_)
58  std::cout << " Total Events " << nEvents_ << " Selected Events " << nSelectedEvents_ << " Run # : " << runNb
59  << " Event # : " << evtNb << " Luminosity Block # : " << lumiNb << std::endl;
60  return true;
61  }
62  }
63  return false;
64 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
unsigned long long EventNumber_t
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
unsigned int LuminosityBlockNumber_t
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
Definition: DQMStore.cc:1613
std::vector< std::string > folderNames_
edm::EventID id() const
Definition: EventBase.h:59
unsigned int RunNumber_t
bool PFDQMEventSelector::openInputFile ( )
private

Definition at line 75 of file PFDQMEventSelector.cc.

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

Referenced by beginJob().

75  {
76  if (inputFileName_.empty())
77  return false;
78  edm::LogInfo("SiStripOfflineDQM") << "SiStripOfflineDQM::openInputFile: Accessing root File" << inputFileName_;
80  return true;
81 }
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:2883
std::string inputFileName_

Member Data Documentation

DQMStore* PFDQMEventSelector::dqmStore_
private

Definition at line 27 of file PFDQMEventSelector.h.

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

bool PFDQMEventSelector::fileOpened_
private

Definition at line 25 of file PFDQMEventSelector.h.

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

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

Definition at line 23 of file PFDQMEventSelector.h.

Referenced by filter(), and PFDQMEventSelector().

std::string PFDQMEventSelector::inputFileName_
private

Definition at line 24 of file PFDQMEventSelector.h.

Referenced by openInputFile(), and PFDQMEventSelector().

uint64_t PFDQMEventSelector::nEvents_
private

Definition at line 20 of file PFDQMEventSelector.h.

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

uint64_t PFDQMEventSelector::nSelectedEvents_
private

Definition at line 20 of file PFDQMEventSelector.h.

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

bool PFDQMEventSelector::verbose_
private

Definition at line 21 of file PFDQMEventSelector.h.

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