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 |
}; |
}; |
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 << " ORDER BY FROM_TIME DESC LIMIT 1;"; |
1175 |
// myquery << " ORDER BY FROM_TIME DESC LIMIT 1;"; |
// myquery << " ORDER BY FROM_TIME DESC LIMIT 1;"; |
1176 |
if ( !this->GetGLTABLES()->IsConnected(dbc) ) return -57; |
if ( !this->GetGLTABLES()->IsConnected(dbc) ) return -57; |
1177 |
this->GetGLTABLES()->AddQ(); |
this->GetGLTABLES()->AddQ(); |
1339 |
// ---------------- |
// ---------------- |
1340 |
myquery.str(""); |
myquery.str(""); |
1341 |
myquery << " select "; |
myquery << " select "; |
1342 |
myquery << " ID, PATH, NAME, DESCR, TYPE, FROM_TIME,TO_TIME "; |
myquery << " ID, PATH, NAME, DESCR, FROM_TIME,TO_TIME, TYPE "; |
1343 |
myquery << " from GL_PARAM "; |
myquery << " from GL_PARAM "; |
1344 |
myquery << " where TYPE = '"<<type<<"' "; |
myquery << " where TYPE = '"<<type<<"' "; |
1345 |
myquery << " and FROM_TIME <= " << time; |
myquery << " and FROM_TIME <= " << time; |
1354 |
if( Row == NULL ) break; |
if( Row == NULL ) break; |
1355 |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
1356 |
if (t==0) ID = (UInt_t)atoll(Row->GetField(t)); |
if (t==0) ID = (UInt_t)atoll(Row->GetField(t)); |
1357 |
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 |
1358 |
if (t==2) NAME = Row->GetField(t); |
if (t==2) NAME = Row->GetField(t); |
1359 |
if (t==3) DESCR = Row->GetField(t); |
if (t==3) DESCR = Row->GetField(t); |
1360 |
if (t==4) FROM_TIME = (UInt_t)atoll(Row->GetField(t)); |
if (t==4) FROM_TIME = (UInt_t)atoll(Row->GetField(t)); |
1400 |
TSQLRow *Row; |
TSQLRow *Row; |
1401 |
stringstream myquery; |
stringstream myquery; |
1402 |
stringstream rname; |
stringstream rname; |
1403 |
|
// pcksList packetsNames; |
1404 |
|
// pcksList::iterator Iter; |
1405 |
|
// getPacketsNames(packetsNames); |
1406 |
rname.str(""); |
rname.str(""); |
1407 |
// ---------------- |
// ---------------- |
1408 |
myquery.str(""); |
myquery.str(""); |
1421 |
if( Row ){ |
if( Row ){ |
1422 |
stringstream fname; |
stringstream fname; |
1423 |
fname.str(""); |
fname.str(""); |
1424 |
fname << Row->GetField(0) << "/" << Row->GetField(1); |
fname << gSystem->ExpandPathName(Row->GetField(0)) << "/" << Row->GetField(1); |
1425 |
rname << Row->GetField(1); |
rname << Row->GetField(1); |
1426 |
file = new TFile(fname.str().c_str(),"READ"); |
file = new TFile(fname.str().c_str(),"READ"); |
1427 |
idraw = (UInt_t)atoll(Row->GetField(2)); |
idraw = (UInt_t)atoll(Row->GetField(2)); |
1438 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
1439 |
pktfirst = ph->GetCounter(); |
pktfirst = ph->GetCounter(); |
1440 |
obtfirst = ph->GetOrbitalTime(); |
obtfirst = ph->GetOrbitalTime(); |
1441 |
|
// |
1442 |
|
// code = eh->GetCounter(); |
1443 |
|
// UInt_t en = 0; |
1444 |
|
// for(Iter = packetsNames.begin(); Iter != packetsNames.end(); Iter++){ |
1445 |
|
// en = code->Get(GetPacketType(*Iter)); |
1446 |
|
// if ( !strcmp("CalibCalPed",*Iter) || !strcmp("CalibTrk1",*Iter) || !strcmp("CalibTrk2",*Iter) || !strcmp("CalibS4",*Iter) ){ |
1447 |
|
// // |
1448 |
|
// TTree *TC = 0; |
1449 |
|
// TC = (TTree*)file->Get("CalibCalPed"); |
1450 |
|
// if ( !TC || TC->IsZombie() ) return; |
1451 |
|
// EventHeader *ehc = 0; |
1452 |
|
// PscuHeader *phc = 0; |
1453 |
|
// TC->SetBranchAddress("Header", &ehc); |
1454 |
|
// TC->GetEntry(0); |
1455 |
|
// phc = ehc->GetPscuHeader(); |
1456 |
|
// pktfirst = phc->GetCounter(); |
1457 |
|
// obtfirst = phc->GetOrbitalTime(); |
1458 |
|
// // |
1459 |
|
// }; |
1460 |
|
// }; |
1461 |
|
// |
1462 |
}; |
}; |
1463 |
// |
// |
1464 |
// look for Resurs offset |
// look for Resurs offset |
1490 |
for (Int_t i = 8; i<13; i++){ |
for (Int_t i = 8; i<13; i++){ |
1491 |
dwo.Append(name[i],1); |
dwo.Append(name[i],1); |
1492 |
}; |
}; |
1493 |
if ( dwo.IsDigit() ) dworbit = (UInt_t)dwo.Atoi(); |
if ( dwo.IsDigit() ){ |
1494 |
|
dworbit = (UInt_t)dwo.Atoi(); |
1495 |
|
} else { |
1496 |
|
dworbit = 1; |
1497 |
|
}; |
1498 |
}; |
}; |
1499 |
// |
// |
1500 |
|
// |
1501 |
if ( !Row ){ |
if ( !Row ){ |
1502 |
oss.str(""); |
oss.str(""); |
1503 |
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< " |