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)
 
double operator() (double time) const override
 
double timeToRise () const override
 
 ~CastorShape () override
 
- 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 15 of file CastorShape.h.

Constructor & Destructor Documentation

◆ CastorShape() [1/2]

CastorShape::CastorShape ( )

Definition at line 4 of file CastorShape.cc.

4 : nbin_(256), nt_(nbin_, 0.) { computeShapeCastor(); }

References computeShapeCastor().

◆ CastorShape() [2/2]

CastorShape::CastorShape ( const CastorShape d)

Definition at line 6 of file CastorShape.cc.

6 : CaloVShape(d), nbin_(d.nbin_), nt_(d.nt_) {}

◆ ~CastorShape()

CastorShape::~CastorShape ( )
inlineoverride

Definition at line 20 of file CastorShape.h.

20 {}

Member Function Documentation

◆ computeShapeCastor()

void CastorShape::computeShapeCastor ( )
private

Definition at line 8 of file CastorShape.cc.

8  {
9  // cout << endl << " ===== computeShapeCastor !!! " << endl << endl;
10 
11  const float ts = 3.0; // time constant in t * exp(-(t/ts)**2)
12 
13  int j;
14  float norm;
15 
16  // HF SHAPE
17  norm = 0.0;
18  for (j = 0; j < 3 * ts && j < nbin_; j++) {
19  // nt_[j] = ((float)j)*exp(-((float)(j*j))/(ts*ts));
20  nt_[j] = j * exp(-(j * j) / (ts * ts));
21  norm += nt_[j];
22  }
23  // normalize pulse area to 1.0
24  for (j = 0; j < 3 * ts && j < nbin_; j++) {
25  nt_[j] /= norm;
26  }
27 }

References JetChargeProducer_cfi::exp, dqmiolumiharvest::j, nbin_, and nt_.

Referenced by CastorShape().

◆ operator()()

double CastorShape::operator() ( double  time) const
overridevirtual

Implements CaloVShape.

Definition at line 29 of file CastorShape.cc.

29  {
30  // return pulse amplitude for request time in ns
31  int jtime;
32  jtime = static_cast<int>(time + 0.5);
33 
34  if (jtime >= 0 && jtime < nbin_)
35  return nt_[jtime];
36  else
37  return 0.0;
38 }

References nbin_, nt_, and ntuplemaker::time.

◆ timeToRise()

double CastorShape::timeToRise ( ) const
overridevirtual

Implements CaloVShape.

Definition at line 40 of file CastorShape.cc.

40 { return 0.0; }

Member Data Documentation

◆ nbin_

int CastorShape::nbin_
private

Definition at line 28 of file CastorShape.h.

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

◆ nt_

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

Definition at line 29 of file CastorShape.h.

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

CaloVShape::CaloVShape
CaloVShape()
Definition: CaloVShape.h:13
CastorShape::computeShapeCastor
void computeShapeCastor()
Definition: CastorShape.cc:8
CastorShape::nt_
std::vector< float > nt_
Definition: CastorShape.h:29
CastorShape::nbin_
int nbin_
Definition: CastorShape.h:28
ztail.d
d
Definition: ztail.py:151
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
ntuplemaker.time
time
Definition: ntuplemaker.py:310