CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

CastorShape Class Reference

shaper for Castor More...

#include <CastorShape.h>

Inheritance diagram for CastorShape:
CaloVShape

List of all members.

Public Member Functions

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

Private Member Functions

void computeShapeCastor ()

Private Attributes

int nbin_
std::vector< float > nt_

Detailed Description

shaper for Castor

Definition at line 16 of file CastorShape.h.


Constructor & Destructor Documentation

CastorShape::CastorShape ( )

Definition at line 4 of file CastorShape.cc.

References computeShapeCastor().

: nbin_(256),
  nt_(nbin_, 0.)
{   
  computeShapeCastor();
}
CastorShape::CastorShape ( const CastorShape d)

Definition at line 12 of file CastorShape.cc.

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

Definition at line 23 of file CastorShape.h.

{}

Member Function Documentation

void CastorShape::computeShapeCastor ( ) [private]

Definition at line 20 of file CastorShape.cc.

References create_public_lumi_plots::exp, j, nbin_, and nt_.

Referenced by CastorShape().

{

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

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


  int j;
  float norm;

  // HF 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 CastorShape::operator() ( double  time) const [virtual]

Implements CaloVShape.

Definition at line 44 of file CastorShape.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 CastorShape::timeToRise ( ) const [virtual]

Implements CaloVShape.

Definition at line 58 of file CastorShape.cc.

{
   return 0.0 ;
}  

Member Data Documentation

int CastorShape::nbin_ [private]

Definition at line 31 of file CastorShape.h.

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

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

Definition at line 32 of file CastorShape.h.

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