CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
MuonIdProducer Class Reference

#include <MuonIdProducer.h>

Inheritance diagram for MuonIdProducer:
edm::stream::EDProducer<>

Classes

struct  ICTypes
 

Public Types

typedef reco::Muon::MuonTrackType TrackType
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 MuonIdProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~MuonIdProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static double sectorPhi (const DetId &id)
 

Private Member Functions

bool approxEqual (const double a, const double b, const double tol=1E-3) const
 
void arbitrateMuons (reco::MuonCollection *, reco::CaloMuonCollection *)
 
unsigned int chamberId (const DetId &)
 
bool checkLinks (const reco::MuonTrackLinks *) const
 
void fillArbitrationInfo (reco::MuonCollection *, unsigned int muonType=reco::Muon::TrackerMuon)
 
void fillGlbQuality (edm::Event &, const edm::EventSetup &, reco::Muon &aMuon)
 
void fillMuonId (edm::Event &, const edm::EventSetup &, reco::Muon &, TrackDetectorAssociator::Direction direction=TrackDetectorAssociator::InsideOut)
 
void fillMuonIsolation (edm::Event &, const edm::EventSetup &, reco::Muon &aMuon, reco::IsoDeposit &trackDep, reco::IsoDeposit &ecalDep, reco::IsoDeposit &hcalDep, reco::IsoDeposit &hoDep, reco::IsoDeposit &jetDep)
 
void fillTrackerKink (reco::Muon &aMuon)
 
std::vector< reco::MuonSegmentMatch > * getSegmentMatches (reco::MuonChamberMatch &chamber, unsigned int muonType) const
 get the segment matches of the appropriate type More...
 
void init (edm::Event &, const edm::EventSetup &)
 
bool isGoodCaloMuon (const reco::CaloMuon &muon)
 
bool isGoodGEMMuon (const reco::Muon &muon)
 
bool isGoodME0Muon (const reco::Muon &muon)
 
bool isGoodRPCMuon (const reco::Muon &muon)
 
bool isGoodTrack (const reco::Track &track)
 
bool isGoodTrackerMuon (const reco::Muon &muon)
 
reco::CaloMuon makeCaloMuon (const reco::Muon &)
 
reco::Muon makeMuon (edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::TrackRef &track, TrackType type)
 
reco::Muon makeMuon (const reco::MuonTrackLinks &links)
 
reco::Muon makeMuon (const reco::Track &track)
 
int overlap (const reco::Muon &muon, const reco::Track &track)
 
double phiOfMuonIneteractionRegion (const reco::Muon &muon) const
 

Private Attributes

bool addExtraSoftMuons_
 
bool arbClean_
 
bool arbitrateTrackerMuons_
 
double caloCut_
 
bool debugWithTruthMatching_
 
edm::Handle< reco::TrackToTrackMapdytCollectionHandle_
 
edm::EDGetTokenT< reco::TrackToTrackMapdytCollectionToken_
 
std::string ecalDepositName_
 
bool fillCaloCompatibility_
 
bool fillEnergy_
 
bool fillGlobalTrackQuality_
 
bool fillGlobalTrackRefits_
 
bool fillIsolation_
 
bool fillMatching_
 
bool fillShowerDigis_
 
bool fillTrackerKink_
 
edm::Handle< edm::ValueMap< reco::MuonQuality > > glbQualHandle_
 
edm::EDGetTokenT< edm::ValueMap< reco::MuonQuality > > glbQualToken_
 
edm::InputTag globalTrackQualityInputTag_
 
std::string hcalDepositName_
 
std::string hoDepositName_
 
edm::Handle< reco::TrackCollectioninnerTrackCollectionHandle_
 
edm::EDGetTokenT< reco::TrackCollectioninnerTrackCollectionToken_
 
std::vector< edm::InputTaginputCollectionLabels_
 
std::vector< ICTypes::ICTypeKeyinputCollectionTypes_
 
std::string jetDepositName_
 
edm::Handle< reco::MuonTrackLinksCollectionlinkCollectionHandle_
 
edm::EDGetTokenT< reco::MuonTrackLinksCollectionlinkCollectionToken_
 
double maxAbsDx_
 
double maxAbsDy_
 
double maxAbsEta_
 
double maxAbsPullX_
 
double maxAbsPullY_
 
std::unique_ptr< MuonMeshmeshAlgo_
 
int minNumberOfMatches_
 
double minP_
 
double minPCaloMuon_
 
double minPt_
 
std::unique_ptr< reco::isodeposit::IsoDepositExtractormuIsoExtractorCalo_
 
std::unique_ptr< reco::isodeposit::IsoDepositExtractormuIsoExtractorJet_
 
std::unique_ptr< reco::isodeposit::IsoDepositExtractormuIsoExtractorTrack_
 
MuonCaloCompatibility muonCaloCompatibility_
 
edm::Handle< reco::MuonCollectionmuonCollectionHandle_
 
edm::EDGetTokenT< reco::MuonCollectionmuonCollectionToken_
 
edm::Handle< reco::TrackCollectionouterTrackCollectionHandle_
 
edm::EDGetTokenT< reco::TrackCollectionouterTrackCollectionToken_
 
TrackAssociatorParameters parameters_
 
edm::Handle< reco::TrackToTrackMappickyCollectionHandle_
 
edm::EDGetTokenT< reco::TrackToTrackMappickyCollectionToken_
 
double ptThresholdToFillCandidateP4WithGlobalFit_
 
edm::Handle< RPCRecHitCollectionrpcHitHandle_
 
edm::EDGetTokenT< RPCRecHitCollectionrpcHitToken_
 
double sigmaThresholdToFillCandidateP4WithGlobalFit_
 
bool storeCrossedHcalRecHits_
 
std::unique_ptr< MuonShowerDigiFillertheShowerDigiFiller_
 
std::unique_ptr< MuonTimingFillertheTimingFiller_
 
edm::Handle< reco::TrackToTrackMaptpfmsCollectionHandle_
 
edm::EDGetTokenT< reco::TrackToTrackMaptpfmsCollectionToken_
 
TrackDetectorAssociator trackAssociator_
 
std::string trackDepositName_
 
std::unique_ptr< MuonKinkFindertrackerKinkFinder_
 
bool writeIsoDeposits_
 

Detailed Description

Definition at line 66 of file MuonIdProducer.h.

Member Typedef Documentation

Definition at line 68 of file MuonIdProducer.h.

Constructor & Destructor Documentation

MuonIdProducer::MuonIdProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 35 of file MuonIdProducer.cc.

References addExtraSoftMuons_, arbClean_, arbitrateTrackerMuons_, caloCut_, caloParams_cfi::caloParams, MuonCaloCompatibility::configure(), debugWithTruthMatching_, dytCollectionToken_, ecalDepositName_, fillCaloCompatibility_, fillEnergy_, fillGlobalTrackQuality_, fillGlobalTrackRefits_, fillIsolation_, fillMatching_, fillShowerDigis_, fillTrackerKink_, timingPdfMaker::get, edm::ParameterSet::getParameter(), glbQualToken_, hcalDepositName_, hoDepositName_, mps_fire::i, MuonIdProducer::ICTypes::INNER_TRACKS, innerTrackCollectionToken_, inputCollectionLabels_, HLT_2018_cff::inputCollectionTypes, inputCollectionTypes_, DataMixerDataOnData_cff::inputLabel, jetDepositName_, linkCollectionToken_, MuonIdProducer::ICTypes::LINKS, TrackAssociatorParameters::loadParameters(), LogTrace, maxAbsDx_, maxAbsDy_, maxAbsEta_, maxAbsPullX_, maxAbsPullY_, meshAlgo_, minNumberOfMatches_, minP_, minPCaloMuon_, minPt_, muIsoExtractorCalo_, muIsoExtractorJet_, muIsoExtractorTrack_, muonCaloCompatibility_, muonCollectionToken_, MuonIdProducer::ICTypes::MUONS, MuonIdProducer::ICTypes::OUTER_TRACKS, outerTrackCollectionToken_, parameters_, pickyCollectionToken_, ptThresholdToFillCandidateP4WithGlobalFit_, rpcHitToken_, sigmaThresholdToFillCandidateP4WithGlobalFit_, storeCrossedHcalRecHits_, AlCaHLTBitMon_QueryRunRegistry::string, MuonIdProducer::ICTypes::TEV_DYT, MuonIdProducer::ICTypes::TEV_FIRSTHIT, MuonIdProducer::ICTypes::TEV_PICKY, theShowerDigiFiller_, theTimingFiller_, MuonIdProducer::ICTypes::toKey(), tpfmsCollectionToken_, trackDepositName_, trackerKinkFinder_, and writeIsoDeposits_.

35  {
36  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: Constructor called";
37 
38  produces<reco::MuonCollection>();
39  produces<reco::CaloMuonCollection>();
40  produces<reco::MuonTimeExtraMap>("combined");
41  produces<reco::MuonTimeExtraMap>("dt");
42  produces<reco::MuonTimeExtraMap>("csc");
43 
44  minPt_ = iConfig.getParameter<double>("minPt");
45  minP_ = iConfig.getParameter<double>("minP");
46  minPCaloMuon_ = iConfig.getParameter<double>("minPCaloMuon");
47  minNumberOfMatches_ = iConfig.getParameter<int>("minNumberOfMatches");
48  addExtraSoftMuons_ = iConfig.getParameter<bool>("addExtraSoftMuons");
49  maxAbsEta_ = iConfig.getParameter<double>("maxAbsEta");
50  maxAbsDx_ = iConfig.getParameter<double>("maxAbsDx");
51  maxAbsPullX_ = iConfig.getParameter<double>("maxAbsPullX");
52  maxAbsDy_ = iConfig.getParameter<double>("maxAbsDy");
53  maxAbsPullY_ = iConfig.getParameter<double>("maxAbsPullY");
54  fillCaloCompatibility_ = iConfig.getParameter<bool>("fillCaloCompatibility");
55  fillEnergy_ = iConfig.getParameter<bool>("fillEnergy");
56  storeCrossedHcalRecHits_ = iConfig.getParameter<bool>("storeCrossedHcalRecHits");
57  fillMatching_ = iConfig.getParameter<bool>("fillMatching");
58  fillIsolation_ = iConfig.getParameter<bool>("fillIsolation");
59  fillShowerDigis_ = iConfig.getParameter<bool>("fillShowerDigis");
60  writeIsoDeposits_ = iConfig.getParameter<bool>("writeIsoDeposits");
61  fillGlobalTrackQuality_ = iConfig.getParameter<bool>("fillGlobalTrackQuality");
62  fillGlobalTrackRefits_ = iConfig.getParameter<bool>("fillGlobalTrackRefits");
63  arbitrateTrackerMuons_ = iConfig.getParameter<bool>("arbitrateTrackerMuons");
64  //SK: (maybe temporary) run it only if the global is also run
65  fillTrackerKink_ = false;
66  if (fillGlobalTrackQuality_)
67  fillTrackerKink_ = iConfig.getParameter<bool>("fillTrackerKink");
68 
70  iConfig.getParameter<double>("ptThresholdToFillCandidateP4WithGlobalFit");
72  iConfig.getParameter<double>("sigmaThresholdToFillCandidateP4WithGlobalFit");
73  caloCut_ = iConfig.getParameter<double>("minCaloCompatibility"); //CaloMuons
74  arbClean_ = iConfig.getParameter<bool>("runArbitrationCleaner"); // muon mesh
75 
76  // Load TrackDetectorAssociator parameters
77  const edm::ParameterSet parameters = iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters");
78  edm::ConsumesCollector iC = consumesCollector();
79  parameters_.loadParameters(parameters, iC);
80 
81  // Load parameters for the TimingFiller
82  edm::ParameterSet timingParameters = iConfig.getParameter<edm::ParameterSet>("TimingFillerParameters");
83  theTimingFiller_ = std::make_unique<MuonTimingFiller>(timingParameters, consumesCollector());
84 
85  // Load parameters for the ShowerDigiFiller
86  if (fillShowerDigis_ && fillMatching_) {
87  edm::ParameterSet showerDigiParameters = iConfig.getParameter<edm::ParameterSet>("ShowerDigiFillerParameters");
88  theShowerDigiFiller_ = std::make_unique<MuonShowerDigiFiller>(showerDigiParameters, consumesCollector());
89  }
90 
91  if (fillCaloCompatibility_) {
92  // Load MuonCaloCompatibility parameters
93  const auto caloParams = iConfig.getParameter<edm::ParameterSet>("MuonCaloCompatibility");
95  }
96 
97  if (fillIsolation_) {
98  // Load MuIsoExtractor parameters
99  edm::ParameterSet caloExtractorPSet = iConfig.getParameter<edm::ParameterSet>("CaloExtractorPSet");
100  std::string caloExtractorName = caloExtractorPSet.getParameter<std::string>("ComponentName");
102  IsoDepositExtractorFactory::get()->create(caloExtractorName, caloExtractorPSet, consumesCollector());
103 
104  edm::ParameterSet trackExtractorPSet = iConfig.getParameter<edm::ParameterSet>("TrackExtractorPSet");
105  std::string trackExtractorName = trackExtractorPSet.getParameter<std::string>("ComponentName");
107  IsoDepositExtractorFactory::get()->create(trackExtractorName, trackExtractorPSet, consumesCollector());
108 
109  edm::ParameterSet jetExtractorPSet = iConfig.getParameter<edm::ParameterSet>("JetExtractorPSet");
110  std::string jetExtractorName = jetExtractorPSet.getParameter<std::string>("ComponentName");
112  IsoDepositExtractorFactory::get()->create(jetExtractorName, jetExtractorPSet, consumesCollector());
113  }
114  if (fillIsolation_ && writeIsoDeposits_) {
115  trackDepositName_ = iConfig.getParameter<std::string>("trackDepositName");
116  produces<reco::IsoDepositMap>(trackDepositName_);
117  ecalDepositName_ = iConfig.getParameter<std::string>("ecalDepositName");
118  produces<reco::IsoDepositMap>(ecalDepositName_);
119  hcalDepositName_ = iConfig.getParameter<std::string>("hcalDepositName");
120  produces<reco::IsoDepositMap>(hcalDepositName_);
121  hoDepositName_ = iConfig.getParameter<std::string>("hoDepositName");
122  produces<reco::IsoDepositMap>(hoDepositName_);
123  jetDepositName_ = iConfig.getParameter<std::string>("jetDepositName");
124  produces<reco::IsoDepositMap>(jetDepositName_);
125  }
126 
127  inputCollectionLabels_ = iConfig.getParameter<std::vector<edm::InputTag> >("inputCollectionLabels");
128  const auto inputCollectionTypes = iConfig.getParameter<std::vector<std::string> >("inputCollectionTypes");
129  if (inputCollectionLabels_.size() != inputCollectionTypes.size())
130  throw cms::Exception("ConfigurationError")
131  << "Number of input collection labels is different from number of types. "
132  << "For each collection label there should be exactly one collection type specified.";
133  if (inputCollectionLabels_.size() > 7 || inputCollectionLabels_.empty())
134  throw cms::Exception("ConfigurationError") << "Number of input collections should be from 1 to 7.";
135 
136  debugWithTruthMatching_ = iConfig.getParameter<bool>("debugWithTruthMatching");
138  edm::LogWarning("MuonIdentification")
139  << "========================================================================\n"
140  << "Debugging mode with truth matching is turned on!!! Make sure you understand what you are doing!\n"
141  << "========================================================================\n";
142  if (fillGlobalTrackQuality_) {
143  const auto& glbQualTag = iConfig.getParameter<edm::InputTag>("globalTrackQualityInputTag");
144  glbQualToken_ = consumes<edm::ValueMap<reco::MuonQuality> >(glbQualTag);
145  }
146 
147  if (fillTrackerKink_) {
149  std::make_unique<MuonKinkFinder>(iConfig.getParameter<edm::ParameterSet>("TrackerKinkFinderParameters"));
150  }
151 
152  //create mesh holder
153  meshAlgo_ = std::make_unique<MuonMesh>(iConfig.getParameter<edm::ParameterSet>("arbitrationCleanerOptions"));
154 
155  edm::InputTag rpcHitTag("rpcRecHits");
156  rpcHitToken_ = consumes<RPCRecHitCollection>(rpcHitTag);
157 
158  //Consumes... UGH
159  inputCollectionTypes_.resize(inputCollectionLabels_.size());
160  for (unsigned int i = 0; i < inputCollectionLabels_.size(); ++i) {
161  const auto inputLabel = inputCollectionLabels_[i];
162  const auto inputType = ICTypes::toKey(inputCollectionTypes[i]); // Note: thorws exception if type is undefined.
163 
164  if (inputType == ICTypes::INNER_TRACKS) {
165  innerTrackCollectionToken_ = consumes<reco::TrackCollection>(inputLabel);
166  } else if (inputType == ICTypes::OUTER_TRACKS) {
167  outerTrackCollectionToken_ = consumes<reco::TrackCollection>(inputLabel);
168  } else if (inputType == ICTypes::LINKS) {
169  linkCollectionToken_ = consumes<reco::MuonTrackLinksCollection>(inputLabel);
170  } else if (inputType == ICTypes::MUONS) {
171  muonCollectionToken_ = consumes<reco::MuonCollection>(inputLabel);
172  } else if (inputType == ICTypes::TEV_FIRSTHIT) {
173  tpfmsCollectionToken_ = consumes<reco::TrackToTrackMap>(inputLabel);
174  } else if (fillGlobalTrackRefits_ && inputType == ICTypes::TEV_PICKY) {
175  pickyCollectionToken_ = consumes<reco::TrackToTrackMap>(inputLabel);
176  } else if (fillGlobalTrackRefits_ && inputType == ICTypes::TEV_DYT) {
177  dytCollectionToken_ = consumes<reco::TrackToTrackMap>(inputCollectionLabels_.at(i));
178  }
179 
180  inputCollectionTypes_[i] = inputType;
181  }
182 }
std::string hoDepositName_
T getParameter(std::string const &) const
std::string jetDepositName_
edm::EDGetTokenT< reco::TrackCollection > innerTrackCollectionToken_
edm::EDGetTokenT< edm::ValueMap< reco::MuonQuality > > glbQualToken_
std::unique_ptr< MuonKinkFinder > trackerKinkFinder_
edm::EDGetTokenT< RPCRecHitCollection > rpcHitToken_
bool fillCaloCompatibility_
std::string trackDepositName_
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
MuonCaloCompatibility muonCaloCompatibility_
edm::EDGetTokenT< reco::TrackToTrackMap > pickyCollectionToken_
bool arbitrateTrackerMuons_
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > muIsoExtractorTrack_
std::unique_ptr< MuonTimingFiller > theTimingFiller_
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > muIsoExtractorCalo_
edm::EDGetTokenT< reco::TrackToTrackMap > tpfmsCollectionToken_
std::unique_ptr< MuonShowerDigiFiller > theShowerDigiFiller_
double ptThresholdToFillCandidateP4WithGlobalFit_
TrackAssociatorParameters parameters_
std::string ecalDepositName_
edm::EDGetTokenT< reco::MuonCollection > muonCollectionToken_
edm::EDGetTokenT< reco::TrackCollection > outerTrackCollectionToken_
edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkCollectionToken_
#define LogTrace(id)
bool fillGlobalTrackRefits_
static ICTypeKey toKey(const std::string &s)
void configure(const edm::ParameterSet &)
std::vector< ICTypes::ICTypeKey > inputCollectionTypes_
std::vector< edm::InputTag > inputCollectionLabels_
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > muIsoExtractorJet_
bool fillGlobalTrackQuality_
std::string hcalDepositName_
bool storeCrossedHcalRecHits_
double sigmaThresholdToFillCandidateP4WithGlobalFit_
bool debugWithTruthMatching_
std::unique_ptr< MuonMesh > meshAlgo_
edm::EDGetTokenT< reco::TrackToTrackMap > dytCollectionToken_
MuonIdProducer::~MuonIdProducer ( )
override

