CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
MuonIdProducer Class Reference

#include <MuonIdProducer.h>

Inheritance diagram for MuonIdProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

virtual void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 MuonIdProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
virtual ~MuonIdProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static double sectorPhi (const DetId &id)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

bool approxEqual (const double a, const double b, const double tol=1E-3) const
 
unsigned int chamberId (const DetId &)
 
bool checkLinks (const reco::MuonTrackLinks *) const
 
void fillArbitrationInfo (reco::MuonCollection *)
 
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)
 
void init (edm::Event &, const edm::EventSetup &)
 
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_
 
double caloCut_
 
bool debugWithTruthMatching_
 
edm::Handle
< reco::TrackToTrackMap
dytCollectionHandle_
 
edm::EDGetTokenT
< reco::TrackToTrackMap
dytCollectionToken_
 
std::string ecalDepositName_
 
bool fillCaloCompatibility_
 
bool fillEnergy_
 
bool fillGlobalTrackQuality_
 
bool fillGlobalTrackRefits_
 
bool fillIsolation_
 
bool fillMatching_
 
bool 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::TrackCollection
innerTrackCollectionHandle_
 
edm::EDGetTokenT
< reco::TrackCollection
innerTrackCollectionToken_
 
std::vector< edm::InputTaginputCollectionLabels_
 
std::vector< ICTypes::ICTypeKeyinputCollectionTypes_
 
std::string jetDepositName_
 
edm::Handle
< reco::MuonTrackLinksCollection
linkCollectionHandle_
 
edm::EDGetTokenT
< reco::MuonTrackLinksCollection
linkCollectionToken_
 
double maxAbsDx_
 
double maxAbsDy_
 
double maxAbsEta_
 
double maxAbsPullX_
 
double maxAbsPullY_
 
MuonMeshmeshAlgo_
 
int minNumberOfMatches_
 
double minP_
 
double minPCaloMuon_
 
double minPt_
 
reco::isodeposit::IsoDepositExtractormuIsoExtractorCalo_
 
reco::isodeposit::IsoDepositExtractormuIsoExtractorJet_
 
reco::isodeposit::IsoDepositExtractormuIsoExtractorTrack_
 
MuonCaloCompatibility muonCaloCompatibility_
 
edm::Handle< reco::MuonCollectionmuonCollectionHandle_
 
edm::EDGetTokenT
< reco::MuonCollection
muonCollectionToken_
 
edm::Handle
< reco::TrackCollection
outerTrackCollectionHandle_
 
edm::EDGetTokenT
< reco::TrackCollection
outerTrackCollectionToken_
 
TrackAssociatorParameters parameters_
 
edm::Handle
< reco::TrackToTrackMap
pickyCollectionHandle_
 
edm::EDGetTokenT
< reco::TrackToTrackMap
pickyCollectionToken_
 
double ptThresholdToFillCandidateP4WithGlobalFit_
 
edm::Handle< RPCRecHitCollectionrpcHitHandle_
 
edm::EDGetTokenT
< RPCRecHitCollection
rpcHitToken_
 
double sigmaThresholdToFillCandidateP4WithGlobalFit_
 
MuonTimingFillertheTimingFiller_
 
edm::Handle
< reco::TrackToTrackMap
tpfmsCollectionHandle_
 
edm::EDGetTokenT
< reco::TrackToTrackMap
tpfmsCollectionToken_
 
TrackDetectorAssociator trackAssociator_
 
std::string trackDepositName_
 
std::auto_ptr< MuonKinkFindertrackerKinkFinder_
 
bool writeIsoDeposits_
 

Additional Inherited Members

- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 67 of file MuonIdProducer.h.

Member Typedef Documentation

Definition at line 69 of file MuonIdProducer.h.

Constructor & Destructor Documentation

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

Definition at line 34 of file MuonIdProducer.cc.

References addExtraSoftMuons_, arbClean_, caloCut_, MuonCaloCompatibility::configure(), edm::EDConsumerBase::consumesCollector(), debugWithTruthMatching_, dytCollectionToken_, ecalDepositName_, fillCaloCompatibility_, fillEnergy_, fillGlobalTrackQuality_, fillGlobalTrackRefits_, fillIsolation_, fillMatching_, fillTrackerKink_, reco::get(), edm::ParameterSet::getParameter(), glbQualToken_, hcalDepositName_, hoDepositName_, i, MuonIdProducer::ICTypes::INNER_TRACKS, innerTrackCollectionToken_, inputCollectionLabels_, HLT_25ns14e33_v1_cff::inputCollectionTypes, inputCollectionTypes_, dtTPAnalyzer_cfg::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::parameters, parameters_, pickyCollectionToken_, ptThresholdToFillCandidateP4WithGlobalFit_, rpcHitToken_, sigmaThresholdToFillCandidateP4WithGlobalFit_, AlCaHLTBitMon_QueryRunRegistry::string, MuonIdProducer::ICTypes::TEV_DYT, MuonIdProducer::ICTypes::TEV_FIRSTHIT, MuonIdProducer::ICTypes::TEV_PICKY, theTimingFiller_, MuonIdProducer::ICTypes::toKey(), tpfmsCollectionToken_, trackDepositName_, trackerKinkFinder_, and writeIsoDeposits_.

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

Definition at line 179 of file MuonIdProducer.cc.

References meshAlgo_, muIsoExtractorCalo_, muIsoExtractorJet_, muIsoExtractorTrack_, and theTimingFiller_.

180 {
185  if (meshAlgo_) delete meshAlgo_;
186  // TimingReport::current()->dump(std::cout);
187 }
reco::isodeposit::IsoDepositExtractor * muIsoExtractorCalo_
MuonMesh * meshAlgo_
reco::isodeposit::IsoDepositExtractor * muIsoExtractorTrack_
reco::isodeposit::IsoDepositExtractor * muIsoExtractorJet_
MuonTimingFiller * theTimingFiller_

Member Function Documentation

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

Definition at line 117 of file MuonIdProducer.h.

References funct::abs().

Referenced by fillArbitrationInfo().

118  {
119  return std::abs(a-b) < tol;
120  }
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::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 424 of file MuonIdProducer.cc.

References edm::EventSetup::get(), meshAlgo_, edm::ESHandle< class >::product(), and MuonMesh::setCSCGeometry().

425 {
426  edm::ESHandle<CSCGeometry> geomHandle;
427  iSetup.get<MuonGeometryRecord>().get(geomHandle);
428 
429  meshAlgo_->setCSCGeometry(geomHandle.product());
430 
431 }
MuonMesh * meshAlgo_
void setCSCGeometry(const CSCGeometry *pg)
Definition: MuonMesh.h:43
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
unsigned int MuonIdProducer::chamberId ( const DetId id)
private

Definition at line 375 of file MuonIdProducer.cc.

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

Referenced by overlap().

376 {
377  if ( id.det() != DetId::Muon ) return 0;
378 
379  const auto subdetId = id.subdetId();
380  if ( subdetId == MuonSubdetId::DT ) {
381  return DTChamberId(id.rawId()).rawId();
382  }
383  else if ( subdetId == MuonSubdetId::CSC ) {
384  return CSCDetId(id.rawId()).chamberId().rawId();
385  }
386 
387  return 0;
388 }
static const int CSC
Definition: MuonSubdetId.h:13
static const int DT
Definition: MuonSubdetId.h:12
bool MuonIdProducer::checkLinks ( const reco::MuonTrackLinks links) const
private

Definition at line 1245 of file MuonIdProducer.cc.

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

Referenced by produce().

