CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

HFShape Class Reference

shaper for HF More...

#include <HFShape.h>

Inheritance diagram for HFShape:
CaloVShape

List of all members.

Public Member Functions

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

Private Member Functions

void computeShapeHF ()

Private Attributes

int nbin_
std::vector< float > nt_

Detailed Description

shaper for HF

Definition at line 16 of file HFShape.h.


Constructor & Destructor Documentation

HFShape::HFShape ( )

Definition at line 4 of file HFShape.cc.

References computeShapeHF().

: nbin_(256),
  nt_(nbin_, 0.)
{   
  computeShapeHF();
}
HFShape::HFShape ( const HFShape d)

Definition at line 12 of file HFShape.cc.

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

Definition at line 23 of file HFShape.h.

{}

Member Function Documentation

void HFShape::computeShapeHF ( ) [private]

Definition at line 25 of file HFShape.cc.

References funct::exp(), j, reco::ParticleMasses::k0, nbin_, lumiNorm::norm, nt_, p1, p2, and p4.

Referenced by HFShape().

{

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

  const float k0=0.7956; // shape parameters
  const float p2=1.355;
  const float p4=2.327;
  const float p1=4.3;    // position parameter

  int j;
  float norm,r0,sigma0;

  // HF SHAPE
  norm = 0.0;
  for( j = 0; j < 25 && j < nbin_; j++){

    r0 = j-p1;
    if (r0<0) sigma0 = p2;
    else sigma0 =  p2*p4;
    r0 = r0/sigma0;
    if(r0 < k0) nt_[j] = exp(-0.5*r0*r0);
    else nt_[j] = exp(0.5*k0*k0-k0*r0);
    norm += nt_[j];
  }
  // normalize pulse area to 1.0
  for( j = 0; j < 25 && j < nbin_; j++){
    nt_[j] /= norm;
  }
}
double HFShape::operator() ( double  time) const [virtual]

Implements CaloVShape.

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

Implements CaloVShape.

Definition at line 20 of file HFShape.cc.

{
   return 0. ;
}

Member Data Documentation

int HFShape::nbin_ [private]

Definition at line 32 of file HFShape.h.

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

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

Definition at line 33 of file HFShape.h.

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