CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
TopSingleLeptonDQM_miniAOD Class Reference

#include <TopSingleLeptonDQM_miniAOD.h>

Inheritance diagram for TopSingleLeptonDQM_miniAOD:
DQMEDAnalyzer edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup) override
 do this during the event loop More...
 
 TopSingleLeptonDQM_miniAOD (const edm::ParameterSet &cfg)
 default constructor More...
 
 ~TopSingleLeptonDQM_miniAOD () override
 default destructor More...
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () 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)
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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)
 

Private Member Functions

std::string objectType (const std::string &label)
 
std::string selectionStep (const std::string &label)
 

Private Attributes

edm::InputTag beamspot_
 beamspot More...
 
edm::EDGetTokenT< reco::BeamSpotbeamspot__
 
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
 string cut selector More...
 
std::unique_ptr< SelectionStep< pat::Electron > > ElectronStep
 
std::vector< std::unique_ptr< SelectionStep< pat::Jet > > > JetSteps
 
std::unique_ptr< SelectionStep< pat::MET > > METStep
 
std::unique_ptr< SelectionStep< pat::Muon > > MuonStep
 
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
 
std::vector< edm::ParameterSetsel_
 
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< TopSingleLepton_miniAOD::MonitorEnsemble > > > selection_
 
std::vector< std::string > selectionOrder_
 
edm::ParameterSet setup_
 
std::vector< std::string > triggerPaths_
 trigger paths More...
 
edm::EDGetTokenT< edm::TriggerResultstriggerTable__
 trigger table More...
 
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > vertexSelect_
 string cut selector More...
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase 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::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 187 of file TopSingleLeptonDQM_miniAOD.h.

Constructor & Destructor Documentation

TopSingleLeptonDQM_miniAOD::TopSingleLeptonDQM_miniAOD ( const edm::ParameterSet cfg)

default constructor

Definition at line 701 of file TopSingleLeptonDQM_miniAOD.cc.

References beamspot_, beamspot__, beamspotSelect_, edm::EDConsumerBase::consumesCollector(), ElectronStep, edm::ParameterSet::existsAs(), dqmdumpme::first, edm::ParameterSet::getParameter(), mps_fire::i, JetSteps, crabWrapper::key, METStep, MuonStep, objectType(), PvStep, sel_, selection_, selectionOrder_, selectionStep(), setup_, AlCaHLTBitMon_QueryRunRegistry::string, triggerPaths_, and triggerTable__.

