CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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 phiOfMuonInteractionRegion (const reco::Muon &muon) const
 

Private Attributes

bool addExtraSoftMuons_
 
bool arbClean_
 
bool arbitrateTrackerMuons_
 
double caloCut_
 
bool debugWithTruthMatching_
 
edm::Handle
< reco::TrackToTrackMap
dytCollectionHandle_
 
edm::EDGetTokenT
< reco::TrackToTrackMap
dytCollectionToken_
 
std::string ecalDepositName_
 
bool fillCaloCompatibility_
 
bool fillEnergy_
 
bool fillGlobalTrackQuality_
 
bool fillGlobalTrackRefits_
 
bool fillIsolation_
 
bool fillMatching_
 
bool fillShowerDigis_
 
bool fillTrackerKink_
 
const edm::ESGetToken
< CSCGeometry,
MuonGeometryRecord
geomTokenRun_
 
edm::Handle< edm::ValueMap
< reco::MuonQuality > > 
glbQualHandle_
 
edm::EDGetTokenT
< edm::ValueMap
< reco::MuonQuality > > 
glbQualToken_
 
edm::ESGetToken
< GlobalTrackingGeometry,
GlobalTrackingGeometryRecord
globalGeomToken_
 
edm::InputTag globalTrackQualityInputTag_
 
std::string hcalDepositName_
 
std::string hoDepositName_
 
edm::Handle
< reco::TrackCollection
innerTrackCollectionHandle_
 
edm::EDGetTokenT
< reco::TrackCollection
innerTrackCollectionToken_
 
std::vector< edm::InputTaginputCollectionLabels_
 
std::vector< ICTypes::ICTypeKeyinputCollectionTypes_
 
std::string jetDepositName_
 
edm::Handle
< reco::MuonTrackLinksCollection
linkCollectionHandle_
 
edm::EDGetTokenT
< reco::MuonTrackLinksCollection
linkCollectionToken_
 
double maxAbsDx_
 
double maxAbsDy_
 
double maxAbsEta_
 
double maxAbsPullX2_
 
double maxAbsPullY2_
 
std::unique_ptr< MuonMeshmeshAlgo_
 
int minNumberOfMatches_
 
double minP_
 
double minPCaloMuon_
 
double minPt_
 
std::unique_ptr
< reco::isodeposit::IsoDepositExtractor
muIsoExtractorCalo_
 
std::unique_ptr
< reco::isodeposit::IsoDepositExtractor
muIsoExtractorJet_
 
std::unique_ptr
< reco::isodeposit::IsoDepositExtractor
muIsoExtractorTrack_
 
MuonCaloCompatibility muonCaloCompatibility_
 
edm::Handle< reco::MuonCollectionmuonCollectionHandle_
 
edm::EDGetTokenT
< reco::MuonCollection
muonCollectionToken_
 
edm::Handle
< reco::TrackCollection
outerTrackCollectionHandle_
 
edm::EDGetTokenT
< reco::TrackCollection
outerTrackCollectionToken_
 
TrackAssociatorParameters parameters_
 
edm::Handle
< reco::TrackToTrackMap
pickyCollectionHandle_
 
edm::EDGetTokenT
< reco::TrackToTrackMap
pickyCollectionToken_
 
const edm::ESGetToken
< Propagator,
TrackingComponentsRecord
propagatorToken_
 
double ptThresholdToFillCandidateP4WithGlobalFit_
 
edm::Handle< RPCRecHitCollectionrpcHitHandle_
 
edm::EDGetTokenT
< RPCRecHitCollection
rpcHitToken_
 
double sigmaThresholdToFillCandidateP4WithGlobalFit_
 
bool storeCrossedHcalRecHits_
 
std::unique_ptr
< MuonShowerDigiFiller
theShowerDigiFiller_
 
std::unique_ptr< MuonTimingFillertheTimingFiller_
 
edm::Handle
< reco::TrackToTrackMap
tpfmsCollectionHandle_
 
edm::EDGetTokenT
< reco::TrackToTrackMap
tpfmsCollectionToken_
 
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 34 of file MuonIdProducer.cc.

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

Definition at line 192 of file MuonIdProducer.cc.

192  {
193  // TimingReport::current()->dump(std::cout);
194 }

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 1037 of file MuonIdProducer.cc.

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

Referenced by produce().

1037  {
1039  // arbitrate TrackerMuons
1040  // if a muon was exclusively TrackerMuon check if it can be a calo muon
1041  for (reco::MuonCollection::iterator muon = muons->begin(); muon != muons->end();) {
1042  if (muon->isTrackerMuon()) {
1043  if (muon->numberOfMatches(arbitration) < minNumberOfMatches_) {
1044  // TrackerMuon failed arbitration
1045  // If not any other base type - erase the element
1046  // (PFMuon is not a base type)
1047  unsigned int mask = reco::Muon::TrackerMuon | reco::Muon::PFMuon;
1048  if ((muon->type() & (~mask)) == 0) {
1049  const reco::CaloMuon& caloMuon = makeCaloMuon(*muon);
1050  if (isGoodCaloMuon(caloMuon))
1051  caloMuons->push_back(caloMuon);
1052  muon = muons->erase(muon);
1053  continue;
1054  } else {
1055  muon->setType(muon->type() & (~reco::Muon::TrackerMuon));
1056  }
1057  }
1058  }
1059  muon++;
1060  }
1061 }
ArbitrationType
define arbitration schemes
Definition: Muon.h:187
reco::CaloMuon makeCaloMuon(const reco::Muon &)
static const unsigned int TrackerMuon
Definition: Muon.h:286
static const unsigned int PFMuon
Definition: Muon.h:289
tuple muons
Definition: patZpeak.py:39
bool isGoodCaloMuon(const reco::CaloMuon &muon)
void MuonIdProducer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
override

Definition at line 419 of file MuonIdProducer.cc.

References fillMatching_, fillShowerDigis_, geomTokenRun_, edm::EventSetup::getData(), meshAlgo_, and theShowerDigiFiller_.

419  {
420  meshAlgo_->setCSCGeometry(&iSetup.getData(geomTokenRun_));
421 
423  theShowerDigiFiller_->getES(iSetup);
424 }
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > geomTokenRun_
bool getData(T &iHolder) const
Definition: EventSetup.h:128
std::unique_ptr< MuonShowerDigiFiller > theShowerDigiFiller_
std::unique_ptr< MuonMesh > meshAlgo_
unsigned int MuonIdProducer::chamberId ( const DetId id)
private

Definition at line 376 of file MuonIdProducer.cc.

References MuonSubdetId::CSC, CSCDetId, MuonSubdetId::DT, DTChamberId, and DetId::Muon.

Referenced by overlap().

