CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
BPHGenericVertexSelect Class Reference
Inheritance diagram for BPHGenericVertexSelect:
BPHHistoSpecificDecay::CandidateSelect

Public Member Functions

bool accept (const pat::CompositeCandidate &cand, const reco::Vertex *pvtx) const override
 
 BPHGenericVertexSelect (char vType, float probMin, float cosMin=-2.0, float sigMin=-1.0, char dMode= 'r')
 
 ~BPHGenericVertexSelect () override
 
- Public Member Functions inherited from BPHHistoSpecificDecay::CandidateSelect
virtual ~CandidateSelect ()
 

Private Attributes

float cMin
 
char mode
 
float pMin
 
float sMin
 
char type
 

Detailed Description

Definition at line 316 of file BPHHistoSpecificDecay.cc.

Constructor & Destructor Documentation

BPHGenericVertexSelect::BPHGenericVertexSelect ( char  vType,
float  probMin,
float  cosMin = -2.0,
float  sigMin = -1.0,
char  dMode = 'r' 
)
inline
BPHGenericVertexSelect::~BPHGenericVertexSelect ( )
inlineoverride

Definition at line 320 of file BPHHistoSpecificDecay.cc.

320 {}

Member Function Documentation

bool BPHGenericVertexSelect::accept ( const pat::CompositeCandidate cand,
const reco::Vertex pvtx 
) const
inlineoverridevirtual

Implements BPHHistoSpecificDecay::CandidateSelect.

Definition at line 321 of file BPHHistoSpecificDecay.cc.

References VertexAnalysis::cAlpha(), reco::Vertex::chi2(), ChiSquaredProbability(), VertexAnalysis::dist2D(), ResonanceBuilder::mass, universalConfigTemplate::mode, reco::Vertex::ndof(), HLT_FULL_cff::pMin, PV3DBase< T, VectorTag, FrameTag >::x(), and PV3DBase< T, VectorTag, FrameTag >::y().

Referenced by esMonitoring.FDJsonServer::handle_accept().

321  {
322  if (pvtx == nullptr)
323  return false;
324  const reco::Vertex* svtx = nullptr;
325  float px;
326  float py;
327  float mass;
328  switch (type) {
329  case 'c':
330  svtx = BPHUserData::get<reco::Vertex>(cand, "vertex");
331  px = cand.px();
332  py = cand.py();
333  mass = cand.mass();
334  break;
335  case 'f':
336  svtx = BPHUserData::get<reco::Vertex>(cand, "fitVertex");
337  {
338  const Vector3DBase<float, GlobalTag>* fmom =
339  BPHUserData::get<Vector3DBase<float, GlobalTag>>(cand, "fitMomentum");
340  if (fmom == nullptr)
341  return false;
342  px = fmom->x();
343  py = fmom->y();
344  }
345  if (!cand.hasUserFloat("fitMass"))
346  return false;
347  mass = cand.userFloat("fitMass");
348  break;
349  default:
350  return false;
351  }
352  if (svtx == nullptr)
353  return false;
354  if (pMin > 0) {
355  if (ChiSquaredProbability(svtx->chi2(), svtx->ndof()) < pMin)
356  return false;
357  }
358  if ((cMin > -1.0) || (sMin > 0)) {
359  float cosAlpha = VertexAnalysis::cAlpha(pvtx, svtx, px, py);
360  if (cosAlpha < cMin)
361  return false;
362  if (sMin < 0)
363  return true;
364  double ctauPV;
365  double ctauErrPV;
366  VertexAnalysis::dist2D(pvtx, svtx, px, py, cosAlpha, mass, ctauPV, ctauErrPV);
367  float dTest;
368  switch (mode) {
369  case 'a':
370  case 'd':
371  dTest = ctauPV;
372  break;
373  case 'r':
374  case 's':
375  default:
376  dTest = ctauPV / ctauErrPV;
377  break;
378  }
379  if (dTest < sMin)
380  return false;
381  }
382  return true;
383  }
static void dist2D(const reco::Vertex *pvtx, const reco::Vertex *svtx, float px, float py, float mass, double &ctauPV, double &ctauErrPV)
double chi2() const
chi-squares
Definition: Vertex.h:116
float ChiSquaredProbability(double chiSquared, double nrDOF)
double ndof() const
Definition: Vertex.h:123
static double cAlpha(const reco::Vertex *pvtx, const reco::Vertex *svtx, float px, float py)

Member Data Documentation

float BPHGenericVertexSelect::cMin
private

Definition at line 388 of file BPHHistoSpecificDecay.cc.

char BPHGenericVertexSelect::mode
private

Definition at line 390 of file BPHHistoSpecificDecay.cc.

float BPHGenericVertexSelect::pMin
private

Definition at line 387 of file BPHHistoSpecificDecay.cc.

float BPHGenericVertexSelect::sMin
private

Definition at line 389 of file BPHHistoSpecificDecay.cc.

char BPHGenericVertexSelect::type
private