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

Member Function Documentation

◆ accept()

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

Implements BPHHistoSpecificDecay::CandidateSelect.

Definition at line 318 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, run3scouting_cff::sMin, PV3DBase< T, VectorTag, FrameTag >::x(), and PV3DBase< T, VectorTag, FrameTag >::y().

Referenced by esMonitoring.FDJsonServer::handle_accept().

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

Member Data Documentation

◆ cMin

float BPHGenericVertexSelect::cMin
private

Definition at line 385 of file BPHHistoSpecificDecay.cc.

◆ mode

char BPHGenericVertexSelect::mode
private

Definition at line 387 of file BPHHistoSpecificDecay.cc.

◆ pMin

float BPHGenericVertexSelect::pMin
private

Definition at line 384 of file BPHHistoSpecificDecay.cc.

◆ sMin

float BPHGenericVertexSelect::sMin
private

Definition at line 386 of file BPHHistoSpecificDecay.cc.

◆ type

char BPHGenericVertexSelect::type
private