376  {
377  if (id.det() != DetId::Muon)
378  return 0;
379 
380  const auto subdetId = id.subdetId();
381  if (subdetId == MuonSubdetId::DT) {
382  return DTChamberId(id.rawId()).rawId();
383  } else if (subdetId == MuonSubdetId::CSC) {
384  return CSCDetId(id.rawId()).chamberId().rawId();
385  }
386 
387  return 0;
388 }
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 1379 of file MuonIdProducer.cc.

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

Referenced by produce().

1379  {
1380  const bool trackBAD = links->trackerTrack().isNull();
1381  const bool staBAD = links->standAloneTrack().isNull();
1382  const bool glbBAD = links->globalTrack().isNull();
1383  if (trackBAD || staBAD || glbBAD) {
1384  edm::LogWarning("muonIDbadLinks") << "Global muon links to constituent tracks are invalid: trkBad " << trackBAD
1385  << " standaloneBad " << staBAD << " globalBad " << glbBAD
1386  << ". There should be no such object. Muon is skipped.";
1387  return false;
1388  }
1389  return true;
1390 }
bool isNull() const
Checks for null.
Definition: Ref.h:235
Log< level::Warning, false > LogWarning
void MuonIdProducer::fillArbitrationInfo ( reco::MuonCollection pOutputMuons,
unsigned int  muonType = reco::Muon::TrackerMuon 
)
private

Definition at line 1063 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, MuonSubdetId::CSC, CSCDetId, getSegmentMatches(), meshAlgo_, plotscripts::stationIndex(), and reco::Muon::TrackerMuon.

Referenced by produce().

1063  {
1064  //
1065  // apply segment flags
1066  //
1067  std::vector<std::pair<reco::MuonChamberMatch*, reco::MuonSegmentMatch*> > chamberPairs; // for chamber segment sorting
1068  std::vector<std::pair<reco::MuonChamberMatch*, reco::MuonSegmentMatch*> > stationPairs; // for station segment sorting
1069  std::vector<std::pair<reco::MuonChamberMatch*, reco::MuonSegmentMatch*> >
1070  arbitrationPairs; // for muon segment arbitration
1071 
1072  // muonIndex1
1073  for (unsigned int muonIndex1 = 0; muonIndex1 < pOutputMuons->size(); ++muonIndex1) {
1074  auto& muon1 = pOutputMuons->at(muonIndex1);
1075  // chamberIter1
1076  for (auto& chamber1 : muon1.matches()) {
1077  // segmentIter1
1078  std::vector<reco::MuonSegmentMatch>* segmentMatches1 = getSegmentMatches(chamber1, muonType);
1079 
1080  if (segmentMatches1->empty())
1081  continue;
1082  chamberPairs.clear();
1083 
1084  for (auto& segment1 : *segmentMatches1) {
1085  chamberPairs.push_back(std::make_pair(&chamber1, &segment1));
1086  if (!segment1.isMask()) // has not yet been arbitrated
1087  {
1088  arbitrationPairs.clear();
1089  arbitrationPairs.push_back(std::make_pair(&chamber1, &segment1));
1090 
1091  // find identical segments with which to arbitrate
1092  // tracker muons only
1093  if (muon1.type() & muonType) {
1094  // muonIndex2
1095  for (unsigned int muonIndex2 = muonIndex1 + 1; muonIndex2 < pOutputMuons->size(); ++muonIndex2) {
1096  auto& muon2 = pOutputMuons->at(muonIndex2);
1097  // tracker muons only
1098  if (!(muon2.type() & muonType))
1099  continue;
1100  // chamberIter2
1101  for (auto& chamber2 : muon2.matches()) {
1102  // segmentIter2
1103  std::vector<reco::MuonSegmentMatch>* segmentMatches2 = getSegmentMatches(chamber2, muonType);
1104  for (auto& segment2 : *segmentMatches2) {
1105  if (segment2.isMask())
1106  continue; // has already been arbitrated
1107  if (approxEqual(segment2.x, segment1.x) && approxEqual(segment2.y, segment1.y) &&
1108  approxEqual(segment2.dXdZ, segment1.dXdZ) && approxEqual(segment2.dYdZ, segment1.dYdZ) &&
1109  approxEqual(segment2.xErr, segment1.xErr) && approxEqual(segment2.yErr, segment1.yErr) &&
1110  approxEqual(segment2.dXdZErr, segment1.dXdZErr) &&
1111  approxEqual(segment2.dYdZErr, segment1.dYdZErr)) {
1112  arbitrationPairs.push_back(std::make_pair(&chamber2, &segment2));
1113  }
1114  } // segmentIter2
1115  } // chamberIter2
1116  } // muonIndex2
1117  }
1118 
1119  // arbitration segment sort
1120  if (arbitrationPairs.empty())
1121  continue; // this should never happen
1122  if (arbitrationPairs.size() == 1) {
1123  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDRSlope);
1124  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDXSlope);
1125  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDR);
1126  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDX);
1127  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::Arbitrated);
1128  } else {
1129  sort(arbitrationPairs.begin(),
1130  arbitrationPairs.end(),
1132  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDRSlope);
1133  sort(arbitrationPairs.begin(),
1134  arbitrationPairs.end(),
1136  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDXSlope);
1137  sort(arbitrationPairs.begin(),
1138  arbitrationPairs.end(),
1140  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDR);
1141  sort(arbitrationPairs.begin(),
1142  arbitrationPairs.end(),
1144  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDX);
1145  for (auto& ap : arbitrationPairs) {
1146  ap.second->setMask(reco::MuonSegmentMatch::Arbitrated);
1147  }
1148  }
1149  }
1150 
1151  // setup me1a cleaning for later
1152  if (muonType == reco::Muon::TrackerMuon && chamber1.id.subdetId() == MuonSubdetId::CSC && arbClean_ &&
1153  CSCDetId(chamber1.id).ring() == 4) {
1154  for (auto& segment2 : chamber1.segmentMatches) {
1155  if (segment1.cscSegmentRef.isNull() || segment2.cscSegmentRef.isNull())
1156  continue;
1157  if (meshAlgo_->isDuplicateOf(segment1.cscSegmentRef, segment2.cscSegmentRef) &&
1158  (segment2.mask & 0x1e0000) && (segment1.mask & 0x1e0000)) {
1160  //if the track has lost the segment already through normal arbitration no need to do it again.
1161  }
1162  }
1163  } // mark all ME1/a duplicates that this track owns
1164 
1165  } // segmentIter1
1166 
1167  // chamber segment sort
1168  if (chamberPairs.empty())
1169  continue; // this should never happen
1170  if (chamberPairs.size() == 1) {
1171  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDRSlope);
1172  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDXSlope);
1173  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDR);
1174  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDX);
1175  } else {
1176  sort(chamberPairs.begin(),
1177  chamberPairs.end(),
1179  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDRSlope);
1180  sort(chamberPairs.begin(),
1181  chamberPairs.end(),
1183  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDXSlope);
1184  sort(chamberPairs.begin(),
1185  chamberPairs.end(),
1187  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDR);
1188  sort(chamberPairs.begin(),
1189  chamberPairs.end(),
1191  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDX);
1192  }
1193  } // chamberIter1
1194 
1195  // station segment sort
1196  for (int stationIndex = 1; stationIndex < 5; ++stationIndex) {
1197  for (int detectorIndex = 1; detectorIndex <= 5;
1198  ++detectorIndex) // 1-5, as in DataFormats/MuonDetId/interface/MuonSubdetId.h
1199  {
1200  stationPairs.clear();
1201 
1202  // chamberIter
1203  for (auto& chamber : muon1.matches()) {
1204  if (!(chamber.station() == stationIndex && chamber.detector() == detectorIndex))
1205  continue;
1206  std::vector<reco::MuonSegmentMatch>* segmentMatches = getSegmentMatches(chamber, muonType);
1207  if (segmentMatches->empty())
1208  continue;
1209 
1210  for (auto& segment : *segmentMatches) {
1211  stationPairs.push_back(std::make_pair(&chamber, &segment));
1212  }
1213  } // chamberIter
1214 
1215  if (stationPairs.empty())
1216  continue; // this may very well happen
1217  if (stationPairs.size() == 1) {
1218  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDRSlope);
1219  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDXSlope);
1220  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDR);
1221  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDX);
1222  } else {
1223  sort(stationPairs.begin(),
1224  stationPairs.end(),
1226  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDRSlope);
1227  sort(stationPairs.begin(),
1228  stationPairs.end(),
1230  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDXSlope);
1231  sort(stationPairs.begin(),
1232  stationPairs.end(),
1234  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDR);
1235  sort(stationPairs.begin(),
1236  stationPairs.end(),
1238  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDX);
1239  }
1240  }
1241  }
1242 
1243  } // muonIndex1
1244 
1245  if (arbClean_) {
1246  // clear old mesh, create and prune new mesh!
1247  meshAlgo_->clearMesh();
1248  meshAlgo_->runMesh(pOutputMuons);
1249  }
1250 }
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
static const unsigned int BestInChamberByDR
static const unsigned int BestInStationByDXSlope
static const unsigned int BestInChamberByDXSlope
static const unsigned int TrackerMuon
Definition: Muon.h:286
static const unsigned int BelongsToTrackByDRSlope
static const unsigned int BelongsToTrackByDR
static const unsigned int BelongsToTrackByDX
functor predicate for standard library sort algorithm
def stationIndex
Definition: plotscripts.py:355
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 1392 of file MuonIdProducer.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and edm::ParameterSetDescription::setAllowAnything().

