66 muonLowPtMvaEstimator_ = std::make_unique<MuonMvaEstimator>(mvaLowPtTrainingFile,
mvaDrMax);
76 : relMiniIsoPUCorrected_(0),
77 useUserData_(iConfig.exists(
"userData")),
78 computeMuonMVA_(
false),
79 computeSoftMuonMVA_(
false),
80 recomputeBasicSelectors_(
false),
82 isolator_(iConfig.exists(
"userIsolation") ? iConfig.getParameter<
edm::
ParameterSet>(
"userIsolation")
113 if (addInverseBeta_) {
128 iConfig.
getParameter<std::vector<edm::InputTag>>(
"genParticleMatch"),
129 [
this](
edm::InputTag const&
tag) { return consumes<edm::Association<reco::GenParticleCollection>>(tag); });
170 if (embedHighLevelSelection_) {
184 throw cms::Exception(
"ParameterError") <<
"miniIsoParams must have exactly 9 elements.\n";
193 throw cms::Exception(
"ConfigurationError") <<
"MiniIso is needed for Muon MVA calculation.\n";
195 if (computeMuonMVA_) {
218 produces<std::vector<Muon>>();
225 const DetId& chamberId) {
227 if (chamberGeometry) {
228 LocalPoint localPosition(chamberMatch.
x, chamberMatch.
y, 0);
229 return std::optional<GlobalPoint>(std::in_place, chamberGeometry->
toGlobal(localPosition));
231 return std::optional<GlobalPoint>();
243 std::optional<GlobalPoint> muonPosition;
248 for (
const auto& chamberMatch : aMuon.
matches()) {
251 if (
abs(detId.station()) > 3)
254 if (
abs(detId.station()) == 2)
258 CSCDetId detId(chamberMatch.id.rawId());
259 if (
abs(detId.station()) > 3)
262 if (
abs(detId.station()) == 2)
266 if (not muonPosition)
270 if (fabs(triggerObject.eta()) < 0.001) {
272 if (
deltaPhi(triggerObject.phi(), muonPosition->phi()) > 0.1)
276 if (
deltaR(triggerObject.p4(), *muonPosition) > 0.15)
289 const std::vector<std::string>& collection_filter_names) {
295 for (
const auto&
name : collection_filter_names) {
296 if (triggerObject.hasCollection(
name)) {
317 throw cms::Exception(
"FatalError") <<
"Unable to find GlobalTrackingGeometryRecord in event!\n";
394 bool beamSpotIsValid =
false;
395 bool primaryVertexIsValid =
false;
405 if (beamSpotHandle.
isValid()) {
406 beamSpot = *beamSpotHandle;
407 beamSpotIsValid =
true;
409 edm::LogError(
"DataNotAvailable") <<
"No beam spot available from EventSetup, not adding high level selection \n";
411 if (pvHandle.
isValid() && !pvHandle->empty()) {
412 primaryVertex = pvHandle->at(0);
413 primaryVertexIsValid =
true;
416 <<
"No primary vertex available from EventSetup, not adding high level selection \n";
427 std::vector<Muon>*
patMuons =
new std::vector<Muon>();
442 Muon aMuon(muonBaseRef);
457 chosenTrack = bestTrack;
460 unsigned int nhits = chosenTrack->numberOfValidHits();
464 embedHighLevel(aMuon, chosenTrack, tt, primaryVertex, primaryVertexIsValid, beamSpot, beamSpotIsValid);
468 double norm_chi2 = globalTrack->chi2() / globalTrack->ndof();
486 (*PUPPIIsolation_neutral_hadrons)[muonBaseRef],
487 (*PUPPIIsolation_photons)[muonBaseRef]);
490 (*PUPPINoLeptonsIsolation_neutral_hadrons)[muonBaseRef],
491 (*PUPPINoLeptonsIsolation_photons)[muonBaseRef]);
501 patMuons->push_back(aMuon);
534 unsigned int idx = itMuon - muons->begin();
544 (*PUPPIIsolation_neutral_hadrons)[muonRef],
545 (*PUPPIIsolation_photons)[muonRef]);
547 (*PUPPINoLeptonsIsolation_neutral_hadrons)[muonRef],
548 (*PUPPINoLeptonsIsolation_photons)[muonRef]);
588 chosenTrack = bestTrack;
590 unsigned int nhits = chosenTrack->numberOfValidHits();
594 embedHighLevel(aMuon, chosenTrack, tt, primaryVertex, primaryVertexIsValid, beamSpot, beamSpotIsValid);
598 double norm_chi2 = globalTrack->chi2() / globalTrack->ndof();
612 if (pfmu.muonRef().isNonnull()) {
613 if (pfmu.muonRef().id() != muonRef.id())
615 <<
"Muon reference within PF candidates does not point to the muon collection." << std::endl;
616 if (pfmu.muonRef().key() == muonRef.key()) {
627 if (simInfoIsAvailalbe) {
628 const auto& msi = (*simInfo)[muonBaseRef];
644 patMuons->push_back(aMuon);
649 std::sort(patMuons->begin(), patMuons->end(),
pTComparator_);
659 if (primaryVertexIsValid)
664 bool triggerObjectsAvailable =
false;
665 bool triggerResultsAvailable =
false;
671 for (
auto&
muon : *patMuons) {
680 muon.setSelectors(0);
681 bool isRun2016BCDEF = (272728 <= iEvent.
run() && iEvent.
run() <= 278808);
684 float miniIsoValue = -1;
696 double puppiCombinedIsolationPAT = -1;
704 float jetPtRatio = 0.0;
705 float jetPtRel = 0.0;
707 float mva_lowpt = 0.0;
710 mva = globalCache()->muonMvaEstimator()->computeMva(
muon,
712 *(mvaBTagCollectionTag.
product()),
717 &*mvaL1L2L3ResCorrector);
718 mva_lowpt = globalCache()->muonLowPtMvaEstimator()->computeMva(
muon,
720 *(mvaBTagCollectionTag.
product()),
725 &*mvaL1L2L3ResCorrector);
728 mva = globalCache()->muonMvaEstimator()->computeMva(
729 muon, primaryVertex, *(mvaBTagCollectionTag.
product()), jetPtRatio, jetPtRel, miniIsoValue);
730 mva_lowpt = globalCache()->muonLowPtMvaEstimator()->computeMva(
731 muon, primaryVertex, *(mvaBTagCollectionTag.
product()), jetPtRatio, jetPtRel, miniIsoValue);
734 muon.setMvaValue(mva);
735 muon.setLowPtMvaValue(mva_lowpt);
736 muon.setJetPtRatio(jetPtRatio);
737 muon.setJetPtRel(jetPtRel);
742 miniIsoValue < 0.11 && (
muon.jetPtRatio() > 0.74 ||
muon.jetPtRel() > 6.8));
750 double sip3D = edB3D > 0 ? dB3D / edB3D : 0.0;
751 double dz = fabs(
muon.muonBestTrack()->dz(primaryVertex.
position()));
755 dB2D < 0.05 and dz < 0.1) {
762 if (
muon.pt() > 5 and
muon.isLooseMuon() and sip3D < 4 and dB2D < 0.5 and dz < 1) {
770 float mva = globalCache()->softMuonMvaEstimator()->computeMva(
muon);
771 muon.setSoftMvaValue(mva);
778 std::unique_ptr<std::vector<Muon>> ptr(patMuons);
823 for (
size_t i = 0,
n = genMatches.size();
i <
n; ++
i) {
834 for (
size_t j = 0, nd = deposits.size(); j < nd; ++j) {
838 }
else if (deposits[j]->
contains(muonRef.
id())) {
849 for (
size_t j = 0; j < isolationValues.size(); ++j) {
851 if (isolationValues[j]->
contains(baseRef.
id())) {
853 }
else if (isolationValues[j]->
contains(muonRef.
id())) {
893 double dR_threshold = 0.4;
894 double dR2_threshold = dR_threshold * dR_threshold;
895 double mix_fraction = 0.5;
897 double val_PuppiWithLep = 0.0;
898 double val_PuppiWithoutLep = 0.0;
900 for (
const auto&
cand : *pc) {
904 if (pType ==
OTHER) {
906 LogTrace(
"PATMuonProducer") <<
"candidate with PDGID = " <<
cand.pdgId()
907 <<
" is not CH/NH/PH/e/mu or 1/2 (and this is removed from isolation calculation)" 913 if (d_eta > dR_threshold)
917 if (d_phi > dR_threshold)
921 if (dR2 > dR2_threshold)
923 if (pType == CH && dR2 < 0.0001 * 0.0001)
925 if (pType == NH && dR2 < 0.01 * 0.01)
927 if (pType == PH && dR2 < 0.01 * 0.01)
929 val_PuppiWithLep +=
cand.pt() *
cand.puppiWeight();
930 val_PuppiWithoutLep +=
cand.pt() *
cand.puppiWeightNoLep();
934 double reliso_Puppi_withLep = val_PuppiWithLep / muon.
pt();
935 double reliso_Puppi_withoutlep = val_PuppiWithoutLep / muon.
pt();
936 double reliso_Puppi_combined = mix_fraction * reliso_Puppi_withLep + (1.0 - mix_fraction) * reliso_Puppi_withoutlep;
937 return reliso_Puppi_combined;
955 iDesc.
add<
bool>(
"embedMuonBestTrack",
true)->setComment(
"embed muon best track (global pflow)");
956 iDesc.
add<
bool>(
"embedTunePMuonBestTrack",
true)->setComment(
"embed muon best track (muon only)");
957 iDesc.
add<
bool>(
"forceBestTrackEmbedding",
true)
959 "force embedding separately the best tracks even if they're already embedded e.g. as tracker or global " 961 iDesc.
add<
bool>(
"embedTrack",
true)->setComment(
"embed external track");
962 iDesc.
add<
bool>(
"embedStandAloneMuon",
true)->setComment(
"embed external stand-alone muon");
963 iDesc.
add<
bool>(
"embedCombinedMuon",
false)->setComment(
"embed external combined muon");
964 iDesc.
add<
bool>(
"embedPickyMuon",
false)->setComment(
"embed external picky track");
965 iDesc.
add<
bool>(
"embedTpfmsMuon",
false)->setComment(
"embed external tpfms track");
966 iDesc.
add<
bool>(
"embedDytMuon",
false)->setComment(
"embed external dyt track ");
969 iDesc.
add<
bool>(
"embedCaloMETMuonCorrs",
true)->setComment(
"whether to add MET muon correction for caloMET or not");
971 ->setComment(
"source of MET muon corrections for caloMET");
972 iDesc.
add<
bool>(
"embedTcMETMuonCorrs",
true)->setComment(
"whether to add MET muon correction for tcMET or not");
974 ->setComment(
"source of MET muon corrections for tcMET");
978 iDesc.
add<
bool>(
"useParticleFlow",
false)->setComment(
"whether to use particle flow or not");
979 iDesc.
add<
bool>(
"embedPFCandidate",
false)->setComment(
"embed external particle flow object");
980 iDesc.
add<
bool>(
"embedPfEcalEnergy",
true)->setComment(
"add ecal energy as reconstructed by PF");
983 iDesc.
add<
bool>(
"addInverseBeta",
true)->setComment(
"add combined inverse beta");
985 ->setComment(
"source of inverse beta values");
988 iDesc.
add<
bool>(
"getdBFromTrack",
false)->setComment(
"switch IP2D computation to use the best track one");
991 iDesc.
add<
bool>(
"addGenMatch",
true)->setComment(
"add MC matching");
992 iDesc.
add<
bool>(
"embedGenMatch",
false)->setComment(
"embed MC matched MC information");
993 std::vector<edm::InputTag> emptySourceVector;
997 ->
setComment(
"input with MC match information");
1000 iDesc.
add<
bool>(
"computeMiniIso",
false)->setComment(
"whether or not to compute and store electron mini-isolation");
1001 iDesc.
add<
bool>(
"computePuppiCombinedIso",
false)
1002 ->setComment(
"whether or not to compute and store puppi combined isolation");
1005 ->setComment(
"collection to use to compute mini-iso");
1006 iDesc.
add<std::vector<double>>(
"miniIsoParams", std::vector<double>())
1007 ->
setComment(
"mini-iso parameters to use for muons");
1009 iDesc.
add<
bool>(
"addTriggerMatching",
false)->setComment(
"add L1 and HLT matching to offline muon");
1024 isoDepositsPSet.
addOptional<std::vector<edm::InputTag>>(
"user");
1025 iDesc.
addOptional(
"isoDeposits", isoDepositsPSet);
1038 iDesc.
addOptional(
"isolationValues", isolationValuesPSet);
1042 "puppiIsolationChargedHadrons",
1043 edm::InputTag(
"muonPUPPIIsolation",
"h+-DR030-ThresholdVeto000-ConeVeto000"),
1046 "puppiIsolationNeutralHadrons",
1047 edm::InputTag(
"muonPUPPIIsolation",
"h0-DR030-ThresholdVeto000-ConeVeto001"),
1050 "puppiIsolationPhotons",
1051 edm::InputTag(
"muonPUPPIIsolation",
"gamma-DR030-ThresholdVeto000-ConeVeto001"),
1054 "puppiNoLeptonsIsolationChargedHadrons",
1055 edm::InputTag(
"muonPUPPINoLeptonsIsolation",
"h+-DR030-ThresholdVeto000-ConeVeto000"),
1058 "puppiNoLeptonsIsolationNeutralHadrons",
1059 edm::InputTag(
"muonPUPPINoLeptonsIsolation",
"h0-DR030-ThresholdVeto000-ConeVeto001"),
1062 "puppiNoLeptonsIsolationPhotons",
1063 edm::InputTag(
"muonPUPPINoLeptonsIsolation",
"gamma-DR030-ThresholdVeto000-ConeVeto001"),
1070 iDesc.
add(
"efficiencies", efficienciesPSet);
1071 iDesc.
add<
bool>(
"addEfficiencies",
false);
1080 iDesc.
add(
"userIsolation", isolationPSet);
1082 iDesc.
add<
bool>(
"embedHighLevelSelection",
true)->setComment(
"embed high level selection");
1086 ->
setComment(
"input with high level selection");
1088 ->
setComment(
"input with high level selection");
1099 bool primaryVertexIsValid,
1101 bool beamspotIsValid) {
1103 std::pair<bool,Measurement1D>
result;
1117 d0_corr = result.second.value();
1118 d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
1124 d0_corr = result.second.value();
1125 d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
1137 d0_corr = result.second.value();
1138 d0_err = beamspotIsValid ? result.second.error() : -1.0;
1144 d0_corr = result.second.value();
1145 d0_err = beamspotIsValid ? result.second.error() : -1.0;
bool embedTpfmsMuon_
embed track from tpfms muon fit into the muon
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_charged_hadrons_
bool enabled() const
'true' if this there is at least one efficiency configured
bool useUserData_
add user data to the muon (this will be data members of th muon even w/o embedding) ...
void readIsolationLabels(const edm::ParameterSet &iConfig, const char *psetName, IsolationLabels &labels, std::vector< edm::EDGetTokenT< edm::ValueMap< T >>> &tokens)
constexpr double deltaPhi(double phi1, double phi2)
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_photons_
T getParameter(std::string const &) const
double ecalEnergy() const
return corrected Ecal energy
void setComment(std::string const &value)
Assists in assimilating all pat::UserData into pat objects.
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T >> cases)
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
bool addPuppiIsolation_
add puppi isolation
void embedDytMuon()
embed reference to the above dyt Track
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
bool isNonnull() const
Checks for non-null.
void embedTpfmsMuon()
embed reference to the above tpfms Track
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > tcMETMuonCorrsToken_
source of tcMET muon corrections
double eta() const final
momentum pseudorapidity
void setIsolation(IsolationKeys key, float value)
bool embedTcMETMuonCorrs_
embed muon MET correction info for tcMET into the muon
const PolarLorentzVector & polarP4() const final
four-momentum Lorentz vector
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
void embedTcMETMuonCorrs(const reco::MuonMETCorrectionData &t)
edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
input source of the primary vertex
bool contains(EventRange const &lh, EventID const &rh)
edm::EDGetTokenT< edm::ValueMap< reco::MuonTimeExtra > > muonTimeExtraToken_
input tag for reading inverse beta
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_photons_
void embedCombinedMuon()
set reference to Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon...
edm::EDGetTokenT< double > rho_
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
input source
void embedTunePMuonBestTrack(bool force=false)
bool addEfficiencies_
add efficiencies to the muon (this will be data members of th muon even w/o embedding) ...
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > caloMETMuonCorrsToken_
source of caloMET muon corrections
bool getByToken(EDGetToken token, Handle< PROD > &result) const
enum start value shifted to 81 so as to avoid clashes with PDG codes
void setAllowAnything()
allow any parameter label/value pairs
double zError() const
error on z
void setSimFlavour(int f)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
bool embedCaloMETMuonCorrs_
embed muon MET correction info for caloMET into the muon
bool isChargedHadron(long pdgid)
~PATMuonProducer() override
default destructur
edm::EDGetTokenT< edm::ValueMap< reco::MuonSimInfo > > simInfo_
MC info.
void embedMuonBestTrack(bool force=false)
std::vector< pat::PackedCandidate > PackedCandidateCollection
void setIsolationPUPPINoLeptons(float chargedhadrons, float neutralhadrons, float photons)
sets PUPPINoLeptons isolations
void setMuonMiniIso(pat::Muon &aMuon, const pat::PackedCandidateCollection *pc)
reco::TransientTrack build(const reco::Track *p) const
PATMuonProducer(const edm::ParameterSet &iConfig, PATMuonHeavyObjectCache const *)
default constructir
bool addTriggerMatching_
Trigger.
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
bool embedBestTrack_
embed the track from best muon measurement (global pflow)
edm::EDGetTokenT< reco::JetCorrector > mvaL1Corrector_
double pt() const final
transverse momentum
bool addResolutions_
add resolutions to the muon (this will be data members of th muon even w/o embedding) ...
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
void unpackPathNames(const edm::TriggerNames &names)
unpack trigger names into indices
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_charged_hadrons_
std::vector< double > miniIsoParams_
void setSimPhi(float phi)
PFCandidateCollection::const_iterator PFCandidateConstIterator
iterator
bool computePuppiCombinedIso_
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
void setSimProdRho(float rho)
void setSimHeaviestMotherFlavour(int id)
void setPFCandidateRef(const reco::PFCandidateRef &ref)
add a reference to the source IsolatedPFCandidate
const Point & position() const
position
void embedHighLevel(pat::Muon &aMuon, reco::TrackRef track, reco::TransientTrack &tt, reco::Vertex &primaryVertex, bool primaryVertexIsValid, reco::BeamSpot &beamspot, bool beamspotIsValid)
std::vector< double > effectiveAreaVec_
const std::string names[nVars_]
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_neutral_hadrons_
void setSimType(reco::MuonSimType type)
void embedStandAloneMuon()
set reference to Track reconstructed in the muon detector only (reimplemented from reco::Muon) ...
edm::EDGetTokenT< reco::JetTagCollection > mvaBTagCollectionTag_
edm::EDGetTokenT< reco::PFCandidateCollection > pfMuonToken_
input source pfCandidates that will be to be transformed into pat::Muons, when using PF2PAT ...
void setIsolationPUPPI(float chargedhadrons, float neutralhadrons, float photons)
sets PUPPI isolations
pat::helper::MultiIsolator isolator_
helper class to add userdefined isolation values to the muon
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
bool enabled() const
'true' if this there is at least one efficiency configured
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
void embedTrack()
set reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
static void fillDescription(edm::ParameterSetDescription &iDesc)
const PFIsolation & miniPFIsolation() const
edm::EDGetTokenT< reco::BeamSpot > beamLineToken_
input source of the primary vertex/beamspot
bool addInverseBeta_
add combined inverse beta measurement into the muon
bool useParticleFlow_
switch to use particle flow (PF2PAT) or not
pat::PATUserDataHelper< pat::Muon > userDataHelper_
helper class to add userData to the muon
bool enabled() const
True if it has a non null configuration.
std::vector< edm::Handle< edm::ValueMap< IsoDeposit > > > IsoDepositMaps
bool embedStandAloneMuon_
embed track from muon system into the muon
void setComment(std::string const &value)
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
#define DEFINE_FWK_MODULE(type)
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
GreaterByPt< Muon > pTComparator_
bool embedTrack_
embed the track from inner tracker into the muon
void setDB(double dB, double edB, IPTYPE type=PV2D)
bool addGenMatch_
add generator match information
PATMuonHeavyObjectCache(const edm::ParameterSet &)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
description of config file parameters
void fillL1TriggerInfo(pat::Muon &muon, edm::Handle< std::vector< pat::TriggerObjectStandAlone >> &triggerObjects, const edm::TriggerNames &names, const edm::ESHandle< GlobalTrackingGeometry > &geometry)
double muonRelMiniIsoPUCorrected(const PFIsolation &iso, const reco::Candidate::PolarLorentzVector &p4, double dr, double rho, const std::vector< double > &area)
bool isGlobalMuon() const override
bool embedPfEcalEnergy_
add ecal PF energy
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
void embedPFCandidate()
embed the IsolatedPFCandidate pointed to by pfCandidateRef_
bool getdBFromTrack_
switch on reading the dB information from the track
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
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
everything that needs to be done during the event loop
reco::PFCandidateRef pfCandidateRef() const
Abs< T >::type abs(const T &t)
edm::EDGetTokenT< pat::PackedCandidateCollection > pcToken_
static std::string const triggerResults
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double puppiCombinedIsolation(const pat::Muon &muon, const pat::PackedCandidateCollection *pc)
void readTimeExtra(const reco::MuonTimeExtra &t)
std::vector< std::string > hltCollectionFilters_
float miniIsoDr(const reco::Candidate::PolarLorentzVector &p4, float mindr, float maxdr, float kt_scale)
reco::MuonRef muonRef() const
void fillHltTriggerInfo(pat::Muon &muon, edm::Handle< std::vector< pat::TriggerObjectStandAlone >> &triggerObjects, const edm::TriggerNames &names, const std::vector< std::string > &collection_names)
reco::Muon::Selector makeSelectorBitset(reco::Muon const &muon, reco::Vertex const *vertex=0, bool run2016_hip_mitigation=false)
bool isAValidMuonTrack(const MuonTrackType &type) const
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
void addGenParticleRef(const reco::GenParticleRef &ref)
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 >
void setPfEcalEnergy(float pfEcalEnergy)
bool embedTunePBestTrack_
embed the track from best muon measurement (muon only)
T const * product() const
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
double getRelMiniIsoPUCorrected(const pat::Muon &muon, double rho, const std::vector< double > &area)
void setSimMotherPdgId(int id)
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
void addTriggerObjectMatch(const TriggerObjectStandAlone &trigObj)
add a trigger match
void setExtSimType(reco::ExtendedMuonSimType type)
std::vector< MuonChamberMatch > & matches()
get muon matching information
void setMiniPFIsolation(PFIsolation const &iso)
std::vector< edm::Handle< edm::Association< reco::GenParticleCollection > > > GenAssociations
edm::EDGetTokenT< reco::JetCorrector > mvaL1L2L3ResCorrector_
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
ESHandle< TrackerGeometry > geometry
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
void setSimProdZ(float z)
Particle reconstructed by the particle flow algorithm.
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
pat::helper::EfficiencyLoader efficiencyLoader_
helper class to add efficiencies to the muon
bool embedPickyMuon_
embed track from picky muon fit into the muon
void setNormChi2(double normChi2)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
bool embedDytMuon_
embed track from DYT muon fit into the muon
void embedCaloMETMuonCorrs(const reco::MuonMETCorrectionData &t)
const GeomDet * idToDet(DetId) const override
bool isPhoton(long pdgid)
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
isolation value pair for temporary storage before being folded into the muon
edm::EDGetTokenT< std::vector< pat::TriggerObjectStandAlone > > triggerObjects_
bool embedGenMatch_
embed the gen match information into the muon
const Point & position() const
position
IsolationLabels isoDepositLabels_
input source for isoDeposits
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
input tags for generator match information
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)
Covariance3DMatrix rotatedCovariance3D() const
IsolationLabels isolationValueLabels_
input source isolation value maps
bool recomputeBasicSelectors_
void embedPickyMuon()
embed reference to the above picky Track
bool forceEmbedBestTrack_
force separate embed of the best track even if already embedded
bool embedPFCandidate_
embed pfCandidates into the muon
double phi() const final
momentum azimuthal angle
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
void setNumberOfValidHits(unsigned int numberOfValidHits)
bool computeMuonMVA_
standard muon selectors
void setSimEta(float eta)
bool embedCombinedMuon_
embed track of the combined fit into the muon
Analysis-level muon class.
pat::helper::KinResolutionsLoader resolutionLoader_
helper class to add resolutions to the muon
static std::string const source
void setP4(const LorentzVector &p4) final
set 4-momentum
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_neutral_hadrons_
std::optional< GlobalPoint > getMuonDirection(const reco::MuonChamberMatch &chamberMatch, const edm::ESHandle< GlobalTrackingGeometry > &geometry, const DetId &chamberId)
bool isNeutralHadron(long pdgid)
Global3DVector GlobalVector
Analysis-level trigger object class (stand-alone)
void setSimMatchQuality(float quality)
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
void setSimTpEvent(int tpEvent)
bool embedHighLevelSelection_
embed high level selection variables