CMS 3D CMS Logo

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

#include <SingleTopTChannelLeptonDQM_miniAOD.h>

Inheritance diagram for SingleTopTChannelLeptonDQM_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...
 
 SingleTopTChannelLeptonDQM_miniAOD (const edm::ParameterSet &cfg)
 default constructor More...
 
 ~SingleTopTChannelLeptonDQM_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< SingleTopTChannelLepton_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 SingleTopTChannelLeptonDQM_miniAOD.h.

Constructor & Destructor Documentation

SingleTopTChannelLeptonDQM_miniAOD::SingleTopTChannelLeptonDQM_miniAOD ( const edm::ParameterSet cfg)

default constructor

Definition at line 741 of file SingleTopTChannelLeptonDQM_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__.

742  : vertexSelect_(nullptr),
743  beamspot_(""),
744  beamspotSelect_(nullptr),
745  MuonStep(nullptr),
746  ElectronStep(nullptr),
747  PvStep(nullptr),
748  METStep(nullptr) {
749  JetSteps.clear();
750 
751  // configure preselection
752  edm::ParameterSet presel = cfg.getParameter<edm::ParameterSet>("preselection");
753  if (presel.existsAs<edm::ParameterSet>("trigger")) {
755  triggerTable__ = consumes<edm::TriggerResults>(trigger.getParameter<edm::InputTag>("src"));
756  triggerPaths_ = trigger.getParameter<std::vector<std::string>>("select");
757  }
758  if (presel.existsAs<edm::ParameterSet>("beamspot")) {
760  beamspot_ = beamspot.getParameter<edm::InputTag>("src");
761  beamspot__ = consumes<reco::BeamSpot>(beamspot.getParameter<edm::InputTag>("src"));
763  }
764 
765  // conifgure the selection
766  sel_ = cfg.getParameter<std::vector<edm::ParameterSet>>("selection");
767  setup_ = cfg.getParameter<edm::ParameterSet>("setup");
768  for (unsigned int i = 0; i < sel_.size(); ++i) {
769  selectionOrder_.push_back(sel_.at(i).getParameter<std::string>("label"));
771  std::make_pair(sel_.at(i),
772  std::unique_ptr<SingleTopTChannelLepton_miniAOD::MonitorEnsemble>(
774  selectionStep(selectionOrder_.back()).c_str(), setup_, consumesCollector())));
775  }
776  for (std::vector<std::string>::const_iterator selIt = selectionOrder_.begin(); selIt != selectionOrder_.end();
777  ++selIt) {
778  std::string key = selectionStep(*selIt), type = objectType(*selIt);
779  if (selection_.find(key) != selection_.end()) {
780  if (type == "muons") {
782  }
783  if (type == "elecs") {
785  }
786  if (type == "pvs") {
788  }
789  if (type == "jets") {
790  JetSteps.push_back(std::unique_ptr<SelectionStep<pat::Jet>>(
792  }
793 
794  if (type == "met") {
796  }
797  }
798  }
799 }
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
std::vector< std::unique_ptr< SelectionStep< pat::Jet > > > JetSteps
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< SingleTopTChannelLepton_miniAOD::MonitorEnsemble > > > selection_
std::unique_ptr< SelectionStep< pat::Muon > > MuonStep
std::string selectionStep(const std::string &label)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::string objectType(const std::string &label)
std::vector< std::string > triggerPaths_
trigger paths
Templated helper class to allow a selection on a certain object collection.
std::unique_ptr< SelectionStep< pat::MET > > METStep
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > vertexSelect_
string cut selector
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
std::unique_ptr< SelectionStep< pat::Electron > > ElectronStep
SingleTopTChannelLeptonDQM_miniAOD::~SingleTopTChannelLeptonDQM_miniAOD ( )
inlineoverride

default destructor

Definition at line 192 of file SingleTopTChannelLeptonDQM_miniAOD.h.

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

192 {};

Member Function Documentation

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

do this during the event loop

Definition at line 807 of file SingleTopTChannelLeptonDQM_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__.

807  {
810  if (!event.getByToken(triggerTable__, triggerTable))
811  return;
812  if (!accept(event, *triggerTable, triggerPaths_))
813  return;
814  }
815  if (!beamspot__.isUninitialized()) {
817  if (!event.getByToken(beamspot__, beamspot))
818  return;
819  if (!(*beamspotSelect_)(*beamspot))
820  return;
821  }
822 
823  unsigned int passed = 0;
824  unsigned int nJetSteps = -1;
825 
826  for (std::vector<std::string>::const_iterator selIt = selectionOrder_.begin(); selIt != selectionOrder_.end();
827  ++selIt) {
828  std::string key = selectionStep(*selIt), type = objectType(*selIt);
829  if (selection_.find(key) != selection_.end()) {
830  if (type == "empty") {
831  selection_[key].second->fill(event, setup);
832  }
833  if (type == "muons" && MuonStep != nullptr) {
834  if (MuonStep->select(event)) {
835  ++passed;
836 
837  selection_[key].second->fill(event, setup);
838  } else
839  break;
840  }
841 
842  if (type == "elecs" && ElectronStep != nullptr) {
843  if (ElectronStep->select(event)) {
844  ++passed;
845  selection_[key].second->fill(event, setup);
846  } else
847  break;
848  }
849 
850  if (type == "pvs" && PvStep != nullptr) {
851  if (PvStep->selectVertex(event)) {
852  ++passed;
853  selection_[key].second->fill(event, setup);
854  } else
855  break;
856  }
857 
858  if (type == "jets") {
859  nJetSteps++;
860  if (JetSteps[nJetSteps] != nullptr) {
861  if (JetSteps[nJetSteps]->select(event, setup)) {
862  ++passed;
863  selection_[key].second->fill(event, setup);
864  } else
865  break;
866  }
867  }
868 
869  if (type == "met" && METStep != nullptr) {
870  if (METStep->select(event)) {
871  ++passed;
872  selection_[key].second->fill(event, setup);
873  } else
874  break;
875  }
876  }
877  }
878 }
type
Definition: HCALResponse.h:21
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
std::vector< std::unique_ptr< SelectionStep< pat::Jet > > > JetSteps
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< SingleTopTChannelLepton_miniAOD::MonitorEnsemble > > > selection_
std::unique_ptr< SelectionStep< pat::Muon > > MuonStep
std::string selectionStep(const std::string &label)
std::string objectType(const std::string &label)
std::vector< std::string > triggerPaths_
trigger paths
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
std::unique_ptr< SelectionStep< pat::MET > > METStep
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
bool isUninitialized() const
Definition: EDGetToken.h:70
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
std::unique_ptr< SelectionStep< pat::Electron > > ElectronStep
void SingleTopTChannelLeptonDQM_miniAOD::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 800 of file SingleTopTChannelLeptonDQM_miniAOD.cc.

