CMS 3D CMS Logo

Functions
reco::tau::qcuts Namespace Reference

Functions

bool minPackedCandVertexWeight (const pat::PackedCandidate &pCand, const reco::VertexRef *pv, double cut)
 

Function Documentation

◆ minPackedCandVertexWeight()

bool reco::tau::qcuts::minPackedCandVertexWeight ( const pat::PackedCandidate pCand,
const reco::VertexRef pv,
double  cut 
)

Definition at line 55 of file RecoTauQualityCuts.cc.

55  {
56  if (pv->isNull()) {
57  edm::LogError("QCutsNoPrimaryVertex") << "Primary vertex Ref in "
58  << "RecoTauQualityCuts is invalid. - minPackedCandVertexWeight";
59  return false;
60  }
61  //there is some low granular information on track weight in the vertex available with packed cands
62  double weight = -9.9;
63  if (pCand.vertexRef().isNonnull() && pCand.vertexRef().key() == pv->key()) {
64  int quality = pCand.pvAssociationQuality();
66  weight = 0.6; //0.6 as proxy for weight above 0.5
68  weight = 0.1; //0.6 as proxy for weight below 0.5
69  }
70  LogDebug("TauQCuts") << " packedCand: Pt = " << pCand.pt() << ", eta = " << pCand.eta()
71  << ", phi = " << pCand.phi();
72  LogDebug("TauQCuts") << " vertex: x = " << (*pv)->position().x() << ", y = " << (*pv)->position().y()
73  << ", z = " << (*pv)->position().z();
74  LogDebug("TauQCuts") << "--> trackWeight from packedCand = " << weight << " (cut = " << cut << ")";
75  return (weight >= cut);
76  }

References PA_MinBiasSkim_cff::cut, pat::PackedCandidate::eta(), edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), LogDebug, pat::PackedCandidate::phi(), pat::PackedCandidate::pt(), MetAnalyzer::pv(), pat::PackedCandidate::pvAssociationQuality(), quality, pat::PackedCandidate::UsedInFitLoose, pat::PackedCandidate::UsedInFitTight, and pat::PackedCandidate::vertexRef().

Referenced by reco::tau::RecoTauQualityCuts::filterChargedCand().

pat::PackedCandidate::vertexRef
const reco::VertexRef vertexRef() const
Definition: PackedCandidate.h:738
pat::PackedCandidate::pvAssociationQuality
const PVAssociationQuality pvAssociationQuality() const
Definition: PackedCandidate.h:730
pat::PackedCandidate::UsedInFitLoose
Definition: PackedCandidate.h:727
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:122
pat::PackedCandidate::pt
double pt() const override
transverse momentum
Definition: PackedCandidate.h:523
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
pat::PackedCandidate::phi
double phi() const override
momentum azimuthal angle
Definition: PackedCandidate.h:529
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
PA_MinBiasSkim_cff.cut
cut
Definition: PA_MinBiasSkim_cff.py:13
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
pat::PackedCandidate::UsedInFitTight
Definition: PackedCandidate.h:728
weight
Definition: weight.py:1
pat::PackedCandidate::eta
double eta() const override
momentum pseudorapidity
Definition: PackedCandidate.h:563