CMS 3D CMS Logo

PATMuonProducer.cc
Go to the documentation of this file.
1 
53 
54 namespace pat {
55 
57  public:
59 
62 
64 
65  private:
66  std::unique_ptr<const pat::MuonMvaEstimator> muonLowPtMvaEstimator_;
67  std::unique_ptr<const pat::MuonMvaEstimator> muonMvaEstimator_;
68  std::unique_ptr<const pat::SoftMuonMvaEstimator> softMuonMvaEstimator_;
69  };
70 
72  class TrackerIsolationPt;
73  class CaloIsolationEnergy;
74 
76  class PATMuonProducer : public edm::stream::EDProducer<edm::GlobalCache<PATMuonHeavyObjectCache>> {
77  public:
79  explicit PATMuonProducer(const edm::ParameterSet& iConfig, PATMuonHeavyObjectCache const*);
81  ~PATMuonProducer() override;
82 
83  static std::unique_ptr<PATMuonHeavyObjectCache> initializeGlobalCache(const edm::ParameterSet& iConfig) {
84  return std::make_unique<PATMuonHeavyObjectCache>(iConfig);
85  }
86 
88 
90  void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
92  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
93 
94  private:
97  typedef std::vector<edm::Handle<edm::Association<reco::GenParticleCollection>>> GenAssociations;
98  typedef std::vector<edm::Handle<edm::ValueMap<IsoDeposit>>> IsoDepositMaps;
99  typedef std::vector<edm::Handle<edm::ValueMap<double>>> IsolationValueMaps;
100  typedef std::pair<pat::IsolationKeys, edm::InputTag> IsolationLabel;
101  typedef std::vector<IsolationLabel> IsolationLabels;
102 
104  void fillMuon(Muon& aMuon,
105  const MuonBaseRef& muonRef,
106  const reco::CandidateBaseRef& baseRef,
107  const GenAssociations& genMatches,
108  const IsoDepositMaps& deposits,
109  const IsolationValueMaps& isolationValues) const;
112  template <typename T>
113  void readIsolationLabels(const edm::ParameterSet& iConfig,
114  const char* psetName,
117 
119  double getRelMiniIsoPUCorrected(const pat::Muon& muon, double rho, const std::vector<double>& area);
120 
122  bool isNeutralHadron(long pdgid);
123  bool isChargedHadron(long pdgid);
124  bool isPhoton(long pdgid);
125 
126  // embed various impact parameters with errors
127  // embed high level selection
128  void embedHighLevel(pat::Muon& aMuon,
132  bool primaryVertexIsValid,
134  bool beamspotIsValid);
135  double relMiniIsoPUCorrected(const pat::Muon& aMuon, double rho);
136  std::optional<GlobalPoint> getMuonDirection(const reco::MuonChamberMatch& chamberMatch,
138  const DetId& chamberId);
140  edm::Handle<std::vector<pat::TriggerObjectStandAlone>>& triggerObjects,
141  const edm::TriggerNames& names,
144  edm::Handle<std::vector<pat::TriggerObjectStandAlone>>& triggerObjects,
145  const edm::TriggerNames& names,
146  const std::vector<std::string>& collection_names);
147 
148  private:
151 
152  // for mini-iso calculation
156  std::vector<double> effectiveAreaVec_;
157  std::vector<double> miniIsoParams_;
159 
193  std::vector<edm::EDGetTokenT<edm::Association<reco::GenParticleCollection>>> genMatchTokens_;
214  std::vector<edm::EDGetTokenT<edm::ValueMap<IsoDeposit>>> isoDepositTokens_;
217  std::vector<edm::EDGetTokenT<edm::ValueMap<double>>> isolationValueTokens_;
226  //PUPPI isolation tokens
230  //PUPPINoLeptons isolation tokens
243 
253 
256 
261  std::vector<std::string> hltCollectionFilters_;
262 
265 
267  };
268 
269 } // namespace pat
270 
271 template <typename T>
273  const char* psetName,
276  labels.clear();
277 
278  if (iConfig.exists(psetName)) {
279  edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>(psetName);
280 
281  if (depconf.exists("tracker"))
282  labels.emplace_back(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker"));
283  if (depconf.exists("ecal"))
284  labels.emplace_back(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal"));
285  if (depconf.exists("hcal"))
286  labels.emplace_back(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal"));
287  if (depconf.exists("pfAllParticles")) {
288  labels.emplace_back(pat::PfAllParticleIso, depconf.getParameter<edm::InputTag>("pfAllParticles"));
289  }
290  if (depconf.exists("pfChargedHadrons")) {
291  labels.emplace_back(pat::PfChargedHadronIso, depconf.getParameter<edm::InputTag>("pfChargedHadrons"));
292  }
293  if (depconf.exists("pfChargedAll")) {
294  labels.emplace_back(pat::PfChargedAllIso, depconf.getParameter<edm::InputTag>("pfChargedAll"));
295  }
296  if (depconf.exists("pfPUChargedHadrons")) {
297  labels.emplace_back(pat::PfPUChargedHadronIso, depconf.getParameter<edm::InputTag>("pfPUChargedHadrons"));
298  }
299  if (depconf.exists("pfNeutralHadrons")) {
300  labels.emplace_back(pat::PfNeutralHadronIso, depconf.getParameter<edm::InputTag>("pfNeutralHadrons"));
301  }
302  if (depconf.exists("pfPhotons")) {
303  labels.emplace_back(pat::PfGammaIso, depconf.getParameter<edm::InputTag>("pfPhotons"));
304  }
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) {
310  labels.push_back(std::make_pair(pat::IsolationKeys(key), *it));
311  }
312  tokens = edm::vector_transform(
313  labels, [this](IsolationLabel const& label) { return consumes<edm::ValueMap<T>>(label.second); });
314  }
315  }
317  return consumes<edm::ValueMap<T>>(label.second);
318  });
319 }
320 
321 using namespace pat;
322 using namespace std;
323 
325  if (iConfig.getParameter<bool>("computeMuonMVA")) {
326  edm::FileInPath mvaTrainingFile = iConfig.getParameter<edm::FileInPath>("mvaTrainingFile");
327  edm::FileInPath mvaLowPtTrainingFile = iConfig.getParameter<edm::FileInPath>("lowPtmvaTrainingFile");
328  float mvaDrMax = iConfig.getParameter<double>("mvaDrMax");
329  muonMvaEstimator_ = std::make_unique<MuonMvaEstimator>(mvaTrainingFile, mvaDrMax);
330  muonLowPtMvaEstimator_ = std::make_unique<MuonMvaEstimator>(mvaLowPtTrainingFile, mvaDrMax);
331  }
332 
333  if (iConfig.getParameter<bool>("computeSoftMuonMVA")) {
334  edm::FileInPath softMvaTrainingFile = iConfig.getParameter<edm::FileInPath>("softMvaTrainingFile");
335  softMuonMvaEstimator_ = std::make_unique<SoftMuonMvaEstimator>(softMvaTrainingFile);
336  }
337 }
338 
340  : relMiniIsoPUCorrected_(0),
341  useUserData_(iConfig.exists("userData")),
342  computeMuonMVA_(false),
343  computeSoftMuonMVA_(false),
344  recomputeBasicSelectors_(false),
345  mvaUseJec_(false),
346  isolator_(iConfig.exists("userIsolation") ? iConfig.getParameter<edm::ParameterSet>("userIsolation")
347  : edm::ParameterSet(),
348  consumesCollector(),
349  false),
350  geometryToken_{esConsumes()},
351  transientTrackBuilderToken_{esConsumes(edm::ESInputTag("", "TransientTrackBuilder"))},
352  patMuonPutToken_{produces<std::vector<Muon>>()} {
353  // input source
354  muonToken_ = consumes<edm::View<reco::Muon>>(iConfig.getParameter<edm::InputTag>("muonSource"));
355  // embedding of tracks
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");
362  // embedding of muon MET correction information
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"));
369  // pflow specific configurables
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");
374  // embedding of tracks from TeV refit
375  embedPickyMuon_ = iConfig.getParameter<bool>("embedPickyMuon");
376  embedTpfmsMuon_ = iConfig.getParameter<bool>("embedTpfmsMuon");
377  embedDytMuon_ = iConfig.getParameter<bool>("embedDytMuon");
378  // embedding of inverse beta variable information
379  addInverseBeta_ = iConfig.getParameter<bool>("addInverseBeta");
380  if (addInverseBeta_) {
381  muonTimeExtraToken_ =
382  consumes<edm::ValueMap<reco::MuonTimeExtra>>(iConfig.getParameter<edm::InputTag>("sourceMuonTimeExtra"));
383  }
384  // Monte Carlo matching
385  addGenMatch_ = iConfig.getParameter<bool>("addGenMatch");
386  if (addGenMatch_) {
387  embedGenMatch_ = iConfig.getParameter<bool>("embedGenMatch");
388  if (iConfig.existsAs<edm::InputTag>("genParticleMatch")) {
389  genMatchTokens_.push_back(consumes<edm::Association<reco::GenParticleCollection>>(
390  iConfig.getParameter<edm::InputTag>("genParticleMatch")));
391  } else {
392  genMatchTokens_ = edm::vector_transform(
393  iConfig.getParameter<std::vector<edm::InputTag>>("genParticleMatch"),
394  [this](edm::InputTag const& tag) { return consumes<edm::Association<reco::GenParticleCollection>>(tag); });
395  }
396  }
397  // efficiencies
398  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
399  if (addEfficiencies_) {
400  efficiencyLoader_ =
401  pat::helper::EfficiencyLoader(iConfig.getParameter<edm::ParameterSet>("efficiencies"), consumesCollector());
402  }
403  // resolutions
404  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
405  if (addResolutions_) {
406  resolutionLoader_ = pat::helper::KinResolutionsLoader(iConfig.getParameter<edm::ParameterSet>("resolutions"));
407  }
408  // puppi
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"));
417  //puppiNoLeptons
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"));
424  }
425  // read isoDeposit labels, for direct embedding
426  readIsolationLabels(iConfig, "isoDeposits", isoDepositLabels_, isoDepositTokens_);
427  // read isolation value labels, for direct embedding
428  readIsolationLabels(iConfig, "isolationValues", isolationValueLabels_, isolationValueTokens_);
429  // check to see if the user wants to add user data
430  if (useUserData_) {
431  userDataHelper_ = PATUserDataHelper<Muon>(iConfig.getParameter<edm::ParameterSet>("userData"), consumesCollector());
432  }
433  // embed high level selection variables
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"));
438  }
439 
440  //for mini-isolation calculation
441  computeMiniIso_ = iConfig.getParameter<bool>("computeMiniIso");
442 
443  computePuppiCombinedIso_ = iConfig.getParameter<bool>("computePuppiCombinedIso");
444 
445  effectiveAreaVec_ = iConfig.getParameter<std::vector<double>>("effectiveAreaVec");
446 
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";
450  }
451  if (computeMiniIso_ || computePuppiCombinedIso_)
452  pcToken_ = consumes<pat::PackedCandidateCollection>(iConfig.getParameter<edm::InputTag>("pfCandsForMiniIso"));
453 
454  // standard selectors
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";
459 
460  if (computeMuonMVA_) {
461  // pfCombinedInclusiveSecondaryVertexV2BJetTags
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");
467  }
468 
469  computeSoftMuonMVA_ = iConfig.getParameter<bool>("computeSoftMuonMVA");
470 
471  // MC info
472  simInfo_ = consumes<edm::ValueMap<reco::MuonSimInfo>>(iConfig.getParameter<edm::InputTag>("muonSimInfo"));
473 
474  addTriggerMatching_ = iConfig.getParameter<bool>("addTriggerMatching");
475  if (addTriggerMatching_) {
476  triggerObjects_ =
477  consumes<std::vector<pat::TriggerObjectStandAlone>>(iConfig.getParameter<edm::InputTag>("triggerObjects"));
478  triggerResults_ = consumes<edm::TriggerResults>(iConfig.getParameter<edm::InputTag>("triggerResults"));
479  }
480  hltCollectionFilters_ = iConfig.getParameter<std::vector<std::string>>("hltCollectionFilters");
481 }
482 
484 
485 std::optional<GlobalPoint> PATMuonProducer::getMuonDirection(const reco::MuonChamberMatch& chamberMatch,
487  const DetId& chamberId) {
488  const GeomDet* chamberGeometry = geometry->idToDet(chamberId);
489  if (chamberGeometry) {
490  LocalPoint localPosition(chamberMatch.x, chamberMatch.y, 0);
491  return std::optional<GlobalPoint>(std::in_place, chamberGeometry->toGlobal(localPosition));
492  }
493  return std::optional<GlobalPoint>();
494 }
495 
497  edm::Handle<std::vector<pat::TriggerObjectStandAlone>>& triggerObjects,
498  const edm::TriggerNames& names,
500  // L1 trigger object parameters are defined at MB2/ME2. Use the muon
501  // chamber matching information to get the local direction of the
502  // muon trajectory and convert it to a global direction to match the
503  // trigger objects
504 
505  std::optional<GlobalPoint> muonPosition;
506  // Loop over chambers
507  // initialize muonPosition with any available match, just in case
508  // the second station is missing - it's better folling back to
509  // dR matching at IP
510  for (const auto& chamberMatch : aMuon.matches()) {
511  if (chamberMatch.id.subdetId() == MuonSubdetId::DT) {
512  DTChamberId detId(chamberMatch.id.rawId());
513  if (abs(detId.station()) > 3)
514  continue;
515  muonPosition = getMuonDirection(chamberMatch, geometry, detId);
516  if (abs(detId.station()) == 2)
517  break;
518  }
519  if (chamberMatch.id.subdetId() == MuonSubdetId::CSC) {
520  CSCDetId detId(chamberMatch.id.rawId());
521  if (abs(detId.station()) > 3)
522  continue;
523  muonPosition = getMuonDirection(chamberMatch, geometry, detId);
524  if (abs(detId.station()) == 2)
525  break;
526  }
527  }
528  if (not muonPosition)
529  return;
530  for (const auto& triggerObject : *triggerObjects) {
531  if (triggerObject.hasTriggerObjectType(trigger::TriggerL1Mu)) {
532  if (std::abs(triggerObject.eta()) < 0.001) {
533  // L1 is defined in X-Y plain
534  if (deltaPhi(triggerObject.phi(), muonPosition->phi()) > 0.1)
535  continue;
536  } else {
537  // 3D L1
538  if (deltaR(triggerObject.p4(), *muonPosition) > 0.15)
539  continue;
540  }
541  pat::TriggerObjectStandAlone obj(triggerObject);
542  obj.unpackPathNames(names);
543  aMuon.addTriggerObjectMatch(obj);
544  }
545  }
546 }
547 
549  edm::Handle<std::vector<pat::TriggerObjectStandAlone>>& triggerObjects,
550  const edm::TriggerNames& names,
551  const std::vector<std::string>& collection_filter_names) {
552  // WARNING: in a case of close-by muons the dR matching may select both muons.
553  // It's better to select the best match for a given collection.
554  for (const auto& triggerObject : *triggerObjects) {
555  if (triggerObject.hasTriggerObjectType(trigger::TriggerMuon)) {
556  bool keepIt = false;
557  for (const auto& name : collection_filter_names) {
558  if (triggerObject.hasCollection(name)) {
559  keepIt = true;
560  break;
561  }
562  }
563  if (not keepIt)
564  continue;
565  if (deltaR(triggerObject.p4(), muon) > 0.1)
566  continue;
567  pat::TriggerObjectStandAlone obj(triggerObject);
568  obj.unpackPathNames(names);
569  muon.addTriggerObjectMatch(obj);
570  }
571  }
572 }
573 
575  // get the tracking Geometry
576  auto geometry = iSetup.getHandle(geometryToken_);
577  if (!geometry.isValid())
578  throw cms::Exception("FatalError") << "Unable to find GlobalTrackingGeometryRecord in event!\n";
579 
580  // switch off embedding (in unschedules mode)
581  if (iEvent.isRealData()) {
582  addGenMatch_ = false;
583  embedGenMatch_ = false;
584  }
585 
587  iEvent.getByToken(muonToken_, muons);
588 
591  iEvent.getByToken(pcToken_, pc);
592 
593  // get the ESHandle for the transient track builder,
594  // if needed for high level selection embedding
595  TransientTrackBuilder const* trackBuilder = nullptr;
596 
597  if (isolator_.enabled())
598  isolator_.beginEvent(iEvent, iSetup);
603 
605  for (size_t j = 0; j < isoDepositTokens_.size(); ++j) {
606  iEvent.getByToken(isoDepositTokens_[j], deposits[j]);
607  }
608 
610  for (size_t j = 0; j < isolationValueTokens_.size(); ++j) {
612  }
613 
614  //value maps for puppi isolation
615  edm::Handle<edm::ValueMap<float>> PUPPIIsolation_charged_hadrons;
616  edm::Handle<edm::ValueMap<float>> PUPPIIsolation_neutral_hadrons;
617  edm::Handle<edm::ValueMap<float>> PUPPIIsolation_photons;
618  //value maps for puppiNoLeptons isolation
619  edm::Handle<edm::ValueMap<float>> PUPPINoLeptonsIsolation_charged_hadrons;
620  edm::Handle<edm::ValueMap<float>> PUPPINoLeptonsIsolation_neutral_hadrons;
621  edm::Handle<edm::ValueMap<float>> PUPPINoLeptonsIsolation_photons;
622  if (addPuppiIsolation_) {
623  //puppi
624  iEvent.getByToken(PUPPIIsolation_charged_hadrons_, PUPPIIsolation_charged_hadrons);
625  iEvent.getByToken(PUPPIIsolation_neutral_hadrons_, PUPPIIsolation_neutral_hadrons);
626  iEvent.getByToken(PUPPIIsolation_photons_, PUPPIIsolation_photons);
627  //puppiNoLeptons
628  iEvent.getByToken(PUPPINoLeptonsIsolation_charged_hadrons_, PUPPINoLeptonsIsolation_charged_hadrons);
629  iEvent.getByToken(PUPPINoLeptonsIsolation_neutral_hadrons_, PUPPINoLeptonsIsolation_neutral_hadrons);
630  iEvent.getByToken(PUPPINoLeptonsIsolation_photons_, PUPPINoLeptonsIsolation_photons);
631  }
632 
633  // inputs for muon mva
634  edm::Handle<reco::JetTagCollection> mvaBTagCollectionTag;
637  if (computeMuonMVA_) {
638  iEvent.getByToken(mvaBTagCollectionTag_, mvaBTagCollectionTag);
641  }
642 
643  // prepare the MC genMatchTokens_
644  GenAssociations genMatches(genMatchTokens_.size());
645  if (addGenMatch_) {
646  for (size_t j = 0, nd = genMatchTokens_.size(); j < nd; ++j) {
647  iEvent.getByToken(genMatchTokens_[j], genMatches[j]);
648  }
649  }
650 
651  // prepare the high level selection: needs beamline
652  // OR primary vertex, depending on user selection
655  bool beamSpotIsValid = false;
656  bool primaryVertexIsValid = false;
658  // get the beamspot
659  edm::Handle<reco::BeamSpot> beamSpotHandle;
660  iEvent.getByToken(beamLineToken_, beamSpotHandle);
661 
662  // get the primary vertex
664  iEvent.getByToken(pvToken_, pvHandle);
665 
666  if (beamSpotHandle.isValid()) {
667  beamSpot = *beamSpotHandle;
668  beamSpotIsValid = true;
669  } else {
670  edm::LogError("DataNotAvailable") << "No beam spot available from EventSetup, not adding high level selection \n";
671  }
672  if (pvHandle.isValid() && !pvHandle->empty()) {
673  primaryVertex = pvHandle->at(0);
674  primaryVertexIsValid = true;
675  } else {
676  edm::LogError("DataNotAvailable")
677  << "No primary vertex available from EventSetup, not adding high level selection \n";
678  }
679  // this is needed by the IPTools methods from the tracking group
680  trackBuilder = &iSetup.getData(transientTrackBuilderToken_);
681  }
682 
683  // MC info
685  bool simInfoIsAvailalbe = iEvent.getByToken(simInfo_, simInfo);
686 
687  // this will be the new object collection
688  std::vector<Muon> patMuons;
689 
691  if (useParticleFlow_) {
692  // get the PFCandidates of type muons
693  iEvent.getByToken(pfMuonToken_, pfMuons);
694 
695  unsigned index = 0;
696  for (reco::PFCandidateConstIterator i = pfMuons->begin(); i != pfMuons->end(); ++i, ++index) {
697  const reco::PFCandidate& pfmu = *i;
698  //const reco::IsolaPFCandidate& pfmu = *i;
699  const reco::MuonRef& muonRef = pfmu.muonRef();
700  assert(muonRef.isNonnull());
701 
702  MuonBaseRef muonBaseRef(muonRef);
703  Muon aMuon(muonBaseRef);
704 
705  if (useUserData_) {
706  userDataHelper_.add(aMuon, iEvent, iSetup);
707  }
708 
709  // embed high level selection
711  // get the tracks
712  reco::TrackRef innerTrack = muonBaseRef->innerTrack();
713  reco::TrackRef globalTrack = muonBaseRef->globalTrack();
714  reco::TrackRef bestTrack = muonBaseRef->muonBestTrack();
715  reco::TrackRef chosenTrack = innerTrack;
716  // Make sure the collection it points to is there
717  if (bestTrack.isNonnull() && bestTrack.isAvailable())
718  chosenTrack = bestTrack;
719 
720  if (chosenTrack.isNonnull() && chosenTrack.isAvailable()) {
721  unsigned int nhits = chosenTrack->numberOfValidHits(); // ????
723 
724  reco::TransientTrack tt = trackBuilder->build(chosenTrack);
725  embedHighLevel(aMuon, chosenTrack, tt, primaryVertex, primaryVertexIsValid, beamSpot, beamSpotIsValid);
726  }
727 
728  if (globalTrack.isNonnull() && globalTrack.isAvailable() && !embedCombinedMuon_) {
729  double norm_chi2 = globalTrack->chi2() / globalTrack->ndof();
730  aMuon.setNormChi2(norm_chi2);
731  }
732  }
733  reco::PFCandidateRef pfRef(pfMuons, index);
734  //reco::PFCandidatePtr ptrToMother(pfMuons,index);
735  reco::CandidateBaseRef pfBaseRef(pfRef);
736 
737  aMuon.setPFCandidateRef(pfRef);
738  if (embedPFCandidate_)
739  aMuon.embedPFCandidate();
740  fillMuon(aMuon, muonBaseRef, pfBaseRef, genMatches, deposits, isolationValues);
741 
742  if (computeMiniIso_)
743  setMuonMiniIso(aMuon, pc.product());
744 
745  if (addPuppiIsolation_) {
746  aMuon.setIsolationPUPPI((*PUPPIIsolation_charged_hadrons)[muonBaseRef],
747  (*PUPPIIsolation_neutral_hadrons)[muonBaseRef],
748  (*PUPPIIsolation_photons)[muonBaseRef]);
749 
750  aMuon.setIsolationPUPPINoLeptons((*PUPPINoLeptonsIsolation_charged_hadrons)[muonBaseRef],
751  (*PUPPINoLeptonsIsolation_neutral_hadrons)[muonBaseRef],
752  (*PUPPINoLeptonsIsolation_photons)[muonBaseRef]);
753  } else {
754  aMuon.setIsolationPUPPI(-999., -999., -999.);
755  aMuon.setIsolationPUPPINoLeptons(-999., -999., -999.);
756  }
757 
758  if (embedPfEcalEnergy_) {
759  aMuon.setPfEcalEnergy(pfmu.ecalEnergy());
760  }
761 
762  patMuons.push_back(aMuon);
763  }
764  } else {
766  iEvent.getByToken(muonToken_, muons);
767 
768  // embedding of muon MET corrections
770  //edm::ValueMap<reco::MuonMETCorrectionData> caloMETmuCorValueMap;
773  //caloMETmuCorValueMap = *caloMETmuCorValueMap_h;
774  }
776  //edm::ValueMap<reco::MuonMETCorrectionData> tcMETmuCorValueMap;
777  if (embedTcMETMuonCorrs_) {
779  //tcMETmuCorValueMap = *tcMETmuCorValueMap_h;
780  }
781 
783  // get the PFCandidates of type muons
784  iEvent.getByToken(pfMuonToken_, pfMuons);
785  }
786 
788  if (addInverseBeta_) {
789  // get MuonTimerExtra value map
790  iEvent.getByToken(muonTimeExtraToken_, muonsTimeExtra);
791  }
792 
793  for (edm::View<reco::Muon>::const_iterator itMuon = muons->begin(); itMuon != muons->end(); ++itMuon) {
794  // construct the Muon from the ref -> save ref to original object
795  unsigned int idx = itMuon - muons->begin();
796  MuonBaseRef muonRef = muons->refAt(idx);
797  reco::CandidateBaseRef muonBaseRef(muonRef);
798 
799  Muon aMuon(muonRef);
800  fillMuon(aMuon, muonRef, muonBaseRef, genMatches, deposits, isolationValues);
801  if (computeMiniIso_)
802  setMuonMiniIso(aMuon, pc.product());
803  if (addPuppiIsolation_) {
804  aMuon.setIsolationPUPPI((*PUPPIIsolation_charged_hadrons)[muonRef],
805  (*PUPPIIsolation_neutral_hadrons)[muonRef],
806  (*PUPPIIsolation_photons)[muonRef]);
807  aMuon.setIsolationPUPPINoLeptons((*PUPPINoLeptonsIsolation_charged_hadrons)[muonRef],
808  (*PUPPINoLeptonsIsolation_neutral_hadrons)[muonRef],
809  (*PUPPINoLeptonsIsolation_photons)[muonRef]);
810  } else {
811  aMuon.setIsolationPUPPI(-999., -999., -999.);
812  aMuon.setIsolationPUPPINoLeptons(-999., -999., -999.);
813  }
814 
815  // Isolation
816  if (isolator_.enabled()) {
817  //reco::CandidatePtr mother = ptrToMother->sourceCandidatePtr(0);
819  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
820  // better to loop backwards, so the vector is resized less times
821  for (IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(),
822  ed = isolatorTmpStorage_.rend();
823  it != ed;
824  ++it) {
825  aMuon.setIsolation(it->first, it->second);
826  }
827  }
828 
829  // for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
830  // aMuon.setIsoDeposit(isoDepositLabels_[j].first,
831  // (*deposits[j])[muonRef]);
832  // }
833 
834  // add sel to selected
835  edm::Ptr<reco::Muon> muonsPtr = muons->ptrAt(idx);
836  if (useUserData_) {
837  userDataHelper_.add(aMuon, iEvent, iSetup);
838  }
839 
840  // embed high level selection
842  // get the tracks
843  reco::TrackRef innerTrack = itMuon->innerTrack();
844  reco::TrackRef globalTrack = itMuon->globalTrack();
845  reco::TrackRef bestTrack = itMuon->muonBestTrack();
846  reco::TrackRef chosenTrack = innerTrack;
847  // Make sure the collection it points to is there
848  if (bestTrack.isNonnull() && bestTrack.isAvailable())
849  chosenTrack = bestTrack;
850  if (chosenTrack.isNonnull() && chosenTrack.isAvailable()) {
851  unsigned int nhits = chosenTrack->numberOfValidHits(); // ????
853 
854  reco::TransientTrack tt = trackBuilder->build(chosenTrack);
855  embedHighLevel(aMuon, chosenTrack, tt, primaryVertex, primaryVertexIsValid, beamSpot, beamSpotIsValid);
856  }
857 
858  if (globalTrack.isNonnull() && globalTrack.isAvailable()) {
859  double norm_chi2 = globalTrack->chi2() / globalTrack->ndof();
860  aMuon.setNormChi2(norm_chi2);
861  }
862  }
863 
864  // embed MET muon corrections
866  aMuon.embedCaloMETMuonCorrs((*caloMETMuonCorrs)[muonRef]);
868  aMuon.embedTcMETMuonCorrs((*tcMETMuonCorrs)[muonRef]);
869 
871  if (embedPfEcalEnergy_)
872  aMuon.setPfEcalEnergy(-99.0);
873  unsigned index = 0;
874  for (const reco::PFCandidate& pfmu : *pfMuons) {
875  if (pfmu.muonRef().isNonnull()) {
876  if (pfmu.muonRef().id() != muonRef.id())
877  throw cms::Exception("Configuration")
878  << "Muon reference within PF candidates does not point to the muon collection." << std::endl;
879  if (pfmu.muonRef().key() == muonRef.key()) {
880  reco::PFCandidateRef pfRef(pfMuons, index);
881  aMuon.setPFCandidateRef(pfRef);
882  if (embedPfEcalEnergy_)
883  aMuon.setPfEcalEnergy(pfmu.ecalEnergy());
884  if (embedPFCandidate_)
885  aMuon.embedPFCandidate();
886  break;
887  }
888  }
889  index++;
890  }
891  }
892 
893  if (addInverseBeta_) {
894  aMuon.readTimeExtra((*muonsTimeExtra)[muonRef]);
895  }
896  // MC info
897  aMuon.initSimInfo();
898  if (simInfoIsAvailalbe) {
899  const auto& msi = (*simInfo)[muonBaseRef];
900  aMuon.setSimType(msi.primaryClass);
901  aMuon.setExtSimType(msi.extendedClass);
902  aMuon.setSimFlavour(msi.flavour);
903  aMuon.setSimHeaviestMotherFlavour(msi.heaviestMotherFlavour);
904  aMuon.setSimPdgId(msi.pdgId);
905  aMuon.setSimMotherPdgId(msi.motherPdgId);
906  aMuon.setSimBX(msi.tpBX);
907  aMuon.setSimTpEvent(msi.tpEvent);
908  aMuon.setSimProdRho(msi.vertex.Rho());
909  aMuon.setSimProdZ(msi.vertex.Z());
910  aMuon.setSimPt(msi.p4.pt());
911  aMuon.setSimEta(msi.p4.eta());
912  aMuon.setSimPhi(msi.p4.phi());
913  aMuon.setSimMatchQuality(msi.tpAssoQuality);
914  }
915  patMuons.push_back(aMuon);
916  }
917  }
918 
919  // sort muons in pt
920  std::sort(patMuons.begin(), patMuons.end(), [](auto const& t1, auto const& t2) { return t1.pt() > t2.pt(); });
921 
922  // Store standard muon selection decisions and jet related
923  // quantaties.
924  // Need a separate loop over muons to have all inputs properly
925  // computed and stored in the object.
927  if (computeMuonMVA_)
928  iEvent.getByToken(rho_, rho);
929  const reco::Vertex* pv(nullptr);
930  if (primaryVertexIsValid)
931  pv = &primaryVertex;
932 
935  bool triggerObjectsAvailable = false;
936  bool triggerResultsAvailable = false;
937  if (addTriggerMatching_) {
938  triggerObjectsAvailable = iEvent.getByToken(triggerObjects_, triggerObjects);
939  triggerResultsAvailable = iEvent.getByToken(triggerResults_, triggerResults);
940  }
941 
942  for (auto& muon : patMuons) {
943  // trigger info
944  if (addTriggerMatching_ and triggerObjectsAvailable and triggerResultsAvailable) {
945  const edm::TriggerNames& triggerNames(iEvent.triggerNames(*triggerResults));
948  }
949 
951  muon.setSelectors(0);
952  bool isRun2016BCDEF = (272728 <= iEvent.run() && iEvent.run() <= 278808);
953  muon.setSelectors(muon::makeSelectorBitset(muon, pv, isRun2016BCDEF));
954  }
955  float miniIsoValue = -1;
956  if (computeMiniIso_) {
957  // MiniIsolation working points
958 
959  miniIsoValue = getRelMiniIsoPUCorrected(muon, *rho, effectiveAreaVec_);
960 
961  muon.setSelector(reco::Muon::MiniIsoLoose, miniIsoValue < 0.40);
962  muon.setSelector(reco::Muon::MiniIsoMedium, miniIsoValue < 0.20);
963  muon.setSelector(reco::Muon::MiniIsoTight, miniIsoValue < 0.10);
964  muon.setSelector(reco::Muon::MiniIsoVeryTight, miniIsoValue < 0.05);
965  }
966 
967  double puppiCombinedIsolationPAT = -1;
969  puppiCombinedIsolationPAT = puppiCombinedIsolation(muon, pc.product());
970  muon.setSelector(reco::Muon::PuppiIsoLoose, puppiCombinedIsolationPAT < 0.27);
971  muon.setSelector(reco::Muon::PuppiIsoMedium, puppiCombinedIsolationPAT < 0.22);
972  muon.setSelector(reco::Muon::PuppiIsoTight, puppiCombinedIsolationPAT < 0.12);
973  }
974 
975  float jetPtRatio = 0.0;
976  float jetPtRel = 0.0;
977  float mva = 0.0;
978  float mva_lowpt = 0.0;
979  if (computeMuonMVA_ && primaryVertexIsValid && computeMiniIso_) {
980  if (mvaUseJec_) {
981  mva = globalCache()->muonMvaEstimator().computeMva(muon,
983  *(mvaBTagCollectionTag.product()),
984  jetPtRatio,
985  jetPtRel,
986  miniIsoValue,
987  mvaL1Corrector.product(),
988  mvaL1L2L3ResCorrector.product());
989  mva_lowpt = globalCache()->muonLowPtMvaEstimator().computeMva(muon,
991  *(mvaBTagCollectionTag.product()),
992  jetPtRatio,
993  jetPtRel,
994  miniIsoValue,
995  mvaL1Corrector.product(),
996  mvaL1L2L3ResCorrector.product());
997 
998  } else {
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);
1003  }
1004 
1005  muon.setMvaValue(mva);
1006  muon.setLowPtMvaValue(mva_lowpt);
1007  muon.setJetPtRatio(jetPtRatio);
1008  muon.setJetPtRel(jetPtRel);
1009 
1010  // multi-isolation
1011  if (computeMiniIso_) {
1012  muon.setSelector(reco::Muon::MultiIsoMedium,
1013  miniIsoValue < 0.11 && (muon.jetPtRatio() > 0.74 || muon.jetPtRel() > 6.8));
1014  }
1015 
1016  // MVA working points
1017  // https://twiki.cern.ch/twiki/bin/viewauth/CMS/LeptonMVA
1018  const double dB2D = std::abs(muon.dB(pat::Muon::PV2D));
1019  const double dB3D = std::abs(muon.dB(pat::Muon::PV3D));
1020  const double edB3D = std::abs(muon.edB(pat::Muon::PV3D));
1021  const double sip3D = edB3D > 0 ? dB3D / edB3D : 0.0;
1022  const double dz = std::abs(muon.muonBestTrack()->dz(primaryVertex.position()));
1023 
1024  // muon preselection
1025  if (muon.pt() > 5 and muon.isLooseMuon() and muon.passed(reco::Muon::MiniIsoLoose) and sip3D < 8.0 and
1026  dB2D < 0.05 and dz < 0.1) {
1027  muon.setSelector(reco::Muon::MvaLoose, muon.mvaValue() > -0.60);
1028  muon.setSelector(reco::Muon::MvaMedium, muon.mvaValue() > -0.20);
1029  muon.setSelector(reco::Muon::MvaTight, muon.mvaValue() > 0.15);
1030  muon.setSelector(reco::Muon::MvaVTight, muon.mvaValue() > 0.45);
1031  muon.setSelector(reco::Muon::MvaVVTight, muon.mvaValue() > 0.9);
1032  }
1033  if (muon.pt() > 5 and muon.isLooseMuon() and sip3D < 4 and dB2D < 0.5 and dz < 1) {
1034  muon.setSelector(reco::Muon::LowPtMvaLoose, muon.lowptMvaValue() > -0.60);
1035  muon.setSelector(reco::Muon::LowPtMvaMedium, muon.lowptMvaValue() > -0.20);
1036  }
1037  }
1038 
1039  //SOFT MVA
1040  if (computeSoftMuonMVA_) {
1041  float mva = globalCache()->softMuonMvaEstimator().computeMva(muon);
1042  muon.setSoftMvaValue(mva);
1043  //preselection in SoftMuonMvaEstimator.cc
1044  muon.setSelector(reco::Muon::SoftMvaId, muon.softMvaValue() > 0.58); //WP choose for bmm4
1045  }
1046  }
1047 
1048  // put products in Event
1050 
1051  if (isolator_.enabled())
1052  isolator_.endEvent();
1053 }
1054 
1056  const MuonBaseRef& muonRef,
1057  const reco::CandidateBaseRef& baseRef,
1058  const GenAssociations& genMatches,
1059  const IsoDepositMaps& deposits,
1060  const IsolationValueMaps& isolationValues) const {
1061  // in the particle flow algorithm,
1062  // the muon momentum is recomputed.
1063  // the new value is stored as the momentum of the
1064  // resulting PFCandidate of type Muon, and choosen
1065  // as the pat::Muon momentum
1066  if (useParticleFlow_)
1067  aMuon.setP4(aMuon.pfCandidateRef()->p4());
1068  if (embedTrack_)
1069  aMuon.embedTrack();
1071  aMuon.embedStandAloneMuon();
1072  if (embedCombinedMuon_)
1073  aMuon.embedCombinedMuon();
1074 
1075  // embed the TeV refit track refs (only available for globalMuons)
1076  if (aMuon.isGlobalMuon()) {
1078  aMuon.embedPickyMuon();
1080  aMuon.embedTpfmsMuon();
1082  aMuon.embedDytMuon();
1083  }
1084 
1085  // embed best tracks (at the end, so unless forceEmbedBestTrack_ is true we can save some space not embedding them twice)
1086  if (embedBestTrack_)
1090 
1091  // store the match to the generated final state muons
1092  if (addGenMatch_) {
1093  for (auto const& genMatch : genMatches) {
1094  reco::GenParticleRef genMuon = (*genMatch)[baseRef];
1095  aMuon.addGenParticleRef(genMuon);
1096  }
1097  if (embedGenMatch_)
1098  aMuon.embedGenParticle();
1099  }
1100  if (efficiencyLoader_.enabled()) {
1101  efficiencyLoader_.setEfficiencies(aMuon, muonRef);
1102  }
1103 
1104  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
1105  if (useParticleFlow_) {
1106  if (deposits[j]->contains(baseRef.id())) {
1107  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[baseRef]);
1108  } else if (deposits[j]->contains(muonRef.id())) {
1109  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[muonRef]);
1110  } else {
1111  reco::CandidatePtr source = aMuon.pfCandidateRef()->sourceCandidatePtr(0);
1113  }
1114  } else {
1115  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[muonRef]);
1116  }
1117  }
1118 
1119  for (size_t j = 0; j < isolationValues.size(); ++j) {
1120  if (useParticleFlow_) {
1121  if (isolationValues[j]->contains(baseRef.id())) {
1123  } else if (isolationValues[j]->contains(muonRef.id())) {
1125  } else {
1126  reco::CandidatePtr source = aMuon.pfCandidateRef()->sourceCandidatePtr(0);
1128  }
1129  } else {
1131  }
1132  }
1133 
1134  if (resolutionLoader_.enabled()) {
1136  }
1137 }
1138 
1141  aMuon.polarP4(),
1142  miniIsoParams_[0],
1143  miniIsoParams_[1],
1144  miniIsoParams_[2],
1145  miniIsoParams_[3],
1146  miniIsoParams_[4],
1147  miniIsoParams_[5],
1148  miniIsoParams_[6],
1149  miniIsoParams_[7],
1150  miniIsoParams_[8]);
1151  aMuon.setMiniPFIsolation(miniiso);
1152 }
1153 
1154 double PATMuonProducer::getRelMiniIsoPUCorrected(const pat::Muon& muon, double rho, const std::vector<double>& area) {
1155  double mindr(miniIsoParams_[0]);
1156  double maxdr(miniIsoParams_[1]);
1157  double kt_scale(miniIsoParams_[2]);
1158  double drcut = pat::miniIsoDr(muon.polarP4(), mindr, maxdr, kt_scale);
1159  return pat::muonRelMiniIsoPUCorrected(muon.miniPFIsolation(), muon.polarP4(), drcut, rho, area);
1160 }
1161 
1163  constexpr double dR_threshold = 0.4;
1164  constexpr double dR2_threshold = dR_threshold * dR_threshold;
1165  constexpr double mix_fraction = 0.5;
1166  enum particleType { CH = 0, NH = 1, PH = 2, OTHER = 100000 };
1167  double val_PuppiWithLep = 0.0;
1168  double val_PuppiWithoutLep = 0.0;
1169 
1170  for (const auto& cand : *pc) { //pat::pat::PackedCandidate loop start
1171 
1172  const particleType pType = isChargedHadron(cand.pdgId()) ? CH
1173  : isNeutralHadron(cand.pdgId()) ? NH
1174  : isPhoton(cand.pdgId()) ? PH
1175  : OTHER;
1176  if (pType == OTHER) {
1177  if (cand.pdgId() != 1 && cand.pdgId() != 2 && abs(cand.pdgId()) != 11 && abs(cand.pdgId()) != 13) {
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)"
1180  << std::endl;
1181  }
1182  continue;
1183  }
1184  double d_eta = std::abs(cand.eta() - muon.eta());
1185  if (d_eta > dR_threshold)
1186  continue;
1187 
1188  double d_phi = std::abs(reco::deltaPhi(cand.phi(), muon.phi()));
1189  if (d_phi > dR_threshold)
1190  continue;
1191 
1192  double dR2 = reco::deltaR2(cand, muon);
1193  if (dR2 > dR2_threshold)
1194  continue;
1195  if (pType == CH && dR2 < 0.0001 * 0.0001)
1196  continue;
1197  if (pType == NH && dR2 < 0.01 * 0.01)
1198  continue;
1199  if (pType == PH && dR2 < 0.01 * 0.01)
1200  continue;
1201  val_PuppiWithLep += cand.pt() * cand.puppiWeight();
1202  val_PuppiWithoutLep += cand.pt() * cand.puppiWeightNoLep();
1203 
1204  } //pat::pat::PackedCandidate loop end
1205 
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;
1210 }
1211 
1213 
1215 
1216 bool PATMuonProducer::isPhoton(long pdgid) { return pdgid == 22; }
1217 
1218 // ParameterSet description for module
1221  iDesc.setComment("PAT muon producer module");
1222 
1223  // input source
1224  iDesc.add<edm::InputTag>("muonSource", edm::InputTag("no default"))->setComment("input collection");
1225 
1226  // embedding
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)
1230  ->setComment(
1231  "force embedding separately the best tracks even if they're already embedded e.g. as tracker or global "
1232  "tracks");
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 ");
1239 
1240  // embedding of MET muon corrections
1241  iDesc.add<bool>("embedCaloMETMuonCorrs", true)->setComment("whether to add MET muon correction for caloMET or not");
1242  iDesc.add<edm::InputTag>("caloMETMuonCorrs", edm::InputTag("muonMETValueMapProducer", "muCorrData"))
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");
1245  iDesc.add<edm::InputTag>("tcMETMuonCorrs", edm::InputTag("muonTCMETValueMapProducer", "muCorrData"))
1246  ->setComment("source of MET muon corrections for tcMET");
1247 
1248  // pf specific parameters
1249  iDesc.add<edm::InputTag>("pfMuonSource", edm::InputTag("pfMuons"))->setComment("particle flow input collection");
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");
1253 
1254  // inverse beta computation
1255  iDesc.add<bool>("addInverseBeta", true)->setComment("add combined inverse beta");
1256  iDesc.add<edm::InputTag>("sourceInverseBeta", edm::InputTag("muons", "combined"))
1257  ->setComment("source of inverse beta values");
1258 
1259  // MC matching configurables
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;
1263  iDesc
1264  .addNode(edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
1265  edm::ParameterDescription<std::vector<edm::InputTag>>("genParticleMatch", emptySourceVector, true))
1266  ->setComment("input with MC match information");
1267 
1268  // mini-iso
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");
1272 
1273  iDesc.add<edm::InputTag>("pfCandsForMiniIso", edm::InputTag("packedPFCandidates"))
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");
1277 
1278  iDesc.add<bool>("addTriggerMatching", false)->setComment("add L1 and HLT matching to offline muon");
1279 
1281 
1282  // IsoDeposit configurables
1283  edm::ParameterSetDescription isoDepositsPSet;
1284  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
1285  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
1286  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
1287  isoDepositsPSet.addOptional<edm::InputTag>("particle");
1288  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadrons");
1289  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedAll");
1290  isoDepositsPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
1291  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
1292  isoDepositsPSet.addOptional<edm::InputTag>("pfPhotons");
1293  isoDepositsPSet.addOptional<std::vector<edm::InputTag>>("user");
1294  iDesc.addOptional("isoDeposits", isoDepositsPSet);
1295 
1296  // isolation values configurables
1297  edm::ParameterSetDescription isolationValuesPSet;
1298  isolationValuesPSet.addOptional<edm::InputTag>("tracker");
1299  isolationValuesPSet.addOptional<edm::InputTag>("ecal");
1300  isolationValuesPSet.addOptional<edm::InputTag>("hcal");
1301  isolationValuesPSet.addOptional<edm::InputTag>("particle");
1302  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedHadrons");
1303  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedAll");
1304  isolationValuesPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
1305  isolationValuesPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
1306  isolationValuesPSet.addOptional<edm::InputTag>("pfPhotons");
1307  iDesc.addOptional("isolationValues", isolationValuesPSet);
1308 
1309  iDesc.ifValue(edm::ParameterDescription<bool>("addPuppiIsolation", false, true),
1311  "puppiIsolationChargedHadrons",
1312  edm::InputTag("muonPUPPIIsolation", "h+-DR030-ThresholdVeto000-ConeVeto000"),
1313  true) and
1315  "puppiIsolationNeutralHadrons",
1316  edm::InputTag("muonPUPPIIsolation", "h0-DR030-ThresholdVeto000-ConeVeto001"),
1317  true) and
1319  "puppiIsolationPhotons",
1320  edm::InputTag("muonPUPPIIsolation", "gamma-DR030-ThresholdVeto000-ConeVeto001"),
1321  true) and
1323  "puppiNoLeptonsIsolationChargedHadrons",
1324  edm::InputTag("muonPUPPINoLeptonsIsolation", "h+-DR030-ThresholdVeto000-ConeVeto000"),
1325  true) and
1327  "puppiNoLeptonsIsolationNeutralHadrons",
1328  edm::InputTag("muonPUPPINoLeptonsIsolation", "h0-DR030-ThresholdVeto000-ConeVeto001"),
1329  true) and
1331  "puppiNoLeptonsIsolationPhotons",
1332  edm::InputTag("muonPUPPINoLeptonsIsolation", "gamma-DR030-ThresholdVeto000-ConeVeto001"),
1333  true)) or
1334  false >> edm::EmptyGroupDescription());
1335 
1336  // Efficiency configurables
1337  edm::ParameterSetDescription efficienciesPSet;
1338  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
1339  iDesc.add("efficiencies", efficienciesPSet);
1340  iDesc.add<bool>("addEfficiencies", false);
1341 
1342  // Check to see if the user wants to add user data
1343  edm::ParameterSetDescription userDataPSet;
1345  iDesc.addOptional("userData", userDataPSet);
1346 
1347  edm::ParameterSetDescription isolationPSet;
1348  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
1349  iDesc.add("userIsolation", isolationPSet);
1350 
1351  iDesc.add<bool>("embedHighLevelSelection", true)->setComment("embed high level selection");
1352  edm::ParameterSetDescription highLevelPSet;
1353  highLevelPSet.setAllowAnything();
1354  iDesc.addNode(edm::ParameterDescription<edm::InputTag>("beamLineSrc", edm::InputTag(), true))
1355  ->setComment("input with high level selection");
1357  ->setComment("input with high level selection");
1358 
1359  //descriptions.add("PATMuonProducer", iDesc);
1360 }
1361 
1362 // embed various impact parameters with errors
1363 // embed high level selection
1368  bool primaryVertexIsValid,
1370  bool beamspotIsValid) {
1371  // Correct to PV
1372 
1373  // PV2D
1374  aMuon.setDB(track->dxy(primaryVertex.position()),
1375  track->dxyError(primaryVertex.position(), primaryVertex.covariance()),
1376  pat::Muon::PV2D);
1377 
1378  // PV3D
1379  std::pair<bool, Measurement1D> result =
1381  double d0_corr = result.second.value();
1382  double d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
1383  aMuon.setDB(d0_corr, d0_err, pat::Muon::PV3D);
1384 
1385  // Correct to beam spot
1386 
1387  // BS2D
1388  aMuon.setDB(track->dxy(beamspot), track->dxyError(beamspot), pat::Muon::BS2D);
1389 
1390  // make a fake vertex out of beam spot
1391  reco::Vertex vBeamspot(beamspot.position(), beamspot.rotatedCovariance3D());
1392 
1393  // BS3D
1394  result = IPTools::signedImpactParameter3D(tt, GlobalVector(track->px(), track->py(), track->pz()), vBeamspot);
1395  d0_corr = result.second.value();
1396  d0_err = beamspotIsValid ? result.second.error() : -1.0;
1397  aMuon.setDB(d0_corr, d0_err, pat::Muon::BS3D);
1398 
1399  // PVDZ
1400  aMuon.setDB(
1401  track->dz(primaryVertex.position()), std::hypot(track->dzError(), primaryVertex.zError()), pat::Muon::PVDZ);
1402 }
1403 
1405 
ConfigurationDescriptions.h
pat::PATMuonProducer::addInverseBeta_
bool addInverseBeta_
add combined inverse beta measurement into the muon
Definition: PATMuonProducer.cc:187
SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
pat::Muon::embedTpfmsMuon
void embedTpfmsMuon()
embed reference to the above tpfms Track
reco::Muon::isAValidMuonTrack
bool isAValidMuonTrack(const MuonTrackType &type) const
pat::Muon::setSimMatchQuality
void setSimMatchQuality(float quality)
Definition: Muon.h:336
pat::PATMuonProducer::fillMuon
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
Definition: PATMuonProducer.cc:1055
cutBasedMuonId_MuonPOG_V0_cff.globalTrack
globalTrack
Definition: cutBasedMuonId_MuonPOG_V0_cff.py:135
MuonSubdetId::CSC
static constexpr int CSC
Definition: MuonSubdetId.h:12
reco::Muon::MvaVTight
Definition: Muon.h:232
pat::PATMuonProducer::getRelMiniIsoPUCorrected
double getRelMiniIsoPUCorrected(const pat::Muon &muon, double rho, const std::vector< double > &area)
Definition: PATMuonProducer.cc:1154
pat::PATUserDataHelper< pat::Muon >
mps_fire.i
i
Definition: mps_fire.py:428
pat::EcalIso
Definition: Isolation.h:11
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
pat::PATMuonProducer::embedTrack_
bool embedTrack_
embed the track from inner tracker into the muon
Definition: PATMuonProducer.cc:167
Muon.h
muonProducer_cfi.mvaTrainingFile
mvaTrainingFile
Definition: muonProducer_cfi.py:113
PFIsolation.h
MessageLogger.h
pat::Muon::setSimBX
void setSimBX(int bx)
Definition: Muon.h:329
funct::false
false
Definition: Factorize.h:29
GeomDet
Definition: GeomDet.h:27
edm::Handle::product
T const * product() const
Definition: Handle.h:70
pat::Muon::PVDZ
Definition: Muon.h:237
pat::Muon::BS3D
Definition: Muon.h:237
muonProducer_cfi.mvaDrMax
mvaDrMax
Definition: muonProducer_cfi.py:117
electronProducer_cff.isolationValues
isolationValues
Definition: electronProducer_cff.py:26
pat::PATObject::addTriggerObjectMatch
void addTriggerObjectMatch(const TriggerObjectStandAlone &trigObj)
add a trigger match
Definition: PATObject.h:238
pat::SoftMuonMvaEstimator
Definition: SoftMuonMvaEstimator.h:18
triggerMatchMonitor_cfi.triggerObjects
triggerObjects
Definition: triggerMatchMonitor_cfi.py:15
reco::Muon::MiniIsoVeryTight
Definition: Muon.h:223
pat::CaloIsolationEnergy
Calculates a lepton's calorimetric isolation energy.
Definition: CaloIsolationEnergy.h:32
TriggerResults.h
pat::PATMuonProducer::embedPfEcalEnergy_
bool embedPfEcalEnergy_
add ecal PF energy
Definition: PATMuonProducer.cc:223
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
pat::PATMuonProducer::IsolationLabel
std::pair< pat::IsolationKeys, edm::InputTag > IsolationLabel
Definition: PATMuonProducer.cc:100
muon
Definition: MuonCocktails.h:17
pat::Muon::setSimFlavour
void setSimFlavour(int f)
Definition: Muon.h:325
pat::miniIsoDr
float miniIsoDr(const reco::Candidate::PolarLorentzVector &p4, float mindr, float maxdr, float kt_scale)
Definition: MiniIsolation.cc:15
reco::MuonChamberMatch::x
float x
Definition: MuonChamberMatch.h:19
muonProducer_cfi.caloMETMuonCorrs
caloMETMuonCorrs
Definition: muonProducer_cfi.py:48
pat::helper::EfficiencyLoader
Definition: EfficiencyLoader.h:16
reco::Muon::TPFMS
Definition: Muon.h:36
edm::Ref::isAvailable
bool isAvailable() const
Definition: Ref.h:537
pat::PATMuonProducer::produce
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
everything that needs to be done during the event loop
Definition: PATMuonProducer.cc:574
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
deltaPhi.h
pat::muonRelMiniIsoPUCorrected
double muonRelMiniIsoPUCorrected(const PFIsolation &iso, const reco::Candidate::PolarLorentzVector &p4, double dr, double rho, const std::vector< double > &area)
Definition: MiniIsolation.cc:59
pat::Muon::embedTcMETMuonCorrs
void embedTcMETMuonCorrs(const reco::MuonMETCorrectionData &t)
pat::TriggerObjectStandAlone
Analysis-level trigger object class (stand-alone)
Definition: TriggerObjectStandAlone.h:32
pat::PATMuonProducer::embedTunePBestTrack_
bool embedTunePBestTrack_
embed the track from best muon measurement (muon only)
Definition: PATMuonProducer.cc:163
edm::EDGetTokenT
Definition: EDGetToken.h:33
pat::helper::MultiIsolator::fill
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
Definition: MultiIsolator.h:84
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::EDPutTokenT
Definition: EDPutToken.h:33
Muon.h
pat::PATUserDataHelper::fillDescription
static void fillDescription(edm::ParameterSetDescription &iDesc)
Definition: PATUserDataHelper.h:135
reco::Muon::DYT
Definition: Muon.h:36
pat::PATMuonProducer::embedPickyMuon_
bool embedPickyMuon_
embed track from picky muon fit into the muon
Definition: PATMuonProducer.cc:181
reco::Muon::matches
std::vector< MuonChamberMatch > & matches()
get muon matching information
Definition: Muon.h:145
geometry
Definition: geometry.py:1
pat::PATMuonProducer::initializeGlobalCache
static std::unique_ptr< PATMuonHeavyObjectCache > initializeGlobalCache(const edm::ParameterSet &iConfig)
Definition: PATMuonProducer.cc:83
reco::PFCandidateConstIterator
PFCandidateCollection::const_iterator PFCandidateConstIterator
iterator
Definition: PFCandidateFwd.h:18
reco::Muon::PuppiIsoLoose
Definition: Muon.h:229
pat::Muon::setSimType
void setSimType(reco::MuonSimType type)
Definition: Muon.h:323
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
reco::Muon::SoftMvaId
Definition: Muon.h:216
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
triggerResults
static const std::string triggerResults
Definition: EdmProvDump.cc:45
pat::Muon::setIsolationPUPPI
void setIsolationPUPPI(float chargedhadrons, float neutralhadrons, float photons)
sets PUPPI isolations
Definition: Muon.h:201
pat::Lepton::setIsolation
void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:115
pat::helper::EfficiencyLoader::enabled
bool enabled() const
'true' if this there is at least one efficiency configured
Definition: EfficiencyLoader.h:25
cms::cuda::assert
assert(be >=bs)
pat::PATMuonProducer::isolatorTmpStorage_
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
isolation value pair for temporary storage before being folded into the muon
Definition: PATMuonProducer.cc:248
EDProducer.h
pat::Muon::embedDytMuon
void embedDytMuon()
embed reference to the above dyt Track
pat::PATMuonProducer::globalEndJob
static void globalEndJob(PATMuonHeavyObjectCache *)
Definition: PATMuonProducer.cc:87
pat::PATMuonProducer::triggerObjects_
edm::EDGetTokenT< std::vector< pat::TriggerObjectStandAlone > > triggerObjects_
Definition: PATMuonProducer.cc:259
pat::PATObject::addGenParticleRef
void addGenParticleRef(const reco::GenParticleRef &ref)
Definition: PATObject.h:751
pat::PfAllParticleIso
Definition: Isolation.h:13
pat::PATMuonProducer::GenAssociations
std::vector< edm::Handle< edm::Association< reco::GenParticleCollection > > > GenAssociations
Definition: PATMuonProducer.cc:97
pat::PATMuonProducer::mvaL1L2L3ResCorrector_
edm::EDGetTokenT< reco::JetCorrector > mvaL1L2L3ResCorrector_
Definition: PATMuonProducer.cc:241
EmptyGroupDescription.h
pat::TrackerIsolationPt
Calculates a lepton's tracker isolation pt.
Definition: TrackerIsolationPt.h:31
pat::Muon
Analysis-level muon class.
Definition: Muon.h:51
pat::Muon::setIsolationPUPPINoLeptons
void setIsolationPUPPINoLeptons(float chargedhadrons, float neutralhadrons, float photons)
sets PUPPINoLeptons isolations
Definition: Muon.h:207
pat::Muon::setPFCandidateRef
void setPFCandidateRef(const reco::PFCandidateRef &ref)
add a reference to the source IsolatedPFCandidate
Definition: Muon.h:141
pat::PATMuonProducer::embedDytMuon_
bool embedDytMuon_
embed track from DYT muon fit into the muon
Definition: PATMuonProducer.cc:185
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
pat::Muon::embedMuonBestTrack
void embedMuonBestTrack(bool force=false)
TransientTrack.h
beam_dqm_sourceclient-live_cfg.mva
mva
Definition: beam_dqm_sourceclient-live_cfg.py:127
Association.h
pat::PATMuonProducer::fillHltTriggerInfo
void fillHltTriggerInfo(pat::Muon &muon, edm::Handle< std::vector< pat::TriggerObjectStandAlone >> &triggerObjects, const edm::TriggerNames &names, const std::vector< std::string > &collection_names)
Definition: PATMuonProducer.cc:548
pat::PATMuonProducer::recomputeBasicSelectors_
bool recomputeBasicSelectors_
Definition: PATMuonProducer.cc:237
edm::Handle
Definition: AssociativeIterator.h:50
edm::ParameterSetDescription::addOptional
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:105
pat::Muon::embedCombinedMuon
void embedCombinedMuon()
set reference to Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon...
pat::helper::MultiIsolator::IsolationValuePairs
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
Definition: MultiIsolator.h:17
pat::PATMuonProducer::isolationValueTokens_
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
Definition: PATMuonProducer.cc:217
MultiIsolator.h
EfficiencyLoader.h
pat::helper::KinResolutionsLoader::enabled
bool enabled() const
'true' if this there is at least one efficiency configured
Definition: KinResolutionsLoader.h:27
pat::PATMuonProducer::embedCombinedMuon_
bool embedCombinedMuon_
embed track of the combined fit into the muon
Definition: PATMuonProducer.cc:171
Muon
Definition: Muon.py:1
pat::helper::MultiIsolator::enabled
bool enabled() const
True if it has a non null configuration.
Definition: MultiIsolator.h:55
pat::PATMuonProducer::isPhoton
bool isPhoton(long pdgid)
Definition: PATMuonProducer.cc:1216
edm::Ref< TrackCollection >
pat::PATMuonProducer::embedGenMatch_
bool embedGenMatch_
embed the gen match information into the muon
Definition: PATMuonProducer.cc:195
pat::PATMuonProducer::PUPPIIsolation_neutral_hadrons_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_neutral_hadrons_
Definition: PATMuonProducer.cc:228
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
pat::helper::MultiIsolator::endEvent
void endEvent()
Definition: MultiIsolator.cc:85
GenParticle.h
pat::Muon::BS2D
Definition: Muon.h:237
reco::Muon::PuppiIsoTight
Definition: Muon.h:231
BeamMonitor_cff.primaryVertex
primaryVertex
hltOfflineBeamSpot for HLTMON
Definition: BeamMonitor_cff.py:7
MTVHistoProducerAlgoForTrackerBlock_cfi.maxdr
maxdr
Definition: MTVHistoProducerAlgoForTrackerBlock_cfi.py:80
pat::Muon::setSimPhi
void setSimPhi(float phi)
Definition: Muon.h:335
DetId
Definition: DetId.h:17
muonProducer_cfi.softMvaTrainingFile
softMvaTrainingFile
Definition: muonProducer_cfi.py:124
pat::PATMuonProducer::isolationValueLabels_
IsolationLabels isolationValueLabels_
input source isolation value maps
Definition: PATMuonProducer.cc:216
edm::FileInPath
Definition: FileInPath.h:61
pat::Muon::setSimHeaviestMotherFlavour
void setSimHeaviestMotherFlavour(int id)
Definition: Muon.h:326
pat::PATMuonProducer::IsolationValueMaps
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
Definition: PATMuonProducer.cc:99
MakerMacros.h
pat::PATMuonProducer::efficiencyLoader_
pat::helper::EfficiencyLoader efficiencyLoader_
helper class to add efficiencies to the muon
Definition: PATMuonProducer.cc:250
pat::Muon::setSimProdRho
void setSimProdRho(float rho)
Definition: Muon.h:331
reco::PFCandidate::muonRef
reco::MuonRef muonRef() const
Definition: PFCandidate.cc:421
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
reco::Muon::PuppiIsoMedium
Definition: Muon.h:230
pat::PATMuonProducer::useUserData_
bool useUserData_
add user data to the muon (this will be data members of th muon even w/o embedding)
Definition: PATMuonProducer.cc:221
pat::PATMuonProducer::patMuonPutToken_
const edm::EDPutTokenT< std::vector< Muon > > patMuonPutToken_
Definition: PATMuonProducer.cc:266
pat::PATMuonProducer::PUPPIIsolation_charged_hadrons_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_charged_hadrons_
Definition: PATMuonProducer.cc:227
pat::PATMuonProducer::MuonBaseRef
edm::RefToBase< reco::Muon > MuonBaseRef
typedefs for convenience
Definition: PATMuonProducer.cc:96
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
pat::PATMuonProducer::forceEmbedBestTrack_
bool forceEmbedBestTrack_
force separate embed of the best track even if already embedded
Definition: PATMuonProducer.cc:165
BeamSpot.h
pat::Muon::embedStandAloneMuon
void embedStandAloneMuon()
set reference to Track reconstructed in the muon detector only (reimplemented from reco::Muon)
pat::getMiniPFIsolation
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)
Definition: MiniIsolation.cc:19
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
names
const std::string names[nVars_]
Definition: PhotonIDValueMapProducer.cc:124
pat::PfChargedHadronIso
Definition: Isolation.h:14
pat::PATMuonProducer::addPuppiIsolation_
bool addPuppiIsolation_
add puppi isolation
Definition: PATMuonProducer.cc:225
IPTools::signedImpactParameter3D
std::pair< bool, Measurement1D > signedImpactParameter3D(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:81
pat::Muon::embedTrack
void embedTrack()
set reference to Track reconstructed in the tracker only (reimplemented from reco::Muon)
pat::PATUserDataHelper::add
void add(ObjectType &patObject, edm::Event const &iEvent, edm::EventSetup const &iSetup)
Definition: PATUserDataHelper.h:114
HLT_FULL_cff.muon
muon
Definition: HLT_FULL_cff.py:11725
L1TEGammaOffline_cfi.triggerNames
triggerNames
Definition: L1TEGammaOffline_cfi.py:40
pat::helper::EfficiencyLoader::newEvent
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
Definition: EfficiencyLoader.cc:21
reco::Muon::MvaLoose
Definition: Muon.h:217
pat::PATMuonProducer::genMatchTokens_
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
input tags for generator match information
Definition: PATMuonProducer.cc:193
pat::PATMuonProducer::isNeutralHadron
bool isNeutralHadron(long pdgid)
Definition: PATMuonProducer.cc:1212
MuonTimeExtra.h
GenParticleFwd.h
pat::Muon::embedPFCandidate
void embedPFCandidate()
embed the IsolatedPFCandidate pointed to by pfCandidateRef_
reco::BeamSpot
Definition: BeamSpot.h:21
trigger::TriggerMuon
Definition: TriggerTypeDefs.h:79
source
static const std::string source
Definition: EdmProvDump.cc:47
pat::helper::KinResolutionsLoader
Definition: KinResolutionsLoader.h:18
pat::Lepton::setIsoDeposit
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
Definition: Lepton.h:191
muonProducer_cfi.mvaL1Corrector
mvaL1Corrector
Definition: muonProducer_cfi.py:119
edm::ESHandle< GlobalTrackingGeometry >
KinResolutionsLoader.h
pat::PATMuonHeavyObjectCache::softMuonMvaEstimator_
std::unique_ptr< const pat::SoftMuonMvaEstimator > softMuonMvaEstimator_
Definition: PATMuonProducer.cc:68
beamspot
Definition: BeamSpotWrite2Txt.h:8
pat::PATMuonProducer::embedHighLevelSelection_
bool embedHighLevelSelection_
embed high level selection variables
Definition: PATMuonProducer.cc:207
MiniIsolation.h
reco::Muon::MvaVVTight
Definition: Muon.h:233
MuonSubdetId::DT
static constexpr int DT
Definition: MuonSubdetId.h:11
reco::Muon::MiniIsoLoose
Definition: Muon.h:220
pat::Muon::PV3D
Definition: Muon.h:237
Point3DBase< float, LocalTag >
ParameterSetDescription.h
JetCorrector.h
nhits
Definition: HIMultiTrackSelector.h:42
pat::Muon::setDB
void setDB(double dB, double edB, IPTYPE type=PV2D)
Definition: Muon.h:247
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
reco::Muon::Picky
Definition: Muon.h:36
pat::PATMuonProducer::resolutionLoader_
pat::helper::KinResolutionsLoader resolutionLoader_
helper class to add resolutions to the muon
Definition: PATMuonProducer.cc:199
commonCuts_cff.triggerResults_
triggerResults_
Definition: commonCuts_cff.py:17
muonProducer_cfi.tcMETMuonCorrs
tcMETMuonCorrs
Definition: muonProducer_cfi.py:51
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
pat::PATMuonProducer::computeMiniIso_
bool computeMiniIso_
Definition: PATMuonProducer.cc:154
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
reco::Muon::MiniIsoTight
Definition: Muon.h:222
GlobalTrackingGeometryRecord.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::vector_transform
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 >
Definition: transform.h:11
FileInPath.h
MuonSimInfo.h
pat::Muon::initSimInfo
void initSimInfo(void)
pat::PATMuonProducer::isoDepositLabels_
IsolationLabels isoDepositLabels_
input source for isoDeposits
Definition: PATMuonProducer.cc:213
pat::PATMuonProducer::getMuonDirection
std::optional< GlobalPoint > getMuonDirection(const reco::MuonChamberMatch &chamberMatch, const edm::ESHandle< GlobalTrackingGeometry > &geometry, const DetId &chamberId)
Definition: PATMuonProducer.cc:485
dqm::qstatus::OTHER
static const int OTHER
Definition: MonitorElement.h:47
reco::Muon::isGlobalMuon
bool isGlobalMuon() const override
Definition: Muon.h:299
pat::Muon::setPfEcalEnergy
void setPfEcalEnergy(float pfEcalEnergy)
Definition: Muon.h:277
pat::helper::KinResolutionsLoader::setResolutions
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
Definition: KinResolutionsLoader.h:49
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
pat::PATMuonProducer::embedTcMETMuonCorrs_
bool embedTcMETMuonCorrs_
embed muon MET correction info for tcMET into the muon
Definition: PATMuonProducer.cc:177
TransientTrackBuilder.h
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
edm::ParameterSet
Definition: ParameterSet.h:47
pat::PATMuonProducer::~PATMuonProducer
~PATMuonProducer() override
default destructur
Definition: PATMuonProducer.cc:483
edm::ParameterSetDescription::setComment
void setComment(std::string const &value)
Definition: ParameterSetDescription.cc:33
SoftMuonMvaEstimator.h
pat::PATMuonProducer::isChargedHadron
bool isChargedHadron(long pdgid)
Definition: PATMuonProducer.cc:1214
Event.h
pat::PATMuonProducer::readIsolationLabels
void readIsolationLabels(const edm::ParameterSet &iConfig, const char *psetName, IsolationLabels &labels, std::vector< edm::EDGetTokenT< edm::ValueMap< T >>> &tokens)
Definition: PATMuonProducer.cc:272
ParameterSet
Definition: Functions.h:16
deltaR.h
pat::PATMuonProducer::mvaUseJec_
bool mvaUseJec_
Definition: PATMuonProducer.cc:238
pat::PfGammaIso
Definition: Isolation.h:16
pat::PATMuonProducer::embedPFCandidate_
bool embedPFCandidate_
embed pfCandidates into the muon
Definition: PATMuonProducer.cc:205
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
pat::PATMuonProducer::PUPPIIsolation_photons_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_photons_
Definition: PATMuonProducer.cc:229
pat::helper::KinResolutionsLoader::fillDescription
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
Definition: KinResolutionsLoader.cc:34
pat::PATMuonProducer::computeMuonMVA_
bool computeMuonMVA_
standard muon selectors
Definition: PATMuonProducer.cc:235
UserData.h
trigger::TriggerL1Mu
enum start value shifted to 81 so as to avoid clashes with PDG codes
Definition: TriggerTypeDefs.h:30
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
PackedCandidate.h
pat::PATMuonProducer::mvaL1Corrector_
edm::EDGetTokenT< reco::JetCorrector > mvaL1Corrector_
Definition: PATMuonProducer.cc:240
reco::Muon::LowPtMvaMedium
Definition: Muon.h:235
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
pat::UserBaseIso
Definition: Isolation.h:22
pat::PATMuonProducer::caloMETMuonCorrsToken_
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > caloMETMuonCorrsToken_
source of caloMET muon corrections
Definition: PATMuonProducer.cc:175
CSCDetId
Definition: CSCDetId.h:26
pat::PATMuonHeavyObjectCache
Definition: PATMuonProducer.cc:56
pat::PATMuonHeavyObjectCache::muonMvaEstimator
pat::MuonMvaEstimator const & muonMvaEstimator() const
Definition: PATMuonProducer.cc:60
edm::ParameterSetDescription::ifValue
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T >> cases)
Definition: ParameterSetDescription.h:220
cand
Definition: decayParser.h:32
pat::TrackIso
Definition: Isolation.h:10
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
iEvent
int iEvent
Definition: GenABIO.cc:224
reco::Muon::MultiIsoMedium
Definition: Muon.h:228
pat::HcalIso
Definition: Isolation.h:12
pat::PATMuonProducer::PUPPINoLeptonsIsolation_charged_hadrons_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_charged_hadrons_
Definition: PATMuonProducer.cc:231
pat::Muon::PV2D
Definition: Muon.h:237
pat::PATMuonProducer::pvToken_
edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
input source of the primary vertex
Definition: PATMuonProducer.cc:211
pat::PATMuonProducer::embedCaloMETMuonCorrs_
bool embedCaloMETMuonCorrs_
embed muon MET correction info for caloMET into the muon
Definition: PATMuonProducer.cc:173
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
pat::PATMuonHeavyObjectCache::softMuonMvaEstimator
pat::SoftMuonMvaEstimator const & softMuonMvaEstimator() const
Definition: PATMuonProducer.cc:63
susybsm::HSCParticleType::innerTrack
Definition: HSCParticle.h:20
reco::Muon::LowPtMvaLoose
Definition: Muon.h:234
pat::PfNeutralHadronIso
Definition: Isolation.h:15
edm::stream::EDProducer
Definition: EDProducer.h:36
pat::PATMuonProducer::embedTpfmsMuon_
bool embedTpfmsMuon_
embed track from tpfms muon fit into the muon
Definition: PATMuonProducer.cc:183
pat::Lepton::setMiniPFIsolation
void setMiniPFIsolation(PFIsolation const &iso)
Definition: Lepton.h:217
pat::PATMuonProducer::computePuppiCombinedIso_
bool computePuppiCombinedIso_
Definition: PATMuonProducer.cc:155
TransientTrackBuilder
Definition: TransientTrackBuilder.h:16
pat::Muon::setSimMotherPdgId
void setSimMotherPdgId(int id)
Definition: Muon.h:328
pat::PfChargedAllIso
Definition: Isolation.h:25
reco::Muon::MiniIsoMedium
Definition: Muon.h:221
edm::Association
Definition: Association.h:18
edm::EventSetup
Definition: EventSetup.h:58
edm::ParameterSetDescription::addNode
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
Definition: ParameterSetDescription.cc:41
pat
Definition: HeavyIon.h:7
pat::PATMuonProducer::muonTimeExtraToken_
edm::EDGetTokenT< edm::ValueMap< reco::MuonTimeExtra > > muonTimeExtraToken_
input tag for reading inverse beta
Definition: PATMuonProducer.cc:189
pat::PATMuonProducer::PUPPINoLeptonsIsolation_photons_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_photons_
Definition: PATMuonProducer.cc:233
edm::contains
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:37
edm::ParameterSetDescription::setAllowAnything
void setAllowAnything()
allow any parameter label/value pairs
Definition: ParameterSetDescription.cc:37
pat::Muon::setSimPdgId
void setSimPdgId(int id)
Definition: Muon.h:327
MuonMvaEstimator.h
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
reco::MuonChamberMatch
Definition: MuonChamberMatch.h:10
TransientTrackRecord.h
pat::PATMuonProducer::addEfficiencies_
bool addEfficiencies_
add efficiencies to the muon (this will be data members of th muon even w/o embedding)
Definition: PATMuonProducer.cc:219
pat::PATMuonProducer::muonToken_
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
input source
Definition: PATMuonProducer.cc:150
pat::PfPUChargedHadronIso
Definition: Isolation.h:24
pat::helper::KinResolutionsLoader::newEvent
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
Definition: KinResolutionsLoader.cc:27
pat::PATMuonProducer::transientTrackBuilderToken_
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transientTrackBuilderToken_
Definition: PATMuonProducer.cc:264
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord >
pat::PATMuonProducer::pfMuonToken_
edm::EDGetTokenT< reco::PFCandidateCollection > pfMuonToken_
input source pfCandidates that will be to be transformed into pat::Muons, when using PF2PAT
Definition: PATMuonProducer.cc:203
reco::PFCandidate::ecalEnergy
double ecalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:221
L1DTConfigBti_cff.CH
CH
LTS and SET for low trigger suppression.
Definition: L1DTConfigBti_cff.py:38
reco::Muon::MvaMedium
Definition: Muon.h:218
muon::makeSelectorBitset
reco::Muon::Selector makeSelectorBitset(reco::Muon const &muon, reco::Vertex const *vertex=nullptr, bool run2016_hip_mitigation=false)
Definition: MuonSelectors.cc:1033
edm::Ptr< reco::Muon >
edm::RefToBase::id
ProductID id() const
Definition: RefToBase.h:214
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
pat::PackedCandidateCollection
std::vector< pat::PackedCandidate > PackedCandidateCollection
Definition: PackedCandidate.h:1131
pat::PATMuonProducer::addResolutions_
bool addResolutions_
add resolutions to the muon (this will be data members of th muon even w/o embedding)
Definition: PATMuonProducer.cc:197
IsolatedPFCandidate.h
pat::PATMuonProducer::tcMETMuonCorrsToken_
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > tcMETMuonCorrsToken_
source of tcMET muon corrections
Definition: PATMuonProducer.cc:179
pat::PFIsolation
Definition: PFIsolation.h:12
pat::PATMuonProducer::beamLineToken_
edm::EDGetTokenT< reco::BeamSpot > beamLineToken_
input source of the primary vertex/beamspot
Definition: PATMuonProducer.cc:209
pat::helper::MultiIsolator
Definition: MultiIsolator.h:15
pat::PATMuonProducer::IsoDepositMaps
std::vector< edm::Handle< edm::ValueMap< IsoDeposit > > > IsoDepositMaps
Definition: PATMuonProducer.cc:98
GeomDet.h
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition: LeafCandidate.h:158
pat::PATMuonProducer::simInfo_
edm::EDGetTokenT< edm::ValueMap< reco::MuonSimInfo > > simInfo_
MC info.
Definition: PATMuonProducer.cc:255
pat::Muon::readTimeExtra
void readTimeExtra(const reco::MuonTimeExtra &t)
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
IPTools.h
pat::PATMuonProducer::computeSoftMuonMVA_
bool computeSoftMuonMVA_
Definition: PATMuonProducer.cc:236
pat::PATMuonProducer::setMuonMiniIso
void setMuonMiniIso(pat::Muon &aMuon, const pat::PackedCandidateCollection *pc)
Definition: PATMuonProducer.cc:1139
pat::IsolationKeys
IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
reco::TransientTrack
Definition: TransientTrack.h:19
pat::PATMuonHeavyObjectCache::muonMvaEstimator_
std::unique_ptr< const pat::MuonMvaEstimator > muonMvaEstimator_
Definition: PATMuonProducer.cc:67
pat::PATMuonProducer::addTriggerMatching_
bool addTriggerMatching_
Trigger.
Definition: PATMuonProducer.cc:258
pat::helper::MultiIsolator::beginEvent
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
Definition: MultiIsolator.cc:79
pat::PATMuonProducer::rho_
edm::EDGetTokenT< double > rho_
Definition: PATMuonProducer.cc:242
pat::helper::EfficiencyLoader::setEfficiencies
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
Definition: EfficiencyLoader.h:41
MTVHistoProducerAlgoForTrackerBlock_cfi.mindr
mindr
Definition: MTVHistoProducerAlgoForTrackerBlock_cfi.py:79
Vertex.h
pat::PATMuonProducer::PUPPINoLeptonsIsolation_neutral_hadrons_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_neutral_hadrons_
Definition: PATMuonProducer.cc:232
pat::Muon::setSimEta
void setSimEta(float eta)
Definition: Muon.h:334
PVValHelper::dz
Definition: PVValidationHelpers.h:51
pat::Muon::setNumberOfValidHits
void setNumberOfValidHits(unsigned int numberOfValidHits)
Definition: Muon.h:255
pat::PATMuonProducer::addGenMatch_
bool addGenMatch_
add generator match information
Definition: PATMuonProducer.cc:191
pat::PATMuonProducer::mvaBTagCollectionTag_
edm::EDGetTokenT< reco::JetTagCollection > mvaBTagCollectionTag_
Definition: PATMuonProducer.cc:239
transform.h
edm::ValueMap
Definition: ValueMap.h:107
pat::PATMuonProducer::fillL1TriggerInfo
void fillL1TriggerInfo(pat::Muon &muon, edm::Handle< std::vector< pat::TriggerObjectStandAlone >> &triggerObjects, const edm::TriggerNames &names, const edm::ESHandle< GlobalTrackingGeometry > &geometry)
Definition: PATMuonProducer.cc:496
Exception
Definition: hltDiff.cc:245
pat::PATMuonProducer::isoDepositTokens_
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
Definition: PATMuonProducer.cc:214
edm::TriggerNames
Definition: TriggerNames.h:55
pat::PATMuonHeavyObjectCache::muonLowPtMvaEstimator
pat::MuonMvaEstimator const & muonLowPtMvaEstimator() const
Definition: PATMuonProducer.cc:61
pat::PATMuonProducer
class definition
Definition: PATMuonProducer.cc:76
reco::MuonChamberMatch::y
float y
Definition: MuonChamberMatch.h:20
pat::PATMuonProducer::useParticleFlow_
bool useParticleFlow_
switch to use particle flow (PF2PAT) or not
Definition: PATMuonProducer.cc:201
PATUserDataHelper.h
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
pat::PATMuonProducer::userDataHelper_
pat::PATUserDataHelper< pat::Muon > userDataHelper_
helper class to add userData to the muon
Definition: PATMuonProducer.cc:252
or
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
Definition: Activities.doc:12
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::RefToBase
Definition: AssociativeIterator.h:54
pat::Muon::setSimTpEvent
void setSimTpEvent(int tpEvent)
Definition: Muon.h:330
Exception.h
pat::PATMuonProducer::triggerResults_
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
Definition: PATMuonProducer.cc:260
pat::PATMuonHeavyObjectCache::PATMuonHeavyObjectCache
PATMuonHeavyObjectCache(const edm::ParameterSet &)
Definition: PATMuonProducer.cc:324
pat::Muon::setNormChi2
void setNormChi2(double normChi2)
Definition: Muon.h:262
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
hemisphereProducer_cfi.patMuons
patMuons
Definition: hemisphereProducer_cfi.py:6
pat::PATMuonProducer::PATMuonProducer
PATMuonProducer(const edm::ParameterSet &iConfig, PATMuonHeavyObjectCache const *)
default constructir
Definition: PATMuonProducer.cc:339
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
muonProducer_cfi.mvaL1L2L3ResCorrector
mvaL1L2L3ResCorrector
Definition: muonProducer_cfi.py:120
pat::PATMuonProducer::embedHighLevel
void embedHighLevel(pat::Muon &aMuon, reco::TrackRef track, reco::TransientTrack &tt, reco::Vertex &primaryVertex, bool primaryVertexIsValid, reco::BeamSpot &beamspot, bool beamspotIsValid)
Definition: PATMuonProducer.cc:1364
pat::Muon::embedCaloMETMuonCorrs
void embedCaloMETMuonCorrs(const reco::MuonMETCorrectionData &t)
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
TransientTrackBuilder::build
reco::TransientTrack build(const reco::Track *p) const
Definition: TransientTrackBuilder.cc:20
pat::PATMuonProducer::embedBestTrack_
bool embedBestTrack_
embed the track from best muon measurement (global pflow)
Definition: PATMuonProducer.cc:161
mps_fire.result
result
Definition: mps_fire.py:311
cms::Exception
Definition: Exception.h:70
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DTChamberId
Definition: DTChamberId.h:14
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
reco::LeafCandidate::polarP4
const PolarLorentzVector & polarP4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:116
pat::Muon::setExtSimType
void setExtSimType(reco::ExtendedMuonSimType type)
Definition: Muon.h:324
pat::PATMuonProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
description of config file parameters
Definition: PATMuonProducer.cc:1219
reco::Muon::MvaTight
Definition: Muon.h:219
ParameterSet.h
edm::ParameterDescriptionNode::setComment
void setComment(std::string const &value)
Definition: ParameterDescriptionNode.cc:106
pat::PATMuonProducer::geometryToken_
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > geometryToken_
Definition: PATMuonProducer.cc:263
PbPb_ZMuSkimMuonDPG_cff.particleType
particleType
Definition: PbPb_ZMuSkimMuonDPG_cff.py:27
TtFullHadEvtBuilder_cfi.genMatch
genMatch
add extra information on genMatch
Definition: TtFullHadEvtBuilder_cfi.py:37
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
pat::PATObject::embedGenParticle
void embedGenParticle()
Definition: PATObject.h:768
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
pat::PATMuonProducer::IsolationLabels
std::vector< IsolationLabel > IsolationLabels
Definition: PATMuonProducer.cc:101
pat::PATMuonProducer::miniIsoParams_
std::vector< double > miniIsoParams_
Definition: PATMuonProducer.cc:157
edm::Event
Definition: Event.h:73
EgammaValidation_cff.pdgid
pdgid
Definition: EgammaValidation_cff.py:29
crabWrapper.key
key
Definition: crabWrapper.py:19
pat::PATMuonProducer::embedStandAloneMuon_
bool embedStandAloneMuon_
embed track from muon system into the muon
Definition: PATMuonProducer.cc:169
pat::PATMuonProducer::puppiCombinedIsolation
double puppiCombinedIsolation(const pat::Muon &muon, const pat::PackedCandidateCollection *pc)
Definition: PATMuonProducer.cc:1162
edm::EmptyGroupDescription
Definition: EmptyGroupDescription.h:15
edm::ParameterDescription
Definition: ParameterDescription.h:110
TriggerObjectStandAlone.h
CandIsolatorFromDeposits_cfi.deposits
deposits
Definition: CandIsolatorFromDeposits_cfi.py:4
custom_jme_cff.area
area
Definition: custom_jme_cff.py:140
pat::Muon::setSimProdZ
void setSimProdZ(float z)
Definition: Muon.h:332
edm::InputTag
Definition: InputTag.h:15
pat::PATMuonProducer::hltCollectionFilters_
std::vector< std::string > hltCollectionFilters_
Definition: PATMuonProducer.cc:261
label
const char * label
Definition: PFTauDecayModeTools.cc:11
pat::Muon::embedPickyMuon
void embedPickyMuon()
embed reference to the above picky Track
pat::PATMuonProducer::effectiveAreaVec_
std::vector< double > effectiveAreaVec_
Definition: PATMuonProducer.cc:156
reco::Vertex
Definition: Vertex.h:35
pat::PATMuonProducer::relMiniIsoPUCorrected
double relMiniIsoPUCorrected(const pat::Muon &aMuon, double rho)
pat::Muon::pfCandidateRef
reco::PFCandidateRef pfCandidateRef() const
pat::Muon::setSimPt
void setSimPt(float pt)
Definition: Muon.h:333
pat::Muon::embedTunePMuonBestTrack
void embedTunePMuonBestTrack(bool force=false)
pat::PATMuonProducer::relMiniIsoPUCorrected_
double relMiniIsoPUCorrected_
Definition: PATMuonProducer.cc:158
pat::PATMuonProducer::pcToken_
edm::EDGetTokenT< pat::PackedCandidateCollection > pcToken_
Definition: PATMuonProducer.cc:153
pat::MuonMvaEstimator
Definition: MuonMvaEstimator.h:25
pat::PATMuonHeavyObjectCache::muonLowPtMvaEstimator_
std::unique_ptr< const pat::MuonMvaEstimator > muonLowPtMvaEstimator_
Definition: PATMuonProducer.cc:66
pat::PATMuonProducer::isolator_
pat::helper::MultiIsolator isolator_
Definition: PATMuonProducer.cc:246