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.

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

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

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  }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
Definition: weight.py:1
Log< level::Error, false > LogError
const reco::VertexRef vertexRef() const
key_type key() const
Accessor for product key.
Definition: Ref.h:250
const PVAssociationQuality pvAssociationQuality() const
string quality
double eta() const override
momentum pseudorapidity
double pt() const override
transverse momentum
double phi() const override
momentum azimuthal angle
#define LogDebug(id)