30 for(
int i=0;
i<iSizePar;
i++){
31 for(
int j=0;
j<iSizeGain;
j++){
32 corParams[
j][
i] = 0.0 ;
39 test = fopen(filename.c_str(),
"r");
47 fin.open(filename.c_str());
48 while( (c=fin.peek()) != EOF )
50 fin >> gain>> aa >> bb >> cc;
53 corParams[gain][0]=aa;
54 corParams[gain][1]=bb;
55 corParams[gain][2]=cc;
61 cout <<
" No PN linearity corrections file found, no correction will be applied "<< endl;
79 double xpn=val0/1000.0;
81 if( isFileOK==0)
return 1.0;
83 if( gain> iSizeGain )
cout <<
"Unknown gain, gain has to be lower than "<<iSizeGain << endl;
85 if( gain< iSizeGain ) {
87 cor=xpn*(corParams[gain][0] +xpn*(corParams[gain][1]+xpn*corParams[gain][2]));
89 if(pn!=0) corr = 1.0 - cor/pn;
double getPNCorrectionFactor(double val0, int gain)
TPNCor(std::string filename)