1245  {
1246  const bool trackBAD = links->trackerTrack().isNull();
1247  const bool staBAD = links->standAloneTrack().isNull();
1248  const bool glbBAD = links->globalTrack().isNull();
1249  if (trackBAD || staBAD || glbBAD )
1250  {
1251  edm::LogWarning("muonIDbadLinks") << "Global muon links to constituent tracks are invalid: trkBad "
1252  <<trackBAD <<" standaloneBad "<<staBAD<<" globalBad "<<glbBAD
1253  <<". There should be no such object. Muon is skipped.";
1254  return false;
1255  }
1256  return true;
1257 }
bool isNull() const
Checks for null.
Definition: Ref.h:249
void MuonIdProducer::fillArbitrationInfo ( reco::MuonCollection pOutputMuons)
private

Definition at line 963 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, MuonMesh::clearMesh(), MuonSubdetId::CSC, CSCDetId, MuonMesh::isDuplicateOf(), meshAlgo_, MuonMesh::runMesh(), python.multivaluedict::sort(), and plotscripts::stationIndex().

Referenced by produce().

964 {
965  //
966  // apply segment flags
967  //
968  std::vector<std::pair<reco::MuonChamberMatch*,reco::MuonSegmentMatch*> > chamberPairs; // for chamber segment sorting
969  std::vector<std::pair<reco::MuonChamberMatch*,reco::MuonSegmentMatch*> > stationPairs; // for station segment sorting
970  std::vector<std::pair<reco::MuonChamberMatch*,reco::MuonSegmentMatch*> > arbitrationPairs; // for muon segment arbitration
971 
972  // muonIndex1
973  for( unsigned int muonIndex1 = 0; muonIndex1 < pOutputMuons->size(); ++muonIndex1 )
974  {
975  auto& muon1 = pOutputMuons->at(muonIndex1);
976  // chamberIter1
977  for ( auto& chamber1 : muon1.matches() )
978  {
979  if(chamber1.segmentMatches.empty()) continue;
980  chamberPairs.clear();
981 
982  // segmentIter1
983  for ( auto& segment1 : chamber1.segmentMatches )
984  {
985  chamberPairs.push_back(std::make_pair(&chamber1, &segment1));
986  if(!segment1.isMask()) // has not yet been arbitrated
987  {
988  arbitrationPairs.clear();
989  arbitrationPairs.push_back(std::make_pair(&chamber1, &segment1));
990 
991  // find identical segments with which to arbitrate
992  // tracker muons only
993  if (muon1.isTrackerMuon()) {
994  // muonIndex2
995  for( unsigned int muonIndex2 = muonIndex1+1; muonIndex2 < pOutputMuons->size(); ++muonIndex2 )
996  {
997  auto& muon2 = pOutputMuons->at(muonIndex2);
998  // tracker muons only
999  if ( !muon2.isTrackerMuon() ) continue;
1000  // chamberIter2
1001  for ( auto& chamber2 : muon2.matches() )
1002  {
1003  // segmentIter2
1004  for ( auto& segment2 : chamber2.segmentMatches )
1005  {
1006  if(segment2.isMask()) continue; // has already been arbitrated
1007  if(approxEqual(segment2.x , segment1.x ) &&
1008  approxEqual(segment2.y , segment1.y ) &&
1009  approxEqual(segment2.dXdZ , segment1.dXdZ ) &&
1010  approxEqual(segment2.dYdZ , segment1.dYdZ ) &&
1011  approxEqual(segment2.xErr , segment1.xErr ) &&
1012  approxEqual(segment2.yErr , segment1.yErr ) &&
1013  approxEqual(segment2.dXdZErr, segment1.dXdZErr) &&
1014  approxEqual(segment2.dYdZErr, segment1.dYdZErr))
1015  {
1016  arbitrationPairs.push_back(std::make_pair(&chamber2, &segment2));
1017  }
1018  } // segmentIter2
1019  } // chamberIter2
1020  } // muonIndex2
1021  }
1022 
1023  // arbitration segment sort
1024  if(arbitrationPairs.empty()) continue; // this should never happen
1025  if(arbitrationPairs.size()==1) {
1026  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDRSlope);
1027  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDXSlope);
1028  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDR);
1029  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDX);
1030  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::Arbitrated);
1031  } else {
1032  sort(arbitrationPairs.begin(), arbitrationPairs.end(), SortMuonSegmentMatches(reco::MuonSegmentMatch::BelongsToTrackByDRSlope));
1033  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDRSlope);
1034  sort(arbitrationPairs.begin(), arbitrationPairs.end(), SortMuonSegmentMatches(reco::MuonSegmentMatch::BelongsToTrackByDXSlope));
1035  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDXSlope);
1036  sort(arbitrationPairs.begin(), arbitrationPairs.end(), SortMuonSegmentMatches(reco::MuonSegmentMatch::BelongsToTrackByDR));
1037  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDR);
1038  sort(arbitrationPairs.begin(), arbitrationPairs.end(), SortMuonSegmentMatches(reco::MuonSegmentMatch::BelongsToTrackByDX));
1039  arbitrationPairs.front().second->setMask(reco::MuonSegmentMatch::BelongsToTrackByDX);
1040  for ( auto& ap : arbitrationPairs ) {
1041  ap.second->setMask(reco::MuonSegmentMatch::Arbitrated);
1042  }
1043  }
1044  }
1045 
1046  // setup me1a cleaning for later
1047  if( chamber1.id.subdetId() == MuonSubdetId::CSC && arbClean_ &&
1048  CSCDetId(chamber1.id).ring() == 4) {
1049  for ( auto& segment2 : chamber1.segmentMatches ) {
1050  if( segment1.cscSegmentRef.isNull() || segment2.cscSegmentRef.isNull() ) continue;
1051  if( meshAlgo_->isDuplicateOf(segment1.cscSegmentRef,segment2.cscSegmentRef) &&
1052  (segment2.mask & 0x1e0000) &&
1053  (segment1.mask & 0x1e0000) ) {
1055  //if the track has lost the segment already through normal arbitration no need to do it again.
1056  }
1057  }
1058  }// mark all ME1/a duplicates that this track owns
1059 
1060  } // segmentIter1
1061 
1062  // chamber segment sort
1063  if(chamberPairs.empty()) continue; // this should never happen
1064  if(chamberPairs.size()==1) {
1065  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDRSlope);
1066  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDXSlope);
1067  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDR);
1068  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDX);
1069  } else {
1070  sort(chamberPairs.begin(), chamberPairs.end(), SortMuonSegmentMatches(reco::MuonSegmentMatch::BestInChamberByDRSlope));
1071  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDRSlope);
1072  sort(chamberPairs.begin(), chamberPairs.end(), SortMuonSegmentMatches(reco::MuonSegmentMatch::BestInChamberByDXSlope));
1073  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDXSlope);
1074  sort(chamberPairs.begin(), chamberPairs.end(), SortMuonSegmentMatches(reco::MuonSegmentMatch::BestInChamberByDR));
1075  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDR);
1076  sort(chamberPairs.begin(), chamberPairs.end(), SortMuonSegmentMatches(reco::MuonSegmentMatch::BestInChamberByDX));
1077  chamberPairs.front().second->setMask(reco::MuonSegmentMatch::BestInChamberByDX);
1078  }
1079  } // chamberIter1
1080 
1081  // station segment sort
1082  for( int stationIndex = 1; stationIndex < 5; ++stationIndex )
1083  {
1084  for( int detectorIndex = 1; detectorIndex < 4; ++detectorIndex )
1085  {
1086  stationPairs.clear();
1087 
1088  // chamberIter
1089  for ( auto& chamber : muon1.matches() )
1090  {
1091  if(!(chamber.station()==stationIndex && chamber.detector()==detectorIndex)) continue;
1092  if(chamber.segmentMatches.empty()) continue;
1093 
1094  for ( auto& segment : chamber.segmentMatches ) {
1095  stationPairs.push_back(std::make_pair(&chamber, &segment));
1096  }
1097  } // chamberIter
1098 
1099  if(stationPairs.empty()) continue; // this may very well happen
1100  if(stationPairs.size()==1) {
1101  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDRSlope);
1102  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDXSlope);
1103  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDR);
1104  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDX);
1105  } else {
1106  sort(stationPairs.begin(), stationPairs.end(), SortMuonSegmentMatches(reco::MuonSegmentMatch::BestInStationByDRSlope));
1107  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDRSlope);
1108  sort(stationPairs.begin(), stationPairs.end(), SortMuonSegmentMatches(reco::MuonSegmentMatch::BestInStationByDXSlope));
1109  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDXSlope);
1110  sort(stationPairs.begin(), stationPairs.end(), SortMuonSegmentMatches(reco::MuonSegmentMatch::BestInStationByDR));
1111  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDR);
1112  sort(stationPairs.begin(), stationPairs.end(), SortMuonSegmentMatches(reco::MuonSegmentMatch::BestInStationByDX));
1113  stationPairs.front().second->setMask(reco::MuonSegmentMatch::BestInStationByDX);
1114  }
1115  }
1116  }
1117 
1118  } // muonIndex1
1119 
1120  if(arbClean_) {
1121  // clear old mesh, create and prune new mesh!
1122  meshAlgo_->clearMesh();
1123  meshAlgo_->runMesh(pOutputMuons);
1124  }
1125 }
static const unsigned int BelongsToTrackByME1aClean
void runMesh(std::vector< reco::Muon > *p)
Definition: MuonMesh.h:39
static const unsigned int Arbitrated
segment mask flags
static const unsigned int BestInStationByDRSlope
static const unsigned int BelongsToTrackByDXSlope
static const unsigned int BestInStationByDR
void clearMesh()
Definition: MuonMesh.h:41
MuonMesh * meshAlgo_
bool approxEqual(const double a, const double b, const double tol=1E-3) const
static const int CSC
Definition: MuonSubdetId.h:13
static const unsigned int BestInChamberByDX
static const unsigned int BestInChamberByDR
static const unsigned int BestInStationByDXSlope
static const unsigned int BestInChamberByDXSlope
bool isDuplicateOf(const CSCSegmentRef &lhs, const CSCSegmentRef &rhs) const
Definition: MuonMesh.cc:342
static const unsigned int BelongsToTrackByDRSlope
static const unsigned int BelongsToTrackByDR
static const unsigned int BelongsToTrackByDX
functor predicate for standard library sort algorithm
def stationIndex
Definition: plotscripts.py:353
static const unsigned int BestInStationByDX
static const unsigned int BestInChamberByDRSlope
void MuonIdProducer::fillGlbQuality ( edm::Event iEvent,
const edm::EventSetup iSetup,
reco::Muon aMuon 
)
private

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

