CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CastorPulseShapes::Shape Class Reference

#include <CastorPulseShapes.h>

Public Member Functions

float at (double time) const
 
float getTpeak () const
 
float integrate (double tmin, double tmax) const
 
float operator() (double time) const
 
void setNBin (int n)
 
void setShapeBin (int i, float f)
 
 Shape ()
 

Private Attributes

int nbin_
 
std::vector< float > shape_
 
float tpeak_
 

Detailed Description

Definition at line 14 of file CastorPulseShapes.h.

Constructor & Destructor Documentation

◆ Shape()

CastorPulseShapes::Shape::Shape ( )

Definition at line 37 of file CastorPulseShapes.cc.

37  {
38  nbin_ = 0;
39  tpeak_ = 0;
40 }

References nbin_, and tpeak_.

Member Function Documentation

◆ at()

float CastorPulseShapes::Shape::at ( double  time) const

Definition at line 61 of file CastorPulseShapes.cc.

61  {
62  // shape is in 1 ns steps
63  int i = (int)(t + 0.5);
64  float rv = 0;
65  if (i >= 0 && i < nbin_)
66  rv = shape_[i];
67  return rv;
68 }

References mps_fire::i, createfilelist::int, and OrderedSet::t.

◆ getTpeak()

float CastorPulseShapes::Shape::getTpeak ( ) const
inline

Definition at line 19 of file CastorPulseShapes.h.

19 { return tpeak_; }

References tpeak_.

◆ integrate()

float CastorPulseShapes::Shape::integrate ( double  tmin,
double  tmax 
) const

Definition at line 70 of file CastorPulseShapes.cc.

70  {
71  static const float int_delta_ns = 0.05f;
72  double intval = 0.0;
73 
74  for (double t = t1; t < t2; t += int_delta_ns) {
75  float loedge = at(t);
76  float hiedge = at(t + int_delta_ns);
77  intval += (loedge + hiedge) * int_delta_ns / 2.0;
78  }
79 
80  return (float)intval;
81 }

References OrderedSet::t, RandomServiceHelper::t1, and RandomServiceHelper::t2.

◆ operator()()

float CastorPulseShapes::Shape::operator() ( double  time) const

Definition at line 52 of file CastorPulseShapes.cc.

52  {
53  // shape is in 1 ns steps
54  int i = (int)(t + 0.5);
55  float rv = 0;
56  if (i >= 0 && i < nbin_)
57  rv = shape_[i];
58  return rv;
59 }

References mps_fire::i, createfilelist::int, and OrderedSet::t.

◆ setNBin()

void CastorPulseShapes::Shape::setNBin ( int  n)

Definition at line 42 of file CastorPulseShapes.cc.

42  {
43  nbin_ = n;
44  shape_ = std::vector<float>(n, 0.0f);
45 }

References f, and dqmiodumpmetadata::n.

Referenced by CastorPulseShapes::computeCastorShape().

◆ setShapeBin()

void CastorPulseShapes::Shape::setShapeBin ( int  i,
float  f 
)

Definition at line 47 of file CastorPulseShapes.cc.

47  {
48  if (i >= 0 && i < nbin_)
49  shape_[i] = f;
50 }

References f, and mps_fire::i.

Referenced by CastorPulseShapes::computeCastorShape().

Member Data Documentation

◆ nbin_

int CastorPulseShapes::Shape::nbin_
private

Definition at line 26 of file CastorPulseShapes.h.

Referenced by Shape().

◆ shape_

std::vector<float> CastorPulseShapes::Shape::shape_
private

Definition at line 25 of file CastorPulseShapes.h.

◆ tpeak_

float CastorPulseShapes::Shape::tpeak_
private

Definition at line 27 of file CastorPulseShapes.h.

Referenced by getTpeak(), and Shape().

RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
mps_fire.i
i
Definition: mps_fire.py:355
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
CastorPulseShapes::Shape::tpeak_
float tpeak_
Definition: CastorPulseShapes.h:27
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
CastorPulseShapes::Shape::nbin_
int nbin_
Definition: CastorPulseShapes.h:26
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
CastorPulseShapes::Shape::at
float at(double time) const
Definition: CastorPulseShapes.cc:61
CastorPulseShapes::Shape::shape_
std::vector< float > shape_
Definition: CastorPulseShapes.h:25
OrderedSet.t
t
Definition: OrderedSet.py:90
createfilelist.int
int
Definition: createfilelist.py:10