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

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, SimDataFormats::CaloAnalysis::sc, 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);
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  }
T sqrt(T t)
Definition: SSEVec.h:19
virtual npstat::EquidistantInLogSpace::~EquidistantInLogSpace ( )
inlinevirtual

Definition at line 39 of file EquidistantSequence.h.

39 {}
npstat::EquidistantInLogSpace::EquidistantInLogSpace ( )
privatedelete