CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
reco::tau::qcuts Namespace Reference

Functions

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

Function Documentation

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

Definition at line 55 of file RecoTauQualityCuts.cc.

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

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
67  else if (quality == pat::PackedCandidate::UsedInFitLoose)
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
uint32_t const *__restrict__ Quality * quality
key_type key() const
Accessor for product key.
Definition: Ref.h:250
Log< level::Error, false > LogError
const reco::VertexRef vertexRef() const
double eta() const override
momentum pseudorapidity
const PVAssociationQuality pvAssociationQuality() const
bool isNull() const
Checks for null.
Definition: Ref.h:235
double pt() const override
transverse momentum
int weight
Definition: histoStyle.py:51
double phi() const override
momentum azimuthal angle
#define LogDebug(id)