1225 {
1227  aMuon.setCombinedQuality((*glbQualHandle_)[aMuon.combinedMuon()]);
1228  }
1229 
1230  LogDebug("MuonIdentification") << "tkChiVal " << aMuon.combinedQuality().trkRelChi2;
1231 
1232 }
#define LogDebug(id)
bool isGlobalMuon() const
Definition: Muon.h:218
float trkRelChi2
chi2 value for the inner track stub with respect to the global track
Definition: MuonQuality.h:15
MuonQuality combinedQuality() const
get energy deposition information
Definition: Muon.h:121
bool isValid() const
Definition: HandleBase.h:75
bool failedToGet() const
Definition: HandleBase.h:79
virtual TrackRef combinedMuon() const
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 777 of file MuonIdProducer.cc.

References funct::abs(), TrackDetectorAssociator::associate(), reco::MuonRPCHitMatch::bx, TrackDetMatchInfo::chambers, TrackDetMatchInfo::crossedEcalIds, TrackDetMatchInfo::crossedEnergy(), TrackDetMatchInfo::crossedHcalIds, reco::MuonSegmentMatch::cscSegmentRef, 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, Exception, fillEnergy_, fillMatching_, TrackDetMatchInfo::findMaxDeposition(), 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_, 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(), reco::MuonSegmentMatch::t0, reco::MuonEnergy::tower, reco::MuonEnergy::towerS9, TrackDetMatchInfo::TowerTotal, 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().

