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

#include <MrpcCalibSvc.h>

Public Member Functions

 MrpcCalibSvc ()
 
 ~MrpcCalibSvc ()
 
double Time_Amplitude_Correction (unsigned int tdcChannel, unsigned int tdc2Channel)
 
double GetSigma (double, unsigned, int, bool)
 
double GetSigmaElectron (double, unsigned, bool)
 
double GetSigmaMuon (double, unsigned, bool)
 
double GetSigmaPion (double, unsigned, bool)
 
double GetSigmaKaon (double, unsigned, bool)
 
double GetSigmaProton (double, unsigned, bool)
 
double GetEnergyCalibration (double, bool, bool)
 
 MrpcCalibSvc ()
 
 ~MrpcCalibSvc ()
 
double Time_Amplitude_Correction (unsigned int tdcChannel, unsigned int tdc2Channel)
 
double GetSigma (double, unsigned, int, bool)
 
double GetSigmaElectron (double, unsigned, bool)
 
double GetSigmaMuon (double, unsigned, bool)
 
double GetSigmaPion (double, unsigned, bool)
 
double GetSigmaKaon (double, unsigned, bool)
 
double GetSigmaProton (double, unsigned, bool)
 
double GetEnergyCalibration (double, bool, bool)
 

Detailed Description

Constructor & Destructor Documentation

◆ MrpcCalibSvc() [1/2]

MrpcCalibSvc::MrpcCalibSvc ( )

◆ ~MrpcCalibSvc() [1/2]

MrpcCalibSvc::~MrpcCalibSvc ( )

◆ MrpcCalibSvc() [2/2]

MrpcCalibSvc::MrpcCalibSvc ( )

◆ ~MrpcCalibSvc() [2/2]

MrpcCalibSvc::~MrpcCalibSvc ( )

Member Function Documentation

◆ GetEnergyCalibration() [1/2]

double MrpcCalibSvc::GetEnergyCalibration ( double  charge_ns,
bool  neutral,
bool  neighborhood 
)

Definition at line 165 of file MrpcCalibSvc.cxx.

166{
167
168 double energy=0;
169
170 if(neutral==true)
171 {
172 // The values are from photons simulated with geant4!
173 if(charge_ns<15.0716) energy = 326.35-10.6284*15.0716-1.4169*15.0716*15.0716-0.0514292*15.0716*15.0716*15.0716+0.00645421*15.0716*15.0716*15.0716*15.0716;//in MeV: Below this value we assume a constant energyloss!
174 else if(charge_ns>15.9131) energy = -7.91205+0.814588*charge_ns; //Over this value we expect the energyloss to be the same as for charged particles!
175 else energy = 326.35-10.6284*charge_ns-1.4169*charge_ns*charge_ns-0.0514292*charge_ns*charge_ns*charge_ns+0.00645421*charge_ns*charge_ns*charge_ns*charge_ns;// in MeV
176 }
177 else //charged tracks, (combined electrons/positrons in geant4)
178 {
179 if(neighborhood==false) energy = -7.91205+0.814588*charge_ns;// in MeV
180 else
181 {
182 if(15.16>= charge_ns) energy= -72550.7+14230.9*15.16-930.499*15.16*15.16+20.2818*15.16*15.16*15.16;//Minimal loss from fit!
183 if(15.16< charge_ns &&charge_ns<15.7633) energy= -72550.7+14230.9*charge_ns-930.499*charge_ns*charge_ns+20.2818*charge_ns*charge_ns*charge_ns;
184 else energy = -7.91205+0.814588*charge_ns; //Else we will use the not neighborhood distribution as our fit will begin to fall
185 }
186
187 }
188
189 return energy;
190
191}
************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 TofShower::energyCalib().

◆ GetEnergyCalibration() [2/2]

double MrpcCalibSvc::GetEnergyCalibration ( double  ,
bool  ,
bool   
)

◆ GetSigma() [1/2]

double MrpcCalibSvc::GetSigma ( double  momentum,
unsigned  tof_id,
int  particle_species,
bool  dbs 
)

Definition at line 85 of file MrpcCalibSvc.cxx.

86{
87 //paricle species: 0=Electron, 1=Muon, 2=Pion, 3=Kaon, 4 = Proton
88
89 double sigma=0;
90
91 if(particle_species==0) sigma=GetSigmaElectron(momentum,tof_id,dbs);
92 if(particle_species==1) sigma=GetSigmaMuon(momentum,tof_id,dbs);
93 if(particle_species==2) sigma=GetSigmaPion(momentum,tof_id,dbs);
94 if(particle_species==3) sigma=GetSigmaKaon(momentum,tof_id,dbs);
95 if(particle_species==4) sigma=GetSigmaProton(momentum,tof_id,dbs);
96
97 return sigma;
98}
**********INTEGER nmxhep !maximum number of particles DOUBLE PRECISION vhep INTEGER jdahep COMMON hepevt $ !serial number $ !number of particles $ !status code $ !particle ident KF $ !parent particles $ !childreen particles $ !four momentum
double GetSigmaMuon(double, unsigned, bool)
double GetSigmaPion(double, unsigned, bool)
double GetSigmaProton(double, unsigned, bool)
double GetSigmaKaon(double, unsigned, bool)
double GetSigmaElectron(double, unsigned, bool)

Referenced by MrpcTrack::setCalibration(), and MrpcDBSTrack::setCalibration().

◆ GetSigma() [2/2]

