48 |
* @param tsync file timesync. |
* @param tsync file timesync. |
49 |
* @param debug debug flag. |
* @param debug debug flag. |
50 |
*/ |
*/ |
51 |
PamelaDBOperations::PamelaDBOperations(TString host, TString user, TString password, TString filerawname, TString filerootname, UInt_t boot, UInt_t tsync, UInt_t obt0, Bool_t debug, Long64_t olderthan){ |
PamelaDBOperations::PamelaDBOperations(TString host, TString user, TString password, TString filerawname, TString filerootname, UInt_t boot, UInt_t tsync, UInt_t obt0, Bool_t debug){ |
52 |
// |
// |
53 |
// |
// |
54 |
SetConnection(host,user,password); |
SetConnection(host,user,password); |
67 |
if(INSERT_RAW)SetRawName(filerawname); |
if(INSERT_RAW)SetRawName(filerawname); |
68 |
// |
// |
69 |
INSERT_ROOT = !filerootname.IsNull(); |
INSERT_ROOT = !filerootname.IsNull(); |
70 |
if(INSERT_ROOT){ |
if( INSERT_ROOT ){ |
71 |
file = TFile::Open(this->GetRootName().Data()); |
this->SetRootName(filerootname); |
72 |
if ( !file ) INSERT_ROOT = false; |
file = TFile::Open(this->GetRootName().Data()); |
73 |
}; |
}; |
|
// this->OpenFile(); |
|
74 |
// |
// |
75 |
this->SetID_RAW(0); |
this->SetID_RAW(0); |
76 |
this->SetID_ROOT(0); |
this->SetID_ROOT(0); |
77 |
|
|
78 |
VALIDATE = false; |
VALIDATE = false; |
|
clean_time = new TDatime(); |
|
|
if(olderthan >= 0){ |
|
|
VALIDATE = true; |
|
|
UInt_t timelim = 0; |
|
|
// timelim = now - olderthan |
|
|
timelim = (UInt_t)clean_time->Convert() - olderthan; |
|
|
clean_time->Set(timelim,false); |
|
|
}; |
|
79 |
|
|
80 |
// |
// |
81 |
}; |
}; |
82 |
|
|
83 |
/** |
/** |
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. |
655 |
// void PamelaDBOperations::OpenFile(){ |
// void PamelaDBOperations::OpenFile(){ |
656 |
// file = TFile::Open(this->GetRootName().Data()); |
// file = TFile::Open(this->GetRootName().Data()); |
657 |
// // |
// // |
658 |
// if ( !file ) throw -12; |
|
659 |
// }; |
void PamelaDBOperations::CheckFile(){ |
660 |
|
if ( !file ) throw -12; |
661 |
|
}; |
662 |
|
|
663 |
|
|
664 |
/** |
/** |