CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CastorShape Class Reference

shaper for Castor More...

#include <CastorShape.h>

Inheritance diagram for CastorShape:
CaloVShape

Public Member Functions

 CastorShape ()
 
 CastorShape (const CastorShape &d)
 
virtual double operator() (double time) const
 
virtual double timeToRise () const
 
virtual ~CastorShape ()
 
- Public Member Functions inherited from CaloVShape
 CaloVShape ()
 
virtual ~CaloVShape ()
 

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

5 : nbin_(256),
6  nt_(nbin_, 0.)
7 {
9 }
void computeShapeCastor()
Definition: CastorShape.cc:20
std::vector< float > nt_
Definition: CastorShape.h:32
CastorShape::CastorShape ( const CastorShape d)

Definition at line 12 of file CastorShape.cc.

13 : CaloVShape(d),
14  nbin_(d.nbin_),
15  nt_(d.nt_)
16 {
17 }
std::vector< float > nt_
Definition: CastorShape.h:32
virtual CastorShape::~CastorShape ( )
inlinevirtual

Definition at line 23 of file CastorShape.h.

References computeShapeCastor(), operator()(), ntuplemaker::time, and timeToRise().

23 {}

Member Function Documentation

void CastorShape::computeShapeCastor ( )
private

Definition at line 20 of file CastorShape.cc.

References JetChargeProducer_cfi::exp, nbin_, and nt_.

Referenced by CastorShape(), and ~CastorShape().

21 {
22 
23  // cout << endl << " ===== computeShapeCastor !!! " << endl << endl;
24 
25  const float ts = 3.0; // time constant in t * exp(-(t/ts)**2)
26 
27 
28  int j;
29  float norm;
30 
31  // HF SHAPE
32  norm = 0.0;
33  for( j = 0; j < 3 * ts && j < nbin_; j++){
34  //nt_[j] = ((float)j)*exp(-((float)(j*j))/(ts*ts));
35  nt_[j] = j * exp(-(j*j)/(ts*ts));
36  norm += nt_[j];
37  }
38  // normalize pulse area to 1.0
39  for( j = 0; j < 3 * ts && j < nbin_; j++){
40  nt_[j] /= norm;
41  }
42 }
std::vector< float > nt_
Definition: CastorShape.h:32
double CastorShape::operator() ( double  time) const
virtual

Implements CaloVShape.

Definition at line 44 of file CastorShape.cc.

References nbin_, and nt_.

Referenced by ~CastorShape().

45 {
46 
47  // return pulse amplitude for request time in ns
48  int jtime;
49  jtime = static_cast<int>(time+0.5);
50 
51  if(jtime >= 0 && jtime < nbin_)
52  return nt_[jtime];
53  else
54  return 0.0;
55 }
std::vector< float > nt_
Definition: CastorShape.h:32
double CastorShape::timeToRise ( ) const
virtual

Implements CaloVShape.

Definition at line 58 of file CastorShape.cc.

Referenced by ~CastorShape().

59 {
60  return 0.0 ;
61 }

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