| 56 |
* @param debug debug flag. |
* @param debug debug flag. |
| 57 |
* @param tlefilename ascii file with TLE 3 line elements. |
* @param tlefilename ascii file with TLE 3 line elements. |
| 58 |
*/ |
*/ |
| 59 |
PamelaDBOperations::PamelaDBOperations(TString host, TString user, TString password, TString filerawname, TString filerootname, UInt_t boot, UInt_t tsync, UInt_t obt0, Bool_t debug, TString tlefilename){ |
PamelaDBOperations::PamelaDBOperations(TString host, TString user, TString password, TString filerawname, TString filerootname, UInt_t boot, UInt_t tsync, UInt_t obt0, Bool_t debug, TString tlefilename, UInt_t dwinput){ |
| 60 |
// |
// |
| 61 |
// |
// |
| 62 |
SetConnection(host,user,password); |
SetConnection(host,user,password); |
| 79 |
INSERT_ROOT = !filerootname.IsNull(); |
INSERT_ROOT = !filerootname.IsNull(); |
| 80 |
if( INSERT_ROOT ){ |
if( INSERT_ROOT ){ |
| 81 |
this->SetRootName(filerootname); |
this->SetRootName(filerootname); |
| 82 |
this->SetOrbitNo(); |
this->SetOrbitNo(dwinput); |
| 83 |
file = TFile::Open(this->GetRootName().Data()); |
file = TFile::Open(this->GetRootName().Data()); |
| 84 |
} else { |
} else { |
| 85 |
this->SetRootName(""); |
this->SetRootName(""); |
| 215 |
/** |
/** |
| 216 |
* Store the downlink orbit number from filename. |
* Store the downlink orbit number from filename. |
| 217 |
*/ |
*/ |
| 218 |
void PamelaDBOperations::SetOrbitNo(){ |
void PamelaDBOperations::SetOrbitNo(UInt_t dwinput){ |
| 219 |
dworbit = 0; |
dworbit = 0; |
| 220 |
|
// |
| 221 |
|
if ( dwinput ){ |
| 222 |
|
dworbit = dwinput; |
| 223 |
|
if ( IsDebug() ) printf(" Downlink orbit given by hand: %i \n",dworbit); |
| 224 |
|
return; |
| 225 |
|
}; |
| 226 |
|
// |
| 227 |
TString name = this->GetRootFile(); |
TString name = this->GetRootFile(); |
| 228 |
Int_t nlength = name.Length(); |
Int_t nlength = name.Length(); |
| 229 |
if ( nlength < 5 ) return; |
if ( nlength < 5 ) return; |
| 280 |
oss << "SELECT ID FROM GL_RAW WHERE " |
oss << "SELECT ID FROM GL_RAW WHERE " |
| 281 |
<< " PATH = '" << this->GetRawPath().Data() << "' AND " |
<< " PATH = '" << this->GetRawPath().Data() << "' AND " |
| 282 |
<< " NAME = '" << this->GetRawFile().Data() << "' "; |
<< " NAME = '" << this->GetRawFile().Data() << "' "; |
| 283 |
|
|
| 284 |
result = conn->Query(oss.str().c_str()); |
result = conn->Query(oss.str().c_str()); |
| 285 |
if ( result == NULL ) throw -4; |
if ( result == NULL ) throw -4; |
| 286 |
row = result->Next(); |
row = result->Next(); |
| 368 |
if ( !nevent ) return(2); |
if ( !nevent ) return(2); |
| 369 |
// |
// |
| 370 |
if ( nevent < 2 ) return(4); |
if ( nevent < 2 ) return(4); |
| 371 |
|
if ( nevent < jump ) jump = 1; |
| 372 |
|
// if ( nevent < jump ) jump = int(nevent/10); |
| 373 |
|
// if ( !jump ) jump = 1; |
| 374 |
// |
// |
| 375 |
if ( (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) || (labs(PKT(pktlast)-PKT(pktfirst))<deltapkt && labs(OBT(obtlast)-OBT(obtfirst))<deltaobt) ){ |
if ( (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) || (labs(PKT(pktlast)-PKT(pktfirst))<deltapkt && labs(OBT(obtlast)-OBT(obtfirst))<deltaobt) && nevent > deltapkt ){ |
| 376 |
// |
// |
| 377 |
|
if ( IsDebug() ) printf(" starting jump %i \n",jump); |
| 378 |
// go back |
// go back |
| 379 |
zomp = nevent - 2; |
zomp = nevent - 2; |
| 380 |
// |
// |
| 450 |
Long64_t pkth = 0LL; |
Long64_t pkth = 0LL; |
| 451 |
Long64_t obth = 0LL; |
Long64_t obth = 0LL; |
| 452 |
// |
// |
| 453 |
|
if ( rhev || rtev ){ |
| 454 |
|
|
| 455 |
|
|
| 456 |
T->GetEntry(upperentry); |
T->GetEntry(upperentry); |
| 457 |
code = eh->GetCounter(); |
code = eh->GetCounter(); |
| 458 |
Int_t lasttrail = code->Get(pctp->RunTrailer); |
Int_t lasttrail = code->Get(pctp->RunTrailer); |
| 659 |
}; |
}; |
| 660 |
if ( IsDebug() ) printf(" rtev after %i pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt); |
if ( IsDebug() ) printf(" rtev after %i pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt); |
| 661 |
// |
// |
| 662 |
|
|
| 663 |
|
|
| 664 |
|
}; |
| 665 |
|
// |
| 666 |
if ( IsDebug() ) printf(" Upper limits are: OBT %lld pkt_num %lld upper entry %i \n",upperobt,upperpkt,upperentry); |
if ( IsDebug() ) printf(" Upper limits are: OBT %lld pkt_num %lld upper entry %i \n",upperobt,upperpkt,upperentry); |
| 667 |
// |
// |
| 668 |
return(0); |
return(0); |
| 797 |
if( !conn ) throw -1; |
if( !conn ) throw -1; |
| 798 |
bool connect = conn->IsConnected(); |
bool connect = conn->IsConnected(); |
| 799 |
if( !connect ) throw -1; |
if( !connect ) throw -1; |
| 800 |
|
// |
| 801 |
|
if ( IsDebug() ) printf("\n DB INFORMATIONS:\n SQL: %s Version: %s Host %s Port %i \n\n",conn->GetDBMS(),conn->ServerInfo(),conn->GetHost(),conn->GetPort()); |
| 802 |
|
// |
| 803 |
if ( !dworbit && strcmp(this->GetRootName().Data(),"") ) throw -27; |
if ( !dworbit && strcmp(this->GetRootName().Data(),"") ) throw -27; |
| 804 |
// |
// |
| 805 |
// set DB timezone to UTC |
// set DB timezone to UTC |
| 811 |
TSQLResult *result = 0; |
TSQLResult *result = 0; |
| 812 |
result = conn->Query(oss.str().c_str()); |
result = conn->Query(oss.str().c_str()); |
| 813 |
if ( !result ) throw -10; |
if ( !result ) throw -10; |
| 814 |
|
oss.str(""); |
| 815 |
|
oss << "SET wait_timeout=173000;"; |
| 816 |
|
conn->Query(oss.str().c_str()); |
| 817 |
// |
// |
| 818 |
}; |
}; |
| 819 |
|
|
| 1398 |
// |
// |
| 1399 |
Int_t sgn = 0; |
Int_t sgn = 0; |
| 1400 |
// |
// |
| 1401 |
if ( !found ){ |
if ( !found && !BOOTNO ){ |
| 1402 |
throw -29; |
throw -29; |
| 1403 |
} else { |
} else { |
| 1404 |
if ( afound ){ |
if ( afound ){ |