CMS 3D CMS Logo

List of all members | Public Member Functions
npstat::EquidistantInLogSpace Class Reference

#include <EquidistantSequence.h>

Inheritance diagram for npstat::EquidistantInLogSpace:

Public Member Functions

 EquidistantInLogSpace (double minScale, double maxScale, unsigned nScales)
 
 EquidistantInLogSpace ()=delete
 
virtual ~EquidistantInLogSpace ()
 

Detailed Description

A sequence of points equidistant in log space. Note that std::vector destructor is not virtual, so do not destroy this class by base pointer or reference.

Definition at line 35 of file EquidistantSequence.h.

Constructor & Destructor Documentation

◆ EquidistantInLogSpace() [1/2]

npstat::EquidistantInLogSpace::EquidistantInLogSpace ( double  minScale,
double  maxScale,
unsigned  nScales 
)

Definition at line 32 of file EquidistantSequence.cc.

References JetChargeProducer_cfi::exp, mps_fire::i, dqm-mbProfile::log, fftjetcommon_cfi::maxScale, fftjetcommon_cfi::minScale, fftjetcommon_cfi::nScales, push_back(), and mathSSE::sqrt().

33  : std::vector<double>() {
34  if (nScales)
35  if (!(minScale > 0.0 && maxScale > 0.0))
37  "In npstat::EquidistantInLogSpace constructor: "
38  "minimum and maximum scales must be positive");
39  switch (nScales) {
40  case 0:
41  break;
42 
43  case 1: {
44  this->reserve(nScales);
45  const double sc = (minScale == maxScale ? minScale : sqrt(minScale * maxScale));
46  push_back(sc);
47  } break;
48 
49  default: {
50  this->reserve(nScales);
51  const double logmax = log(maxScale);
52  const double logmin = log(minScale);
53  const double logstep = (logmax - logmin) / (nScales - 1);
55  for (unsigned i = 1; i < nScales - 1; ++i)
56  push_back(exp(logmin + i * logstep));
58  } break;
59  }
60  }
T sqrt(T t)
Definition: SSEVec.h:23
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})

◆ ~EquidistantInLogSpace()

virtual npstat::EquidistantInLogSpace::~EquidistantInLogSpace ( )
inlinevirtual

Definition at line 38 of file EquidistantSequence.h.

38 {}

◆ EquidistantInLogSpace() [2/2]

npstat::EquidistantInLogSpace::EquidistantInLogSpace ( )
delete