CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 //
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();
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 
RunNumber_t run() const
Definition: EventID.h:38
~PFDQMEventSelector() override
EventNumber_t event() const
Definition: EventID.h:40
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
unsigned long long EventNumber_t
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:39
unsigned int LuminosityBlockNumber_t
void beginJob() override
int iEvent
Definition: GenABIO.cc:224
bool filter(edm::Event &, edm::EventSetup const &) override
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
Log< level::Info, false > LogInfo
PFDQMEventSelector(const edm::ParameterSet &)
std::vector< std::string > folderNames_
void endJob() override
std::string inputFileName_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EventID id() const
Definition: EventBase.h:59
tuple cout
Definition: gather_cfg.py:144
unsigned int RunNumber_t
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