CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::ProductRegistryHelper

Public Member Functions

 PFDQMEventSelector (const edm::ParameterSet &)
 
 ~PFDQMEventSelector ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

void beginJob ()
 
void endJob ()
 
bool filter (edm::Event &, edm::EventSetup const &)
 
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
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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_, 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 ( )

Definition at line 28 of file PFDQMEventSelector.cc.

28  {
29 }

Member Function Documentation

void PFDQMEventSelector::beginJob ( void  )
privatevirtual
void PFDQMEventSelector::endJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 73 of file PFDQMEventSelector.cc.

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

73  {
74  if ( verbose_ ) std::cout << " Total Events " << nEvents_
75  << " Selected Events " << nSelectedEvents_
76  << std::endl;
77 }
tuple cout
Definition: gather_cfg.py:121
bool PFDQMEventSelector::filter ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
privatevirtual

Implements edm::EDFilter.

Definition at line 42 of file PFDQMEventSelector.cc.

References gather_cfg::cout, dqmStore_, edm::EventID::event(), fileOpened_, folderNames_, DQMStore::get(), edm::EventBase::id(), edm::EventID::luminosityBlock(), nEvents_, nSelectedEvents_, scaleCards::path, edm::EventID::run(), 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().

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

Definition at line 81 of file PFDQMEventSelector.cc.

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

Referenced by beginJob().

81  {
82  if (inputFileName_.size() == 0) return false;
83  edm::LogInfo("SiStripOfflineDQM") << "SiStripOfflineDQM::openInputFile: Accessing root File" << inputFileName_;
85  return true;
86 }
std::string inputFileName_
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2432

Member Data Documentation

DQMStore* PFDQMEventSelector::dqmStore_
private

Definition at line 28 of file PFDQMEventSelector.h.

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

bool PFDQMEventSelector::fileOpened_
private

Definition at line 26 of file PFDQMEventSelector.h.

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

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

Definition at line 24 of file PFDQMEventSelector.h.

Referenced by filter(), and PFDQMEventSelector().

std::string PFDQMEventSelector::inputFileName_
private

Definition at line 25 of file PFDQMEventSelector.h.

Referenced by openInputFile(), and PFDQMEventSelector().

uint64_t PFDQMEventSelector::nEvents_
private

Definition at line 21 of file PFDQMEventSelector.h.

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

uint64_t PFDQMEventSelector::nSelectedEvents_
private

Definition at line 21 of file PFDQMEventSelector.h.

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

bool PFDQMEventSelector::verbose_
private

Definition at line 22 of file PFDQMEventSelector.h.

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