CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 

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 38 of file EquidistantSequence.h.

Constructor & Destructor Documentation

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

Definition at line 38 of file EquidistantSequence.cc.

References create_public_lumi_plots::exp, i, fff_deleter::log, and mathSSE::sqrt().

40  : std::vector<double>()
41  {
42  if (nScales)
43  if (!(minScale > 0.0 && maxScale > 0.0))
45  "In npstat::EquidistantInLogSpace constructor: "
46  "minimum and maximum scales must be positive");
47  switch (nScales)
48  {
49  case 0:
50  break;
51 
52  case 1:
53  {
54  this->reserve(nScales);
55  const double sc = (minScale == maxScale ? minScale :
56  sqrt(minScale*maxScale));
57  push_back(sc);
58  }
59  break;
60 
61  default:
62  {
63  this->reserve(nScales);
64  const double logmax = log(maxScale);
65  const double logmin = log(minScale);
66  const double logstep = (logmax - logmin)/(nScales - 1);
67  push_back(minScale);
68  for (unsigned i=1; i<nScales - 1; ++i)
69  push_back(exp(logmin + i*logstep));
70  push_back(maxScale);
71  }
72  break;
73  }
74  }
int i
Definition: DBlmapReader.cc:9
T sqrt(T t)
Definition: SSEVec.h:48
virtual npstat::EquidistantInLogSpace::~EquidistantInLogSpace ( )
inlinevirtual

Definition at line 43 of file EquidistantSequence.h.

43 {}
npstat::EquidistantInLogSpace::EquidistantInLogSpace ( )
private