CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Attributes
pat::VertexAssociationSelector Class Reference

#include <VertexAssociationSelector.h>

Classes

struct  Config
 

Public Member Functions

bool operator() (const pat::VertexAssociation &vass) const
 check if this VertexAssociation is ok More...
 
bool operator() (const reco::Candidate &c, const reco::Vertex &) const
 
pat::VertexAssociation simpleAssociation (const reco::Candidate &c, const reco::VertexRef &vtx) const
 
 VertexAssociationSelector ()
 an empty constructor is sometimes needed More...
 
 VertexAssociationSelector (const Config &conf)
 constructor from a configuration More...
 

Private Attributes

Config conf_
 

Detailed Description

Definition at line 9 of file VertexAssociationSelector.h.

Constructor & Destructor Documentation

◆ VertexAssociationSelector() [1/2]

pat::VertexAssociationSelector::VertexAssociationSelector ( )
inline

an empty constructor is sometimes needed

Definition at line 41 of file VertexAssociationSelector.h.

41 {}

◆ VertexAssociationSelector() [2/2]

pat::VertexAssociationSelector::VertexAssociationSelector ( const Config conf)

constructor from a configuration

Definition at line 6 of file VertexAssociationSelector.cc.

6 : conf_(conf) {}

Member Function Documentation

◆ operator()() [1/2]

bool pat::VertexAssociationSelector::operator() ( const pat::VertexAssociation vass) const

check if this VertexAssociation is ok

Definition at line 48 of file VertexAssociationSelector.cc.

48  {
49  if (vass.isNull())
50  return false;
51  if ((conf_.dZ > 0) && (vass.dz().value() > conf_.dZ))
52  return false;
53  if ((conf_.sigmasZ > 0) && (vass.dz().significance() > conf_.sigmasZ))
54  return false;
55  if ((conf_.dZ > 0) && (vass.dr().value() > conf_.dR))
56  return false;
57  if ((conf_.sigmasZ > 0) && (vass.dr().significance() > conf_.sigmasR))
58  return false;
59  // if ((conf_.sigmas3d > 0) && ( vass.signif3d() > conf_.sigmas3d)) return false;
60  return true;
61 }

References pat::VertexAssociation::dr(), pat::VertexAssociation::dz(), pat::VertexAssociation::isNull(), Measurement1DFloat::significance(), and Measurement1DFloat::value().

◆ operator()() [2/2]

bool pat::VertexAssociationSelector::operator() ( const reco::Candidate c,
const reco::Vertex vtx 
) const

check if this candidate and this vertex are compatible this will just use the basic candidate vertex position, without any fancy track extrapolation.

Definition at line 15 of file VertexAssociationSelector.cc.

15  {
16  using std::abs;
17  using std::sqrt;
18 
19  if ((conf_.dZ > 0) && !(std::abs(c.vz() - vtx.z()) > conf_.dZ))
20  return false;
21  if ((conf_.sigmasZ > 0) && !(std::abs(c.vz() - vtx.z()) > conf_.sigmasZ * vtx.zError()))
22  return false;
23  if ((conf_.dR > 0) && !((c.vertex() - vtx.position()).Rho() > conf_.dR))
24  return false;
25  if (conf_.sigmasR > 0) {
26  // D = sqrt( DZ^2 + DY^2) => sigma^2(D) = d D/d X_i * cov(X_i, X_j) * d D/d X_j =>
27  // d D / d X_i = DX_i / D
28  // D > sigmaR * sigma(D) if and only if D^4 > sigmaR^2 * DX_i DX_j cov(X_i,X_j)
29  AlgebraicVector3 dist(c.vx() - vtx.x(), c.vy() - vtx.y(), 0);
30  double D2 = dist[0] * dist[0] + dist[1] * dist[1];
31  double DcovD = ROOT::Math::Similarity(dist, vtx.error());
32  if (D2 * D2 > DcovD * (conf_.sigmasR * conf_.sigmasR))
33  return false;
34  }
35  /*
36  if (conf_.sigmas3d > 0) {
37  // same as above, but 3D
38  AlgebraicVector3 dist(c.vx() - vtx.x(), c.vy() - vtx.y(), c.vz() - vtx.z());
39  double D2 = dist[0]*dist[0] + dist[1]*dist[1] + dist[2]*dist[2];
40  double DcovD = ROOT::Math::Similarity(dist, vtx.error());
41  if ( D2*D2 > DcovD * (conf_.sigmas3d*conf_.sigmas3d) ) return false;
42  }
43  */
44 
45  return true;
46 }

References funct::abs(), HltBtagPostValidation_cff::c, mathSSE::sqrt(), and badGlobalMuonTaggersAOD_cff::vtx.

◆ simpleAssociation()

pat::VertexAssociation pat::VertexAssociationSelector::simpleAssociation ( const reco::Candidate c,
const reco::VertexRef vtx 
) const

Definition at line 8 of file VertexAssociationSelector.cc.

9  {
11  ret.setDistances(c.vertex(), vtx->position(), vtx->error());
12  return ret;
13 }

References HltBtagPostValidation_cff::c, runTheMatrix::ret, and badGlobalMuonTaggersAOD_cff::vtx.

Member Data Documentation

◆ conf_

Config pat::VertexAssociationSelector::conf_
private

Definition at line 62 of file VertexAssociationSelector.h.

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
pat::VertexAssociation::dz
const Measurement1DFloat & dz() const
Definition: Vertexing.h:60
pat::VertexAssociationSelector::Config::sigmasR
float sigmasR
Definition: VertexAssociationSelector.h:17
AlgebraicVector3
ROOT::Math::SVector< double, 3 > AlgebraicVector3
Definition: AlgebraicROOTObjects.h:12
funct::D2
Divides< B, C > D2
Definition: Factorize.h:137
pat::VertexAssociationSelector::Config::sigmasZ
float sigmasZ
Definition: VertexAssociationSelector.h:17
pat::VertexAssociation::dr
const Measurement1DFloat & dr() const
Distance between the object and the vertex in the transverse plane, and it's error.
Definition: Vertexing.h:62
Measurement1DFloat::value
float value() const
Definition: Measurement1DFloat.h:23
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
pat::VertexAssociationSelector::Config::dR
float dR
Definition: VertexAssociationSelector.h:17
pat::VertexAssociationSelector::Config::dZ
float dZ
cuts on Z and transverse distance from the vertex, absolute values or significances
Definition: VertexAssociationSelector.h:17
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
pat::VertexAssociation
Analysis-level structure for vertex-related information.
Definition: Vertexing.h:25
JME::Binning::Rho
Measurement1DFloat::significance
float significance() const
Definition: Measurement1DFloat.h:27
pat::VertexAssociation::isNull
bool isNull() const
Return 'true' if this is a null association (that is, no vertex)
Definition: Vertexing.h:37
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
pat::VertexAssociationSelector::conf_
Config conf_
Definition: VertexAssociationSelector.h:62