1392  {
1394  desc.setAllowAnything();
1395 
1396  desc.add<bool>("arbitrateTrackerMuons", false);
1397  desc.add<bool>("storeCrossedHcalRecHits", false);
1398  desc.add<bool>("fillShowerDigis", false);
1399 
1400  edm::ParameterSetDescription descTrkAsoPar;
1401  descTrkAsoPar.add<edm::InputTag>("GEMSegmentCollectionLabel", edm::InputTag("gemSegments"));
1402  descTrkAsoPar.add<edm::InputTag>("ME0SegmentCollectionLabel", edm::InputTag("me0Segments"));
1403  descTrkAsoPar.add<bool>("useGEM", false);
1404  descTrkAsoPar.add<bool>("useME0", false);
1405  descTrkAsoPar.setAllowAnything();
1406  desc.add<edm::ParameterSetDescription>("TrackAssociatorParameters", descTrkAsoPar);
1407 
1409  descJet.setAllowAnything();
1410  descJet.add<edm::ParameterSetDescription>("TrackAssociatorParameters", descTrkAsoPar);
1411  desc.add<edm::ParameterSetDescription>("JetExtractorPSet", descJet);
1412 
1414  descCalo.setAllowAnything();
1415  descCalo.add<edm::ParameterSetDescription>("TrackAssociatorParameters", descTrkAsoPar);
1416  desc.add<edm::ParameterSetDescription>("CaloExtractorPSet", descCalo);
1417 
1418  descriptions.addDefault(desc);
1419 }
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 1358 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().

1358  {
1360  aMuon.setCombinedQuality((*glbQualHandle_)[aMuon.combinedMuon()]);
1361  }
1362 
1363  LogDebug("MuonIdentification") << "tkChiVal " << aMuon.combinedQuality().trkRelChi2;
1364 }
TrackRef combinedMuon() const override
reference to a stand-alone muon Track
Definition: Muon.h:52
float trkRelChi2
chi2 value for the inner track stub with respect to the global track
Definition: MuonQuality.h:15
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
void setCombinedQuality(const MuonQuality &combinedQuality)
set energy deposition information
Definition: Muon.h:121
bool isGlobalMuon() const override
Definition: Muon.h:299
edm::Handle< edm::ValueMap< reco::MuonQuality > > glbQualHandle_
#define LogDebug(id)
void MuonIdProducer::fillMuonId ( edm::Event iEvent,
const edm::EventSetup iSetup,
reco::Muon aMuon,
TrackDetectorAssociator::Direction  direction = TrackDetectorAssociator::InsideOut 
)
private

Definition at line 802 of file MuonIdProducer.cc.

References funct::abs(), TrackDetectorAssociator::associate(), reco::MuonRPCHitMatch::bx, 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_, maxAbsPullX2_, maxAbsPullY2_, MuonSubdetId::ME0, reco::MuonChamberMatch::me0Matches, reco::MuonSegmentMatch::me0SegmentRef, reco::Muon::NoArbitration, reco::Muon::numberOfMatches(), TrackDetMatchInfo::nXnEnergy(), or, parameters_, funct::pow(), MuonSubdetId::RPC, 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_FULL_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().

