CMS 3D CMS Logo

PFDQMEventSelector.cc
Go to the documentation of this file.
2 
6 
9 
10 #include <iostream>
11 
12 //
13 // -- Constructor
14 //
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 }
24 //
25 // -- Destructor
26 //
28 
29 //
30 // -- BeginJob
31 //
33  dqmStore_ = edm::Service<DQMStore>().operator->();
35 }
36 //
37 // -- Event Filtering
38 //
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 }
64 //
65 // -- End Job
66 //
68  if (verbose_)
69  std::cout << " Total Events " << nEvents_ << " Selected Events " << nSelectedEvents_ << std::endl;
70 }
71 //
72 // -- Open Input File
73 //
75  if (inputFileName_.empty())
76  return false;
77  edm::LogInfo("SiStripOfflineDQM") << "SiStripOfflineDQM::openInputFile: Accessing root File" << inputFileName_;
79  return true;
80 }
81 
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
Handle.h
dqm::implementation::DQMStore::StripRunDirs
Definition: DQMStore.h:542
MessageLogger.h
PFDQMEventSelector.h
PFDQMEventSelector::beginJob
void beginJob() override
Definition: PFDQMEventSelector.cc:32
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DQMStore.h
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
PFDQMEventSelector
Definition: PFDQMEventSelector.h:8
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::LuminosityBlockNumber_t
unsigned int LuminosityBlockNumber_t
Definition: RunLumiEventNumber.h:13
PFDQMEventSelector::nEvents_
uint64_t nEvents_
Definition: PFDQMEventSelector.h:23
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
PFDQMEventSelector::openInputFile
bool openInputFile()
Definition: PFDQMEventSelector.cc:74
Service.h
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
PFDQMEventSelector::filter
bool filter(edm::Event &, edm::EventSetup const &) override
Definition: PFDQMEventSelector.cc:39
edm::ParameterSet
Definition: ParameterSet.h:47
PFDQMEventSelector::dqmStore_
DQMStore * dqmStore_
Definition: PFDQMEventSelector.h:30
Event.h
PFDQMEventSelector::~PFDQMEventSelector
~PFDQMEventSelector() override
Definition: PFDQMEventSelector.cc:27
PFDQMEventSelector::endJob
void endJob() override
Definition: PFDQMEventSelector.cc:67
edm::Service
Definition: Service.h:30
iEvent
int iEvent
Definition: GenABIO.cc:224
PFDQMEventSelector::inputFileName_
std::string inputFileName_
Definition: PFDQMEventSelector.h:27
edm::EventSetup
Definition: EventSetup.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PFDQMEventSelector::nSelectedEvents_
uint64_t nSelectedEvents_
Definition: PFDQMEventSelector.h:23
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
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:790
PFDQMEventSelector::PFDQMEventSelector
PFDQMEventSelector(const edm::ParameterSet &)
Definition: PFDQMEventSelector.cc:15
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:61
edm::Event
Definition: Event.h:73
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27