--- YodaProfiler/src/GLTables.cpp 2007/11/26 08:38:52 1.37 +++ YodaProfiler/src/GLTables.cpp 2008/09/29 12:41:34 1.40 @@ -1310,7 +1310,7 @@ // // if the selected calibration is too old (more than 5 orbits old) try to take the closest not corrupted one // - if ( (time-myfromtime)>28500 ){ + if ( (time-myfromtime)>28500 && myfromtime > 0 ){ // myquery.str(""); myquery << "select ID_ROOT_L0, FROM_TIME, TO_TIME, EV_ROOT from GL_CALO_CALIB where SECTION=" << section; @@ -1705,7 +1705,7 @@ */ UInt_t GL_TIMESYNC::ResursTime(UInt_t OBT){ // - return(((UInt_t)((Int_t)(this->DBobt(OBT)-this->DBobt(OBT0))/1000)+TIMESYNC)); + return(((UInt_t)((Int_t)(this->DBobt(OBT)-this->DBobt(OBT0)/1000))+TIMESYNC)); // }; @@ -1732,7 +1732,9 @@ */ Long64_t GL_TIMESYNC::DBobt(UInt_t obt){ // - if ( obt < (obtfirst/2) && obtfirst > (numeric_limits::max()/2) ) return((Long64_t)(obt+numeric_limits::max())); + if ( obt < (obtfirst/2) && obtfirst > (numeric_limits::max()/2) ){ + return((Long64_t)obt+(Long64_t)numeric_limits::max()); + }; // if ( obt > (obtfirst*2) && obt > (numeric_limits::max()/2) ){ return((Long64_t)obt-(Long64_t)numeric_limits::max());