CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GsfVertexMerger Class Reference

#include <GsfVertexMerger.h>

Public Member Functions

GsfVertexMergerclone () const
 
 GsfVertexMerger (const edm::ParameterSet &pSet)
 
CachingVertex< 5 > merge (const CachingVertex< 5 > &vertex) const
 
VertexState merge (const VertexState &vertex) const
 
 ~GsfVertexMerger ()
 

Private Attributes

unsigned int maxComponents
 
DeepCopyPointerByClone< MultiGaussianStateMerger< 3 > > merger
 

Detailed Description

Definition at line 15 of file GsfVertexMerger.h.

Constructor & Destructor Documentation

◆ GsfVertexMerger()

GsfVertexMerger::GsfVertexMerger ( const edm::ParameterSet pSet)

Definition at line 13 of file GsfVertexMerger.cc.

13  {
14  maxComponents = pSet.getParameter<int>("maxNbrComponents");
15  std::string mergerName = pSet.getParameter<std::string>("merger");
16  std::string distanceName = pSet.getParameter<std::string>("distance");
17 
18  if (mergerName == "CloseComponentsMerger") {
20 
21  if (distanceName == "KullbackLeiblerDistance")
23  // else if ( distanceName=="MahalanobisDistance" )
24  // distance = new MahalanobisDistance();
25  else
26  throw VertexException("GsfVertexMerger: Distance type " + distanceName +
27  " unknown. Check distance parameter in GsfMergerParameters PSet");
28 
30  delete distance;
31  }
32  // else if ( mergerName=="LargestWeightsStateMerger" )
33  // merger = new LargestWeightsStateMerger(maxComponents);
34  else
35  throw VertexException("GsfVertexMerger: Merger type " + mergerName +
36  " unknown. Check merger parameter in GsfMergerParameters PSet");
37 
38  // else if ( mergerName=="KeepingNonZeroWeightsMerger" )
39  // merger = new KeepingNonZeroWeightsMerger();
40 
41  // std::string mergerName = "test";
42  // edm::ESHandle<MultiGaussianStateMerger> mergerProducer;
43  // iRecord.get(mergerName,mergerProducer);
44  // merger = (MultiGaussianStateMerger *) mergerProducer.product();
45 }

References HLT_FULL_cff::distance, edm::ParameterSet::getParameter(), maxComponents, merger, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by clone().

◆ ~GsfVertexMerger()

GsfVertexMerger::~GsfVertexMerger ( )
inline

Definition at line 18 of file GsfVertexMerger.h.

18 {}

Member Function Documentation

◆ clone()

GsfVertexMerger* GsfVertexMerger::clone ( void  ) const
inline

Definition at line 24 of file GsfVertexMerger.h.

24 { return new GsfVertexMerger(*this); }

References GsfVertexMerger().

Referenced by GsfVertexSmoother::GsfVertexSmoother(), and GsfVertexUpdator::GsfVertexUpdator().

◆ merge() [1/2]

CachingVertex< 5 > GsfVertexMerger::merge ( const CachingVertex< 5 > &  vertex) const

Definition at line 47 of file GsfVertexMerger.cc.

47  {
48  if (oldVertex.vertexState().components().size() <= maxComponents)
49  return oldVertex;
50 
51  VertexState newVertexState = merge(oldVertex.vertexState());
52 
53  if (oldVertex.hasPrior()) {
54  return CachingVertex<5>(oldVertex.priorPosition(),
55  oldVertex.priorError(),
56  newVertexState.weightTimesPosition(),
57  newVertexState.weight(),
58  oldVertex.tracks(),
59  oldVertex.totalChiSquared());
60  } else {
61  return CachingVertex<5>(newVertexState, oldVertex.tracks(), oldVertex.totalChiSquared());
62  }
63 }

References VertexState::components(), CachingVertex< N >::hasPrior(), maxComponents, CachingVertex< N >::priorError(), CachingVertex< N >::priorPosition(), CachingVertex< N >::totalChiSquared(), CachingVertex< N >::tracks(), CachingVertex< N >::vertexState(), VertexState::weight(), and VertexState::weightTimesPosition().

Referenced by GsfVertexUpdator::add(), and GsfVertexSmoother::smooth().

◆ merge() [2/2]

VertexState GsfVertexMerger::merge ( const VertexState vertex) const

Definition at line 65 of file GsfVertexMerger.cc.

65  {
66  using namespace GaussianStateConversions;
67 
68  if (oldVertex.components().size() <= maxComponents)
69  return oldVertex;
70 
71  MultiGaussianState<3> multiGaussianState(multiGaussianStateFromVertex(oldVertex));
72  MultiGaussianState<3> finalState(merger->merge(multiGaussianState));
73  return vertexFromMultiGaussianState(finalState);
74 }

References VertexState::components(), maxComponents, MultiGaussianStateMerger< N >::merge(), merger, GaussianStateConversions::multiGaussianStateFromVertex(), and GaussianStateConversions::vertexFromMultiGaussianState().

Member Data Documentation

◆ maxComponents

unsigned int GsfVertexMerger::maxComponents
private

Definition at line 28 of file GsfVertexMerger.h.

Referenced by GsfVertexMerger(), and merge().

◆ merger

DeepCopyPointerByClone<MultiGaussianStateMerger<3> > GsfVertexMerger::merger
private

Definition at line 27 of file GsfVertexMerger.h.

Referenced by GsfVertexMerger(), and merge().

GsfVertexMerger::GsfVertexMerger
GsfVertexMerger(const edm::ParameterSet &pSet)
Definition: GsfVertexMerger.cc:13
VertexException
Common base class.
Definition: VertexException.h:12
CachingVertex< 5 >
CloseComponentsMerger
Definition: CloseComponentsMerger.h:18
MultiGaussianState
Mixture of multi-variate gaussian states.
Definition: MultiGaussianState.h:18
GaussianStateConversions
Definition: VertexGaussianStateConversions.h:6
KullbackLeiblerDistance
Definition: KullbackLeiblerDistance.h:10
DistanceBetweenComponents
Definition: DistanceBetweenComponents.h:11
GaussianStateConversions::multiGaussianStateFromVertex
MultiGaussianState< 3 > multiGaussianStateFromVertex(const VertexState aState)
Definition: VertexGaussianStateConversions.cc:8
VertexState::weight
GlobalWeight weight() const
Definition: VertexState.h:69
MultiGaussianStateMerger::merge
virtual MultiState merge(const MultiState &mgs) const =0
VertexState::weightTimesPosition
AlgebraicVector3 weightTimesPosition() const
Definition: VertexState.h:77
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GsfVertexMerger::maxComponents
unsigned int maxComponents
Definition: GsfVertexMerger.h:28
GsfVertexMerger::merge
CachingVertex< 5 > merge(const CachingVertex< 5 > &vertex) const
Definition: GsfVertexMerger.cc:47
GaussianStateConversions::vertexFromMultiGaussianState
VertexState vertexFromMultiGaussianState(const MultiGaussianState< 3 > &multiState)
Definition: VertexGaussianStateConversions.cc:27
VertexState
Definition: VertexState.h:13
GsfVertexMerger::merger
DeepCopyPointerByClone< MultiGaussianStateMerger< 3 > > merger
Definition: GsfVertexMerger.h:27
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7746