test
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  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
81 
82  private:
87  reco::IsoDeposit& trackDep, reco::IsoDeposit& ecalDep, reco::IsoDeposit& hcalDep, reco::IsoDeposit& hoDep,
88  reco::IsoDeposit& jetDep);
89  void fillGlbQuality( edm::Event&, const edm::EventSetup&, reco::Muon& aMuon );
90  void fillTrackerKink( reco::Muon& aMuon );
91  void init( edm::Event&, const edm::EventSetup& );
92 
93  // make a muon based on a track ref
95  const reco::TrackRef& track, TrackType type);
96  // make a global muon based on the links object
98 
99  // make a muon based on track (p4)
100  reco::Muon makeMuon( const reco::Track& track );
101 
103 
104  // check if a silicon track satisfies the trackerMuon requirements
105  bool isGoodTrack( const reco::Track& track );
106 
107  bool isGoodTrackerMuon( const reco::Muon& muon );
108  bool isGoodRPCMuon( const reco::Muon& muon );
109  bool isGoodGEMMuon( const reco::Muon& muon );
110  bool isGoodME0Muon( const reco::Muon& muon );
111 
112  // check number of common DetIds for a given trackerMuon and a stand alone
113  // muon track
114  int overlap(const reco::Muon& muon, const reco::Track& track);
115 
116  unsigned int chamberId(const DetId&);
117 
118  double phiOfMuonIneteractionRegion( const reco::Muon& muon ) const;
119 
120  bool checkLinks(const reco::MuonTrackLinks*) const ;
121  inline bool approxEqual(const double a, const double b, const double tol=1E-3) const
122  {
123  return std::abs(a-b) < tol;
124  }
125 
128 
129  struct ICTypes
130  {
131  enum ICTypeKey {
136  };
137 
138  static ICTypeKey toKey(const std::string& s) {
139  if ( s == "inner tracks" ) return INNER_TRACKS;
140  else if ( s == "outer tracks" ) return OUTER_TRACKS;
141  else if ( s == "links" ) return LINKS;
142  else if ( s == "muons" ) return MUONS;
143  else if ( s == "tev firstHit" ) return TEV_FIRSTHIT;
144  else if ( s == "tev picky" ) return TEV_PICKY ;
145  else if ( s == "tev dyt" ) return TEV_DYT ;
146 
147  throw cms::Exception("FatalError") << "Unknown input collection type: " << s;
148  }
149 
150  static std::string toStr(const ICTypeKey k) {
151  switch ( k ) {
152  case INNER_TRACKS: return "inner tracks";
153  case OUTER_TRACKS: return "outer tracks";
154  case LINKS : return "links" ;
155  case MUONS : return "muons" ;
156  case TEV_FIRSTHIT: return "tev firstHit";
157  case TEV_PICKY : return "tev picky" ;
158  case TEV_DYT : return "tev dyt" ;
159  default: throw cms::Exception("FatalError") << "Unknown input collection type";
160  }
161  return "";
162  }
163  };
164  std::vector<edm::InputTag> inputCollectionLabels_;
165  std::vector<ICTypes::ICTypeKey> inputCollectionTypes_;
166 
168 
169  // selections
170  double minPt_;
171  double minP_;
174  double maxAbsEta_;
176 
177  // matching
178  double maxAbsDx_;
179  double maxAbsPullX_;
180  double maxAbsDy_;
181  double maxAbsPullY_;
182 
183  // what information to fill
191 
193 
201 
209 
212 
215 
225 
229 
231  std::unique_ptr<MuonKinkFinder> trackerKinkFinder_;
232 
233  double caloCut_;
234 
235  bool arbClean_;
237 
238 };
239 #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_
std::unique_ptr< MuonKinkFinder > trackerKinkFinder_
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_
bool isGoodGEMMuon(const reco::Muon &muon)
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::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_
bool isGoodME0Muon(const reco::Muon &muon)
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_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::InputTag globalTrackQualityInputTag_
edm::Handle< reco::MuonCollection > muonCollectionHandle_
Definition: Run.h:42
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_