17 auto qualNames = para.
getParameter<std::vector<std::string> >(
"allowedQualities");
18 auto algoNames = para.
getParameter<std::vector<std::string> >(
"algosToReject");
20 for(
auto& qualName : qualNames){
33 desc.
add<
double>(
"minPt",1.0);
34 desc.
add<
double>(
"maxDR",0.3);
35 desc.
add<
double>(
"minDR",0.000);
36 desc.
add<
double>(
"minDEta",0.005);
37 desc.
add<
double>(
"maxDZ",0.1);
38 desc.
add<
double>(
"maxDPtPt",-1);
39 desc.
add<
int>(
"minHits",8);
40 desc.
add<
int>(
"minPixelHits",1);
41 desc.
add<std::vector<std::string> >(
"allowedQualities");
42 desc.
add<std::vector<std::string> >(
"algosToReject");
81 for(
auto&
cand : cands){
90 return {nrTrks,ptSum};
102 std::pair<int,double>
112 for(
auto& trk : tracks){
118 return {nrTrks,ptSum};
128 if(pidAbs==11)
return false;
131 if(pidAbs==11)
return true;
135 "invalid PIDVeto "<<
static_cast<int>(
veto)<<
", "<<
136 "this is likely due to some static casting of invalid ints somewhere";
145 throw cms::Exception(
"CodeError") <<
"unrecognised string "<<vetoStr<<
", either a typo or this function needs to be updated";
151 const double eleEta,
const double elePhi,
155 const float dEta = trk.
eta()-eleEta;
156 const float dZ = eleVZ - trk.
vz();
173 const std::vector<reco::TrackBase::TrackQuality>& quals)
175 if(quals.empty())
return true;
177 for(
auto qual : quals) {
178 if(trk.
quality(qual))
return true;
186 const std::vector<reco::TrackBase::TrackAlgorithm>& algosToRej)
188 return algosToRej.empty() || !std::binary_search(algosToRej.begin(),algosToRej.end(),trk.
algo());
T getParameter(std::string const &) const
TrkCuts(const edm::ParameterSet ¶)
int numberOfValidHits() const
static edm::ParameterSetDescription pSetDescript()
std::vector< pat::PackedCandidate > PackedCandidateCollection
std::vector< Track > TrackCollection
collection of Tracks
double phi() const
azimuthal angle of momentum vector
static bool passAlgo(const reco::TrackBase &trk, const std::vector< reco::TrackBase::TrackAlgorithm > &algosToRej)
std::vector< reco::TrackBase::TrackQuality > allowedQualities
TrackAlgorithm algo() const
double eta() const
pseudorapidity of momentum vector
std::vector< reco::TrackBase::TrackAlgorithm > algosToReject
double pt() const
track transverse momentum
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Abs< T >::type abs(const T &t)
static edm::ParameterSetDescription pSetDescript()
std::pair< int, double > calIsol(const reco::TrackBase &trk, const pat::PackedCandidateCollection &cands, const PIDVeto=PIDVeto::NONE) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static bool passQual(const reco::TrackBase &trk, const std::vector< reco::TrackBase::TrackQuality > &quals)
double vz() const
z coordinate of the reference point on track
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
static TrackQuality qualityByName(const std::string &name)
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
static PIDVeto pidVetoFromStr(const std::string &vetoStr)
bool quality(const TrackQuality) const
Track quality.
static TrackAlgorithm algoByName(const std::string &name)
int numberOfValidPixelHits() const
static bool passTrkSel(const reco::TrackBase &trk, const double trkPt, const TrkCuts &cuts, const double eleEta, const double elePhi, const double eleVZ)
EleTkIsolFromCands(const edm::ParameterSet ¶)
static bool passPIDVeto(const int pdgId, const EleTkIsolFromCands::PIDVeto pidVeto)