CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcWaveform Class Reference

#include <EmcWaveform.h>

Public Member Functions

 EmcWaveform ()
 
 EmcWaveform (int, double, double)
 
 ~EmcWaveform ()
 
double & operator[] (int) const
 
EmcWaveformoperator*= (const double)
 
EmcWaveformoperator/= (const double)
 
EmcWaveformoperator+= (const EmcWaveform &)
 
EmcWaveformoperator= (const EmcWaveform &)
 
int length () const
 
double * GetWave () const
 
double GetTau () const
 
double GetTauTrg () const
 
double GetSampleTime () const
 
double GetSampleTimeTrg () const
 
double GetPeakTime () const
 
double GetPeakTimeTrg () const
 
double GetTimeOffset () const
 
double GetTimeOffsetTrg () const
 
double max (int &binOfMax) const
 
double getADCTrg (int time)
 
int frontEdgeTrg (double thres)
 
void makeWaveform (double energy, double time)
 
void makeWaveformTrg (double energy, double time)
 
void print ()
 
 EmcWaveform ()
 
 EmcWaveform (int, double, double)
 
 ~EmcWaveform ()
 
double & operator[] (int) const
 
EmcWaveformoperator*= (const double)
 
EmcWaveformoperator/= (const double)
 
EmcWaveformoperator+= (const EmcWaveform &)
 
EmcWaveformoperator= (const EmcWaveform &)
 
int length () const
 
double * GetWave () const
 
double GetTau () const
 
double GetTauTrg () const
 
double GetSampleTime () const
 
double GetSampleTimeTrg () const
 
double GetPeakTime () const
 
double GetPeakTimeTrg () const
 
double GetTimeOffset () const
 
double GetTimeOffsetTrg () const
 
double max (int &binOfMax) const
 
double getADCTrg (int time)
 
int frontEdgeTrg (double thres)
 
void makeWaveform (double energy, double time)
 
void makeWaveformTrg (double energy, double time)
 
void print ()
 

Protected Attributes

double * emcWave
 
int array_size
 

Detailed Description

Constructor & Destructor Documentation

◆ EmcWaveform() [1/4]

EmcWaveform::EmcWaveform ( )

Definition at line 17 of file EmcWaveform.cxx.

18{
19 array_size = 60;
20 m_tau = 1000.;
21 m_sampleTime = 50.;
22 m_peakTime = 4000.;
23 m_timeOffset = 2500.;
24 emcWave=new double[array_size];
25
26 for (int i=0; i<array_size;i++)
27 emcWave[i]=0;
28}

◆ EmcWaveform() [2/4]

EmcWaveform::EmcWaveform ( int  size,
double  tau,
double  sampleTime 
)

Definition at line 30 of file EmcWaveform.cxx.

31 :m_tau(tau),m_sampleTime(sampleTime)
32{
33 if(size>0){
34 array_size=size;
35 emcWave=new double[array_size];
36 double *init=emcWave+array_size;
37 while(init!=emcWave) *--init=0.0;
38 }
39}

◆ ~EmcWaveform() [1/2]

EmcWaveform::~EmcWaveform ( )

Definition at line 42 of file EmcWaveform.cxx.

42 {
43 delete [] emcWave;
44 emcWave=0;
45}

◆ EmcWaveform() [3/4]

EmcWaveform::EmcWaveform ( )

◆ EmcWaveform() [4/4]

EmcWaveform::EmcWaveform ( int  ,
double  ,
double   
)

◆ ~EmcWaveform() [2/2]

EmcWaveform::~EmcWaveform ( )

Member Function Documentation

◆ frontEdgeTrg() [1/2]

int EmcWaveform::frontEdgeTrg ( double  thres)

Definition at line 101 of file EmcWaveform.cxx.

102{
103 int binOfMax = -1;
104 for (int i=0;i<array_size;i++)
105 {
106 if (emcWave[i]>thres)
107 {
108 binOfMax = i;
109 break;
110 }
111 }
112 return binOfMax;
113}