Definition at line 184 of file MuonIdProducer.cc.

184  {
185  // TimingReport::current()->dump(std::cout);
186 }

Member Function Documentation

bool MuonIdProducer::approxEqual ( const double  a,
const double  b,
const double  tol = 1E-3 
) const
inlineprivate

Definition at line 128 of file MuonIdProducer.h.

References funct::abs().

Referenced by fillArbitrationInfo().

128  {
129  return std::abs(a - b) < tol;
130  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
void MuonIdProducer::arbitrateMuons ( reco::MuonCollection muons,
reco::CaloMuonCollection caloMuons 
)
private

Definition at line 1020 of file MuonIdProducer.cc.

References isGoodCaloMuon(), makeCaloMuon(), minNumberOfMatches_, reco::Muon::PFMuon, reco::Muon::SegmentAndTrackArbitration, and reco::Muon::TrackerMuon.

Referenced by produce().

1020  {
1022  // arbitrate TrackerMuons
1023  // if a muon was exclusively TrackerMuon check if it can be a calo muon
1024  for (reco::MuonCollection::iterator muon = muons->begin(); muon != muons->end();) {
1025  if (muon->isTrackerMuon()) {
1026  if (muon->numberOfMatches(arbitration) < minNumberOfMatches_) {
1027  // TrackerMuon failed arbitration
1028  // If not any other base type - erase the element
1029  // (PFMuon is not a base type)
1030  unsigned int mask = reco::Muon::TrackerMuon | reco::Muon::PFMuon;
1031  if ((muon->type() & (~mask)) == 0) {
1032  const reco::CaloMuon& caloMuon = makeCaloMuon(*muon);
1033  if (isGoodCaloMuon(caloMuon))
1034  caloMuons->push_back(caloMuon);
1035  muon = muons->erase(muon);
1036  continue;
1037  } else {
1038  muon->setType(muon->type() & (~reco::Muon::TrackerMuon));
1039  }
1040  }
1041  }
1042  muon++;
1043  }
1044 }
ArbitrationType
define arbitration schemes
Definition: Muon.h:187
reco::CaloMuon makeCaloMuon(const reco::Muon &)
static const unsigned int TrackerMuon
Definition: Muon.h:285
static const unsigned int PFMuon
Definition: Muon.h:288
fixed size matrix
bool isGoodCaloMuon(const reco::CaloMuon &muon)
void MuonIdProducer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
override

Definition at line 413 of file MuonIdProducer.cc.

References fillMatching_, fillShowerDigis_, edm::EventSetup::get(), meshAlgo_, edm::ESHandle< T >::product(), and theShowerDigiFiller_.

413  {
414  edm::ESHandle<CSCGeometry> geomHandle;
415  iSetup.get<MuonGeometryRecord>().get(geomHandle);
416 
417  meshAlgo_->setCSCGeometry(geomHandle.product());
418 
420  theShowerDigiFiller_->getES(iSetup);
421 }
std::unique_ptr< MuonShowerDigiFiller > theShowerDigiFiller_
T get() const
Definition: EventSetup.h:73
T const * product() const
Definition: ESHandle.h:86
std::unique_ptr< MuonMesh > meshAlgo_
unsigned int MuonIdProducer::chamberId ( const DetId id)
private

Definition at line 370 of file MuonIdProducer.cc.

References CSCDetId::chamberId(), MuonSubdetId::CSC, MuonSubdetId::DT, DetId::Muon, and DetId::rawId().

Referenced by overlap().

370  {
371  if (id.det() != DetId::Muon)
372  return 0;
373 
374  const auto subdetId = id.subdetId();
375  if (subdetId == MuonSubdetId::DT) {
376  return DTChamberId(id.rawId()).rawId();
377  } else if (subdetId == MuonSubdetId::CSC) {
378  return CSCDetId(id.rawId()).chamberId().rawId();
379  }
380 
381  return 0;
382 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
CSCDetId chamberId() const
Definition: CSCDetId.h:47
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12
bool MuonIdProducer::checkLinks ( const reco::MuonTrackLinks links) const
private

Definition at line 1362 of file MuonIdProducer.cc.

References reco::MuonTrackLinks::globalTrack(), edm::Ref< C, T, F >::isNull(), reco::MuonTrackLinks::standAloneTrack(), and reco::MuonTrackLinks::trackerTrack().

Referenced by produce().

1362  {
1363  const bool trackBAD = links->trackerTrack().isNull();
1364  const bool staBAD = links->standAloneTrack().isNull();
1365  const bool glbBAD = links->globalTrack().isNull();
1366  if (trackBAD || staBAD || glbBAD) {
1367  edm::LogWarning("muonIDbadLinks") << "Global muon links to constituent tracks are invalid: trkBad " << trackBAD
1368  << " standaloneBad " << staBAD << " globalBad " << glbBAD
1369  << ". There should be no such object. Muon is skipped.";
1370  return false;
1371  }
1372  return true;
1373 }
bool isNull() const
Checks for null.
Definition: Ref.h:235
void MuonIdProducer::fillArbitrationInfo ( reco::MuonCollection pOutputMuons,
unsigned int  muonType = reco::Muon::TrackerMuon 
)
private

Definition at line 1046 of file MuonIdProducer.cc.

References approxEqual(), arbClean_, reco::MuonSegmentMatch::Arbitrated, reco::MuonSegmentMatch::BelongsToTrackByDR, reco::MuonSegmentMatch::BelongsToTrackByDRSlope, reco::MuonSegmentMatch::BelongsToTrackByDX, reco::MuonSegmentMatch::BelongsToTrackByDXSlope, reco::MuonSegmentMatch::BelongsToTrackByME1aClean, reco::MuonSegmentMatch::BestInChamberByDR, reco::MuonSegmentMatch::BestInChamberByDRSlope, reco::MuonSegmentMatch::BestInChamberByDX, reco::MuonSegmentMatch::BestInChamberByDXSlope, reco::MuonSegmentMatch::BestInStationByDR, reco::MuonSegmentMatch::BestInStationByDRSlope, reco::MuonSegmentMatch::BestInStationByDX, reco::MuonSegmentMatch::BestInStationByDXSlope, relativeConstraints::chamber, MuonSubdetId::CSC, getSegmentMatches(), meshAlgo_, CSCDetId::ring(), plotscripts::stationIndex(), and reco::Muon::TrackerMuon.

Referenced by produce().

1046  {
1047  //
1048  // apply segment flags
1049  //
1050  std::vector<std::pair<reco::MuonChamberMatch*, reco::MuonSegmentMatch*> > chamberPairs; // for chamber segment sorting
1051  std::vector<std::pair<reco::MuonChamberMatch*, reco::MuonSegmentMatch*> > stationPairs; // for station segment sorting
1052  std::vector<std::pair<reco::MuonChamberMatch*, reco::MuonSegmentMatch*> >
1053  arbitrationPairs; // for muon segment arbitration
1054 
1055  // muonIndex1
1056  for (unsigned int muonIndex1 = 0; muonIndex1 < pOutputMuons->size(); ++muonIndex1) {
1057  auto& muon1 = pOutputMuons->at(muonIndex1);
1058  // chamberIter1
1059  for (auto& chamber1 : muon1.matches()) {
1060  // segmentIter1
1061  std::vector<reco::MuonSegmentMatch>* segmentMatches1 = getSegmentMatches(chamber1, muonType);
1062 
1063  if (segmentMatches1->empty())
1064  continue;
1065  chamberPairs.clear();
1066 
1067  for (auto& segment1 : *segmentMatches1) {
1068  chamberPairs.push_back(std::make_pair(&chamber1, &segment1));
1069  if (!segment1.isMask()) // has not yet been arbitrated
1070  {
1071  arbitrationPairs.clear();
1072  arbitrationPairs.push_back(std::make_pair(&chamber1, &segment1));
1073 
1074  // find identical segments with which to arbitrate
1075  // tracker muons only
1076  if (muon1.type() & muonType) {
1077  // muonIndex2
1078  for (unsigned int muonIndex2 = muonIndex1 + 1; muonIndex2 < pOutputMuons->size(); ++muonIndex2) {
1079  auto& muon2 = pOutputMuons->at(muonIndex2);
1080  // tracker muons only
1081  if (!(muon2.type() & muonType))
1082  continue;
1083  // chamberIter2
1084  for (auto& chamber2 : muon2.matches()) {
1085  // segmentIter2
1086  std::vector<reco::MuonSegmentMatch>* segmentMatches2 = getSegmentMatches(chamber2, muonType);
1087  for (auto& segment2 : *segmentMatches2) {
1088  if (segment2.isMask())
1089  continue; // has already been arbitrated
1090  if (approxEqual(segment2.x, segment1.x) && approxEqual(segment2.y, segment1.y) &&
1091  approxEqual(segment2.dXdZ, segment1.dXdZ) && approxEqual(segment2.dYdZ, segment1.dYdZ) &&
1092  approxEqual(segment2.xErr, segment1.xErr) && approxEqual(segment2.yErr, segment1.yErr) &&
1093  approxEqual(segment2.dXdZErr, segment1.dXdZErr) &&
1094  approxEqual(segment2.dYdZErr, segment1.dYdZErr)) {
1095  arbitrationPairs.push_back(std::make_pair(&chamber2, &segment2));
1096  }
1097  } // segmentIter2
1098  } // chamberIter2
1099  } // muonIndex2
1100  }
1101 
1102  // arbitration segment sort
1103  if (arbitrationPairs.empty())
1104  continue; // this should never happen
1105  if (arbitrationPairs.size() == 1) {
1106  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDRSlope);
1107  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDXSlope);
1108  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDR);
1109  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDX);
1110  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::Arbitrated);
1111  } else {
1112  sort(arbitrationPairs.begin(),
1113  arbitrationPairs.end(),
1115  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDRSlope);
1116  sort(arbitrationPairs.begin(),
1117  arbitrationPairs.end(),
1119  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDXSlope);
1120  sort(arbitrationPairs.begin(),
1121  arbitrationPairs.end(),
1123  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDR);
1124  sort(arbitrationPairs.begin(),
1125  arbitrationPairs.end(),
1127  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDX);
1128  for (auto& ap : arbitrationPairs) {
1129  ap.second->setMask(reco::MuonSegmentMatch::Arbitrated);
1130  }
1131  }
1132  }
1133 
1134  // setup me1a cleaning for later
1135  if (muonType == reco::Muon::TrackerMuon && chamber1.id.subdetId() == MuonSubdetId::CSC && arbClean_ &&
1136  CSCDetId(chamber1.id).ring() == 4) {
1137  for (auto& segment2 : chamber1.segmentMatches) {
1138  if (segment1.cscSegmentRef.isNull() || segment2.cscSegmentRef.isNull())
1139  continue;
1140  if (meshAlgo_->isDuplicateOf(segment1.cscSegmentRef, segment2.cscSegmentRef) &&
1141  (segment2.mask & 0x1e0000) && (segment1.mask & 0x1e0000)) {
1143  //if the track has lost the segment already through normal arbitration no need to do it again.
1144  }
1145  }
1146  } // mark all ME1/a duplicates that this track owns
1147 
1148  } // segmentIter1
1149 
1150  // chamber segment sort
1151  if (chamberPairs.empty())
1152  continue; // this should never happen
1153  if (chamberPairs.size() == 1) {
1154  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDRSlope);
1155  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDXSlope);
1156  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDR);
1157  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDX);
1158  } else {
1159  sort(chamberPairs.begin(),
1160  chamberPairs.end(),
1162  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDRSlope);
1163  sort(chamberPairs.begin(),
1164  chamberPairs.end(),
1166  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDXSlope);
1167  sort(chamberPairs.begin(),
1168  chamberPairs.end(),
1170  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDR);
1171  sort(chamberPairs.begin(),
1172  chamberPairs.end(),
1174  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDX);
1175  }
1176  } // chamberIter1
1177 
1178  // station segment sort
1179  for (int stationIndex = 1; stationIndex < 5; ++stationIndex) {
1180  for (int detectorIndex = 1; detectorIndex <= 5;
1181  ++detectorIndex) // 1-5, as in DataFormats/MuonDetId/interface/MuonSubdetId.h
1182  {
1183  stationPairs.clear();
1184 
1185  // chamberIter
1186  for (auto& chamber : muon1.matches()) {
1187  if (!(chamber.station() == stationIndex && chamber.detector() == detectorIndex))
1188  continue;
1189  std::vector<reco::MuonSegmentMatch>* segmentMatches = getSegmentMatches(chamber, muonType);
1190  if (segmentMatches->empty())
1191  continue;
1192 
1193  for (auto& segment : *segmentMatches) {
1194  stationPairs.push_back(std::make_pair(&chamber, &segment));
1195  }
1196  } // chamberIter
1197 
1198  if (stationPairs.empty())
1199  continue; // this may very well happen
1200  if (stationPairs.size() == 1) {
1201  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDRSlope);
1202  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDXSlope);
1203  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDR);
1204  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDX);
1205  } else {
1206  sort(stationPairs.begin(),
1207  stationPairs.end(),
1209  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDRSlope);
1210  sort(stationPairs.begin(),
1211  stationPairs.end(),
1213  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDXSlope);
1214  sort(stationPairs.begin(),
1215  stationPairs.end(),
1217  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDR);
1218  sort(stationPairs.begin(),
1219  stationPairs.end(),
1221  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDX);
1222  }
1223  }
1224  }
1225 
1226  } // muonIndex1
1227 
1228  if (arbClean_) {
1229  // clear old mesh, create and prune new mesh!
1230  meshAlgo_->clearMesh();
1231  meshAlgo_->runMesh(pOutputMuons);
1232  }
1233 }
static const unsigned int BelongsToTrackByME1aClean
static const unsigned int Arbitrated
segment mask flags
std::vector< reco::MuonSegmentMatch > * getSegmentMatches(reco::MuonChamberMatch &chamber, unsigned int muonType) const
get the segment matches of the appropriate type
static const unsigned int BestInStationByDRSlope
static const unsigned int BelongsToTrackByDXSlope
static const unsigned int BestInStationByDR
bool approxEqual(const double a, const double b, const double tol=1E-3) const
static const unsigned int BestInChamberByDX
def stationIndex(name)
Definition: plotscripts.py:355
static const unsigned int BestInChamberByDR
static const unsigned int BestInStationByDXSlope
static const unsigned int BestInChamberByDXSlope
int ring() const
Definition: CSCDetId.h:68
static const unsigned int TrackerMuon
Definition: Muon.h:285
static const unsigned int BelongsToTrackByDRSlope
static const unsigned int BelongsToTrackByDR
static const unsigned int BelongsToTrackByDX
functor predicate for standard library sort algorithm
static const unsigned int BestInStationByDX
static constexpr int CSC
Definition: MuonSubdetId.h:12
static const unsigned int BestInChamberByDRSlope
std::unique_ptr< MuonMesh > meshAlgo_
void MuonIdProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 1375 of file MuonIdProducer.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), HLT_2018_cff::InputTag, and edm::ParameterSetDescription::setAllowAnything().

