18 auto qualNames = para.
getParameter<std::vector<std::string> >(
"allowedQualities");
19 auto algoNames = para.
getParameter<std::vector<std::string> >(
"algosToReject");
21 for(
auto& qualName : qualNames){
24 for(
auto& algoName : algoNames){
34 desc.
add<
double>(
"minPt",1.0);
35 desc.
add<
double>(
"maxDR",0.3);
36 desc.
add<
double>(
"minDR",0.000);
37 desc.
add<
double>(
"minDEta",0.005);
38 desc.
add<
double>(
"maxDZ",0.1);
39 desc.
add<
double>(
"maxDPtPt",-1);
40 desc.
add<
int>(
"minHits",8);
41 desc.
add<
int>(
"minPixelHits",1);
42 desc.
add<std::vector<std::string> >(
"allowedQualities");
43 desc.
add<std::vector<std::string> >(
"algosToReject");
83 for(
auto& cand : cands){
87 if(
passTrkSel(trk,trkPt,cuts,eleEta,elePhi,eleVZ)){
93 return {nrTrks,ptSum};
99 const double eleEta,
const double elePhi,
103 const float dEta = trk.
eta()-eleEta;
104 const float dZ = eleVZ - trk.
vz();
121 const std::vector<reco::TrackBase::TrackQuality>& quals)
123 if(quals.empty())
return true;
125 for(
auto qual : quals) {
126 if(trk.
quality(qual))
return true;
134 const std::vector<reco::TrackBase::TrackAlgorithm>& algosToRej)
136 return algosToRej.empty() || !std::binary_search(algosToRej.begin(),algosToRej.end(),trk.
algo());
149 return std::abs(trk.
eta()-ele.gsfTrack()->eta())<0.001 &&
152 for(
auto& ele : eles){
153 if(ele.gsfTrack().isNonnull()){
155 return ele.gsfTrack()->pt();
T getParameter(std::string const &) const
TrkCuts(const edm::ParameterSet ¶)
static bool passTrkSel(const reco::Track &trk, const double trkPt, const TrkCuts &cuts, const double eleEta, const double elePhi, const double eleVZ)
std::pair< int, double > calIsol(const reco::TrackBase &trk, const pat::PackedCandidateCollection &cands, const edm::View< reco::GsfElectron > &eles)
int numberOfValidHits() const
static edm::ParameterSetDescription pSetDescript()
std::vector< pat::PackedCandidate > PackedCandidateCollection
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()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static bool passQual(const reco::TrackBase &trk, const std::vector< reco::TrackBase::TrackQuality > &quals)
double deltaPhi(double phi1, double phi2)
double vz() const
z coordinate of the reference point on track
static TrackQuality qualityByName(const std::string &name)
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
bool quality(const TrackQuality) const
Track quality.
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
static TrackAlgorithm algoByName(const std::string &name)
int numberOfValidPixelHits() const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
EleTkIsolFromCands(const edm::ParameterSet ¶)
double getTrkPt(const reco::TrackBase &trk, const edm::View< reco::GsfElectron > &eles)