805  {
806  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId";
807 
808  // perform track - detector association
809  const reco::Track* track = nullptr;
810  if (aMuon.track().isNonnull())
811  track = aMuon.track().get();
812  else if (aMuon.standAloneMuon().isNonnull())
813  track = aMuon.standAloneMuon().get();
814  else
815  throw cms::Exception("FatalError")
816  << "Failed to fill muon id information for a muon with undefined references to tracks";
817 
818  TrackDetMatchInfo info = trackAssociator_.associate(iEvent, iSetup, *track, parameters_, direction);
819 
820  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId :: fillEnergy = " << fillEnergy_;
821 
822  if (fillEnergy_) {
823  reco::MuonEnergy muonEnergy;
826  muonEnergy.ho = info.crossedEnergy(TrackDetMatchInfo::HORecHits);
828  muonEnergy.emS9 = info.nXnEnergy(TrackDetMatchInfo::EcalRecHits, 1); // 3x3 energy
829  muonEnergy.emS25 = info.nXnEnergy(TrackDetMatchInfo::EcalRecHits, 2); // 5x5 energy
830  muonEnergy.hadS9 = info.nXnEnergy(TrackDetMatchInfo::HcalRecHits, 1); // 3x3 energy
831  muonEnergy.hoS9 = info.nXnEnergy(TrackDetMatchInfo::HORecHits, 1); // 3x3 energy
832  muonEnergy.towerS9 = info.nXnEnergy(TrackDetMatchInfo::TowerTotal, 1); // 3x3 energy
834  muonEnergy.crossedHadRecHits.clear();
835  for (auto hit : info.crossedHcalRecHits) {
837  mhit.energy = hit->energy();
838  mhit.chi2 = hit->chi2();
839  mhit.time = hit->time();
840  mhit.detId = hit->id();
841  muonEnergy.crossedHadRecHits.push_back(mhit);
842  }
843  }
844  muonEnergy.ecal_position = info.trkGlobPosAtEcal;
845  muonEnergy.hcal_position = info.trkGlobPosAtHcal;
846  if (!info.crossedEcalIds.empty())
847  muonEnergy.ecal_id = info.crossedEcalIds.front();
848  if (!info.crossedHcalIds.empty())
849  muonEnergy.hcal_id = info.crossedHcalIds.front();
850  // find maximal energy depositions and their time
851  DetId emMaxId = info.findMaxDeposition(TrackDetMatchInfo::EcalRecHits, 2); // max energy deposit in 5x5 shape
852  for (const auto& hit : info.ecalRecHits) {
853  if (hit->id() != emMaxId)
854  continue;
855  muonEnergy.emMax = hit->energy();
856  muonEnergy.ecal_time = hit->time();
857  }
858  DetId hadMaxId = info.findMaxDeposition(TrackDetMatchInfo::HcalRecHits, 1); // max energy deposit in 3x3 shape
859  for (const auto& hit : info.hcalRecHits) {
860  if (hit->id() != hadMaxId)
861  continue;
862  muonEnergy.hadMax = hit->energy();
863  muonEnergy.hcal_time = hit->time();
864  }
865  aMuon.setCalEnergy(muonEnergy);
866  }
867  if (!fillMatching_ && !aMuon.isTrackerMuon() && !aMuon.isRPCMuon())
868  return;
869 
870  // fill muon match info
871  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId :: fill muon match info ";
872  std::vector<reco::MuonChamberMatch> muonChamberMatches;
873  unsigned int nubmerOfMatchesAccordingToTrackAssociator = 0;
874  for (const auto& chamber : info.chambers) {
875  if (chamber.id.subdetId() == MuonSubdetId::RPC && rpcHitHandle_.isValid())
876  continue; // Skip RPC chambers, they are taken care of below)
877  reco::MuonChamberMatch matchedChamber;
878 
879  const auto& lErr = chamber.tState.localError();
880  const auto& lPos = chamber.tState.localPosition();
881  const auto& lDir = chamber.tState.localDirection();
882 
883  const auto& localError = lErr.positionError();
884  matchedChamber.x = lPos.x();
885  matchedChamber.y = lPos.y();
886  matchedChamber.xErr = sqrt(localError.xx());
887  matchedChamber.yErr = sqrt(localError.yy());
888 
889  matchedChamber.dXdZ = lDir.z() != 0 ? lDir.x() / lDir.z() : 9999;
890  matchedChamber.dYdZ = lDir.z() != 0 ? lDir.y() / lDir.z() : 9999;
891  // DANGEROUS - compiler cannot guaranty parameters ordering
892  AlgebraicSymMatrix55 trajectoryCovMatrix = lErr.matrix();
893  matchedChamber.dXdZErr = trajectoryCovMatrix(1, 1) > 0 ? sqrt(trajectoryCovMatrix(1, 1)) : 0;
894  matchedChamber.dYdZErr = trajectoryCovMatrix(2, 2) > 0 ? sqrt(trajectoryCovMatrix(2, 2)) : 0;
895 
896  matchedChamber.edgeX = chamber.localDistanceX;
897  matchedChamber.edgeY = chamber.localDistanceY;
898 
899  matchedChamber.id = chamber.id;
900 
902  theShowerDigiFiller_->fill(matchedChamber);
903  } else {
904  theShowerDigiFiller_->fillDefault(matchedChamber);
905  }
906 
907  if (!chamber.segments.empty())
908  ++nubmerOfMatchesAccordingToTrackAssociator;
909 
910  // fill segments
911  for (const auto& segment : chamber.segments) {
912  reco::MuonSegmentMatch matchedSegment;
913  matchedSegment.x = segment.segmentLocalPosition.x();
914  matchedSegment.y = segment.segmentLocalPosition.y();
915  matchedSegment.dXdZ =
916  segment.segmentLocalDirection.z() ? segment.segmentLocalDirection.x() / segment.segmentLocalDirection.z() : 0;
917  matchedSegment.dYdZ =
918  segment.segmentLocalDirection.z() ? segment.segmentLocalDirection.y() / segment.segmentLocalDirection.z() : 0;
919  matchedSegment.xErr = segment.segmentLocalErrorXX > 0 ? sqrt(segment.segmentLocalErrorXX) : 0;
920  matchedSegment.yErr = segment.segmentLocalErrorYY > 0 ? sqrt(segment.segmentLocalErrorYY) : 0;
921  matchedSegment.dXdZErr = segment.segmentLocalErrorDxDz > 0 ? sqrt(segment.segmentLocalErrorDxDz) : 0;
922  matchedSegment.dYdZErr = segment.segmentLocalErrorDyDz > 0 ? sqrt(segment.segmentLocalErrorDyDz) : 0;
923  matchedSegment.t0 = segment.t0;
924  matchedSegment.mask = 0;
925  matchedSegment.dtSegmentRef = segment.dtSegmentRef;
926  matchedSegment.cscSegmentRef = segment.cscSegmentRef;
927  matchedSegment.gemSegmentRef = segment.gemSegmentRef;
928  matchedSegment.me0SegmentRef = segment.me0SegmentRef;
929  matchedSegment.hasZed_ = segment.hasZed;
930  matchedSegment.hasPhi_ = segment.hasPhi;
931  // test segment
932  bool matchedX = false;
933  bool matchedY = false;
934  LogTrace("MuonIdentification") << " matching local x, segment x: " << matchedSegment.x
935  << ", chamber x: " << matchedChamber.x << ", max: " << maxAbsDx_;
936  LogTrace("MuonIdentification") << " matching local y, segment y: " << matchedSegment.y
937  << ", chamber y: " << matchedChamber.y << ", max: " << maxAbsDy_;
938  const double matchedSegChDx = std::abs(matchedSegment.x - matchedChamber.x);
939  const double matchedSegChDy = std::abs(matchedSegment.y - matchedChamber.y);
940  if (matchedSegment.xErr > 0 && matchedChamber.xErr > 0)
941  LogTrace("MuonIdentification") << " xpull: "
942  << matchedSegChDx / std::sqrt(std::pow(matchedSegment.xErr, 2) +
943  std::pow(matchedChamber.xErr, 2));
944  if (matchedSegment.yErr > 0 && matchedChamber.yErr > 0)
945  LogTrace("MuonIdentification") << " ypull: "
946  << matchedSegChDy / std::sqrt(std::pow(matchedSegment.yErr, 2) +
947  std::pow(matchedChamber.yErr, 2));
948 
949  if (matchedSegChDx < maxAbsDx_)
950  matchedX = true;
951  else if (matchedSegment.xErr > 0 && matchedChamber.xErr > 0) {
952  const double invMatchedSegChPullX2 = std::pow(matchedSegment.xErr, 2) + std::pow(matchedChamber.xErr, 2);
953  if (matchedSegChDx * matchedSegChDx < maxAbsPullX2_ * invMatchedSegChPullX2)
954  matchedX = true;
955  }
956  if (matchedSegChDy < maxAbsDy_)
957  matchedY = true;
958  else if (matchedSegment.yErr > 0 && matchedChamber.yErr > 0) {
959  const double invMatchedSegChPullY2 = std::pow(matchedSegment.yErr, 2) + std::pow(matchedChamber.yErr, 2);
960  if (matchedSegChDy * matchedSegChDy < maxAbsPullY2_ * invMatchedSegChPullY2)
961  matchedY = true;
962  }
963  if (matchedX && matchedY) {
964  if (matchedChamber.id.subdetId() == MuonSubdetId::ME0)
965  matchedChamber.me0Matches.push_back(matchedSegment);
966  else if (matchedChamber.id.subdetId() == MuonSubdetId::GEM)
967  matchedChamber.gemMatches.push_back(matchedSegment);
968  else
969  matchedChamber.segmentMatches.push_back(matchedSegment);
970  }
971  }
972  muonChamberMatches.push_back(matchedChamber);
973  }
974 
975  // Fill RPC info
976  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId :: fill RPC info";
977  if (rpcHitHandle_.isValid()) {
978  for (const auto& chamber : info.chambers) {
979  if (chamber.id.subdetId() != MuonSubdetId::RPC)
980  continue; // Consider RPC chambers only
981  const auto& lErr = chamber.tState.localError();
982  const auto& lPos = chamber.tState.localPosition();
983  const auto& lDir = chamber.tState.localDirection();
984 
985  reco::MuonChamberMatch matchedChamber;
986 
987  LocalError localError = lErr.positionError();
988  matchedChamber.x = lPos.x();
989  matchedChamber.y = lPos.y();
990  matchedChamber.xErr = sqrt(localError.xx());
991  matchedChamber.yErr = sqrt(localError.yy());
992 
993  matchedChamber.dXdZ = lDir.z() != 0 ? lDir.x() / lDir.z() : 9999;
994  matchedChamber.dYdZ = lDir.z() != 0 ? lDir.y() / lDir.z() : 9999;
995  // DANGEROUS - compiler cannot guaranty parameters ordering
996  AlgebraicSymMatrix55 trajectoryCovMatrix = lErr.matrix();
997  matchedChamber.dXdZErr = trajectoryCovMatrix(1, 1) > 0 ? sqrt(trajectoryCovMatrix(1, 1)) : 0;
998  matchedChamber.dYdZErr = trajectoryCovMatrix(2, 2) > 0 ? sqrt(trajectoryCovMatrix(2, 2)) : 0;
999 
1000  matchedChamber.edgeX = chamber.localDistanceX;
1001  matchedChamber.edgeY = chamber.localDistanceY;
1002 
1003  theShowerDigiFiller_->fillDefault(matchedChamber);
1004 
1005  matchedChamber.id = chamber.id;
1006 
1007  for (const auto& rpcRecHit : *rpcHitHandle_) {
1008  reco::MuonRPCHitMatch rpcHitMatch;
1009 
1010  if (rpcRecHit.rawId() != chamber.id.rawId())
1011  continue;
1012 
1013  rpcHitMatch.x = rpcRecHit.localPosition().x();
1014  rpcHitMatch.mask = 0;
1015  rpcHitMatch.bx = rpcRecHit.BunchX();
1016 
1017  const double absDx = std::abs(rpcRecHit.localPosition().x() - chamber.tState.localPosition().x());
1018  if (absDx <= 20 or absDx * absDx <= 16 * localError.xx())
1019  matchedChamber.rpcMatches.push_back(rpcHitMatch);
1020  }
1021 
1022  muonChamberMatches.push_back(matchedChamber);
1023  }
1024  }
1025 
1026  aMuon.setMatches(muonChamberMatches);
1027 
1028  LogTrace("MuonIdentification") << "number of muon chambers: " << aMuon.matches().size() << "\n"
1029  << "number of chambers with segments according to the associator requirements: "
1030  << nubmerOfMatchesAccordingToTrackAssociator;
1031  LogTrace("MuonIdentification") << "number of segment matches with the producer requirements: "
1033 
1034  // fillTime( iEvent, iSetup, aMuon );
1035 }
float xx() const
Definition: LocalError.h:22
GEMSegmentRef gemSegmentRef
DTRecSegment4DRef dtSegmentRef
static const TGPicture * info(bool iBackgroundIsBlack)
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
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
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
TrackRef track() const override
reference to a Track
Definition: Muon.h:46
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
bool isTrackerMuon() const override
Definition: Muon.h:300
#define LogTrace(id)
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 isRPCMuon() const
Definition: Muon.h:304
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
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
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
Definition: Muon.h:49
ME0SegmentRef me0SegmentRef
bool isValid() const
Definition: HandleBase.h:70
double crossedEnergy(EnergyType)
energy in detector elements crossed by the track by types
math::XYZPointF hcal_position
Definition: MuonEnergy.h:54
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
static constexpr int RPC
Definition: MuonSubdetId.h:13
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
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
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 1252 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_FULL_cff::track, reco::MuonIsolation::trackerVetoPt, and writeIsoDeposits_.