1375  {
1377  desc.setAllowAnything();
1378 
1379  desc.add<bool>("arbitrateTrackerMuons", false);
1380  desc.add<bool>("storeCrossedHcalRecHits", false);
1381  desc.add<bool>("fillShowerDigis", false);
1382 
1383  edm::ParameterSetDescription descTrkAsoPar;
1384  descTrkAsoPar.add<edm::InputTag>("GEMSegmentCollectionLabel", edm::InputTag("gemSegments"));
1385  descTrkAsoPar.add<edm::InputTag>("ME0SegmentCollectionLabel", edm::InputTag("me0Segments"));
1386  descTrkAsoPar.add<bool>("useGEM", false);
1387  descTrkAsoPar.add<bool>("useME0", false);
1388  descTrkAsoPar.setAllowAnything();
1389  desc.add<edm::ParameterSetDescription>("TrackAssociatorParameters", descTrkAsoPar);
1390 
1392  descJet.setAllowAnything();
1393  descJet.add<edm::ParameterSetDescription>("TrackAssociatorParameters", descTrkAsoPar);
1394  desc.add<edm::ParameterSetDescription>("JetExtractorPSet", descJet);
1395 
1397  descCalo.setAllowAnything();
1398  descCalo.add<edm::ParameterSetDescription>("TrackAssociatorParameters", descTrkAsoPar);
1399  desc.add<edm::ParameterSetDescription>("CaloExtractorPSet", descCalo);
1400 
1401  descriptions.addDefault(desc);
1402 }
void setAllowAnything()
allow any parameter label/value pairs
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void MuonIdProducer::fillGlbQuality ( edm::Event iEvent,
const edm::EventSetup iSetup,
reco::Muon aMuon 
)
private

Definition at line 1341 of file MuonIdProducer.cc.

References reco::Muon::combinedMuon(), reco::Muon::combinedQuality(), edm::HandleBase::failedToGet(), glbQualHandle_, reco::Muon::isGlobalMuon(), edm::HandleBase::isValid(), LogDebug, reco::Muon::setCombinedQuality(), and reco::MuonQuality::trkRelChi2.

Referenced by produce().

1341  {
1343  aMuon.setCombinedQuality((*glbQualHandle_)[aMuon.combinedMuon()]);
1344  }
1345 
1346  LogDebug("MuonIdentification") << "tkChiVal " << aMuon.combinedQuality().trkRelChi2;
1347 }
#define LogDebug(id)
float trkRelChi2
chi2 value for the inner track stub with respect to the global track
Definition: MuonQuality.h:15
bool isGlobalMuon() const override
Definition: Muon.h:298
MuonQuality combinedQuality() const
get energy deposition information
Definition: Muon.h:119
bool isValid() const
Definition: HandleBase.h:70
bool failedToGet() const
Definition: HandleBase.h:72
TrackRef combinedMuon() const override
reference to a stand-alone muon Track
Definition: Muon.h:52
void setCombinedQuality(const MuonQuality &combinedQuality)
set energy deposition information
Definition: Muon.h:121
edm::Handle< edm::ValueMap< reco::MuonQuality > > glbQualHandle_
void MuonIdProducer::fillMuonId ( edm::Event iEvent,
const edm::EventSetup iSetup,
reco::Muon aMuon,
TrackDetectorAssociator::Direction  direction = TrackDetectorAssociator::InsideOut 
)
private

Definition at line 793 of file MuonIdProducer.cc.

References funct::abs(), TrackDetectorAssociator::associate(), reco::MuonRPCHitMatch::bx, relativeConstraints::chamber, TrackDetMatchInfo::chambers, reco::HcalMuonRecHit::chi2, TrackDetMatchInfo::crossedEcalIds, TrackDetMatchInfo::crossedEnergy(), reco::MuonEnergy::crossedHadRecHits, TrackDetMatchInfo::crossedHcalIds, TrackDetMatchInfo::crossedHcalRecHits, reco::MuonSegmentMatch::cscSegmentRef, reco::HcalMuonRecHit::detId, reco::MuonSegmentMatch::dtSegmentRef, reco::MuonChamberMatch::dXdZ, reco::MuonSegmentMatch::dXdZ, reco::MuonChamberMatch::dXdZErr, reco::MuonSegmentMatch::dXdZErr, reco::MuonChamberMatch::dYdZ, reco::MuonSegmentMatch::dYdZ, reco::MuonChamberMatch::dYdZErr, reco::MuonSegmentMatch::dYdZErr, reco::MuonEnergy::ecal_id, reco::MuonEnergy::ecal_position, reco::MuonEnergy::ecal_time, TrackDetMatchInfo::EcalRecHits, TrackDetMatchInfo::ecalRecHits, reco::MuonChamberMatch::edgeX, reco::MuonChamberMatch::edgeY, reco::MuonEnergy::em, reco::MuonEnergy::emMax, reco::MuonEnergy::emS25, reco::MuonEnergy::emS9, reco::HcalMuonRecHit::energy, Exception, fillEnergy_, fillMatching_, fillShowerDigis_, TrackDetMatchInfo::findMaxDeposition(), MuonSubdetId::GEM, reco::MuonChamberMatch::gemMatches, reco::MuonSegmentMatch::gemSegmentRef, edm::Ref< C, T, F >::get(), reco::MuonEnergy::had, reco::MuonEnergy::hadMax, reco::MuonEnergy::hadS9, reco::MuonSegmentMatch::hasPhi_, reco::MuonSegmentMatch::hasZed_, reco::MuonEnergy::hcal_id, reco::MuonEnergy::hcal_position, reco::MuonEnergy::hcal_time, TrackDetMatchInfo::HcalRecHits, TrackDetMatchInfo::hcalRecHits, reco::MuonEnergy::ho, TrackDetMatchInfo::HORecHits, reco::MuonEnergy::hoS9, reco::MuonChamberMatch::id, hit::id, info(), edm::Ref< C, T, F >::isNonnull(), reco::Muon::isRPCMuon(), reco::Muon::isTrackerMuon(), edm::HandleBase::isValid(), LogTrace, reco::MuonRPCHitMatch::mask, reco::MuonSegmentMatch::mask, reco::Muon::matches(), maxAbsDx_, maxAbsDy_, maxAbsPullX_, maxAbsPullY_, MuonSubdetId::ME0, reco::MuonChamberMatch::me0Matches, reco::MuonSegmentMatch::me0SegmentRef, reco::Muon::NoArbitration, reco::Muon::numberOfMatches(), TrackDetMatchInfo::nXnEnergy(), or, parameters_, rpcHitHandle_, reco::MuonChamberMatch::rpcMatches, reco::MuonChamberMatch::segmentMatches, reco::Muon::setCalEnergy(), reco::Muon::setMatches(), mathSSE::sqrt(), reco::Muon::standAloneMuon(), storeCrossedHcalRecHits_, DetId::subdetId(), reco::MuonSegmentMatch::t0, theShowerDigiFiller_, reco::HcalMuonRecHit::time, reco::MuonEnergy::tower, reco::MuonEnergy::towerS9, TrackDetMatchInfo::TowerTotal, reco::Muon::track(), HLT_2018_cff::track, trackAssociator_, TrackDetMatchInfo::trkGlobPosAtEcal, TrackDetMatchInfo::trkGlobPosAtHcal, reco::MuonRPCHitMatch::x, reco::MuonChamberMatch::x, reco::MuonSegmentMatch::x, reco::MuonChamberMatch::xErr, reco::MuonSegmentMatch::xErr, LocalError::xx(), reco::MuonChamberMatch::y, reco::MuonSegmentMatch::y, reco::MuonChamberMatch::yErr, reco::MuonSegmentMatch::yErr, and LocalError::yy().

Referenced by produce().

