/[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.64 by mocchiut, Wed Oct 1 16:06:19 2008 UTC revision 1.65 by pam-fi, Thu Nov 6 10:45:36 2008 UTC
# Line 722  void PamLevel2::Reset(){ Line 722  void PamLevel2::Reset(){
722    
723  Bool_t PamLevel2::IsGood(){  Bool_t PamLevel2::IsGood(){
724      Bool_t goodev=true;      Bool_t goodev=true;
725      //  if(trk2_obj && trk2_obj->UnpackError() != 0 ) goodev = false;      if(trk2_obj && trk2_obj->UnpackError() != 0 ) goodev = false;
726      if(calo2_obj && calo2_obj->good != 1) goodev = false;      if(calo2_obj && calo2_obj->good != 1) goodev = false;
727      if(tof_obj && tof_obj->unpackError != 0) goodev = false;        if(tof_obj && tof_obj->unpackError != 0) goodev = false;  
728      if(trig_obj && trig_obj->unpackError != 0) goodev = false;      if(trig_obj && trig_obj->unpackError != 0) goodev = false;
# Line 756  void *PamLevel2::GetPointerTo(const char Line 756  void *PamLevel2::GetPointerTo(const char
756          return &trk2_obj;          return &trk2_obj;
757      };      };
758      if(!objname.CompareTo("TrkHough"))   {      if(!objname.CompareTo("TrkHough"))   {
759          if(!trkh_obj)  trkh_obj  = new TrkHough();          if(!trkh_obj)  {
760                trkh_obj  = new TrkHough();
761                trkh_obj->Set();
762            }
763          return &trkh_obj;          return &trkh_obj;
764      };      };
765      if(!objname.CompareTo("CaloLevel1")) {      if(!objname.CompareTo("CaloLevel1")) {
# Line 2737  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 2740  Bool_t PamLevel2::UpdateRunInfo(Long64_t
2740          // --------------------------------------          // --------------------------------------
2741          // ---> exit with TRUE          // ---> exit with TRUE
2742          // --------------------------------------          // --------------------------------------
2743          cout << endl << " ))))) UPDATE RUN INFO (((((  @iev "<<iev<<" run "<<GetRunInfo()->ID<<" irun "<<irun<<endl;          if(DBG)cout << endl << " ))))) UPDATE RUN INFO (((((  @iev "<<iev<<" run "<<GetRunInfo()->ID<<" irun "<<irun<<endl;
2744            // ----------------------------------------------------
2745            // update the tracker parameters
2746            // (non ho trovato nessun altro modo sicuro di farlo...)
2747            // ----------------------------------------------------
2748            if(!dbc || (dbc && !dbc->IsConnected()) )SetDBConnection();
2749            TrkParams::Set(GetRunInfo() ,dbc);
2750            if(dbc)dbc->Close();
2751    
2752          // ----------------------------------------------------          // ----------------------------------------------------
2753          // then check if the run has a fragment          // then check if the run has a fragment
2754          // in this case we have to switch to the next fragment          // in this case we have to switch to the next fragment
# Line 2746  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 2757  Bool_t PamLevel2::UpdateRunInfo(Long64_t
2757          if(          if(
2758              GetRunInfo()->ID_RUN_FRAG != 0 &&              GetRunInfo()->ID_RUN_FRAG != 0 &&
2759  //          GetRunInfo()->ID_RUN_FRAG != GetRunInfo()->ID &&  //          GetRunInfo()->ID_RUN_FRAG != GetRunInfo()->ID &&
2760                DBG &&
2761              true ){              true ){
2762              cout << "* fragment *"<<endl;                            cout << "* fragment *"<<endl;              
2763          }          }
# Line 2791  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 2803  Bool_t PamLevel2::UpdateRunInfo(Long64_t
2803                      cout << " obt "<<obt;                      cout << " obt "<<obt;
2804                      cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT;                      cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT;
2805                      cout << " *** JUMP RUN *** irun "<<irun;                      cout << " *** JUMP RUN *** irun "<<irun;
 //              if(!SECONDO_GIRO)cout << " (don't worry)";  
 //              else             cout << " (start worring...)";  
2806                      cout << endl;                      cout << endl;
2807                  }                  }
2808  //              irun++;  //              irun++;
# Line 2824  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 2834  Bool_t PamLevel2::UpdateRunInfo(Long64_t
2834                  cout << " obt "<<obt;                  cout << " obt "<<obt;
2835                  cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT;                  cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT;
2836              }              }
2837              cout << endl;              if(DBG)cout << endl;
2838              cout << endl << " ))))) UPDATE RUN INFO (((((  @iev "<<iev<<" run "<<GetRunInfo()->ID<<" (run-entry "<<irun<<")"<<endl;              if(DBG)cout << endl << " ))))) UPDATE RUN INFO (((((  @iev "<<iev<<" run "<<GetRunInfo()->ID<<" (run-entry "<<irun<<")"<<endl;
2839                // ----------------------------------------------------
2840                // update the tracker parameters
2841                // (non ho trovato nessun altro modo sicuro di farlo...)
2842                // ----------------------------------------------------
2843                if(!dbc || (dbc && !dbc->IsConnected()) )SetDBConnection();
2844                TrkParams::Set(GetRunInfo() ,dbc);
2845                if(dbc)dbc->Close();
2846  //          cout << endl;  //          cout << endl;
2847              prevshift = 0;              prevshift = 0;
2848              return true;              return true;
# Line 3897  TTree* PamLevel2::GetYodaTree( ){ Line 3914  TTree* PamLevel2::GetYodaTree( ){
3914  //     }  //     }
3915    
3916      if ( TRK0 ){      if ( TRK0 ){
3917          TrkParams::Load(6);  //      TrkParams::Load(6);
3918          if( !TrkParams::IsLoaded(6) ){  //      if( !TrkParams::IsLoaded(6) ){
3919              cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- VK-mask not loaded"<<endl;  //          cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- VK-mask not loaded"<<endl;
3920          };  //      };
3921          if(!dbc || (dbc && !dbc->IsConnected()))SetDBConnection();  //      if(!dbc || (dbc && !dbc->IsConnected()))SetDBConnection();
3922          TrkParams::SetCalib(run_obj,dbc);          TrkParams::SetCalib(run_obj,dbc);
3923          TrkParams::LoadCalib( );          TrkParams::LoadCalib( );
3924          if( !TrkParams::CalibIsLoaded() ){          if( !TrkParams::CalibIsLoaded() ){
3925              cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- Calibration not loaded"<<endl;              cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- Calibration not loaded"<<endl;
3926          };          };
3927          dbc->Close(); // EMILIANO, do not leave open connections, open only when needed  //      if(dbc)dbc->Close(); // EMILIANO, do not leave open connections, open only when needed
3928      }      }
3929    
3930    
# Line 3976  Int_t PamLevel2::GetYodaEntry(){ Line 3993  Int_t PamLevel2::GetYodaEntry(){
3993      do{      do{
3994          if(shift>0){              if(shift>0){    
3995              cout << " PKTNUM  L2 --- "<< pktn << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl;              cout << " PKTNUM  L2 --- "<< pktn << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl;
3996              cout << "         RUN: ID "<< GetRunInfo()->ID << " ID_ROOT_L0 "<<run_obj->ID_ROOT_L0<<" ID_RUN_FRAG "<<GetRunInfo()->ID_RUN_FRAG << " EV_FROM "<<GetRunInfo()->EV_FROM  <<endl;              if(DBG)cout << "         RUN: ID "<< GetRunInfo()->ID << " ID_ROOT_L0 "<<run_obj->ID_ROOT_L0<<" ID_RUN_FRAG "<<GetRunInfo()->ID_RUN_FRAG << " EV_FROM "<<GetRunInfo()->EV_FROM  <<endl;
3997              cout << "         L2 <--> L0 mismatch ( irun "<<irun<<" irunentry "<<irunentry<<" shift "<<shift<<" prevshift "<<prevshift<<" )"<<endl;              if(DBG)cout << "         L2 <--> L0 mismatch ( irun "<<irun<<" irunentry "<<irunentry<<" shift "<<shift<<" prevshift "<<prevshift<<" )"<<endl;
3998          }          }
3999          answer = l0_tree->GetEntry(quellagiusta+(Long64_t)shift+(Long64_t)prevshift);          answer = l0_tree->GetEntry(quellagiusta+(Long64_t)shift+(Long64_t)prevshift);
4000          shift++;          shift++;
# Line 4025  Int_t PamLevel2::GetYodaEntry(){ Line 4042  Int_t PamLevel2::GetYodaEntry(){
4042   */   */
4043  Bool_t PamLevel2::SetDBConnection(){  Bool_t PamLevel2::SetDBConnection(){
4044    
4045    //    cout << "PamLevel2::SetDBConnection()" << endl;
4046      if(DBG){      if(DBG){
4047          cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;          cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
4048          cout<<"Connecting to DB"<<endl;          cout<<"Connecting to DB"<<endl;

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65

  ViewVC Help
Powered by ViewVC 1.1.23