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.

References computeShapeZDC().

4 : nbin_(256), nt_(nbin_, 0.) { computeShapeZDC(); }
int nbin_
Definition: ZDCShape.h:28
void computeShapeZDC()
Definition: ZDCShape.cc:10
std::vector< float > nt_
Definition: ZDCShape.h:29

◆ 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_) {}
d
Definition: ztail.py:151
int nbin_
Definition: ZDCShape.h:28
std::vector< float > nt_
Definition: ZDCShape.h:29

◆ ~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.

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

Referenced by ZDCShape().

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 }
int nbin_
Definition: ZDCShape.h:28
std::vector< float > nt_
Definition: ZDCShape.h:29

◆ operator()()

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

Implements CaloVShape.

Definition at line 31 of file ZDCShape.cc.

References nbin_, nt_, and protons_cff::time.

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 }
int nbin_
Definition: ZDCShape.h:28
std::vector< float > nt_
Definition: ZDCShape.h:29

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