796  {
797  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId";
798 
799  // perform track - detector association
800  const reco::Track* track = nullptr;
801  if (aMuon.track().isNonnull())
802  track = aMuon.track().get();
803  else if (aMuon.standAloneMuon().isNonnull())
804  track = aMuon.standAloneMuon().get();
805  else
806  throw cms::Exception("FatalError")
807  << "Failed to fill muon id information for a muon with undefined references to tracks";
808 
809  TrackDetMatchInfo info = trackAssociator_.associate(iEvent, iSetup, *track, parameters_, direction);
810 
811  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId :: fillEnergy = " << fillEnergy_;
812 
813  if (fillEnergy_) {
814  reco::MuonEnergy muonEnergy;
817  muonEnergy.ho = info.crossedEnergy(TrackDetMatchInfo::HORecHits);
819  muonEnergy.emS9 = info.nXnEnergy(TrackDetMatchInfo::EcalRecHits, 1); // 3x3 energy
820  muonEnergy.emS25 = info.nXnEnergy(TrackDetMatchInfo::EcalRecHits, 2); // 5x5 energy
821  muonEnergy.hadS9 = info.nXnEnergy(TrackDetMatchInfo::HcalRecHits, 1); // 3x3 energy
822  muonEnergy.hoS9 = info.nXnEnergy(TrackDetMatchInfo::HORecHits, 1); // 3x3 energy
823  muonEnergy.towerS9 = info.nXnEnergy(TrackDetMatchInfo::TowerTotal, 1); // 3x3 energy
825  muonEnergy.crossedHadRecHits.clear();
826  for (auto hit : info.crossedHcalRecHits) {
828  mhit.energy = hit->energy();
829  mhit.chi2 = hit->chi2();
830  mhit.time = hit->time();
831  mhit.detId = hit->id();
832  muonEnergy.crossedHadRecHits.push_back(mhit);
833  }
834  }
835  muonEnergy.ecal_position = info.trkGlobPosAtEcal;
836  muonEnergy.hcal_position = info.trkGlobPosAtHcal;
837  if (!info.crossedEcalIds.empty())
838  muonEnergy.ecal_id = info.crossedEcalIds.front();
839  if (!info.crossedHcalIds.empty())
840  muonEnergy.hcal_id = info.crossedHcalIds.front();
841  // find maximal energy depositions and their time
842  DetId emMaxId = info.findMaxDeposition(TrackDetMatchInfo::EcalRecHits, 2); // max energy deposit in 5x5 shape
843  for (const auto& hit : info.ecalRecHits) {
844  if (hit->id() != emMaxId)
845  continue;
846  muonEnergy.emMax = hit->energy();
847  muonEnergy.ecal_time = hit->time();
848  }
849  DetId hadMaxId = info.findMaxDeposition(TrackDetMatchInfo::HcalRecHits, 1); // max energy deposit in 3x3 shape
850  for (const auto& hit : info.hcalRecHits) {
851  if (hit->id() != hadMaxId)
852  continue;
853  muonEnergy.hadMax = hit->energy();
854  muonEnergy.hcal_time = hit->time();
855  }
856  aMuon.setCalEnergy(muonEnergy);
857  }
858  if (!fillMatching_ && !aMuon.isTrackerMuon() && !aMuon.isRPCMuon())
859  return;
860 
861  // fill muon match info
862  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId :: fill muon match info ";
863  std::vector<reco::MuonChamberMatch> muonChamberMatches;
864  unsigned int nubmerOfMatchesAccordingToTrackAssociator = 0;
865  for (const auto& chamber : info.chambers) {
866  if (chamber.id.subdetId() == 3 && rpcHitHandle_.isValid())
867  continue; // Skip RPC chambers, they are taken care of below)
868  reco::MuonChamberMatch matchedChamber;
869 
870  const auto& lErr = chamber.tState.localError();
871  const auto& lPos = chamber.tState.localPosition();
872  const auto& lDir = chamber.tState.localDirection();
873 
874  const auto& localError = lErr.positionError();
875  matchedChamber.x = lPos.x();
876  matchedChamber.y = lPos.y();
877  matchedChamber.xErr = sqrt(localError.xx());
878  matchedChamber.yErr = sqrt(localError.yy());
879 
880  matchedChamber.dXdZ = lDir.z() != 0 ? lDir.x() / lDir.z() : 9999;
881  matchedChamber.dYdZ = lDir.z() != 0 ? lDir.y() / lDir.z() : 9999;
882  // DANGEROUS - compiler cannot guaranty parameters ordering
883  AlgebraicSymMatrix55 trajectoryCovMatrix = lErr.matrix();
884  matchedChamber.dXdZErr = trajectoryCovMatrix(1, 1) > 0 ? sqrt(trajectoryCovMatrix(1, 1)) : 0;
885  matchedChamber.dYdZErr = trajectoryCovMatrix(2, 2) > 0 ? sqrt(trajectoryCovMatrix(2, 2)) : 0;
886 
887  matchedChamber.edgeX = chamber.localDistanceX;
888  matchedChamber.edgeY = chamber.localDistanceY;
889 
890  matchedChamber.id = chamber.id;
891 
892  if (fillShowerDigis_) {
893  theShowerDigiFiller_->fill(matchedChamber);
894  } else {
895  theShowerDigiFiller_->fillDefault(matchedChamber);
896  }
897 
898  if (!chamber.segments.empty())
899  ++nubmerOfMatchesAccordingToTrackAssociator;
900 
901  // fill segments
902  for (const auto& segment : chamber.segments) {
903  reco::MuonSegmentMatch matchedSegment;
904  matchedSegment.x = segment.segmentLocalPosition.x();
905  matchedSegment.y = segment.segmentLocalPosition.y();
906  matchedSegment.dXdZ =
907  segment.segmentLocalDirection.z() ? segment.segmentLocalDirection.x() / segment.segmentLocalDirection.z() : 0;
908  matchedSegment.dYdZ =
909  segment.segmentLocalDirection.z() ? segment.segmentLocalDirection.y() / segment.segmentLocalDirection.z() : 0;
910  matchedSegment.xErr = segment.segmentLocalErrorXX > 0 ? sqrt(segment.segmentLocalErrorXX) : 0;
911  matchedSegment.yErr = segment.segmentLocalErrorYY > 0 ? sqrt(segment.segmentLocalErrorYY) : 0;
912  matchedSegment.dXdZErr = segment.segmentLocalErrorDxDz > 0 ? sqrt(segment.segmentLocalErrorDxDz) : 0;
913  matchedSegment.dYdZErr = segment.segmentLocalErrorDyDz > 0 ? sqrt(segment.segmentLocalErrorDyDz) : 0;
914  matchedSegment.t0 = segment.t0;
915  matchedSegment.mask = 0;
916  matchedSegment.dtSegmentRef = segment.dtSegmentRef;
917  matchedSegment.cscSegmentRef = segment.cscSegmentRef;
918  matchedSegment.gemSegmentRef = segment.gemSegmentRef;
919  matchedSegment.me0SegmentRef = segment.me0SegmentRef;
920  matchedSegment.hasZed_ = segment.hasZed;
921  matchedSegment.hasPhi_ = segment.hasPhi;
922  // test segment
923  bool matchedX = false;
924  bool matchedY = false;
925  LogTrace("MuonIdentification") << " matching local x, segment x: " << matchedSegment.x
926  << ", chamber x: " << matchedChamber.x << ", max: " << maxAbsDx_;
927  LogTrace("MuonIdentification") << " matching local y, segment y: " << matchedSegment.y
928  << ", chamber y: " << matchedChamber.y << ", max: " << maxAbsDy_;
929  const double matchedSegChDx = std::abs(matchedSegment.x - matchedChamber.x);
930  const double matchedSegChDy = std::abs(matchedSegment.y - matchedChamber.y);
931  const double matchedSegChPullX = matchedSegChDx / std::hypot(matchedSegment.xErr, matchedChamber.xErr);
932  const double matchedSegChPullY = matchedSegChDy / std::hypot(matchedSegment.yErr, matchedChamber.yErr);
933  if (matchedSegment.xErr > 0 && matchedChamber.xErr > 0)
934  LogTrace("MuonIdentification") << " xpull: " << matchedSegChPullX;
935  if (matchedSegment.yErr > 0 && matchedChamber.yErr > 0)
936  LogTrace("MuonIdentification") << " ypull: " << matchedSegChPullY;
937 
938  if (matchedSegChDx < maxAbsDx_)
939  matchedX = true;
940  if (matchedSegChDy < maxAbsDy_)
941  matchedY = true;
942  if (matchedSegment.xErr > 0 && matchedChamber.xErr > 0 && matchedSegChPullX < maxAbsPullX_)
943  matchedX = true;
944  if (matchedSegment.yErr > 0 && matchedChamber.yErr > 0 && matchedSegChPullY < maxAbsPullY_)
945  matchedY = true;
946  if (matchedX && matchedY) {
947  if (matchedChamber.id.subdetId() == MuonSubdetId::ME0)
948  matchedChamber.me0Matches.push_back(matchedSegment);
949  else if (matchedChamber.id.subdetId() == MuonSubdetId::GEM)
950  matchedChamber.gemMatches.push_back(matchedSegment);
951  else
952  matchedChamber.segmentMatches.push_back(matchedSegment);
953  }
954  }
955  muonChamberMatches.push_back(matchedChamber);
956  }
957 
958  // Fill RPC info
959  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId :: fill RPC info";
960  if (rpcHitHandle_.isValid()) {
961  for (const auto& chamber : info.chambers) {
962  if (chamber.id.subdetId() != 3)
963  continue; // Consider RPC chambers only
964  const auto& lErr = chamber.tState.localError();
965  const auto& lPos = chamber.tState.localPosition();
966  const auto& lDir = chamber.tState.localDirection();
967 
968  reco::MuonChamberMatch matchedChamber;
969 
970  LocalError localError = lErr.positionError();
971  matchedChamber.x = lPos.x();
972  matchedChamber.y = lPos.y();
973  matchedChamber.xErr = sqrt(localError.xx());
974  matchedChamber.yErr = sqrt(localError.yy());
975 
976  matchedChamber.dXdZ = lDir.z() != 0 ? lDir.x() / lDir.z() : 9999;
977  matchedChamber.dYdZ = lDir.z() != 0 ? lDir.y() / lDir.z() : 9999;
978  // DANGEROUS - compiler cannot guaranty parameters ordering
979  AlgebraicSymMatrix55 trajectoryCovMatrix = lErr.matrix();
980  matchedChamber.dXdZErr = trajectoryCovMatrix(1, 1) > 0 ? sqrt(trajectoryCovMatrix(1, 1)) : 0;
981  matchedChamber.dYdZErr = trajectoryCovMatrix(2, 2) > 0 ? sqrt(trajectoryCovMatrix(2, 2)) : 0;
982 
983  matchedChamber.edgeX = chamber.localDistanceX;
984  matchedChamber.edgeY = chamber.localDistanceY;
985 
986  theShowerDigiFiller_->fillDefault(matchedChamber);
987 
988  matchedChamber.id = chamber.id;
989 
990  for (const auto& rpcRecHit : *rpcHitHandle_) {
991  reco::MuonRPCHitMatch rpcHitMatch;
992 
993  if (rpcRecHit.rawId() != chamber.id.rawId())
994  continue;
995 
996  rpcHitMatch.x = rpcRecHit.localPosition().x();
997  rpcHitMatch.mask = 0;
998  rpcHitMatch.bx = rpcRecHit.BunchX();
999 
1000  const double absDx = std::abs(rpcRecHit.localPosition().x() - chamber.tState.localPosition().x());
1001  if (absDx <= 20 or absDx / sqrt(localError.xx()) <= 4)
1002  matchedChamber.rpcMatches.push_back(rpcHitMatch);
1003  }
1004 
1005  muonChamberMatches.push_back(matchedChamber);
1006  }
1007  }
1008 
1009  aMuon.setMatches(muonChamberMatches);
1010 
1011  LogTrace("MuonIdentification") << "number of muon chambers: " << aMuon.matches().size() << "\n"
1012  << "number of chambers with segments according to the associator requirements: "
1013  << nubmerOfMatchesAccordingToTrackAssociator;
1014  LogTrace("MuonIdentification") << "number of segment matches with the producer requirements: "
1016 
1017  // fillTime( iEvent, iSetup, aMuon );
1018 }
float xx() const
Definition: LocalError.h:22
GEMSegmentRef gemSegmentRef
DTRecSegment4DRef dtSegmentRef
static const TGPicture * info(bool iBackgroundIsBlack)
TrackRef track() const override
reference to a Track
Definition: Muon.h:46
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
static constexpr int GEM
Definition: MuonSubdetId.h:14
std::vector< reco::MuonSegmentMatch > gemMatches
TrackDetectorAssociator trackAssociator_
CSCSegmentRef cscSegmentRef
std::vector< const HBHERecHit * > crossedHcalRecHits
std::vector< const EcalRecHit * > ecalRecHits
hits in the cone
std::vector< DetId > crossedEcalIds
DetId findMaxDeposition(EnergyType)
Find detector elements with highest energy deposition.
float emS9
energy deposited in 3x3 ECAL crystal shape around central crystal
Definition: MuonEnergy.h:28
void setCalEnergy(const MuonEnergy &calEnergy)
set energy deposition information
Definition: Muon.h:108
std::vector< DetId > crossedHcalIds
double nXnEnergy(const DetId &, EnergyType, int gridSize=1)
get energy of the NxN shape (N = 2*gridSize + 1) around given detector element
float towerS9
total energy in 3x3 tower shape
Definition: MuonEnergy.h:22
math::XYZPoint trkGlobPosAtHcal
float ecal_time
Calorimeter timing.
Definition: MuonEnergy.h:47
float ho
energy deposited in crossed HO towers
Definition: MuonEnergy.h:42
bool isTrackerMuon() const override
Definition: Muon.h:299
bool isRPCMuon() const
Definition: Muon.h:303
DetId hcal_id
DetId of the central HCAL tower with smallest depth.
Definition: MuonEnergy.h:60
std::vector< reco::MuonSegmentMatch > me0Matches
std::unique_ptr< MuonShowerDigiFiller > theShowerDigiFiller_
TrackAssociatorParameters parameters_
float yy() const
Definition: LocalError.h:24
float emS25
energy deposited in 5x5 ECAL crystal shape around central crystal
Definition: MuonEnergy.h:30
T sqrt(T t)
Definition: SSEVec.h:19
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
std::vector< TAMuonChamberMatch > chambers
std::vector< const HBHERecHit * > hcalRecHits
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::Handle< RPCRecHitCollection > rpcHitHandle_
float hoS9
energy deposited in 3x3 HO tower shape around central tower
Definition: MuonEnergy.h:44
std::vector< reco::MuonRPCHitMatch > rpcMatches
static constexpr int ME0
Definition: MuonSubdetId.h:15
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
ME0SegmentRef me0SegmentRef
bool isValid() const
Definition: HandleBase.h:70
double crossedEnergy(EnergyType)
energy in detector elements crossed by the track by types
#define LogTrace(id)
math::XYZPointF hcal_position
Definition: MuonEnergy.h:54
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
Definition: Muon.h:49
unsigned int id
float emMax
maximal energy of ECAL crystal in the 5x5 shape
Definition: MuonEnergy.h:32
Definition: DetId.h:17
float hadMax
maximal energy of HCAL tower in the 3x3 shape
Definition: MuonEnergy.h:40
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
std::vector< MuonChamberMatch > & matches()
get muon matching information
Definition: Muon.h:145
std::vector< reco::MuonSegmentMatch > segmentMatches
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
DetId ecal_id
DetId of the central ECAL crystal.
Definition: MuonEnergy.h:57
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
bool storeCrossedHcalRecHits_
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
std::vector< HcalMuonRecHit > crossedHadRecHits
Definition: MuonEnergy.h:66
void setMatches(const std::vector< MuonChamberMatch > &matches)
set muon matching information
Definition: Muon.h:148
math::XYZPointF ecal_position
Trajectory position at the calorimeter.
Definition: MuonEnergy.h:53
float hadS9
energy deposited in 3x3 HCAL tower shape around central tower
Definition: MuonEnergy.h:38
void MuonIdProducer::fillMuonIsolation ( edm::Event iEvent,
const edm::EventSetup iSetup,
reco::Muon aMuon,
reco::IsoDeposit trackDep,
reco::IsoDeposit ecalDep,
reco::IsoDeposit hcalDep,
reco::IsoDeposit hoDep,
reco::IsoDeposit jetDep 
)
private

Definition at line 1235 of file MuonIdProducer.cc.

References reco::IsoDeposit::candEnergy(), reco::IsoDeposit::depositAndCountWithin(), reco::IsoDeposit::depositWithin(), reco::MuonIsolation::emEt, reco::MuonIsolation::emVetoEt, Exception, edm::Ref< C, T, F >::get(), reco::MuonIsolation::hadEt, reco::MuonIsolation::hadVetoEt, reco::MuonIsolation::hoEt, reco::MuonIsolation::hoVetoEt, edm::Ref< C, T, F >::isNonnull(), LogTrace, muIsoExtractorCalo_, muIsoExtractorJet_, muIsoExtractorTrack_, reco::MuonIsolation::nJets, reco::MuonIsolation::nTracks, reco::Muon::setIsolation(), reco::Muon::standAloneMuon(), reco::MuonIsolation::sumPt, reco::Muon::track(), HLT_2018_cff::track, reco::MuonIsolation::trackerVetoPt, and writeIsoDeposits_.

Referenced by produce().

