CMS 3D CMS Logo

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

#include <EquidistantSequence.h>

Inheritance diagram for npstat::EquidistantInLogSpace:

Public Member Functions

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

Private Member Functions

 EquidistantInLogSpace ()=delete
 

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 36 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.

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);
54  push_back(minScale);
55  for (unsigned i = 1; i < nScales - 1; ++i)
56  push_back(exp(logmin + i * logstep));
57  push_back(maxScale);
58  } break;
59  }
60  }

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

◆ ~EquidistantInLogSpace()

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

Definition at line 39 of file EquidistantSequence.h.

39 {}

◆ EquidistantInLogSpace() [2/2]

npstat::EquidistantInLogSpace::EquidistantInLogSpace ( )
privatedelete
mps_fire.i
i
Definition: mps_fire.py:355
fftjetcommon_cfi.nScales
nScales
Definition: fftjetcommon_cfi.py:111
fftjetcommon_cfi.maxScale
maxScale
Definition: fftjetcommon_cfi.py:110
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
npstat::NpstatInvalidArgument
Definition: NpstatException.h:38
fftjetcommon_cfi.minScale
minScale
Definition: fftjetcommon_cfi.py:109
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6