CMS 3D CMS Logo

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 ()=default
 

Private Attributes

float cMin
 
char mode
 
float pMin
 
float sMin
 
char type
 

Detailed Description

Definition at line 306 of file BPHHistoSpecificDecay.cc.

Constructor & Destructor Documentation

◆ BPHGenericVertexSelect()

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

◆ ~BPHGenericVertexSelect()

BPHGenericVertexSelect::~BPHGenericVertexSelect ( )
inlineoverride

Definition at line 310 of file BPHHistoSpecificDecay.cc.

310 {}

Member Function Documentation

◆ accept()

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

Implements BPHHistoSpecificDecay::CandidateSelect.

Definition at line 311 of file BPHHistoSpecificDecay.cc.

References VertexAnalysis::cAlpha(), reco::Vertex::chi2(), ChiSquaredProbability(), VertexAnalysis::dist2D(), EgHLTOffHistBins_cfi::mass, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, reco::Vertex::ndof(), ALCARECOTkAlMinBias_cff::pMin, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, PV3DBase< T, VectorTag, FrameTag >::x(), and PV3DBase< T, VectorTag, FrameTag >::y().

Referenced by esMonitoring.FDJsonServer::handle_accept().

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

Member Data Documentation

◆ cMin

float BPHGenericVertexSelect::cMin
private

Definition at line 378 of file BPHHistoSpecificDecay.cc.

◆ mode

char BPHGenericVertexSelect::mode
private

Definition at line 380 of file BPHHistoSpecificDecay.cc.

◆ pMin

float BPHGenericVertexSelect::pMin
private

Definition at line 377 of file BPHHistoSpecificDecay.cc.

◆ sMin

float BPHGenericVertexSelect::sMin
private

Definition at line 379 of file BPHHistoSpecificDecay.cc.

◆ type

char BPHGenericVertexSelect::type
private