702  : vertexSelect_(nullptr),
703  beamspot_(""),
704  beamspotSelect_(nullptr),
705  MuonStep(nullptr),
706  ElectronStep(nullptr),
707  PvStep(nullptr),
708  METStep(nullptr) {
709  JetSteps.clear();
710 
711  // configure preselection
712  edm::ParameterSet presel = cfg.getParameter<edm::ParameterSet>("preselection");
713  if (presel.existsAs<edm::ParameterSet>("trigger")) {
715  triggerTable__ = consumes<edm::TriggerResults>(trigger.getParameter<edm::InputTag>("src"));
716  triggerPaths_ = trigger.getParameter<std::vector<std::string>>("select");
717  }
718  if (presel.existsAs<edm::ParameterSet>("beamspot")) {
720  beamspot_ = beamspot.getParameter<edm::InputTag>("src");
721  beamspot__ = consumes<reco::BeamSpot>(beamspot.getParameter<edm::InputTag>("src"));
723  }
724 
725  // conifgure the selection
726  sel_ = cfg.getParameter<std::vector<edm::ParameterSet>>("selection");
727  setup_ = cfg.getParameter<edm::ParameterSet>("setup");
728  for (unsigned int i = 0; i < sel_.size(); ++i) {
729  selectionOrder_.push_back(sel_.at(i).getParameter<std::string>("label"));
730  selection_[selectionStep(selectionOrder_.back())] = std::make_pair(
731  sel_.at(i),
732  std::unique_ptr<TopSingleLepton_miniAOD::MonitorEnsemble>(new TopSingleLepton_miniAOD::MonitorEnsemble(
733  selectionStep(selectionOrder_.back()).c_str(), setup_, consumesCollector())));
734  }
735  for (std::vector<std::string>::const_iterator selIt = selectionOrder_.begin(); selIt != selectionOrder_.end();
736  ++selIt) {
737  std::string key = selectionStep(*selIt), type = objectType(*selIt);
738  if (selection_.find(key) != selection_.end()) {
739  if (type == "muons") {
741  }
742  if (type == "elecs") {
744  }
745  if (type == "pvs") {
747  }
748  if (type == "jets") {
749  JetSteps.push_back(std::unique_ptr<SelectionStep<pat::Jet>>(
751  }
752 
753  if (type == "met") {
755  }
756  }
757  }
758 }
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > vertexSelect_
string cut selector
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
std::string objectType(const std::string &label)
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< TopSingleLepton_miniAOD::MonitorEnsemble > > > selection_
std::vector< edm::ParameterSet > sel_
std::vector< std::string > selectionOrder_
edm::EDGetTokenT< reco::BeamSpot > beamspot__
std::string selectionStep(const std::string &label)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< std::string > triggerPaths_
trigger paths
std::unique_ptr< SelectionStep< pat::MET > > METStep
std::vector< std::unique_ptr< SelectionStep< pat::Jet > > > JetSteps
std::unique_ptr< SelectionStep< pat::Muon > > MuonStep
Templated helper class to allow a selection on a certain object collection.
std::unique_ptr< SelectionStep< pat::Electron > > ElectronStep
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
TopSingleLeptonDQM_miniAOD::~TopSingleLeptonDQM_miniAOD ( )
inlineoverride

default destructor

Definition at line 192 of file TopSingleLeptonDQM_miniAOD.h.

References analyze(), bookHistograms(), and singleTopDQM_cfi::setup.

192 {};

Member Function Documentation

void TopSingleLeptonDQM_miniAOD::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
override

do this during the event loop

Definition at line 764 of file TopSingleLeptonDQM_miniAOD.cc.

References accept(), HLTObjectsMonitor_cfi::beamspot, beamspot__, beamspotSelect_, ElectronStep, edm::Event::getByToken(), edm::EDGetTokenT< T >::isUninitialized(), JetSteps, crabWrapper::key, METStep, MuonStep, objectType(), TriggerAnalyzer::passed, PvStep, singleTopDQM_cfi::select, selection_, selectionOrder_, selectionStep(), AlCaHLTBitMon_QueryRunRegistry::string, triggerPaths_, and triggerTable__.

764  {
767  if (!event.getByToken(triggerTable__, triggerTable))
768  return;
769  if (!accept(event, *triggerTable, triggerPaths_))
770  return;
771  }
772  if (!beamspot__.isUninitialized()) {
774  if (!event.getByToken(beamspot__, beamspot))
775  return;
776  if (!(*beamspotSelect_)(*beamspot))
777  return;
778  }
779 
780  unsigned int passed = 0;
781  unsigned int nJetSteps = -1;
782 
783  for (std::vector<std::string>::const_iterator selIt = selectionOrder_.begin(); selIt != selectionOrder_.end();
784  ++selIt) {
785  std::string key = selectionStep(*selIt), type = objectType(*selIt);
786  if (selection_.find(key) != selection_.end()) {
787  if (type == "empty") {
788  selection_[key].second->fill(event, setup);
789  }
790  if (type == "muons" && MuonStep != nullptr) {
791  if (MuonStep->select(event)) {
792  ++passed;
793 
794  selection_[key].second->fill(event, setup);
795  } else
796  break;
797  }
798 
799  if (type == "elecs" && ElectronStep != nullptr) {
800  if (ElectronStep->select(event)) {
801  ++passed;
802  selection_[key].second->fill(event, setup);
803  } else
804  break;
805  }
806 
807  if (type == "pvs" && PvStep != nullptr) {
808  if (PvStep->selectVertex(event)) {
809  ++passed;
810  selection_[key].second->fill(event, setup);
811  } else
812  break;
813  }
814 
815  if (type == "jets") {
816  nJetSteps++;
817  if (JetSteps[nJetSteps] != nullptr) {
818  if (JetSteps[nJetSteps]->select(event, setup)) {
819  ++passed;
820  selection_[key].second->fill(event, setup);
821  } else
822  break;
823  }
824  }
825 
826  if (type == "met" && METStep != nullptr) {
827  if (METStep->select(event)) {
828  ++passed;
829  selection_[key].second->fill(event, setup);
830  } else
831  break;
832  }
833  }
834  }
835 }
type
Definition: HCALResponse.h:21
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
std::string objectType(const std::string &label)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< TopSingleLepton_miniAOD::MonitorEnsemble > > > selection_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
std::vector< std::string > selectionOrder_
edm::EDGetTokenT< reco::BeamSpot > beamspot__
std::string selectionStep(const std::string &label)
std::vector< std::string > triggerPaths_
trigger paths
std::unique_ptr< SelectionStep< pat::MET > > METStep
std::vector< std::unique_ptr< SelectionStep< pat::Jet > > > JetSteps
std::unique_ptr< SelectionStep< pat::Muon > > MuonStep
select
when omitted electron plots will be filled w/o cut on electronId electronId = cms.PSet( src = cms.InputTag("mvaTrigV0"), cutValue = cms.double(0.5) ), when omitted electron plots will be filled w/o additional pre- selection of the electron candidates
bool isUninitialized() const
Definition: EDGetToken.h:70
std::unique_ptr< SelectionStep< pat::Electron > > ElectronStep
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
void TopSingleLeptonDQM_miniAOD::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 759 of file TopSingleLeptonDQM_miniAOD.cc.

References selection_.

759  {
760  for (auto selIt = selection_.begin(); selIt != selection_.end(); ++selIt) {
761  selIt->second.second->book(ibooker);
762  }
763 }
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< TopSingleLepton_miniAOD::MonitorEnsemble > > > selection_
std::string TopSingleLeptonDQM_miniAOD::objectType ( const std::string &  label)
inlineprivate

deduce object type from ParameterSet label, the label is expected to be of type 'objectType:selectionStep'

Definition at line 204 of file TopSingleLeptonDQM_miniAOD.h.

Referenced by analyze(), and TopSingleLeptonDQM_miniAOD().

204 { return label.substr(0, label.find(':')); };
char const * label
std::string TopSingleLeptonDQM_miniAOD::selectionStep ( const std::string &  label)
inlineprivate

deduce selection step from ParameterSet label, the label is expected to be of type 'objectType:selectionStep'

Definition at line 207 of file TopSingleLeptonDQM_miniAOD.h.

Referenced by analyze(), and TopSingleLeptonDQM_miniAOD().

207 { return label.substr(label.find(':') + 1); };
char const * label

Member Data Documentation

edm::InputTag TopSingleLeptonDQM_miniAOD::beamspot_
private

beamspot

Definition at line 218 of file TopSingleLeptonDQM_miniAOD.h.

Referenced by TopSingleLeptonDQM_miniAOD().

edm::EDGetTokenT<reco::BeamSpot> TopSingleLeptonDQM_miniAOD::beamspot__
private

Definition at line 219 of file TopSingleLeptonDQM_miniAOD.h.

Referenced by analyze(), and TopSingleLeptonDQM_miniAOD().

std::unique_ptr<StringCutObjectSelector<reco::BeamSpot> > TopSingleLeptonDQM_miniAOD::beamspotSelect_
private

string cut selector

Definition at line 221 of file TopSingleLeptonDQM_miniAOD.h.

Referenced by analyze(), and TopSingleLeptonDQM_miniAOD().

std::unique_ptr<SelectionStep<pat::Electron> > TopSingleLeptonDQM_miniAOD::ElectronStep
private

Definition at line 234 of file TopSingleLeptonDQM_miniAOD.h.

Referenced by analyze(), and TopSingleLeptonDQM_miniAOD().

std::vector<std::unique_ptr<SelectionStep<pat::Jet> > > TopSingleLeptonDQM_miniAOD::JetSteps
private

Definition at line 237 of file TopSingleLeptonDQM_miniAOD.h.

Referenced by analyze(), and TopSingleLeptonDQM_miniAOD().

std::unique_ptr<SelectionStep<pat::MET> > TopSingleLeptonDQM_miniAOD::METStep
private

Definition at line 236 of file TopSingleLeptonDQM_miniAOD.h.

Referenced by analyze(), and TopSingleLeptonDQM_miniAOD().

std::unique_ptr<SelectionStep<pat::Muon> > TopSingleLeptonDQM_miniAOD::MuonStep
private

Definition at line 233 of file TopSingleLeptonDQM_miniAOD.h.

Referenced by analyze(), and TopSingleLeptonDQM_miniAOD().

std::unique_ptr<SelectionStep<reco::Vertex> > TopSingleLeptonDQM_miniAOD::PvStep
private

Definition at line 235 of file TopSingleLeptonDQM_miniAOD.h.

Referenced by analyze(), and TopSingleLeptonDQM_miniAOD().

std::vector<edm::ParameterSet> TopSingleLeptonDQM_miniAOD::sel_
private

Definition at line 239 of file TopSingleLeptonDQM_miniAOD.h.

Referenced by TopSingleLeptonDQM_miniAOD().

std::map<std::string, std::pair<edm::ParameterSet, std::unique_ptr<TopSingleLepton_miniAOD::MonitorEnsemble> > > TopSingleLeptonDQM_miniAOD::selection_
private

this is the heart component of the plugin; std::string keeps a label the selection step for later identification, edm::ParameterSet keeps the configuration of the selection for the SelectionStep class, MonitoringEnsemble keeps an instance of the MonitorEnsemble class to be filled after each selection step

Definition at line 232 of file TopSingleLeptonDQM_miniAOD.h.

Referenced by analyze(), bookHistograms(), and TopSingleLeptonDQM_miniAOD().

std::vector<std::string> TopSingleLeptonDQM_miniAOD::selectionOrder_
private

needed to guarantee the selection order as defined by the order of ParameterSets in the selection vector as defined in the config

Definition at line 225 of file TopSingleLeptonDQM_miniAOD.h.

Referenced by analyze(), and TopSingleLeptonDQM_miniAOD().

edm::ParameterSet TopSingleLeptonDQM_miniAOD::setup_
private
std::vector<std::string> TopSingleLeptonDQM_miniAOD::triggerPaths_
private

trigger paths

Definition at line 213 of file TopSingleLeptonDQM_miniAOD.h.

Referenced by analyze(), and TopSingleLeptonDQM_miniAOD().

edm::EDGetTokenT<edm::TriggerResults> TopSingleLeptonDQM_miniAOD::triggerTable__
private

trigger table

Definition at line 207 of file TopSingleLeptonDQM_miniAOD.h.

Referenced by analyze(), and TopSingleLeptonDQM_miniAOD().

std::unique_ptr<StringCutObjectSelector<reco::Vertex> > TopSingleLeptonDQM_miniAOD::vertexSelect_
private

string cut selector

Definition at line 215 of file TopSingleLeptonDQM_miniAOD.h.