Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:46:21

0001 #include "AnalysisDataFormats/SUSYBSMObjects/interface/HSCParticle.h"
0002 
0003 namespace susybsm {
0004 
0005   int HSCParticle::type() const {
0006     if (hasTrackRef() && !hasMuonRef()) {
0007       return HSCParticleType::innerTrack;
0008     } else if (!hasTrackRef() && hasMuonRef()) {
0009       return HSCParticleType::standAloneMuon;
0010     } else if (hasTrackRef() && hasMuonRef() && muonRef()->isGlobalMuon()) {
0011       return HSCParticleType::globalMuon;
0012     } else if (hasTrackRef() && hasMuonRef() && muonRef()->isStandAloneMuon()) {
0013       return HSCParticleType::matchedStandAloneMuon;
0014     } else if (hasTrackRef() && hasMuonRef() && muonRef()->isTrackerMuon()) {
0015       return HSCParticleType::trackerMuon;
0016     } else
0017       return HSCParticleType::unknown;
0018   }
0019 
0020   float HSCParticle::p() const {
0021     if (hasMuonRef() && muonRef()->combinedMuon().isNonnull()) {
0022       return muonRef()->combinedMuon()->p();
0023     } else if (hasMuonRef() && muonRef()->innerTrack().isNonnull()) {
0024       return muonRef()->innerTrack()->p();
0025     } else if (hasMuonRef() && muonRef()->standAloneMuon().isNonnull()) {
0026       return muonRef()->standAloneMuon()->p();
0027     } else if (hasTrackRef() && trackRef().isNonnull()) {
0028       return trackRef()->p();
0029     } else
0030       return 0.0f;
0031   }
0032 
0033   float HSCParticle::pt() const {
0034     if (hasMuonRef() && muonRef()->combinedMuon().isNonnull()) {
0035       return muonRef()->combinedMuon()->pt();
0036     } else if (hasMuonRef() && muonRef()->innerTrack().isNonnull()) {
0037       return muonRef()->innerTrack()->pt();
0038     } else if (hasMuonRef() && muonRef()->standAloneMuon().isNonnull()) {
0039       return muonRef()->standAloneMuon()->pt();
0040     } else if (hasTrackRef() && trackRef().isNonnull()) {
0041       return trackRef()->pt();
0042     } else
0043       return 0.0f;
0044   }
0045 
0046 }  // namespace susybsm