|
|
Go to the documentation of this file.
7 auto sq = [](
double val) {
return val *
val; };
16 auto qualNames = para.
getParameter<std::vector<std::string> >(
"allowedQualities");
17 auto algoNames = para.
getParameter<std::vector<std::string> >(
"algosToReject");
19 for (
auto& qualName : qualNames) {
30 desc.
add<
double>(
"minPt", 1.0);
31 desc.
add<
double>(
"maxDR", 0.3);
32 desc.
add<
double>(
"minDR", 0.000);
33 desc.
add<
double>(
"minDEta", 0.005);
34 desc.
add<
double>(
"maxDZ", 0.1);
35 desc.
add<
double>(
"maxDPtPt", -1);
36 desc.
add<
int>(
"minHits", 8);
37 desc.
add<
int>(
"minPixelHits", 1);
38 desc.
add<std::vector<std::string> >(
"allowedQualities");
39 desc.
add<std::vector<std::string> >(
"algosToReject");
79 return {nrTrks, ptSum};
102 return {nrTrks, ptSum};
121 throw cms::Exception(
"CodeError") <<
"invalid PIDVeto " << static_cast<int>(
veto) <<
", "
122 <<
"this is likely due to some static casting of invalid ints somewhere";
126 if (vetoStr ==
"NONE")
128 else if (vetoStr ==
"ELES")
130 else if (vetoStr ==
"NONELES")
133 throw cms::Exception(
"CodeError") <<
"unrecognised string " << vetoStr
134 <<
", either a typo or this function needs to be updated";
143 const double eleVZ) {
145 const float dEta = trk.
eta() - eleEta;
146 const float dZ = eleVZ - trk.
vz();
159 for (
auto qual : quals) {
168 const std::vector<reco::TrackBase::TrackAlgorithm>& algosToRej) {
169 return algosToRej.empty() || !std::binary_search(algosToRej.begin(), algosToRej.end(), trk.
algo());
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
static bool passPIDVeto(const int pdgId, const EleTkIsolFromCands::PIDVeto pidVeto)
std::vector< reco::TrackBase::TrackQuality > allowedQualities
static PIDVeto pidVetoFromStr(const std::string &vetoStr)
static edm::ParameterSetDescription pSetDescript()
std::pair< int, double > calIsol(const reco::TrackBase &trk, const pat::PackedCandidateCollection &cands, const PIDVeto=PIDVeto::NONE) const
double pt() const
track transverse momentum
TrkCuts(const edm::ParameterSet ¶)
double vz() const
z coordinate of the reference point on track
double phi() const
azimuthal angle of momentum vector
static bool passQual(const reco::TrackBase &trk, const std::vector< reco::TrackBase::TrackQuality > &quals)
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
double eta() const
pseudorapidity of momentum vector
static bool passAlgo(const reco::TrackBase &trk, const std::vector< reco::TrackBase::TrackAlgorithm > &algosToRej)
static edm::ParameterSetDescription pSetDescript()
std::vector< pat::PackedCandidate > PackedCandidateCollection
TrackAlgorithm algo() const
static TrackQuality qualityByName(const std::string &name)
T getParameter(std::string const &) const
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
static bool passTrkSel(const reco::TrackBase &trk, const double trkPt, const TrkCuts &cuts, const double eleEta, const double elePhi, const double eleVZ)
std::vector< reco::TrackBase::TrackAlgorithm > algosToReject
EleTkIsolFromCands(const edm::ParameterSet ¶)
int numberOfValidPixelHits() const
static TrackAlgorithm algoByName(const std::string &name)
Abs< T >::type abs(const T &t)
int numberOfValidHits() const
bool quality(const TrackQuality) const
Track quality.
std::vector< Track > TrackCollection
collection of Tracks