Go to the documentation of this file.00001 #include "SUSYBSMAnalysis/HSCP/interface/CandidateSelector.h"
00002
00003 using namespace edm;
00004 using namespace reco;
00005 using namespace susybsm;
00006
00007
00008
00009
00010 CandidateSelector::CandidateSelector(const edm::ParameterSet& iConfig){
00011 isTrack = iConfig.getParameter<bool> ("onlyConsiderTrack");
00012 isMuon = iConfig.getParameter<bool> ("onlyConsiderMuon");
00013 isMuonSTA = iConfig.getParameter<bool> ("onlyConsiderMuonSTA");
00014 isMuonGB = iConfig.getParameter<bool> ("onlyConsiderMuonGB");
00015 isMuonTK = iConfig.getParameter<bool> ("onlyConsiderMuonTK");
00016 isRpc = iConfig.getParameter<bool> ("onlyConsiderRpc");
00017 isEcal = iConfig.getParameter<bool> ("onlyConsiderEcal");
00018
00019 minTrackHits = iConfig.getParameter<int> ("minTrackHits");
00020 minTrackP = iConfig.getParameter<double> ("minTrackP");
00021 minTrackPt = iConfig.getParameter<double> ("minTrackPt");
00022
00023 minDedx = iConfig.getParameter<double> ("minDedx");
00024
00025 minMuonP = iConfig.getParameter<double> ("minMuonP");
00026 minMuonPt = iConfig.getParameter<double> ("minMuonPt");
00027
00028 maxMuTimeDtBeta = iConfig.getParameter<double> ("maxMuTimeDtBeta");
00029 minMuTimeDtNdof = iConfig.getParameter<double> ("minMuTimeDtNdof");
00030 maxMuTimeCscBeta = iConfig.getParameter<double> ("maxMuTimeCscBeta");
00031 minMuTimeCscNdof = iConfig.getParameter<double> ("minMuTimeCscNdof");
00032 maxMuTimeCombinedBeta = iConfig.getParameter<double> ("maxMuTimeCombinedBeta");
00033 minMuTimeCombinedNdof = iConfig.getParameter<double> ("minMuTimeCombinedNdof");
00034
00035 maxBetaRpc = iConfig.getParameter<double> ("maxBetaRpc");
00036 maxBetaEcal = iConfig.getParameter<double> ("maxBetaEcal");
00037 }
00038
00039
00040 bool CandidateSelector::isSelected(HSCParticle& candidate)
00041 {
00042 if(isTrack && !candidate.hasTrackRef()){return false;}
00043 if(isMuon && !candidate.hasMuonRef() ){return false;}
00044 if(isMuonSTA && (!candidate.hasMuonRef() || candidate.muonRef()->standAloneMuon().isNull()) ){return false;}
00045 if(isMuonGB && (!candidate.hasMuonRef() || candidate.muonRef()->combinedMuon ().isNull()) ){return false;}
00046 if(isMuonTK && (!candidate.hasMuonRef() || candidate.muonRef()->innerTrack ().isNull()) ){return false;}
00047 if(isRpc && !candidate.hasRpcInfo() ){return false;}
00048 if(isEcal && !candidate.hasCaloInfo()){return false;}
00049
00050 if(candidate.hasTrackRef()){
00051 if(candidate.trackRef()->found() < minTrackHits){return false;}
00052 if(candidate.trackRef()->p() < minTrackP ){return false;}
00053 if(candidate.trackRef()->pt() < minTrackPt ){return false;}
00054
00055
00056
00057
00058 }
00059
00060 if(candidate.hasMuonRef()){
00061 if(candidate.muonRef()->p() < minMuonP ){return false;}
00062 if(candidate.muonRef()->pt() < minMuonPt ){return false;}
00063
00064
00065
00066
00067
00068
00069
00070
00071 }
00072
00073 if(candidate.hasRpcInfo() && maxBetaRpc>=0 && candidate.rpc ().beta > maxBetaRpc ){return false;}
00074
00075
00076
00077
00078 return true;
00079 }
00080