CMS 3D CMS Logo

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

#include <Cluster1DMerger.h>

Public Member Functions

 Cluster1DMerger (const Cluster1DMerger &)
 
 Cluster1DMerger (const WeightEstimator< T > &, const math::XYZPoint &bs=math::XYZPoint(0., 0., 0.))
 
Cluster1D< Toperator() (const Cluster1D< T > &first, const Cluster1D< T > &second) const
 
void setBeamSpot (const math::XYZPoint &bs)
 
 ~Cluster1DMerger ()
 

Private Attributes

math::XYZPoint theBS
 
WeightEstimator< T > * theEstimator
 

Detailed Description

template<class T>
class pixeltemp::Cluster1DMerger< T >

Definition at line 17 of file Cluster1DMerger.h.

Constructor & Destructor Documentation

◆ Cluster1DMerger() [1/2]

template<class T>
Cluster1DMerger< T >::Cluster1DMerger ( const WeightEstimator< T > &  est,
const math::XYZPoint bs = math::XYZPoint(0., 0., 0.) 
)

Definition at line 35 of file Cluster1DMerger.h.

36  : theEstimator(est.clone()), theBS(bs) {}

◆ ~Cluster1DMerger()

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

Definition at line 39 of file Cluster1DMerger.h.

39  {
40  delete theEstimator;
41  }

◆ Cluster1DMerger() [2/2]

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

Definition at line 44 of file Cluster1DMerger.h.

45  : theEstimator(other.theEstimator->clone()), theBS(other.theBS) {}

Member Function Documentation

◆ operator()()

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

Definition at line 48 of file Cluster1DMerger.h.

48  {
49  std::vector<const T *> tracks = first.tracks();
50  std::vector<const T *> sectracks = second.tracks();
51  for (typename std::vector<const T *>::const_iterator i = sectracks.begin(); i != sectracks.end(); ++i) {
52  tracks.push_back(*i);
53  };
54  float newpos =
55  (first.position().value() * first.weight() / first.position().error() / first.position().error() +
56  second.position().value() * second.weight() / second.position().error() / second.position().error()) /
57  (first.weight() / first.position().error() / first.position().error() +
58  second.weight() / second.position().error() / second.position().error());
59 
60  float newerr = sqrt(first.position().error() * first.position().error() +
61  second.position().error() * second.position().error());
62  float newWeight = theEstimator->weight(tracks);
63 
64  // Now try a different method
65  float sumUp = 0;
66  float sumDown = 0;
67  float err = 0;
68  for (unsigned int i = 0; i < tracks.size(); ++i) {
69  // float err2 = tracks[i]->covariance( reco::TrackBase::i_dz, reco::TrackBase::i_dz );
70  float err2 = tracks[i]->dzError();
71  err2 *= err2;
72 
73  if (err2 != 0) {
74  sumUp += tracks[i]->dz(theBS) * 1 / err2; // error-weighted average of Z at IP
75  sumDown += 1 / err2;
76  }
77  err += sqrt(err2);
78  }
79 
80  newpos = sumUp / sumDown;
81  newerr = err / tracks.size() / sqrt(1.0 * tracks.size());
82 
83  Measurement1D newmeas(newpos, newerr);
84  return Cluster1D<T>(newmeas, tracks, newWeight);
85  }

◆ setBeamSpot()

template<class T>
void pixeltemp::Cluster1DMerger< T >::setBeamSpot ( const math::XYZPoint bs)
inline

Definition at line 20 of file Cluster1DMerger.h.

20 { theBS = bs; }

Member Data Documentation

◆ theBS

template<class T>
math::XYZPoint pixeltemp::Cluster1DMerger< T >::theBS
private

◆ theEstimator

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

Definition at line 26 of file Cluster1DMerger.h.

PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
Measurement1D
Definition: Measurement1D.h:11
mps_fire.i
i
Definition: mps_fire.py:355
Cluster1D
Definition: Cluster1D.h:13
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
dqmdumpme.first
first
Definition: dqmdumpme.py:55
cms::cuda::bs
bs
Definition: HistoContainer.h:127
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
WeightEstimator::clone
virtual WeightEstimator * clone() const =0
trackingPlots.other
other
Definition: trackingPlots.py:1465
runTheMatrix.err
err
Definition: runTheMatrix.py:288
pixeltemp::Cluster1DMerger::theBS
math::XYZPoint theBS
Definition: Cluster1DMerger.h:27
pixeltemp::Cluster1DMerger::theEstimator
WeightEstimator< T > * theEstimator
Definition: Cluster1DMerger.h:26