Referenced by BesTrigL1::getEmcAnalogSig().

◆ frontEdgeTrg() [2/2]

int EmcWaveform::frontEdgeTrg ( double  thres)

◆ getADCTrg() [1/2]

double EmcWaveform::getADCTrg ( int  time)

Definition at line 92 of file EmcWaveform.cxx.

93{
94 double adc = emcWave[0];
95 for(int i = 0; i < array_size; i++) {
96 if(time >= i*m_sampleTime && time < (i+1)*m_sampleTime) adc = emcWave[i];
97 }
98 return adc;
99}
Double_t time

◆ getADCTrg() [2/2]

double EmcWaveform::getADCTrg ( int  time)

◆ GetPeakTime() [1/2]

double EmcWaveform::GetPeakTime ( ) const
inline

Definition at line 67 of file Emc/EmcWaveform/EmcWaveform-00-00-03/EmcWaveform/EmcWaveform.h.

67{ return m_peakTime; }

◆ GetPeakTime() [2/2]

double EmcWaveform::GetPeakTime ( ) const
inline

Definition at line 67 of file InstallArea/include/EmcWaveform/EmcWaveform/EmcWaveform.h.

67{ return m_peakTime; }

◆ GetPeakTimeTrg() [1/2]

double EmcWaveform::GetPeakTimeTrg ( ) const
inline

Definition at line 68 of file Emc/EmcWaveform/EmcWaveform-00-00-03/EmcWaveform/EmcWaveform.h.

68{ return m_peakTimeTrg; }

◆ GetPeakTimeTrg() [2/2]

double EmcWaveform::GetPeakTimeTrg ( ) const
inline

Definition at line 68 of file InstallArea/include/EmcWaveform/EmcWaveform/EmcWaveform.h.

68{ return m_peakTimeTrg; }

◆ GetSampleTime() [1/2]

double EmcWaveform::GetSampleTime ( ) const
inline

Definition at line 65 of file Emc/EmcWaveform/EmcWaveform-00-00-03/EmcWaveform/EmcWaveform.h.

65{ return m_sampleTime; }

◆ GetSampleTime() [2/2]

double EmcWaveform::GetSampleTime ( ) const
inline

Definition at line 65 of file InstallArea/include/EmcWaveform/EmcWaveform/EmcWaveform.h.

65{ return m_sampleTime; }

◆ GetSampleTimeTrg() [1/2]

double EmcWaveform::GetSampleTimeTrg ( ) const
inline

Definition at line 66 of file Emc/EmcWaveform/EmcWaveform-00-00-03/EmcWaveform/EmcWaveform.h.

66{ return m_sampleTimeTrg; }

◆ GetSampleTimeTrg() [2/2]

double EmcWaveform::GetSampleTimeTrg ( ) const
inline

Definition at line 66 of file InstallArea/include/EmcWaveform/EmcWaveform/EmcWaveform.h.

66{ return m_sampleTimeTrg; }

◆ GetTau() [1/2]

double EmcWaveform::GetTau ( ) const
inline

Definition at line 63 of file Emc/EmcWaveform/EmcWaveform-00-00-03/EmcWaveform/EmcWaveform.h.

63{ return m_tau; }

◆ GetTau() [2/2]

double EmcWaveform::GetTau ( ) const
inline

Definition at line 63 of file InstallArea/include/EmcWaveform/EmcWaveform/EmcWaveform.h.

63{ return m_tau; }

◆ GetTauTrg() [1/2]

double EmcWaveform::GetTauTrg ( ) const
inline

Definition at line 64 of file Emc/EmcWaveform/EmcWaveform-00-00-03/EmcWaveform/EmcWaveform.h.

64{ return m_tauTrg; }

◆ GetTauTrg() [2/2]

double EmcWaveform::GetTauTrg ( ) const
inline

