CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
Cluster1DMerger< T > Class Template Reference

#include <Cluster1DMerger.h>

Public Member Functions

 Cluster1DMerger (const Cluster1DMerger &)
 
 Cluster1DMerger (const WeightEstimator< T > &)
 
Cluster1D< Toperator() (const Cluster1D< T > &first, const Cluster1D< T > &second) const
 
 ~Cluster1DMerger ()
 

Private Attributes

WeightEstimator< T > * theEstimator
 

Detailed Description

template<class T>
class Cluster1DMerger< T >

The class that should always be used to merge two Cluster1D into a single Cluster1D.

Definition at line 14 of file Cluster1DMerger.h.

Constructor & Destructor Documentation

◆ Cluster1DMerger() [1/2]

template<class T >
Cluster1DMerger< T >::Cluster1DMerger ( const WeightEstimator< T > &  est)

Definition at line 30 of file Cluster1DMerger.h.

30 : theEstimator(est.clone()) {}

◆ ~Cluster1DMerger()

template<class T >
Cluster1DMerger< T >::~Cluster1DMerger ( )

Definition at line 33 of file Cluster1DMerger.h.

33  {
34  delete theEstimator;
35 }

◆ Cluster1DMerger() [2/2]

template<class T >
Cluster1DMerger< T >::Cluster1DMerger ( const Cluster1DMerger< T > &  other)

Definition at line 38 of file Cluster1DMerger.h.

38 : theEstimator(other.theEstimator->clone()) {}

Member Function Documentation

◆ operator()()

template<class T >
Cluster1D< T > Cluster1DMerger< T >::operator() ( const Cluster1D< T > &  first,
const Cluster1D< T > &  second 
) const

Definition at line 41 of file Cluster1DMerger.h.

41  {
42  std::vector<const T*> tracks = first.tracks();
43  std::vector<const T*> sectracks = second.tracks();
44  for (typename std::vector<const T*>::const_iterator i = sectracks.begin(); i != sectracks.end(); ++i) {
45  tracks.push_back(*i);
46  };
47  double V1 = first.position().error() * first.position().error();
48  double V2 = second.position().error() * second.position().error();
49  double C1 = first.weight() / V1;
50  double C2 = second.weight() / V2;
51 
52  double newpos = (first.position().value() * C1 + second.position().value() * C2) / (C1 + C2);
53 
54  double newerr = sqrt(C1 * C1 * V1 + C2 * C2 * V2) / (C1 + C2);
55  double newWeight = theEstimator->weight(tracks);
56 
57  Measurement1D newmeas(newpos, newerr);
58  return Cluster1D<T>(newmeas, tracks, newWeight);
59 }

References first, mps_fire::i, edm::second(), mathSSE::sqrt(), and tracks.

Member Data Documentation

◆ theEstimator

template<class T>
WeightEstimator<T>* Cluster1DMerger< T >::theEstimator
private

Definition at line 22 of file Cluster1DMerger.h.

Measurement1D
Definition: Measurement1D.h:11
mps_fire.i
i
Definition: mps_fire.py:428
Cluster1D
Definition: Cluster1D.h:13
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
WeightEstimator::clone
virtual WeightEstimator * clone() const =0
trackingPlots.other
other
Definition: trackingPlots.py:1464
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:176
Cluster1DMerger::theEstimator
WeightEstimator< T > * theEstimator
Definition: Cluster1DMerger.h:22