CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

ZDCShape Class Reference

shaper for ZDC More...

#include <ZDCShape.h>

Inheritance diagram for ZDCShape:
CaloVShape

List of all members.

Public Member Functions

virtual double operator() (double time) const
virtual double timeToRise () const
 ZDCShape (const ZDCShape &d)
 ZDCShape ()
virtual ~ZDCShape ()

Private Member Functions

void computeShapeZDC ()

Private Attributes

int nbin_
std::vector< float > nt_

Detailed Description

shaper for ZDC

Definition at line 16 of file ZDCShape.h.


Constructor & Destructor Documentation

ZDCShape::ZDCShape ( )

Definition at line 4 of file ZDCShape.cc.

References computeShapeZDC().

: nbin_(256),
  nt_(nbin_, 0.)
{   
  computeShapeZDC();
}
ZDCShape::ZDCShape ( const ZDCShape d)

Definition at line 12 of file ZDCShape.cc.

: CaloVShape(d),
  nbin_(d.nbin_),
  nt_(d.nt_)
{
}
virtual ZDCShape::~ZDCShape ( ) [inline, virtual]

Definition at line 23 of file ZDCShape.h.

{}

Member Function Documentation

void ZDCShape::computeShapeZDC ( ) [private]

Definition at line 26 of file ZDCShape.cc.

References funct::exp(), j, nbin_, and nt_.

Referenced by ZDCShape().

{

  //  cout << endl << " ===== computeShapeZDC  !!! " << endl << endl;

  const float ts = 3.0;           // time constant in   t * exp(-(t/ts)**2)


  int j;
  float norm;

  // ZDC SHAPE
  norm = 0.0;
  for( j = 0; j < 3 * ts && j < nbin_; j++){
    //nt_[j] = ((float)j)*exp(-((float)(j*j))/(ts*ts));
    nt_[j] = j * exp(-(j*j)/(ts*ts));
    norm += nt_[j];
  }
  // normalize pulse area to 1.0
  for( j = 0; j < 3 * ts && j < nbin_; j++){
    nt_[j] /= norm;
  }
}
double ZDCShape::operator() ( double  time) const [virtual]

Implements CaloVShape.

Definition at line 50 of file ZDCShape.cc.

References nbin_, and nt_.

{

  // return pulse amplitude for request time in ns
  int jtime;
  jtime = static_cast<int>(time+0.5);

  if(jtime >= 0 && jtime < nbin_)
    return nt_[jtime];
  else 
    return 0.0;
}
double ZDCShape::timeToRise ( ) const [virtual]

Implements CaloVShape.

Definition at line 20 of file ZDCShape.cc.

{
   return 0. ;
}

Member Data Documentation

int ZDCShape::nbin_ [private]

Definition at line 32 of file ZDCShape.h.

Referenced by computeShapeZDC(), and operator()().

std::vector<float> ZDCShape::nt_ [private]

Definition at line 33 of file ZDCShape.h.

Referenced by computeShapeZDC(), and operator()().