780 {
781 
782  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId";
783 
784  // perform track - detector association
785  const reco::Track* track = 0;
786  if ( aMuon.track().isNonnull() ) track = aMuon.track().get();
787  else if ( aMuon.standAloneMuon().isNonnull() ) track = aMuon.standAloneMuon().get();
788  else throw cms::Exception("FatalError") << "Failed to fill muon id information for a muon with undefined references to tracks";
789 
790 
791  TrackDetMatchInfo info = trackAssociator_.associate(iEvent, iSetup, *track, parameters_, direction);
792 
793  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId :: fillEnergy = "<<fillEnergy_;
794 
795  if ( fillEnergy_ ) {
796 
797  reco::MuonEnergy muonEnergy;
800  muonEnergy.ho = info.crossedEnergy(TrackDetMatchInfo::HORecHits);
802  muonEnergy.emS9 = info.nXnEnergy(TrackDetMatchInfo::EcalRecHits,1); // 3x3 energy
803  muonEnergy.emS25 = info.nXnEnergy(TrackDetMatchInfo::EcalRecHits,2); // 5x5 energy
804  muonEnergy.hadS9 = info.nXnEnergy(TrackDetMatchInfo::HcalRecHits,1); // 3x3 energy
805  muonEnergy.hoS9 = info.nXnEnergy(TrackDetMatchInfo::HORecHits,1); // 3x3 energy
806  muonEnergy.towerS9 = info.nXnEnergy(TrackDetMatchInfo::TowerTotal,1); // 3x3 energy
807  muonEnergy.ecal_position = info.trkGlobPosAtEcal;
808  muonEnergy.hcal_position = info.trkGlobPosAtHcal;
809  if (! info.crossedEcalIds.empty() ) muonEnergy.ecal_id = info.crossedEcalIds.front();
810  if (! info.crossedHcalIds.empty() ) muonEnergy.hcal_id = info.crossedHcalIds.front();
811  // find maximal energy depositions and their time
812  DetId emMaxId = info.findMaxDeposition(TrackDetMatchInfo::EcalRecHits,2); // max energy deposit in 5x5 shape
813  for ( const auto& hit : info.ecalRecHits ) {
814  if (hit->id() != emMaxId) continue;
815  muonEnergy.emMax = hit->energy();
816  muonEnergy.ecal_time = hit->time();
817  }
818  DetId hadMaxId = info.findMaxDeposition(TrackDetMatchInfo::HcalRecHits,1); // max energy deposit in 3x3 shape
819  for ( const auto& hit : info.hcalRecHits ) {
820  if (hit->id() != hadMaxId) continue;
821  muonEnergy.hadMax = hit->energy();
822  muonEnergy.hcal_time = hit->time();
823  }
824  aMuon.setCalEnergy( muonEnergy );
825  }
826  if ( ! fillMatching_ && ! aMuon.isTrackerMuon() && ! aMuon.isRPCMuon() ) return;
827 
828  // fill muon match info
829  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId :: fill muon match info ";
830  std::vector<reco::MuonChamberMatch> muonChamberMatches;
831  unsigned int nubmerOfMatchesAccordingToTrackAssociator = 0;
832  for ( const auto& chamber : info.chambers )
833  {
834  if (chamber.id.subdetId() == 3 && rpcHitHandle_.isValid() ) continue; // Skip RPC chambers, they are taken care of below)
835  reco::MuonChamberMatch matchedChamber;
836 
837  const auto& lErr = chamber.tState.localError();
838  const auto& lPos = chamber.tState.localPosition();
839  const auto& lDir = chamber.tState.localDirection();
840 
841  const auto& localError = lErr.positionError();
842  matchedChamber.x = lPos.x();
843  matchedChamber.y = lPos.y();
844  matchedChamber.xErr = sqrt( localError.xx() );
845  matchedChamber.yErr = sqrt( localError.yy() );
846 
847  matchedChamber.dXdZ = lDir.z()!=0?lDir.x()/lDir.z():9999;
848  matchedChamber.dYdZ = lDir.z()!=0?lDir.y()/lDir.z():9999;
849  // DANGEROUS - compiler cannot guaranty parameters ordering
850  AlgebraicSymMatrix55 trajectoryCovMatrix = lErr.matrix();
851  matchedChamber.dXdZErr = trajectoryCovMatrix(1,1)>0?sqrt(trajectoryCovMatrix(1,1)):0;
852  matchedChamber.dYdZErr = trajectoryCovMatrix(2,2)>0?sqrt(trajectoryCovMatrix(2,2)):0;
853 
854  matchedChamber.edgeX = chamber.localDistanceX;
855  matchedChamber.edgeY = chamber.localDistanceY;
856 
857  matchedChamber.id = chamber.id;
858  if ( ! chamber.segments.empty() ) ++nubmerOfMatchesAccordingToTrackAssociator;
859 
860  // fill segments
861  for ( const auto& segment : chamber.segments )
862  {
863  reco::MuonSegmentMatch matchedSegment;
864  matchedSegment.x = segment.segmentLocalPosition.x();
865  matchedSegment.y = segment.segmentLocalPosition.y();
866  matchedSegment.dXdZ = segment.segmentLocalDirection.z()?segment.segmentLocalDirection.x()/segment.segmentLocalDirection.z():0;
867  matchedSegment.dYdZ = segment.segmentLocalDirection.z()?segment.segmentLocalDirection.y()/segment.segmentLocalDirection.z():0;
868  matchedSegment.xErr = segment.segmentLocalErrorXX>0?sqrt(segment.segmentLocalErrorXX):0;
869  matchedSegment.yErr = segment.segmentLocalErrorYY>0?sqrt(segment.segmentLocalErrorYY):0;
870  matchedSegment.dXdZErr = segment.segmentLocalErrorDxDz>0?sqrt(segment.segmentLocalErrorDxDz):0;
871  matchedSegment.dYdZErr = segment.segmentLocalErrorDyDz>0?sqrt(segment.segmentLocalErrorDyDz):0;
872  matchedSegment.t0 = segment.t0;
873  matchedSegment.mask = 0;
874  matchedSegment.dtSegmentRef = segment.dtSegmentRef;
875  matchedSegment.cscSegmentRef = segment.cscSegmentRef;
876  matchedSegment.hasZed_ = segment.hasZed;
877  matchedSegment.hasPhi_ = segment.hasPhi;
878  // test segment
879  bool matchedX = false;
880  bool matchedY = false;
881  LogTrace("MuonIdentification") << " matching local x, segment x: " << matchedSegment.x <<
882  ", chamber x: " << matchedChamber.x << ", max: " << maxAbsDx_;
883  LogTrace("MuonIdentification") << " matching local y, segment y: " << matchedSegment.y <<
884  ", chamber y: " << matchedChamber.y << ", max: " << maxAbsDy_;
885  const double matchedSegChDx = std::abs(matchedSegment.x - matchedChamber.x);
886  const double matchedSegChDy = std::abs(matchedSegment.y - matchedChamber.y);
887  const double matchedSegChPullX = matchedSegChDx/std::hypot(matchedSegment.xErr, matchedChamber.xErr);
888  const double matchedSegChPullY = matchedSegChDy/std::hypot(matchedSegment.yErr, matchedChamber.yErr);
889  if (matchedSegment.xErr>0 && matchedChamber.xErr>0 )
890  LogTrace("MuonIdentification") << " xpull: " << matchedSegChPullX;
891  if (matchedSegment.yErr>0 && matchedChamber.yErr>0 )
892  LogTrace("MuonIdentification") << " ypull: " << matchedSegChPullY;
893 
894  if (matchedSegChDx < maxAbsDx_) matchedX = true;
895  if (matchedSegChDy < maxAbsDy_) matchedY = true;
896  if (matchedSegment.xErr>0 && matchedChamber.xErr>0 && matchedSegChPullX < maxAbsPullX_) matchedX = true;
897  if (matchedSegment.yErr>0 && matchedChamber.yErr>0 && matchedSegChPullY < maxAbsPullY_) matchedY = true;
898  if (matchedX && matchedY) matchedChamber.segmentMatches.push_back(matchedSegment);
899  }
900  muonChamberMatches.push_back(matchedChamber);
901  }
902 
903  // Fill RPC info
904  LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId :: fill RPC info";
905  if ( rpcHitHandle_.isValid() )
906  {
907  for ( const auto& chamber : info.chambers )
908  {
909  if ( chamber.id.subdetId() != 3 ) continue; // Consider RPC chambers only
910  const auto& lErr = chamber.tState.localError();
911  const auto& lPos = chamber.tState.localPosition();
912  const auto& lDir = chamber.tState.localDirection();
913 
914  reco::MuonChamberMatch matchedChamber;
915 
916  LocalError localError = lErr.positionError();
917  matchedChamber.x = lPos.x();
918  matchedChamber.y = lPos.y();
919  matchedChamber.xErr = sqrt( localError.xx() );
920  matchedChamber.yErr = sqrt( localError.yy() );
921 
922  matchedChamber.dXdZ = lDir.z()!=0?lDir.x()/lDir.z():9999;
923  matchedChamber.dYdZ = lDir.z()!=0?lDir.y()/lDir.z():9999;
924  // DANGEROUS - compiler cannot guaranty parameters ordering
925  AlgebraicSymMatrix55 trajectoryCovMatrix = lErr.matrix();
926  matchedChamber.dXdZErr = trajectoryCovMatrix(1,1)>0?sqrt(trajectoryCovMatrix(1,1)):0;
927  matchedChamber.dYdZErr = trajectoryCovMatrix(2,2)>0?sqrt(trajectoryCovMatrix(2,2)):0;
928 
929  matchedChamber.edgeX = chamber.localDistanceX;
930  matchedChamber.edgeY = chamber.localDistanceY;
931 
932  matchedChamber.id = chamber.id;
933 
934  for ( const auto& rpcRecHit : *rpcHitHandle_ )
935  {
936  reco::MuonRPCHitMatch rpcHitMatch;
937 
938  if ( rpcRecHit.rawId() != chamber.id.rawId() ) continue;
939 
940  rpcHitMatch.x = rpcRecHit.localPosition().x();
941  rpcHitMatch.mask = 0;
942  rpcHitMatch.bx = rpcRecHit.BunchX();
943 
944  const double absDx = std::abs(rpcRecHit.localPosition().x()-chamber.tState.localPosition().x());
945  if( absDx <= 20 or absDx/sqrt(localError.xx()) <= 4 ) matchedChamber.rpcMatches.push_back(rpcHitMatch);
946  }
947 
948  muonChamberMatches.push_back(matchedChamber);
949  }
950  }
951 
952  aMuon.setMatches(muonChamberMatches);
953 
954  LogTrace("MuonIdentification") << "number of muon chambers: " << aMuon.matches().size() << "\n"
955  << "number of chambers with segments according to the associator requirements: " <<
956  nubmerOfMatchesAccordingToTrackAssociator;
957  LogTrace("MuonIdentification") << "number of segment matches with the producer requirements: " <<
959 
960  // fillTime( iEvent, iSetup, aMuon );
961 }
float xx() const
Definition: LocalError.h:24
DTRecSegment4DRef dtSegmentRef
static const TGPicture * info(bool iBackgroundIsBlack)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
TrackDetectorAssociator trackAssociator_
CSCSegmentRef cscSegmentRef
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
bool isTrackerMuon() const
Definition: Muon.h:219
std::vector< const EcalRecHit * > ecalRecHits
hits in the cone
std::vector< DetId > crossedEcalIds
DetId findMaxDeposition(EnergyType)
Find detector elements with highest energy deposition.
virtual TrackRef track() const
reference to a Track
Definition: Muon.h:49
float emS9
energy deposited in 3x3 ECAL crystal shape around central crystal
Definition: MuonEnergy.h:18
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:12
math::XYZPoint trkGlobPosAtHcal
float ecal_time
Calorimeter timing.
Definition: MuonEnergy.h:37
float ho
energy deposited in crossed HO towers
Definition: MuonEnergy.h:32
bool isRPCMuon() const
Definition: Muon.h:223
DetId hcal_id
DetId of the central HCAL tower with smallest depth.
Definition: MuonEnergy.h:50
TrackAssociatorParameters parameters_
float yy() const
Definition: LocalError.h:26
float emS25
energy deposited in 5x5 ECAL crystal shape around central crystal
Definition: MuonEnergy.h:20
T sqrt(T t)
Definition: SSEVec.h:48
std::vector< TAMuonChamberMatch > chambers
std::vector< const HBHERecHit * > hcalRecHits
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:34
std::vector< reco::MuonRPCHitMatch > rpcMatches
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:244
bool isValid() const
Definition: HandleBase.h:75
double crossedEnergy(EnergyType)
energy in detector elements crossed by the track by types
#define LogTrace(id)
math::XYZPointF hcal_position
Definition: MuonEnergy.h:44
unsigned int id
float emMax
maximal energy of ECAL crystal in the 5x5 shape
Definition: MuonEnergy.h:22
Definition: DetId.h:18
float hadMax
maximal energy of HCAL tower in the 3x3 shape
Definition: MuonEnergy.h:30
std::vector< MuonChamberMatch > & matches()
get muon matching information
Definition: Muon.h:140
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:47
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
void setMatches(const std::vector< MuonChamberMatch > &matches)
set muon matching information
Definition: Muon.h:143
math::XYZPointF ecal_position
Trajectory position at the calorimeter.
Definition: MuonEnergy.h:43
float hadS9
energy deposited in 3x3 HCAL tower shape around central tower
Definition: MuonEnergy.h:28
virtual TrackRef standAloneMuon() const
reference to a stand-alone muon Track
Definition: Muon.h:52
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 1127 of file MuonIdProducer.cc.

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