Referenced by produce().

1259  {
1260  const reco::Track* track = nullptr;
1261  if (aMuon.track().isNonnull())
1262  track = aMuon.track().get();
1263  else if (aMuon.standAloneMuon().isNonnull())
1264  track = aMuon.standAloneMuon().get();
1265  else
1266  throw cms::Exception("FatalError")
1267  << "Failed to compute muon isolation information for a muon with undefined references to tracks";
1268 
1269  reco::MuonIsolation isoR03, isoR05;
1270 
1271  // get deposits
1272  reco::IsoDeposit depTrk = muIsoExtractorTrack_->deposit(iEvent, iSetup, *track);
1273  std::vector<reco::IsoDeposit> caloDeps = muIsoExtractorCalo_->deposits(iEvent, iSetup, *track);
1274  reco::IsoDeposit depJet = muIsoExtractorJet_->deposit(iEvent, iSetup, *track);
1275 
1276  if (caloDeps.size() != 3) {
1277  LogTrace("MuonIdentification") << "Failed to fill vector of calorimeter isolation deposits!";
1278  return;
1279  }
1280 
1281  reco::IsoDeposit depEcal = caloDeps.at(0);
1282  reco::IsoDeposit depHcal = caloDeps.at(1);
1283  reco::IsoDeposit depHo = caloDeps.at(2);
1284 
1285  //no need to copy outside if we don't write them
1286  if (writeIsoDeposits_) {
1287  trackDep = depTrk;
1288  ecalDep = depEcal;
1289  hcalDep = depHcal;
1290  hoDep = depHo;
1291  jetDep = depJet;
1292  }
1293 
1294  isoR03.sumPt = depTrk.depositWithin(0.3);
1295  isoR03.emEt = depEcal.depositWithin(0.3);
1296  isoR03.hadEt = depHcal.depositWithin(0.3);
1297  isoR03.hoEt = depHo.depositWithin(0.3);
1298  isoR03.nTracks = depTrk.depositAndCountWithin(0.3).second;
1299  isoR03.nJets = depJet.depositAndCountWithin(0.3).second;
1300  isoR03.trackerVetoPt = depTrk.candEnergy();
1301  isoR03.emVetoEt = depEcal.candEnergy();
1302  isoR03.hadVetoEt = depHcal.candEnergy();
1303  isoR03.hoVetoEt = depHo.candEnergy();
1304 
1305  isoR05.sumPt = depTrk.depositWithin(0.5);
1306  isoR05.emEt = depEcal.depositWithin(0.5);
1307  isoR05.hadEt = depHcal.depositWithin(0.5);
1308  isoR05.hoEt = depHo.depositWithin(0.5);
1309  isoR05.nTracks = depTrk.depositAndCountWithin(0.5).second;
1310  isoR05.nJets = depJet.depositAndCountWithin(0.5).second;
1311  isoR05.trackerVetoPt = depTrk.candEnergy();
1312  isoR05.emVetoEt = depEcal.candEnergy();
1313  isoR05.hadVetoEt = depHcal.candEnergy();
1314  isoR05.hoVetoEt = depHo.candEnergy();
1315 
1316  aMuon.setIsolation(isoR03, isoR05);
1317 }
float hadEt
hcal sum-Et
Definition: MuonIsolation.h:8
double candEnergy() const
Get energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:129
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
TrackRef track() const override
reference to a Track
Definition: Muon.h:46
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > muIsoExtractorTrack_
#define LogTrace(id)
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
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 1366 of file MuonIdProducer.cc.

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

