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
HcalPulseShapes::Shape Class Reference

#include <HcalPulseShapes.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 16 of file HcalPulseShapes.h.

Constructor & Destructor Documentation

HcalPulseShapes::Shape::Shape ( )

Definition at line 139 of file HcalPulseShapes.cc.

References nbin_, and tpeak_.

139  {
140  nbin_=0;
141  tpeak_=0;
142 }

Member Function Documentation

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

Definition at line 161 of file HcalPulseShapes.cc.

References i.

Referenced by HBHEPulseShapeFlagSetter::Initialize(), and HcalNoiseMonitor::ReadHcalPulse().

161  {
162  // shape is in 1 ns steps
163  int i=(int)(t+0.5);
164  float rv=0;
165  if (i>=0 && i<nbin_) rv=shape_[i];
166  return rv;
167 }
int i
Definition: DBlmapReader.cc:9
std::vector< float > shape_
float HcalPulseShapes::Shape::getTpeak ( ) const
inline

Definition at line 21 of file HcalPulseShapes.h.

References tpeak_.

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

Definition at line 169 of file HcalPulseShapes.cc.

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

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

169  {
170  static const float int_delta_ns = 0.05f;
171  double intval = 0.0;
172 
173  for (double t = t1; t < t2; t+= int_delta_ns) {
174  float loedge = at(t);
175  float hiedge = at(t+int_delta_ns);
176  intval += (loedge+hiedge)*int_delta_ns/2.0;
177  }
178 
179  return (float)intval;
180 }
float at(double time) const
float HcalPulseShapes::Shape::operator() ( double  time) const

Definition at line 153 of file HcalPulseShapes.cc.

References i.

153  {
154  // shape is in 1 ns steps
155  int i=(int)(t+0.5);
156  float rv=0;
157  if (i>=0 && i<nbin_) rv=shape_[i];
158  return rv;
159 }
int i
Definition: DBlmapReader.cc:9
std::vector< float > shape_
void HcalPulseShapes::Shape::setNBin ( int  n)

Definition at line 144 of file HcalPulseShapes.cc.

References n.

Referenced by HcalPulseShapes::computeHFShape(), and HcalPulseShapes::computeHPDShape().

144  {
145  nbin_=n;
146  shape_=std::vector<float>(n,0.0f);
147 }
std::vector< float > shape_
void HcalPulseShapes::Shape::setShapeBin ( int  i,
float  f 
)

Definition at line 149 of file HcalPulseShapes.cc.

References f, and i.

Referenced by HcalPulseShapes::computeHFShape(), and HcalPulseShapes::computeHPDShape().

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

Member Data Documentation

int HcalPulseShapes::Shape::nbin_
private

Definition at line 27 of file HcalPulseShapes.h.

Referenced by Shape().

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

Definition at line 26 of file HcalPulseShapes.h.

float HcalPulseShapes::Shape::tpeak_
private

Definition at line 28 of file HcalPulseShapes.h.

Referenced by getTpeak(), and Shape().