Referenced by produce().

1130 {
1131  const reco::Track* track = 0;
1132  if ( aMuon.track().isNonnull() ) track = aMuon.track().get();
1133  else if ( aMuon.standAloneMuon().isNonnull() ) track = aMuon.standAloneMuon().get();
1134  else throw cms::Exception("FatalError") << "Failed to compute muon isolation information for a muon with undefined references to tracks";
1135 
1136  reco::MuonIsolation isoR03, isoR05;
1137 
1138  // get deposits
1139  reco::IsoDeposit depTrk = muIsoExtractorTrack_->deposit(iEvent, iSetup, *track );
1140  std::vector<reco::IsoDeposit> caloDeps = muIsoExtractorCalo_->deposits(iEvent, iSetup, *track);
1141  reco::IsoDeposit depJet = muIsoExtractorJet_->deposit(iEvent, iSetup, *track );
1142 
1143  if(caloDeps.size()!=3) {
1144  LogTrace("MuonIdentification") << "Failed to fill vector of calorimeter isolation deposits!";
1145  return;
1146  }
1147 
1148  reco::IsoDeposit depEcal = caloDeps.at(0);
1149  reco::IsoDeposit depHcal = caloDeps.at(1);
1150  reco::IsoDeposit depHo = caloDeps.at(2);
1151 
1152  trackDep = depTrk;
1153  ecalDep = depEcal;
1154  hcalDep = depHcal;
1155  hoDep = depHo;
1156  jetDep = depJet;
1157 
1158  isoR03.sumPt = depTrk.depositWithin(0.3);
1159  isoR03.emEt = depEcal.depositWithin(0.3);
1160  isoR03.hadEt = depHcal.depositWithin(0.3);
1161  isoR03.hoEt = depHo.depositWithin(0.3);
1162  isoR03.nTracks = depTrk.depositAndCountWithin(0.3).second;
1163  isoR03.nJets = depJet.depositAndCountWithin(0.3).second;
1164  isoR03.trackerVetoPt = depTrk.candEnergy();
1165  isoR03.emVetoEt = depEcal.candEnergy();
1166  isoR03.hadVetoEt = depHcal.candEnergy();
1167  isoR03.hoVetoEt = depHo.candEnergy();
1168 
1169  isoR05.sumPt = depTrk.depositWithin(0.5);
1170  isoR05.emEt = depEcal.depositWithin(0.5);
1171  isoR05.hadEt = depHcal.depositWithin(0.5);
1172  isoR05.hoEt = depHo.depositWithin(0.5);
1173  isoR05.nTracks = depTrk.depositAndCountWithin(0.5).second;
1174  isoR05.nJets = depJet.depositAndCountWithin(0.5).second;
1175  isoR05.trackerVetoPt = depTrk.candEnergy();
1176  isoR05.emVetoEt = depEcal.candEnergy();
1177  isoR05.hadVetoEt = depHcal.candEnergy();
1178  isoR05.hoVetoEt = depHo.candEnergy();
1179 
1180 
1181  aMuon.setIsolation(isoR03, isoR05);
1182 
1183 }
float hadEt
hcal sum-Et
Definition: MuonIsolation.h:9
double candEnergy() const
Get energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:136
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
float sumPt
sum-pt of tracks
Definition: MuonIsolation.h:7
reco::isodeposit::IsoDepositExtractor * muIsoExtractorCalo_
float hadVetoEt
hcal sum-et in the veto region in r-phi
Definition: MuonIsolation.h:15
virtual TrackRef track() const
reference to a Track
Definition: Muon.h:49
double depositWithin(double coneSize, const Vetos &vetos=Vetos(), bool skipDepositVeto=false) const
Get deposit.
Definition: IsoDeposit.cc:34
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:244
#define LogTrace(id)
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
reco::isodeposit::IsoDepositExtractor * muIsoExtractorTrack_
float emVetoEt
ecal sum-et in the veto region in r-phi
Definition: MuonIsolation.h:14
reco::isodeposit::IsoDepositExtractor * muIsoExtractorJet_
virtual std::vector< reco::IsoDeposit > deposits(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
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
virtual reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const =0
float trackerVetoPt
(sum-)pt inside the veto region in r-phi
Definition: MuonIsolation.h:13
virtual TrackRef standAloneMuon() const
reference to a stand-alone muon Track
Definition: Muon.h:52
void MuonIdProducer::fillTrackerKink ( reco::Muon aMuon)
private

Definition at line 1234 of file MuonIdProducer.cc.

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

Referenced by produce().

1234  {
1235  // skip muons with no tracks
1236  if (aMuon.innerTrack().isNull()) return;
1237  // get quality from muon if already there, otherwise make empty one
1239  // fill it
1240  const bool filled = trackerKinkFinder_->fillTrkKink(quality, *aMuon.innerTrack());
1241  // if quality was there, or if we filled it, commit to the muon
1242  if (filled || aMuon.isQualityValid()) aMuon.setCombinedQuality(quality);
1243 }
virtual TrackRef innerTrack() const
Definition: Muon.h:48
std::auto_ptr< MuonKinkFinder > trackerKinkFinder_
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:249
void setCombinedQuality(const MuonQuality &combinedQuality)
set energy deposition information
Definition: Muon.h:123
void MuonIdProducer::init ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 189 of file MuonIdProducer.cc.

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

Referenced by produce().

190 {
195 
199 
200 
202  iSetup.get<TrackingComponentsRecord>().get("SteppingHelixPropagatorAny", propagator);
203  trackAssociator_.setPropagator(propagator.product());
204 
205  if (fillTrackerKink_) trackerKinkFinder_->init(iSetup);
206 
207  for ( unsigned int i = 0; i < inputCollectionLabels_.size(); ++i ) {
208  const auto& inputLabel = inputCollectionLabels_[i];
209  const auto inputType = inputCollectionTypes_[i];
210  if ( inputType == ICTypes::INNER_TRACKS ) {
213  throw cms::Exception("FatalError") << "Failed to get input track collection with label: " << inputLabel;
214  LogTrace("MuonIdentification") << "Number of input inner tracks: " << innerTrackCollectionHandle_->size();
215  }
216  else if ( inputType == ICTypes::OUTER_TRACKS ) {
219  throw cms::Exception("FatalError") << "Failed to get input track collection with label: " << inputLabel;
220  LogTrace("MuonIdentification") << "Number of input outer tracks: " << outerTrackCollectionHandle_->size();
221  }
222  else if ( inputType == ICTypes::LINKS ) {
225  throw cms::Exception("FatalError") << "Failed to get input link collection with label: " << inputLabel;
226  LogTrace("MuonIdentification") << "Number of input links: " << linkCollectionHandle_->size();
227  }
228  else if ( inputType == ICTypes::MUONS ) {
231  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
232  LogTrace("MuonIdentification") << "Number of input muons: " << muonCollectionHandle_->size();
233  }
234  else if ( fillGlobalTrackRefits_ && inputType == ICTypes::TEV_FIRSTHIT ) {
237  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
238  LogTrace("MuonIdentification") << "Number of input muons: " << tpfmsCollectionHandle_->size();
239  }
240  else if ( fillGlobalTrackRefits_ && inputType == ICTypes::TEV_PICKY ) {
243  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
244  LogTrace("MuonIdentification") << "Number of input muons: " << pickyCollectionHandle_->size();
245  }
246  else if ( fillGlobalTrackRefits_ && inputType == ICTypes::TEV_DYT ) {
248  if (! dytCollectionHandle_.isValid())
249  throw cms::Exception("FatalError") << "Failed to get input muon collection with label: " << inputLabel;
250  LogTrace("MuonIdentification") << "Number of input muons: " << dytCollectionHandle_->size();
251  }
252  else throw cms::Exception("FatalError") << "Unknown input collection type: #" << ICTypes::toStr(inputType);
253  }
254 
257 
258 }
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< reco::TrackCollection > innerTrackCollectionToken_
edm::EDGetTokenT< edm::ValueMap< reco::MuonQuality > > glbQualToken_
TrackDetectorAssociator trackAssociator_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
edm::Handle< reco::MuonTrackLinksCollection > linkCollectionHandle_
edm::EDGetTokenT< RPCRecHitCollection > rpcHitToken_
edm::EDGetTokenT< reco::TrackToTrackMap > pickyCollectionToken_
static std::string toStr(const ICTypeKey k)
std::auto_ptr< MuonKinkFinder > trackerKinkFinder_
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:75
edm::Handle< reco::TrackCollection > outerTrackCollectionHandle_
edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkCollectionToken_
#define LogTrace(id)
bool fillGlobalTrackRefits_
std::vector< ICTypes::ICTypeKey > inputCollectionTypes_
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
std::vector< edm::InputTag > inputCollectionLabels_
bool fillGlobalTrackQuality_
edm::Handle< reco::TrackToTrackMap > tpfmsCollectionHandle_
edm::Handle< reco::TrackCollection > innerTrackCollectionHandle_
edm::Handle< reco::MuonCollection > muonCollectionHandle_
edm::Handle< edm::ValueMap< reco::MuonQuality > > glbQualHandle_
edm::Handle< reco::TrackToTrackMap > pickyCollectionHandle_
edm::EDGetTokenT< reco::TrackToTrackMap > dytCollectionToken_
bool MuonIdProducer::isGoodRPCMuon ( const reco::Muon muon)
private

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

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

Definition at line 353 of file MuonIdProducer.cc.

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

Referenced by produce().

354 {
355  // Pt and absolute momentum requirement
356  const double p = track.p();
357  const double pt = track.pt();
358  if (pt < minPt_ || (p < minP_ && p < minPCaloMuon_)){
359  LogTrace("MuonIdentification") << "Skipped low momentum track (Pt,P): " << pt
360  << ", " << track.p() << " GeV";
361  return false;
362  }
363 
364  // Eta requirement
365  const double eta = track.eta();
366  const double absEta = std::abs(eta);
367  if ( absEta > maxAbsEta_ ){
368  LogTrace("MuonIdentification") << "Skipped track with large pseudo rapidity (Eta: " << track.eta() << " )";
369  return false;
370  }
371 
372  return true;
373 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:602
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:638
double pt() const
track transverse momentum
Definition: TrackBase.h:608
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 759 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().

760 {
761  if(muon.track()->pt() < minPt_ || muon.track()->p() < minP_) return false;
762  if ( addExtraSoftMuons_ &&
763  muon.pt()<5 && std::abs(muon.eta())<1.5 &&
764  muon.numberOfMatches( reco::Muon::NoArbitration ) >= 1 ) return true;
766 }
virtual TrackRef track() const
reference to a Track
Definition: Muon.h:49
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
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 278 of file MuonIdProducer.cc.

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

Referenced by produce().

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

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

Referenced by makeMuon(), and produce().

262 {
263  LogTrace("MuonIdentification") << "Creating a muon from a track " << track.get()->pt() <<
264  " Pt (GeV), eta: " << track.get()->eta();
265  reco::Muon aMuon( makeMuon( *(track.get()) ) );
266 
267  LogTrace("MuonIdentification") << "Muon created from a track ";
268 
269  aMuon.setMuonTrack(type,track);
270  aMuon.setBestTrack(type);
271  aMuon.setTunePBestTrack(type);
272 
273  LogTrace("MuonIdentification") << "Muon created from a track and setMuonBestTrack, setBestTrack and setTunePBestTrack called";
274 
275  return aMuon;
276 }
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:244
#define LogTrace(id)
reco::Muon MuonIdProducer::makeMuon ( const reco::MuonTrackLinks links)
private

Definition at line 293 of file MuonIdProducer.cc.

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

294 {
295  LogTrace("MuonIdentification") << "Creating a muon from a link to tracks object";
296 
297  reco::Muon aMuon;
298  reco::Muon::MuonTrackTypePair chosenTrack;
299  reco::TrackRef tpfmsRef;
300  reco::TrackRef pickyRef;
301  reco::TrackRef dytRef;
302  bool useSigmaSwitch = false;
303 
306 
310 
311  if (tpfmsRef.isNull() && pickyRef.isNull() && dytRef.isNull()){
312  edm::LogWarning("MakeMuonWithTEV")<<"Failed to get TEV refits, fall back to sigma switch.";
313  useSigmaSwitch = true;
314  }
315  } else {
316  useSigmaSwitch = true;
317  }
318 
319  if (useSigmaSwitch){
320  chosenTrack = muon::sigmaSwitch( links.globalTrack(), links.trackerTrack(),
323  } else {
324  chosenTrack = muon::tevOptimized( links.globalTrack(), links.trackerTrack(),
325  tpfmsRef, pickyRef, dytRef,
327  }
328  aMuon = makeMuon(*chosenTrack.first);
329  aMuon.setInnerTrack( links.trackerTrack() );
330  aMuon.setOuterTrack( links.standAloneTrack() );
331  aMuon.setGlobalTrack( links.globalTrack() );
332  aMuon.setBestTrack(chosenTrack.second);
333  aMuon.setTunePBestTrack(chosenTrack.second);
334 
338  if (it != tpfmsCollectionHandle_->end()) aMuon.setMuonTrack(reco::Muon::TPFMS, (it->val));
339  }
342  if (it != pickyCollectionHandle_->end()) aMuon.setMuonTrack(reco::Muon::Picky, (it->val));
343  }
346  if (it != dytCollectionHandle_->end()) aMuon.setMuonTrack(reco::Muon::DYT, (it->val));
347  }
348  }
349  return aMuon;
350 }
reco::Muon makeMuon(edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::TrackRef &track, TrackType type)
virtual void setTunePBestTrack(MuonTrackType muonType)
Definition: Muon.h:93
virtual void setInnerTrack(const TrackRef &t)
set reference to Track
double ptThresholdToFillCandidateP4WithGlobalFit_
reco::Muon::MuonTrackTypePair sigmaSwitch(const reco::TrackRef &combinedTrack, const reco::TrackRef &trackerTrack, const double nSigma=2., const double ptThreshold=200.)
reco::Muon::MuonTrackTypePair tevOptimized(const reco::TrackRef &combinedTrack, const reco::TrackRef &trackerTrack, const reco::TrackRef &tpfmsTrack, const reco::TrackRef &pickyTrack, const reco::TrackRef &dytTrack, const double ptThreshold=200., const double tune1=17., const double tune2=40., const double dptcut=0.25)
Definition: MuonCocktails.cc:9
edm::Handle< reco::TrackToTrackMap > dytCollectionHandle_
bool isValid() const
Definition: HandleBase.h:75
bool isNull() const
Checks for null.
Definition: Ref.h:249
#define LogTrace(id)
bool fillGlobalTrackRefits_
void setMuonTrack(const MuonTrackType &, const TrackRef &)
bool failedToGet() const
Definition: HandleBase.h:79
virtual void setOuterTrack(const TrackRef &t)
set reference to Track
reco::TrackRef getTevRefitTrack(const reco::TrackRef &combinedTrack, const reco::TrackToTrackMap &map)
virtual void setBestTrack(MuonTrackType muonType)
Definition: Muon.h:91
edm::Handle< reco::TrackToTrackMap > tpfmsCollectionHandle_
double sigmaThresholdToFillCandidateP4WithGlobalFit_
std::pair< TrackRef, Muon::MuonTrackType > MuonTrackTypePair
Definition: Muon.h:40
virtual void setGlobalTrack(const TrackRef &t)
set reference to Track
edm::Handle< reco::TrackToTrackMap > pickyCollectionHandle_
reco::Muon MuonIdProducer::makeMuon ( const reco::Track track)
private