Referenced by produce().

1366  {
1367  // skip muons with no tracks
1368  if (aMuon.innerTrack().isNull())
1369  return;
1370  // get quality from muon if already there, otherwise make empty one
1372  // fill it
1373  const bool filled = trackerKinkFinder_->fillTrkKink(quality, *aMuon.innerTrack());
1374  // if quality was there, or if we filled it, commit to the muon
1375  if (filled || aMuon.isQualityValid())
1376  aMuon.setCombinedQuality(quality);
1377 }
std::unique_ptr< MuonKinkFinder > trackerKinkFinder_
virtual TrackRef innerTrack() const
Definition: Muon.h:45
uint32_t const *__restrict__ Quality * quality
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:292
static const unsigned int TrackerMuon
Definition: Muon.h:286
std::vector< reco::MuonSegmentMatch > segmentMatches
static const unsigned int GEMMuon
Definition: Muon.h:291
void MuonIdProducer::init ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 196 of file MuonIdProducer.cc.

References edm::HandleBase::clear(), dytCollectionHandle_, dytCollectionToken_, Exception, fillGlobalTrackQuality_, fillGlobalTrackRefits_, fillTrackerKink_, edm::Event::getByToken(), edm::EventSetup::getData(), glbQualHandle_, glbQualToken_, mps_fire::i, MuonIdProducer::ICTypes::INNER_TRACKS, innerTrackCollectionHandle_, innerTrackCollectionToken_, inputCollectionLabels_, inputCollectionTypes_, dtTPAnalyzer_cfg::inputLabel, edm::HandleBase::isValid(), linkCollectionHandle_, linkCollectionToken_, MuonIdProducer::ICTypes::LINKS, LogTrace, muonCollectionHandle_, muonCollectionToken_, MuonIdProducer::ICTypes::MUONS, MuonIdProducer::ICTypes::OUTER_TRACKS, outerTrackCollectionHandle_, outerTrackCollectionToken_, pickyCollectionHandle_, pickyCollectionToken_, propagatorToken_, rpcHitHandle_, rpcHitToken_, TrackDetectorAssociator::setPropagator(), MuonIdProducer::ICTypes::TEV_DYT, MuonIdProducer::ICTypes::TEV_FIRSTHIT, MuonIdProducer::ICTypes::TEV_PICKY, MuonIdProducer::ICTypes::toStr(), tpfmsCollectionHandle_, tpfmsCollectionToken_, trackAssociator_, and trackerKinkFinder_.

Referenced by produce().

196  {
201 
205 
207 
208  if (fillTrackerKink_)
209  trackerKinkFinder_->init(iSetup);
210 
211  for (unsigned int i = 0; i < inputCollectionLabels_.size(); ++i) {
212  const auto& inputLabel = inputCollectionLabels_[i];
213  const auto inputType = inputCollectionTypes_[i];
214  if (inputType == ICTypes::INNER_TRACKS) {
217  throw cms::Exception("FatalError") << "Failed to get input track collection with label: " << inputLabel;
218  LogTrace("MuonIdentification") << "Number of input inner tracks: " << innerTrackCollectionHandle_->size();
219  } else if (inputType == ICTypes::OUTER_TRACKS) {
222  throw cms::Exception("FatalError") << "Failed to get input track collection with label: " << inputLabel;
223  LogTrace("MuonIdentification") << "Number of input outer tracks: " << outerTrackCollectionHandle_->size();
224  } else if (inputType == ICTypes::LINKS) {
227  throw cms::Exception("FatalError") << "Failed to get input link collection with label: " << inputLabel;
228  LogTrace("MuonIdentification") << "Number of input links: " << linkCollectionHandle_->size();
229  } else if (inputType == ICTypes::MUONS) {
232  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
233  LogTrace("MuonIdentification") << "Number of input muons: " << muonCollectionHandle_->size();
234  } else if (fillGlobalTrackRefits_ && inputType == ICTypes::TEV_FIRSTHIT) {
237  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
238  LogTrace("MuonIdentification") << "Number of input muons: " << tpfmsCollectionHandle_->size();
239  } else if (fillGlobalTrackRefits_ && inputType == ICTypes::TEV_PICKY) {
242  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
243  LogTrace("MuonIdentification") << "Number of input muons: " << pickyCollectionHandle_->size();
244  } else if (fillGlobalTrackRefits_ && inputType == ICTypes::TEV_DYT) {
247  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
248  LogTrace("MuonIdentification") << "Number of input muons: " << dytCollectionHandle_->size();
249  } else
250  throw cms::Exception("FatalError") << "Unknown input collection type: #" << ICTypes::toStr(inputType);
251  }
252 
256 }
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:539
edm::Handle< reco::MuonTrackLinksCollection > linkCollectionHandle_
edm::EDGetTokenT< RPCRecHitCollection > rpcHitToken_
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
edm::EDGetTokenT< reco::TrackToTrackMap > pickyCollectionToken_
static std::string toStr(const ICTypeKey k)
#define LogTrace(id)
bool getData(T &iHolder) const
Definition: EventSetup.h:128
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_
bool fillGlobalTrackRefits_
std::vector< ICTypes::ICTypeKey > inputCollectionTypes_
std::vector< edm::InputTag > inputCollectionLabels_
bool fillGlobalTrackQuality_
edm::Handle< reco::TrackToTrackMap > tpfmsCollectionHandle_
edm::Handle< reco::TrackCollection > innerTrackCollectionHandle_
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 774 of file MuonIdProducer.cc.

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

