8#include "EmcRec/EmcRecParameter.h"
9#include "TGraph2DErrors.h"
17pthread_mutex_t EmcRecParameter::m_pthread_lock = PTHREAD_MUTEX_INITIALIZER;
20EmcRecParameter::EmcRecParameter()
22 string paraPath = getenv(
"EMCRECROOT");
24 string paraPath1(paraPath);
25 string paraPath2(paraPath);
26 paraPath +=
"/share/EmcRecPara.dat";
29 in.open(paraPath.c_str());
32 const int maxCharOfOneLine=255;
33 char temp[maxCharOfOneLine];
35 while(in.peek()!=EOF) {
36 in.getline(temp,maxCharOfOneLine);
37 if(temp[0]==
'#')
continue;
41 istringstream(temp)>>fElectronicsNoiseLevel>>fEThresholdSeed>>fEThresholdCluster>>fLogPosOffset;
44 istringstream(temp)>>fMoliereRadius>>fLateralProfile;
47 istringstream(temp)>>eCorr[0]>>eCorr[1]>>eCorr[2]>>eCorr[3];
50 istringstream(temp)>>sigE[0]>>sigE[1]>>sigE[2]
51 >>sigTheta[0]>>sigTheta[1]>>sigPhi[0]>>sigPhi[1];
54 istringstream(temp)>>hitNb[0]>>hitNb[1]>>hitNb[2];
57 istringstream(temp)>>elecBias[0]>>elecBias[1]>>elecBias[2]
58 >>elecBias[3]>>elecBias[4];
61 istringstream(temp)>>smCut[0]>>smCut[1]>>smCut[2]>>smCut[3];
69 paraPath1 +=
"/share/Peak1.843_10.12calib.dat";
71 in1.open(paraPath1.c_str());
74 double sigma,sigmaerr,peakerr;
75 for(
int i=0;i<56;i++) {
76 in1>>ntheta>>sigma>>sigmaerr>>peak[i]>>peakerr;
81 paraPath2 +=
"/share/evset.txt";
83 in2.open(paraPath2.c_str());
85 double energy,thetaid,peak1,peakerr1,res,reserr;
87 dt =
new TGraph2DErrors();
88 dtErr =
new TGraph2DErrors();
89 for(
int i=0;i<504;i++){
96 dt->SetPoint(i,
energy,thetaid,peak1);
97 dt->SetPointError(i,0,0,peakerr1);
98 dtErr->SetPoint(i,
energy,thetaid,res);
99 dtErr->SetPointError(i,0,0,reserr);
106EmcRecParameter::~EmcRecParameter()
125 return fpInstance!=0;
139 return fElectronicsNoiseLevel;
144 return fEThresholdSeed;
149 return fEThresholdCluster;
154 return fLogPosOffset;
169 return fMoliereRadius;
174 return fLateralProfile;
220 positionMode1=mode[0];
221 positionMode2=mode[1];
231 if(theid<=0)theid=0.001;
232 if(theid>=27)theid=26.999;
233 Float_t einter = eg + 0.00001;
234 Float_t tinter = theid+0.0001;
235 double ecor=dt->Interpolate(einter,tinter);
236 if(!(ecor))
return Energy5x5;
237 if(ecor<0.5)
return Energy5x5;
238 double EnergyCor=Energy5x5/ecor;
247 if(theid<=0)theid=0.001;
248 if(theid>=27)theid=26.999;
249 Float_t einter = eg + 0.00001;
250 Float_t tinter = theid+0.0001;
251 double err=dtErr->Interpolate(einter,tinter);
************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
double LogPosOffset() const
double ECorr(int n) const
void SetPositionMode(std::vector< std::string > &mode)
double ECorrMC(double eg, double theid) const
static EmcRecParameter & GetInstance()
double EThresholdCluster() const
double EThresholdSeed() const
double HitNb(int n) const
double ElectronicsNoiseLevel() const
double LateralProfile() const
double SigTheta(int n) const
double ElecBias(int n) const
double MoliereRadius() const
double SmCut(int n) const
double SigPhi(int n) const
double ErrMC(double eg, double theid) const