CMS 3D CMS Logo

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

#include <FsmwModeFinder3d.h>

Inheritance diagram for FsmwModeFinder3d:
ModeFinder3d

Public Member Functions

FsmwModeFinder3dclone () const override
 
 FsmwModeFinder3d (float fraction=.5, float weightExponent=-2., float cutoff=10, int no_weights_above=10)
 
GlobalPoint operator() (const std::vector< PointAndDistance > &) const override
 
- Public Member Functions inherited from ModeFinder3d
virtual ~ModeFinder3d ()
 

Private Attributes

float theCutoff
 
float theFraction
 
int theNoWeightsAbove
 
float theWeightExponent
 

Additional Inherited Members

- Public Types inherited from ModeFinder3d
typedef std::pair< GlobalPoint, float > PointAndDistance
 

Detailed Description

this is a half sample mode finder that works coordinate wise, in 3d.

Definition at line 12 of file FsmwModeFinder3d.h.

Constructor & Destructor Documentation

◆ FsmwModeFinder3d()

FsmwModeFinder3d::FsmwModeFinder3d ( float  fraction = .5,
float  weightExp = -2.,
float  cutoff = 10,
int  no_w_a = 10 
)

Constructor

Parameters
fractionthe fraction of data points that have to be within the interval.
weightExponentThe exponent by which the weights are taken into account. Default is "w^-1", w being the track distance + cutoff (see below).
cutoffweight = ( cutoff + 10000 * distance ) * weightExponent
no_weights_aboveignore weights as long as the number of data points is > x

Half sample mode in 3d, as a functional class.

Definition at line 10 of file FsmwModeFinder3d.cc.

12  assert(theFraction > 0. && theFraction < 1.);
13 }

References cms::cuda::assert(), and theFraction.

Referenced by clone().

Member Function Documentation

◆ clone()

FsmwModeFinder3d * FsmwModeFinder3d::clone ( void  ) const
overridevirtual

Implements ModeFinder3d.

Definition at line 50 of file FsmwModeFinder3d.cc.

50 { return new FsmwModeFinder3d(*this); }

References FsmwModeFinder3d().

◆ operator()()

GlobalPoint FsmwModeFinder3d::operator() ( const std::vector< PointAndDistance > &  values) const
overridevirtual

Implements ModeFinder3d.

Definition at line 15 of file FsmwModeFinder3d.cc.

15  {
16  typedef Cluster1D<void> SimpleCluster;
17  std::vector<SimpleCluster> vx, vy, vz;
18  vx.reserve(values.size() - 1);
19  vy.reserve(values.size() - 1);
20  vz.reserve(values.size() - 1);
21  std::vector<const void*> emptyvec;
22 
23  for (std::vector<PointAndDistance>::const_iterator i = values.begin(); i != values.end(); ++i) {
24  float weight = 1.;
25  if (static_cast<int>(values.size()) < theNoWeightsAbove) {
26  // compute weights if we have fewer than theNoWeightsAbove
27  // data points
28  weight = pow(theCutoff + 10000 * i->second, theWeightExponent);
29  };
30 
31  SimpleCluster tmp_x(Measurement1D(i->first.x(), 1.0), emptyvec, weight);
32  SimpleCluster tmp_y(Measurement1D(i->first.y(), 1.0), emptyvec, weight);
33  SimpleCluster tmp_z(Measurement1D(i->first.z(), 1.0), emptyvec, weight);
34  vx.push_back(tmp_x);
35  vy.push_back(tmp_y);
36  vz.push_back(tmp_z);
37  };
38 
40  std::vector<SimpleCluster> cresx = algo(vx).first;
41  std::vector<SimpleCluster> cresy = algo(vy).first;
42  std::vector<SimpleCluster> cresz = algo(vz).first;
43  assert(!cresx.empty() && !cresy.empty() && !cresz.empty());
44 
46  cresx.begin()->position().value(), cresy.begin()->position().value(), cresz.begin()->position().value());
47  return ret;
48 }

References cms::cuda::assert(), mps_fire::i, funct::pow(), runTheMatrix::ret, theCutoff, theFraction, theNoWeightsAbove, theWeightExponent, contentValuesCheck::values, and mps_merge::weight.

Member Data Documentation

◆ theCutoff

float FsmwModeFinder3d::theCutoff
private

Definition at line 36 of file FsmwModeFinder3d.h.

Referenced by operator()().

◆ theFraction

float FsmwModeFinder3d::theFraction
private

Definition at line 34 of file FsmwModeFinder3d.h.

Referenced by FsmwModeFinder3d(), and operator()().

◆ theNoWeightsAbove

int FsmwModeFinder3d::theNoWeightsAbove
private

Definition at line 37 of file FsmwModeFinder3d.h.

Referenced by operator()().

◆ theWeightExponent

float FsmwModeFinder3d::theWeightExponent
private

Definition at line 35 of file FsmwModeFinder3d.h.

Referenced by operator()().

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:542
FsmwModeFinder3d::theFraction
float theFraction
Definition: FsmwModeFinder3d.h:34
Measurement1D
Definition: Measurement1D.h:11
mps_fire.i
i
Definition: mps_fire.py:428
Cluster1D
Definition: Cluster1D.h:13
mps_merge.weight
weight
Definition: mps_merge.py:88
cms::cuda::assert
assert(be >=bs)
cmsdt::algo
algo
Definition: constants.h:165
HLT_FULL_cff.fraction
fraction
Definition: HLT_FULL_cff.py:52802
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
FsmwModeFinder3d::theWeightExponent
float theWeightExponent
Definition: FsmwModeFinder3d.h:35
Point3DBase< float, GlobalTag >
FsmwClusterizer1D
Definition: FsmwClusterizer1D.h:17
FsmwModeFinder3d::theNoWeightsAbove
int theNoWeightsAbove
Definition: FsmwModeFinder3d.h:37
FsmwModeFinder3d::FsmwModeFinder3d
FsmwModeFinder3d(float fraction=.5, float weightExponent=-2., float cutoff=10, int no_weights_above=10)
Definition: FsmwModeFinder3d.cc:10
FsmwModeFinder3d::theCutoff
float theCutoff
Definition: FsmwModeFinder3d.h:36
EcalSCDynamicDPhiParametersESProducer_cfi.cutoff
cutoff
Definition: EcalSCDynamicDPhiParametersESProducer_cfi.py:15
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
weight
Definition: weight.py:1