CMS 3D CMS Logo

List of all members | Public Member Functions
WeightedMeanPrimaryVertexEstimator Class Reference

#include <WeightedMeanFitter.h>

Inheritance diagram for WeightedMeanPrimaryVertexEstimator:
PrimaryVertexFitterBase

Public Member Functions

std::vector< TransientVertexfit (const std::vector< reco::TransientTrack > &dummy, const std::vector< TransientVertex > &clusters, const reco::BeamSpot &beamSpot, const bool useBeamConstraint) override
 
 WeightedMeanPrimaryVertexEstimator ()=default
 
 ~WeightedMeanPrimaryVertexEstimator () override=default
 
- Public Member Functions inherited from PrimaryVertexFitterBase
 PrimaryVertexFitterBase (const edm::ParameterSet &conf)
 
 PrimaryVertexFitterBase ()
 
virtual ~PrimaryVertexFitterBase ()=default
 

Detailed Description

Definition at line 464 of file WeightedMeanFitter.h.

Constructor & Destructor Documentation

◆ WeightedMeanPrimaryVertexEstimator()

WeightedMeanPrimaryVertexEstimator::WeightedMeanPrimaryVertexEstimator ( )
default

◆ ~WeightedMeanPrimaryVertexEstimator()

WeightedMeanPrimaryVertexEstimator::~WeightedMeanPrimaryVertexEstimator ( )
overridedefault

Member Function Documentation

◆ fit()

std::vector<TransientVertex> WeightedMeanPrimaryVertexEstimator::fit ( const std::vector< reco::TransientTrack > &  dummy,
const std::vector< TransientVertex > &  clusters,
const reco::BeamSpot beamSpot,
const bool  useBeamConstraint 
)
inlineoverridevirtual

Implements PrimaryVertexFitterBase.

Definition at line 469 of file WeightedMeanFitter.h.

References pwdgSkimBPark_cfi::beamSpot, bsc_activity_cfg::clusters, submitPVResolutionJobs::err, AlCaHLTBitMon_ParallelJobs::p, SiStripOfflineCRack_cfg::p2, FSQDQM_cfi::pvs, fileCollector::seed, WeightedMeanFitter::startError, HLT_2024v13_cff::useBeamConstraint, findQualityFiles::v, WeightedMeanFitter::weightedMeanOutlierRejection(), and WeightedMeanFitter::weightedMeanOutlierRejectionBeamSpot().

Referenced by trackingPlots.Iteration::modules().

472  {
473  std::vector<TransientVertex> pvs;
474  std::vector<TransientVertex> seed(1);
475 
476  for (auto& cluster : clusters) {
477  if (cluster.originalTracks().size() > 1) {
478  std::vector<reco::TransientTrack> tracklist = cluster.originalTracks();
480  std::vector<std::pair<GlobalPoint, GlobalPoint>> points;
481  if (useBeamConstraint && (tracklist.size() > 1)) {
482  for (const auto& itrack : tracklist) {
483  GlobalPoint p = itrack.stateAtBeamLine().trackStateAtPCA().position();
484  GlobalPoint err(itrack.stateAtBeamLine().transverseImpactParameter().error(),
485  itrack.stateAtBeamLine().transverseImpactParameter().error(),
486  itrack.track().dzError());
487  std::pair<GlobalPoint, GlobalPoint> p2(p, err);
488  points.push_back(p2);
489  }
490 
492  if (!v.hasTrackWeight()) {
493  // if the fitter doesn't provide weights, fill dummy values
495  for (const auto& trk : v.originalTracks()) {
496  trkWeightMap[trk] = 1.;
497  }
498  v.weightMap(trkWeightMap);
499  }
500  if ((v.positionError().matrix())(2, 2) != (WeightedMeanFitter::startError * WeightedMeanFitter::startError))
501  pvs.push_back(v);
502  } else if (!(useBeamConstraint) && (tracklist.size() > 1)) {
503  for (const auto& itrack : tracklist) {
504  GlobalPoint p = itrack.impactPointState().globalPosition();
505  GlobalPoint err(itrack.track().dxyError(), itrack.track().dxyError(), itrack.track().dzError());
506  std::pair<GlobalPoint, GlobalPoint> p2(p, err);
507  points.push_back(p2);
508  }
509 
511  if (!v.hasTrackWeight()) {
512  // if the fitter doesn't provide weights, fill dummy values
514  for (const auto& trk : v.originalTracks()) {
515  trkWeightMap[trk] = 1.;
516  }
517  v.weightMap(trkWeightMap);
518  }
519  if ((v.positionError().matrix())(2, 2) != (WeightedMeanFitter::startError * WeightedMeanFitter::startError))
520  pvs.push_back(v); //FIX with constants
521  }
522  }
523  }
524  return pvs;
525  }
std::map< reco::TransientTrack, float > TransientTrackToFloatMap
TransientVertex weightedMeanOutlierRejectionBeamSpot(const std::vector< std::pair< GlobalPoint, GlobalPoint >> &points, std::vector< reco::TransientTrack > iclus, const reco::BeamSpot &beamSpot)
TransientVertex weightedMeanOutlierRejection(const std::vector< std::pair< GlobalPoint, GlobalPoint >> &points, std::vector< reco::TransientTrack > iclus)
constexpr float startError