CMS 3D CMS Logo

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

List of all members.

Public Member Functions

 PFDQMEventSelector (const edm::ParameterSet &)
 ~PFDQMEventSelector ()

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_

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_.

                                                                     {
   verbose_       = pset.getParameter<bool>( "DebugOn" );
   inputFileName_ = pset.getParameter<std::string>("InputFileName");
   folderNames_   = pset.getParameter< std::vector<std::string> >("FolderNames");

   nEvents_         = 0;
   nSelectedEvents_ = 0;
   fileOpened_      = false;
}
PFDQMEventSelector::~PFDQMEventSelector ( )

Definition at line 28 of file PFDQMEventSelector.cc.

                                        {
}

Member Function Documentation

void PFDQMEventSelector::beginJob ( void  ) [private, virtual]
void PFDQMEventSelector::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDFilter.

Definition at line 73 of file PFDQMEventSelector.cc.

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

                                {
  if ( verbose_ ) std::cout << " Total Events " << nEvents_ 
                            << " Selected Events " << nSelectedEvents_ 
                            << std::endl; 
}
bool PFDQMEventSelector::filter ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
) [private, virtual]

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_, getHLTPrescaleColumns::path, edm::EventID::run(), AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

                                                                               {
  
  nEvents_++;
  if (!fileOpened_) return false;

  unsigned int runNb  = iEvent.id().run();
  unsigned int evtNb  = iEvent.id().event();
  unsigned int lumiNb = iEvent.id().luminosityBlock();
  std::ostringstream eventid_str;
  eventid_str << runNb << "_"<< evtNb << "_" << lumiNb;
  
  for (std::vector<std::string>::const_iterator ifolder = folderNames_.begin();
                                    ifolder != folderNames_.end(); ifolder++) {
    std::string path  = "ParticleFlow/"+(*ifolder) + "/BadEvents";
    MonitorElement* me = dqmStore_->get(path + "/" + eventid_str.str());
    if (me) {
      nSelectedEvents_++;
      if ( verbose_ ) std::cout << " Total Events " << nEvents_ 
                                << " Selected Events " << nSelectedEvents_ 
                                << " Run # : " << runNb 
                                << " Event # : " << evtNb
                                << " Luminosity Block # : " << lumiNb
                                <<  std::endl;           
      return true;
    }
  } 
  return false;
}
bool PFDQMEventSelector::openInputFile ( ) [private]

Definition at line 81 of file PFDQMEventSelector.cc.

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

Referenced by beginJob().

                                       { 
  if (inputFileName_.size() == 0) return false;
  edm::LogInfo("SiStripOfflineDQM") <<  "SiStripOfflineDQM::openInputFile: Accessing root File" << inputFileName_;
  dqmStore_->open(inputFileName_, false, "", "", DQMStore::StripRunDirs); 
  return true;
}

Member Data Documentation

Definition at line 28 of file PFDQMEventSelector.h.

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

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().

Definition at line 21 of file PFDQMEventSelector.h.

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

Definition at line 22 of file PFDQMEventSelector.h.

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