Referenced by arbitrateMuons(), and produce().

774  {
775  if (!caloMuon.isCaloCompatibilityValid() || caloMuon.caloCompatibility() < caloCut_ || caloMuon.p() < minPCaloMuon_)
776  return false;
777  return true;
778 }
bool MuonIdProducer::isGoodGEMMuon ( const reco::Muon muon)
private

Definition at line 789 of file MuonIdProducer.cc.

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

Referenced by produce().

789  {
790  if (muon.track()->pt() < minPt_ || muon.track()->p() < minP_)
791  return false;
793 }
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 795 of file MuonIdProducer.cc.

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

Referenced by produce().

795  {
796  // need to update min cuts on pt
797  if (muon.track()->p() < minP_)
798  return false;
800 }
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 780 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().

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

Definition at line 356 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().

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

Definition at line 765 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().

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

Definition at line 278 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().

278  {
279  LogTrace("MuonIdentification") << "Creating a CaloMuon from a Muon";
280 
281  reco::CaloMuon aMuon;
282  aMuon.setInnerTrack(muon.innerTrack());
283 
284  if (muon.isEnergyValid())
285  aMuon.setCalEnergy(muon.calEnergy());
286  // get calo compatibility
289  return aMuon;
290 }
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 258 of file MuonIdProducer.cc.

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

Referenced by makeMuon(), and produce().

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

Definition at line 292 of file MuonIdProducer.cc.

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

292  {
293  LogTrace("MuonIdentification") << "Creating a muon from a link to tracks object";
294 
295  reco::Muon aMuon;
296  reco::Muon::MuonTrackTypePair chosenTrack;
297  reco::TrackRef tpfmsRef;
298  reco::TrackRef pickyRef;
299  reco::TrackRef dytRef;
300  bool useSigmaSwitch = false;
301 
307 
308  if (tpfmsRef.isNull() && pickyRef.isNull() && dytRef.isNull()) {
309  edm::LogWarning("MakeMuonWithTEV") << "Failed to get TEV refits, fall back to sigma switch.";
310  useSigmaSwitch = true;
311  }
312  } else {
313  useSigmaSwitch = true;
314  }
315 
316  if (useSigmaSwitch) {
317  chosenTrack = muon::sigmaSwitch(links.globalTrack(),
318  links.trackerTrack(),
321  } else {
322  chosenTrack = muon::tevOptimized(links.globalTrack(),
323  links.trackerTrack(),
324  tpfmsRef,
325  pickyRef,
326  dytRef,
328  }
329  aMuon = makeMuon(*chosenTrack.first);
330  aMuon.setInnerTrack(links.trackerTrack());
331  aMuon.setOuterTrack(links.standAloneTrack());
332  aMuon.setGlobalTrack(links.globalTrack());
333  aMuon.setBestTrack(chosenTrack.second);
334  aMuon.setTunePBestTrack(chosenTrack.second);
335 
339  if (it != tpfmsCollectionHandle_->end())
340  aMuon.setMuonTrack(reco::Muon::TPFMS, (it->val));
341  }
344  if (it != pickyCollectionHandle_->end())
345  aMuon.setMuonTrack(reco::Muon::Picky, (it->val));
346  }
349  if (it != dytCollectionHandle_->end())
350  aMuon.setMuonTrack(reco::Muon::DYT, (it->val));
351  }
352  }
353  return aMuon;
354 }
reco::Muon makeMuon(edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::TrackRef &track, TrackType type)
#define LogTrace(id)
virtual void setTunePBestTrack(MuonTrackType muonType)
Definition: Muon.h:88
virtual void setInnerTrack(const TrackRef &t)
set reference to Track
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
bool fillGlobalTrackRefits_
void setMuonTrack(const MuonTrackType &, const TrackRef &)
bool failedToGet() const
Definition: HandleBase.h:72
virtual void setOuterTrack(const TrackRef &t)
set reference to Track
reco::TrackRef getTevRefitTrack(const reco::TrackRef &combinedTrack, const reco::TrackToTrackMap &map)
virtual void setBestTrack(MuonTrackType muonType)
Definition: Muon.h:86
edm::Handle< reco::TrackToTrackMap > tpfmsCollectionHandle_
double sigmaThresholdToFillCandidateP4WithGlobalFit_
Log< level::Warning, false > LogWarning
std::pair< TrackRef, Muon::MuonTrackType > MuonTrackTypePair
Definition: Muon.h:38
virtual void setGlobalTrack(const TrackRef &t)
set reference to Track
edm::Handle< reco::TrackToTrackMap > pickyCollectionHandle_
reco::Muon MuonIdProducer::makeMuon ( const reco::Track track)
private

Definition at line 1319 of file MuonIdProducer.cc.

References reco::TrackBase::charge(), relval_parameters_module::energy, dumpRecoGeometry_cfg::Muon, reco::TrackBase::p(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), mathSSE::sqrt(), and reco::TrackBase::vertex().

