29 for(
int i=0;
i<iSizePar;
i++){
30 for(
int j=0;j<iSizeGain;j++){
31 corParams[j][
i] = 0.0 ;
38 test = fopen(filename.c_str(),
"r");
46 fin.open(filename.c_str());
47 while( (c=fin.peek()) != EOF )
49 fin >> gain>> aa >> bb >> cc;
52 corParams[
gain][0]=aa;
53 corParams[
gain][1]=bb;
54 corParams[
gain][2]=cc;
60 cout <<
" No PN linearity corrections file found, no correction will be applied "<< endl;
78 double xpn=val0/1000.0;
80 if( isFileOK==0)
return 1.0;
82 if( gain> iSizeGain )
cout <<
"Unknown gain, gain has to be lower than "<<iSizeGain << endl;
84 if( gain< iSizeGain ) {
86 cor=xpn*(corParams[
gain][0] +xpn*(corParams[
gain][1]+xpn*corParams[
gain][2]));
88 if(pn!=0) corr = 1.0 - cor/pn;
double getPNCorrectionFactor(double val0, int gain)
TPNCor(std::string filename)