/[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.39 by pam-fi, Mon May 14 11:57:36 2007 UTC revision 1.40 by pam-fi, Fri May 25 13:38:51 2007 UTC
# Line 304  void PamLevel2::Clear(){ Line 304  void PamLevel2::Clear(){
304    
305      if(h0_obj)   h0_obj->Clear();            if(h0_obj)   h0_obj->Clear();      
306  //    if(trk0_obj) trk0_obj->Clear();    //    if(trk0_obj) trk0_obj->Clear();  
     if(calo0_obj) calo0_obj->Clear();    
307      if(trk1_obj) trk1_obj->Clear();          if(trk1_obj) trk1_obj->Clear();    
308      if(trk2_obj) trk2_obj->Clear();      if(trk2_obj) trk2_obj->Clear();
309      if(trkh_obj) trkh_obj->Clear();      if(trkh_obj) trkh_obj->Clear();
310        if(calo0_obj) calo0_obj->Clear();  
311      if(calo1_obj)calo1_obj->Clear();      if(calo1_obj)calo1_obj->Clear();
312      if(calo2_obj)calo2_obj->Clear();      if(calo2_obj)calo2_obj->Clear();
313      if(tof_obj)  tof_obj->Clear();      if(tof_obj)  tof_obj->Clear();
# Line 2964  Int_t PamLevel2::GetEntry(Long64_t iee){ Line 2964  Int_t PamLevel2::GetEntry(Long64_t iee){
2964  //     cout << "irunentry     "<<irunentry << endl;  //     cout << "irunentry     "<<irunentry << endl;
2965  //     cout << "runfirstentry "<<runfirstentry << endl;  //     cout << "runfirstentry "<<runfirstentry << endl;
2966  //     cout << "nevents       "<<GetRunInfo()->NEVENTS<< endl;  //     cout << "nevents       "<<GetRunInfo()->NEVENTS<< endl;
2967      if( TRK0 || CAL0 || TOF0 ){  
2968          if( !GetYodaEntry( ) ){  //     if( TRK0 || CAL0 || TOF0 ){
2969              cout << " Int_t PamLevel2::GetEntry(Int_t) -- ERROR -- error reading level0 tree"<<endl;  //      if( !GetYodaEntry( ) ){
2970              return 0;  //          cout << " Int_t PamLevel2::GetEntry(Int_t) -- ERROR -- error reading level0 tree"<<endl;
2971          }  //          return 0;
2972      }  //      }
2973    //     }
2974    
2975    
2976      return 1;      return 1;
2977    
2978  }  }
2979    
2980    TrkLevel0    *PamLevel2::GetTrkLevel0(){
2981        if( !TRK0 )return NULL;
2982        if( !GetYodaEntry( ) ){
2983            cout << " Int_t PamLevel2::GetTrkLevel0() -- ERROR -- error reading level0 tree"<<endl;
2984            return 0;
2985        }
2986        return trk0_obj;
2987    };
2988    CaloLevel0    *PamLevel2::GetCaloLevel0(){
2989        if( !CAL0 )return NULL;
2990        if( !GetYodaEntry( ) ){
2991            cout << " Int_t PamLevel2::GetCaloLevel0() -- ERROR -- error reading level0 tree"<<endl;
2992            return 0;
2993        }
2994        return calo0_obj;
2995    };
2996    
2997    
2998  /**  /**
2999   * Method to retrieve the level0 tree (YODA tree) that contains the current event.   * Method to retrieve the level0 tree (YODA tree) that contains the current event.
3000   * Given the run ID (...), if needed it query the DB and load the proper file.   * Given the run ID (...), if needed it query the DB and load the proper file.
# Line 3051  TTree* PamLevel2::GetYodaTree( ){ Line 3072  TTree* PamLevel2::GetYodaTree( ){
3072              };              };
3073              l0_tree->SetBranchAddress("Tracker" ,trk0_obj->GetPointerToTrackerEvent());              l0_tree->SetBranchAddress("Tracker" ,trk0_obj->GetPointerToTrackerEvent());
3074          }          }
3075          //---------------------------------------------------          //--------------------------------------------------
3076          // CALORIMETER:          // CALORIMETER:
3077          if(CAL0){          if(CAL0){
3078              if(!calo0_obj){              if(!calo0_obj){
# Line 3180  Int_t PamLevel2::GetYodaEntry(){ Line 3201  Int_t PamLevel2::GetYodaEntry(){
3201      return answer;      return answer;
3202            
3203  }  }
3204    /**
3205     * \Brief Set DB connection
3206     */
3207    Bool_t PamLevel2::SetDBConnection(){
3208    
3209        cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
3210        cout<<"Connecting to DB"<<endl;
3211        cout<<"HOST "<<host<<endl;
3212        cout<<"USER "<<user<<endl;
3213        cout<<"PSW  "<<psw<<endl;
3214        dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data());
3215        if( !dbc )return false;
3216        if( !dbc->IsConnected() )return false;    
3217        cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
3218        return true;
3219    
3220    }

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.23