--- PamelaDigitizer/DigitizeTOF.cxx 2008/12/18 17:11:47 1.4 +++ PamelaDigitizer/DigitizeTOF.cxx 2009/08/11 14:56:30 1.6 @@ -101,11 +101,12 @@ pmtleft=0; pmtright=0; // WM: S12 paddles are "reversed" (Nov'07) - if (ip==2) + if (ip==2){ if (ipad==0) ipad=1; else ipad=0; + } if ((ip>-1)&&(ip<6)) { //ToF paddles only, not S4 Paddle2Pmt(ip, ipad, &pmtleft, &pmtright); // DC: evaluates mean position and path inside the paddle @@ -463,22 +464,33 @@ Int_t error = 0,temp=0; GL_PARAM *glparam = new GL_PARAM(); error = glparam->Query_GL_PARAM(3,202,fDbc); - calfile.str(""); - calfile << glparam->PATH.Data() << "/"; - calfile << glparam->NAME.Data(); - printf("\n Using TOF calibration file: \n %s\n",calfile.str().c_str()); - ifstream fileTriggerCalib; - fileTriggerCalib.open(calfile.str().c_str()); - if(!fileTriggerCalib)printf("debug: no trigger calib file!\n"); - // correct readout WM Oct '07 - for(Int_t i=0; i> temp; - fileTriggerCalib >> atte1[i]; - fileTriggerCalib >> lambda1[i]; - fileTriggerCalib >> atte2[i]; - fileTriggerCalib >> lambda2[i]; - fileTriggerCalib >> temp; + if(!error){ + calfile.str(""); + calfile << glparam->PATH.Data() << "/"; + calfile << glparam->NAME.Data(); + printf("\n Using TOF calibration file: \n %s\n",calfile.str().c_str()); + ifstream fileTriggerCalib; + fileTriggerCalib.open(calfile.str().c_str()); + for(Int_t i=0; i> temp; + fileTriggerCalib >> atte1[i]; + fileTriggerCalib >> lambda1[i]; + fileTriggerCalib >> atte2[i]; + fileTriggerCalib >> lambda2[i]; + fileTriggerCalib >> temp; + } + fileTriggerCalib.close(); + } + else{ + cout<