test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &event, const edm::EventSetup &setup)
 do this during the event loop More...
 
 SingleTopTChannelLeptonDQM_miniAOD (const edm::ParameterSet &cfg)
 default constructor More...
 
 ~SingleTopTChannelLeptonDQM_miniAOD ()
 default destructor More...
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- 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 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_
 
std::vector< std::string > triggerPaths_
 trigger paths More...
 
edm::EDGetTokenT
< edm::TriggerResults
triggerTable__
 trigger table More...
 
edm::InputTag vertex_
 primary vertex More...
 
edm::EDGetTokenT< reco::Vertexvertex__
 
std::unique_ptr
< StringCutObjectSelector
< reco::Vertex > > 
vertexSelect_
 string cut selector More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 228 of file SingleTopTChannelLeptonDQM_miniAOD.h.

Constructor & Destructor Documentation

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

default constructor

Definition at line 761 of file SingleTopTChannelLeptonDQM_miniAOD.cc.

References HLT_25ns10e33_v2_cff::beamspot, beamspot_, beamspot__, beamspotSelect_, edm::EDConsumerBase::consumesCollector(), electronStep_, edm::ParameterSet::existsAs(), plotBeamSpotDB::first, edm::ParameterSet::getParameter(), i, jetSteps_, relval_steps::key, metStep_, muonStep_, objectType(), pvStep_, sel, selection_, selectionOrder_, selectionStep(), AlCaHLTBitMon_QueryRunRegistry::string, triggerPaths_, triggerTable__, vertex_, vertex__, and vertexSelect_.

763  : vertexSelect_(nullptr),
764  beamspot_(""),
765  beamspotSelect_(nullptr),
766  muonStep_(nullptr),
767  electronStep_(nullptr),
768  pvStep_(nullptr),
769  metStep_(nullptr) {
770  jetSteps_.clear();
771 
772 
773  // configure preselection
774  edm::ParameterSet presel =
775  cfg.getParameter<edm::ParameterSet>("preselection");
776  if (presel.existsAs<edm::ParameterSet>("trigger")) {
777  edm::ParameterSet trigger =
778  presel.getParameter<edm::ParameterSet>("trigger");
779  triggerTable__ = consumes<edm::TriggerResults>(
780  trigger.getParameter<edm::InputTag>("src"));
781  triggerPaths_ = trigger.getParameter<std::vector<std::string>>("select");
782  }
783  if (presel.existsAs<edm::ParameterSet>("vertex")) {
784  edm::ParameterSet vertex = presel.getParameter<edm::ParameterSet>("vertex");
785  vertex_ = vertex.getParameter<edm::InputTag>("src");
786  vertex__ =
787  consumes<reco::Vertex>(vertex.getParameter<edm::InputTag>("src"));
789  vertex.getParameter<std::string>("select")));
790  }
791  if (presel.existsAs<edm::ParameterSet>("beamspot")) {
793  presel.getParameter<edm::ParameterSet>("beamspot");
794  beamspot_ = beamspot.getParameter<edm::InputTag>("src");
795  beamspot__ =
796  consumes<reco::BeamSpot>(beamspot.getParameter<edm::InputTag>("src"));
798  beamspot.getParameter<std::string>("select")));
799  }
800  // conifgure the selection
801  std::vector<edm::ParameterSet> sel =
802  cfg.getParameter<std::vector<edm::ParameterSet>>("selection");
803 
804  for (unsigned int i = 0; i < sel.size(); ++i) {
805  selectionOrder_.push_back(sel.at(i).getParameter<std::string>("label"));
806  selection_[selectionStep(selectionOrder_.back())] = std::make_pair(
807  sel.at(i),
808  std::unique_ptr<SingleTopTChannelLepton_miniAOD::MonitorEnsemble>(
810  selectionStep(selectionOrder_.back()).c_str(),
811  cfg.getParameter<edm::ParameterSet>("setup"),
812  cfg.getParameter<std::vector<edm::ParameterSet>>("selection"),
813  consumesCollector())));
814  }
815  for (std::vector<std::string>::const_iterator selIt = selectionOrder_.begin();
816  selIt != selectionOrder_.end(); ++selIt) {
817  std::string key = selectionStep(*selIt), type = objectType(*selIt);
818  if (selection_.find(key) != selection_.end()) {
819  using std::unique_ptr;
820 
821  if (type == "muons") {
823  consumesCollector()));
824  }
825  if (type == "elecs") {
827  selection_[key].first, consumesCollector()));
828  }
829 
830  if (type == "pvs") {
831  pvStep_.reset(new SelectionStep<reco::Vertex>(selection_[key].first,
832  consumesCollector()));
833  }
834  if (type == "jets") {
835  jetSteps_.push_back(std::unique_ptr<SelectionStep<pat::Jet>>(
836  new SelectionStep<pat::Jet>(selection_[key].first,
837  consumesCollector())));
838  }
839  if (type == "met") {
840  metStep_.reset(new SelectionStep<pat::MET>(selection_[key].first,
841  consumesCollector()));
842  }
843  }
844  }
845 }
type
Definition: HCALResponse.h:21
std::unique_ptr< SelectionStep< pat::Electron > > electronStep_
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< SingleTopTChannelLepton_miniAOD::MonitorEnsemble > > > selection_
std::string selectionStep(const std::string &label)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::unique_ptr< SelectionStep< pat::MET > > metStep_
std::string objectType(const std::string &label)
std::unique_ptr< SelectionStep< pat::Muon > > muonStep_
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
std::vector< std::unique_ptr< SelectionStep< pat::Jet > > > jetSteps_
std::vector< std::string > triggerPaths_
trigger paths
Templated helper class to allow a selection on a certain object collection.
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< reco::Vertex > > pvStep_
SingleTopTChannelLeptonDQM_miniAOD::~SingleTopTChannelLeptonDQM_miniAOD ( )
inline