1319  {
1320  const double energy = std::sqrt(track.p() * track.p() + 0.105658369 * 0.105658369);
1321  const math::XYZTLorentzVector p4(track.px(), track.py(), track.pz(), energy);
1322  return reco::Muon(track.charge(), p4, track.vertex());
1323 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:640
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:676
T sqrt(T t)
Definition: SSEVec.h:19
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:646
int charge() const
track electric charge
Definition: TrackBase.h:596
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:643
int MuonIdProducer::overlap ( const reco::Muon muon,
const reco::Track track 
)
private

Definition at line 390 of file MuonIdProducer.cc.

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

Referenced by produce().

390  {
391  if (!muon.isMatchesValid() || track.extra().isNull() || track.extra()->recHitsSize() == 0)
392  return 0;
393 
394  int numberOfCommonDetIds = 0;
395  const std::vector<reco::MuonChamberMatch>& matches(muon.matches());
396  for (const auto& match : matches) {
397  if (match.segmentMatches.empty())
398  continue;
399 
400  bool foundCommonDetId = false;
401  for (auto hit = track.extra()->recHitsBegin(); hit != track.extra()->recHitsEnd(); ++hit) {
402  // LogTrace("MuonIdentification") << "hit DetId: " << std::hex << hit->get()->geographicalId().rawId() <<
403  // "\t hit chamber DetId: " << getChamberId(hit->get()->geographicalId()) <<
404  // "\t segment DetId: " << match->id.rawId() << std::dec;
405 
406  if (chamberId((*hit)->geographicalId()) == match.id.rawId()) {
407  foundCommonDetId = true;
408  break;
409  }
410  }
411  if (foundCommonDetId) {
412  ++numberOfCommonDetIds;
413  break;
414  }
415  }
416  return numberOfCommonDetIds;
417 }
const TrackExtraRef & extra() const
reference to &quot;extra&quot; 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::phiOfMuonInteractionRegion ( const reco::Muon muon) const
private

Definition at line 1345 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().

1345  {
1346  if (muon.isStandAloneMuon())
1347  return muon.standAloneMuon()->innerPosition().phi();
1348  // the rest is tracker muon only
1349  if (muon.matches().empty()) {
1350  if (muon.innerTrack().isAvailable() && muon.innerTrack()->extra().isAvailable())
1351  return muon.innerTrack()->outerPosition().phi();
1352  else
1353  return muon.phi(); // makes little sense, but what else can I use
1354  }
1355  return sectorPhi(muon.matches().at(0).id);
1356 }
bool isAvailable() const
Definition: Ref.h:537
virtual TrackRef innerTrack() const
Definition: Muon.h:45
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
Definition: Muon.h:49
static double sectorPhi(const DetId &id)
std::vector< MuonChamberMatch > & matches()
get muon matching information
Definition: Muon.h:145
double phi() const final
momentum azimuthal angle
bool isStandAloneMuon() const override
Definition: Muon.h:301
void MuonIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 438 of file MuonIdProducer.cc.

References funct::abs(), TrackDetectorAssociator::Any, arbitrateMuons(), arbitrateTrackerMuons_, reco::Muon::calEnergy(), checkLinks(), TrackDetectorAssociator::crossedIP(), debugWithTruthMatching_, reco::deltaPhi(), ecalDepositName_, ev, MuonCaloCompatibility::evaluate(), reco::Track::extra(), fillArbitrationInfo(), fillCaloCompatibility_, fillEnergy_, fillGlbQuality(), fillGlobalTrackQuality_, fillIsolation_, fillMatching_, fillMuonId(), fillMuonIsolation(), fillShowerDigis_, fillTrackerKink(), fillTrackerKink_, reco::Muon::GEMMuon, relativeConstraints::geometry, edm::Ref< C, T, F >::get(), edm::EventSetup::getData(), globalGeomToken_, 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, M_PI_2, makeCaloMuon(), makeMuon(), reco::Muon::matches(), reco::Muon::ME0Muon, eostools::move(), HLT_FULL_cff::muon, muonCaloCompatibility_, muonCollectionHandle_, reco::MuonTime::nDof, reco::MuonTimeExtra::nDof(), reco::Muon::OuterTrack, outerTrackCollectionHandle_, TrackDetectorAssociator::OutsideIn, overlap(), phiOfMuonInteractionRegion(), 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_FULL_cff::track, trackDepositName_, susybsm::HSCParticleType::trackerMuon, reco::Muon::TrackerMuon, MuonIdTruthInfo::truthMatchMuon(), reco::Muon::type(), validateGlobalMuonPair(), and writeIsoDeposits_.

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

Definition at line 1325 of file MuonIdProducer.cc.

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

Referenced by phiOfMuonInteractionRegion().

1325  {
1326  double phi = 0;
1327  if (id.subdetId() == MuonSubdetId::DT) { // DT
1328  DTChamberId muonId(id.rawId());
1329  if (muonId.sector() <= 12)
1330  phi = (muonId.sector() - 1) / 6. * M_PI;
1331  if (muonId.sector() == 13)
1332  phi = 3 / 6. * M_PI;
1333  if (muonId.sector() == 14)
1334  phi = 9 / 6. * M_PI;
1335  }
1336  if (id.subdetId() == MuonSubdetId::CSC) { // CSC
1337  CSCDetId muonId(id.rawId());
1338  phi = M_PI / 4 + (muonId.triggerSector() - 1) / 3. * M_PI;
1339  }
1340  if (phi > M_PI)
1341  phi -= 2 * M_PI;
1342  return phi;
1343 }
#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 272 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 270 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 258 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 263 of file MuonIdProducer.h.

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

bool MuonIdProducer::fillGlobalTrackRefits_
private

Definition at line 264 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 267 of file MuonIdProducer.h.

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

const edm::ESGetToken<CSCGeometry, MuonGeometryRecord> MuonIdProducer::geomTokenRun_
private

Definition at line 249 of file MuonIdProducer.h.

Referenced by beginRun().

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::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> MuonIdProducer::globalGeomToken_
private

Definition at line 251 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

edm::InputTag MuonIdProducer::globalTrackQualityInputTag_
private

Definition at line 265 of file MuonIdProducer.h.

std::string MuonIdProducer::hcalDepositName_
private

Definition at line 259 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

std::string MuonIdProducer::hoDepositName_
private

Definition at line 260 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 261 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::maxAbsPullX2_
private

Definition at line 208 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

double MuonIdProducer::maxAbsPullY2_
private

Definition at line 210 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

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

Definition at line 273 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 254 of file MuonIdProducer.h.

Referenced by fillMuonIsolation(), and MuonIdProducer().

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

Definition at line 256 of file MuonIdProducer.h.

Referenced by fillMuonIsolation(), and MuonIdProducer().

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

Definition at line 255 of file MuonIdProducer.h.

Referenced by fillMuonIsolation(), and MuonIdProducer().

MuonCaloCompatibility MuonIdProducer::muonCaloCompatibility_
private

Definition at line 253 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().

const edm::ESGetToken<Propagator, TrackingComponentsRecord> MuonIdProducer::propagatorToken_
private

Definition at line 250 of file MuonIdProducer.h.

Referenced by init().

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 257 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

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

Definition at line 268 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().