1242  {
1243  const reco::Track* track = nullptr;
1244  if (aMuon.track().isNonnull())
1245  track = aMuon.track().get();
1246  else if (aMuon.standAloneMuon().isNonnull())
1247  track = aMuon.standAloneMuon().get();
1248  else
1249  throw cms::Exception("FatalError")
1250  << "Failed to compute muon isolation information for a muon with undefined references to tracks";
1251 
1252  reco::MuonIsolation isoR03, isoR05;
1253 
1254  // get deposits
1255  reco::IsoDeposit depTrk = muIsoExtractorTrack_->deposit(iEvent, iSetup, *track);
1256  std::vector<reco::IsoDeposit> caloDeps = muIsoExtractorCalo_->deposits(iEvent, iSetup, *track);
1257  reco::IsoDeposit depJet = muIsoExtractorJet_->deposit(iEvent, iSetup, *track);
1258 
1259  if (caloDeps.size() != 3) {
1260  LogTrace("MuonIdentification") << "Failed to fill vector of calorimeter isolation deposits!";
1261  return;
1262  }
1263 
1264  reco::IsoDeposit depEcal = caloDeps.at(0);
1265  reco::IsoDeposit depHcal = caloDeps.at(1);
1266  reco::IsoDeposit depHo = caloDeps.at(2);
1267 
1268  //no need to copy outside if we don't write them
1269  if (writeIsoDeposits_) {
1270  trackDep = depTrk;
1271  ecalDep = depEcal;
1272  hcalDep = depHcal;
1273  hoDep = depHo;
1274  jetDep = depJet;
1275  }
1276 
1277  isoR03.sumPt = depTrk.depositWithin(0.3);
1278  isoR03.emEt = depEcal.depositWithin(0.3);
1279  isoR03.hadEt = depHcal.depositWithin(0.3);
1280  isoR03.hoEt = depHo.depositWithin(0.3);
1281  isoR03.nTracks = depTrk.depositAndCountWithin(0.3).second;
1282  isoR03.nJets = depJet.depositAndCountWithin(0.3).second;
1283  isoR03.trackerVetoPt = depTrk.candEnergy();
1284  isoR03.emVetoEt = depEcal.candEnergy();
1285  isoR03.hadVetoEt = depHcal.candEnergy();
1286  isoR03.hoVetoEt = depHo.candEnergy();
1287 
1288  isoR05.sumPt = depTrk.depositWithin(0.5);
1289  isoR05.emEt = depEcal.depositWithin(0.5);
1290  isoR05.hadEt = depHcal.depositWithin(0.5);
1291  isoR05.hoEt = depHo.depositWithin(0.5);
1292  isoR05.nTracks = depTrk.depositAndCountWithin(0.5).second;
1293  isoR05.nJets = depJet.depositAndCountWithin(0.5).second;
1294  isoR05.trackerVetoPt = depTrk.candEnergy();
1295  isoR05.emVetoEt = depEcal.candEnergy();
1296  isoR05.hadVetoEt = depHcal.candEnergy();
1297  isoR05.hoVetoEt = depHo.candEnergy();
1298 
1299  aMuon.setIsolation(isoR03, isoR05);
1300 }
float hadEt
hcal sum-Et
Definition: MuonIsolation.h:8
double candEnergy() const
Get energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:129
TrackRef track() const override
reference to a Track
Definition: Muon.h:46
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
float sumPt
sum-pt of tracks
Definition: MuonIsolation.h:6
float hadVetoEt
hcal sum-et in the veto region in r-phi
Definition: MuonIsolation.h:14
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > muIsoExtractorTrack_
double depositWithin(double coneSize, const Vetos &vetos=Vetos(), bool skipDepositVeto=false) const
Get deposit.
Definition: IsoDeposit.cc:29
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > muIsoExtractorCalo_
float emEt
ecal sum-Et
Definition: MuonIsolation.h:7
int nJets
number of jets in the cone
Definition: MuonIsolation.h:11
float hoEt
ho sum-Et
Definition: MuonIsolation.h:9
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
#define LogTrace(id)
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
Definition: Muon.h:49
float hoVetoEt
ho sum-et in the veto region in r-phi
Definition: MuonIsolation.h:15
int nTracks
number of tracks in the cone (excluding veto region)
Definition: MuonIsolation.h:10
float emVetoEt
ecal sum-et in the veto region in r-phi
Definition: MuonIsolation.h:13
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > muIsoExtractorJet_
void setIsolation(const MuonIsolation &isoR03, const MuonIsolation &isoR05)
std::pair< double, int > depositAndCountWithin(double coneSize, const Vetos &vetos=Vetos(), double threshold=-1e+36, bool skipDepositVeto=false) const
Get deposit.
Definition: IsoDeposit.cc:37
float trackerVetoPt
(sum-)pt inside the veto region in r-phi
Definition: MuonIsolation.h:12
void MuonIdProducer::fillTrackerKink ( reco::Muon aMuon)
private

Definition at line 1349 of file MuonIdProducer.cc.

References reco::Muon::combinedQuality(), reco::Muon::innerTrack(), edm::Ref< C, T, F >::isNull(), reco::Muon::isQualityValid(), qcdUeDQM_cfi::quality, reco::Muon::setCombinedQuality(), and trackerKinkFinder_.

Referenced by produce().

1349  {
1350  // skip muons with no tracks
1351  if (aMuon.innerTrack().isNull())
1352  return;
1353  // get quality from muon if already there, otherwise make empty one
1355  // fill it
1356  const bool filled = trackerKinkFinder_->fillTrkKink(quality, *aMuon.innerTrack());
1357  // if quality was there, or if we filled it, commit to the muon
1358  if (filled || aMuon.isQualityValid())
1359  aMuon.setCombinedQuality(quality);
1360 }
std::unique_ptr< MuonKinkFinder > trackerKinkFinder_
virtual TrackRef innerTrack() const
Definition: Muon.h:45
MuonQuality combinedQuality() const
get energy deposition information
Definition: Muon.h:119
bool isQualityValid() const
Definition: Muon.h:117
bool isNull() const
Checks for null.
Definition: Ref.h:235
void setCombinedQuality(const MuonQuality &combinedQuality)
set energy deposition information
Definition: Muon.h:121
std::vector<reco::MuonSegmentMatch>* MuonIdProducer::getSegmentMatches ( reco::MuonChamberMatch chamber,
unsigned int  muonType 
) const
inlineprivate

get the segment matches of the appropriate type

Definition at line 133 of file MuonIdProducer.h.

References Exception, reco::MuonChamberMatch::gemMatches, reco::Muon::GEMMuon, reco::MuonChamberMatch::me0Matches, reco::Muon::ME0Muon, reco::MuonChamberMatch::segmentMatches, and reco::Muon::TrackerMuon.

Referenced by fillArbitrationInfo().

133  {
134  if (muonType == reco::Muon::TrackerMuon)
135  return &chamber.segmentMatches;
136  else if (muonType == reco::Muon::ME0Muon)
137  return &chamber.me0Matches;
138  else if (muonType == reco::Muon::GEMMuon)
139  return &chamber.gemMatches;
140  else
141  throw cms::Exception("getSegmentMatches called with unsupported muonType");
142  }
std::vector< reco::MuonSegmentMatch > gemMatches
std::vector< reco::MuonSegmentMatch > me0Matches
static const unsigned int ME0Muon
Definition: Muon.h:291
static const unsigned int TrackerMuon
Definition: Muon.h:285
std::vector< reco::MuonSegmentMatch > segmentMatches
static const unsigned int GEMMuon
Definition: Muon.h:290
void MuonIdProducer::init ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 188 of file MuonIdProducer.cc.

References edm::HandleBase::clear(), dytCollectionHandle_, dytCollectionToken_, Exception, fillGlobalTrackQuality_, fillGlobalTrackRefits_, fillTrackerKink_, edm::EventSetup::get(), edm::Event::getByToken(), glbQualHandle_, glbQualToken_, mps_fire::i, MuonIdProducer::ICTypes::INNER_TRACKS, innerTrackCollectionHandle_, innerTrackCollectionToken_, inputCollectionLabels_, inputCollectionTypes_, DataMixerDataOnData_cff::inputLabel, edm::HandleBase::isValid(), linkCollectionHandle_, linkCollectionToken_, MuonIdProducer::ICTypes::LINKS, LogTrace, muonCollectionHandle_, muonCollectionToken_, MuonIdProducer::ICTypes::MUONS, MuonIdProducer::ICTypes::OUTER_TRACKS, outerTrackCollectionHandle_, outerTrackCollectionToken_, pickyCollectionHandle_, pickyCollectionToken_, edm::ESHandle< T >::product(), TrackCandidateProducer_cfi::propagator, rpcHitHandle_, rpcHitToken_, TrackDetectorAssociator::setPropagator(), edm::AssociationMap< Tag >::size(), MuonIdProducer::ICTypes::TEV_DYT, MuonIdProducer::ICTypes::TEV_FIRSTHIT, MuonIdProducer::ICTypes::TEV_PICKY, MuonIdProducer::ICTypes::toStr(), tpfmsCollectionHandle_, tpfmsCollectionToken_, trackAssociator_, and trackerKinkFinder_.

Referenced by produce().

188  {
193 
197 
199  iSetup.get<TrackingComponentsRecord>().get("SteppingHelixPropagatorAny", propagator);
200  trackAssociator_.setPropagator(propagator.product());
201 
202  if (fillTrackerKink_)
203  trackerKinkFinder_->init(iSetup);
204 
205  for (unsigned int i = 0; i < inputCollectionLabels_.size(); ++i) {
206  const auto& inputLabel = inputCollectionLabels_[i];
207  const auto inputType = inputCollectionTypes_[i];
208  if (inputType == ICTypes::INNER_TRACKS) {
211  throw cms::Exception("FatalError") << "Failed to get input track collection with label: " << inputLabel;
212  LogTrace("MuonIdentification") << "Number of input inner tracks: " << innerTrackCollectionHandle_->size();
213  } else if (inputType == ICTypes::OUTER_TRACKS) {
216  throw cms::Exception("FatalError") << "Failed to get input track collection with label: " << inputLabel;
217  LogTrace("MuonIdentification") << "Number of input outer tracks: " << outerTrackCollectionHandle_->size();
218  } else if (inputType == ICTypes::LINKS) {
221  throw cms::Exception("FatalError") << "Failed to get input link collection with label: " << inputLabel;
222  LogTrace("MuonIdentification") << "Number of input links: " << linkCollectionHandle_->size();
223  } else if (inputType == ICTypes::MUONS) {
226  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
227  LogTrace("MuonIdentification") << "Number of input muons: " << muonCollectionHandle_->size();
228  } else if (fillGlobalTrackRefits_ && inputType == ICTypes::TEV_FIRSTHIT) {
231  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
232  LogTrace("MuonIdentification") << "Number of input muons: " << tpfmsCollectionHandle_->size();
233  } else if (fillGlobalTrackRefits_ && inputType == ICTypes::TEV_PICKY) {
236  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
237  LogTrace("MuonIdentification") << "Number of input muons: " << pickyCollectionHandle_->size();
238  } else if (fillGlobalTrackRefits_ && inputType == ICTypes::TEV_DYT) {
241  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
242  LogTrace("MuonIdentification") << "Number of input muons: " << dytCollectionHandle_->size();
243  } else
244  throw cms::Exception("FatalError") << "Unknown input collection type: #" << ICTypes::toStr(inputType);
245  }
246 
250 }
edm::EDGetTokenT< reco::TrackCollection > innerTrackCollectionToken_
edm::EDGetTokenT< edm::ValueMap< reco::MuonQuality > > glbQualToken_
TrackDetectorAssociator trackAssociator_
std::unique_ptr< MuonKinkFinder > trackerKinkFinder_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::Handle< reco::MuonTrackLinksCollection > linkCollectionHandle_
edm::EDGetTokenT< RPCRecHitCollection > rpcHitToken_
edm::EDGetTokenT< reco::TrackToTrackMap > pickyCollectionToken_
static std::string toStr(const ICTypeKey k)
edm::EDGetTokenT< reco::TrackToTrackMap > tpfmsCollectionToken_
void setPropagator(const Propagator *)
use a user configured propagator
edm::EDGetTokenT< reco::MuonCollection > muonCollectionToken_
edm::EDGetTokenT< reco::TrackCollection > outerTrackCollectionToken_
edm::Handle< RPCRecHitCollection > rpcHitHandle_
edm::Handle< reco::TrackToTrackMap > dytCollectionHandle_
bool isValid() const
Definition: HandleBase.h:70
edm::Handle< reco::TrackCollection > outerTrackCollectionHandle_
edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkCollectionToken_
#define LogTrace(id)
bool fillGlobalTrackRefits_
size_type size() const
map size
std::vector< ICTypes::ICTypeKey > inputCollectionTypes_
std::vector< edm::InputTag > inputCollectionLabels_
bool fillGlobalTrackQuality_
T get() const
Definition: EventSetup.h:73
edm::Handle< reco::TrackToTrackMap > tpfmsCollectionHandle_
edm::Handle< reco::TrackCollection > innerTrackCollectionHandle_
T const * product() const
Definition: ESHandle.h:86
edm::Handle< reco::MuonCollection > muonCollectionHandle_
edm::Handle< edm::ValueMap< reco::MuonQuality > > glbQualHandle_
edm::Handle< reco::TrackToTrackMap > pickyCollectionHandle_
edm::EDGetTokenT< reco::TrackToTrackMap > dytCollectionToken_
bool MuonIdProducer::isGoodCaloMuon ( const reco::CaloMuon muon)
private

Definition at line 765 of file MuonIdProducer.cc.

References reco::CaloMuon::caloCompatibility(), caloCut_, reco::CaloMuon::isCaloCompatibilityValid(), minPCaloMuon_, and reco::CaloMuon::p().

Referenced by arbitrateMuons(), and produce().

765  {
766  if (!caloMuon.isCaloCompatibilityValid() || caloMuon.caloCompatibility() < caloCut_ || caloMuon.p() < minPCaloMuon_)
767  return false;
768  return true;
769 }
bool MuonIdProducer::isGoodGEMMuon ( const reco::Muon muon)
private

Definition at line 780 of file MuonIdProducer.cc.

References reco::Muon::GEMSegmentAndTrackArbitration, minP_, minPt_, reco::Muon::numberOfMatches(), and reco::Muon::track().

Referenced by produce().

780  {
781  if (muon.track()->pt() < minPt_ || muon.track()->p() < minP_)
782  return false;
784 }
TrackRef track() const override
reference to a Track
Definition: Muon.h:46
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
bool MuonIdProducer::isGoodME0Muon ( const reco::Muon muon)
private

Definition at line 786 of file MuonIdProducer.cc.

References reco::Muon::ME0SegmentAndTrackArbitration, minP_, reco::Muon::numberOfMatches(), and reco::Muon::track().

Referenced by produce().

786  {
787  // need to update min cuts on pt
788  if (muon.track()->p() < minP_)
789  return false;
791 }
TrackRef track() const override
reference to a Track
Definition: Muon.h:46
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
bool MuonIdProducer::isGoodRPCMuon ( const reco::Muon muon)
private