Definition at line 64 of file InstallArea/include/EmcWaveform/EmcWaveform/EmcWaveform.h.

64{ return m_tauTrg; }

◆ GetTimeOffset() [1/2]

double EmcWaveform::GetTimeOffset ( ) const
inline

Definition at line 69 of file Emc/EmcWaveform/EmcWaveform-00-00-03/EmcWaveform/EmcWaveform.h.

69{ return m_timeOffset; }

◆ GetTimeOffset() [2/2]

double EmcWaveform::GetTimeOffset ( ) const
inline

Definition at line 69 of file InstallArea/include/EmcWaveform/EmcWaveform/EmcWaveform.h.

69{ return m_timeOffset; }

◆ GetTimeOffsetTrg() [1/2]

double EmcWaveform::GetTimeOffsetTrg ( ) const
inline

Definition at line 70 of file Emc/EmcWaveform/EmcWaveform-00-00-03/EmcWaveform/EmcWaveform.h.

70{ return m_timeOffsetTrg; }

◆ GetTimeOffsetTrg() [2/2]

double EmcWaveform::GetTimeOffsetTrg ( ) const
inline

Definition at line 70 of file InstallArea/include/EmcWaveform/EmcWaveform/EmcWaveform.h.

70{ return m_timeOffsetTrg; }

◆ GetWave() [1/2]

double * EmcWaveform::GetWave ( ) const
inline

◆ GetWave() [2/2]

double * EmcWaveform::GetWave ( ) const
inline

Definition at line 62 of file InstallArea/include/EmcWaveform/EmcWaveform/EmcWaveform.h.

62{ return emcWave; }

◆ length() [1/2]

int EmcWaveform::length ( ) const
inline

◆ length() [2/2]

int EmcWaveform::length ( ) const
inline

◆ makeWaveform() [1/2]

void EmcWaveform::makeWaveform ( double  energy,
double  time 
)

Definition at line 131 of file EmcWaveform.cxx.

132{
133 double time0 = time*m_sampleTime+m_timeOffset-m_peakTime; //start time
134 double tempTime = 0; //time for each bin
135
136 double peak = m_peakTime*m_peakTime*m_peakTime*m_peakTime*exp(-m_peakTime/m_tau)/24;
137
138 for (int i=0;i<array_size;i++)
139 {
140 tempTime = i*m_sampleTime + m_timeOffset - time0;
141 if(tempTime>0)
142 emcWave[i] +=
143 energy*tempTime*tempTime*tempTime*tempTime*exp(-tempTime/m_tau)/(24*peak);
144 }
145}
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:252
************Class m_ypar INTEGER m_KeyWgt INTEGER m_nphot INTEGER m_KeyGPS INTEGER m_IsBeamPolarized INTEGER m_EvtGenInterface DOUBLE PRECISION m_Emin DOUBLE PRECISION m_sphot DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_q2 DOUBLE PRECISION m_PolBeam2 DOUBLE PRECISION m_xErrPb *COMMON c_KK2f $ !CMS energy average $ !Spin Polarization vector first beam $ !Spin Polarization vector second beam $ !Beam energy spread[GeV] $ !minimum hadronization energy[GeV] $ !input READ never touch them !$ !debug facility $ !maximum weight $ !inverse alfaQED $ !minimum real photon energy
Definition: KK2f.h:50

Referenced by EmcDigi::operator+=().

◆ makeWaveform() [2/2]

void EmcWaveform::makeWaveform ( double  energy,
double  time 
)

◆ makeWaveformTrg() [1/2]

void EmcWaveform::makeWaveformTrg ( double  energy,
double  time 
)

Definition at line 115 of file EmcWaveform.cxx.

