/[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.22 by mocchiut, Wed Jan 31 16:15:02 2007 UTC revision 1.28 by mocchiut, Mon Apr 30 09:16:49 2007 UTC
# Line 1145  Int_t GL_ROOT::Query_GL_ROOT(UInt_t id, Line 1145  Int_t GL_ROOT::Query_GL_ROOT(UInt_t id,
1145            if(t==0) ID     = (UInt_t)atoll(Row->GetField(t));            if(t==0) ID     = (UInt_t)atoll(Row->GetField(t));
1146            if(t==1) ID_RAW = (UInt_t)atoll(Row->GetField(t));            if(t==1) ID_RAW = (UInt_t)atoll(Row->GetField(t));
1147            if(t==2) ID_TIMESYNC = (UInt_t)atoll(Row->GetField(t));            if(t==2) ID_TIMESYNC = (UInt_t)atoll(Row->GetField(t));
1148            if(t==3) PATH   = Row->GetField(t);            if(t==3) PATH   = (TString)gSystem->ExpandPathName(Row->GetField(t))+'/';
1149            if(t==4) NAME   = Row->GetField(t);            if(t==4) NAME   = Row->GetField(t);
1150        };        };
1151    };    };
# Line 1170  Int_t GL_TRK_CALIB::Query_GL_TRK_CALIB(U Line 1170  Int_t GL_TRK_CALIB::Query_GL_TRK_CALIB(U
1170    // ----------------    // ----------------
1171    myquery.str("");    myquery.str("");
1172    myquery << "select ID,ID_ROOT_L0,EV_ROOT_CALIBTRK1,EV_ROOT_CALIBTRK2,FROM_TIME,TO_TIME,OBT1,OBT2,PKT1,PKT2,BOOT_NUMBER,VALIDATION from GL_TRK_CALIB where FROM_TIME <= "<< time;    myquery << "select ID,ID_ROOT_L0,EV_ROOT_CALIBTRK1,EV_ROOT_CALIBTRK2,FROM_TIME,TO_TIME,OBT1,OBT2,PKT1,PKT2,BOOT_NUMBER,VALIDATION from GL_TRK_CALIB where FROM_TIME <= "<< time;
1173    myquery << " AND VALIDATION=1 ORDER BY FROM_TIME DESC LIMIT 1;";        //  myquery << " AND VALIDATION=1 ORDER BY FROM_TIME DESC LIMIT 1;";      // RIVEDERE LA VALIDAZIONE!!!
1174      myquery << " and EV_ROOT_CALIBTRK1>=0 and and EV_ROOT_CALIBTRK2>=0"; // EM! SE MANCA UN PACCHETTO DEI DUE IL PROCESSAMENTO CRASHA... DA RIVEDERE LA VALIDAZIONE      
1175      myquery << " ORDER BY FROM_TIME DESC LIMIT 1;";      
1176    //  myquery << " ORDER BY FROM_TIME DESC LIMIT 1;";          //  myquery << " ORDER BY FROM_TIME DESC LIMIT 1;";      
1177    if ( !this->GetGLTABLES()->IsConnected(dbc) ) return -57;      if ( !this->GetGLTABLES()->IsConnected(dbc) ) return -57;  
1178    this->GetGLTABLES()->AddQ();    this->GetGLTABLES()->AddQ();
# Line 1338  Int_t GL_PARAM::Query_GL_PARAM(UInt_t ti Line 1340  Int_t GL_PARAM::Query_GL_PARAM(UInt_t ti
1340    // ----------------        // ----------------    
1341    myquery.str("");    myquery.str("");
1342    myquery << " select ";    myquery << " select ";
1343    myquery << " ID, PATH, NAME, DESCR, TYPE, FROM_TIME,TO_TIME ";    myquery << " ID, PATH, NAME, DESCR, FROM_TIME,TO_TIME, TYPE ";
1344    myquery << " from GL_PARAM ";    myquery << " from GL_PARAM ";
1345    myquery << " where TYPE = '"<<type<<"' ";    myquery << " where TYPE = '"<<type<<"' ";
1346    myquery << " and FROM_TIME <= " << time;    myquery << " and FROM_TIME <= " << time;
# Line 1353  Int_t GL_PARAM::Query_GL_PARAM(UInt_t ti Line 1355  Int_t GL_PARAM::Query_GL_PARAM(UInt_t ti
1355        if( Row == NULL ) break;        if( Row == NULL ) break;
1356        for( t = 0; t < pResult->GetFieldCount(); t++){        for( t = 0; t < pResult->GetFieldCount(); t++){
1357          if (t==0) ID        = (UInt_t)atoll(Row->GetField(t));          if (t==0) ID        = (UInt_t)atoll(Row->GetField(t));
1358            if (t==1) PATH      = Row->GetField(t);// put in fpath the path to that file          if (t==1) PATH      = (TString)gSystem->ExpandPathName(Row->GetField(t))+'/';// put in fpath the path to that file
1359            if (t==2) NAME      = Row->GetField(t);            if (t==2) NAME      = Row->GetField(t);
1360            if (t==3) DESCR     = Row->GetField(t);            if (t==3) DESCR     = Row->GetField(t);
1361            if (t==4) FROM_TIME = (UInt_t)atoll(Row->GetField(t));            if (t==4) FROM_TIME = (UInt_t)atoll(Row->GetField(t));
# Line 1399  GL_TIMESYNC::GL_TIMESYNC(UInt_t id, TStr Line 1401  GL_TIMESYNC::GL_TIMESYNC(UInt_t id, TStr
1401    TSQLRow *Row;    TSQLRow *Row;
1402    stringstream myquery;    stringstream myquery;
1403    stringstream rname;    stringstream rname;
1404      //  pcksList packetsNames;
1405      //  pcksList::iterator Iter;
1406      //  getPacketsNames(packetsNames);
1407    rname.str("");    rname.str("");
1408    // ----------------    // ----------------
1409    myquery.str("");    myquery.str("");
# Line 1417  GL_TIMESYNC::GL_TIMESYNC(UInt_t id, TStr Line 1422  GL_TIMESYNC::GL_TIMESYNC(UInt_t id, TStr
1422      if( Row ){      if( Row ){
1423        stringstream fname;        stringstream fname;
1424        fname.str("");        fname.str("");
1425        fname << Row->GetField(0) << "/" << Row->GetField(1);        fname << gSystem->ExpandPathName(Row->GetField(0)) << "/" << Row->GetField(1);
1426        rname << Row->GetField(1);        rname << Row->GetField(1);
1427        file = new TFile(fname.str().c_str(),"READ");        file = new TFile(fname.str().c_str(),"READ");
1428        idraw = (UInt_t)atoll(Row->GetField(2));        idraw = (UInt_t)atoll(Row->GetField(2));
# Line 1434  GL_TIMESYNC::GL_TIMESYNC(UInt_t id, TStr Line 1439  GL_TIMESYNC::GL_TIMESYNC(UInt_t id, TStr
1439      ph = eh->GetPscuHeader();      ph = eh->GetPscuHeader();
1440      pktfirst = ph->GetCounter();      pktfirst = ph->GetCounter();
1441      obtfirst = ph->GetOrbitalTime();        obtfirst = ph->GetOrbitalTime();  
1442        //
1443    //     code = eh->GetCounter();
1444    //     UInt_t en = 0;
1445    //     for(Iter = packetsNames.begin(); Iter != packetsNames.end(); Iter++){
1446    //       en = code->Get(GetPacketType(*Iter));
1447    //       if ( !strcmp("CalibCalPed",*Iter) || !strcmp("CalibTrk1",*Iter) || !strcmp("CalibTrk2",*Iter) || !strcmp("CalibS4",*Iter) ){
1448    //      //
1449    //      TTree *TC = 0;
1450    //      TC = (TTree*)file->Get("CalibCalPed");
1451    //      if ( !TC || TC->IsZombie() ) return;
1452    //      EventHeader *ehc = 0;
1453    //      PscuHeader *phc = 0;
1454    //      TC->SetBranchAddress("Header", &ehc);
1455    //      TC->GetEntry(0);
1456    //      phc = ehc->GetPscuHeader();
1457    //      pktfirst = phc->GetCounter();
1458    //      obtfirst = phc->GetOrbitalTime();  
1459    //       //
1460    //       };
1461    //     };  
1462        //
1463    };    };
1464    //    //
1465    // look for Resurs offset    // look for Resurs offset
# Line 1442  GL_TIMESYNC::GL_TIMESYNC(UInt_t id, TStr Line 1468  GL_TIMESYNC::GL_TIMESYNC(UInt_t id, TStr
1468    //    //
1469    //    //
1470    stringstream oss;    stringstream oss;
1471      TString frn = rname.str().c_str();
1472      frn = frn.ReplaceAll(".root",5,".pam",4);
1473    oss.str("");    oss.str("");
1474    oss << "SELECT YEAR(OFFSET_DATE),MONTH(OFFSET_DATE),DAY(OFFSET_DATE),HOUR(OFFSET_DATE),MINUTE(OFFSET_DATE),SECOND(OFFSET_DATE) FROM GL_RESURS_OFFSET WHERE SPECIAL_FILE='"    oss << "SELECT YEAR(OFFSET_DATE),MONTH(OFFSET_DATE),DAY(OFFSET_DATE),HOUR(OFFSET_DATE),MINUTE(OFFSET_DATE),SECOND(OFFSET_DATE) FROM GL_RESURS_OFFSET WHERE SPECIAL_FILE='"
1475        << rname.str().c_str() << "';";        << frn.Data() << "';";
1476    if ( !this->GetGLTABLES()->IsConnected(dbc) ) return;      if ( !this->GetGLTABLES()->IsConnected(dbc) ) return;  
1477    this->GetGLTABLES()->AddQ();    this->GetGLTABLES()->AddQ();
1478    pResult = dbc->Query(oss.str().c_str());    pResult = dbc->Query(oss.str().c_str());
# Line 1465  GL_TIMESYNC::GL_TIMESYNC(UInt_t id, TStr Line 1493  GL_TIMESYNC::GL_TIMESYNC(UInt_t id, TStr
1493      for (Int_t i = 8; i<13; i++){      for (Int_t i = 8; i<13; i++){
1494        dwo.Append(name[i],1);        dwo.Append(name[i],1);
1495      };          };    
1496      if ( dwo.IsDigit() ) dworbit = (UInt_t)dwo.Atoi();      if ( dwo.IsDigit() ){
1497          dworbit = (UInt_t)dwo.Atoi();
1498        } else {
1499          dworbit = 1;
1500        };
1501    };    };
1502    //    //
1503      //
1504    if ( !Row ){    if ( !Row ){
1505      oss.str("");      oss.str("");
1506      oss << "SELECT YEAR(OFFSET_DATE),MONTH(OFFSET_DATE),DAY(OFFSET_DATE),HOUR(OFFSET_DATE),MINUTE(OFFSET_DATE),SECOND(OFFSET_DATE) FROM GL_RESURS_OFFSET WHERE FROM_ORBIT< "      oss << "SELECT YEAR(OFFSET_DATE),MONTH(OFFSET_DATE),DAY(OFFSET_DATE),HOUR(OFFSET_DATE),MINUTE(OFFSET_DATE),SECOND(OFFSET_DATE) FROM GL_RESURS_OFFSET WHERE FROM_ORBIT< "

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.23