CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HFShape Class Reference

shaper for HF More...

#include <HFShape.h>

Inheritance diagram for HFShape:
CaloVShape

Public Member Functions

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

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

5 : nbin_(256),
6  nt_(nbin_, 0.)
7 {
9 }
void computeShapeHF()
Definition: HFShape.cc:25
int nbin_
Definition: HFShape.h:32
std::vector< float > nt_
Definition: HFShape.h:33
HFShape::HFShape ( const HFShape d)

Definition at line 12 of file HFShape.cc.

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

Definition at line 23 of file HFShape.h.

23 {}

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

26 {
27 
28  // cout << endl << " ===== computeShapeHF !!! " << endl << endl;
29 
30  const float k0=0.7956; // shape parameters
31  const float p2=1.355;
32  const float p4=2.327;
33  const float p1=4.3; // position parameter
34 
35  int j;
36  float norm,r0,sigma0;
37 
38  // HF SHAPE
39  norm = 0.0;
40  for( j = 0; j < 25 && j < nbin_; j++){
41 
42  r0 = j-p1;
43  if (r0<0) sigma0 = p2;
44  else sigma0 = p2*p4;
45  r0 = r0/sigma0;
46  if(r0 < k0) nt_[j] = exp(-0.5*r0*r0);
47  else nt_[j] = exp(0.5*k0*k0-k0*r0);
48  norm += nt_[j];
49  }
50  // normalize pulse area to 1.0
51  for( j = 0; j < 25 && j < nbin_; j++){
52  nt_[j] /= norm;
53  }
54 }
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
double p4[4]
Definition: TauolaWrapper.h:92
tuple norm
Definition: lumiNorm.py:78
int nbin_
Definition: HFShape.h:32
int j
Definition: DBlmapReader.cc:9
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
std::vector< float > nt_
Definition: HFShape.h:33
double HFShape::operator() ( double  time) const
virtual

Implements CaloVShape.

Definition at line 56 of file HFShape.cc.

References nbin_, and nt_.

57 {
58 
59  // return pulse amplitude for request time in ns
60  int jtime;
61  jtime = static_cast<int>(time+0.5);
62 
63  if(jtime >= 0 && jtime < nbin_)
64  return nt_[jtime];
65  else
66  return 0.0;
67 }
int nbin_
Definition: HFShape.h:32
std::vector< float > nt_
Definition: HFShape.h:33
double HFShape::timeToRise ( ) const
virtual

Implements CaloVShape.

Definition at line 20 of file HFShape.cc.

21 {
22  return 0. ;
23 }

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