CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/AnalysisDataFormats/SUSYBSMObjects/src/HSCParticle.cc

Go to the documentation of this file.
00001 #include "AnalysisDataFormats/SUSYBSMObjects/interface/HSCParticle.h"
00002 
00003 namespace susybsm {
00004 
00005 int HSCParticle::type() const {
00006    if      ( hasTrackRef() && !hasMuonRef()){                               return HSCParticleType::innerTrack;
00007    }else if(!hasTrackRef() &&  hasMuonRef()){                               return HSCParticleType::standAloneMuon;
00008    }else if( hasTrackRef() &&  hasMuonRef() && muonRef()->isGlobalMuon()){ return HSCParticleType::globalMuon;
00009    }else if( hasTrackRef() &&  hasMuonRef() && muonRef()->isStandAloneMuon()){ return HSCParticleType::matchedStandAloneMuon;
00010    }else if( hasTrackRef() &&  hasMuonRef() && muonRef()->isTrackerMuon()){ return HSCParticleType::trackerMuon;
00011    }else                                                                    return HSCParticleType::unknown;
00012 }
00013 
00014 float HSCParticle::p() const {
00015   if(      hasMuonRef() && muonRef()->combinedMuon()  .isNonnull()){ return muonRef()->combinedMuon()  ->p();
00016   }else if(hasMuonRef() && muonRef()->innerTrack()    .isNonnull()){ return muonRef()->innerTrack()    ->p();
00017   }else if(hasMuonRef() && muonRef()->standAloneMuon().isNonnull()){ return muonRef()->standAloneMuon()->p();
00018   }else if(hasTrackRef()&& trackRef()                 .isNonnull()){ return trackRef()                 ->p();
00019   }else return 0.0f;
00020 }
00021 
00022 float HSCParticle::pt() const {
00023   if(      hasMuonRef() && muonRef()->combinedMuon()  .isNonnull()){ return muonRef()->combinedMuon()  ->pt();
00024   }else if(hasMuonRef() && muonRef()->innerTrack()    .isNonnull()){ return muonRef()->innerTrack()    ->pt();
00025   }else if(hasMuonRef() && muonRef()->standAloneMuon().isNonnull()){ return muonRef()->standAloneMuon()->pt();
00026   }else if(hasTrackRef()&& trackRef()                 .isNonnull()){ return trackRef()                 ->pt();
00027   }else return 0.0f;
00028 }
00029 
00030 }