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

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

Definition at line 19 of file CastorPulseShapes.h.

References at(), integrate(), operator()(), ntuplemaker::time, tmax, and tpeak_.

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

Definition at line 69 of file CastorPulseShapes.cc.

References lumiQTWidget::t, and reco::t2.

Referenced by getTpeak(), and 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
auto const T2 &decltype(t1.eta()) t2
Definition: deltaR.h:16
float CastorPulseShapes::Shape::operator() ( double  time) const

Definition at line 53 of file CastorPulseShapes.cc.

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

Referenced by getTpeak().

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

Definition at line 44 of file CastorPulseShapes.cc.

References gen::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 mps_fire::i.

Referenced by CastorPulseShapes::computeCastorShape().

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

Member Data Documentation

int CastorPulseShapes::Shape::nbin_
private

Definition at line 25 of file CastorPulseShapes.h.

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().