/[PAMELA software]/YodaProfiler/src/GLTables.cpp
ViewVC logotype

Diff of /YodaProfiler/src/GLTables.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by mocchiut, Tue Nov 7 12:17:44 2006 UTC revision 1.17 by mocchiut, Thu Nov 9 12:02:54 2006 UTC
# Line 154  GL_TIMESYNC::GL_TIMESYNC(){ Line 154  GL_TIMESYNC::GL_TIMESYNC(){
154    obtfirst = 0;    obtfirst = 0;
155    pktfirst = 0;    pktfirst = 0;
156    toffset  = 0;    toffset  = 0;
157    ID       = 0;    //  ID       = 0;
158    ID_RAW   = 0;    //  ID_RAW   = 0;
159    OBT0     = 0;    OBT0     = 0;
160    TIMESYNC = 0;    TIMESYNC = 0;
161    TYPE     = 0;    TYPE     = 0;
# Line 1304  GL_TIMESYNC::GL_TIMESYNC(UInt_t id, TStr Line 1304  GL_TIMESYNC::GL_TIMESYNC(UInt_t id, TStr
1304    //    //
1305    // look for Resurs offset    // look for Resurs offset
1306    //    //
1307    UInt_t t0 = 0;    T0 = 0;
1308    //    //
1309    //    //
1310    stringstream oss;    stringstream oss;
# Line 1350  GL_TIMESYNC::GL_TIMESYNC(UInt_t id, TStr Line 1350  GL_TIMESYNC::GL_TIMESYNC(UInt_t id, TStr
1350    //      //  
1351    TDatime ti = TDatime(Row->GetField(0));    TDatime ti = TDatime(Row->GetField(0));
1352    TTimeStamp tu = TTimeStamp((UInt_t)ti.GetYear(),(UInt_t)ti.GetMonth(),(UInt_t)ti.GetDay(),(UInt_t)ti.GetHour(),(UInt_t)ti.GetMinute(),(UInt_t)ti.GetSecond(),0,true,0);    TTimeStamp tu = TTimeStamp((UInt_t)ti.GetYear(),(UInt_t)ti.GetMonth(),(UInt_t)ti.GetDay(),(UInt_t)ti.GetHour(),(UInt_t)ti.GetMinute(),(UInt_t)ti.GetSecond(),0,true,0);
1353    t0 = (UInt_t)tu.GetSec();    T0 = (UInt_t)tu.GetSec();
1354    //    //
1355    // look for the correct timesync entry    // look for the correct timesync entry
1356    //    //
1357    myquery.str("");    myquery.str("");
1358    myquery << " SELECT OBT0,TIMESYNC FROM GL_TIMESYNC "    myquery << " SELECT OBT0,TIMESYNC,TYPE FROM GL_TIMESYNC "
1359        << " WHERE ID_RAW = " << idraw        << " WHERE ID_RAW = " << idraw
1360        << ";";        << ";";
1361    pResult = dbc->Query(myquery.str().c_str());    pResult = dbc->Query(myquery.str().c_str());
1362    if ( pResult ){    if ( pResult ){
1363      Row = pResult->Next();      Row = pResult->Next();
1364      if ( (Row != NULL) && ((UInt_t)atoll(Row->GetField(0)) > 0 ) ){      if ( (Row != NULL) && ((UInt_t)atoll(Row->GetField(0)) > 0 ) ){
1365        toffset = (UInt_t)atoll(Row->GetField(1)) - (UInt_t)(this->DBobt((UInt_t)atoll(Row->GetField(0)))/1000) + t0;        OBT0 = (UInt_t)atoll(Row->GetField(0));
1366          TIMESYNC = (UInt_t)atoll(Row->GetField(1));
1367          TYPE = (UInt_t)atoll(Row->GetField(2));
1368          toffset = (UInt_t)atoll(Row->GetField(1)) - (UInt_t)(this->DBobt((UInt_t)atoll(Row->GetField(0)))/1000) + T0;
1369      };      };
1370    };    };
1371    //    //
# Line 1381  UInt_t GL_TIMESYNC::DBabsTime(UInt_t OBT Line 1384  UInt_t GL_TIMESYNC::DBabsTime(UInt_t OBT
1384    //    //
1385  };  };
1386    
1387    /**
1388     *
1389     * Returns the Resurs time given the OBT needed to process inclination and orbital infos
1390     *
1391     */
1392    UInt_t GL_TIMESYNC::ResursTime(UInt_t OBT){  
1393      //
1394      return(((UInt_t)((this->DBobt(OBT)-this->DBobt(OBT0))/1000)+TIMESYNC));
1395      //
1396    };
1397    
1398    
1399  ULong64_t GL_TIMESYNC::DBobt(UInt_t obt){    ULong64_t GL_TIMESYNC::DBobt(UInt_t obt){  
1400    //    //

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.23