References selection_.

802  {
803  for (auto selIt = selection_.begin(); selIt != selection_.end(); ++selIt) {
804  selIt->second.second->book(ibooker);
805  }
806 }
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< SingleTopTChannelLepton_miniAOD::MonitorEnsemble > > > selection_
std::string SingleTopTChannelLeptonDQM_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 SingleTopTChannelLeptonDQM_miniAOD.h.

Referenced by analyze(), and SingleTopTChannelLeptonDQM_miniAOD().

204 { return label.substr(0, label.find(':')); };
char const * label
std::string SingleTopTChannelLeptonDQM_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 SingleTopTChannelLeptonDQM_miniAOD.h.

Referenced by analyze(), and SingleTopTChannelLeptonDQM_miniAOD().

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

Member Data Documentation

edm::InputTag SingleTopTChannelLeptonDQM_miniAOD::beamspot_
private

beamspot

Definition at line 218 of file SingleTopTChannelLeptonDQM_miniAOD.h.

Referenced by SingleTopTChannelLeptonDQM_miniAOD().

edm::EDGetTokenT<reco::BeamSpot> SingleTopTChannelLeptonDQM_miniAOD::beamspot__
private
std::unique_ptr<StringCutObjectSelector<reco::BeamSpot> > SingleTopTChannelLeptonDQM_miniAOD::beamspotSelect_
private

string cut selector

Definition at line 221 of file SingleTopTChannelLeptonDQM_miniAOD.h.

Referenced by analyze(), and SingleTopTChannelLeptonDQM_miniAOD().

std::unique_ptr<SelectionStep<pat::Electron> > SingleTopTChannelLeptonDQM_miniAOD::ElectronStep
private
std::vector<std::unique_ptr<SelectionStep<pat::Jet> > > SingleTopTChannelLeptonDQM_miniAOD::JetSteps
private
std::unique_ptr<SelectionStep<pat::MET> > SingleTopTChannelLeptonDQM_miniAOD::METStep
private
std::unique_ptr<SelectionStep<pat::Muon> > SingleTopTChannelLeptonDQM_miniAOD::MuonStep
private
std::unique_ptr<SelectionStep<reco::Vertex> > SingleTopTChannelLeptonDQM_miniAOD::PvStep
private
std::vector<edm::ParameterSet> SingleTopTChannelLeptonDQM_miniAOD::sel_
private
std::map<std::string, std::pair<edm::ParameterSet, std::unique_ptr<SingleTopTChannelLepton_miniAOD::MonitorEnsemble> > > SingleTopTChannelLeptonDQM_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 SingleTopTChannelLeptonDQM_miniAOD.h.

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

std::vector<std::string> SingleTopTChannelLeptonDQM_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 SingleTopTChannelLeptonDQM_miniAOD.h.

Referenced by analyze(), and SingleTopTChannelLeptonDQM_miniAOD().

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

trigger paths

Definition at line 213 of file SingleTopTChannelLeptonDQM_miniAOD.h.

Referenced by analyze(), and SingleTopTChannelLeptonDQM_miniAOD().

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

trigger table

Definition at line 207 of file SingleTopTChannelLeptonDQM_miniAOD.h.

Referenced by analyze(), and SingleTopTChannelLeptonDQM_miniAOD().

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

string cut selector

Definition at line 215 of file SingleTopTChannelLeptonDQM_miniAOD.h.