1 #ifndef PhysicsTools_PatUtils_interface_MuonVPlusJetsIDSelectionFunctor_h 2 #define PhysicsTools_PatUtils_interface_MuonVPlusJetsIDSelectionFunctor_h 40 if (versionStr ==
"SUMMER08") {
42 }
else if (versionStr ==
"FIRSTDATA") {
44 }
else if (versionStr ==
"SPRING10") {
46 }
else if (versionStr ==
"FALL10") {
49 std::cout <<
"\nMUON SELECTION - you are using FALL10 Selection" << std::endl;
50 }
else if (versionStr ==
"KITQCD") {
53 std::cout <<
"\nMUON SELECTION - you are using KITQCD Selection" << std::endl;
56 <<
"Expect version to be one of SUMMER08, FIRSTDATA, SPRING10, FALL10" << std::endl;
71 parameters.getParameter<
int>(
"nMatchedStations"));
87 int nValidMuonHits = 0,
88 double ecalveto = 4.0,
89 double hcalveto = 6.0,
118 int nValidMuonHits = 0,
119 double ecalveto = 4.0,
120 double hcalveto = 6.0,
121 double reliso = 0.05,
122 double maxLepZ = 1.0,
124 int minNMatches = 1) {
138 push_back(
"nMatchedStations", minNMatches);
151 set(
"nMatchedStations");
169 set(
"ECalVeto",
false);
170 set(
"HCalVeto",
false);
174 set(
"ECalVeto",
false);
175 set(
"HCalVeto",
false);
177 set(
"nPixelHits",
false);
178 set(
"nMatchedStations",
false);
182 set(
"NValMuHits",
false);
184 set(
"nPixelHits",
false);
185 set(
"nMatchedStations",
false);
188 set(
"NValMuHits",
false);
190 set(
"nPixelHits",
false);
191 set(
"nMatchedStations",
false);
207 std::cout <<
"Calling KIT selection method" << std::endl;
217 throw cms::Exception(
"LogicError") <<
"MuonVPlusJetsSelectionFunctor SPRING10 and FALL10 versions needs the " 218 "event! Call operator()(muon,event,ret)" 236 double norm_chi2 =
muon.normChi2();
237 double corr_d0 =
muon.dB();
238 int nhits =
static_cast<int>(
muon.numberOfValidHits());
240 double ecalVeto =
muon.isolationR03().emVetoEt;
241 double hcalVeto =
muon.isolationR03().hadVetoEt;
243 double hcalIso =
muon.hcalIso();
244 double ecalIso =
muon.ecalIso();
245 double trkIso =
muon.trackIso();
248 double relIso = (ecalIso + hcalIso + trkIso) /
pt;
272 double norm_chi2 =
muon.normChi2();
273 double corr_d0 =
muon.dB();
274 double corr_ed0 =
muon.edB();
275 double corr_sd0 = (corr_ed0 > 0.000000001) ? corr_d0 / corr_ed0 : 999.0;
276 int nhits =
static_cast<int>(
muon.numberOfValidHits());
278 double ecalVeto =
muon.isolationR03().emVetoEt;
279 double hcalVeto =
muon.isolationR03().hadVetoEt;
281 double hcalIso =
muon.hcalIso();
282 double ecalIso =
muon.ecalIso();
283 double trkIso =
muon.trackIso();
286 double relIso = (ecalIso + hcalIso + trkIso) /
pt;
314 double norm_chi2 =
muon.normChi2();
315 double corr_d0 =
muon.dB();
316 double corr_ed0 =
muon.edB();
317 double corr_sd0 = (corr_ed0 > 0.000000001) ? corr_d0 / corr_ed0 : 999.0;
327 if (beamSpotHandle.
isValid()) {
331 <<
"No beam spot available from EventSetup, not adding high level selection \n";
342 corr_sd0 = (corr_ed0 > 0.000000001) ? corr_d0 / corr_ed0 : 999.0;
350 int nhits =
static_cast<int>(
muon.numberOfValidHits());
351 int nValidMuonHits =
static_cast<int>(
muon.globalTrack()->hitPattern().numberOfValidMuonHits());
353 double ecalVeto =
muon.isolationR03().emVetoEt;
354 double hcalVeto =
muon.isolationR03().hadVetoEt;
356 double hcalIso =
muon.hcalIso();
357 double ecalIso =
muon.ecalIso();
358 double trkIso =
muon.trackIso();
361 double relIso = (ecalIso + hcalIso + trkIso) /
pt;
391 double norm_chi2 =
muon.normChi2();
392 double corr_d0 =
muon.dB();
393 double corr_ed0 =
muon.edB();
394 double corr_sd0 = (corr_ed0 > 0.000000001) ? corr_d0 / corr_ed0 : 999.0;
398 event.getByLabel(
pvSrc_, pvtxHandle_);
401 if (!pvtxHandle_->empty()) {
402 zvtx = pvtxHandle_->at(0).z();
405 <<
" There needs to be at least one primary vertex in the event." << std::endl;
416 if (beamSpotHandle.
isValid()) {
420 <<
"No beam spot available from EventSetup, not adding high level selection \n";
431 corr_sd0 = (corr_ed0 > 0.000000001) ? corr_d0 / corr_ed0 : 999.0;
439 int nhits =
static_cast<int>(
muon.numberOfValidHits());
440 int nValidMuonHits =
static_cast<int>(
muon.globalTrack()->hitPattern().numberOfValidMuonHits());
442 double ecalVeto =
muon.isolationR03().emVetoEt;
443 double hcalVeto =
muon.isolationR03().hadVetoEt;
445 double hcalIso =
muon.hcalIso();
446 double ecalIso =
muon.ecalIso();
447 double trkIso =
muon.trackIso();
450 double relIso = (ecalIso + hcalIso + trkIso) /
pt;
452 double z_mu =
muon.vertex().z();
454 int nPixelHits =
muon.innerTrack()->hitPattern().pixelLayersWithMeasurement();
456 int nMatchedStations =
muon.numberOfMatches();
495 double norm_chi2 =
muon.normChi2();
496 double corr_d0 =
muon.dB();
497 double corr_ed0 =
muon.edB();
498 double corr_sd0 = (corr_ed0 > 0.000000001) ? corr_d0 / corr_ed0 : 999.0;
502 event.getByLabel(
pvSrc_, pvtxHandle_);
505 if (!pvtxHandle_->empty()) {
506 zvtx = pvtxHandle_->at(0).z();
509 <<
" There needs to be at least one primary vertex in the event." << std::endl;
520 if (beamSpotHandle.
isValid()) {
524 <<
"No beam spot available from EventSetup, not adding high level selection \n";
535 corr_sd0 = (corr_ed0 > 0.000000001) ? corr_d0 / corr_ed0 : 999.0;
543 int nhits =
static_cast<int>(
muon.numberOfValidHits());
544 int nValidMuonHits =
static_cast<int>(
muon.globalTrack()->hitPattern().numberOfValidMuonHits());
546 double ecalVeto =
muon.isolationR03().emVetoEt;
547 double hcalVeto =
muon.isolationR03().hadVetoEt;
549 double hcalIso =
muon.hcalIso();
550 double ecalIso =
muon.ecalIso();
551 double trkIso =
muon.trackIso();
554 double relIso = (ecalIso + hcalIso + trkIso) /
pt;
556 double z_mu =
muon.vertex().z();
558 int nPixelHits =
muon.innerTrack()->hitPattern().pixelLayersWithMeasurement();
560 int nMatchedStations =
muon.numberOfMatches();
bool ignoreCut(std::string const &s) const
ignore the cut at index "s"
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
bool fall10Cuts(const pat::Muon &muon, edm::EventBase const &event, pat::strbitset &ret)
edm::EDGetTokenT< std::vector< reco::Vertex > > pvSrcToken_
bool firstDataCuts(const pat::Muon &muon, pat::strbitset &ret)
void initialize(Version_t version, double chi2=10.0, double d0=999.0, double ed0=999.0, double sd0=3.0, int nhits=11, int nValidMuonHits=0, double ecalveto=4.0, double hcalveto=6.0, double reliso=0.05, double maxLepZ=1.0, int minPixelHits=1, int minNMatches=1)
bool operator()(const pat::Muon &muon, edm::EventBase const &event, pat::strbitset &ret) override
This provides an alternative signature that includes extra information.
ret
prodAgent to be discontinued
MuonVPlusJetsIDSelectionFunctor(edm::ParameterSet const ¶meters, edm::ConsumesCollector &iC)
pat::strbitset::index_type index_type
void setIgnored(pat::strbitset &ret)
set ignored bits
pat::strbitset retInternal_
internal ret if users don't care about return bits
Log< level::Error, false > LogError
bool summer08Cuts(const pat::Muon &muon, pat::strbitset &ret)
MuonVPlusJetsIDSelectionFunctor()
pat::strbitset bits_
the bitset indexed by strings
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
index_type indexStations_
virtual void push_back(std::string const &s)
This is the registration of an individual cut string.
index_type indexECalVeto_
math::XYZPoint Point
point in the space
Functor that operates on <T>
index_type indexNValMuHits_
edm::EDGetTokenT< reco::BeamSpot > beamLineSrcToken_
index_type indexHCalVeto_
MuonVPlusJetsIDSelectionFunctor(Version_t version, double chi2=10.0, double d0=0.2, double ed0=999.0, double sd0=999.0, int nhits=11, int nValidMuonHits=0, double ecalveto=4.0, double hcalveto=6.0, double reliso=0.05, double maxLepZ=1.0, int minPixelHits=1, int minNMatches=1)
bool spring10Cuts(const pat::Muon &muon, edm::EventBase const &event, pat::strbitset &ret)
static constexpr float d0
bool operator()(const pat::Muon &muon, pat::strbitset &ret) override
This provides the interface for base classes to select objects.
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
int cut(index_type const &i, int val) const
Access the int cut values at index "s".
MuonVPlusJetsIDSelectionFunctor(edm::ParameterSet const ¶meters)
void setIgnoredCuts(std::vector< std::string > const &bitsToIgnore)
set the bits to ignore from a vector
bool kitQCDCuts(const pat::Muon &muon, edm::EventBase const &event, pat::strbitset &ret)
Analysis-level muon class.
edm::InputTag beamLineSrc_