CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
BPHFittedVertexSelect Class Reference
Inheritance diagram for BPHFittedVertexSelect:
BPHHistoSpecificDecay::CandidateSelect

Public Member Functions

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

Private Attributes

float cMin
 
float pMin
 
float sMin
 

Detailed Description

Definition at line 284 of file BPHHistoSpecificDecay.cc.

Constructor & Destructor Documentation

BPHFittedVertexSelect::BPHFittedVertexSelect ( float  probMin,
float  cosMin = -1.0,
float  sigMin = -1.0 
)
inline

Member Function Documentation

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

Implements BPHHistoSpecificDecay::CandidateSelect.

Definition at line 288 of file BPHHistoSpecificDecay.cc.

References reco::Vertex::chi2(), ChiSquaredProbability(), reco::Vertex::error(), EgHLTOffHistBins_cfi::mass, GlobalErrorBase< T, ErrorWeightType >::matrix(), reco::Vertex::ndof(), ALCARECOTkAlMinBias_cff::pMin, mathSSE::sqrt(), Measurement1D::value(), reco::Vertex::x(), and reco::Vertex::y().

Referenced by Vispa.Gui.BoxContentDialog.BoxContentDialog::apply(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog::apply(), and esMonitoring.FDJsonServer::handle_accept().

288  {
289  const reco::Vertex* svtx = BPHUserData::get<reco::Vertex>(cand, "fitVertex");
290  if (svtx == nullptr)
291  return false;
292  if (pMin > 0) {
293  if (ChiSquaredProbability(svtx->chi2(), svtx->ndof()) < pMin)
294  return false;
295  }
296  if ((cMin > 0) || (sMin > 0)) {
297  TVector3 disp(svtx->x() - pvtx->x(), svtx->y() - pvtx->y(), 0);
298  const Vector3DBase<float, GlobalTag>* fmom =
299  BPHUserData::get<Vector3DBase<float, GlobalTag> >(cand, "fitMomentum");
300  if (fmom == nullptr)
301  return false;
302  TVector3 cmom(fmom->x(), fmom->y(), 0);
303  float cosAlpha = disp.Dot(cmom) / (disp.Perp() * cmom.Perp());
304  if (cosAlpha < cMin)
305  return false;
306  if (sMin < 0)
307  return true;
308  if (!cand.hasUserFloat("fitMass"))
309  return false;
310  float mass = cand.userFloat("fitMass");
311  AlgebraicVector3 vmom(fmom->x(), fmom->y(), 0);
312  VertexDistanceXY vdistXY;
313  Measurement1D distXY = vdistXY.distance(*svtx, *pvtx);
314  double ctauPV = distXY.value() * cosAlpha * mass / cmom.Perp();
315  GlobalError sve = svtx->error();
316  GlobalError pve = pvtx->error();
317  AlgebraicSymMatrix33 vXYe = sve.matrix() + pve.matrix();
318  double ctauErrPV = sqrt(ROOT::Math::Similarity(vmom, vXYe)) * mass / cmom.Perp2();
319  if ((ctauPV / ctauErrPV) < sMin)
320  return false;
321  }
322  return true;
323  }
const AlgebraicSymMatrix33 matrix() const
double y() const
y coordinate
Definition: Vertex.h:117
T sqrt(T t)
Definition: SSEVec.h:19
double chi2() const
chi-squares
Definition: Vertex.h:102
float ChiSquaredProbability(double chiSquared, double nrDOF)
double ndof() const
Definition: Vertex.h:109
double x() const
x coordinate
Definition: Vertex.h:115
double value() const
Definition: Measurement1D.h:25
Error error() const
return SMatrix
Definition: Vertex.h:149
ROOT::Math::SVector< double, 3 > AlgebraicVector3
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33

Member Data Documentation

float BPHFittedVertexSelect::cMin
private

Definition at line 327 of file BPHHistoSpecificDecay.cc.

float BPHFittedVertexSelect::pMin
private

Definition at line 326 of file BPHHistoSpecificDecay.cc.

float BPHFittedVertexSelect::sMin
private

Definition at line 328 of file BPHHistoSpecificDecay.cc.