double MrpcCalibSvc::GetSigma ( double  ,
unsigned  ,
int  ,
bool   
)

◆ GetSigmaElectron() [1/2]

double MrpcCalibSvc::GetSigmaElectron ( double  momentum,
unsigned  tof_id,
bool  dbs 
)

Definition at line 102 of file MrpcCalibSvc.cxx.

103{
104 double sigma=0.08;
105
106 if(!dbs) sigma =0.0864116*exp(-momentum/0.329858)+0.0898002;
107 if(dbs) sigma =0.103841*exp(-momentum/0.252881)+0.0840766;
108
109 return sigma;
110}
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:252

Referenced by GetSigma().

◆ GetSigmaElectron() [2/2]

double MrpcCalibSvc::GetSigmaElectron ( double  ,
unsigned  ,
bool   
)

◆ GetSigmaKaon() [1/2]

double MrpcCalibSvc::GetSigmaKaon ( double  momentum,
unsigned  tof_id,
bool  dbs 
)

Definition at line 137 of file MrpcCalibSvc.cxx.

138{
139 double sigma=0.08;
140
141 if(!dbs) sigma =0.174625*exp(-momentum/0.201226+1.13756+1.10314*momentum*momentum)+0.0752667;
142 if(dbs) sigma =0.581175*exp(-momentum/0.141733+0.581804+1.75623*momentum*momentum)+0.0767948;
143
144 return sigma;
145}

Referenced by GetSigma().

◆ GetSigmaKaon() [2/2]

double MrpcCalibSvc::GetSigmaKaon ( double  ,
unsigned  ,
bool   
)

◆ GetSigmaMuon() [1/2]

double MrpcCalibSvc::GetSigmaMuon ( double  momentum,
unsigned  tof_id,
bool  dbs 
)

Definition at line 113 of file MrpcCalibSvc.cxx.

114{
115 double sigma=0.08;
116
117 if(!dbs) sigma=0.165892*exp(-momentum/0.25094)+0.0718477;
118 if(dbs) sigma=0.166412*exp(-momentum/0.203065)+0.0718146;
119
120 return sigma;
121}

Referenced by GetSigma().

◆ GetSigmaMuon() [2/2]

double MrpcCalibSvc::GetSigmaMuon ( double  ,
unsigned  ,
bool   
)

◆ GetSigmaPion() [1/2]

double MrpcCalibSvc::GetSigmaPion ( double  momentum,
unsigned  tof_id,
bool  dbs 
)

Definition at line 125 of file MrpcCalibSvc.cxx.

126{
127 double sigma=0.08;
128
129 if(!dbs) sigma =0.338622*exp(-momentum/0.187429)+0.0802867;
130 if(dbs) sigma =0.448576*exp(-momentum/0.147072)+0.078237;
131
132 return sigma;
133}

Referenced by GetSigma().

◆ GetSigmaPion() [2/2]

double MrpcCalibSvc::GetSigmaPion ( double  ,
unsigned  ,
bool   
)

◆ GetSigmaProton() [1/2]

double MrpcCalibSvc::GetSigmaProton ( double  momentum,
unsigned  tof_id,
bool  dbs 
)

Definition at line 149 of file MrpcCalibSvc.cxx.

150{
151 double sigma=0.08;
152
153 if(!dbs) sigma=0.8125*exp(-momentum/0.276857)+0.0828829;
154 if(dbs) sigma=1.1716*exp(-momentum/0.227311)+0.0823852;
155
156 return sigma;
157}

Referenced by GetSigma().

◆ GetSigmaProton() [2/2]

double MrpcCalibSvc::GetSigmaProton ( double  ,
unsigned  ,
bool   
)

◆ Time_Amplitude_Correction() [1/2]

double MrpcCalibSvc::Time_Amplitude_Correction ( unsigned int  tdcChannel,
unsigned int  tdc2Channel 
)

Definition at line 41 of file MrpcCalibSvc.cxx.

42{
43
44 double pulse_length=RawDataUtil::TofTime(tdc2Channel-tdcChannel);
45
46
47 //Calculate the correction:
48 double correction_ta=0;
49
50 if(pulse_length < 4.164){correction_ta=-100000.;} // 4.164 ns = 10 fC; Everything smaller is expected to be noise! ->Deposit charge =0;
51
52 //This function has been extracted with a fit on MC data
53 if(pulse_length>=4.164 && pulse_length<=14.0)
54 {
55 correction_ta=278.03; //value of the function below at pulselength=14.0 as it is ~constant.
56 }
57 else if(pulse_length>14.0 && 15.793)
58 {
59 correction_ta = 1152674.673-307911.4654*pulse_length+30788.47591*pulse_length*pulse_length-1365.232906*pulse_length*pulse_length*pulse_length+22.64702791*pulse_length*pulse_length*pulse_length*pulse_length;
60 if(correction_ta<0)correction_ta=0;
61 }
62 else if(pulse_length >= 15.793)
63 {
64 6104.055949-375.6901764*pulse_length; // Linear fit for the last part of the spectra. The x^4 - polynom was not able to describe this part satisfying.
65 if(correction_ta<0)correction_ta=0;
66 }
67
68 return (correction_ta/1000.);
69
70}
static double TofTime(unsigned int timeChannel)

Referenced by TofRawDataProvider::tofDataMapFull().

◆ Time_Amplitude_Correction() [2/2]

double MrpcCalibSvc::Time_Amplitude_Correction ( unsigned int  tdcChannel,
unsigned int  tdc2Channel 
)

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