CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonIdProducer.h
Go to the documentation of this file.
1 #ifndef MuonIdentification_MuonIdProducer_h
2 #define MuonIdentification_MuonIdProducer_h
3 
4 // -*- C++ -*-
5 //
6 // Package: MuonIdentification
7 // Class: MuonIdProducer
8 //
9 /*
10 
11  Description: reco::Muon producer that can fill various information:
12  - track-segment matching
13  - energy deposition
14  - muon isolation
15  - muon hypothesis compatibility (calorimeter)
16  Acceptable inputs:
17  - reco::TrackCollection
18  - reco::MuonCollection
19  - reco::MuonTrackLinksCollection
20 */
21 //
22 // Original Author: Dmytro Kovalskyi
23 //
24 //
25 
26 
27 // user include files
30 
34 
36 
43 
45 // #include "Utilities/Timing/interface/TimerStack.h"
46 
50 // RPC-Muon stuffs
51 
55 
58 
62 
63 
64 class MuonMesh;
65 class MuonKinkFinder;
66 
68  public:
70 
71  explicit MuonIdProducer(const edm::ParameterSet&);
72 
73  virtual ~MuonIdProducer();
74 
75  virtual void produce(edm::Event&, const edm::EventSetup&) override;
76  virtual void beginRun(const edm::Run&, const edm::EventSetup&) override;
77 
78  static double sectorPhi( const DetId& id );
79 
80  private:
85  reco::IsoDeposit& trackDep, reco::IsoDeposit& ecalDep, reco::IsoDeposit& hcalDep, reco::IsoDeposit& hoDep,
86  reco::IsoDeposit& jetDep);
87  void fillGlbQuality( edm::Event&, const edm::EventSetup&, reco::Muon& aMuon );
88  void fillTrackerKink( reco::Muon& aMuon );
89  void init( edm::Event&, const edm::EventSetup& );
90 
91  // make a muon based on a track ref
93  const reco::TrackRef& track, TrackType type);
94  // make a global muon based on the links object
96 
97  // make a muon based on track (p4)
98  reco::Muon makeMuon( const reco::Track& track );
99 
101 
102  // check if a silicon track satisfies the trackerMuon requirements
103  bool isGoodTrack( const reco::Track& track );
104 
105  bool isGoodTrackerMuon( const reco::Muon& muon );
106  bool isGoodRPCMuon( const reco::Muon& muon );
107 
108  // check number of common DetIds for a given trackerMuon and a stand alone
109  // muon track
110  int overlap(const reco::Muon& muon, const reco::Track& track);
111 
112  unsigned int chamberId(const DetId&);
113 
114  double phiOfMuonIneteractionRegion( const reco::Muon& muon ) const;
115 
116  bool checkLinks(const reco::MuonTrackLinks*) const ;
117  inline bool approxEqual(const double a, const double b, const double tol=1E-3) const
118  {
119  return std::abs(a-b) < tol;
120  }
121 
124 
125  struct ICTypes
126  {
127  enum ICTypeKey {
132  };
133 
134  static ICTypeKey toKey(const std::string& s) {
135  if ( s == "inner tracks" ) return INNER_TRACKS;
136  else if ( s == "outer tracks" ) return OUTER_TRACKS;
137  else if ( s == "links" ) return LINKS;
138  else if ( s == "muons" ) return MUONS;
139  else if ( s == "tev firstHit" ) return TEV_FIRSTHIT;
140  else if ( s == "tev picky" ) return TEV_PICKY ;
141  else if ( s == "tev dyt" ) return TEV_DYT ;
142 
143  throw cms::Exception("FatalError") << "Unknown input collection type: " << s;
144  }
145 
146  static std::string toStr(const ICTypeKey k) {
147  switch ( k ) {
148  case INNER_TRACKS: return "inner tracks";
149  case OUTER_TRACKS: return "outer tracks";
150  case LINKS : return "links" ;
151  case MUONS : return "muons" ;
152  case TEV_FIRSTHIT: return "tev firstHit";
153  case TEV_PICKY : return "tev picky" ;
154  case TEV_DYT : return "tev dyt" ;
155  default: throw cms::Exception("FatalError") << "Unknown input collection type";
156  }
157  return "";
158  }
159  };
160  std::vector<edm::InputTag> inputCollectionLabels_;
161  std::vector<ICTypes::ICTypeKey> inputCollectionTypes_;
162 
164 
165  // selections
166  double minPt_;
167  double minP_;
170  double maxAbsEta_;
172 
173  // matching
174  double maxAbsDx_;
175  double maxAbsPullX_;
176  double maxAbsDy_;
177  double maxAbsPullY_;
178 
179  // what information to fill
187 
189 
197 
205 
208 
211 
221 
225 
227  std::auto_ptr<MuonKinkFinder> trackerKinkFinder_;
228 
229  double caloCut_;
230 
231  bool arbClean_;
233 
234 };
235 #endif
std::string hoDepositName_
type
Definition: HCALResponse.h:21
std::string jetDepositName_
bool isGoodRPCMuon(const reco::Muon &muon)
edm::EDGetTokenT< reco::TrackCollection > innerTrackCollectionToken_
reco::Muon makeMuon(edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::TrackRef &track, TrackType type)
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)
edm::EDGetTokenT< edm::ValueMap< reco::MuonQuality > > glbQualToken_
TrackDetectorAssociator trackAssociator_
void fillMuonId(edm::Event &, const edm::EventSetup &, reco::Muon &, TrackDetectorAssociator::Direction direction=TrackDetectorAssociator::InsideOut)
reco::isodeposit::IsoDepositExtractor * muIsoExtractorCalo_
edm::Handle< reco::MuonTrackLinksCollection > linkCollectionHandle_
edm::EDGetTokenT< RPCRecHitCollection > rpcHitToken_
int overlap(const reco::Muon &muon, const reco::Track &track)
bool fillCaloCompatibility_
std::string trackDepositName_
double phiOfMuonIneteractionRegion(const reco::Muon &muon) const
virtual void produce(edm::Event &, const edm::EventSetup &) override
MuonCaloCompatibility muonCaloCompatibility_
edm::EDGetTokenT< reco::TrackToTrackMap > pickyCollectionToken_
static std::string toStr(const ICTypeKey k)
void fillGlbQuality(edm::Event &, const edm::EventSetup &, reco::Muon &aMuon)
std::auto_ptr< MuonKinkFinder > trackerKinkFinder_
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
MuonMesh * meshAlgo_
bool approxEqual(const double a, const double b, const double tol=1E-3) const
void init(edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< reco::TrackToTrackMap > tpfmsCollectionToken_
int iEvent
Definition: GenABIO.cc:230
double ptThresholdToFillCandidateP4WithGlobalFit_
TrackAssociatorParameters parameters_
void fillArbitrationInfo(reco::MuonCollection *)
void fillTrackerKink(reco::Muon &aMuon)
bool isGoodTrackerMuon(const reco::Muon &muon)
bool checkLinks(const reco::MuonTrackLinks *) const
std::string ecalDepositName_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< reco::MuonCollection > muonCollectionToken_
edm::EDGetTokenT< reco::TrackCollection > outerTrackCollectionToken_
edm::Handle< RPCRecHitCollection > rpcHitHandle_
edm::Handle< reco::TrackToTrackMap > dytCollectionHandle_
edm::Handle< reco::TrackCollection > outerTrackCollectionHandle_
edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkCollectionToken_
bool fillGlobalTrackRefits_
static double sectorPhi(const DetId &id)
reco::CaloMuon makeCaloMuon(const reco::Muon &)
virtual ~MuonIdProducer()
reco::isodeposit::IsoDepositExtractor * muIsoExtractorTrack_
reco::Muon::MuonTrackType TrackType
Definition: DetId.h:18
static ICTypeKey toKey(const std::string &s)
reco::isodeposit::IsoDepositExtractor * muIsoExtractorJet_
MuonTimingFiller * theTimingFiller_
std::vector< ICTypes::ICTypeKey > inputCollectionTypes_
std::vector< edm::InputTag > inputCollectionLabels_
double b
Definition: hdecay.h:120
MuonIdProducer(const edm::ParameterSet &)
bool fillGlobalTrackQuality_
std::string hcalDepositName_
unsigned int chamberId(const DetId &)
double a
Definition: hdecay.h:121
edm::Handle< reco::TrackToTrackMap > tpfmsCollectionHandle_
edm::Handle< reco::TrackCollection > innerTrackCollectionHandle_
bool isGoodTrack(const reco::Track &track)
MuonTrackType
map for Global Muon refitters
Definition: Muon.h:38
double sigmaThresholdToFillCandidateP4WithGlobalFit_
bool debugWithTruthMatching_
edm::InputTag globalTrackQualityInputTag_
edm::Handle< reco::MuonCollection > muonCollectionHandle_
Definition: Run.h:43
edm::Handle< edm::ValueMap< reco::MuonQuality > > glbQualHandle_
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
edm::Handle< reco::TrackToTrackMap > pickyCollectionHandle_
edm::EDGetTokenT< reco::TrackToTrackMap > dytCollectionToken_