default destructor

Definition at line 233 of file SingleTopTChannelLeptonDQM_miniAOD.h.

233 {};

Member Function Documentation

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

do this during the event loop

Implements edm::stream::EDAnalyzerBase.

Definition at line 853 of file SingleTopTChannelLeptonDQM_miniAOD.cc.

References accept(), HLT_25ns10e33_v2_cff::beamspot, beamspot__, beamspotSelect_, electronStep_, edm::Event::getByToken(), edm::EDGetTokenT< T >::isUninitialized(), jetSteps_, relval_steps::key, metStep_, muonStep_, objectType(), MetAnalyzer::pv(), benchmark_cfg::select, selection_, selectionOrder_, selectionStep(), AlCaHLTBitMon_QueryRunRegistry::string, triggerPaths_, triggerTable__, vertex__, and vertexSelect_.

854  {
857  if (!event.getByToken(triggerTable__, triggerTable)) return;
858  if (!accept(event, *triggerTable, triggerPaths_)) return;
859  }
860  if (!beamspot__.isUninitialized()) {
862  if (!event.getByToken(beamspot__, beamspot)) return;
863  if (!(*beamspotSelect_)(*beamspot)) return;
864  }
865 
866  if (!vertex__.isUninitialized()) {
868  if (!event.getByToken(vertex__, vertex)) return;
870  if (!(*vertexSelect_)(*pv)) return;
871  }
872 
873  // apply selection steps
874  unsigned int passed = 0;
875  unsigned int nJetSteps = -1;
876 
877  for (std::vector<std::string>::const_iterator selIt = selectionOrder_.begin();
878  selIt != selectionOrder_.end(); ++selIt) {
879  std::string key = selectionStep(*selIt), type = objectType(*selIt);
880  if (selection_.find(key) != selection_.end()) {
881  if (type == "empty") {
882  selection_[key].second->fill(event, setup);
883  }
884  if (type == "presel") {
885  selection_[key].second->fill(event, setup);
886  }
887  if (type == "elecs" && electronStep_ != 0) {
888  if (electronStep_->select(event)) {
889  ++passed;
890  selection_[key].second->fill(event, setup);
891  } else
892  break;
893  }
894  if (type == "muons" && muonStep_ != 0) {
895  if (muonStep_->select(event)) {
896  ++passed;
897  selection_[key].second->fill(event, setup);
898  } else
899  break;
900  }
901  if (type == "jets") {
902  nJetSteps++;
903  if (jetSteps_[nJetSteps]) {
904  if (jetSteps_[nJetSteps]->select(event, setup)) {
905  ++passed;
906  selection_[key].second->fill(event, setup);
907  } else
908  break;
909  }
910  }
911  if (type == "met" && metStep_ != 0) {
912  if (metStep_->select(event)) {
913  ++passed;
914  selection_[key].second->fill(event, setup);
915  } else
916  break;
917  }
918  }
919  }
920 }
type
Definition: HCALResponse.h:21
std::unique_ptr< SelectionStep< pat::Electron > > electronStep_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< SingleTopTChannelLepton_miniAOD::MonitorEnsemble > > > selection_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
std::string selectionStep(const std::string &label)
std::unique_ptr< SelectionStep< pat::MET > > metStep_
std::string objectType(const std::string &label)
std::unique_ptr< SelectionStep< pat::Muon > > muonStep_
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
std::vector< std::unique_ptr< SelectionStep< pat::Jet > > > jetSteps_
std::vector< std::string > triggerPaths_
trigger paths
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > vertexSelect_
string cut selector
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
bool isUninitialized() const
Definition: EDGetToken.h:73
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
void SingleTopTChannelLeptonDQM_miniAOD::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 846 of file SingleTopTChannelLeptonDQM_miniAOD.cc.

