#include <EmcRecParameter.h>
Public Member Functions | |
bool | DigiCalib () const |
bool | DigiCalib () const |
double | ECorr (int n) const |
double | ECorr (int n) const |
double | ECorrMC (double eg, double theid) const |
double | ECorrMC (double eg, double theid) const |
double | ElecBias (int n) const |
double | ElecBias (int n) const |
double | ElectronicsNoiseLevel () const |
double | ElectronicsNoiseLevel () const |
EmcRecParameter () | |
EmcRecParameter () | |
double | ErrMC (double eg, double theid) const |
double | ErrMC (double eg, double theid) const |
double | EThresholdCluster () const |
double | EThresholdCluster () const |
double | EThresholdSeed () const |
double | EThresholdSeed () const |
double | HitNb (int n) const |
double | HitNb (int n) const |
double | LateralProfile () const |
double | LateralProfile () const |
double | LogPosOffset () const |
double | LogPosOffset () const |
double | MoliereRadius () const |
double | MoliereRadius () const |
double | Peak (int n) const |
double | Peak (int n) const |
std::string | PositionMode1 () const |
std::string | PositionMode1 () const |
std::string | PositionMode2 () const |
std::string | PositionMode2 () const |
void | SetDigiCalib (bool digi) |
void | SetDigiCalib (bool digi) |
void | SetPeak (double e, int n) |
void | SetPeak (double e, int n) |
void | SetPositionMode (std::vector< std::string > &mode) |
void | SetPositionMode (std::vector< std::string > &mode) |
void | SetTimeMax (double max) |
void | SetTimeMax (double max) |
void | SetTimeMin (double min) |
void | SetTimeMin (double min) |
double | SigE (int n) const |
double | SigE (int n) const |
double | SigPhi (int n) const |
double | SigPhi (int n) const |
double | SigTheta (int n) const |
double | SigTheta (int n) const |
double | SmCut (int n) const |
double | SmCut (int n) const |
double | TimeMax () const |
double | TimeMax () const |
double | TimeMin () const |
double | TimeMin () const |
~EmcRecParameter () | |
~EmcRecParameter () | |
Static Public Member Functions | |
bool | Exist () |
bool | Exist () |
EmcRecParameter & | GetInstance () |
EmcRecParameter & | GetInstance () |
void | Kill () |
void | Kill () |
Private Attributes | |
bool | digiCalib |
TGraph2DErrors * | dt |
TGraph2DErrors * | dt |
TGraph2DErrors * | dtErr |
TGraph2DErrors * | dtErr |
double | eCorr [4] |
double | elecBias [5] |
double | fElectronicsNoiseLevel |
double | fEThresholdCluster |
double | fEThresholdSeed |
double | fLateralProfile |
double | fLogPosOffset |
double | fMoliereRadius |
double | fTimeMax |
double | fTimeMin |
double | hitNb [3] |
double | peak [56] |
std::string | positionMode1 |
std::string | positionMode2 |
double | sigE [3] |
double | sigPhi [2] |
double | sigTheta [2] |
double | smCut [4] |
Static Private Attributes | |
EmcRecParameter * | fpInstance |
EmcRecParameter * | fpInstance = 0 |
|
00018 { 00019 string paraPath = getenv("EMCRECROOT"); 00020 if(paraPath=="") cout<<"EmcRec environment not set!"; 00021 string paraPath1(paraPath); 00022 string paraPath2(paraPath); 00023 paraPath += "/share/EmcRecPara.dat"; 00024 //cout<<paraPath<<endl; 00025 ifstream in; 00026 in.open(paraPath.c_str()); 00027 assert(in); 00028 00029 const int maxCharOfOneLine=255; 00030 char temp[maxCharOfOneLine]; 00031 int inputNo=0; 00032 while(in.peek()!=EOF) { 00033 in.getline(temp,maxCharOfOneLine); 00034 if(temp[0]=='#') continue; 00035 inputNo++; 00036 switch(inputNo) { 00037 case 1: 00038 istringstream(temp)>>fElectronicsNoiseLevel>>fEThresholdSeed>>fEThresholdCluster>>fLogPosOffset; 00039 break; 00040 case 2: 00041 istringstream(temp)>>fMoliereRadius>>fLateralProfile; 00042 break; 00043 case 3: 00044 istringstream(temp)>>eCorr[0]>>eCorr[1]>>eCorr[2]>>eCorr[3]; 00045 break; 00046 case 4: 00047 istringstream(temp)>>sigE[0]>>sigE[1]>>sigE[2] 00048 >>sigTheta[0]>>sigTheta[1]>>sigPhi[0]>>sigPhi[1]; 00049 break; 00050 case 5: 00051 istringstream(temp)>>hitNb[0]>>hitNb[1]>>hitNb[2]; 00052 break; 00053 case 6: 00054 istringstream(temp)>>elecBias[0]>>elecBias[1]>>elecBias[2] 00055 >>elecBias[3]>>elecBias[4]; 00056 break; 00057 case 7: 00058 istringstream(temp)>>smCut[0]>>smCut[1]>>smCut[2]>>smCut[3]; 00059 break; 00060 default: 00061 break; 00062 } 00063 } 00064 in.close(); 00065 00066 paraPath1 += "/share/Peak1.843_10.12calib.dat"; 00067 ifstream in1; 00068 in1.open(paraPath1.c_str()); 00069 assert(in1); 00070 int ntheta; 00071 double sigma,sigmaerr,peakerr; 00072 for(int i=0;i<56;i++) { 00073 in1>>ntheta>>sigma>>sigmaerr>>peak[i]>>peakerr; 00074 } 00075 in1.close(); 00076 00077 // Read energy correction parameters from PhotonCor/McCor 00078 paraPath2 += "/share/evset.txt"; 00079 ifstream in2; 00080 in2.open(paraPath2.c_str()); 00081 assert(in2); 00082 double energy,thetaid,peak1,peakerr1,res,reserr; 00083 //double ep[18]={0.03,0.04,0.05,0.075,0.1,0.125,0.15,0.2,0.25,0.3,0.4,0.5,0.75,1.0,1.25,1.5,1.75,2.0}; 00084 dt = new TGraph2DErrors(); 00085 dtErr = new TGraph2DErrors(); 00086 for(int i=0;i<504;i++){ 00087 in2>>energy; 00088 in2>>thetaid; 00089 in2>>peak1; 00090 in2>>peakerr1; 00091 in2>>res; 00092 in2>>reserr; 00093 dt->SetPoint(i,energy,thetaid,peak1); 00094 dt->SetPointError(i,0,0,peakerr1); 00095 dtErr->SetPoint(i,energy,thetaid,res); 00096 dtErr->SetPointError(i,0,0,reserr); 00097 } 00098 in2.close(); 00099 00100 }
|
|
00104 { 00105 // cout<<"deconstructed"<<endl; 00106 delete dt; 00107 delete dtErr; 00108 }
|
|
|
|
|
|
00057 { return digiCalib; }
|
|
00057 { return digiCalib; }
|
|
|
|
00175 { 00176 return eCorr[n]; 00177 }
|
|
|
|
00224 { 00225 double Energy5x5=eg; 00226 if(eg<0.02)eg=0.02; 00227 if(eg>1.74)eg=1.74; 00228 if(theid<=0)theid=0.001; 00229 if(theid>=27)theid=26.999; 00230 Float_t einter = eg + 0.00001; 00231 Float_t tinter = theid+0.0001; 00232 double ecor=dt->Interpolate(einter,tinter); 00233 if(!(ecor))return Energy5x5; 00234 if(ecor<0.5)return Energy5x5; 00235 double EnergyCor=Energy5x5/ecor; 00236 return EnergyCor; 00237 }
|
|
|
|
00200 { 00201 return elecBias[n]; 00202 }
|
|
|
|
00135 {
00136 return fElectronicsNoiseLevel;
00137 }
|
|
|
|
00241 { 00242 if(eg<0.02)eg=0.02; 00243 if(eg>1.74)eg=1.74; 00244 if(theid<=0)theid=0.001; 00245 if(theid>=27)theid=26.999; 00246 Float_t einter = eg + 0.00001; 00247 Float_t tinter = theid+0.0001; 00248 double err=dtErr->Interpolate(einter,tinter); 00249 return err; 00250 }
|
|
|
|
00145 {
00146 return fEThresholdCluster;
00147 }
|
|
|
|
00140 {
00141 return fEThresholdSeed;
00142 }
|
|
|
|
00121 { 00122 return fpInstance!=0; 00123 }
|
|
|
|
00113 { 00114 if(!Exist()) { 00115 fpInstance=new EmcRecParameter; 00116 } 00117 return *fpInstance; 00118 }
|
|
|
|
00195 { 00196 return hitNb[n]; 00197 }
|
|
|
|
00126 { 00127 if(Exist()) { 00128 delete fpInstance; 00129 fpInstance=0; 00130 } 00131 }
|
|
|
|
00170 {
00171 return fLateralProfile;
00172 }
|
|
|
|
00150 {
00151 return fLogPosOffset;
00152 }
|
|
|
|
00165 {
00166 return fMoliereRadius;
00167 }
|
|
|
|
00210 { 00211 return peak[n]; 00212 }
|
|
00065 { return positionMode1; }
|
|
00065 { return positionMode1; }
|
|
00066 { return positionMode2; }
|
|
00066 { return positionMode2; }
|
|
00058 { digiCalib=digi; }
|
|
00058 { digiCalib=digi; }
|
|
00063 { peak[n]=e; }
|
|
00063 { peak[n]=e; }
|
|
|
|
00215 { 00216 if(mode.size()==2) { 00217 positionMode1=mode[0]; 00218 positionMode2=mode[1]; 00219 } 00220 }
|
|
00061 { fTimeMax=max; }
|
|
00061 { fTimeMax=max; }
|
|
00060 { fTimeMin=min; }
|
|
00060 { fTimeMin=min; }
|
|
|
|
00180 { 00181 return sigE[n]; 00182 }
|
|
|
|
00190 { 00191 return sigPhi[n]; 00192 }
|
|
|
|
00185 { 00186 return sigTheta[n]; 00187 }
|
|
|
|
00205 { 00206 return smCut[n]; 00207 }
|
|
|
|
00160 {
00161 return fTimeMax;
00162 }
|
|
|
|
00155 {
00156 return fTimeMin;
00157 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|