CMS 3D CMS Logo

Public Member Functions | Private Attributes

PrimaryVertexProducerAlgorithm Class Reference

#include <RecoVertex/PrimaryVertexProducerAlgorithm/src/PrimaryVertexProducerAlgorithm.cc>

Inheritance diagram for PrimaryVertexProducerAlgorithm:
VertexReconstructor

List of all members.

Public Member Functions

virtual
PrimaryVertexProducerAlgorithm
clone () const
 PrimaryVertexProducerAlgorithm (const edm::ParameterSet &)
virtual std::vector
< TransientVertex
vertices (const std::vector< reco::TransientTrack > &tracks, const reco::BeamSpot &beamSpot) const
virtual std::vector
< TransientVertex
vertices (const std::vector< reco::TransientTrack > &tracks) const
 ~PrimaryVertexProducerAlgorithm ()

Private Attributes

bool fapply_finder
bool fFailsafe
double fMinNdof
bool fUseBeamConstraint
bool fVerbose
edm::ParameterSet theConfig
KalmanTrimmedVertexFinder theFinder
VertexFitter< 5 > * theFitter
TrackClusterizerInZtheTrackClusterizer
TrackFilterForPVFindingBasetheTrackFilter
VertexCompatibleWithBeam theVertexSelector

Detailed Description

Description: finds primary vertices, compatible with the beam line

Implementation: <Notes on="" implementation>="">

Definition at line 36 of file PrimaryVertexProducerAlgorithm.h.


Constructor & Destructor Documentation

PrimaryVertexProducerAlgorithm::PrimaryVertexProducerAlgorithm ( const edm::ParameterSet conf) [explicit]

Definition at line 22 of file PrimaryVertexProducerAlgorithm.cc.

References algorithm(), fapply_finder, fFailsafe, fMinNdof, fUseBeamConstraint, fVerbose, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), KalmanTrimmedVertexFinder::setParameters(), theFinder, theFitter, theTrackClusterizer, and theTrackFilter.

Referenced by clone().

  : theConfig(conf), 
    theVertexSelector(VertexDistanceXY(), 
                      conf.getParameter<edm::ParameterSet>("PVSelParameters").getParameter<double>("maxDistanceToBeam"))
{
  edm::LogInfo("PVDebugInfo") 
    << "PVSelParameters::maxDistanceToBeam = " 
    << conf.getParameter<edm::ParameterSet>("PVSelParameters").getParameter<double>("maxDistanceToBeam") << "\n";


  fUseBeamConstraint = conf.getParameter<bool>("useBeamConstraint");
  fVerbose           = conf.getUntrackedParameter<bool>("verbose", false);
  fMinNdof           = conf.getParameter<double>("minNdof");
  fFailsafe          = true; //conf.getUntrackedParameter<bool>("failsafe",true);


  // select and configure the track selection
  std::string trackSelectionAlgorithm=conf.getParameter<edm::ParameterSet>("TkFilterParameters").getParameter<std::string>("algorithm");
  if(trackSelectionAlgorithm=="filter"){
    theTrackFilter= new TrackFilterForPVFinding( conf.getParameter<edm::ParameterSet>("TkFilterParameters") );
  }else if (trackSelectionAlgorithm=="filterWithThreshold"){
    theTrackFilter= new HITrackFilterForPVFinding(conf.getParameter<edm::ParameterSet>("TkFilterParameters"));
  }else{
    throw VertexException("PrimaryVertexProducerAlgorithm: unknown track selection algorithm: " + trackSelectionAlgorithm);  
  }


  // select and configure the track clusterizer
  std::string clusteringAlgorithm=conf.getParameter<edm::ParameterSet>("TkClusParameters").getParameter<std::string>("algorithm");
  if (clusteringAlgorithm=="gap"){
    theTrackClusterizer = new GapClusterizerInZ(conf.getParameter<edm::ParameterSet>("TkClusParameters").getParameter<edm::ParameterSet>("TkGapClusParameters"));
  }else if(clusteringAlgorithm=="DA"){
    theTrackClusterizer = new DAClusterizerInZ(conf.getParameter<edm::ParameterSet>("TkClusParameters").getParameter<edm::ParameterSet>("TkDAClusParameters"));
  }else{
    throw VertexException("PrimaryVertexProducerAlgorithm: unknown clustering algorithm: " + clusteringAlgorithm);  
  }

  // select and configure the vertex fitter
  std::string algorithm = conf.getParameter<std::string>("algorithm");
  fapply_finder = false;
  if (algorithm == "TrimmedKalmanFinder") {
    fapply_finder = true;
    theFinder.setParameters(conf.getParameter<edm::ParameterSet>("VtxFinderParameters"));
  } else if (algorithm=="KalmanVertexFitter") {
    theFitter=new KalmanVertexFitter();
  } else if( algorithm=="AdaptiveVertexFitter") {
    theFitter=new AdaptiveVertexFitter();
  } else {
    throw VertexException("PrimaryVertexProducerAlgorithm: unknown algorithm: " + algorithm);  
  }

  edm::LogInfo("PVDebugInfo") 
    << "Using " << algorithm << "\n";
  edm::LogInfo("PVDebugInfo") 
    << "beam-constraint  " << fUseBeamConstraint << "\n"; 

  edm::LogInfo("PVDebugInfo") 
    << "PV producer algorithm initialization: done" << "\n";

}
PrimaryVertexProducerAlgorithm::~PrimaryVertexProducerAlgorithm ( )

Member Function Documentation

virtual PrimaryVertexProducerAlgorithm* PrimaryVertexProducerAlgorithm::clone ( void  ) const [inline, virtual]

Clone method

Implements VertexReconstructor.

Definition at line 55 of file PrimaryVertexProducerAlgorithm.h.

References PrimaryVertexProducerAlgorithm().

                                                         {
    return new PrimaryVertexProducerAlgorithm(*this);
  }
virtual std::vector<TransientVertex> PrimaryVertexProducerAlgorithm::vertices ( const std::vector< reco::TransientTrack > &  tracks) const [virtual]

Find primary vertices

Implements VertexReconstructor.

virtual std::vector<TransientVertex> PrimaryVertexProducerAlgorithm::vertices ( const std::vector< reco::TransientTrack > &  t,
const reco::BeamSpot  
) const [virtual]

Reconstruct vertices, exploiting the beamspot constraint for the primary vertex

Reimplemented from VertexReconstructor.


Member Data Documentation

Definition at line 72 of file PrimaryVertexProducerAlgorithm.h.

Referenced by PrimaryVertexProducerAlgorithm().

Definition at line 73 of file PrimaryVertexProducerAlgorithm.h.

Referenced by PrimaryVertexProducerAlgorithm().

Definition at line 70 of file PrimaryVertexProducerAlgorithm.h.

Referenced by PrimaryVertexProducerAlgorithm().

Definition at line 69 of file PrimaryVertexProducerAlgorithm.h.

Referenced by PrimaryVertexProducerAlgorithm().

Definition at line 68 of file PrimaryVertexProducerAlgorithm.h.

Referenced by PrimaryVertexProducerAlgorithm().

Definition at line 62 of file PrimaryVertexProducerAlgorithm.h.

Definition at line 65 of file PrimaryVertexProducerAlgorithm.h.

Referenced by PrimaryVertexProducerAlgorithm().

Definition at line 66 of file PrimaryVertexProducerAlgorithm.h.