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

CastorPulseShapes::Shape::Shape ( )

Definition at line 37 of file CastorPulseShapes.cc.

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

Member Function Documentation

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

Definition at line 61 of file CastorPulseShapes.cc.

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

Referenced by getTpeak().

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 }
std::vector< float > shape_
float CastorPulseShapes::Shape::getTpeak ( ) const
inline
float CastorPulseShapes::Shape::integrate ( double  tmin,
double  tmax 
) const

Definition at line 70 of file CastorPulseShapes.cc.

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

Referenced by getTpeak().

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 }
float at(double time) const
float CastorPulseShapes::Shape::operator() ( double  time) const

Definition at line 52 of file CastorPulseShapes.cc.

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

Referenced by getTpeak().

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 }
std::vector< float > shape_
void CastorPulseShapes::Shape::setNBin ( int  n)

Definition at line 42 of file CastorPulseShapes.cc.

References dqmiodumpmetadata::n.

Referenced by CastorPulseShapes::computeCastorShape().

42  {
43  nbin_ = n;
44  shape_ = std::vector<float>(n, 0.0f);
45 }
std::vector< float > shape_
void CastorPulseShapes::Shape::setShapeBin ( int  i,
float  f 
)

Definition at line 47 of file CastorPulseShapes.cc.

References f, and mps_fire::i.

Referenced by CastorPulseShapes::computeCastorShape().

47  {
48  if (i >= 0 && i < nbin_)
49  shape_[i] = f;
50 }
std::vector< float > shape_
double f[11][100]

Member Data Documentation

int CastorPulseShapes::Shape::nbin_
private

Definition at line 26 of file CastorPulseShapes.h.

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

Definition at line 25 of file CastorPulseShapes.h.

float CastorPulseShapes::Shape::tpeak_
private

Definition at line 27 of file CastorPulseShapes.h.

Referenced by getTpeak().