| 3757 |
// open the DB connection |
// open the DB connection |
| 3758 |
// (if not already opened) |
// (if not already opened) |
| 3759 |
//=================================== |
//=================================== |
| 3760 |
if(!dbc || (dbc && !dbc->IsConnected())){ |
if(!dbc || (dbc && !dbc->IsConnected()))SetDBConnection(); |
|
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
|
|
cout<<"Re-connecting to DB"<<endl; |
|
|
cout<<"HOST "<<host<<endl; |
|
|
cout<<"USER "<<user<<endl; |
|
|
cout<<"PSW "<<psw<<endl; |
|
|
dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
|
|
if( !dbc )return NULL; |
|
|
if( !dbc->IsConnected() )return NULL; |
|
|
// cout<<"...done"<<endl; |
|
|
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
|
|
}else{ |
|
|
// cout<<"DB already connected"<<endl; |
|
|
} |
|
| 3761 |
GL_ROOT glroot = GL_ROOT(); |
GL_ROOT glroot = GL_ROOT(); |
| 3762 |
if( glroot.Query_GL_ROOT(iroot,dbc) ){ |
if( glroot.Query_GL_ROOT(iroot,dbc) ){ |
| 3763 |
cout << "TTree* PamLevel2::GetYodaTree( ) -- ERROR -- level0 file iroot = "<<iroot<< " does not exists"<<endl; |
cout << "TTree* PamLevel2::GetYodaTree( ) -- ERROR -- level0 file iroot = "<<iroot<< " does not exists"<<endl; |
| 3805 |
cout << "PamLevel2::GetYodaTree() --- level0 TOF not implemented "<<endl; |
cout << "PamLevel2::GetYodaTree() --- level0 TOF not implemented "<<endl; |
| 3806 |
} |
} |
| 3807 |
|
|
| 3808 |
dbc->Close(); |
dbc->Close(); // EMILIANO, do not leave open connections, open only when needed |
| 3809 |
|
|
| 3810 |
|
|
| 3811 |
}; |
}; |
| 3819 |
if( !TrkParams::IsLoaded(6) ){ |
if( !TrkParams::IsLoaded(6) ){ |
| 3820 |
cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- VK-mask not loaded"<<endl; |
cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- VK-mask not loaded"<<endl; |
| 3821 |
}; |
}; |
| 3822 |
|
if(!dbc || (dbc && !dbc->IsConnected()))SetDBConnection(); |
| 3823 |
TrkParams::SetCalib(run_obj,dbc); |
TrkParams::SetCalib(run_obj,dbc); |
| 3824 |
TrkParams::LoadCalib( ); |
TrkParams::LoadCalib( ); |
| 3825 |
if( !TrkParams::CalibIsLoaded() ){ |
if( !TrkParams::CalibIsLoaded() ){ |
| 3826 |
cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- Calibration not loaded"<<endl; |
cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- Calibration not loaded"<<endl; |
| 3827 |
}; |
}; |
| 3828 |
|
dbc->Close(); // EMILIANO, do not leave open connections, open only when needed |
| 3829 |
} |
} |
| 3830 |
|
|
| 3831 |
|
|
| 3951 |
dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
| 3952 |
if( !dbc )return false; |
if( !dbc )return false; |
| 3953 |
if( !dbc->IsConnected() )return false; |
if( !dbc->IsConnected() )return false; |
| 3954 |
|
stringstream myquery; // EMILIANO |
| 3955 |
|
myquery.str(""); // EMILIANO |
| 3956 |
|
myquery << "SET time_zone='+0:00'"; // EMILIANO |
| 3957 |
|
dbc->Query(myquery.str().c_str()); // EMILIANO |
| 3958 |
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
| 3959 |
return true; |
return true; |
| 3960 |
|
|