Definition at line 771 of file MuonIdProducer.cc.

References funct::abs(), addExtraSoftMuons_, reco::LeafCandidate::eta(), minNumberOfMatches_, minP_, minPt_, reco::Muon::numberOfMatchedRPCLayers(), reco::LeafCandidate::pt(), reco::Muon::RPCHitAndTrackArbitration, and reco::Muon::track().

Referenced by produce().

771  {
772  if (muon.track()->pt() < minPt_ || muon.track()->p() < minP_)
773  return false;
774  if (addExtraSoftMuons_ && muon.pt() < 5 && std::abs(muon.eta()) < 1.5 &&
776  return true;
778 }
int numberOfMatchedRPCLayers(ArbitrationType type=RPCHitAndTrackArbitration) const
TrackRef track() const override
reference to a Track
Definition: Muon.h:46
double eta() const final
momentum pseudorapidity
double pt() const final
transverse momentum
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool MuonIdProducer::isGoodTrack ( const reco::Track track)
private

Definition at line 350 of file MuonIdProducer.cc.

References funct::abs(), PVValHelper::eta, reco::TrackBase::eta(), LogTrace, maxAbsEta_, minP_, minPCaloMuon_, minPt_, AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), DiDispStaMuonMonitor_cfi::pt, and reco::TrackBase::pt().

Referenced by produce().

350  {
351  // Pt and absolute momentum requirement
352  const double p = track.p();
353  const double pt = track.pt();
354  if (pt < minPt_ || (p < minP_ && p < minPCaloMuon_)) {
355  LogTrace("MuonIdentification") << "Skipped low momentum track (Pt,P): " << pt << ", " << track.p() << " GeV";
356  return false;
357  }
358 
359  // Eta requirement
360  const double eta = track.eta();
361  const double absEta = std::abs(eta);
362  if (absEta > maxAbsEta_) {
363  LogTrace("MuonIdentification") << "Skipped track with large pseudo rapidity (Eta: " << track.eta() << " )";
364  return false;
365  }
366 
367  return true;
368 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:599
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:617
double pt() const
track transverse momentum
Definition: TrackBase.h:602
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define LogTrace(id)
bool MuonIdProducer::isGoodTrackerMuon ( const reco::Muon muon)
private

Definition at line 756 of file MuonIdProducer.cc.

References funct::abs(), addExtraSoftMuons_, reco::LeafCandidate::eta(), minNumberOfMatches_, minP_, minPt_, reco::Muon::NoArbitration, reco::Muon::numberOfMatches(), reco::LeafCandidate::pt(), and reco::Muon::track().

Referenced by produce().

756  {
757  if (muon.track()->pt() < minPt_ || muon.track()->p() < minP_)
758  return false;
759  if (addExtraSoftMuons_ && muon.pt() < 5 && std::abs(muon.eta()) < 1.5 &&
761  return true;
763 }
TrackRef track() const override
reference to a Track
Definition: Muon.h:46
double eta() const final
momentum pseudorapidity
double pt() const final
transverse momentum
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
reco::CaloMuon MuonIdProducer::makeCaloMuon ( const reco::Muon muon)
private

Definition at line 272 of file MuonIdProducer.cc.

References reco::Muon::calEnergy(), MuonCaloCompatibility::evaluate(), fillCaloCompatibility_, reco::Muon::innerTrack(), reco::Muon::isEnergyValid(), LogTrace, muonCaloCompatibility_, reco::CaloMuon::setCalEnergy(), reco::CaloMuon::setCaloCompatibility(), and reco::CaloMuon::setInnerTrack().

Referenced by arbitrateMuons(), and produce().

272  {
273  LogTrace("MuonIdentification") << "Creating a CaloMuon from a Muon";
274 
275  reco::CaloMuon aMuon;
276  aMuon.setInnerTrack(muon.innerTrack());
277 
278  if (muon.isEnergyValid())
279  aMuon.setCalEnergy(muon.calEnergy());
280  // get calo compatibility
283  return aMuon;
284 }
virtual TrackRef innerTrack() const
Definition: Muon.h:45
bool fillCaloCompatibility_
double evaluate(const reco::Muon &)
MuonCaloCompatibility muonCaloCompatibility_
#define LogTrace(id)
bool isEnergyValid() const
Definition: Muon.h:104
MuonEnergy calEnergy() const
get energy deposition information
Definition: Muon.h:106
void setCaloCompatibility(float input)
Definition: CaloMuon.h:46
virtual void setInnerTrack(const TrackRef &t)
set reference to Track
Definition: CaloMuon.h:30
void setCalEnergy(const MuonEnergy &calEnergy)
set energy deposition information
Definition: CaloMuon.h:37
reco::Muon MuonIdProducer::makeMuon ( edm::Event iEvent,
const edm::EventSetup iSetup,
const reco::TrackRef track,
MuonIdProducer::TrackType  type 
)
private

Definition at line 252 of file MuonIdProducer.cc.

References edm::Ref< C, T, F >::get(), and LogTrace.

Referenced by makeMuon(), and produce().

255  {
256  LogTrace("MuonIdentification") << "Creating a muon from a track " << track.get()->pt()
257  << " Pt (GeV), eta: " << track.get()->eta();
258  reco::Muon aMuon(makeMuon(*(track.get())));
259 
260  LogTrace("MuonIdentification") << "Muon created from a track ";
261 
262  aMuon.setMuonTrack(type, track);
263  aMuon.setBestTrack(type);
264  aMuon.setTunePBestTrack(type);
265 
266  LogTrace("MuonIdentification")
267  << "Muon created from a track and setMuonBestTrack, setBestTrack and setTunePBestTrack called";
268 
269  return aMuon;
270 }
type
Definition: HCALResponse.h:21
reco::Muon makeMuon(edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::TrackRef &track, TrackType type)
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
#define LogTrace(id)
reco::Muon MuonIdProducer::makeMuon ( const reco::MuonTrackLinks links)
private

Definition at line 286 of file MuonIdProducer.cc.

References reco::Muon::DYT, dytCollectionHandle_, edm::AssociationMap< Tag >::end(), edm::HandleBase::failedToGet(), fillGlobalTrackRefits_, edm::AssociationMap< Tag >::find(), muon::getTevRefitTrack(), reco::MuonTrackLinks::globalTrack(), edm::Ref< C, T, F >::isNull(), edm::HandleBase::isValid(), LogTrace, makeMuon(), reco::Muon::Picky, pickyCollectionHandle_, ptThresholdToFillCandidateP4WithGlobalFit_, muon::sigmaSwitch(), sigmaThresholdToFillCandidateP4WithGlobalFit_, reco::MuonTrackLinks::standAloneTrack(), muon::tevOptimized(), reco::Muon::TPFMS, tpfmsCollectionHandle_, reco::MuonTrackLinks::trackerTrack(), and edm::helpers::KeyVal< K, V >::val.

286  {
287  LogTrace("MuonIdentification") << "Creating a muon from a link to tracks object";
288 
289  reco::Muon aMuon;
290  reco::Muon::MuonTrackTypePair chosenTrack;
291  reco::TrackRef tpfmsRef;
292  reco::TrackRef pickyRef;
293  reco::TrackRef dytRef;
294  bool useSigmaSwitch = false;
295 
301 
302  if (tpfmsRef.isNull() && pickyRef.isNull() && dytRef.isNull()) {
303  edm::LogWarning("MakeMuonWithTEV") << "Failed to get TEV refits, fall back to sigma switch.";
304  useSigmaSwitch = true;
305  }
306  } else {
307  useSigmaSwitch = true;
308  }
309 
310  if (useSigmaSwitch) {
311  chosenTrack = muon::sigmaSwitch(links.globalTrack(),
312  links.trackerTrack(),
315  } else {
316  chosenTrack = muon::tevOptimized(links.globalTrack(),
317  links.trackerTrack(),
318  tpfmsRef,
319  pickyRef,
320  dytRef,
322  }
323  aMuon = makeMuon(*chosenTrack.first);
324  aMuon.setInnerTrack(links.trackerTrack());
325  aMuon.setOuterTrack(links.standAloneTrack());
326  aMuon.setGlobalTrack(links.globalTrack());
327  aMuon.setBestTrack(chosenTrack.second);
328  aMuon.setTunePBestTrack(chosenTrack.second);
329 
333  if (it != tpfmsCollectionHandle_->end())
334  aMuon.setMuonTrack(reco::Muon::TPFMS, (it->val));
335  }
338  if (it != pickyCollectionHandle_->end())
339  aMuon.setMuonTrack(reco::Muon::Picky, (it->val));
340  }
343  if (it != dytCollectionHandle_->end())
344  aMuon.setMuonTrack(reco::Muon::DYT, (it->val));
345  }
346  }
347  return aMuon;
348 }
reco::Muon makeMuon(edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::TrackRef &track, TrackType type)
const_iterator end() const
last iterator over the map (read only)
const_iterator find(const key_type &k) const
find element with specified reference key
double ptThresholdToFillCandidateP4WithGlobalFit_
reco::Muon::MuonTrackTypePair sigmaSwitch(const reco::TrackRef &combinedTrack, const reco::TrackRef &trackerTrack, const double nSigma=2., const double ptThreshold=200.)
reco::Muon::MuonTrackTypePair tevOptimized(const reco::TrackRef &combinedTrack, const reco::TrackRef &trackerTrack, const reco::TrackRef &tpfmsTrack, const reco::TrackRef &pickyTrack, const reco::TrackRef &dytTrack, const double ptThreshold=200., const double tune1=17., const double tune2=40., const double dptcut=0.25)
Definition: MuonCocktails.cc:9
edm::Handle< reco::TrackToTrackMap > dytCollectionHandle_
bool isValid() const
Definition: HandleBase.h:70
bool isNull() const
Checks for null.
Definition: Ref.h:235
#define LogTrace(id)
bool fillGlobalTrackRefits_
bool failedToGet() const
Definition: HandleBase.h:72
reco::TrackRef getTevRefitTrack(const reco::TrackRef &combinedTrack, const reco::TrackToTrackMap &map)
edm::Handle< reco::TrackToTrackMap > tpfmsCollectionHandle_
double sigmaThresholdToFillCandidateP4WithGlobalFit_
std::pair< TrackRef, Muon::MuonTrackType > MuonTrackTypePair
Definition: Muon.h:38
edm::Handle< reco::TrackToTrackMap > pickyCollectionHandle_
reco::Muon MuonIdProducer::makeMuon ( const reco::Track track)
private

Definition at line 1302 of file MuonIdProducer.cc.

References reco::TrackBase::charge(), HCALHighEnergyHPDFilter_cfi::energy, dumpRecoGeometry_cfg::Muon, reco::TrackBase::p(), p4, reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), and reco::TrackBase::vertex().