References selection_.

847  {
848 
849  for (auto selIt = selection_.begin(); selIt != selection_.end(); ++selIt) {
850  selIt->second.second->book(ibooker);
851  }
852 }
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 246 of file SingleTopTChannelLeptonDQM_miniAOD.h.

Referenced by analyze(), and SingleTopTChannelLeptonDQM_miniAOD().

246  {
247  return label.substr(0, label.find(':'));
248  };
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 251 of file SingleTopTChannelLeptonDQM_miniAOD.h.

Referenced by analyze(), and SingleTopTChannelLeptonDQM_miniAOD().

251  {
252  return label.substr(label.find(':') + 1);
253  };

Member Data Documentation

edm::InputTag SingleTopTChannelLeptonDQM_miniAOD::beamspot_
private

beamspot

Definition at line 268 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 271 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
std::vector<std::string> SingleTopTChannelLeptonDQM_miniAOD::selectionOrder_
private
std::vector<std::string> SingleTopTChannelLeptonDQM_miniAOD::triggerPaths_
private

trigger paths

Definition at line 260 of file SingleTopTChannelLeptonDQM_miniAOD.h.

Referenced by analyze(), and SingleTopTChannelLeptonDQM_miniAOD().

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

trigger table

Definition at line 253 of file SingleTopTChannelLeptonDQM_miniAOD.h.

Referenced by analyze(), and SingleTopTChannelLeptonDQM_miniAOD().

edm::InputTag SingleTopTChannelLeptonDQM_miniAOD::vertex_
private

primary vertex

Definition at line 262 of file SingleTopTChannelLeptonDQM_miniAOD.h.

Referenced by SingleTopTChannelLeptonDQM_miniAOD().

edm::EDGetTokenT<reco::Vertex> SingleTopTChannelLeptonDQM_miniAOD::vertex__
private
std::unique_ptr<StringCutObjectSelector<reco::Vertex> > SingleTopTChannelLeptonDQM_miniAOD::vertexSelect_
private

string cut selector

Definition at line 265 of file SingleTopTChannelLeptonDQM_miniAOD.h.

Referenced by analyze(), and SingleTopTChannelLeptonDQM_miniAOD().