Definition at line 1185 of file MuonIdProducer.cc.

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

1186 {
1187  const double energy = hypot(track.p(), 0.105658369);
1188  const math::XYZTLorentzVector p4(track.px(), track.py(), track.pz(), energy);
1189  return reco::Muon( track.charge(), p4, track.vertex() );
1190 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:602
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:614
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:674
double p4[4]
Definition: TauolaWrapper.h:92
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:626
int charge() const
track electric charge
Definition: TrackBase.h:554
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:620
int MuonIdProducer::overlap ( const reco::Muon muon,
const reco::Track track 
)
private

Definition at line 391 of file MuonIdProducer.cc.

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

Referenced by produce().

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

1211 {
1212  if ( muon.isStandAloneMuon() ) return muon.standAloneMuon()->innerPosition().phi();
1213  // the rest is tracker muon only
1214  if ( muon.matches().empty() ) {
1215  if ( muon.innerTrack().isAvailable() &&
1216  muon.innerTrack()->extra().isAvailable() )
1217  return muon.innerTrack()->outerPosition().phi();
1218  else
1219  return muon.phi(); // makes little sense, but what else can I use
1220  }
1221  return sectorPhi(muon.matches().at(0).id);
1222 }
bool isAvailable() const
Definition: Ref.h:576
virtual TrackRef innerTrack() const
Definition: Muon.h:48
bool isStandAloneMuon() const
Definition: Muon.h:220
static double sectorPhi(const DetId &id)
std::vector< MuonChamberMatch > & matches()
get muon matching information
Definition: Muon.h:140
virtual double phi() const
momentum azimuthal angle
virtual TrackRef standAloneMuon() const
reference to a stand-alone muon Track
Definition: Muon.h:52
void MuonIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 447 of file MuonIdProducer.cc.

References TrackDetectorAssociator::Any, reco::Muon::calEnergy(), reco::CaloMuon::caloCompatibility(), caloCut_, checkLinks(), funct::cos(), TrackDetectorAssociator::crossedIP(), debugWithTruthMatching_, ecalDepositName_, MuonCaloCompatibility::evaluate(), reco::Track::extra(), edm::helper::Filler< Map >::fill(), fillArbitrationInfo(), fillCaloCompatibility_, fillEnergy_, fillGlbQuality(), fillGlobalTrackQuality_, fillIsolation_, fillMatching_, fillMuonId(), fillMuonIsolation(), MuonTimingFiller::fillTiming(), fillTrackerKink(), fillTrackerKink_, edm::Ref< C, T, F >::get(), reco::Muon::GlobalMuon, hcalDepositName_, hoDepositName_, i, init(), reco::Muon::InnerTrack, reco::Muon::innerTrack(), innerTrackCollectionHandle_, edm::helper::Filler< Map >::insert(), TrackDetectorAssociator::InsideOut, edm::Ref< C, T, F >::isAvailable(), reco::CaloMuon::isCaloCompatibilityValid(), reco::Muon::isEnergyValid(), isGoodRPCMuon(), isGoodTrack(), isGoodTrackerMuon(), reco::Muon::isTimeValid(), edm::HandleBase::isValid(), j, jetDepositName_, linkCollectionHandle_, LogDebug, LogTrace, makeCaloMuon(), makeMuon(), reco::Muon::matches(), minPCaloMuon_, metsig::muon, muonCaloCompatibility_, muonCollectionHandle_, reco::MuonTime::nDof, reco::MuonTimeExtra::nDof(), reco::Muon::OuterTrack, outerTrackCollectionHandle_, TrackDetectorAssociator::OutsideIn, overlap(), reco::CaloMuon::p(), phiOfMuonIneteractionRegion(), edm::Event::put(), reco::Muon::RPCMuon, reco::Muon::setType(), reco::Muon::StandAloneMuon, 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(), trackDepositName_, susybsm::HSCParticleType::trackerMuon, reco::Muon::TrackerMuon, MuonIdTruthInfo::truthMatchMuon(), reco::Muon::type(), validateGlobalMuonPair(), and writeIsoDeposits_.

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

Definition at line 1192 of file MuonIdProducer.cc.

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

Referenced by phiOfMuonIneteractionRegion().

1193 {
1194  double phi = 0;
1195  if( id.subdetId() == MuonSubdetId::DT ) { // DT
1196  DTChamberId muonId(id.rawId());
1197  if ( muonId.sector() <= 12 )
1198  phi = (muonId.sector()-1)/6.*M_PI;
1199  if ( muonId.sector() == 13 ) phi = 3/6.*M_PI;
1200  if ( muonId.sector() == 14 ) phi = 9/6.*M_PI;
1201  }
1202  if( id.subdetId() == MuonSubdetId::CSC ) { // CSC
1203  CSCDetId muonId(id.rawId());
1204  phi = M_PI/4+(muonId.triggerSector()-1)/3.*M_PI;
1205  }
1206  if ( phi > M_PI ) phi -= 2*M_PI;
1207  return phi;
1208 }
static const int CSC
Definition: MuonSubdetId.h:13
#define M_PI
static const int DT
Definition: MuonSubdetId.h:12

Member Data Documentation

bool MuonIdProducer::addExtraSoftMuons_
private

Definition at line 171 of file MuonIdProducer.h.

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

bool MuonIdProducer::arbClean_
private

Definition at line 231 of file MuonIdProducer.h.

Referenced by fillArbitrationInfo(), and MuonIdProducer().

double MuonIdProducer::caloCut_
private

Definition at line 229 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

bool MuonIdProducer::debugWithTruthMatching_
private

Definition at line 188 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

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

Definition at line 196 of file MuonIdProducer.h.

Referenced by init(), and makeMuon().

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

Definition at line 204 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

std::string MuonIdProducer::ecalDepositName_
private

Definition at line 217 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

bool MuonIdProducer::fillCaloCompatibility_
private

Definition at line 180 of file MuonIdProducer.h.

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

bool MuonIdProducer::fillEnergy_
private

Definition at line 181 of file MuonIdProducer.h.

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

bool MuonIdProducer::fillGlobalTrackQuality_
private

Definition at line 222 of file MuonIdProducer.h.

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

bool MuonIdProducer::fillGlobalTrackRefits_
private

Definition at line 223 of file MuonIdProducer.h.

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

bool MuonIdProducer::fillIsolation_
private

Definition at line 183 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

bool MuonIdProducer::fillMatching_
private

Definition at line 182 of file MuonIdProducer.h.

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

bool MuonIdProducer::fillTrackerKink_
private

Definition at line 226 of file MuonIdProducer.h.

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

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

Definition at line 210 of file MuonIdProducer.h.

Referenced by fillGlbQuality(), and init().

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

Definition at line 207 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

edm::InputTag MuonIdProducer::globalTrackQualityInputTag_
private

Definition at line 224 of file MuonIdProducer.h.

std::string MuonIdProducer::hcalDepositName_
private

Definition at line 218 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

std::string MuonIdProducer::hoDepositName_
private

Definition at line 219 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

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

Definition at line 190 of file MuonIdProducer.h.

Referenced by init(), and produce().

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

Definition at line 198 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

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

Definition at line 160 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

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

Definition at line 161 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

std::string MuonIdProducer::jetDepositName_
private

Definition at line 220 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

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

Definition at line 193 of file MuonIdProducer.h.

Referenced by init(), and produce().

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

Definition at line 201 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

double MuonIdProducer::maxAbsDx_
private

Definition at line 174 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

double MuonIdProducer::maxAbsDy_
private

Definition at line 176 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

double MuonIdProducer::maxAbsEta_
private

Definition at line 170 of file MuonIdProducer.h.

Referenced by isGoodTrack(), and MuonIdProducer().

double MuonIdProducer::maxAbsPullX_
private

Definition at line 175 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

double MuonIdProducer::maxAbsPullY_
private

Definition at line 177 of file MuonIdProducer.h.

Referenced by fillMuonId(), and MuonIdProducer().

MuonMesh* MuonIdProducer::meshAlgo_
private

Definition at line 232 of file MuonIdProducer.h.

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

int MuonIdProducer::minNumberOfMatches_
private

Definition at line 169 of file MuonIdProducer.h.

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

double MuonIdProducer::minP_
private

Definition at line 167 of file MuonIdProducer.h.

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

double MuonIdProducer::minPCaloMuon_
private

Definition at line 168 of file MuonIdProducer.h.

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

double MuonIdProducer::minPt_
private

Definition at line 166 of file MuonIdProducer.h.

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

reco::isodeposit::IsoDepositExtractor* MuonIdProducer::muIsoExtractorCalo_
private

Definition at line 213 of file MuonIdProducer.h.

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

reco::isodeposit::IsoDepositExtractor* MuonIdProducer::muIsoExtractorJet_
private

Definition at line 215 of file MuonIdProducer.h.

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

reco::isodeposit::IsoDepositExtractor* MuonIdProducer::muIsoExtractorTrack_
private

Definition at line 214 of file MuonIdProducer.h.

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

MuonCaloCompatibility MuonIdProducer::muonCaloCompatibility_
private

Definition at line 212 of file MuonIdProducer.h.

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

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

Definition at line 192 of file MuonIdProducer.h.

Referenced by init(), and produce().

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

Definition at line 200 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

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

Definition at line 191 of file MuonIdProducer.h.

Referenced by init(), and produce().

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

Definition at line 199 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

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

Definition at line 195 of file MuonIdProducer.h.

Referenced by init(), and makeMuon().

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

Definition at line 203 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

double MuonIdProducer::ptThresholdToFillCandidateP4WithGlobalFit_
private

Definition at line 185 of file MuonIdProducer.h.

Referenced by makeMuon(), and MuonIdProducer().

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

Definition at line 209 of file MuonIdProducer.h.

Referenced by fillMuonId(), and init().

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

Definition at line 206 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

double MuonIdProducer::sigmaThresholdToFillCandidateP4WithGlobalFit_
private

Definition at line 186 of file MuonIdProducer.h.

Referenced by makeMuon(), and MuonIdProducer().

MuonTimingFiller* MuonIdProducer::theTimingFiller_
private

Definition at line 163 of file MuonIdProducer.h.

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

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

Definition at line 194 of file MuonIdProducer.h.

Referenced by init(), and makeMuon().

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

Definition at line 202 of file MuonIdProducer.h.

Referenced by init(), and MuonIdProducer().

TrackDetectorAssociator MuonIdProducer::trackAssociator_
private

Definition at line 122 of file MuonIdProducer.h.

Referenced by fillMuonId(), and init().

std::string MuonIdProducer::trackDepositName_
private

Definition at line 216 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().

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

Definition at line 227 of file MuonIdProducer.h.

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

bool MuonIdProducer::writeIsoDeposits_
private

Definition at line 184 of file MuonIdProducer.h.

Referenced by MuonIdProducer(), and produce().