CMS 3D CMS Logo

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

shaper for ZDC More...

#include <ZDCShape.h>

Inheritance diagram for ZDCShape:
CaloVShape

Public Member Functions

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

Private Member Functions

void computeShapeZDC ()
 

Private Attributes

int nbin_
 
std::vector< float > nt_
 

Detailed Description

shaper for ZDC

Definition at line 15 of file ZDCShape.h.

Constructor & Destructor Documentation

◆ ZDCShape() [1/2]

ZDCShape::ZDCShape ( )

Definition at line 4 of file ZDCShape.cc.

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

References computeShapeZDC().

◆ ZDCShape() [2/2]

ZDCShape::ZDCShape ( const ZDCShape d)

Definition at line 6 of file ZDCShape.cc.

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

◆ ~ZDCShape()

ZDCShape::~ZDCShape ( )
inlineoverride

Definition at line 20 of file ZDCShape.h.

20 {}

Member Function Documentation

◆ computeShapeZDC()

void ZDCShape::computeShapeZDC ( )
private

Definition at line 10 of file ZDCShape.cc.

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

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

Referenced by ZDCShape().

◆ operator()()

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

Implements CaloVShape.

Definition at line 31 of file ZDCShape.cc.

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

References nbin_, nt_, and ntuplemaker::time.

◆ timeToRise()

double ZDCShape::timeToRise ( ) const
overridevirtual

Implements CaloVShape.

Definition at line 8 of file ZDCShape.cc.

8 { return 0.; }

Member Data Documentation

◆ nbin_

int ZDCShape::nbin_
private

Definition at line 28 of file ZDCShape.h.

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

◆ nt_

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

Definition at line 29 of file ZDCShape.h.

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

CaloVShape::CaloVShape
CaloVShape()
Definition: CaloVShape.h:13
ZDCShape::nbin_
int nbin_
Definition: ZDCShape.h:28
ZDCShape::computeShapeZDC
void computeShapeZDC()
Definition: ZDCShape.cc:10
ZDCShape::nt_
std::vector< float > nt_
Definition: ZDCShape.h:29
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