test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HSCParticle.cc
Go to the documentation of this file.
2 
3 namespace susybsm {
4 
5 int HSCParticle::type() const {
8  }else if( hasTrackRef() && hasMuonRef() && muonRef()->isGlobalMuon()){ return HSCParticleType::globalMuon;
9  }else if( hasTrackRef() && hasMuonRef() && muonRef()->isStandAloneMuon()){ return HSCParticleType::matchedStandAloneMuon;
10  }else if( hasTrackRef() && hasMuonRef() && muonRef()->isTrackerMuon()){ return HSCParticleType::trackerMuon;
11  }else return HSCParticleType::unknown;
12 }
13 
14 float HSCParticle::p() const {
15  if( hasMuonRef() && muonRef()->combinedMuon() .isNonnull()){ return muonRef()->combinedMuon() ->p();
16  }else if(hasMuonRef() && muonRef()->innerTrack() .isNonnull()){ return muonRef()->innerTrack() ->p();
17  }else if(hasMuonRef() && muonRef()->standAloneMuon().isNonnull()){ return muonRef()->standAloneMuon()->p();
18  }else if(hasTrackRef()&& trackRef() .isNonnull()){ return trackRef() ->p();
19  }else return 0.0f;
20 }
21 
22 float HSCParticle::pt() const {
23  if( hasMuonRef() && muonRef()->combinedMuon() .isNonnull()){ return muonRef()->combinedMuon() ->pt();
24  }else if(hasMuonRef() && muonRef()->innerTrack() .isNonnull()){ return muonRef()->innerTrack() ->pt();
25  }else if(hasMuonRef() && muonRef()->standAloneMuon().isNonnull()){ return muonRef()->standAloneMuon()->pt();
26  }else if(hasTrackRef()&& trackRef() .isNonnull()){ return trackRef() ->pt();
27  }else return 0.0f;
28 }
29 
30 }
bool hasTrackRef() const
Definition: HSCParticle.h:57
reco::MuonRef muonRef() const
Definition: HSCParticle.h:74
int type() const
Definition: HSCParticle.cc:5
reco::TrackRef trackRef() const
Definition: HSCParticle.h:72
float p() const
Definition: HSCParticle.cc:14
bool hasMuonRef() const
Definition: HSCParticle.h:55
float pt() const
Definition: HSCParticle.cc:22