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 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 39 of file CastorPulseShapes.cc.

References nbin_, and tpeak_.

39  {
40  nbin_=0;
41  tpeak_=0;
42 }

Member Function Documentation

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

Definition at line 61 of file CastorPulseShapes.cc.

References i.

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_) rv=shape_[i];
66  return rv;
67 }
int i
Definition: DBlmapReader.cc:9
std::vector< float > shape_
float CastorPulseShapes::Shape::getTpeak ( ) const
inline

Definition at line 19 of file CastorPulseShapes.h.

References tpeak_.

19 { return tpeak_; }
float CastorPulseShapes::Shape::integrate ( double  tmin,
double  tmax 
) const

Definition at line 69 of file CastorPulseShapes.cc.

References asciidump::at, and lumiQTWidget::t.

Referenced by RecoFCcorFactorAlgo< S >::RecoFCcorFactorAlgo().

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

Definition at line 53 of file CastorPulseShapes.cc.

References i.

53  {
54  // shape is in 1 ns steps
55  int i=(int)(t+0.5);
56  float rv=0;
57  if (i>=0 && i<nbin_) rv=shape_[i];
58  return rv;
59 }
int i
Definition: DBlmapReader.cc:9
std::vector< float > shape_
void CastorPulseShapes::Shape::setNBin ( int  n)

Definition at line 44 of file CastorPulseShapes.cc.

References n.

Referenced by CastorPulseShapes::computeCastorShape().

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

Definition at line 49 of file CastorPulseShapes.cc.

References f, and i.

Referenced by CastorPulseShapes::computeCastorShape().

49  {
50  if (i>=0 && i<nbin_) shape_[i]=f;
51 }
int i
Definition: DBlmapReader.cc:9
std::vector< float > shape_
double f[11][100]

Member Data Documentation

int CastorPulseShapes::Shape::nbin_
private

Definition at line 25 of file CastorPulseShapes.h.

Referenced by Shape().

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

Definition at line 24 of file CastorPulseShapes.h.

float CastorPulseShapes::Shape::tpeak_
private

Definition at line 26 of file CastorPulseShapes.h.

Referenced by getTpeak(), and Shape().