1302  {
1303  const double energy = hypot(track.p(), 0.105658369);
1304  const math::XYZTLorentzVector p4(track.px(), track.py(), track.pz(), energy);
1305  return reco::Muon(track.charge(), p4, track.vertex());
1306 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:599
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:605
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:641
double p4[4]
Definition: TauolaWrapper.h:92
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:611
int charge() const
track electric charge
Definition: TrackBase.h:575
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:608
int MuonIdProducer::overlap ( const reco::Muon muon,
const reco::Track track 
)
private

Definition at line 384 of file MuonIdProducer.cc.

References chamberId(), reco::Track::extra(), reco::Muon::isMatchesValid(), edm::Ref< C, T, F >::isNull(), match(), patCandidatesForDimuonsSequences_cff::matches, and reco::Muon::matches().

Referenced by produce().

384  {
385  if (!muon.isMatchesValid() || track.extra().isNull() || track.extra()->recHitsSize() == 0)
386  return 0;
387 
388  int numberOfCommonDetIds = 0;
389  const std::vector<reco::MuonChamberMatch>& matches(muon.matches());
390  for (const auto& match : matches) {
391  if (match.segmentMatches.empty())
392  continue;
393 
394  bool foundCommonDetId = false;
395  for (auto hit = track.extra()->recHitsBegin(); hit != track.extra()->recHitsEnd(); ++hit) {
396  // LogTrace("MuonIdentification") << "hit DetId: " << std::hex << hit->get()->geographicalId().rawId() <<
397  // "\t hit chamber DetId: " << getChamberId(hit->get()->geographicalId()) <<
398  // "\t segment DetId: " << match->id.rawId() << std::dec;
399 
400  if (chamberId((*hit)->geographicalId()) == match.id.rawId()) {
401  foundCommonDetId = true;
402  break;
403  }
404  }
405  if (foundCommonDetId) {
406  ++numberOfCommonDetIds;
407  break;
408  }
409  }
410  return numberOfCommonDetIds;
411 }
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139
bool isMatchesValid() const
Definition: Muon.h:143
bool isNull() const
Checks for null.
Definition: Ref.h:235
std::vector< MuonChamberMatch > & matches()
get muon matching information
Definition: Muon.h:145
unsigned int chamberId(const DetId &)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
double MuonIdProducer::phiOfMuonIneteractionRegion ( const reco::Muon muon) const
private

Definition at line 1328 of file MuonIdProducer.cc.

References reco::Muon::innerTrack(), edm::Ref< C, T, F >::isAvailable(), reco::Muon::isStandAloneMuon(), reco::Muon::matches(), reco::LeafCandidate::phi(), sectorPhi(), and reco::Muon::standAloneMuon().

Referenced by produce().

1328  {
1329  if (muon.isStandAloneMuon())
1330  return muon.standAloneMuon()->innerPosition().phi();
1331  // the rest is tracker muon only
1332  if (muon.matches().empty()) {
1333  if (muon.innerTrack().isAvailable() && muon.innerTrack()->extra().isAvailable())
1334  return muon.innerTrack()->outerPosition().phi();
1335  else
1336  return muon.phi(); // makes little sense, but what else can I use
1337  }
1338  return sectorPhi(muon.matches().at(0).id);
1339 }
bool isStandAloneMuon() const override
Definition: Muon.h:300
virtual TrackRef innerTrack() const
Definition: Muon.h:45
bool isAvailable() const
Definition: Ref.h:537
static double sectorPhi(const DetId &id)
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
Definition: Muon.h:49
std::vector< MuonChamberMatch > & matches()
get muon matching information
Definition: Muon.h:145
double phi() const final
momentum azimuthal angle
void MuonIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 435 of file MuonIdProducer.cc.

References TrackDetectorAssociator::Any, arbitrateMuons(), arbitrateTrackerMuons_, reco::Muon::calEnergy(), mergedMuons_cfi::caloMuons, checkLinks(), funct::cos(), TrackDetectorAssociator::crossedIP(), debugWithTruthMatching_, ecalDepositName_, ev, MuonCaloCompatibility::evaluate(), reco::Track::extra(), fillArbitrationInfo(), fillCaloCompatibility_, fillEnergy_, trigObjTnPSource_cfi::filler, fillGlbQuality(), fillGlobalTrackQuality_, fillIsolation_, fillMatching_, fillMuonId(), fillMuonIsolation(), fillShowerDigis_, fillTrackerKink(), fillTrackerKink_, reco::Muon::GEMMuon, edm::Ref< C, T, F >::get(), reco::Muon::GlobalMuon, hcalDepositName_, hoDepositName_, mps_fire::i, init(), reco::Muon::InnerTrack, reco::Muon::innerTrack(), innerTrackCollectionHandle_, TrackDetectorAssociator::InsideOut, edm::Ref< C, T, F >::isAvailable(), reco::Muon::isEnergyValid(), isGoodCaloMuon(), isGoodGEMMuon(), isGoodME0Muon(), isGoodRPCMuon(), isGoodTrack(), isGoodTrackerMuon(), reco::Muon::isTimeValid(), edm::HandleBase::isValid(), dqmiolumiharvest::j, jetDepositName_, linkCollectionHandle_, LogDebug, LogTrace, makeCaloMuon(), makeMuon(), reco::Muon::matches(), reco::Muon::ME0Muon, eostools::move(), muonCaloCompatibility_, muonCollectionHandle_, reco::MuonTime::nDof, reco::MuonTimeExtra::nDof(), jets_cff::nMuons, reco::Muon::OuterTrack, outerTrackCollectionHandle_, TrackDetectorAssociator::OutsideIn, overlap(), phiOfMuonIneteractionRegion(), edm::Event::put(), reco::Muon::RPCMuon, reco::Muon::setType(), reco::Muon::StandAloneMuon, AlCaHLTBitMon_QueryRunRegistry::string, theShowerDigiFiller_, theTimingFiller_, reco::Muon::time(), reco::MuonTime::timeAtIpInOut, reco::MuonTimeExtra::timeAtIpInOut(), reco::MuonTime::timeAtIpInOutErr, reco::MuonTimeExtra::timeAtIpInOutErr(), reco::MuonTime::timeAtIpOutIn, reco::MuonTimeExtra::timeAtIpOutIn(), reco::MuonTime::timeAtIpOutInErr, reco::MuonTimeExtra::timeAtIpOutInErr(), HLT_2018_cff::track, trackDepositName_, susybsm::HSCParticleType::trackerMuon, reco::Muon::TrackerMuon, MuonIdTruthInfo::truthMatchMuon(), reco::Muon::type(), validateGlobalMuonPair(), and writeIsoDeposits_.

435  {
436  auto outputMuons = std::make_unique<reco::MuonCollection>();
437  auto caloMuons = std::make_unique<reco::CaloMuonCollection>();
438 
439  init(iEvent, iSetup);
440 
442  theShowerDigiFiller_->getDigis(iEvent);
443 
444  // loop over input collections
445 
446  // muons first - no cleaning, take as is.
448  for (const auto muon : *muonCollectionHandle_) {
449  outputMuons->push_back(muon);
450  }
451  }
452 
453  // links second ( assume global muon type )
455  const auto nLink = linkCollectionHandle_->size();
456  std::vector<bool> goodmuons(nLink, true);
457  if (nLink > 1) {
458  // check for shared tracker tracks
459  for (unsigned int i = 0; i < nLink - 1; ++i) {
460  const auto& iLink = linkCollectionHandle_->at(i);
461  if (iLink.trackerTrack().isNull() || !checkLinks(&iLink))
462  continue;
463  for (unsigned int j = i + 1; j < nLink; ++j) {
464  const auto& jLink = linkCollectionHandle_->at(j);
465  if (!checkLinks(&jLink))
466  continue;
467  if (iLink.trackerTrack() == jLink.trackerTrack()) {
468  // Tracker track is the essential part that dominates muon resolution
469  // so taking either muon is fine. All that is important is to preserve
470  // the muon identification information. If number of hits is small,
471  // keep the one with large number of hits, otherwise take the smalest chi2/ndof
472  if (validateGlobalMuonPair(iLink, jLink))
473  goodmuons[j] = false;
474  else
475  goodmuons[i] = false;
476  }
477  }
478  }
479  // check for shared stand-alone muons.
480  for (unsigned int i = 0; i < nLink - 1; ++i) {
481  if (!goodmuons[i])
482  continue;
483  const auto& iLink = linkCollectionHandle_->at(i);
484  if (iLink.standAloneTrack().isNull() || !checkLinks(&iLink))
485  continue;
486  for (unsigned int j = i + 1; j < nLink; ++j) {
487  if (!goodmuons[j])
488  continue;
489  const auto& jLink = linkCollectionHandle_->at(j);
490  if (!checkLinks(&jLink))
491  continue;
492  if (iLink.standAloneTrack() == jLink.standAloneTrack()) {
493  if (validateGlobalMuonPair(iLink, jLink))
494  goodmuons[j] = false;
495  else
496  goodmuons[i] = false;
497  }
498  }
499  }
500  }
501  for (unsigned int i = 0; i < nLink; ++i) {
502  if (!goodmuons[i])
503  continue;
504  const auto& iLink = linkCollectionHandle_->at(i);
505  if (!checkLinks(&iLink))
506  continue;
507  // check if this muon is already in the list
508  bool newMuon = true;
509  for (auto muon : *outputMuons) {
510  if (muon.track() == iLink.trackerTrack() && muon.standAloneMuon() == iLink.standAloneTrack() &&
511  muon.combinedMuon() == iLink.globalTrack()) {
512  newMuon = false;
513  break;
514  }
515  }
516  if (newMuon) {
517  outputMuons->push_back(makeMuon(iLink));
518  outputMuons->back().setType(reco::Muon::GlobalMuon | reco::Muon::StandAloneMuon);
519  }
520  }
521  }
522 
523  // tracker and calo muons are next
525  LogTrace("MuonIdentification") << "Creating tracker muons";
526  std::vector<TrackDetectorAssociator::Direction> directions1, directions2;
527  directions1.push_back(TrackDetectorAssociator::InsideOut);
528  directions1.push_back(TrackDetectorAssociator::OutsideIn);
529  directions2.push_back(TrackDetectorAssociator::Any);
530 
531  for (unsigned int i = 0; i < innerTrackCollectionHandle_->size(); ++i) {
533  if (!isGoodTrack(track))
534  continue;
535  const auto& trackRef = reco::TrackRef(innerTrackCollectionHandle_, i);
536  bool splitTrack = false;
537  if (track.extra().isAvailable() && TrackDetectorAssociator::crossedIP(track))
538  splitTrack = true;
539  const auto& directions = splitTrack ? directions1 : directions2;
540  for (const auto direction : directions) {
541  // make muon
542  reco::Muon trackerMuon(makeMuon(iEvent, iSetup, trackRef, reco::Muon::InnerTrack));
543  fillMuonId(iEvent, iSetup, trackerMuon, direction);
544 
546  // add MC hits to a list of matched segments.
547  // Since it's debugging mode - code is slow
549  }
550 
551  // check if this muon is already in the list
552  // have to check where muon hits are really located
553  // to match properly
554  bool newMuon = true;
555  const bool goodTrackerMuon = isGoodTrackerMuon(trackerMuon);
556  const bool goodRPCMuon = isGoodRPCMuon(trackerMuon);
557  const bool goodGEMMuon = isGoodGEMMuon(trackerMuon);
558  const bool goodME0Muon = isGoodME0Muon(trackerMuon);
559  if (goodTrackerMuon)
561  if (goodRPCMuon)
562  trackerMuon.setType(trackerMuon.type() | reco::Muon::RPCMuon);
563  if (goodGEMMuon)
564  trackerMuon.setType(trackerMuon.type() | reco::Muon::GEMMuon);
565  if (goodME0Muon)
566  trackerMuon.setType(trackerMuon.type() | reco::Muon::ME0Muon);
567 
568  for (auto& muon : *outputMuons) {
569  if (muon.innerTrack().get() == trackerMuon.innerTrack().get() &&
571  newMuon = false;
572  muon.setMatches(trackerMuon.matches());
573  if (trackerMuon.isTimeValid())
574  muon.setTime(trackerMuon.time());
575  if (trackerMuon.isEnergyValid())
576  muon.setCalEnergy(trackerMuon.calEnergy());
577  if (goodTrackerMuon)
578  muon.setType(muon.type() | reco::Muon::TrackerMuon);
579  if (goodRPCMuon)
580  muon.setType(muon.type() | reco::Muon::RPCMuon);
581  if (goodGEMMuon)
582  muon.setType(muon.type() | reco::Muon::GEMMuon);
583  if (goodME0Muon)
584  muon.setType(muon.type() | reco::Muon::ME0Muon);
585  LogTrace("MuonIdentification") << "Found a corresponding global muon. Set energy, matches and move on";
586  break;
587  }
588  }
589  if (newMuon) {
590  if (goodTrackerMuon || goodRPCMuon || goodGEMMuon || goodME0Muon) {
591  outputMuons->push_back(trackerMuon);
592  } else {
593  LogTrace("MuonIdentification") << "track failed minimal number of muon matches requirement";
594  const reco::CaloMuon& caloMuon = makeCaloMuon(trackerMuon);
595  if (isGoodCaloMuon(caloMuon))
596  caloMuons->push_back(caloMuon);
597  }
598  }
599  }
600  }
601  }
602 
603  // and at last the stand alone muons
605  LogTrace("MuonIdentification") << "Looking for new muons among stand alone muon tracks";
606  for (unsigned int i = 0; i < outerTrackCollectionHandle_->size(); ++i) {
607  const auto& outerTrack = outerTrackCollectionHandle_->at(i);
608 
609  // check if this muon is already in the list of global muons
610  bool newMuon = true;
611  for (auto& muon : *outputMuons) {
612  if (!muon.standAloneMuon().isNull()) {
613  // global muon
614  if (muon.standAloneMuon().get() == &outerTrack) {
615  newMuon = false;
616  break;
617  }
618  } else {
619  // tracker muon - no direct links to the standalone muon
620  // since we have only a few real muons in an event, matching
621  // the stand alone muon to the tracker muon by DetIds should
622  // be good enough for association. At the end it's up to a
623  // user to redefine the association and what it means. Here
624  // we would like to avoid obvious double counting and we
625  // tolerate a potential miss association
626  if (overlap(muon, outerTrack) > 0) {
627  LogTrace("MuonIdentification") << "Found associated tracker muon. Set a reference and move on";
628  newMuon = false;
630  muon.setType(muon.type() | reco::Muon::StandAloneMuon);
631  break;
632  }
633  }
634  }
635  if (newMuon) {
636  LogTrace("MuonIdentification") << "No associated stand alone track is found. Making a muon";
637  outputMuons->push_back(
639  outputMuons->back().setType(reco::Muon::StandAloneMuon);
640  }
641  }
642  }
643 
645  fillArbitrationInfo(outputMuons.get());
646  arbitrateMuons(outputMuons.get(), caloMuons.get());
647  }
648 
649  LogTrace("MuonIdentification") << "Dress up muons if it's necessary";
650 
651  const int nMuons = outputMuons->size();
652 
653  std::vector<reco::MuonTimeExtra> dtTimeColl(nMuons);
654  std::vector<reco::MuonTimeExtra> cscTimeColl(nMuons);
655  std::vector<reco::MuonTimeExtra> combinedTimeColl(nMuons);
656  std::vector<reco::IsoDeposit> trackDepColl(nMuons);
657  std::vector<reco::IsoDeposit> ecalDepColl(nMuons);
658  std::vector<reco::IsoDeposit> hcalDepColl(nMuons);
659  std::vector<reco::IsoDeposit> hoDepColl(nMuons);
660  std::vector<reco::IsoDeposit> jetDepColl(nMuons);
661 
662  // Fill various information
663  for (unsigned int i = 0; i < outputMuons->size(); ++i) {
664  auto& muon = outputMuons->at(i);
665 
666  // Fill muonID
667  if ((fillMatching_ && !muon.isMatchesValid()) || (fillEnergy_ && !muon.isEnergyValid())) {
668  // predict direction based on the muon interaction region location
669  // if it's available
670  if (muon.isStandAloneMuon()) {
671  if (cos(phiOfMuonIneteractionRegion(muon) - muon.phi()) > 0) {
673  } else {
675  }
676  } else {
677  LogTrace("MuonIdentification") << "THIS SHOULD NEVER HAPPEN";
678  fillMuonId(iEvent, iSetup, muon);
679  }
680  }
681 
683  // Fill global quality information
684  fillGlbQuality(iEvent, iSetup, muon);
685  }
686  LogDebug("MuonIdentification");
687 
688  if (fillTrackerKink_) {
690  }
691 
693  muon.setCaloCompatibility(muonCaloCompatibility_.evaluate(muon));
694 
695  if (fillIsolation_) {
697  iEvent, iSetup, muon, trackDepColl[i], ecalDepColl[i], hcalDepColl[i], hoDepColl[i], jetDepColl[i]);
698  }
699 
700  // fill timing information
701  reco::MuonTime muonTime;
702  reco::MuonTimeExtra dtTime;
703  reco::MuonTimeExtra cscTime;
704  reco::MuonTime rpcTime;
705  reco::MuonTimeExtra combinedTime;
706 
707  theTimingFiller_->fillTiming(muon, dtTime, cscTime, rpcTime, combinedTime, iEvent, iSetup);
708 
709  muonTime.nDof = combinedTime.nDof();
710  muonTime.timeAtIpInOut = combinedTime.timeAtIpInOut();
711  muonTime.timeAtIpInOutErr = combinedTime.timeAtIpInOutErr();
712  muonTime.timeAtIpOutIn = combinedTime.timeAtIpOutIn();
713  muonTime.timeAtIpOutInErr = combinedTime.timeAtIpOutInErr();
714 
715  muon.setTime(muonTime);
716  muon.setRPCTime(rpcTime);
717  dtTimeColl[i] = dtTime;
718  cscTimeColl[i] = cscTime;
719  combinedTimeColl[i] = combinedTime;
720  }
721 
722  LogTrace("MuonIdentification") << "number of muons produced: " << outputMuons->size();
723  if (fillMatching_) {
724  fillArbitrationInfo(outputMuons.get(), reco::Muon::TrackerMuon);
725  fillArbitrationInfo(outputMuons.get(), reco::Muon::ME0Muon);
726  fillArbitrationInfo(outputMuons.get(), reco::Muon::GEMMuon);
727  }
728  edm::OrphanHandle<reco::MuonCollection> muonHandle = iEvent.put(std::move(outputMuons));
729 
730  auto fillMap = [](auto refH, auto& vec, edm::Event& ev, const std::string& cAl = "") {
732  auto oMap = std::make_unique<MapType>();
733  {
734  typename MapType::Filler filler(*oMap);
735  filler.insert(refH, vec.begin(), vec.end());
736  vec.clear();
737  filler.fill();
738  }
739  ev.put(std::move(oMap), cAl);
740  };
741  fillMap(muonHandle, combinedTimeColl, iEvent, "combined");
742  fillMap(muonHandle, dtTimeColl, iEvent, "dt");
743  fillMap(muonHandle, cscTimeColl, iEvent, "csc");
744 
746  fillMap(muonHandle, trackDepColl, iEvent, trackDepositName_);
747  fillMap(muonHandle, ecalDepColl, iEvent, ecalDepositName_);
748  fillMap(muonHandle, hcalDepColl, iEvent, hcalDepositName_);
749  fillMap(muonHandle, hoDepColl, iEvent, hoDepositName_);
750  fillMap(muonHandle, jetDepColl, iEvent, jetDepositName_);
751  }
752 
753  iEvent.put(std::move(caloMuons));
754 }
#define LogDebug(id)
std::string hoDepositName_
std::string jetDepositName_
bool isGoodRPCMuon(const reco::Muon &muon)
reco::Muon makeMuon(edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::TrackRef &track, TrackType type)
static const unsigned int GlobalMuon
Definition: Muon.h:284
void fillMuonIsolation(edm::Event &, const edm::EventSetup &, reco::Muon &aMuon, reco::IsoDeposit &trackDep, reco::IsoDeposit &ecalDep, reco::IsoDeposit &hcalDep, reco::IsoDeposit &hoDep, reco::IsoDeposit &jetDep)
static void truthMatchMuon(const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::Muon &aMuon)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
static bool crossedIP(const reco::Track &track)
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139
void fillMuonId(edm::Event &, const edm::EventSetup &, reco::Muon &, TrackDetectorAssociator::Direction direction=TrackDetectorAssociator::InsideOut)
edm::Handle< reco::MuonTrackLinksCollection > linkCollectionHandle_
bool isGoodGEMMuon(const reco::Muon &muon)
int overlap(const reco::Muon &muon, const reco::Track &track)
bool fillCaloCompatibility_
std::string trackDepositName_
void fillArbitrationInfo(reco::MuonCollection *, unsigned int muonType=reco::Muon::TrackerMuon)
double phiOfMuonIneteractionRegion(const reco::Muon &muon) const
double evaluate(const reco::Muon &)
MuonCaloCompatibility muonCaloCompatibility_
float timeAtIpOutInErr() const
Definition: MuonTimeExtra.h:49
bool ev
bool arbitrateTrackerMuons_
void fillGlbQuality(edm::Event &, const edm::EventSetup &, reco::Muon &aMuon)
int nDof() const
number of measurements used in timing calculation
Definition: MuonTimeExtra.h:22
float timeAtIpOutInErr
Definition: MuonTime.h:17
bool isAvailable() const
Definition: Ref.h:537
std::unique_ptr< MuonTimingFiller > theTimingFiller_
void init(edm::Event &, const edm::EventSetup &)
std::unique_ptr< MuonShowerDigiFiller > theShowerDigiFiller_
bool isGoodME0Muon(const reco::Muon &muon)
void fillTrackerKink(reco::Muon &aMuon)
static const unsigned int ME0Muon
Definition: Muon.h:291
bool isGoodTrackerMuon(const reco::Muon &muon)
bool checkLinks(const reco::MuonTrackLinks *) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
float timeAtIpInOutErr
Definition: MuonTime.h:14
std::string ecalDepositName_
float timeAtIpOutIn
b) particle is moving from outside in
Definition: MuonTime.h:16
int nDof
number of muon stations used
Definition: MuonTime.h:9
float timeAtIpInOutErr() const
Definition: MuonTimeExtra.h:44
bool isValid() const
Definition: HandleBase.h:70
edm::Handle< reco::TrackCollection > outerTrackCollectionHandle_
#define LogTrace(id)
reco::CaloMuon makeCaloMuon(const reco::Muon &)
static const unsigned int RPCMuon
Definition: Muon.h:289
static const unsigned int TrackerMuon
Definition: Muon.h:285
float timeAtIpInOut() const
Definition: MuonTimeExtra.h:43
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
void arbitrateMuons(reco::MuonCollection *, reco::CaloMuonCollection *)
bool fillGlobalTrackQuality_
std::string hcalDepositName_
static const unsigned int GEMMuon
Definition: Muon.h:290
edm::Handle< reco::TrackCollection > innerTrackCollectionHandle_
bool isGoodTrack(const reco::Track &track)
static const unsigned int StandAloneMuon
Definition: Muon.h:286
float timeAtIpOutIn() const
b) particle is moving from outside in
Definition: MuonTimeExtra.h:48
bool validateGlobalMuonPair(const reco::MuonTrackLinks &goodMuon, const reco::MuonTrackLinks &badMuon)
bool debugWithTruthMatching_
float timeAtIpInOut
Definition: MuonTime.h:13
bool isGoodCaloMuon(const reco::CaloMuon &muon)
def move(src, dest)
Definition: eostools.py:511
edm::Handle< reco::MuonCollection > muonCollectionHandle_
double MuonIdProducer::sectorPhi ( const DetId id)
static

