CMS 3D CMS Logo

ZDCShape Class Reference

shaper for ZDC More...

#include <SimCalorimetry/HcalSimAlgos/interface/ZDCShape.h>

Inheritance diagram for ZDCShape:

CaloVShape

List of all members.

Public Member Functions

double derivative (double time) const
double getTpeak () const
virtual double operator() (double time) 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(), and CaloVShape::setTpeak().

00005 : nbin_(256),
00006   nt_(nbin_, 0.)
00007 {   
00008   setTpeak(2.0);
00009   computeShapeZDC();
00010 }

ZDCShape::ZDCShape ( const ZDCShape d  ) 

Definition at line 13 of file ZDCShape.cc.

References CaloVShape::setTpeak().

00014 : CaloVShape(d),
00015   nbin_(d.nbin_),
00016   nt_(d.nt_)
00017 {
00018   setTpeak(2.0);
00019 }

virtual ZDCShape::~ZDCShape (  )  [inline, virtual]

Definition at line 23 of file ZDCShape.h.

00023 {}


Member Function Documentation

void ZDCShape::computeShapeZDC (  )  [private]

Definition at line 22 of file ZDCShape.cc.

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

Referenced by ZDCShape().

00023 {
00024 
00025   //  cout << endl << " ===== computeShapeZDC  !!! " << endl << endl;
00026 
00027   const float ts = 3.0;           // time constant in   t * exp(-(t/ts)**2)
00028 
00029 
00030   int j;
00031   float norm;
00032 
00033   // ZDC SHAPE
00034   norm = 0.0;
00035   for( j = 0; j < 3 * ts && j < nbin_; j++){
00036     //nt_[j] = ((float)j)*exp(-((float)(j*j))/(ts*ts));
00037     nt_[j] = j * exp(-(j*j)/(ts*ts));
00038     norm += nt_[j];
00039   }
00040   // normalize pulse area to 1.0
00041   for( j = 0; j < 3 * ts && j < nbin_; j++){
00042     nt_[j] /= norm;
00043   }
00044 }

double ZDCShape::derivative ( double  time  )  const

Definition at line 59 of file ZDCShape.cc.

00060 {
00061   return 0.0;
00062 }

double ZDCShape::getTpeak (  )  const

Reimplemented from CaloVShape.

double ZDCShape::operator() ( double  time  )  const [virtual]

Implements CaloVShape.

Definition at line 46 of file ZDCShape.cc.

References nbin_, and nt_.

00047 {
00048 
00049   // return pulse amplitude for request time in ns
00050   int jtime;
00051   jtime = static_cast<int>(time+0.5);
00052 
00053   if(jtime >= 0 && jtime < nbin_)
00054     return nt_[jtime];
00055   else 
00056     return 0.0;
00057 }


Member Data Documentation

int ZDCShape::nbin_ [private]

Definition at line 33 of file ZDCShape.h.

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

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

Definition at line 34 of file ZDCShape.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:36:02 2009 for CMSSW by  doxygen 1.5.4