116{
117 double time0 = time*m_sampleTime+m_timeOffset-m_peakTime; //start time
118 double tempTime = 0; //time for each bin
119
120 double peak = m_peakTime*m_peakTime*m_peakTime*m_peakTime*exp(-m_peakTime/m_tau)/24;
121
122 for (int i=0;i<array_size;i++)
123 {
124 tempTime = i*m_sampleTime + m_timeOffset - time0;
125 if(tempTime>0)
126 emcWave[i] +=
127 energy*tempTime*tempTime*tempTime*tempTime*exp(-tempTime/m_tau)/(24*peak);
128 }
129}

Referenced by BesTrigL1::getEmcAnalogSig().

◆ makeWaveformTrg() [2/2]

void EmcWaveform::makeWaveformTrg ( double  energy,
double  time 
)

◆ max() [1/2]

double EmcWaveform::max ( int &  binOfMax) const

Definition at line 77 of file EmcWaveform.cxx.

78{
79 double maxi=emcWave[0];
80 binOfMax = 0;
81 for (int i=1;i<array_size;i++)
82 {
83 if (emcWave[i]>maxi)
84 {
85 maxi=emcWave[i];
86 binOfMax = i;
87 }
88 }
89 return maxi;
90}

Referenced by BesTrigL1::findEmcPeakTime(), and EmcDigi::operator+=().

◆ max() [2/2]

double EmcWaveform::max ( int &  binOfMax) const

◆ operator*=() [1/2]

EmcWaveform & EmcWaveform::operator*= ( const double  scale)

Definition at line 48 of file EmcWaveform.cxx.

49{
50 for (int i=0; i<array_size;i++) emcWave[i]*=scale;
51 return *this;
52}

◆ operator*=() [2/2]

EmcWaveform & EmcWaveform::operator*= ( const double  )

◆ operator+=() [1/2]

EmcWaveform & EmcWaveform::operator+= ( const EmcWaveform assign)

Definition at line 60 of file EmcWaveform.cxx.

61{
62 for (int i=0; i<array_size;i++) emcWave[i]+=assign[i];
63 return *this;
64}

◆ operator+=() [2/2]

EmcWaveform & EmcWaveform::operator+= ( const EmcWaveform )

◆ operator/=() [1/2]

EmcWaveform & EmcWaveform::operator/= ( const double  scale)

Definition at line 54 of file EmcWaveform.cxx.

55{
56 for (int i=0; i<array_size;i++) emcWave[i]/=scale;
57 return *this;
58}

◆ operator/=() [2/2]

EmcWaveform & EmcWaveform::operator/= ( const double  )

◆ operator=() [1/2]

EmcWaveform & EmcWaveform::operator= ( const EmcWaveform assign)

Definition at line 66 of file EmcWaveform.cxx.

67{
68 if (this != &assign) {
69 if (emcWave!=0) delete [] emcWave;
70 emcWave=new double[assign.array_size];
72 for (int i=0;i<array_size;i++) emcWave[i]=assign[i];
73 }
74 return *this;
75}

◆ operator=() [2/2]

EmcWaveform & EmcWaveform::operator= ( const EmcWaveform )

◆ operator[]() [1/2]

double & EmcWaveform::operator[] ( int  index) const
inline

Definition at line 100 of file Emc/EmcWaveform/EmcWaveform-00-00-03/EmcWaveform/EmcWaveform.h.

101{
102 if(index<0 || index>array_size-1){
103 cout << "Array bounds exceeded. Index " << index << endl;
104 ::abort();
105 }
106 return emcWave[index];
107}

◆ operator[]() [2/2]

double & EmcWaveform::operator[] ( int  ) const
inline

◆ print() [1/2]

void EmcWaveform::print ( )

Definition at line 147 of file EmcWaveform.cxx.

148{
149 cout<<"New Wave!"<<endl;
150 for(int i=0;i<array_size;i++)
151 cout<<emcWave[i]<<"\t";
152 cout<<endl;
153}

◆ print() [2/2]

void EmcWaveform::print ( )

Member Data Documentation

◆ array_size

◆ emcWave


The documentation for this class was generated from the following files: