CMS 3D CMS Logo

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

#include <MuonIdProducer.h>

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

Classes

struct  ICTypes
 

Public Types

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

Public Member Functions

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

Static Public Member Functions

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

Private Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 68 of file MuonIdProducer.h.

Member Typedef Documentation

Definition at line 70 of file MuonIdProducer.h.

Constructor & Destructor Documentation

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

Definition at line 36 of file MuonIdProducer.cc.

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

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

Definition at line 189 of file MuonIdProducer.cc.

190 {
191  // TimingReport::current()->dump(std::cout);
192 }

Member Function Documentation

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

Definition at line 124 of file MuonIdProducer.h.

References funct::abs().

Referenced by fillArbitrationInfo().

125  {
126  return std::abs(a-b) < tol;
127  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
void MuonIdProducer::arbitrateMuons ( reco::MuonCollection muons,
reco::CaloMuonCollection caloMuons 
)
private

Definition at line 1014 of file MuonIdProducer.cc.

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

Referenced by produce().

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

Definition at line 429 of file MuonIdProducer.cc.

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

430 {
431  edm::ESHandle<CSCGeometry> geomHandle;
432  iSetup.get<MuonGeometryRecord>().get(geomHandle);
433 
434  meshAlgo_->setCSCGeometry(geomHandle.product());
435 
437  theShowerDigiFiller_->getES(iSetup);
438 }
std::unique_ptr< MuonShowerDigiFiller > theShowerDigiFiller_
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
std::unique_ptr< MuonMesh > meshAlgo_
unsigned int MuonIdProducer::chamberId ( const DetId id)
private

Definition at line 380 of file MuonIdProducer.cc.

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

Referenced by overlap().

381 {
382  if ( id.det() != DetId::Muon ) return 0;
383 
384  const auto subdetId = id.subdetId();
385  if ( subdetId == MuonSubdetId::DT ) {
386  return DTChamberId(id.rawId()).rawId();
387  }
388  else if ( subdetId == MuonSubdetId::CSC ) {
389  return CSCDetId(id.rawId()).chamberId().rawId();
390  }
391 
392  return 0;
393 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
CSCDetId chamberId() const
Definition: CSCDetId.h:53
static constexpr int DT
Definition: MuonSubdetId.h:12
static constexpr int CSC
Definition: MuonSubdetId.h:13
bool MuonIdProducer::checkLinks ( const reco::MuonTrackLinks links) const
private

Definition at line 1329 of file MuonIdProducer.cc.

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

Referenced by produce().

1329  {
1330  const bool trackBAD = links->trackerTrack().isNull();
1331  const bool staBAD = links->standAloneTrack().isNull();
1332  const bool glbBAD = links->globalTrack().isNull();
1333  if (trackBAD || staBAD || glbBAD )
1334  {
1335  edm::LogWarning("muonIDbadLinks") << "Global muon links to constituent tracks are invalid: trkBad "
1336  <<trackBAD <<" standaloneBad "<<staBAD<<" globalBad "<<glbBAD
1337  <<". There should be no such object. Muon is skipped.";
1338  return false;
1339  }
1340  return true;
1341 }
bool isNull() const
Checks for null.
Definition: Ref.h:248
void MuonIdProducer::fillArbitrationInfo ( reco::MuonCollection pOutputMuons,
unsigned int  muonType = reco::Muon::TrackerMuon 
)
private

Definition at line 1040 of file MuonIdProducer.cc.

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

Referenced by produce().

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

Definition at line 1343 of file MuonIdProducer.cc.

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

1343  {
1345  desc.setAllowAnything();
1346 
1347  desc.add<bool>("arbitrateTrackerMuons",false);
1348  desc.add<bool>("storeCrossedHcalRecHits",false);
1349  desc.add<bool>("fillShowerDigis",false);
1350 
1351  edm::ParameterSetDescription descTrkAsoPar;
1352  descTrkAsoPar.add<edm::InputTag>("GEMSegmentCollectionLabel",edm::InputTag("gemSegments"));
1353  descTrkAsoPar.add<edm::InputTag>("ME0SegmentCollectionLabel",edm::InputTag("me0Segments"));
1354  descTrkAsoPar.add<bool>("useGEM", false);
1355  descTrkAsoPar.add<bool>("useME0", false);
1356  descTrkAsoPar.setAllowAnything();
1357  desc.add<edm::ParameterSetDescription>("TrackAssociatorParameters", descTrkAsoPar);
1358 
1360  descJet.setAllowAnything();
1361  descJet.add<edm::ParameterSetDescription>("TrackAssociatorParameters", descTrkAsoPar);
1362  desc.add<edm::ParameterSetDescription>("JetExtractorPSet", descJet);
1363 
1365  descCalo.setAllowAnything();
1366  descCalo.add<edm::ParameterSetDescription>("TrackAssociatorParameters", descTrkAsoPar);
1367  desc.add<edm::ParameterSetDescription>("CaloExtractorPSet", descCalo);
1368 
1369  descriptions.addDefault(desc);
1370 }
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 1308 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().

1309 {
1311  aMuon.setCombinedQuality((*glbQualHandle_)[aMuon.combinedMuon()]);
1312  }
1313 
1314  LogDebug("MuonIdentification") << "tkChiVal " << aMuon.combinedQuality().trkRelChi2;
1315 
1316 }
#define LogDebug(id)
float trkRelChi2
chi2 value for the inner track stub with respect to the global track
Definition: MuonQuality.h:15
bool isGlobalMuon() const override
Definition: Muon.h:291
MuonQuality combinedQuality() const
get energy deposition information
Definition: Muon.h:121
bool isValid() const
Definition: HandleBase.h:74
bool failedToGet() const
Definition: HandleBase.h:78
TrackRef combinedMuon() const override
reference to a stand-alone muon Track
Definition: Muon.h:55
void setCombinedQuality(const MuonQuality &combinedQuality)
set energy deposition information
Definition: Muon.h:123
edm::Handle< edm::ValueMap< reco::MuonQuality > > glbQualHandle_
void MuonIdProducer::fillMuonId ( edm::Event iEvent,
const edm::EventSetup iSetup,
reco::Muon aMuon,
TrackDetectorAssociator::Direction  direction = TrackDetectorAssociator::InsideOut 
)
private

Definition at line 799 of file MuonIdProducer.cc.

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

802 {
803 
804  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId";
805 
806  // perform track - detector association
807  const reco::Track* track = nullptr;
808  if ( aMuon.track().isNonnull() ) track = aMuon.track().get();
809  else if ( aMuon.standAloneMuon().isNonnull() ) track = aMuon.standAloneMuon().get();
810  else throw cms::Exception("FatalError") << "Failed to fill muon id information for a muon with undefined references to tracks";
811 
812 
813  TrackDetMatchInfo info = trackAssociator_.associate(iEvent, iSetup, *track, parameters_, direction);
814 
815  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId :: fillEnergy = "<<fillEnergy_;
816 
817  if ( fillEnergy_ ) {
818 
819  reco::MuonEnergy muonEnergy;
822  muonEnergy.ho = info.crossedEnergy(TrackDetMatchInfo::HORecHits);
824  muonEnergy.emS9 = info.nXnEnergy(TrackDetMatchInfo::EcalRecHits,1); // 3x3 energy
825  muonEnergy.emS25 = info.nXnEnergy(TrackDetMatchInfo::EcalRecHits,2); // 5x5 energy
826  muonEnergy.hadS9 = info.nXnEnergy(TrackDetMatchInfo::HcalRecHits,1); // 3x3 energy
827  muonEnergy.hoS9 = info.nXnEnergy(TrackDetMatchInfo::HORecHits,1); // 3x3 energy
828  muonEnergy.towerS9 = info.nXnEnergy(TrackDetMatchInfo::TowerTotal,1); // 3x3 energy
830  muonEnergy.crossedHadRecHits.clear();
831  for (auto hit: info.crossedHcalRecHits){
833  mhit.energy = hit->energy();
834  mhit.chi2 = hit->chi2();
835  mhit.time = hit->time();
836  mhit.detId = hit->id();
837  muonEnergy.crossedHadRecHits.push_back(mhit);
838  }
839  }
840  muonEnergy.ecal_position = info.trkGlobPosAtEcal;
841  muonEnergy.hcal_position = info.trkGlobPosAtHcal;
842  if (! info.crossedEcalIds.empty() ) muonEnergy.ecal_id = info.crossedEcalIds.front();
843  if (! info.crossedHcalIds.empty() ) muonEnergy.hcal_id = info.crossedHcalIds.front();
844  // find maximal energy depositions and their time
845  DetId emMaxId = info.findMaxDeposition(TrackDetMatchInfo::EcalRecHits,2); // max energy deposit in 5x5 shape
846  for ( const auto& hit : info.ecalRecHits ) {
847  if (hit->id() != emMaxId) continue;
848  muonEnergy.emMax = hit->energy();
849  muonEnergy.ecal_time = hit->time();
850  }
851  DetId hadMaxId = info.findMaxDeposition(TrackDetMatchInfo::HcalRecHits,1); // max energy deposit in 3x3 shape
852  for ( const auto& hit : info.hcalRecHits ) {
853  if (hit->id() != hadMaxId) continue;
854  muonEnergy.hadMax = hit->energy();
855  muonEnergy.hcal_time = hit->time();
856  }
857  aMuon.setCalEnergy( muonEnergy );
858  }
859  if ( ! fillMatching_ && ! aMuon.isTrackerMuon() && ! aMuon.isRPCMuon() ) return;
860 
861  // fill muon match info
862  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId :: fill muon match info ";
863  std::vector<reco::MuonChamberMatch> muonChamberMatches;
864  unsigned int nubmerOfMatchesAccordingToTrackAssociator = 0;
865  for ( const auto& chamber : info.chambers )
866  {
867  if (chamber.id.subdetId() == 3 && rpcHitHandle_.isValid() ) continue; // Skip RPC chambers, they are taken care of below)
868  reco::MuonChamberMatch matchedChamber;
869 
870  const auto& lErr = chamber.tState.localError();
871  const auto& lPos = chamber.tState.localPosition();
872  const auto& lDir = chamber.tState.localDirection();
873 
874  const auto& localError = lErr.positionError();
875  matchedChamber.x = lPos.x();
876  matchedChamber.y = lPos.y();
877  matchedChamber.xErr = sqrt( localError.xx() );
878  matchedChamber.yErr = sqrt( localError.yy() );
879 
880  matchedChamber.dXdZ = lDir.z()!=0?lDir.x()/lDir.z():9999;
881  matchedChamber.dYdZ = lDir.z()!=0?lDir.y()/lDir.z():9999;
882  // DANGEROUS - compiler cannot guaranty parameters ordering
883  AlgebraicSymMatrix55 trajectoryCovMatrix = lErr.matrix();
884  matchedChamber.dXdZErr = trajectoryCovMatrix(1,1)>0?sqrt(trajectoryCovMatrix(1,1)):0;
885  matchedChamber.dYdZErr = trajectoryCovMatrix(2,2)>0?sqrt(trajectoryCovMatrix(2,2)):0;
886 
887  matchedChamber.edgeX = chamber.localDistanceX;
888  matchedChamber.edgeY = chamber.localDistanceY;
889 
890  matchedChamber.id = chamber.id;
891 
892  if (fillShowerDigis_) {
893  theShowerDigiFiller_->fill(matchedChamber);
894  }
895  else {
896  theShowerDigiFiller_->fillDefault(matchedChamber);
897  }
898 
899  if ( ! chamber.segments.empty() ) ++nubmerOfMatchesAccordingToTrackAssociator;
900 
901  // fill segments
902  for ( const auto& segment : chamber.segments )
903  {
904  reco::MuonSegmentMatch matchedSegment;
905  matchedSegment.x = segment.segmentLocalPosition.x();
906  matchedSegment.y = segment.segmentLocalPosition.y();
907  matchedSegment.dXdZ = segment.segmentLocalDirection.z()?segment.segmentLocalDirection.x()/segment.segmentLocalDirection.z():0;
908  matchedSegment.dYdZ = segment.segmentLocalDirection.z()?segment.segmentLocalDirection.y()/segment.segmentLocalDirection.z():0;
909  matchedSegment.xErr = segment.segmentLocalErrorXX>0?sqrt(segment.segmentLocalErrorXX):0;
910  matchedSegment.yErr = segment.segmentLocalErrorYY>0?sqrt(segment.segmentLocalErrorYY):0;
911  matchedSegment.dXdZErr = segment.segmentLocalErrorDxDz>0?sqrt(segment.segmentLocalErrorDxDz):0;
912  matchedSegment.dYdZErr = segment.segmentLocalErrorDyDz>0?sqrt(segment.segmentLocalErrorDyDz):0;
913  matchedSegment.t0 = segment.t0;
914  matchedSegment.mask = 0;
915  matchedSegment.dtSegmentRef = segment.dtSegmentRef;
916  matchedSegment.cscSegmentRef = segment.cscSegmentRef;
917  matchedSegment.gemSegmentRef = segment.gemSegmentRef;
918  matchedSegment.me0SegmentRef = segment.me0SegmentRef;
919  matchedSegment.hasZed_ = segment.hasZed;
920  matchedSegment.hasPhi_ = segment.hasPhi;
921  // test segment
922  bool matchedX = false;
923  bool matchedY = false;
924  LogTrace("MuonIdentification") << " matching local x, segment x: " << matchedSegment.x <<
925  ", chamber x: " << matchedChamber.x << ", max: " << maxAbsDx_;
926  LogTrace("MuonIdentification") << " matching local y, segment y: " << matchedSegment.y <<
927  ", chamber y: " << matchedChamber.y << ", max: " << maxAbsDy_;
928  const double matchedSegChDx = std::abs(matchedSegment.x - matchedChamber.x);
929  const double matchedSegChDy = std::abs(matchedSegment.y - matchedChamber.y);
930  const double matchedSegChPullX = matchedSegChDx/std::hypot(matchedSegment.xErr, matchedChamber.xErr);
931  const double matchedSegChPullY = matchedSegChDy/std::hypot(matchedSegment.yErr, matchedChamber.yErr);
932  if (matchedSegment.xErr>0 && matchedChamber.xErr>0 )
933  LogTrace("MuonIdentification") << " xpull: " << matchedSegChPullX;
934  if (matchedSegment.yErr>0 && matchedChamber.yErr>0 )
935  LogTrace("MuonIdentification") << " ypull: " << matchedSegChPullY;
936 
937  if (matchedSegChDx < maxAbsDx_) matchedX = true;
938  if (matchedSegChDy < maxAbsDy_) matchedY = true;
939  if (matchedSegment.xErr>0 && matchedChamber.xErr>0 && matchedSegChPullX < maxAbsPullX_) matchedX = true;
940  if (matchedSegment.yErr>0 && matchedChamber.yErr>0 && matchedSegChPullY < maxAbsPullY_) matchedY = true;
941  if (matchedX && matchedY){
942  if (matchedChamber.id.subdetId() == MuonSubdetId::ME0)
943  matchedChamber.me0Matches.push_back(matchedSegment);
944  else if (matchedChamber.id.subdetId() == MuonSubdetId::GEM)
945  matchedChamber.gemMatches.push_back(matchedSegment);
946  else matchedChamber.segmentMatches.push_back(matchedSegment);
947  }
948  }
949  muonChamberMatches.push_back(matchedChamber);
950  }
951 
952  // Fill RPC info
953  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId :: fill RPC info";
954  if ( rpcHitHandle_.isValid() )
955  {
956  for ( const auto& chamber : info.chambers )
957  {
958  if ( chamber.id.subdetId() != 3 ) continue; // Consider RPC chambers only
959  const auto& lErr = chamber.tState.localError();
960  const auto& lPos = chamber.tState.localPosition();
961  const auto& lDir = chamber.tState.localDirection();
962 
963  reco::MuonChamberMatch matchedChamber;
964 
965  LocalError localError = lErr.positionError();
966  matchedChamber.x = lPos.x();
967  matchedChamber.y = lPos.y();
968  matchedChamber.xErr = sqrt( localError.xx() );
969  matchedChamber.yErr = sqrt( localError.yy() );
970 
971  matchedChamber.dXdZ = lDir.z()!=0?lDir.x()/lDir.z():9999;
972  matchedChamber.dYdZ = lDir.z()!=0?lDir.y()/lDir.z():9999;
973  // DANGEROUS - compiler cannot guaranty parameters ordering
974  AlgebraicSymMatrix55 trajectoryCovMatrix = lErr.matrix();
975  matchedChamber.dXdZErr = trajectoryCovMatrix(1,1)>0?sqrt(trajectoryCovMatrix(1,1)):0;
976  matchedChamber.dYdZErr = trajectoryCovMatrix(2,2)>0?sqrt(trajectoryCovMatrix(2,2)):0;
977 
978  matchedChamber.edgeX = chamber.localDistanceX;
979  matchedChamber.edgeY = chamber.localDistanceY;
980 
981  theShowerDigiFiller_->fillDefault(matchedChamber);
982 
983  matchedChamber.id = chamber.id;
984 
985  for ( const auto& rpcRecHit : *rpcHitHandle_ )
986  {
987  reco::MuonRPCHitMatch rpcHitMatch;
988 
989  if ( rpcRecHit.rawId() != chamber.id.rawId() ) continue;
990 
991  rpcHitMatch.x = rpcRecHit.localPosition().x();
992  rpcHitMatch.mask = 0;
993  rpcHitMatch.bx = rpcRecHit.BunchX();
994 
995  const double absDx = std::abs(rpcRecHit.localPosition().x()-chamber.tState.localPosition().x());
996  if( absDx <= 20 or absDx/sqrt(localError.xx()) <= 4 ) matchedChamber.rpcMatches.push_back(rpcHitMatch);
997  }
998 
999  muonChamberMatches.push_back(matchedChamber);
1000  }
1001  }
1002 
1003  aMuon.setMatches(muonChamberMatches);
1004 
1005  LogTrace("MuonIdentification") << "number of muon chambers: " << aMuon.matches().size() << "\n"
1006  << "number of chambers with segments according to the associator requirements: " <<
1007  nubmerOfMatchesAccordingToTrackAssociator;
1008  LogTrace("MuonIdentification") << "number of segment matches with the producer requirements: " <<
1010 
1011  // fillTime( iEvent, iSetup, aMuon );
1012 }
float xx() const
Definition: LocalError.h:24
GEMSegmentRef gemSegmentRef
DTRecSegment4DRef dtSegmentRef
static const TGPicture * info(bool iBackgroundIsBlack)
TrackRef track() const override
reference to a Track
Definition: Muon.h:49
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:251
static constexpr int GEM
Definition: MuonSubdetId.h:15
std::vector< reco::MuonSegmentMatch > gemMatches
TrackDetectorAssociator trackAssociator_
CSCSegmentRef cscSegmentRef
std::vector< const HBHERecHit * > crossedHcalRecHits
std::vector< const EcalRecHit * > ecalRecHits
hits in the cone
std::vector< DetId > crossedEcalIds
DetId findMaxDeposition(EnergyType)
Find detector elements with highest energy deposition.
float emS9
energy deposited in 3x3 ECAL crystal shape around central crystal
Definition: MuonEnergy.h:29
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
void setCalEnergy(const MuonEnergy &calEnergy)
set energy deposition information
Definition: Muon.h:113
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:23
math::XYZPoint trkGlobPosAtHcal
float ecal_time
Calorimeter timing.
Definition: MuonEnergy.h:48
float ho
energy deposited in crossed HO towers
Definition: MuonEnergy.h:43
bool isTrackerMuon() const override
Definition: Muon.h:292
bool isRPCMuon() const
Definition: Muon.h:296
DetId hcal_id
DetId of the central HCAL tower with smallest depth.
Definition: MuonEnergy.h:61
std::vector< reco::MuonSegmentMatch > me0Matches
std::unique_ptr< MuonShowerDigiFiller > theShowerDigiFiller_
TrackAssociatorParameters parameters_
float yy() const
Definition: LocalError.h:26
float emS25
energy deposited in 5x5 ECAL crystal shape around central crystal
Definition: MuonEnergy.h:31
T sqrt(T t)
Definition: SSEVec.h:18
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::vector< TAMuonChamberMatch > chambers
std::vector< const HBHERecHit * > hcalRecHits
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
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:45
std::vector< reco::MuonRPCHitMatch > rpcMatches
static constexpr int ME0
Definition: MuonSubdetId.h:16
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:243
ME0SegmentRef me0SegmentRef
bool isValid() const
Definition: HandleBase.h:74
double crossedEnergy(EnergyType)
energy in detector elements crossed by the track by types
#define LogTrace(id)
math::XYZPointF hcal_position
Definition: MuonEnergy.h:55
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
Definition: Muon.h:52
unsigned int id
float emMax
maximal energy of ECAL crystal in the 5x5 shape
Definition: MuonEnergy.h:33
Definition: DetId.h:18
float hadMax
maximal energy of HCAL tower in the 3x3 shape
Definition: MuonEnergy.h:41
std::vector< MuonChamberMatch > & matches()
get muon matching information
Definition: Muon.h:144
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:58
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:67
void setMatches(const std::vector< MuonChamberMatch > &matches)
set muon matching information
Definition: Muon.h:147
math::XYZPointF ecal_position
Trajectory position at the calorimeter.
Definition: MuonEnergy.h:54
float hadS9
energy deposited in 3x3 HCAL tower shape around central tower
Definition: MuonEnergy.h:39
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 1208 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, HiIsolationCommonParameters_cff::track, reco::Muon::track(), reco::MuonIsolation::trackerVetoPt, and writeIsoDeposits_.

Referenced by produce().

1211 {
1212  const reco::Track* track = nullptr;
1213  if ( aMuon.track().isNonnull() ) track = aMuon.track().get();
1214  else if ( aMuon.standAloneMuon().isNonnull() ) track = aMuon.standAloneMuon().get();
1215  else throw cms::Exception("FatalError") << "Failed to compute muon isolation information for a muon with undefined references to tracks";
1216 
1217  reco::MuonIsolation isoR03, isoR05;
1218 
1219  // get deposits
1220  reco::IsoDeposit depTrk = muIsoExtractorTrack_->deposit(iEvent, iSetup, *track );
1221  std::vector<reco::IsoDeposit> caloDeps = muIsoExtractorCalo_->deposits(iEvent, iSetup, *track);
1222  reco::IsoDeposit depJet = muIsoExtractorJet_->deposit(iEvent, iSetup, *track );
1223 
1224  if(caloDeps.size()!=3) {
1225  LogTrace("MuonIdentification") << "Failed to fill vector of calorimeter isolation deposits!";
1226  return;
1227  }
1228 
1229  reco::IsoDeposit depEcal = caloDeps.at(0);
1230  reco::IsoDeposit depHcal = caloDeps.at(1);
1231  reco::IsoDeposit depHo = caloDeps.at(2);
1232 
1233  //no need to copy outside if we don't write them
1234  if (writeIsoDeposits_){
1235  trackDep = depTrk;
1236  ecalDep = depEcal;
1237  hcalDep = depHcal;
1238  hoDep = depHo;
1239  jetDep = depJet;
1240  }
1241 
1242  isoR03.sumPt = depTrk.depositWithin(0.3);
1243  isoR03.emEt = depEcal.depositWithin(0.3);
1244  isoR03.hadEt = depHcal.depositWithin(0.3);
1245  isoR03.hoEt = depHo.depositWithin(0.3);
1246  isoR03.nTracks = depTrk.depositAndCountWithin(0.3).second;
1247  isoR03.nJets = depJet.depositAndCountWithin(0.3).second;
1248  isoR03.trackerVetoPt = depTrk.candEnergy();
1249  isoR03.emVetoEt = depEcal.candEnergy();
1250  isoR03.hadVetoEt = depHcal.candEnergy();
1251  isoR03.hoVetoEt = depHo.candEnergy();
1252 
1253  isoR05.sumPt = depTrk.depositWithin(0.5);
1254  isoR05.emEt = depEcal.depositWithin(0.5);
1255  isoR05.hadEt = depHcal.depositWithin(0.5);
1256  isoR05.hoEt = depHo.depositWithin(0.5);
1257  isoR05.nTracks = depTrk.depositAndCountWithin(0.5).second;
1258  isoR05.nJets = depJet.depositAndCountWithin(0.5).second;
1259  isoR05.trackerVetoPt = depTrk.candEnergy();
1260  isoR05.emVetoEt = depEcal.candEnergy();
1261  isoR05.hadVetoEt = depHcal.candEnergy();
1262  isoR05.hoVetoEt = depHo.candEnergy();
1263 
1264 
1265  aMuon.setIsolation(isoR03, isoR05);
1266 
1267 }
float hadEt
hcal sum-Et
Definition: MuonIsolation.h:9
double candEnergy() const
Get energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:136
TrackRef track() const override
reference to a Track
Definition: Muon.h:49
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:251
float sumPt
sum-pt of tracks
Definition: MuonIsolation.h:7
float hadVetoEt
hcal sum-et in the veto region in r-phi
Definition: MuonIsolation.h:15
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > muIsoExtractorTrack_
double depositWithin(double coneSize, const Vetos &vetos=Vetos(), bool skipDepositVeto=false) const
Get deposit.
Definition: IsoDeposit.cc:34
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > muIsoExtractorCalo_
float emEt
ecal sum-Et
Definition: MuonIsolation.h:8
int nJets
number of jets in the cone
Definition: MuonIsolation.h:12
float hoEt
ho sum-Et
Definition: MuonIsolation.h:10
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:243
#define LogTrace(id)
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
Definition: Muon.h:52
float hoVetoEt
ho sum-et in the veto region in r-phi
Definition: MuonIsolation.h:16
int nTracks
number of tracks in the cone (excluding veto region)
Definition: MuonIsolation.h:11
float emVetoEt
ecal sum-et in the veto region in r-phi
Definition: MuonIsolation.h:14
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:44
float trackerVetoPt
(sum-)pt inside the veto region in r-phi
Definition: MuonIsolation.h:13
void MuonIdProducer::fillTrackerKink ( reco::Muon aMuon)
private

Definition at line 1318 of file MuonIdProducer.cc.

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

Referenced by produce().

1318  {
1319  // skip muons with no tracks
1320  if (aMuon.innerTrack().isNull()) return;
1321  // get quality from muon if already there, otherwise make empty one
1323  // fill it
1324  const bool filled = trackerKinkFinder_->fillTrkKink(quality, *aMuon.innerTrack());
1325  // if quality was there, or if we filled it, commit to the muon
1326  if (filled || aMuon.isQualityValid()) aMuon.setCombinedQuality(quality);
1327 }
std::unique_ptr< MuonKinkFinder > trackerKinkFinder_
virtual TrackRef innerTrack() const
Definition: Muon.h:48
MuonQuality combinedQuality() const
get energy deposition information
Definition: Muon.h:121
bool isQualityValid() const
Definition: Muon.h:119
bool isNull() const
Checks for null.
Definition: Ref.h:248
void setCombinedQuality(const MuonQuality &combinedQuality)
set energy deposition information
Definition: Muon.h:123
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 131 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().

131  {
132  if (muonType == reco::Muon::TrackerMuon) return & chamber.segmentMatches;
133  else if (muonType == reco::Muon::ME0Muon) return & chamber.me0Matches;
134  else if (muonType == reco::Muon::GEMMuon) return & chamber.gemMatches;
135  else throw cms::Exception("getSegmentMatches called with unsupported muonType");
136  }
std::vector< reco::MuonSegmentMatch > gemMatches
std::vector< reco::MuonSegmentMatch > me0Matches
static const unsigned int ME0Muon
Definition: Muon.h:283
static const unsigned int TrackerMuon
Definition: Muon.h:277
std::vector< reco::MuonSegmentMatch > segmentMatches
static const unsigned int GEMMuon
Definition: Muon.h:282
void MuonIdProducer::init ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 194 of file MuonIdProducer.cc.

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

Referenced by produce().

195 {
200 
204 
205 
207  iSetup.get<TrackingComponentsRecord>().get("SteppingHelixPropagatorAny", propagator);
208  trackAssociator_.setPropagator(propagator.product());
209 
210  if (fillTrackerKink_) trackerKinkFinder_->init(iSetup);
211 
212  for ( unsigned int i = 0; i < inputCollectionLabels_.size(); ++i ) {
213  const auto& inputLabel = inputCollectionLabels_[i];
214  const auto inputType = inputCollectionTypes_[i];
215  if ( inputType == ICTypes::INNER_TRACKS ) {
218  throw cms::Exception("FatalError") << "Failed to get input track collection with label: " << inputLabel;
219  LogTrace("MuonIdentification") << "Number of input inner tracks: " << innerTrackCollectionHandle_->size();
220  }
221  else if ( inputType == ICTypes::OUTER_TRACKS ) {
224  throw cms::Exception("FatalError") << "Failed to get input track collection with label: " << inputLabel;
225  LogTrace("MuonIdentification") << "Number of input outer tracks: " << outerTrackCollectionHandle_->size();
226  }
227  else if ( inputType == ICTypes::LINKS ) {
230  throw cms::Exception("FatalError") << "Failed to get input link collection with label: " << inputLabel;
231  LogTrace("MuonIdentification") << "Number of input links: " << linkCollectionHandle_->size();
232  }
233  else if ( inputType == ICTypes::MUONS ) {
236  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
237  LogTrace("MuonIdentification") << "Number of input muons: " << muonCollectionHandle_->size();
238  }
239  else if ( fillGlobalTrackRefits_ && inputType == ICTypes::TEV_FIRSTHIT ) {
242  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
243  LogTrace("MuonIdentification") << "Number of input muons: " << tpfmsCollectionHandle_->size();
244  }
245  else if ( fillGlobalTrackRefits_ && inputType == ICTypes::TEV_PICKY ) {
248  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
249  LogTrace("MuonIdentification") << "Number of input muons: " << pickyCollectionHandle_->size();
250  }
251  else if ( fillGlobalTrackRefits_ && inputType == ICTypes::TEV_DYT ) {
253  if (! dytCollectionHandle_.isValid())
254  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
255  LogTrace("MuonIdentification") << "Number of input muons: " << dytCollectionHandle_->size();
256  }
257  else throw cms::Exception("FatalError") << "Unknown input collection type: #" << ICTypes::toStr(inputType);
258  }
259 
262 
263 }
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:517
edm::Handle< reco::MuonTrackLinksCollection > linkCollectionHandle_
edm::EDGetTokenT< RPCRecHitCollection > rpcHitToken_
edm::EDGetTokenT< reco::TrackToTrackMap > pickyCollectionToken_
static std::string toStr(const ICTypeKey k)
edm::EDGetTokenT< reco::TrackToTrackMap > tpfmsCollectionToken_
void setPropagator(const Propagator *)
use a user configured propagator
edm::EDGetTokenT< reco::MuonCollection > muonCollectionToken_
edm::EDGetTokenT< reco::TrackCollection > outerTrackCollectionToken_
edm::Handle< RPCRecHitCollection > rpcHitHandle_
edm::Handle< reco::TrackToTrackMap > dytCollectionHandle_
bool isValid() const
Definition: HandleBase.h:74
edm::Handle< reco::TrackCollection > outerTrackCollectionHandle_
edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkCollectionToken_
#define LogTrace(id)
bool fillGlobalTrackRefits_
size_type size() const
map size
std::vector< ICTypes::ICTypeKey > inputCollectionTypes_
std::vector< edm::InputTag > inputCollectionLabels_
bool fillGlobalTrackQuality_
T get() const
Definition: EventSetup.h:71
edm::Handle< reco::TrackToTrackMap > tpfmsCollectionHandle_
edm::Handle< reco::TrackCollection > innerTrackCollectionHandle_
T const * product() const
Definition: ESHandle.h:86
edm::Handle< reco::MuonCollection > muonCollectionHandle_
edm::Handle< edm::ValueMap< reco::MuonQuality > > glbQualHandle_
edm::Handle< reco::TrackToTrackMap > pickyCollectionHandle_
edm::EDGetTokenT< reco::TrackToTrackMap > dytCollectionToken_
bool MuonIdProducer::isGoodCaloMuon ( const reco::CaloMuon muon)
private

