63 |
SetObt0(obt0); |
SetObt0(obt0); |
64 |
// |
// |
65 |
// |
// |
66 |
SetRootName(filerootname); |
INSERT_RAW =!filerawname.IsNull(); |
67 |
SetRawName(filerawname); |
if(INSERT_RAW)SetRawName(filerawname); |
68 |
// |
// |
69 |
this->OpenFile(); |
INSERT_ROOT = !filerootname.IsNull(); |
70 |
|
if( INSERT_ROOT ){ |
71 |
|
this->SetRootName(filerootname); |
72 |
|
file = TFile::Open(this->GetRootName().Data()); |
73 |
|
}; |
74 |
// |
// |
75 |
this->SetID_RAW(0); |
this->SetID_RAW(0); |
76 |
this->SetID_ROOT(0); |
this->SetID_ROOT(0); |
77 |
|
|
78 |
|
VALIDATE = false; |
79 |
|
|
80 |
// |
// |
81 |
}; |
}; |
82 |
|
|
85 |
*/ |
*/ |
86 |
void PamelaDBOperations::Close(){ |
void PamelaDBOperations::Close(){ |
87 |
if( conn && conn->IsConnected() ) conn->Close(); |
if( conn && conn->IsConnected() ) conn->Close(); |
88 |
|
delete clean_time; |
89 |
delete glrun; |
delete glrun; |
90 |
delete this; |
delete this; |
91 |
}; |
}; |
94 |
// SETTERS |
// SETTERS |
95 |
// |
// |
96 |
|
|
97 |
|
// |
98 |
|
// must be out of the constructor in order to FORCE the validation of the latest runs in case you run the validation together with the latest file |
99 |
|
// |
100 |
|
void PamelaDBOperations::CheckValidate(Long64_t olderthan){ |
101 |
|
clean_time = new TDatime(); |
102 |
|
if(olderthan >= 0){ |
103 |
|
VALIDATE = true; |
104 |
|
UInt_t timelim = 0; |
105 |
|
timelim = (UInt_t)clean_time->Convert() - olderthan; |
106 |
|
clean_time->Set(timelim,false); |
107 |
|
}; |
108 |
|
}; |
109 |
|
|
110 |
/** |
/** |
111 |
* Open the DB connection |
* Open the DB connection |
112 |
* @param host hostname for the SQL connection. |
* @param host hostname for the SQL connection. |
193 |
* Store the olderthan variable |
* Store the olderthan variable |
194 |
* @param olderthan |
* @param olderthan |
195 |
*/ |
*/ |
196 |
void PamelaDBOperations::SetOlderThan(Long64_t oldthan){ |
// void PamelaDBOperations::SetOlderThan(Long64_t oldthan){ |
197 |
olderthan = oldthan; |
// olderthan = oldthan; |
198 |
}; |
// }; |
199 |
|
|
200 |
/** |
/** |
201 |
* Retrieve the ID_RAW, if exists, returns NULL if does not exist. |
* Retrieve the ID_RAW, if exists, returns NULL if does not exist. |
422 |
pkth = PKT(phh->GetCounter()); |
pkth = PKT(phh->GetCounter()); |
423 |
obth = OBT(phh->GetOrbitalTime()); |
obth = OBT(phh->GetOrbitalTime()); |
424 |
// |
// |
425 |
if ( IsDebug() ) printf(" k %i rhev before %i ph %u upperp %u oh %u uppero %u \n",k,rhev,pkth,spkth,obth,sobth); |
// if ( IsDebug() ) printf(" k %i rhev before %i ph %u upperp %u oh %u uppero %u \n",k,rhev,pkth,spkth,obth,sobth); |
426 |
// |
// |
427 |
if ( pkth < spkth && obth < sobth ){ |
if ( pkth < spkth && obth < sobth ){ |
428 |
if ( IsDebug() ) printf(" RH PROBLEMS determining the event repetition at the end of the file lasthead %i \n",rhev); |
if ( IsDebug() ) printf(" RH PROBLEMS determining the event repetition at the end of the file lasthead %i \n",rhev); |
440 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
441 |
t_pktlast = PKT(ph->GetCounter()); |
t_pktlast = PKT(ph->GetCounter()); |
442 |
t_obtlast = OBT(ph->GetOrbitalTime()); |
t_obtlast = OBT(ph->GetOrbitalTime()); |
443 |
if ( t_pktlast < spkth && t_obtlast < sobth ){ // jump |
if ( t_pktlast <= spkth && t_obtlast <= sobth ){ // jump |
444 |
upperpkt = pkth; |
upperpkt = pkth; |
445 |
upperobt = obth; |
upperobt = obth; |
446 |
upperentry = evbefh-1; |
upperentry = evbefh-1; |
481 |
pktt = PKT(pht->GetCounter()); |
pktt = PKT(pht->GetCounter()); |
482 |
obtt = OBT(pht->GetOrbitalTime()); |
obtt = OBT(pht->GetOrbitalTime()); |
483 |
// |
// |
484 |
if ( IsDebug() ) printf(" k %i rtev beforev %i pt %i upperp %i ot %llu uppero %llu \n",k,rtev,pktt,spktt,obtt,sobtt); |
// if ( IsDebug() ) printf(" k %i rtev beforev %i pt %i upperp %i ot %llu uppero %llu \n",k,rtev,pktt,spktt,obtt,sobtt); |
485 |
// |
// |
486 |
if ( pktt < spktt && obtt < sobtt ){ |
if ( pktt < spktt && obtt < sobtt ){ |
487 |
if ( IsDebug() ) printf(" RT PROBLEMS determining the event repetition at the end of the file lasttrail %i \n",rtev); |
if ( IsDebug() ) printf(" RT PROBLEMS determining the event repetition at the end of the file lasttrail %i \n",rtev); |
500 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
501 |
t_pktlast = PKT(ph->GetCounter()); |
t_pktlast = PKT(ph->GetCounter()); |
502 |
t_obtlast = OBT(ph->GetOrbitalTime()); |
t_obtlast = OBT(ph->GetOrbitalTime()); |
503 |
if ( t_pktlast < spktt && t_obtlast < sobtt ){ // jump |
if ( t_pktlast <= spktt && t_obtlast <= sobtt ){ // jump |
504 |
upperpkt = pktt; |
upperpkt = pktt; |
505 |
upperobt = obtt; |
upperobt = obtt; |
506 |
upperentry = evbeft-1; |
upperentry = evbeft-1; |
649 |
// PRIVATE FUNCTIONS |
// PRIVATE FUNCTIONS |
650 |
// |
// |
651 |
|
|
652 |
/** |
// /** |
653 |
* Open the ROOT filename for reading |
// * Open the ROOT filename for reading |
654 |
*/ |
// */ |
655 |
void PamelaDBOperations::OpenFile(){ |
// void PamelaDBOperations::OpenFile(){ |
656 |
file = TFile::Open(this->GetRootName().Data()); |
// file = TFile::Open(this->GetRootName().Data()); |
657 |
|
// // |
658 |
|
|
659 |
|
void PamelaDBOperations::CheckFile(){ |
660 |
|
if ( !file ) throw -12; |
661 |
}; |
}; |
662 |
|
|
663 |
|
|
664 |
/** |
/** |
665 |
* Check if LEVEL0 file and DB connection have really be opened |
* Check if LEVEL0 file and DB connection have really be opened |
666 |
*/ |
*/ |
667 |
void PamelaDBOperations::CheckFile(){ |
void PamelaDBOperations::CheckConnection(){ |
|
// |
|
|
if ( !file ) throw -12; |
|
668 |
// |
// |
669 |
// check connection |
// check connection |
670 |
// |
// |
671 |
if( !conn ) throw -1; |
if( !conn ) throw -1; |
672 |
bool connect = conn->IsConnected(); |
bool connect = conn->IsConnected(); |
673 |
if( !connect ) throw -1; |
if( !connect ) throw -1; |
674 |
}; |
}; |
675 |
|
|
676 |
/** |
/** |
931 |
// |
// |
932 |
TYPE = 55;//224; |
TYPE = 55;//224; |
933 |
// |
// |
934 |
|
if ( IsDebug() ) printf("mcmd tsync %i tsync %u obt %u \n",i,TSYNC,OBT); |
935 |
|
// |
936 |
if ( TSYNC && OBT ){ |
if ( TSYNC && OBT ){ |
937 |
existsts = true; |
existsts = true; |
938 |
goto eout; |
goto eout; |
955 |
// |
// |
956 |
rt->SetBranchAddress("RunTrailer", &runt); |
rt->SetBranchAddress("RunTrailer", &runt); |
957 |
// |
// |
958 |
if ( rhev > 0 ){ |
Int_t nrhev = rh->GetEntries(); |
959 |
rh->GetEntry(0); |
Int_t nrtev = rt->GetEntries(); |
960 |
// |
if ( IsDebug() ) printf(" ou nevent %i rhev %i rtev %i \n",nevent,nrhev,nrtev); |
961 |
TSYNC = runh->LAST_TIME_SYNC_INFO; |
// |
962 |
OBT = runh->OBT_TIME_SYNC * 1000; |
if ( nrhev > 0 ){ |
963 |
// |
for (Int_t i=0; i<nrhev; i++){ |
964 |
TYPE = 20; |
// |
965 |
// |
rh->GetEntry(i); |
966 |
if ( TSYNC && OBT ){ |
// |
967 |
existsts = true; |
TSYNC = runh->LAST_TIME_SYNC_INFO; |
968 |
goto eout; |
OBT = runh->OBT_TIME_SYNC * 1000; |
969 |
|
// |
970 |
|
TYPE = 20; |
971 |
|
// |
972 |
|
if ( IsDebug() ) printf("runheader %i tsync %u obt %u \n",i,TSYNC,OBT); |
973 |
|
// |
974 |
|
if ( TSYNC && OBT ){ |
975 |
|
existsts = true; |
976 |
|
goto eout; |
977 |
|
}; |
978 |
}; |
}; |
979 |
// |
// |
980 |
}; |
}; |
981 |
if ( rtev > 0 ){ |
if ( nrtev > 0 ){ |
982 |
// |
// |
983 |
if ( IsDebug() ) printf(" No runheader \n"); |
if ( IsDebug() ) printf(" No runheader \n"); |
984 |
signal = 6; |
signal = 6; |
985 |
// |
// |
986 |
rt->GetEntry(0); |
for (Int_t i=0; i<nrtev; i++){ |
987 |
// |
// |
988 |
TSYNC = runt->LAST_TYME_SYNC_INFO; |
rt->GetEntry(i); |
989 |
OBT = runt->OBT_TYME_SYNC * 1000; |
// |
990 |
// |
TSYNC = runt->LAST_TYME_SYNC_INFO; |
991 |
TYPE = 21; |
OBT = runt->OBT_TYME_SYNC * 1000; |
992 |
// |
// |
993 |
if ( TSYNC && OBT ){ |
TYPE = 21; |
994 |
existsts = true; |
// |
995 |
goto eout; |
if ( IsDebug() ) printf("runtrailer %i tsync %u obt %u \n",i,TSYNC,OBT); |
996 |
|
// |
997 |
|
if ( TSYNC && OBT ){ |
998 |
|
existsts = true; |
999 |
|
goto eout; |
1000 |
|
}; |
1001 |
}; |
}; |
1002 |
// |
// |
1003 |
} else { |
} else { |
3207 |
TSQLRow *row2 = 0; |
TSQLRow *row2 = 0; |
3208 |
// |
// |
3209 |
UInt_t moved = 0; |
UInt_t moved = 0; |
3210 |
UInt_t timelim = 0; |
// UInt_t timelim = 0; |
3211 |
TDatime *time = new TDatime(); |
// TDatime *time = new TDatime(); |
3212 |
// |
// |
3213 |
stringstream oss; |
stringstream oss; |
3214 |
oss.str(""); |
oss.str(""); |
3215 |
// |
// |
3216 |
// |
// |
|
// |
|
|
if ( olderthan < 0 ){ |
|
|
if ( IsDebug() ) printf(" Do not clean GL_RUN_FRAGMENTS table \n"); |
|
|
return(1); |
|
|
}; |
|
|
// |
|
|
// timelim = now - olderthan |
|
|
// |
|
|
time->Set(); |
|
|
timelim = (UInt_t)time->Convert() - olderthan; |
|
|
time->Set(timelim,false); |
|
|
// |
|
3217 |
// check if there are entries older than "olderthan" seconds from now |
// check if there are entries older than "olderthan" seconds from now |
3218 |
// |
// |
3219 |
oss.str(""); |
oss.str(""); |
3220 |
oss << " SELECT ID FROM GL_RUN_FRAGMENTS WHERE" |
oss << " SELECT ID FROM GL_RUN_FRAGMENTS WHERE" |
3221 |
<< " INSERT_TIME <= '" << time->AsSQLString() << "';"; |
<< " INSERT_TIME <= '" << clean_time->AsSQLString() << "';"; |
3222 |
// |
// |
3223 |
if ( IsDebug() ) printf(" Select from GL_RUN_FRAGMENTS runs older than %s : query is \n %s \n",time->AsSQLString(),oss.str().c_str()); |
if ( IsDebug() ) printf(" Select from GL_RUN_FRAGMENTS runs older than %s : query is \n %s \n",clean_time->AsSQLString(),oss.str().c_str()); |
3224 |
result = conn->Query(oss.str().c_str()); |
result = conn->Query(oss.str().c_str()); |
3225 |
// |
// |
3226 |
if ( result ){ |
if ( result ){ |
3318 |
TSQLResult *result = 0; |
TSQLResult *result = 0; |
3319 |
TSQLRow *row = 0; |
TSQLRow *row = 0; |
3320 |
// |
// |
|
UInt_t timelim = 0; |
|
|
TDatime *time = new TDatime(); |
|
|
// |
|
3321 |
stringstream oss; |
stringstream oss; |
3322 |
oss.str(""); |
oss.str(""); |
3323 |
// |
// |
|
// |
|
|
// |
|
|
if ( olderthan < 0 ){ |
|
|
if ( IsDebug() ) printf(" Do not validate runs \n"); |
|
|
return(1); |
|
|
}; |
|
|
// |
|
|
// timelim = now - olderthan |
|
|
// |
|
|
time->Set(); |
|
|
timelim = (UInt_t)time->Convert() - olderthan; |
|
|
time->Set(timelim,false); |
|
|
|
|
|
printf("Validate runs older than %s \n",time->AsSQLString()); |
|
|
|
|
3324 |
// ======================================================= |
// ======================================================= |
3325 |
// validate runs by checking missing calibrations |
// validate runs by checking missing calibrations |
3326 |
// ======================================================= |
// ======================================================= |
3330 |
// 1) get the OBT of the last run inserted after clean-time limit |
// 1) get the OBT of the last run inserted after clean-time limit |
3331 |
// -------------------------------------------------------------- |
// -------------------------------------------------------------- |
3332 |
oss.str(""); |
oss.str(""); |
3333 |
oss << " SELECT * FROM GL_RUN WHERE INSERT_TIME <= '" << time->AsSQLString() |
oss << " SELECT * FROM GL_RUN WHERE INSERT_TIME <= '" << clean_time->AsSQLString() |
3334 |
<< "' ORDER BY INSERT_TIME DESC LIMIT 1;"; |
<< "' ORDER BY RUNHEADER_TIME DESC LIMIT 1;"; |
3335 |
printf(" Get start validation-time: query is \n %s \n",oss.str().c_str()); |
if ( IsDebug() ) printf(" Get start validation-time: query is \n %s \n",oss.str().c_str()); |
3336 |
result = conn->Query(oss.str().c_str()); |
result = conn->Query(oss.str().c_str()); |
3337 |
if ( !result ) throw -4; |
if ( !result ) throw -4; |
3338 |
if ( !result->GetRowCount() ) { |
if ( !result->GetRowCount() ) { |
3341 |
}else{ |
}else{ |
3342 |
row = result->Next(); |
row = result->Next(); |
3343 |
t_start = (UInt_t)atoll(row->GetField(4)); |
t_start = (UInt_t)atoll(row->GetField(4)); |
|
printf("t_start %i\n",t_start); |
|
3344 |
}; |
}; |
3345 |
// -------------------------------------------------------------- |
// -------------------------------------------------------------- |
3346 |
// 2) get the OBT of the last validated run |
// 2) get the OBT of the last validated run |
3348 |
oss.str(""); |
oss.str(""); |
3349 |
oss << " SELECT * FROM GL_RUN WHERE VALIDATION=1 AND RUNHEADER_TIME<="<< t_start |
oss << " SELECT * FROM GL_RUN WHERE VALIDATION=1 AND RUNHEADER_TIME<="<< t_start |
3350 |
<<" ORDER BY RUNHEADER_TIME DESC LIMIT 1;"; |
<<" ORDER BY RUNHEADER_TIME DESC LIMIT 1;"; |
3351 |
printf(" Get stop validation-time: query is \n %s \n",oss.str().c_str()); |
if ( IsDebug() ) printf(" Get stop validation-time: query is \n %s \n",oss.str().c_str()); |
3352 |
result = conn->Query(oss.str().c_str()); |
result = conn->Query(oss.str().c_str()); |
3353 |
if ( !result ) throw -4; |
if ( !result ) throw -4; |
3354 |
if ( result->GetRowCount() ){ |
if ( result->GetRowCount() ){ |
3355 |
row = result->Next(); |
row = result->Next(); |
3356 |
t_stop = (UInt_t)atoll(row->GetField(4)); |
t_stop = (UInt_t)atoll(row->GetField(4)); |
3357 |
}; |
}; |
3358 |
printf("t_stop %i\n",t_stop); |
if ( IsDebug() ) printf("Validation interval: from time %i - to time %i \n\n",t_stop,t_start); |
3359 |
// -------------------------------------------------------------- |
// -------------------------------------------------------------- |
3360 |
// now retrieves runs to be validated |
// now retrieves runs to be validated |
3361 |
// -------------------------------------------------------------- |
// -------------------------------------------------------------- |
3364 |
oss << " AND RUNHEADER_TIME >="<< t_stop; |
oss << " AND RUNHEADER_TIME >="<< t_stop; |
3365 |
oss << " ORDER BY RUNHEADER_TIME DESC;"; |
oss << " ORDER BY RUNHEADER_TIME DESC;"; |
3366 |
// if ( IsDebug() ) |
// if ( IsDebug() ) |
3367 |
printf(" Check runs for validation: query is \n %s \n",oss.str().c_str()); |
if ( IsDebug() )printf(" Check runs for validation: query is \n %s \n",oss.str().c_str()); |
3368 |
result = conn->Query(oss.str().c_str()); |
result = conn->Query(oss.str().c_str()); |
3369 |
if ( !result ) throw -4; |
if ( !result ) throw -4; |
3370 |
if ( !result->GetRowCount() ) printf(" No runs to validate \n"); |
if ( !result->GetRowCount() ) printf(" No runs to validate \n"); |
3371 |
printf("------------------------------------------------------------------------------- \n"); |
// printf("------------------------------------------------------------------------------- \n"); |
3372 |
|
|
3373 |
Int_t nrow = 0; |
Int_t nrow = 0; |
3374 |
GL_RUN* this_run = new GL_RUN(); |
GL_RUN* this_run = new GL_RUN(); |
3375 |
GL_RUN* next_run = new GL_RUN(); |
GL_RUN* next_run = new GL_RUN(); |
3376 |
Int_t nseq_max = 100; |
Int_t nseq_max = 1000; |
3377 |
// UInt_t* sequence = new UInt_t[100]; |
// UInt_t* sequence = new UInt_t[100]; |
3378 |
vector<UInt_t> sequence(nseq_max); |
vector<UInt_t> sequence(nseq_max); |
3379 |
Int_t nseq = 0; |
Int_t nseq = 0; |
3396 |
//get run info |
//get run info |
3397 |
//------------ |
//------------ |
3398 |
this_run->Set_GL_RUN(row); |
this_run->Set_GL_RUN(row); |
3399 |
|
|
|
printf(" RUN ID %i --- TRK_CALIB_USED %i --- RM_ACQ_AFTER_CALIB %i --- TIME %i %i \n",this_run->ID,this_run->TRK_CALIB_USED,this_run->RM_ACQ_AFTER_CALIB,this_run->RUNHEADER_TIME, this_run->RUNTRAILER_TIME); |
|
|
|
|
3400 |
Bool_t this_BAD = false; |
Bool_t this_BAD = false; |
3401 |
if(this_run->GetTRK_CALIB_USED() == 1 || this_run->GetTRK_CALIB_USED() == 2) this_ONLINE = true; |
if(this_run->GetTRK_CALIB_USED() == 1 || this_run->GetTRK_CALIB_USED() == 2) this_ONLINE = true; |
3402 |
else if (this_run->GetTRK_CALIB_USED() == 104) this_ONLINE = false; |
else if (this_run->GetTRK_CALIB_USED() == 104) this_ONLINE = false; |
3403 |
else{ |
else{ |
3404 |
printf("Missing or corrupted header!! \n"); |
// printf("Missing or corrupted header!! \n"); |
3405 |
this_ONLINE = false; |
this_ONLINE = false; |
3406 |
this_BAD = true; |
this_BAD = true; |
3407 |
}; |
}; |
3425 |
|
|
3426 |
if( interval >= 60 )CHECK = true; //more than 60 s => there might be a calibration |
if( interval >= 60 )CHECK = true; //more than 60 s => there might be a calibration |
3427 |
|
|
|
/* if( CHECK && !next_run->GetRM_ACQ_AFTER_CALIB() ) |
|
|
printf(" ValidateRuns ***WARNING*** : DT = %i but RM_ACQ_AFTER_CALIB = %i \n",(t2-t1),next_run->GetRM_ACQ_AFTER_CALIB());*/ |
|
|
|
|
|
|
|
3428 |
if( !CHECK && this_run->VALIDATION ){ |
if( !CHECK && this_run->VALIDATION ){ |
3429 |
for (Int_t irun = 0; irun < nseq; irun++)assignVALIDATION(sequence[irun],true); |
for (Int_t irun = 0; irun < nseq; irun++)assignVALIDATION(sequence[irun],true); |
3430 |
nseq=0; |
nseq=0; |
3433 |
}else if( !this_ONLINE && next_ONLINE) { // this: DEFAULT + next:ON-LINE |
}else if( !this_ONLINE && next_ONLINE) { // this: DEFAULT + next:ON-LINE |
3434 |
|
|
3435 |
CHECK = true; |
CHECK = true; |
|
// if( interval < 60 ) printf(" ValidateRuns ***WARNING*** : kkkkkk DT = %i \n",interval); |
|
3436 |
|
|
3437 |
}else if( !next_ONLINE ){ // this:ANY + next:DEFAULT |
}else if( !next_ONLINE ){ // this:ANY + next:DEFAULT |
3438 |
|
|
3446 |
//---------------------------- |
//---------------------------- |
3447 |
if( CHECK ){ |
if( CHECK ){ |
3448 |
// check if calibration exists |
// check if calibration exists |
3449 |
printf("DT %i ===> CHECK Missing calibration\n",interval); |
if ( IsDebug() )printf("DT %i ===> CHECK Missing calibration\n",interval); |
3450 |
Bool_t MISSING = MissingTRK_CALIB(t1,t2); |
Bool_t MISSING = MissingTRK_CALIB(t1,t2); |
3451 |
for (Int_t irun = 0; irun < nseq; irun++)assignVALIDATION(sequence[irun],!MISSING); |
for (Int_t irun = 0; irun < nseq; irun++)assignVALIDATION(sequence[irun],!MISSING); |
3452 |
nseq=0; |
nseq=0; |
3453 |
} else printf("DT %i\n",interval); |
}; |
3454 |
//-------------- |
//-------------- |
3455 |
//store run info |
//store run info |
3456 |
//-------------- |
//-------------- |
3463 |
}else printf("ValidateRuns ***WARNING*** : run sequence exceed assumed size (%i) \n",nseq_max); |
}else printf("ValidateRuns ***WARNING*** : run sequence exceed assumed size (%i) \n",nseq_max); |
3464 |
}; |
}; |
3465 |
|
|
3466 |
|
if ( IsDebug() ) printf("%i Run %i \n",nrow,this_run->ID); |
3467 |
nrow++; |
nrow++; |
3468 |
|
|
3469 |
}; |
}; |
3492 |
// which should be equal to the time between ascending-nodes. |
// which should be equal to the time between ascending-nodes. |
3493 |
//============================================================== |
//============================================================== |
3494 |
if ( t2 - trkcalib->FROM_TIME > 5700) { |
if ( t2 - trkcalib->FROM_TIME > 5700) { |
3495 |
printf("Long time to previous calib %i :-( \n",t2 - trkcalib->FROM_TIME); |
if ( IsDebug() )printf("Long time between calib and run start %i :-( ==> there might be a missing calib \n",t2 - trkcalib->FROM_TIME); |
3496 |
//============================================================== |
//============================================================== |
3497 |
// there might be a missing calibration, due to: |
// there might be a missing calibration, due to: |
3498 |
// - MM full |
// - MM full |
3513 |
// it is enough to say that there are no missing calibrations |
// it is enough to say that there are no missing calibrations |
3514 |
//============================================================== |
//============================================================== |
3515 |
// the long time interval bewteen runs might be due to download |
// the long time interval bewteen runs might be due to download |
3516 |
printf("Short time to previous calib %i :-) \n",t2 - trkcalib->FROM_TIME); |
if ( IsDebug() )printf("Short time between calib and run start %i :-) ==> OK! \n",t2 - trkcalib->FROM_TIME); |
3517 |
return(false); |
return(false); |
3518 |
|
|
3519 |
}; |
}; |
3526 |
TSQLResult *result = 0; |
TSQLResult *result = 0; |
3527 |
stringstream oss; |
stringstream oss; |
3528 |
oss.str(""); |
oss.str(""); |
3529 |
oss << " UPDATE GL_RUN SET VALIDATION="<< (UInt_t)validation <<" WHERE ID= " << idrun << "';"; |
oss << " UPDATE GL_RUN SET VALIDATION="<< (UInt_t)validation <<" WHERE ID= " << idrun << ";"; |
3530 |
// |
// |
3531 |
// if ( IsDebug() ) |
// if ( IsDebug() ) |
3532 |
printf(" Set VALIDATION = %i for run %i \n",validation,idrun); |
// printf(" Set VALIDATION = %i for run %i \n",validation,idrun); |
3533 |
// printf(" Set VALIDATION = %i for run %i : query is \n %s \n",validation,idrun,oss.str().c_str()); |
if ( IsDebug() )printf(" Query: %s \n",oss.str().c_str()); |
3534 |
// result = conn->Query(oss.str().c_str()); |
result = conn->Query(oss.str().c_str()); |
3535 |
// if ( !result ) throw -4; |
if ( !result ) throw -4; |
3536 |
return(0); |
return(0); |
3537 |
} |
} |
3538 |
|
|