/[PAMELA software]/PamelaLevel2/src/PamLevel2.cpp
ViewVC logotype

Diff of /PamelaLevel2/src/PamLevel2.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.52 by pam-fi, Mon Nov 5 13:10:13 2007 UTC revision 1.53 by pam-fi, Wed Nov 7 10:39:37 2007 UTC
# Line 3757  TTree* PamLevel2::GetYodaTree( ){ Line 3757  TTree* PamLevel2::GetYodaTree( ){
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;
# Line 3818  TTree* PamLevel2::GetYodaTree( ){ Line 3805  TTree* PamLevel2::GetYodaTree( ){
3805              cout << "PamLevel2::GetYodaTree() --- level0 TOF not implemented "<<endl;              cout << "PamLevel2::GetYodaTree() --- level0 TOF not implemented "<<endl;
3806          }          }
3807    
3808          dbc->Close();  //      dbc->Close();
3809    
3810    
3811      };      };
# Line 3832  TTree* PamLevel2::GetYodaTree( ){ Line 3819  TTree* PamLevel2::GetYodaTree( ){
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() ){
# Line 3962  Bool_t PamLevel2::SetDBConnection(){ Line 3950  Bool_t PamLevel2::SetDBConnection(){
3950      dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data());      dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data());
3951      if( !dbc )return false;      if( !dbc )return false;
3952      if( !dbc->IsConnected() )return false;          if( !dbc->IsConnected() )return false;    
3953        stringstream myquery;  // EMILIANO
3954        myquery.str("");  // EMILIANO
3955        myquery << "SET time_zone='+0:00'";  // EMILIANO
3956        dbc->Query(myquery.str().c_str());  // EMILIANO
3957      cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;      cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
3958      return true;      return true;
3959    

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.53

  ViewVC Help
Powered by ViewVC 1.1.23