Definition at line 771 of file MuonIdProducer.cc.

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

Referenced by arbitrateMuons(), and produce().

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

Definition at line 786 of file MuonIdProducer.cc.

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

Referenced by produce().

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

Definition at line 792 of file MuonIdProducer.cc.

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

Referenced by produce().

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

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

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

Definition at line 358 of file MuonIdProducer.cc.

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

Referenced by produce().

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

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

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

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

284 {
285 
286  LogTrace("MuonIdentification") << "Creating a CaloMuon from a Muon";
287 
288  reco::CaloMuon aMuon;
289  aMuon.setInnerTrack( muon.innerTrack() );
290 
291  if (muon.isEnergyValid()) aMuon.setCalEnergy( muon.calEnergy() );
292  // get calo compatibility
294  return aMuon;
295 }
virtual TrackRef innerTrack() const
Definition: Muon.h:48
bool fillCaloCompatibility_
double evaluate(const reco::Muon &)
MuonCaloCompatibility muonCaloCompatibility_
#define LogTrace(id)
bool isEnergyValid() const
Definition: Muon.h:109
MuonEnergy calEnergy() const
get energy deposition information
Definition: Muon.h:111
void setCaloCompatibility(float input)
Definition: CaloMuon.h:43
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 265 of file MuonIdProducer.cc.

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

