|
|
Go to the documentation of this file.
84 return std::make_unique<PATMuonHeavyObjectCache>(iConfig);
97 typedef std::vector<edm::Handle<edm::Association<reco::GenParticleCollection>>>
GenAssociations;
112 template <
typename T>
114 const char* psetName,
132 bool primaryVertexIsValid,
134 bool beamspotIsValid);
138 const DetId& chamberId);
146 const std::vector<std::string>& collection_names);
193 std::vector<edm::EDGetTokenT<edm::Association<reco::GenParticleCollection>>>
genMatchTokens_;
271 template <
typename T>
273 const char* psetName,
278 if (iConfig.
exists(psetName)) {
281 if (depconf.
exists(
"tracker"))
283 if (depconf.
exists(
"ecal"))
285 if (depconf.
exists(
"hcal"))
287 if (depconf.
exists(
"pfAllParticles")) {
290 if (depconf.
exists(
"pfChargedHadrons")) {
293 if (depconf.
exists(
"pfChargedAll")) {
296 if (depconf.
exists(
"pfPUChargedHadrons")) {
299 if (depconf.
exists(
"pfNeutralHadrons")) {
302 if (depconf.
exists(
"pfPhotons")) {
305 if (depconf.
exists(
"user")) {
306 std::vector<edm::InputTag> userdeps = depconf.
getParameter<std::vector<edm::InputTag>>(
"user");
307 std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
309 for (; it != ed; ++it, ++
key) {
317 return consumes<edm::ValueMap<T>>(
label.second);
330 muonLowPtMvaEstimator_ = std::make_unique<MuonMvaEstimator>(mvaLowPtTrainingFile,
mvaDrMax);
340 : relMiniIsoPUCorrected_(0),
341 useUserData_(iConfig.exists(
"userData")),
342 computeMuonMVA_(
false),
343 computeSoftMuonMVA_(
false),
344 recomputeBasicSelectors_(
false),
346 isolator_(iConfig.exists(
"userIsolation") ? iConfig.getParameter<
edm::
ParameterSet>(
"userIsolation")
352 patMuonPutToken_{produces<std::vector<Muon>>()} {
354 muonToken_ = consumes<edm::View<reco::Muon>>(iConfig.getParameter<
edm::InputTag>(
"muonSource"));
356 embedBestTrack_ = iConfig.getParameter<
bool>(
"embedMuonBestTrack");
357 embedTunePBestTrack_ = iConfig.getParameter<
bool>(
"embedTunePMuonBestTrack");
358 forceEmbedBestTrack_ = iConfig.getParameter<
bool>(
"forceBestTrackEmbedding");
359 embedTrack_ = iConfig.getParameter<
bool>(
"embedTrack");
360 embedCombinedMuon_ = iConfig.getParameter<
bool>(
"embedCombinedMuon");
361 embedStandAloneMuon_ = iConfig.getParameter<
bool>(
"embedStandAloneMuon");
363 embedCaloMETMuonCorrs_ = iConfig.getParameter<
bool>(
"embedCaloMETMuonCorrs");
364 embedTcMETMuonCorrs_ = iConfig.getParameter<
bool>(
"embedTcMETMuonCorrs");
365 caloMETMuonCorrsToken_ =
366 mayConsume<edm::ValueMap<reco::MuonMETCorrectionData>>(iConfig.getParameter<
edm::InputTag>(
"caloMETMuonCorrs"));
367 tcMETMuonCorrsToken_ =
368 mayConsume<edm::ValueMap<reco::MuonMETCorrectionData>>(iConfig.getParameter<
edm::InputTag>(
"tcMETMuonCorrs"));
370 useParticleFlow_ = iConfig.getParameter<
bool>(
"useParticleFlow");
371 embedPFCandidate_ = iConfig.getParameter<
bool>(
"embedPFCandidate");
372 pfMuonToken_ = mayConsume<reco::PFCandidateCollection>(iConfig.getParameter<
edm::InputTag>(
"pfMuonSource"));
373 embedPfEcalEnergy_ = iConfig.getParameter<
bool>(
"embedPfEcalEnergy");
375 embedPickyMuon_ = iConfig.getParameter<
bool>(
"embedPickyMuon");
376 embedTpfmsMuon_ = iConfig.getParameter<
bool>(
"embedTpfmsMuon");
377 embedDytMuon_ = iConfig.getParameter<
bool>(
"embedDytMuon");
379 addInverseBeta_ = iConfig.getParameter<
bool>(
"addInverseBeta");
380 if (addInverseBeta_) {
381 muonTimeExtraToken_ =
382 consumes<edm::ValueMap<reco::MuonTimeExtra>>(iConfig.getParameter<
edm::InputTag>(
"sourceMuonTimeExtra"));
385 addGenMatch_ = iConfig.getParameter<
bool>(
"addGenMatch");
387 embedGenMatch_ = iConfig.getParameter<
bool>(
"embedGenMatch");
393 iConfig.getParameter<std::vector<edm::InputTag>>(
"genParticleMatch"),
394 [
this](
edm::InputTag const&
tag) { return consumes<edm::Association<reco::GenParticleCollection>>(tag); });
398 addEfficiencies_ = iConfig.getParameter<
bool>(
"addEfficiencies");
399 if (addEfficiencies_) {
404 addResolutions_ = iConfig.getParameter<
bool>(
"addResolutions");
405 if (addResolutions_) {
409 addPuppiIsolation_ = iConfig.getParameter<
bool>(
"addPuppiIsolation");
410 if (addPuppiIsolation_) {
411 PUPPIIsolation_charged_hadrons_ =
412 consumes<edm::ValueMap<float>>(iConfig.getParameter<
edm::InputTag>(
"puppiIsolationChargedHadrons"));
413 PUPPIIsolation_neutral_hadrons_ =
414 consumes<edm::ValueMap<float>>(iConfig.getParameter<
edm::InputTag>(
"puppiIsolationNeutralHadrons"));
415 PUPPIIsolation_photons_ =
416 consumes<edm::ValueMap<float>>(iConfig.getParameter<
edm::InputTag>(
"puppiIsolationPhotons"));
418 PUPPINoLeptonsIsolation_charged_hadrons_ =
419 consumes<edm::ValueMap<float>>(iConfig.getParameter<
edm::InputTag>(
"puppiNoLeptonsIsolationChargedHadrons"));
420 PUPPINoLeptonsIsolation_neutral_hadrons_ =
421 consumes<edm::ValueMap<float>>(iConfig.getParameter<
edm::InputTag>(
"puppiNoLeptonsIsolationNeutralHadrons"));
422 PUPPINoLeptonsIsolation_photons_ =
423 consumes<edm::ValueMap<float>>(iConfig.getParameter<
edm::InputTag>(
"puppiNoLeptonsIsolationPhotons"));
426 readIsolationLabels(iConfig,
"isoDeposits", isoDepositLabels_, isoDepositTokens_);
428 readIsolationLabels(iConfig,
"isolationValues", isolationValueLabels_, isolationValueTokens_);
434 embedHighLevelSelection_ = iConfig.getParameter<
bool>(
"embedHighLevelSelection");
435 if (embedHighLevelSelection_) {
436 beamLineToken_ = consumes<reco::BeamSpot>(iConfig.getParameter<
edm::InputTag>(
"beamLineSrc"));
437 pvToken_ = consumes<std::vector<reco::Vertex>>(iConfig.getParameter<
edm::InputTag>(
"pvSrc"));
441 computeMiniIso_ = iConfig.getParameter<
bool>(
"computeMiniIso");
443 computePuppiCombinedIso_ = iConfig.getParameter<
bool>(
"computePuppiCombinedIso");
445 effectiveAreaVec_ = iConfig.getParameter<std::vector<double>>(
"effectiveAreaVec");
447 miniIsoParams_ = iConfig.getParameter<std::vector<double>>(
"miniIsoParams");
448 if (computeMiniIso_ && miniIsoParams_.size() != 9) {
449 throw cms::Exception(
"ParameterError") <<
"miniIsoParams must have exactly 9 elements.\n";
451 if (computeMiniIso_ || computePuppiCombinedIso_)
452 pcToken_ = consumes<pat::PackedCandidateCollection>(iConfig.getParameter<
edm::InputTag>(
"pfCandsForMiniIso"));
455 recomputeBasicSelectors_ = iConfig.getParameter<
bool>(
"recomputeBasicSelectors");
456 computeMuonMVA_ = iConfig.getParameter<
bool>(
"computeMuonMVA");
457 if (computeMuonMVA_ and not computeMiniIso_)
458 throw cms::Exception(
"ConfigurationError") <<
"MiniIso is needed for Muon MVA calculation.\n";
460 if (computeMuonMVA_) {
462 mvaBTagCollectionTag_ = consumes<reco::JetTagCollection>(iConfig.getParameter<
edm::InputTag>(
"mvaJetTag"));
463 mvaL1Corrector_ = consumes<reco::JetCorrector>(iConfig.getParameter<
edm::InputTag>(
"mvaL1Corrector"));
464 mvaL1L2L3ResCorrector_ = consumes<reco::JetCorrector>(iConfig.getParameter<
edm::InputTag>(
"mvaL1L2L3ResCorrector"));
465 rho_ = consumes<double>(iConfig.getParameter<
edm::InputTag>(
"rho"));
466 mvaUseJec_ = iConfig.getParameter<
bool>(
"mvaUseJec");
469 computeSoftMuonMVA_ = iConfig.getParameter<
bool>(
"computeSoftMuonMVA");
472 simInfo_ = consumes<edm::ValueMap<reco::MuonSimInfo>>(iConfig.getParameter<
edm::InputTag>(
"muonSimInfo"));
474 addTriggerMatching_ = iConfig.getParameter<
bool>(
"addTriggerMatching");
475 if (addTriggerMatching_) {
477 consumes<std::vector<pat::TriggerObjectStandAlone>>(iConfig.getParameter<
edm::InputTag>(
"triggerObjects"));
480 hltCollectionFilters_ = iConfig.getParameter<std::vector<std::string>>(
"hltCollectionFilters");
487 const DetId& chamberId) {
489 if (chamberGeometry) {
490 LocalPoint localPosition(chamberMatch.
x, chamberMatch.
y, 0);
491 return std::optional<GlobalPoint>(std::in_place, chamberGeometry->
toGlobal(localPosition));
493 return std::optional<GlobalPoint>();
505 std::optional<GlobalPoint> muonPosition;
510 for (
const auto& chamberMatch : aMuon.
matches()) {
513 if (
abs(detId.station()) > 3)
516 if (
abs(detId.station()) == 2)
520 CSCDetId detId(chamberMatch.id.rawId());
521 if (
abs(detId.station()) > 3)
524 if (
abs(detId.station()) == 2)
528 if (not muonPosition)
532 if (
std::abs(triggerObject.eta()) < 0.001) {
534 if (
deltaPhi(triggerObject.phi(), muonPosition->phi()) > 0.1)
538 if (
deltaR(triggerObject.p4(), *muonPosition) > 0.15)
551 const std::vector<std::string>& collection_filter_names) {
557 for (
const auto&
name : collection_filter_names) {
558 if (triggerObject.hasCollection(
name)) {
569 muon.addTriggerObjectMatch(
obj);
578 throw cms::Exception(
"FatalError") <<
"Unable to find GlobalTrackingGeometryRecord in event!\n";
581 if (
iEvent.isRealData()) {
655 bool beamSpotIsValid =
false;
656 bool primaryVertexIsValid =
false;
666 if (beamSpotHandle.
isValid()) {
668 beamSpotIsValid =
true;
670 edm::LogError(
"DataNotAvailable") <<
"No beam spot available from EventSetup, not adding high level selection \n";
672 if (pvHandle.
isValid() && !pvHandle->empty()) {
674 primaryVertexIsValid =
true;
677 <<
"No primary vertex available from EventSetup, not adding high level selection \n";
703 Muon aMuon(muonBaseRef);
718 chosenTrack = bestTrack;
721 unsigned int nhits = chosenTrack->numberOfValidHits();
747 (*PUPPIIsolation_neutral_hadrons)[muonBaseRef],
748 (*PUPPIIsolation_photons)[muonBaseRef]);
751 (*PUPPINoLeptonsIsolation_neutral_hadrons)[muonBaseRef],
752 (*PUPPINoLeptonsIsolation_photons)[muonBaseRef]);
795 unsigned int idx = itMuon -
muons->begin();
805 (*PUPPIIsolation_neutral_hadrons)[muonRef],
806 (*PUPPIIsolation_photons)[muonRef]);
808 (*PUPPINoLeptonsIsolation_neutral_hadrons)[muonRef],
809 (*PUPPINoLeptonsIsolation_photons)[muonRef]);
849 chosenTrack = bestTrack;
851 unsigned int nhits = chosenTrack->numberOfValidHits();
875 if (pfmu.muonRef().isNonnull()) {
876 if (pfmu.muonRef().id() != muonRef.id())
878 <<
"Muon reference within PF candidates does not point to the muon collection." << std::endl;
879 if (pfmu.muonRef().key() == muonRef.key()) {
898 if (simInfoIsAvailalbe) {
899 const auto& msi = (*simInfo)[muonBaseRef];
930 if (primaryVertexIsValid)
935 bool triggerObjectsAvailable =
false;
936 bool triggerResultsAvailable =
false;
951 muon.setSelectors(0);
952 bool isRun2016BCDEF = (272728 <=
iEvent.run() &&
iEvent.run() <= 278808);
955 float miniIsoValue = -1;
967 double puppiCombinedIsolationPAT = -1;
975 float jetPtRatio = 0.0;
976 float jetPtRel = 0.0;
978 float mva_lowpt = 0.0;
981 mva = globalCache()->muonMvaEstimator().computeMva(
muon,
983 *(mvaBTagCollectionTag.
product()),
989 mva_lowpt = globalCache()->muonLowPtMvaEstimator().computeMva(
muon,
991 *(mvaBTagCollectionTag.
product()),
999 mva = globalCache()->muonMvaEstimator().computeMva(
1000 muon,
primaryVertex, *mvaBTagCollectionTag, jetPtRatio, jetPtRel, miniIsoValue);
1001 mva_lowpt = globalCache()->muonLowPtMvaEstimator().computeMva(
1002 muon,
primaryVertex, *mvaBTagCollectionTag, jetPtRatio, jetPtRel, miniIsoValue);
1006 muon.setLowPtMvaValue(mva_lowpt);
1007 muon.setJetPtRatio(jetPtRatio);
1008 muon.setJetPtRel(jetPtRel);
1013 miniIsoValue < 0.11 && (
muon.jetPtRatio() > 0.74 ||
muon.jetPtRel() > 6.8));
1021 const double sip3D = edB3D > 0 ? dB3D / edB3D : 0.0;
1026 dB2D < 0.05 and
dz < 0.1) {
1033 if (
muon.pt() > 5 and
muon.isLooseMuon() and sip3D < 4 and dB2D < 0.5 and
dz < 1) {
1041 float mva = globalCache()->softMuonMvaEstimator().computeMva(
muon);
1093 for (
auto const&
genMatch : genMatches) {
1104 for (
size_t j = 0, nd =
deposits.size();
j < nd; ++
j) {
1163 constexpr
double dR_threshold = 0.4;
1164 constexpr
double dR2_threshold = dR_threshold * dR_threshold;
1165 constexpr
double mix_fraction = 0.5;
1167 double val_PuppiWithLep = 0.0;
1168 double val_PuppiWithoutLep = 0.0;
1170 for (
const auto&
cand : *pc) {
1176 if (pType ==
OTHER) {
1178 LogTrace(
"PATMuonProducer") <<
"candidate with PDGID = " <<
cand.pdgId()
1179 <<
" is not CH/NH/PH/e/mu or 1/2 (and this is removed from isolation calculation)"
1185 if (d_eta > dR_threshold)
1189 if (d_phi > dR_threshold)
1193 if (dR2 > dR2_threshold)
1195 if (pType ==
CH && dR2 < 0.0001 * 0.0001)
1197 if (pType == NH && dR2 < 0.01 * 0.01)
1199 if (pType == PH && dR2 < 0.01 * 0.01)
1201 val_PuppiWithLep +=
cand.pt() *
cand.puppiWeight();
1202 val_PuppiWithoutLep +=
cand.pt() *
cand.puppiWeightNoLep();
1206 double reliso_Puppi_withLep = val_PuppiWithLep /
muon.pt();
1207 double reliso_Puppi_withoutlep = val_PuppiWithoutLep /
muon.pt();
1208 double reliso_Puppi_combined = mix_fraction * reliso_Puppi_withLep + (1.0 - mix_fraction) * reliso_Puppi_withoutlep;
1209 return reliso_Puppi_combined;
1221 iDesc.
setComment(
"PAT muon producer module");
1227 iDesc.
add<
bool>(
"embedMuonBestTrack",
true)->setComment(
"embed muon best track (global pflow)");
1228 iDesc.
add<
bool>(
"embedTunePMuonBestTrack",
true)->setComment(
"embed muon best track (muon only)");
1229 iDesc.
add<
bool>(
"forceBestTrackEmbedding",
true)
1231 "force embedding separately the best tracks even if they're already embedded e.g. as tracker or global "
1233 iDesc.
add<
bool>(
"embedTrack",
true)->setComment(
"embed external track");
1234 iDesc.
add<
bool>(
"embedStandAloneMuon",
true)->setComment(
"embed external stand-alone muon");
1235 iDesc.
add<
bool>(
"embedCombinedMuon",
false)->setComment(
"embed external combined muon");
1236 iDesc.
add<
bool>(
"embedPickyMuon",
false)->setComment(
"embed external picky track");
1237 iDesc.
add<
bool>(
"embedTpfmsMuon",
false)->setComment(
"embed external tpfms track");
1238 iDesc.
add<
bool>(
"embedDytMuon",
false)->setComment(
"embed external dyt track ");
1241 iDesc.
add<
bool>(
"embedCaloMETMuonCorrs",
true)->setComment(
"whether to add MET muon correction for caloMET or not");
1243 ->setComment(
"source of MET muon corrections for caloMET");
1244 iDesc.
add<
bool>(
"embedTcMETMuonCorrs",
true)->setComment(
"whether to add MET muon correction for tcMET or not");
1246 ->setComment(
"source of MET muon corrections for tcMET");
1250 iDesc.
add<
bool>(
"useParticleFlow",
false)->setComment(
"whether to use particle flow or not");
1251 iDesc.
add<
bool>(
"embedPFCandidate",
false)->setComment(
"embed external particle flow object");
1252 iDesc.
add<
bool>(
"embedPfEcalEnergy",
true)->setComment(
"add ecal energy as reconstructed by PF");
1255 iDesc.
add<
bool>(
"addInverseBeta",
true)->setComment(
"add combined inverse beta");
1257 ->setComment(
"source of inverse beta values");
1260 iDesc.
add<
bool>(
"addGenMatch",
true)->setComment(
"add MC matching");
1261 iDesc.
add<
bool>(
"embedGenMatch",
false)->setComment(
"embed MC matched MC information");
1262 std::vector<edm::InputTag> emptySourceVector;
1266 ->
setComment(
"input with MC match information");
1269 iDesc.
add<
bool>(
"computeMiniIso",
false)->setComment(
"whether or not to compute and store electron mini-isolation");
1270 iDesc.
add<
bool>(
"computePuppiCombinedIso",
false)
1271 ->setComment(
"whether or not to compute and store puppi combined isolation");
1274 ->setComment(
"collection to use to compute mini-iso");
1275 iDesc.
add<std::vector<double>>(
"miniIsoParams", std::vector<double>())
1276 ->setComment(
"mini-iso parameters to use for muons");
1278 iDesc.
add<
bool>(
"addTriggerMatching",
false)->setComment(
"add L1 and HLT matching to offline muon");
1293 isoDepositsPSet.
addOptional<std::vector<edm::InputTag>>(
"user");
1294 iDesc.
addOptional(
"isoDeposits", isoDepositsPSet);
1307 iDesc.
addOptional(
"isolationValues", isolationValuesPSet);
1311 "puppiIsolationChargedHadrons",
1312 edm::InputTag(
"muonPUPPIIsolation",
"h+-DR030-ThresholdVeto000-ConeVeto000"),
1315 "puppiIsolationNeutralHadrons",
1316 edm::InputTag(
"muonPUPPIIsolation",
"h0-DR030-ThresholdVeto000-ConeVeto001"),
1319 "puppiIsolationPhotons",
1320 edm::InputTag(
"muonPUPPIIsolation",
"gamma-DR030-ThresholdVeto000-ConeVeto001"),
1323 "puppiNoLeptonsIsolationChargedHadrons",
1324 edm::InputTag(
"muonPUPPINoLeptonsIsolation",
"h+-DR030-ThresholdVeto000-ConeVeto000"),
1327 "puppiNoLeptonsIsolationNeutralHadrons",
1328 edm::InputTag(
"muonPUPPINoLeptonsIsolation",
"h0-DR030-ThresholdVeto000-ConeVeto001"),
1331 "puppiNoLeptonsIsolationPhotons",
1332 edm::InputTag(
"muonPUPPINoLeptonsIsolation",
"gamma-DR030-ThresholdVeto000-ConeVeto001"),
1339 iDesc.
add(
"efficiencies", efficienciesPSet);
1340 iDesc.
add<
bool>(
"addEfficiencies",
false);
1349 iDesc.
add(
"userIsolation", isolationPSet);
1351 iDesc.
add<
bool>(
"embedHighLevelSelection",
true)->setComment(
"embed high level selection");
1355 ->
setComment(
"input with high level selection");
1357 ->
setComment(
"input with high level selection");
1368 bool primaryVertexIsValid,
1370 bool beamspotIsValid) {
1379 std::pair<bool, Measurement1D>
result =
1381 double d0_corr =
result.second.value();
1382 double d0_err = primaryVertexIsValid ?
result.second.error() : -1.0;
1395 d0_corr =
result.second.value();
1396 d0_err = beamspotIsValid ?
result.second.error() : -1.0;
bool addInverseBeta_
add combined inverse beta measurement into the muon
void embedTpfmsMuon()
embed reference to the above tpfms Track
bool isAValidMuonTrack(const MuonTrackType &type) const
void setSimMatchQuality(float quality)
void fillMuon(Muon &aMuon, const MuonBaseRef &muonRef, const reco::CandidateBaseRef &baseRef, const GenAssociations &genMatches, const IsoDepositMaps &deposits, const IsolationValueMaps &isolationValues) const
common muon filling, for both the standard and PF2PAT case
double getRelMiniIsoPUCorrected(const pat::Muon &muon, double rho, const std::vector< double > &area)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool embedTrack_
embed the track from inner tracker into the muon
T const * product() const
void addTriggerObjectMatch(const TriggerObjectStandAlone &trigObj)
add a trigger match
Calculates a lepton's calorimetric isolation energy.
bool embedPfEcalEnergy_
add ecal PF energy
std::pair< pat::IsolationKeys, edm::InputTag > IsolationLabel
void setSimFlavour(int f)
float miniIsoDr(const reco::Candidate::PolarLorentzVector &p4, float mindr, float maxdr, float kt_scale)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
everything that needs to be done during the event loop
constexpr double deltaPhi(double phi1, double phi2)
double muonRelMiniIsoPUCorrected(const PFIsolation &iso, const reco::Candidate::PolarLorentzVector &p4, double dr, double rho, const std::vector< double > &area)
void embedTcMETMuonCorrs(const reco::MuonMETCorrectionData &t)
Analysis-level trigger object class (stand-alone)
bool embedTunePBestTrack_
embed the track from best muon measurement (muon only)
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
static void fillDescription(edm::ParameterSetDescription &iDesc)
bool embedPickyMuon_
embed track from picky muon fit into the muon
std::vector< MuonChamberMatch > & matches()
get muon matching information
static std::unique_ptr< PATMuonHeavyObjectCache > initializeGlobalCache(const edm::ParameterSet &iConfig)
PFCandidateCollection::const_iterator PFCandidateConstIterator
iterator
void setSimType(reco::MuonSimType type)
static const std::string triggerResults
void setIsolationPUPPI(float chargedhadrons, float neutralhadrons, float photons)
sets PUPPI isolations
void setIsolation(IsolationKeys key, float value)
bool enabled() const
'true' if this there is at least one efficiency configured
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
isolation value pair for temporary storage before being folded into the muon
void embedDytMuon()
embed reference to the above dyt Track
static void globalEndJob(PATMuonHeavyObjectCache *)
edm::EDGetTokenT< std::vector< pat::TriggerObjectStandAlone > > triggerObjects_
void addGenParticleRef(const reco::GenParticleRef &ref)
std::vector< edm::Handle< edm::Association< reco::GenParticleCollection > > > GenAssociations
edm::EDGetTokenT< reco::JetCorrector > mvaL1L2L3ResCorrector_
Calculates a lepton's tracker isolation pt.
Analysis-level muon class.
void setIsolationPUPPINoLeptons(float chargedhadrons, float neutralhadrons, float photons)
sets PUPPINoLeptons isolations
void setPFCandidateRef(const reco::PFCandidateRef &ref)
add a reference to the source IsolatedPFCandidate
bool embedDytMuon_
embed track from DYT muon fit into the muon
Global3DVector GlobalVector
void embedMuonBestTrack(bool force=false)
void fillHltTriggerInfo(pat::Muon &muon, edm::Handle< std::vector< pat::TriggerObjectStandAlone >> &triggerObjects, const edm::TriggerNames &names, const std::vector< std::string > &collection_names)
bool recomputeBasicSelectors_
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
void embedCombinedMuon()
set reference to Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon...
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
bool enabled() const
'true' if this there is at least one efficiency configured
bool embedCombinedMuon_
embed track of the combined fit into the muon
bool enabled() const
True if it has a non null configuration.
bool isPhoton(long pdgid)
bool embedGenMatch_
embed the gen match information into the muon
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_neutral_hadrons_
primaryVertex
hltOfflineBeamSpot for HLTMON
void setSimPhi(float phi)
IsolationLabels isolationValueLabels_
input source isolation value maps
void setSimHeaviestMotherFlavour(int id)
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
pat::helper::EfficiencyLoader efficiencyLoader_
helper class to add efficiencies to the muon
void setSimProdRho(float rho)
reco::MuonRef muonRef() const
bool useUserData_
add user data to the muon (this will be data members of th muon even w/o embedding)
const edm::EDPutTokenT< std::vector< Muon > > patMuonPutToken_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_charged_hadrons_
edm::RefToBase< reco::Muon > MuonBaseRef
typedefs for convenience
#define DEFINE_FWK_MODULE(type)
bool forceEmbedBestTrack_
force separate embed of the best track even if already embedded
void embedStandAloneMuon()
set reference to Track reconstructed in the muon detector only (reimplemented from reco::Muon)
PFIsolation getMiniPFIsolation(const pat::PackedCandidateCollection *pfcands, const reco::Candidate::PolarLorentzVector &p4, float mindr=0.05, float maxdr=0.2, float kt_scale=10.0, float ptthresh=0.5, float deadcone_ch=0.0001, float deadcone_pu=0.01, float deadcone_ph=0.01, float deadcone_nh=0.01, float dZ_cut=0.0)
const std::string names[nVars_]
bool addPuppiIsolation_
add puppi isolation
void embedTrack()
set reference to Track reconstructed in the tracker only (reimplemented from reco::Muon)
void add(ObjectType &patObject, edm::Event const &iEvent, edm::EventSetup const &iSetup)
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
input tags for generator match information
bool isNeutralHadron(long pdgid)
void embedPFCandidate()
embed the IsolatedPFCandidate pointed to by pfCandidateRef_
static const std::string source
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
std::unique_ptr< const pat::SoftMuonMvaEstimator > softMuonMvaEstimator_
bool embedHighLevelSelection_
embed high level selection variables
void setDB(double dB, double edB, IPTYPE type=PV2D)
pat::helper::KinResolutionsLoader resolutionLoader_
helper class to add resolutions to the muon
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
IsolationLabels isoDepositLabels_
input source for isoDeposits
std::optional< GlobalPoint > getMuonDirection(const reco::MuonChamberMatch &chamberMatch, const edm::ESHandle< GlobalTrackingGeometry > &geometry, const DetId &chamberId)
bool isGlobalMuon() const override
void setPfEcalEnergy(float pfEcalEnergy)
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool embedTcMETMuonCorrs_
embed muon MET correction info for tcMET into the muon
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
~PATMuonProducer() override
default destructur
void setComment(std::string const &value)
bool isChargedHadron(long pdgid)
void readIsolationLabels(const edm::ParameterSet &iConfig, const char *psetName, IsolationLabels &labels, std::vector< edm::EDGetTokenT< edm::ValueMap< T >>> &tokens)
bool embedPFCandidate_
embed pfCandidates into the muon
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_photons_
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
bool computeMuonMVA_
standard muon selectors
enum start value shifted to 81 so as to avoid clashes with PDG codes
edm::EDGetTokenT< reco::JetCorrector > mvaL1Corrector_
bool isNonnull() const
Checks for non-null.
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > caloMETMuonCorrsToken_
source of caloMET muon corrections
pat::MuonMvaEstimator const & muonMvaEstimator() const
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T >> cases)
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_charged_hadrons_
edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
input source of the primary vertex
bool embedCaloMETMuonCorrs_
embed muon MET correction info for caloMET into the muon
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
pat::SoftMuonMvaEstimator const & softMuonMvaEstimator() const
bool embedTpfmsMuon_
embed track from tpfms muon fit into the muon
void setMiniPFIsolation(PFIsolation const &iso)
bool computePuppiCombinedIso_
void setSimMotherPdgId(int id)
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
edm::EDGetTokenT< edm::ValueMap< reco::MuonTimeExtra > > muonTimeExtraToken_
input tag for reading inverse beta
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_photons_
bool contains(EventRange const &lh, EventID const &rh)
void setAllowAnything()
allow any parameter label/value pairs
Log< level::Error, false > LogError
bool addEfficiencies_
add efficiencies to the muon (this will be data members of th muon even w/o embedding)
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
input source
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transientTrackBuilderToken_
edm::EDGetTokenT< reco::PFCandidateCollection > pfMuonToken_
input source pfCandidates that will be to be transformed into pat::Muons, when using PF2PAT
double ecalEnergy() const
return corrected Ecal energy
CH
LTS and SET for low trigger suppression.
reco::Muon::Selector makeSelectorBitset(reco::Muon const &muon, reco::Vertex const *vertex=nullptr, bool run2016_hip_mitigation=false)
bool getData(T &iHolder) const
std::vector< pat::PackedCandidate > PackedCandidateCollection
bool addResolutions_
add resolutions to the muon (this will be data members of th muon even w/o embedding)
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > tcMETMuonCorrsToken_
source of tcMET muon corrections
edm::EDGetTokenT< reco::BeamSpot > beamLineToken_
input source of the primary vertex/beamspot
std::vector< edm::Handle< edm::ValueMap< IsoDeposit > > > IsoDepositMaps
void setP4(const LorentzVector &p4) final
set 4-momentum
edm::EDGetTokenT< edm::ValueMap< reco::MuonSimInfo > > simInfo_
MC info.
void readTimeExtra(const reco::MuonTimeExtra &t)
void setMuonMiniIso(pat::Muon &aMuon, const pat::PackedCandidateCollection *pc)
IsolationKeys
Enum defining isolation keys.
std::unique_ptr< const pat::MuonMvaEstimator > muonMvaEstimator_
bool addTriggerMatching_
Trigger.
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
edm::EDGetTokenT< double > rho_
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_neutral_hadrons_
void setSimEta(float eta)
void setNumberOfValidHits(unsigned int numberOfValidHits)
bool addGenMatch_
add generator match information
edm::EDGetTokenT< reco::JetTagCollection > mvaBTagCollectionTag_
void fillL1TriggerInfo(pat::Muon &muon, edm::Handle< std::vector< pat::TriggerObjectStandAlone >> &triggerObjects, const edm::TriggerNames &names, const edm::ESHandle< GlobalTrackingGeometry > &geometry)
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
pat::MuonMvaEstimator const & muonLowPtMvaEstimator() const
bool useParticleFlow_
switch to use particle flow (PF2PAT) or not
pat::PATUserDataHelper< pat::Muon > userDataHelper_
helper class to add userData to the muon
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
T getParameter(std::string const &) const
void setSimTpEvent(int tpEvent)
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
PATMuonHeavyObjectCache(const edm::ParameterSet &)
void setNormChi2(double normChi2)
PATMuonProducer(const edm::ParameterSet &iConfig, PATMuonHeavyObjectCache const *)
default constructir
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
void embedHighLevel(pat::Muon &aMuon, reco::TrackRef track, reco::TransientTrack &tt, reco::Vertex &primaryVertex, bool primaryVertexIsValid, reco::BeamSpot &beamspot, bool beamspotIsValid)
void embedCaloMETMuonCorrs(const reco::MuonMETCorrectionData &t)
Particle reconstructed by the particle flow algorithm.
reco::TransientTrack build(const reco::Track *p) const
bool embedBestTrack_
embed the track from best muon measurement (global pflow)
Abs< T >::type abs(const T &t)
const PolarLorentzVector & polarP4() const final
four-momentum Lorentz vector
void setExtSimType(reco::ExtendedMuonSimType type)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
description of config file parameters
void setComment(std::string const &value)
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > geometryToken_
genMatch
add extra information on genMatch
std::vector< IsolationLabel > IsolationLabels
std::vector< double > miniIsoParams_
bool embedStandAloneMuon_
embed track from muon system into the muon
double puppiCombinedIsolation(const pat::Muon &muon, const pat::PackedCandidateCollection *pc)
void setSimProdZ(float z)
std::vector< std::string > hltCollectionFilters_
void embedPickyMuon()
embed reference to the above picky Track
std::vector< double > effectiveAreaVec_
double relMiniIsoPUCorrected(const pat::Muon &aMuon, double rho)
reco::PFCandidateRef pfCandidateRef() const
void embedTunePMuonBestTrack(bool force=false)
double relMiniIsoPUCorrected_
edm::EDGetTokenT< pat::PackedCandidateCollection > pcToken_
std::unique_ptr< const pat::MuonMvaEstimator > muonLowPtMvaEstimator_
pat::helper::MultiIsolator isolator_