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

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::BPHGenericVertexSelect ( char  vType,
float  probMin,
float  cosMin = -2.0,
float  sigMin = -1.0,
char  dMode = 'r' 
)
inline

Definition at line 318 of file BPHHistoSpecificDecay.cc.

319  : type(vType), pMin(probMin), cMin(cosMin), sMin(sigMin), mode(dMode) {}

◆ ~BPHGenericVertexSelect()

BPHGenericVertexSelect::~BPHGenericVertexSelect ( )
inlineoverride

Definition at line 320 of file BPHHistoSpecificDecay.cc.

320 {}

Member Function Documentation

◆ accept()

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

Implements BPHHistoSpecificDecay::CandidateSelect.

Definition at line 321 of file BPHHistoSpecificDecay.cc.

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  }

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().

Member Data Documentation

◆ cMin

float BPHGenericVertexSelect::cMin
private

Definition at line 388 of file BPHHistoSpecificDecay.cc.

◆ mode

char BPHGenericVertexSelect::mode
private

Definition at line 390 of file BPHHistoSpecificDecay.cc.

◆ pMin

float BPHGenericVertexSelect::pMin
private

Definition at line 387 of file BPHHistoSpecificDecay.cc.

◆ sMin

float BPHGenericVertexSelect::sMin
private

Definition at line 389 of file BPHHistoSpecificDecay.cc.

◆ type

char BPHGenericVertexSelect::type
private
Vector3DBase
Definition: Vector3DBase.h:8
BPHGenericVertexSelect::pMin
float pMin
Definition: BPHHistoSpecificDecay.cc:387
PV3DBase< T, VectorTag, FrameTag >::x
T x() const
Definition: PV3DBase.h:59
recoSelectForWrite_cfi.probMin
probMin
Definition: recoSelectForWrite_cfi.py:8
ChiSquaredProbability
float ChiSquaredProbability(double chiSquared, double nrDOF)
Definition: ChiSquaredProbability.cc:13
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
BPHGenericVertexSelect::sMin
float sMin
Definition: BPHHistoSpecificDecay.cc:389
BPHGenericVertexSelect::type
char type
Definition: BPHHistoSpecificDecay.cc:386
cand
Definition: decayParser.h:34
PV3DBase< T, VectorTag, FrameTag >::y
T y() const
Definition: PV3DBase.h:60
VertexAnalysis::dist2D
static void dist2D(const reco::Vertex *pvtx, const reco::Vertex *svtx, float px, float py, float mass, double &ctauPV, double &ctauErrPV)
Definition: BPHHistoSpecificDecay.cc:64
reco::Vertex::chi2
double chi2() const
chi-squares
Definition: Vertex.h:103
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
VertexAnalysis::cAlpha
static double cAlpha(const reco::Vertex *pvtx, const reco::Vertex *svtx, float px, float py)
Definition: BPHHistoSpecificDecay.cc:55
type
type
Definition: HCALResponse.h:21
BPHGenericVertexSelect::mode
char mode
Definition: BPHHistoSpecificDecay.cc:390
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
BPHGenericVertexSelect::cMin
float cMin
Definition: BPHHistoSpecificDecay.cc:388
reco::Vertex::ndof
double ndof() const
Definition: Vertex.h:110
reco::Vertex
Definition: Vertex.h:35