Definition at line 1308 of file MuonIdProducer.cc.

References MuonSubdetId::CSC, MuonSubdetId::DT, M_PI, phi, DTChamberId::sector(), and CSCDetId::triggerSector().

Referenced by phiOfMuonIneteractionRegion().

1308  {
1309  double phi = 0;
1310  if (id.subdetId() == MuonSubdetId::DT) { // DT
1311  DTChamberId muonId(id.rawId());
1312  if (muonId.sector() <= 12)
1313  phi = (muonId.sector() - 1) / 6. * M_PI;
1314  if (muonId.sector() == 13)
1315  phi = 3 / 6. * M_PI;
1316  if (muonId.sector() == 14)
1317  phi = 9 / 6. * M_PI;
1318  }
1319  if (id.subdetId() == MuonSubdetId::CSC) { // CSC
1320  CSCDetId muonId(id.rawId());
1321  phi = M_PI / 4 + (muonId.triggerSector() - 1) / 3. * M_PI;
1322  }
1323  if (phi > M_PI)
1324  phi -= 2 * M_PI;
1325  return phi;
1326 }
#define M_PI
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12

Member Data Documentation

bool MuonIdProducer::addExtraSoftMuons_
private

Definition at line 204 of file MuonIdProducer.h.

Referenced by isGoodRPCMuon(), isGoodTrackerMuon(), and MuonIdProducer().

bool MuonIdProducer::arbClean_
private

Definition at line 268 of file MuonIdProducer.h.

Referenced by fillArbitrationInfo(), and MuonIdProducer().

bool MuonIdProducer::arbitrateTrackerMuons_
private

Definition at line 223 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

double MuonIdProducer::caloCut_
private

Definition at line 266 of file MuonIdProducer.h.

Referenced by isGoodCaloMuon(), and MuonIdProducer().

bool MuonIdProducer::debugWithTruthMatching_
private

Definition at line 225 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

edm::Handle<reco::TrackToTrackMap> MuonIdProducer::dytCollectionHandle_
private

Definition at line 233 of file MuonIdProducer.h.

Referenced by init(), and makeMuon().

edm::EDGetTokenT<reco::TrackToTrackMap> MuonIdProducer::dytCollectionToken_
private

Definition at line 241 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

std::string MuonIdProducer::ecalDepositName_
private

Definition at line 254 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

bool MuonIdProducer::fillCaloCompatibility_
private

Definition at line 213 of file MuonIdProducer.h.

Referenced by makeCaloMuon(), MuonIdProducer(), and produce().

bool MuonIdProducer::fillEnergy_
private

Definition at line 214 of file MuonIdProducer.h.

Referenced by fillMuonId(), MuonIdProducer(), and produce().

bool MuonIdProducer::fillGlobalTrackQuality_
private

Definition at line 259 of file MuonIdProducer.h.

Referenced by init(), MuonIdProducer(), and produce().

bool MuonIdProducer::fillGlobalTrackRefits_
private

Definition at line 260 of file MuonIdProducer.h.

Referenced by init(), makeMuon(), and MuonIdProducer().

bool MuonIdProducer::fillIsolation_
private

Definition at line 218 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

bool MuonIdProducer::fillMatching_
private

Definition at line 216 of file MuonIdProducer.h.

Referenced by beginRun(), fillMuonId(), MuonIdProducer(), and produce().

bool MuonIdProducer::fillShowerDigis_
private

Definition at line 217 of file MuonIdProducer.h.

Referenced by beginRun(), fillMuonId(), MuonIdProducer(), and produce().

bool MuonIdProducer::fillTrackerKink_
private

Definition at line 263 of file MuonIdProducer.h.

Referenced by init(), MuonIdProducer(), and produce().

edm::Handle<edm::ValueMap<reco::MuonQuality> > MuonIdProducer::glbQualHandle_
private

Definition at line 247 of file MuonIdProducer.h.

Referenced by fillGlbQuality(), and init().

edm::EDGetTokenT<edm::ValueMap<reco::MuonQuality> > MuonIdProducer::glbQualToken_
private

Definition at line 244 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

edm::InputTag MuonIdProducer::globalTrackQualityInputTag_
private

Definition at line 261 of file MuonIdProducer.h.

std::string MuonIdProducer::hcalDepositName_
private

Definition at line 255 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

std::string MuonIdProducer::hoDepositName_
private

Definition at line 256 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

edm::Handle<reco::TrackCollection> MuonIdProducer::innerTrackCollectionHandle_
private

Definition at line 227 of file MuonIdProducer.h.

Referenced by init(), and produce().

edm::EDGetTokenT<reco::TrackCollection> MuonIdProducer::innerTrackCollectionToken_
private

Definition at line 235 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

std::vector<edm::InputTag> MuonIdProducer::inputCollectionLabels_
private

Definition at line 191 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

std::vector<ICTypes::ICTypeKey> MuonIdProducer::inputCollectionTypes_
private

Definition at line 192 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

std::string MuonIdProducer::jetDepositName_
private

Definition at line 257 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

edm::Handle<reco::MuonTrackLinksCollection> MuonIdProducer::linkCollectionHandle_
private

Definition at line 230 of file MuonIdProducer.h.

Referenced by init(), and produce().

edm::EDGetTokenT<reco::MuonTrackLinksCollection> MuonIdProducer::linkCollectionToken_
private

Definition at line 238 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

double MuonIdProducer::maxAbsDx_
private

Definition at line 207 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

double MuonIdProducer::maxAbsDy_
private

Definition at line 209 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

double MuonIdProducer::maxAbsEta_
private

Definition at line 203 of file MuonIdProducer.h.

Referenced by isGoodTrack(), and MuonIdProducer().

double MuonIdProducer::maxAbsPullX_
private

Definition at line 208 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

double MuonIdProducer::maxAbsPullY_
private

Definition at line 210 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

std::unique_ptr<MuonMesh> MuonIdProducer::meshAlgo_
private

Definition at line 269 of file MuonIdProducer.h.

Referenced by beginRun(), fillArbitrationInfo(), and MuonIdProducer().

int MuonIdProducer::minNumberOfMatches_
private

Definition at line 202 of file MuonIdProducer.h.

Referenced by arbitrateMuons(), isGoodRPCMuon(), isGoodTrackerMuon(), and MuonIdProducer().

double MuonIdProducer::minP_
private
double MuonIdProducer::minPCaloMuon_
private

Definition at line 201 of file MuonIdProducer.h.

Referenced by isGoodCaloMuon(), isGoodTrack(), and MuonIdProducer().

double MuonIdProducer::minPt_
private
std::unique_ptr<reco::isodeposit::IsoDepositExtractor> MuonIdProducer::muIsoExtractorCalo_
private

Definition at line 250 of file MuonIdProducer.h.

Referenced by fillMuonIsolation(), and MuonIdProducer().

std::unique_ptr<reco::isodeposit::IsoDepositExtractor> MuonIdProducer::muIsoExtractorJet_
private

Definition at line 252 of file MuonIdProducer.h.

Referenced by fillMuonIsolation(), and MuonIdProducer().

std::unique_ptr<reco::isodeposit::IsoDepositExtractor> MuonIdProducer::muIsoExtractorTrack_
private

Definition at line 251 of file MuonIdProducer.h.

Referenced by fillMuonIsolation(), and MuonIdProducer().

MuonCaloCompatibility MuonIdProducer::muonCaloCompatibility_
private

Definition at line 249 of file MuonIdProducer.h.

Referenced by makeCaloMuon(), MuonIdProducer(), and produce().

edm::Handle<reco::MuonCollection> MuonIdProducer::muonCollectionHandle_
private

Definition at line 229 of file MuonIdProducer.h.

Referenced by init(), and produce().

edm::EDGetTokenT<reco::MuonCollection> MuonIdProducer::muonCollectionToken_
private

Definition at line 237 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

edm::Handle<reco::TrackCollection> MuonIdProducer::outerTrackCollectionHandle_
private

Definition at line 228 of file MuonIdProducer.h.

Referenced by init(), and produce().

edm::EDGetTokenT<reco::TrackCollection> MuonIdProducer::outerTrackCollectionToken_
private

Definition at line 236 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

TrackAssociatorParameters MuonIdProducer::parameters_
private
edm::Handle<reco::TrackToTrackMap> MuonIdProducer::pickyCollectionHandle_
private

Definition at line 232 of file MuonIdProducer.h.

Referenced by init(), and makeMuon().

edm::EDGetTokenT<reco::TrackToTrackMap> MuonIdProducer::pickyCollectionToken_
private

Definition at line 240 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

double MuonIdProducer::ptThresholdToFillCandidateP4WithGlobalFit_
private

Definition at line 220 of file MuonIdProducer.h.

Referenced by makeMuon(), and MuonIdProducer().

edm::Handle<RPCRecHitCollection> MuonIdProducer::rpcHitHandle_
private

Definition at line 246 of file MuonIdProducer.h.

Referenced by fillMuonId(), and init().

edm::EDGetTokenT<RPCRecHitCollection> MuonIdProducer::rpcHitToken_
private

Definition at line 243 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

double MuonIdProducer::sigmaThresholdToFillCandidateP4WithGlobalFit_
private

Definition at line 221 of file MuonIdProducer.h.

Referenced by makeMuon(), and MuonIdProducer().

bool MuonIdProducer::storeCrossedHcalRecHits_
private

Definition at line 215 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

std::unique_ptr<MuonShowerDigiFiller> MuonIdProducer::theShowerDigiFiller_
private

Definition at line 196 of file MuonIdProducer.h.

Referenced by beginRun(), fillMuonId(), MuonIdProducer(), and produce().

std::unique_ptr<MuonTimingFiller> MuonIdProducer::theTimingFiller_
private

Definition at line 194 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

edm::Handle<reco::TrackToTrackMap> MuonIdProducer::tpfmsCollectionHandle_
private

Definition at line 231 of file MuonIdProducer.h.

Referenced by init(), and makeMuon().

edm::EDGetTokenT<reco::TrackToTrackMap> MuonIdProducer::tpfmsCollectionToken_
private

Definition at line 239 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

TrackDetectorAssociator MuonIdProducer::trackAssociator_
private

Definition at line 144 of file MuonIdProducer.h.

Referenced by fillMuonId(), and init().

std::string MuonIdProducer::trackDepositName_
private

Definition at line 253 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

std::unique_ptr<MuonKinkFinder> MuonIdProducer::trackerKinkFinder_
private

Definition at line 264 of file MuonIdProducer.h.

Referenced by fillTrackerKink(), init(), and MuonIdProducer().

bool MuonIdProducer::writeIsoDeposits_
private

Definition at line 219 of file MuonIdProducer.h.

Referenced by fillMuonIsolation(), MuonIdProducer(), and produce().