Templated helper class to allow a selection on a certain object collection. More...
#include <TopDQMHelpers.h>
Public Member Functions | |
bool | select (const edm::Event &event) |
apply selection More... | |
bool | select (const edm::Event &event, const std::string &type) |
apply selection with special treatment for PFCandidates More... | |
bool | select (const edm::Event &event, const edm::EventSetup &setup) |
apply selection override for jets More... | |
SelectionStep (const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC) | |
default constructor More... | |
bool | selectVertex (const edm::Event &event) |
~SelectionStep () | |
default destructor More... | |
Private Attributes | |
edm::EDGetTokenT< reco::JetTagCollection > | btagLabel_ |
choice for b-tag as extra selection type More... | |
double | btagWorkingPoint_ |
choice of b-tag working point as extra selection type More... | |
double | eidCutValue_ |
edm::EDGetTokenT< edm::ValueMap< float > > | electronId_ |
electronId label as extra selection type More... | |
edm::EDGetTokenT< edm::View< reco::GsfElectron > > | gsfEs_ |
std::string | jetCorrector_ |
jet corrector as extra selection type More... | |
edm::EDGetTokenT< reco::JetIDValueMap > | jetIDLabel_ |
jetID as an extra selection type More... | |
StringCutObjectSelector< reco::JetID > * | jetIDSelect_ |
selection string on the jetID More... | |
int | max_ |
int | min_ |
min/max for object multiplicity More... | |
edm::EDGetTokenT< edm::View< reco::Vertex > > | pvs_ |
StringCutObjectSelector< Object > | select_ |
string cut selector More... | |
edm::EDGetTokenT< edm::View< Object > > | src_ |
input collection More... | |
Templated helper class to allow a selection on a certain object collection.
"DQM/Physics/interface/TopDQMHelpers.h"
Templated helper class to allow a selection on a certain object collection, which may be monitored by a separate class afterwards. The class wraps and slightly extends the features of the StringCutParser to allow also to apply event based selections, according to a minimal or maximal number of elements in the collection after the object selection has been applied. It takes an edm::ParameterSet in the constructor, which should contain the following elements:
The parameters src and select are mandatory. The parameters min and max are optional. The parameters electronId and jetCorrector are optional. They are added to keep the possibility to apply selections on id'ed electrons or on corrected jets. They may be omitted in the PSet for simplification reasons if not needed at any time. They are not effiective for other object collections but electrons or jets. If none of the two parameters min or max is found in the event the select function returns true if at least one object fullfilled the requirements.
The class has one template value, which is the object collection to apply the selection on. This has to be parsed to the StringCutParser class. The function select is overrided for jets to circumvent problems with the template specialisation. Note that for MET not type1 or muon corrections are supported on reco candidates.
Templated helper class to allow a selection on a certain object collection, which may be monitored by a separate class afterwards. The class wraps and slightly extends the features of the StringCutParser to allow also to apply event based selections, according to a minimal or maximal number of elements in the collection after the object selection has been applied. It takes an edm::ParameterSet in the constructor, which should contain the following elements:
The parameters src and select are mandatory. The parameters min and max are optional. The parameters electronId and jetCorrector are optional. They are added to keep the possibility to apply selections on id'ed electrons or on corrected jets. They may be omitted in the PSet for simplification reasons if not needed at any time. They are not effiective for other object collections but electrons or jets. If none of the two parameters min or max is found in the event the select function returns true if at least one object fullfilled the requirements.
The class has one template value, which is the object collection to apply the selection on. This has to be parsed to the StringCutParser class. The function select is overrided for jets to circumvent problems with the template specialisation. Note that for MET not type1 or muon corrections are supported on reco candidates.
Definition at line 253 of file TopDQMHelpers.h.
SelectionStep< Object >::SelectionStep | ( | const edm::ParameterSet & | cfg, |
edm::ConsumesCollector && | iC | ||
) |
default constructor
Definition at line 305 of file TopDQMHelpers.h.
References SelectionStep< Object >::btagLabel_, SelectionStep< Object >::btagWorkingPoint_, SelectionStep< Object >::eidCutValue_, SelectionStep< Object >::electronId_, edm::ParameterSet::exists(), edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), SelectionStep< Object >::gsfEs_, SelectionStep< Object >::jetCorrector_, SelectionStep< Object >::jetIDLabel_, SelectionStep< Object >::jetIDSelect_, SelectionStep< Object >::max_, SelectionStep< Object >::min_, SelectionStep< Object >::src_, and AlCaHLTBitMon_QueryRunRegistry::string.
|
inline |
default destructor
Definition at line 258 of file TopDQMHelpers.h.
References TauGenJetsDecayModeSelectorAllHadrons_cfi::select, GeneralSetup::setup(), and AlCaHLTBitMon_QueryRunRegistry::string.
bool SelectionStep< Object >::select | ( | const edm::Event & | event | ) |
apply selection
Definition at line 345 of file TopDQMHelpers.h.
References accept(), SelectionStep< Object >::eidCutValue_, SelectionStep< Object >::electronId_, edm::Event::getByToken(), training_settings::idx, edm::EDGetTokenT< T >::isUninitialized(), SelectionStep< Object >::max_, SelectionStep< Object >::min_, gen::n, MuonAssociatorByHits_cfi::obj, SelectionStep< Object >::select_, TrackRefitter_38T_cff::src, and SelectionStep< Object >::src_.
Referenced by Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), and Vispa.Views.AbstractView.AbstractView::restoreSelection().
bool SelectionStep< Object >::select | ( | const edm::Event & | event, |
const std::string & | type | ||
) |
apply selection with special treatment for PFCandidates
Definition at line 382 of file TopDQMHelpers.h.
References accept(), SelectionStep< Object >::eidCutValue_, SelectionStep< Object >::electronId_, edm::Event::getByToken(), reco::PFCandidate::gsfElectronRef(), training_settings::idx, edm::Ref< C, T, F >::isNonnull(), edm::EDGetTokenT< T >::isUninitialized(), SelectionStep< Object >::max_, SelectionStep< Object >::min_, reco::PFCandidate::muonRef(), gen::n, MuonAssociatorByHits_cfi::obj, SelectionStep< Object >::select_, TrackRefitter_38T_cff::src, and SelectionStep< Object >::src_.
Referenced by Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), and Vispa.Views.AbstractView.AbstractView::restoreSelection().
bool SelectionStep< Object >::select | ( | const edm::Event & | event, |
const edm::EventSetup & | setup | ||
) |
apply selection override for jets
apply selection (w/o using the template class Object), override for jets
Definition at line 469 of file TopDQMHelpers.h.
References accept(), SelectionStep< Object >::btagLabel_, SelectionStep< Object >::btagWorkingPoint_, JetCorrector::correction(), mitigatedMETSequence_cff::corrector, edm::EventSetup::find(), edm::Event::getByToken(), JetCorrector::getJetCorrector(), training_settings::idx, edm::EDGetTokenT< T >::isUninitialized(), metsig::jet, SelectionStep< Object >::jetCorrector_, SelectionStep< Object >::jetIDLabel_, SelectionStep< Object >::jetIDSelect_, edm::eventsetup::EventSetupRecordKey::makeKey(), SelectionStep< Object >::max_, SelectionStep< Object >::min_, gen::n, MuonAssociatorByHits_cfi::obj, SelectionStep< Object >::pvs_, SelectionStep< Object >::select_, TrackRefitter_38T_cff::src, and SelectionStep< Object >::src_.
Referenced by Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), and Vispa.Views.AbstractView.AbstractView::restoreSelection().
bool SelectionStep< Object >::selectVertex | ( | const edm::Event & | event | ) |
Definition at line 444 of file TopDQMHelpers.h.
References accept(), SelectionStep< Object >::electronId_, edm::Event::getByToken(), edm::EDGetTokenT< T >::isUninitialized(), SelectionStep< Object >::max_, SelectionStep< Object >::min_, gen::n, MuonAssociatorByHits_cfi::obj, SelectionStep< Object >::select_, TrackRefitter_38T_cff::src, and SelectionStep< Object >::src_.
|
private |
choice for b-tag as extra selection type
Definition at line 289 of file TopDQMHelpers.h.
Referenced by SelectionStep< Object >::select(), and SelectionStep< Object >::SelectionStep().
|
private |
choice of b-tag working point as extra selection type
Definition at line 291 of file TopDQMHelpers.h.
Referenced by SelectionStep< Object >::select(), and SelectionStep< Object >::SelectionStep().
|
private |
electronId pattern we expect the following pattern: 0: fails 1: passes electron ID only 2: passes electron Isolation only 3: passes electron ID and Isolation only 4: passes conversion rejection 5: passes conversion rejection and ID 6: passes conversion rejection and Isolation 7: passes the whole selection As described on https://twiki.cern.ch/twiki/bin/view/CMS/SimpleCutBasedEleID
Definition at line 285 of file TopDQMHelpers.h.
Referenced by SelectionStep< Object >::select(), and SelectionStep< Object >::SelectionStep().
|
private |
electronId label as extra selection type
Definition at line 273 of file TopDQMHelpers.h.
Referenced by SelectionStep< Object >::select(), SelectionStep< Object >::SelectionStep(), and SelectionStep< Object >::selectVertex().
|
private |
Definition at line 296 of file TopDQMHelpers.h.
Referenced by SelectionStep< Object >::SelectionStep().
|
private |
jet corrector as extra selection type
Definition at line 287 of file TopDQMHelpers.h.
Referenced by SelectionStep< Object >::select(), and SelectionStep< Object >::SelectionStep().
|
private |
jetID as an extra selection type
Definition at line 293 of file TopDQMHelpers.h.
Referenced by SelectionStep< Object >::select(), and SelectionStep< Object >::SelectionStep().
|
private |
selection string on the jetID
Definition at line 300 of file TopDQMHelpers.h.
Referenced by SelectionStep< Object >::select(), and SelectionStep< Object >::SelectionStep().
|
private |
Definition at line 271 of file TopDQMHelpers.h.
Referenced by SelectionStep< Object >::select(), SelectionStep< Object >::SelectionStep(), and SelectionStep< Object >::selectVertex().
|
private |
min/max for object multiplicity
Definition at line 271 of file TopDQMHelpers.h.
Referenced by SelectionStep< Object >::select(), SelectionStep< Object >::SelectionStep(), and SelectionStep< Object >::selectVertex().
|
private |
Definition at line 295 of file TopDQMHelpers.h.
Referenced by SelectionStep< Object >::select().
|
private |
string cut selector
Definition at line 298 of file TopDQMHelpers.h.
Referenced by SelectionStep< Object >::select(), and SelectionStep< Object >::selectVertex().
|
private |
input collection
Definition at line 269 of file TopDQMHelpers.h.
Referenced by SelectionStep< Object >::select(), SelectionStep< Object >::SelectionStep(), and SelectionStep< Object >::selectVertex().