Referenced by makeMuon(), and produce().

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

Definition at line 298 of file MuonIdProducer.cc.

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

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

Definition at line 1269 of file MuonIdProducer.cc.

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

1270 {
1271  const double energy = hypot(track.p(), 0.105658369);
1272  const math::XYZTLorentzVector p4(track.px(), track.py(), track.pz(), energy);
1273  return reco::Muon( track.charge(), p4, track.vertex() );
1274 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:654
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:666
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:738
double p4[4]
Definition: TauolaWrapper.h:92
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:678
int charge() const
track electric charge
Definition: TrackBase.h:606
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:672
int MuonIdProducer::overlap ( const reco::Muon muon,
const reco::Track track 
)
private

Definition at line 396 of file MuonIdProducer.cc.

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

Referenced by produce().

397 {
398  if ( ! muon.isMatchesValid() ||
399  track.extra().isNull() ||
400  track.extra()->recHitsSize()==0 ) return 0;
401 
402  int numberOfCommonDetIds = 0;
403  const std::vector<reco::MuonChamberMatch>& matches( muon.matches() );
404  for ( const auto& match : matches )
405  {
406  if ( match.segmentMatches.empty() ) continue;
407 
408  bool foundCommonDetId = false;
409  for ( auto hit = track.extra()->recHitsBegin();
410  hit != track.extra()->recHitsEnd(); ++hit )
411  {
412  // LogTrace("MuonIdentification") << "hit DetId: " << std::hex << hit->get()->geographicalId().rawId() <<
413  // "\t hit chamber DetId: " << getChamberId(hit->get()->geographicalId()) <<
414  // "\t segment DetId: " << match->id.rawId() << std::dec;
415 
416  if ( chamberId((*hit)->geographicalId()) == match.id.rawId() ) {
417  foundCommonDetId = true;
418  break;
419  }
420  }
421  if ( foundCommonDetId ) {
422  ++numberOfCommonDetIds;
423  break;
424  }
425  }
426  return numberOfCommonDetIds;
427 }
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:194
bool isMatchesValid() const
Definition: Muon.h:142
bool isNull() const
Checks for null.
Definition: Ref.h:248
std::vector< MuonChamberMatch > & matches()
get muon matching information
Definition: Muon.h:144
unsigned int chamberId(const DetId &)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
double MuonIdProducer::phiOfMuonIneteractionRegion ( const reco::Muon muon) const
private

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

1295 {
1296  if ( muon.isStandAloneMuon() ) return muon.standAloneMuon()->innerPosition().phi();
1297  // the rest is tracker muon only
1298  if ( muon.matches().empty() ) {
1299  if ( muon.innerTrack().isAvailable() &&
1300  muon.innerTrack()->extra().isAvailable() )
1301  return muon.innerTrack()->outerPosition().phi();
1302  else
1303  return muon.phi(); // makes little sense, but what else can I use
1304  }
1305  return sectorPhi(muon.matches().at(0).id);
1306 }
bool isAvailable() const
Definition: Ref.h:575
bool isStandAloneMuon() const override
Definition: Muon.h:293
virtual TrackRef innerTrack() const
Definition: Muon.h:48
static double sectorPhi(const DetId &id)
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
Definition: Muon.h:52
std::vector< MuonChamberMatch > & matches()
get muon matching information
Definition: Muon.h:144
double phi() const final
momentum azimuthal angle
void MuonIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 454 of file MuonIdProducer.cc.

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

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

Definition at line 1276 of file MuonIdProducer.cc.

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

Referenced by phiOfMuonIneteractionRegion().

1277 {
1278  double phi = 0;
1279  if( id.subdetId() == MuonSubdetId::DT ) { // DT
1280  DTChamberId muonId(id.rawId());
1281  if ( muonId.sector() <= 12 )
1282  phi = (muonId.sector()-1)/6.*M_PI;
1283  if ( muonId.sector() == 13 ) phi = 3/6.*M_PI;
1284  if ( muonId.sector() == 14 ) phi = 9/6.*M_PI;
1285  }
1286  if( id.subdetId() == MuonSubdetId::CSC ) { // CSC
1287  CSCDetId muonId(id.rawId());
1288  phi = M_PI/4+(muonId.triggerSector()-1)/3.*M_PI;
1289  }
1290  if ( phi > M_PI ) phi -= 2*M_PI;
1291  return phi;
1292 }
#define M_PI
static constexpr int DT
Definition: MuonSubdetId.h:12
static constexpr int CSC
Definition: MuonSubdetId.h:13

Member Data Documentation

bool MuonIdProducer::addExtraSoftMuons_
private

Definition at line 189 of file MuonIdProducer.h.

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

bool MuonIdProducer::arbClean_
private

Definition at line 253 of file MuonIdProducer.h.

Referenced by fillArbitrationInfo(), and MuonIdProducer().

bool MuonIdProducer::arbitrateTrackerMuons_
private

Definition at line 208 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

double MuonIdProducer::caloCut_
private

Definition at line 251 of file MuonIdProducer.h.

Referenced by isGoodCaloMuon(), and MuonIdProducer().

bool MuonIdProducer::debugWithTruthMatching_
private

Definition at line 210 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

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

Definition at line 218 of file MuonIdProducer.h.

Referenced by init(), and makeMuon().

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

Definition at line 226 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

std::string MuonIdProducer::ecalDepositName_
private

Definition at line 239 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

bool MuonIdProducer::fillCaloCompatibility_
private

Definition at line 198 of file MuonIdProducer.h.

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

bool MuonIdProducer::fillEnergy_
private

Definition at line 199 of file MuonIdProducer.h.

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

bool MuonIdProducer::fillGlobalTrackQuality_
private

Definition at line 244 of file MuonIdProducer.h.

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

bool MuonIdProducer::fillGlobalTrackRefits_
private

Definition at line 245 of file MuonIdProducer.h.

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

bool MuonIdProducer::fillIsolation_
private

Definition at line 203 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

bool MuonIdProducer::fillMatching_
private

Definition at line 201 of file MuonIdProducer.h.

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

bool MuonIdProducer::fillShowerDigis_
private

Definition at line 202 of file MuonIdProducer.h.

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

bool MuonIdProducer::fillTrackerKink_
private

Definition at line 248 of file MuonIdProducer.h.

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

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

Definition at line 232 of file MuonIdProducer.h.

Referenced by fillGlbQuality(), and init().

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

Definition at line 229 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

edm::InputTag MuonIdProducer::globalTrackQualityInputTag_
private

Definition at line 246 of file MuonIdProducer.h.

std::string MuonIdProducer::hcalDepositName_
private

Definition at line 240 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

std::string MuonIdProducer::hoDepositName_
private

Definition at line 241 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

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

Definition at line 212 of file MuonIdProducer.h.

Referenced by init(), and produce().

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

Definition at line 220 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

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

Definition at line 176 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

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

Definition at line 177 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

std::string MuonIdProducer::jetDepositName_
private

Definition at line 242 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

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

Definition at line 215 of file MuonIdProducer.h.

Referenced by init(), and produce().

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

Definition at line 223 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

double MuonIdProducer::maxAbsDx_
private

Definition at line 192 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

double MuonIdProducer::maxAbsDy_
private

Definition at line 194 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

double MuonIdProducer::maxAbsEta_
private

Definition at line 188 of file MuonIdProducer.h.

Referenced by isGoodTrack(), and MuonIdProducer().

double MuonIdProducer::maxAbsPullX_
private

Definition at line 193 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

double MuonIdProducer::maxAbsPullY_
private

Definition at line 195 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

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

Definition at line 254 of file MuonIdProducer.h.

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

int MuonIdProducer::minNumberOfMatches_
private

Definition at line 187 of file MuonIdProducer.h.

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

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

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

Referenced by fillMuonIsolation(), and MuonIdProducer().

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

Definition at line 237 of file MuonIdProducer.h.

Referenced by fillMuonIsolation(), and MuonIdProducer().

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

Definition at line 236 of file MuonIdProducer.h.

Referenced by fillMuonIsolation(), and MuonIdProducer().

MuonCaloCompatibility MuonIdProducer::muonCaloCompatibility_
private

Definition at line 234 of file MuonIdProducer.h.

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

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

Definition at line 214 of file MuonIdProducer.h.

Referenced by init(), and produce().

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

Definition at line 222 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

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

Definition at line 213 of file MuonIdProducer.h.

Referenced by init(), and produce().

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

Definition at line 221 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

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

Definition at line 217 of file MuonIdProducer.h.

Referenced by init(), and makeMuon().

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

Definition at line 225 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

double MuonIdProducer::ptThresholdToFillCandidateP4WithGlobalFit_
private

Definition at line 205 of file MuonIdProducer.h.

Referenced by makeMuon(), and MuonIdProducer().

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

Definition at line 231 of file MuonIdProducer.h.

Referenced by fillMuonId(), and init().

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

Definition at line 228 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

double MuonIdProducer::sigmaThresholdToFillCandidateP4WithGlobalFit_
private

Definition at line 206 of file MuonIdProducer.h.

Referenced by makeMuon(), and MuonIdProducer().

bool MuonIdProducer::storeCrossedHcalRecHits_
private

Definition at line 200 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

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

Definition at line 181 of file MuonIdProducer.h.

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

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

Definition at line 179 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

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

Definition at line 216 of file MuonIdProducer.h.

Referenced by init(), and makeMuon().

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

Definition at line 224 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

TrackDetectorAssociator MuonIdProducer::trackAssociator_
private

Definition at line 138 of file MuonIdProducer.h.

Referenced by fillMuonId(), and init().

std::string MuonIdProducer::trackDepositName_
private

Definition at line 238 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

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

Definition at line 249 of file MuonIdProducer.h.

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

bool MuonIdProducer::writeIsoDeposits_
private

Definition at line 204 of file MuonIdProducer.h.

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