CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Muon.h
Go to the documentation of this file.
1 #ifndef MuonReco_Muon_h
2 #define MuonReco_Muon_h
3 
24 
25 namespace reco {
26 
27  class Muon : public RecoCandidate {
28  public:
29  Muon();
31  Muon( Charge, const LorentzVector &, const Point & = Point( 0, 0, 0 ) );
33  Muon * clone() const;
34 
35 
36 
39  typedef std::map<MuonTrackType, reco::TrackRef> MuonTrackRefMap;
40  typedef std::pair<TrackRef, Muon::MuonTrackType> MuonTrackTypePair;
41 
42 
48  virtual TrackRef innerTrack() const { return innerTrack_; }
49  virtual TrackRef track() const { return innerTrack(); }
51  virtual TrackRef outerTrack() const { return outerTrack_; }
52  virtual TrackRef standAloneMuon() const { return outerTrack(); }
54  virtual TrackRef globalTrack() const { return globalTrack_; }
55  virtual TrackRef combinedMuon() const { return globalTrack(); }
56 
57  virtual TrackRef tpfmsTrack() const { return muonTrackFromMap(TPFMS);}
58  virtual TrackRef pickyTrack() const { return muonTrackFromMap(Picky);}
59  virtual TrackRef dytTrack() const { return muonTrackFromMap(DYT);}
60 
61  virtual const Track * bestTrack() const {return muonTrack(bestTrackType_).get();}
63  virtual TrackRef muonBestTrack() const {return muonTrack(bestTrackType_);}
67 
68 
69 
70  bool isAValidMuonTrack(const MuonTrackType& type) const;
71  TrackRef muonTrack(const MuonTrackType&) const;
72 
74  MuonTrackRefMap::const_iterator iter = refittedTrackMap_.find(type);
75  if (iter != refittedTrackMap_.end())
76  return iter->second;
77  else
78  return TrackRef();
79  }
80 
82  virtual void setInnerTrack( const TrackRef & t );
83  virtual void setTrack( const TrackRef & t );
85  virtual void setOuterTrack( const TrackRef & t );
86  virtual void setStandAlone( const TrackRef & t );
88  virtual void setGlobalTrack( const TrackRef & t );
89  virtual void setCombined( const TrackRef & t );
90  // set reference to the Best Track
91  virtual void setBestTrack(MuonTrackType muonType) {bestTrackType_ = muonType;}
92  // set reference to the Best Track by PF
93  virtual void setTunePBestTrack(MuonTrackType muonType) {bestTunePTrackType_ = muonType;}
94 
95  void setMuonTrack(const MuonTrackType&, const TrackRef&);
96 
101 
103  virtual void setPFP4( const reco::Candidate::LorentzVector& p4_ );
104 
109  bool isEnergyValid() const { return energyValid_; }
111  MuonEnergy calEnergy() const { return calEnergy_; }
114 
119  bool isQualityValid() const { return qualityValid_; }
124 
129  bool isTimeValid() const { return (time_.nDof>0); }
131  MuonTime time() const { return time_; }
133  void setTime( const MuonTime& time ) { time_ = time; }
134 
138  bool isMatchesValid() const { return matchesValid_; }
140  std::vector<MuonChamberMatch>& matches() { return muMatches_;}
141  const std::vector<MuonChamberMatch>& matches() const { return muMatches_; }
143  void setMatches( const std::vector<MuonChamberMatch>& matches ) { muMatches_ = matches; matchesValid_ = true; }
144 
150  float caloCompatibility() const { return caloCompatibility_; }
152  bool isCaloCompatibilityValid() const { return caloCompatibility_>=0; }
153 
158  const MuonIsolation& isolationR03() const { return isolationR03_; }
159  const MuonIsolation& isolationR05() const { return isolationR05_; }
160 
161  const MuonPFIsolation& pfIsolationR03() const { return pfIsolationR03_; }
164  const MuonPFIsolation& pfIsolationR04() const { return pfIsolationR04_; }
167 
168 
169  void setIsolation( const MuonIsolation& isoR03, const MuonIsolation& isoR05 );
170  bool isIsolationValid() const { return isolationValid_; }
171  void setPFIsolation(const std::string& label,const reco::MuonPFIsolation& deposit);
172 
173 
174  bool isPFIsolationValid() const { return pfIsolationValid_; }
175 
176 
179 
184  int numberOfChambers() const { return muMatches_.size(); }
186  int numberOfChambersNoRPC() const;
201  unsigned int stationGapMaskDistance( float distanceCut = 10. ) const;
203  unsigned int stationGapMaskPull( float sigmaCut = 3. ) const;
204 
207  static const unsigned int GlobalMuon = 1<<1;
208  static const unsigned int TrackerMuon = 1<<2;
209  static const unsigned int StandAloneMuon = 1<<3;
210  static const unsigned int CaloMuon = 1<<4;
211  static const unsigned int PFMuon = 1<<5;
212  static const unsigned int RPCMuon = 1<<6;
213 
214  void setType( unsigned int type ) { type_ = type; }
215  unsigned int type() const { return type_; }
216  // override of method in base class reco::Candidate
217  bool isMuon() const { return true; }
218  bool isGlobalMuon() const { return type_ & GlobalMuon; }
219  bool isTrackerMuon() const { return type_ & TrackerMuon; }
220  bool isStandAloneMuon() const { return type_ & StandAloneMuon; }
221  bool isCaloMuon() const { return type_ & CaloMuon; }
222  bool isPFMuon() const {return type_ & PFMuon;} //fix me ! Has to go to type
223  bool isRPCMuon() const {return type_ & RPCMuon;}
224 
225  private:
227  virtual bool overlap( const Candidate & ) const;
240 
246  std::vector<MuonChamberMatch> muMatches_;
259 
267 
269  unsigned int type_;
270 
271  //PF muon p4
273 
274  // FixMe: Still missing trigger information
275 
277  const std::vector<const MuonChamberMatch*> chambers( int station, int muonSubdetId ) const;
279  std::pair<const MuonChamberMatch*,const MuonSegmentMatch*> pair( const std::vector<const MuonChamberMatch*> &,
281 
282  public:
284  int numberOfSegments( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
287  float dX ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
288  float dY ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
289  float dDxDz ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
290  float dDyDz ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
291  float pullX ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration, bool includeSegmentError = true ) const;
292  float pullY ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration, bool includeSegmentError = true ) const;
293  float pullDxDz ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration, bool includeSegmentError = true ) const;
294  float pullDyDz ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration, bool includeSegmentError = true ) const;
297  float segmentX ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
298  float segmentY ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
299  float segmentDxDz ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
300  float segmentDyDz ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
301  float segmentXErr ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
302  float segmentYErr ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
303  float segmentDxDzErr ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
304  float segmentDyDzErr ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
309  float trackEdgeX ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
310  float trackEdgeY ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
311  float trackX ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
312  float trackY ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
313  float trackDxDz ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
314  float trackDyDz ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
315  float trackXErr ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
316  float trackYErr ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
317  float trackDxDzErr ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
318  float trackDyDzErr ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
319  float trackDist ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
320  float trackDistErr ( int station, int muonSubdetId, ArbitrationType type = SegmentAndTrackArbitration ) const;
321 
322  float t0(int n=0) {
323  int i = 0;
324  for( std::vector<MuonChamberMatch>::const_iterator chamber = muMatches_.begin();
325  chamber != muMatches_.end(); ++chamber )
326  for ( std::vector<reco::MuonSegmentMatch>::const_iterator segment = chamber->segmentMatches.begin();
327  segment != chamber->segmentMatches.end(); ++segment )
328  {
329  if (i==n) return segment->t0;
330  ++i;
331  }
332  return 0;
333  }
334  };
335 
336 }
337 
338 
339 #endif
MuonPFIsolation pfIsoSumDRR03_
Definition: Muon.h:263
float dDyDz(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
type
Definition: HCALResponse.h:21
MuonEnergy calEnergy_
energy deposition
Definition: Muon.h:242
int Charge
electric charge type
Definition: Candidate.h:35
float segmentX(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
int i
Definition: DBlmapReader.cc:9
int numberOfMatchedRPCLayers(ArbitrationType type=RPCHitAndTrackArbitration) const
static const unsigned int GlobalMuon
Definition: Muon.h:207
reco::Candidate::LorentzVector pfP4_
Definition: Muon.h:272
unsigned int stationGapMaskPull(float sigmaCut=3.) const
same as above for given number of sigmas
float trackY(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
virtual MuonTrackType muonBestTrackType() const
Definition: Muon.h:64
void setType(unsigned int type)
Definition: Muon.h:214
MuonIsolation isolationR05_
Definition: Muon.h:258
virtual TrackRef innerTrack() const
Definition: Muon.h:48
float caloCompatibility_
muon hypothesis compatibility with observer calorimeter energy
Definition: Muon.h:255
bool isCaloCompatibilityValid() const
Definition: Muon.h:152
const MuonPFIsolation & pfSumDRIsoProfileR04() const
Definition: Muon.h:166
unsigned int type_
muon type mask
Definition: Muon.h:269
bool isTrackerMuon() const
Definition: Muon.h:219
bool isolationValid_
Definition: Muon.h:251
MuonPFIsolation pfIsoMeanDRR04_
Definition: Muon.h:265
const MuonPFIsolation & pfMeanDRIsoProfileR04() const
Definition: Muon.h:165
int numberOfSegments(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
get number of segments
virtual TrackRef track() const
reference to a Track
Definition: Muon.h:49
bool isGlobalMuon() const
Definition: Muon.h:218
MuonPFIsolation pfIsolationR04_
Definition: Muon.h:264
bool isMatchesValid() const
Definition: Muon.h:138
MuonPFIsolation pfIsolationR03_
PF Isolation information for two cones with dR=0.3 and dR=0.4.
Definition: Muon.h:261
std::pair< const MuonChamberMatch *, const MuonSegmentMatch * > pair(const std::vector< const MuonChamberMatch * > &, ArbitrationType type=SegmentAndTrackArbitration) const
get pointers to best segment and corresponding chamber in vector of chambers
float segmentDxDzErr(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
bool isStandAloneMuon() const
Definition: Muon.h:220
void setCalEnergy(const MuonEnergy &calEnergy)
set energy deposition information
Definition: Muon.h:113
const MuonIsolation & isolationR05() const
Definition: Muon.h:159
reco::Candidate::LorentzVector pfP4() const
Definition: Muon.h:102
virtual TrackRef tpfmsTrack() const
Definition: Muon.h:57
MuonTime time() const
get timing information
Definition: Muon.h:131
static std::string const input
Definition: EdmProvDump.cc:43
bool isCaloMuon() const
Definition: Muon.h:221
virtual reco::TrackRef track() const
reference to a Track
virtual void setTunePBestTrack(MuonTrackType muonType)
Definition: Muon.h:93
float segmentYErr(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
float trackEdgeX(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
virtual void setInnerTrack(const TrackRef &t)
set reference to Track
bool isRPCMuon() const
Definition: Muon.h:223
virtual const Track * bestTrack() const
best track pointer
Definition: Muon.h:61
int numberOfChambersNoRPC() const
number of chambers not including RPC matches (MuonChamberMatches include RPC rolls) ...
MuonTrackRefMap refittedTrackMap_
reference to the Global Track refitted with dedicated TeV reconstructors
Definition: Muon.h:235
virtual void setStandAlone(const TrackRef &t)
float trackDistErr(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
float dY(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
virtual bool overlap(const Candidate &) const
check overlap with another candidate
virtual TrackRef muonBestTrack() const
Definition: Muon.h:63
TrackRef innerTrack_
reference to Track reconstructed in the tracker only
Definition: Muon.h:229
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
Definition: TrackFwd.h:32
void setCaloCompatibility(float input)
Definition: Muon.h:151
virtual void setCombined(const TrackRef &t)
const MuonPFIsolation & pfIsolationR03() const
Definition: Muon.h:161
ArbitrationType
define arbitration schemes
Definition: Muon.h:178
float pullDxDz(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration, bool includeSegmentError=true) const
TrackRef muonTrack(const MuonTrackType &) const
float segmentY(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
bool isPFIsolationValid() const
Definition: Muon.h:174
unsigned int stationGapMaskDistance(float distanceCut=10.) const
MuonQuality combinedQuality() const
get energy deposition information
Definition: Muon.h:121
float segmentDyDz(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
int nDof
number of muon stations used
Definition: MuonTime.h:10
MuonPFIsolation pfIsoSumDRR04_
Definition: Muon.h:266
const std::vector< MuonChamberMatch > & matches() const
Definition: Muon.h:141
MuonTrackType bestTrackType_
reference to the Track chosen to assign the momentum value to the muon
Definition: Muon.h:237
float trackEdgeY(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
virtual TrackRef pickyTrack() const
Definition: Muon.h:58
void setPFIsolation(const std::string &label, const reco::MuonPFIsolation &deposit)
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:244
bool isQualityValid() const
Definition: Muon.h:119
MuonQuality combinedQuality_
quality block
Definition: Muon.h:244
bool energyValid_
Definition: Muon.h:249
float dX(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
float pullY(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration, bool includeSegmentError=true) const
bool isMuon() const
Definition: Muon.h:217
void setTime(const MuonTime &time)
set timing information
Definition: Muon.h:133
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
Definition: Muon.h:51
float trackDyDz(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
void setMuonTrack(const MuonTrackType &, const TrackRef &)
bool isEnergyValid() const
Definition: Muon.h:109
unsigned int stationMask(ArbitrationType type=SegmentAndTrackArbitration) const
int numberOfMatchedStations(ArbitrationType type=SegmentAndTrackArbitration) const
MuonEnergy calEnergy() const
get energy deposition information
Definition: Muon.h:111
const std::vector< const MuonChamberMatch * > chambers(int station, int muonSubdetId) const
get vector of muon chambers for given station and detector
float trackYErr(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
static const unsigned int RPCMuon
Definition: Muon.h:212
float trackXErr(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
float trackDyDzErr(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
bool isAValidMuonTrack(const MuonTrackType &type) const
float segmentDyDzErr(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
bool isTimeValid() const
Definition: Muon.h:129
virtual TrackRef combinedMuon() const
reference to a stand-alone muon Track
Definition: Muon.h:55
static const unsigned int TrackerMuon
Definition: Muon.h:208
float trackX(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
float trackDxDz(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
int numberOfChambers() const
Definition: Muon.h:184
const MuonPFIsolation & pfIsolationR04() const
Definition: Muon.h:164
const MuonPFIsolation & pfSumDRIsoProfileR03() const
Definition: Muon.h:163
std::map< MuonTrackType, reco::TrackRef > MuonTrackRefMap
Definition: Muon.h:39
bool pfIsolationValid_
Definition: Muon.h:252
void setCombinedQuality(const MuonQuality &combinedQuality)
set energy deposition information
Definition: Muon.h:123
static const unsigned int PFMuon
Definition: Muon.h:211
MuonIsolation isolationR03_
Isolation information for two cones with dR=0.3 and dR=0.5.
Definition: Muon.h:257
std::vector< MuonChamberMatch > & matches()
get muon matching information
Definition: Muon.h:140
bool qualityValid_
Definition: Muon.h:253
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
float t0(int n=0)
Definition: Muon.h:322
TrackRef outerTrack_
reference to Track reconstructed in the muon detector only
Definition: Muon.h:231
virtual TrackRef dytTrack() const
Definition: Muon.h:59
std::vector< MuonChamberMatch > muMatches_
Information on matching between tracks and segments.
Definition: Muon.h:246
virtual void setOuterTrack(const TrackRef &t)
set reference to Track
virtual MuonTrackType tunePMuonBestTrackType() const
Definition: Muon.h:66
float pullDyDz(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration, bool includeSegmentError=true) const
static const unsigned int CaloMuon
Definition: Muon.h:210
void setIsolation(const MuonIsolation &isoR03, const MuonIsolation &isoR05)
virtual void setBestTrack(MuonTrackType muonType)
Definition: Muon.h:91
virtual void setTrack(const TrackRef &t)
float segmentDxDz(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
MuonTime time_
timing
Definition: Muon.h:248
float trackDxDzErr(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
float trackDist(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
float segmentXErr(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
unsigned int type() const
Definition: Muon.h:215
bool isPFMuon() const
Definition: Muon.h:222
virtual void setPFP4(const reco::Candidate::LorentzVector &p4_)
math::XYZPoint Point
point in the space
Definition: Candidate.h:41
virtual TrackRef tunePMuonBestTrack() const
Definition: Muon.h:65
bool matchesValid_
Definition: Muon.h:250
TrackRef globalTrack_
reference to Track reconstructed in both tracked and muon detector
Definition: Muon.h:233
MuonTrackType bestTunePTrackType_
reference to the Track chosen to assign the momentum value to the muon by PF
Definition: Muon.h:239
MuonTrackType
map for Global Muon refitters
Definition: Muon.h:38
const MuonPFIsolation & pfMeanDRIsoProfileR03() const
Definition: Muon.h:162
static const unsigned int StandAloneMuon
Definition: Muon.h:209
float dDxDz(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration) const
unsigned int RPClayerMask(ArbitrationType type=RPCHitAndTrackArbitration) const
MuonTrackType
Definition: MuonTrackType.h:27
std::pair< TrackRef, Muon::MuonTrackType > MuonTrackTypePair
Definition: Muon.h:40
void setMatches(const std::vector< MuonChamberMatch > &matches)
set muon matching information
Definition: Muon.h:143
bool isIsolationValid() const
Definition: Muon.h:170
MuonPFIsolation pfIsoMeanDRR03_
Definition: Muon.h:262
Muon * clone() const
create a clone
virtual void setGlobalTrack(const TrackRef &t)
set reference to Track
float caloCompatibility() const
Definition: Muon.h:150
virtual TrackBaseRef bestTrackRef() const
best track RefToBase
Definition: Muon.h:62
const MuonIsolation & isolationR03() const
Definition: Muon.h:158
TrackRef muonTrackFromMap(const MuonTrackType &type) const
Definition: Muon.h:73
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:27
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
Definition: Muon.h:54
float pullX(int station, int muonSubdetId, ArbitrationType type=SegmentAndTrackArbitration, bool includeSegmentError=true) const
virtual TrackRef standAloneMuon() const
reference to a stand-alone muon Track
Definition: Muon.h:52