/[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.61 by pam-fi, Thu Apr 3 14:39:51 2008 UTC revision 1.72 by mocchiut, Fri Dec 12 14:11:50 2008 UTC
# Line 284  PamTrack::PamTrack(){ Line 284  PamTrack::PamTrack(){
284      trk_track  = 0;      trk_track  = 0;
285      calo_track = 0;      calo_track = 0;
286      tof_track  = 0;      tof_track  = 0;
287        orb_track  = 0;
288      candeleteobj = 0;      candeleteobj = 0;
289      pscore = 0;      pscore = 0;
290      iscore = 0;      iscore = 0;
# Line 295  PamTrack::PamTrack(){ Line 296  PamTrack::PamTrack(){
296  /**  /**
297   * Constructor   * Constructor
298   */   */
299  PamTrack::PamTrack(TrkTrack* t, CaloTrkVar* c, ToFTrkVar* o){  PamTrack::PamTrack(TrkTrack* t, CaloTrkVar* c, ToFTrkVar* o, OrbitalInfoTrkVar *r){
300    
301      trk_track  = 0;      trk_track  = 0;
302      calo_track = 0;      calo_track = 0;
303      tof_track  = 0;      tof_track  = 0;
304        orb_track  = 0;
305  //     if(t)trk_track  = new TrkTrack(*t);  //     if(t)trk_track  = new TrkTrack(*t);
306  //     if(c)calo_track = new CaloTrkVar(*c);  //     if(c)calo_track = new CaloTrkVar(*c);
307  //     if(o)tof_track  = new ToFTrkVar(*o);  //     if(o)tof_track  = new ToFTrkVar(*o);
308      if(t)trk_track  = t;      if(t)trk_track  = t;
309      if(c)calo_track = c;      if(c)calo_track = c;
310      if(o)tof_track  = o;      if(o)tof_track  = o;
311      candeleteobj = 0;      if(r) orb_track  = r;
312    
313       candeleteobj = 0;
314    
315  };  };
316  PamTrack::PamTrack(const PamTrack& track){  PamTrack::PamTrack(const PamTrack& track){
# Line 314  PamTrack::PamTrack(const PamTrack& track Line 318  PamTrack::PamTrack(const PamTrack& track
318      TrkTrack   *t = track.trk_track;      TrkTrack   *t = track.trk_track;
319      CaloTrkVar *c = track.calo_track;      CaloTrkVar *c = track.calo_track;
320      ToFTrkVar  *o = track.tof_track;      ToFTrkVar  *o = track.tof_track;
321        OrbitalInfoTrkVar  *r = track.orb_track;
322    
323      trk_track  = 0;      trk_track  = 0;
324      calo_track = 0;      calo_track = 0;
325      tof_track  = 0;      tof_track  = 0;
326        orb_track  = 0;
327      if(t)trk_track  = new TrkTrack(*t);      if(t)trk_track  = new TrkTrack(*t);
328      if(c)calo_track = new CaloTrkVar(*c);      if(c)calo_track = new CaloTrkVar(*c);
329      if(o)tof_track  = new ToFTrkVar(*o);      if(o)tof_track  = new ToFTrkVar(*o);
330        if(r)orb_track  = new OrbitalInfoTrkVar(*r);
331      candeleteobj = 1;      candeleteobj = 1;
332            
333  }  }
# Line 331  void PamTrack::Clear(){ Line 338  void PamTrack::Clear(){
338          if(trk_track)  trk_track->TrkTrack::Clear();          if(trk_track)  trk_track->TrkTrack::Clear();
339          if(calo_track) calo_track->CaloTrkVar::Clear();//???          if(calo_track) calo_track->CaloTrkVar::Clear();//???
340          if(tof_track)  tof_track->ToFTrkVar::Clear();//???          if(tof_track)  tof_track->ToFTrkVar::Clear();//???
341            if(orb_track)  orb_track->OrbitalInfoTrkVar::Clear();//???
342      }else{      }else{
343          trk_track  = 0;          trk_track  = 0;
344          calo_track = 0;          calo_track = 0;
345          tof_track  = 0;          tof_track  = 0;
346            orb_track  = 0;
347      }      }
348      pscore = 0;      pscore = 0;
349      iscore = 0;      iscore = 0;
# Line 355  void PamTrack::Delete(){ Line 364  void PamTrack::Delete(){
364              tof_track->ToFTrkVar::Clear();//???              tof_track->ToFTrkVar::Clear();//???
365              delete tof_track;              delete tof_track;
366          }          }
367            if(orb_track){
368                orb_track->OrbitalInfoTrkVar::Clear();//???
369                delete orb_track;
370            }
371      }else{      }else{
372          Clear();          Clear();
373      }      }
# Line 391  PamLevel2::PamLevel2(TString ddir,TStrin Line 404  PamLevel2::PamLevel2(TString ddir,TStrin
404      GetRunTree(listf);      GetRunTree(listf);
405  };  };
406    
407    PamLevel2::PamLevel2(TString ddir,TList *list,TString detlist){
408        Initialize();
409        GetPamTree(list,detlist);
410        GetRunTree(list);
411    };
412  /**  /**
413   * Constructor   * Constructor
414   * @param ddir Name of directory where level2 files are stored.   * @param ddir Name of directory where level2 files are stored.
# Line 431  void PamLevel2::Initialize(){ Line 449  void PamLevel2::Initialize(){
449      irunt = -1LL;      irunt = -1LL;
450      runfirstentry = 0LL;      runfirstentry = 0LL;
451      runlastentry = 0LL;      runlastentry = 0LL;
452        gltsync = 0; // Emiliano
453    
454      l0_file = NULL;      l0_file = NULL;
455      l0_tree = NULL;      l0_tree = NULL;
# Line 540  void PamLevel2::Delete(){ Line 559  void PamLevel2::Delete(){
559          dbc->Close();          dbc->Close();
560          delete dbc;          delete dbc;
561      }      }
562    
563        if ( gltsync ) delete gltsync;
564            
565      if(l0_file)l0_file->Close();      if(l0_file)l0_file->Close();
566      //    if(pam_tree)pam_tree->Delete();;      //    if(pam_tree)pam_tree->Delete();;
# Line 708  void PamLevel2::Reset(){ Line 729  void PamLevel2::Reset(){
729      //      //
730  };  };
731    
732  Bool_t PamLevel2::IsGood(){  Bool_t PamLevel2::IsGood(Bool_t strict){
733      Bool_t goodev=true;    Bool_t goodev=true;
734      //  if(trk2_obj && trk2_obj->UnpackError() != 0 ) goodev = false;    //
735      if(calo2_obj && calo2_obj->good != 1) goodev = false;    if(calo2_obj && !calo2_obj->IsGood(strict) ) goodev = false;
736      //
737      if ( strict ){
738        if(trk2_obj && trk2_obj->UnpackError() != 0 ) goodev = false;
739      if(tof_obj && tof_obj->unpackError != 0) goodev = false;        if(tof_obj && tof_obj->unpackError != 0) goodev = false;  
740      if(trig_obj && trig_obj->unpackError != 0) goodev = false;      if(trig_obj && trig_obj->unpackError != 0) goodev = false;
741      if(s4_obj && s4_obj->unpackError != 0) goodev = false;        if(s4_obj && s4_obj->unpackError != 0) goodev = false;  
742      if(nd_obj && nd_obj->unpackError != 0) goodev = false;        if(nd_obj && nd_obj->unpackError != 0) goodev = false;  
743      if(ac_obj && ac_obj->unpackError != 255) goodev = false;        if(ac_obj && (ac_obj->unpackError != 0 || ((ac_obj->status[0]>>3)&1) || ((ac_obj->status[0]>>3)&1)) ) goodev = false;      
744      //  if(orb_obj)        //  if(orb_obj)  
745      return goodev;    } else {
746        if(nd_obj && nd_obj->unpackError != 0) goodev = false;  
747        if(ac_obj && (ac_obj->unpackError != 0 || ((ac_obj->status[0]>>3)&1) || ((ac_obj->status[0]>>3)&1)) ) goodev = false;      
748      };
749      return(goodev);
750  };  };
751    
752  //--------------------------------------  //--------------------------------------
# Line 744  void *PamLevel2::GetPointerTo(const char Line 772  void *PamLevel2::GetPointerTo(const char
772          return &trk2_obj;          return &trk2_obj;
773      };      };
774      if(!objname.CompareTo("TrkHough"))   {      if(!objname.CompareTo("TrkHough"))   {
775          if(!trkh_obj)  trkh_obj  = new TrkHough();          if(!trkh_obj)  {
776                trkh_obj  = new TrkHough();
777                trkh_obj->Set();
778            }
779          return &trkh_obj;          return &trkh_obj;
780      };      };
781      if(!objname.CompareTo("CaloLevel1")) {      if(!objname.CompareTo("CaloLevel1")) {
# Line 781  void *PamLevel2::GetPointerTo(const char Line 812  void *PamLevel2::GetPointerTo(const char
812          if(!ac_obj)    ac_obj    = new AcLevel2();          if(!ac_obj)    ac_obj    = new AcLevel2();
813          return &ac_obj;          return &ac_obj;
814      };      };
815      if(!objname.CompareTo("OrbitalInfo")){      if(!objname.CompareTo("OrbitalInfo"))  {
816          if(!orb_obj)   orb_obj   = new OrbitalInfo();          if(!orb_obj){
817                orb_obj   = new OrbitalInfo();
818                orb_obj->Set();
819            }
820          return &orb_obj;          return &orb_obj;
821      };      };
822    //     if(!objname.CompareTo("OrbitalInfo")){
823    //      if(!orb_obj)   orb_obj   = new OrbitalInfo();
824    //      return &orb_obj;
825    //     };
826      if(!objname.CompareTo("GPamela")){      if(!objname.CompareTo("GPamela")){
827          if(!gp_obj)   gp_obj   = new GPamela();          if(!gp_obj)   gp_obj   = new GPamela();
828          return &gp_obj;          return &gp_obj;
# Line 866  ToFTrkVar *PamLevel2::GetToFStoredTrack( Line 904  ToFTrkVar *PamLevel2::GetToFStoredTrack(
904  //  //
905  //--------------------------------------  //--------------------------------------
906  /**  /**
907   * Give the pamela track associated to a tracker track, retrieving related calorimeter and tof track information.   * Retrieves the OrbitalInfo track matching the seqno-th tracker stored track.
908     * (If seqno = -1 retrieves the tracker-independent tof related track)
909     */
910    OrbitalInfoTrkVar *PamLevel2::GetOrbitalInfoStoredTrack(int seqno){
911            
912        if( !orb_obj )return 0;
913    
914    
915        if( orb_obj->OrbitalInfo::ntrk()==0 ){
916    //       // TRICK BEGIN
917    //       OrbitalInfoTrkVar  *r = new OrbitalInfoTrkVar(); // TEMPORARY TRICK
918    //       Int_t nn = 0;
919    //       TClonesArray &tor = *orb_obj->OrbitalInfoTrk;
920    //       for(Int_t nt=0; nt < tof_obj->ToFLevel2::ntrk(); nt++){  
921    //      //
922    //      ToFTrkVar *ptt = tof_obj->ToFLevel2::GetToFTrkVar(nt);
923    //      if ( ptt->trkseqno != -1  ){
924    //        //
925    //        r->trkseqno = ptt->trkseqno;
926    //        //
927    //        r->Eij = 0;  
928    //        //
929    //        r->Sij = 0;
930    //        //        
931    //        r->pitch = -1000.;
932    //        //
933    //        r->cutoff = -1000.;
934    //        //
935    //        new(tor[nn]) OrbitalInfoTrkVar(*r);
936    //        nn++;
937    //        //
938    //        r->Clear();
939    //        //
940    //      };
941    //       };
942    //       delete r;
943    //       OrbitalInfoTrkVar *c = 0;
944    //       c = orb_obj->OrbitalInfo::GetOrbitalInfoTrkVar(0);
945    //       return c;
946    //       //TRICK END
947          cout << "PamLevel2::GetOrbitalInfoStoredTrack(int) : requested tracker SeqNo "<< seqno <<" but no OrbitalInfo tracks are stored"<<endl;
948          return NULL;
949        };
950        
951        OrbitalInfoTrkVar *c = 0;
952        Int_t it_tof=0;
953        
954        do{
955            c = orb_obj->OrbitalInfo::GetOrbitalInfoTrkVar(it_tof);
956            it_tof++;
957        } while( c && seqno != c->trkseqno && it_tof < orb_obj->OrbitalInfo::ntrk());      
958        
959        if(!c || seqno != c->trkseqno){
960            c = 0;
961            if(seqno!=-1)cout << "PamLevel2::GetOrbitalInfoStoredTrack(int) : requested tracker SeqNo "<< seqno <<" does not match OrbitalInfo stored tracks"<<endl;
962        };
963        return c;
964        
965    };
966    
967    //--------------------------------------
968    //
969    //
970    //--------------------------------------
971    /**
972     * Give the pamela track associated to a tracker track, retrieving related calorimeter, orbitalinfo and tof track information.
973   */   */
974  PamTrack* PamLevel2::GetPamTrackAlong(TrkTrack* t){  PamTrack* PamLevel2::GetPamTrackAlong(TrkTrack* t){
975            
# Line 875  PamTrack* PamLevel2::GetPamTrackAlong(Tr Line 978  PamTrack* PamLevel2::GetPamTrackAlong(Tr
978    
979      CaloTrkVar *c = 0;      CaloTrkVar *c = 0;
980      ToFTrkVar  *o = 0;      ToFTrkVar  *o = 0;
981        OrbitalInfoTrkVar  *r = 0;
982            
983      if(CAL2) c = GetCaloStoredTrack(t->GetSeqNo());      if(CAL2) c = GetCaloStoredTrack(t->GetSeqNo());
984      if(TOF) o = GetToFStoredTrack(t->GetSeqNo());      if(TOF) o = GetToFStoredTrack(t->GetSeqNo());
985        if(ORB) r = GetOrbitalInfoStoredTrack(t->GetSeqNo());
986            
987  //    if(t && c && o)track = new PamTrack(t,c,o);  //    if(t && c && o)track = new PamTrack(t,c,o);
988      PamTrack *track = new PamTrack(t,c,o);      PamTrack *track = new PamTrack(t,c,o,r);
989            
990      return track;      return track;
991    
# Line 898  PamTrack* PamLevel2::GetPamTrackAlong(Tr Line 1003  PamTrack* PamLevel2::GetPamTrackAlong(Tr
1003  PamTrack* PamLevel2::GetStoredTrack(Int_t itrk){  PamTrack* PamLevel2::GetStoredTrack(Int_t itrk){
1004            
1005      cout <<"PamLevel2::GetStoredTrack(Int_t itrk) **to-be-updated** "<<endl;      cout <<"PamLevel2::GetStoredTrack(Int_t itrk) **to-be-updated** "<<endl;
1006      cout <<"for the moment, better use separately the methods: TrkLevel2::GetStoredTrack(seqno) CaloLevel2::GetCaloTrkVar(Int_t notrack) ToFLevel2::GetToFTrkVar(Int_t notrack)"<<endl;      cout <<"for the moment, better use separately the methods: TrkLevel2::GetStoredTrack(seqno) CaloLevel2::GetCaloTrkVar(Int_t notrack) ToFLevel2::GetToFTrkVar(Int_t notrack) OrbitalInfo::GetOrbitalInfoTrkVar(Int_t notrack)"<<endl;
1007      cout <<"(if you use it, remember to delete the PamTrack object)"<<endl;      cout <<"(if you use it, remember to delete the PamTrack object)"<<endl;
1008      PamTrack *track = 0;      PamTrack *track = 0;
1009            
# Line 1010  void PamLevel2::SortTracks(){ Line 1115  void PamLevel2::SortTracks(){
1115          TrkTrack   *ts = 0;          TrkTrack   *ts = 0;
1116          CaloTrkVar *cs = 0;          CaloTrkVar *cs = 0;
1117          ToFTrkVar  *os = 0;          ToFTrkVar  *os = 0;
1118            OrbitalInfoTrkVar  *rs = 0;
1119                    
1120          // get tracker tracks          // get tracker tracks
1121          TrkTrack   *tp = trk2_obj->TrkLevel2::GetTrack(i); //tracker          TrkTrack   *tp = trk2_obj->TrkLevel2::GetTrack(i); //tracker
1122          CaloTrkVar *cp = GetCaloStoredTrack(tp->GetSeqNo());          CaloTrkVar *cp = GetCaloStoredTrack(tp->GetSeqNo());
1123          ToFTrkVar  *op = GetToFStoredTrack(tp->GetSeqNo());          ToFTrkVar  *op = GetToFStoredTrack(tp->GetSeqNo());
1124            OrbitalInfoTrkVar  *rp = GetOrbitalInfoStoredTrack(tp->GetSeqNo());
1125    
1126          TrkTrack   *ti = 0; //tracker (image)          TrkTrack   *ti = 0; //tracker (image)
1127          CaloTrkVar *ci = 0;          CaloTrkVar *ci = 0;
1128          ToFTrkVar  *oi = 0;          ToFTrkVar  *oi = 0;
1129            OrbitalInfoTrkVar  *ri = 0;
1130          //      cout << "trk track n. "<<i << " "<<hex<< tp <<dec<< endl;          //      cout << "trk track n. "<<i << " "<<hex<< tp <<dec<< endl;
1131          // if track has an image, check image selection          // if track has an image, check image selection
1132    
# Line 1032  void PamLevel2::SortTracks(){ Line 1140  void PamLevel2::SortTracks(){
1140              ti = trk2_obj->TrkLevel2::GetTrackImage(i);              //tracker (image)              ti = trk2_obj->TrkLevel2::GetTrackImage(i);              //tracker (image)
1141              ci = GetCaloStoredTrack(ti->GetSeqNo());              ci = GetCaloStoredTrack(ti->GetSeqNo());
1142              oi = GetToFStoredTrack(ti->GetSeqNo());              oi = GetToFStoredTrack(ti->GetSeqNo());
1143                ri = GetOrbitalInfoStoredTrack(ti->GetSeqNo());
1144                            
1145              //      cout << "its image "<<i << " "<<hex<< ti <<dec<< endl;              //      cout << "its image "<<i << " "<<hex<< ti <<dec<< endl;
1146    
# Line 1373  void PamLevel2::SortTracks(){ Line 1482  void PamLevel2::SortTracks(){
1482                  ts = ti;//its image!!                  ts = ti;//its image!!
1483                  cs = ci;                  cs = ci;
1484                  os = oi;                  os = oi;
1485                    rs = ri;
1486                  Int_t totis = toti_score;                  Int_t totis = toti_score;
1487    
1488                  ti = tp;//its image!!                  ti = tp;//its image!!
1489                  ci = cp;                  ci = cp;
1490                  oi = op;                  oi = op;
1491                    ri = rp;
1492    
1493                  tp = ts;//its image!!                  tp = ts;//its image!!
1494                  cp = cs;                  cp = cs;
1495                  op = os;                  op = os;
1496                    rp = rs;
1497    
1498                  toti_score = totp_score;                  toti_score = totp_score;
1499                  totp_score = totis;                  totp_score = totis;
# Line 1411  void PamLevel2::SortTracks(){ Line 1523  void PamLevel2::SortTracks(){
1523          //      cout<<"o "<<cp<<endl;          //      cout<<"o "<<cp<<endl;
1524          //      cout<<"o "<<op<<endl;          //      cout<<"o "<<op<<endl;
1525    
1526          new(ttsorted[i]) PamTrack(tp,cp,op);          new(ttsorted[i]) PamTrack(tp,cp,op,rp);
1527          new(ttimage[i])  PamTrack(ti,ci,oi);          new(ttimage[i])  PamTrack(ti,ci,oi,ri);
1528    
1529          ((PamTrack*)(ttsorted[i]))->SetPScore(totp_score);          ((PamTrack*)(ttsorted[i]))->SetPScore(totp_score);
1530          ((PamTrack*)(ttsorted[i]))->SetIScore(toti_score);          ((PamTrack*)(ttsorted[i]))->SetIScore(toti_score);
# Line 1595  TTree *PamLevel2::GetPamTree(TFile *f, T Line 1707  TTree *PamLevel2::GetPamTree(TFile *f, T
1707      if(ORB)cout<<"ORB ";      if(ORB)cout<<"ORB ";
1708      if(GP)cout<<"GP ";      if(GP)cout<<"GP ";
1709      cout << endl;      cout << endl;
1710      if(SELLI)cout<<">>> Found selection-list <<<"<<endl;      if(SELLI && SELLI!=2)cout<<">>> Found selection-list <<<"<<endl; //EMILIANO
1711    
1712      f->cd();      f->cd();
1713    
# Line 2523  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 2635  Bool_t PamLevel2::UpdateRunInfo(Long64_t
2635          prevshift = 0;          prevshift = 0;
2636          run_tree->GetEntry(irun);          run_tree->GetEntry(irun);
2637          if( !GetOrbitalInfo() )cout << "** WARNING ** missing OrbitalInfo ---> run info might be not correctly updated "<<endl;          if( !GetOrbitalInfo() )cout << "** WARNING ** missing OrbitalInfo ---> run info might be not correctly updated "<<endl;
2638            if ( gltsync ) delete gltsync; //Emiliano
2639            if(!dbc || (dbc && !dbc->IsConnected()) )SetDBConnection(); //Emiliano
2640            gltsync = new GL_TIMESYNC(GetRunInfo()->ID_ROOT_L0,"ID",dbc); //Emiliano
2641            if ( dbc ) dbc->Close();// Emiliano
2642      };            };      
2643      // ---------------------------------------------------------------      // ---------------------------------------------------------------
2644      // retrieve OBT and absolute time of the event      // retrieve OBT and absolute time of the event
2645      // ---------------------------------------------------------------      // ---------------------------------------------------------------
2646      ULong64_t abstime = 0LL;      ULong64_t abstime = 0LL;
2647      ULong64_t obt     = 0LL;      //    ULong64_t obt     = 0LL; // Emiliano
2648        Long64_t obt     = 0LL; // Emiliano, Long64_t GL_TIMESYNC::DBobt(UInt_t obt) since depending on the situation OBT is lowered or boosted
2649      if( GetOrbitalInfo() ){      if( GetOrbitalInfo() ){
2650          abstime = GetOrbitalInfo()->absTime;          abstime = GetOrbitalInfo()->absTime;
2651          obt     = GetOrbitalInfo()->OBT;          obt     = gltsync->DBobt(GetOrbitalInfo()->OBT); // Emiliano
 //      cout << " ABS >>> "<<abstime<<" OBT >>> "<<obt<<" "<<endl;  
2652      }else{      }else{
2653          abstime = GetRunInfo()->RUNHEADER_TIME;          abstime = GetRunInfo()->RUNHEADER_TIME;
2654          obt     = GetRunInfo()->RUNHEADER_OBT;          obt     = gltsync->DBobt(GetRunInfo()->RUNHEADER_OBT); // Emiliano
2655      }      }
 //    cout << ISGP << " "<<abstime<<endl;  
     // ---------------------------------------------------------------  
     // the absolute time is necessary to relate the event with the run  
     // ---------------------------------------------------------------  
 //     if( !GetOrbitalInfo() && !ISGP ){  
 //      cout << "Bool_t PamLevel2::UpdateRunInfo(Long64_t iev) -- ERROR -- missing OrbitalInfo "<<endl;  
 //      return(false);  
 //     }  
     // -----------------------------------------------------------------------  
     // if it is simulation, assign abstime by hand (temporaneo!!!)  
     // -----------------------------------------------------------------------  
 //     if(ISGP){  
 //      abstime = GetRunInfo()->RUNHEADER_TIME; // BARBATRUCCO  
 //      obt     = GetRunInfo()->RUNHEADER_OBT; // BARBATRUCCO  
 //     }  
2656            
2657    
2658      // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-      // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
2659      // if it is a full file (not preselected)      // if it is a full file (not preselected)
2660      // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-      // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
2661      if(SELLI==0){      if(SELLI==0 || SELLI==2){ // Emiliano
2662    
2663          // ---------------------------------------------------------------          // ---------------------------------------------------------------
2664          // increment dead and live-time counters          // increment dead and live-time counters
# Line 2570  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 2671  Bool_t PamLevel2::UpdateRunInfo(Long64_t
2671              }              }
2672              totdltime[2]++;              totdltime[2]++;
2673          }          }
 //      cout << setw(10)<<totdltime[0]<<setw(10)<<totdltime[1]<<setw(10)<<totdltime[2]<<endl;  
   
 //      // ---------------------------------------------------------------  
 //      // retrieve OBT and absolute time of the event  
 //      // ---------------------------------------------------------------  
 //      ULong64_t abstime = 0;  
 //      ULong64_t obt     = 0;  
 //      if( GetOrbitalInfo() ){  
 //          abstime = GetOrbitalInfo()->absTime;  
 //          obt     = GetOrbitalInfo()->OBT;  
 //      }  
 //      // ---------------------------------------------------------------  
 //      // the absolute time is necessary to relate the event with the run  
 //      // ---------------------------------------------------------------  
 //      if( !GetOrbitalInfo() && !ISGP ){  
 //          cout << "Bool_t PamLevel2::UpdateRunInfo(Long64_t iev) -- ERROR -- missing OrbitalInfo "<<endl;  
 //          return(false);  
 //      }  
         
 //      // -----------------------------------------------------------------------  
 //      // the first time the routine is called, set run search from the beginning  
 //      // -----------------------------------------------------------------------  
 //      if ( irun < 0 ){  
 //          irun = 0LL;  
 //          irunt = 0LL;  
 //          irunentry = 0;  
 //          prevshift = 0;  
 //          run_tree->GetEntry(irun);  
   
 //          if( ISGP && run_tree->GetEntries()!=1 ){  
 //              cout << "** WARNING ** simulated files are assumed to have 1 single run, not "<< run_tree->GetEntries() << endl;  
 //              cout << "** WARNING ** run will not be updated"<<endl;  
 //          }  
 //      };        
2674    
 //      // -----------------------------------------------------------------------  
 //      // if it is simulation, assign abstime by hand (temporaneo!!!)  
 //      // -----------------------------------------------------------------------  
 //      if(ISGP){  
 //          abstime = GetRunInfo()->RUNHEADER_TIME; // BARBATRUCCO  
 //          obt     = GetRunInfo()->RUNHEADER_OBT; // BARBATRUCCO  
 //      }  
2675          //          //
2676          bool fromfirst = true; // first loop over runs          bool fromfirst = true; // first loop over runs
2677    
 //      Bool_t hasfrag = false;  
 //      if( GetRunInfo()->ID_RUN_FRAG!=0 && GetRunInfo()->ID_RUN_FRAG != GetRunInfo()->ID)hasfrag=true;  
 //      ULong64_t fragid = GetRunInfo()->ID_RUN_FRAG;  
2678    
2679          // ------------------------------------------------------          // ------------------------------------------------------
2680          // loop over runs to find the one that contains the event          // loop over runs to find the one that contains the event
2681          // ------------------------------------------------------          // ------------------------------------------------------
2682          while (          while (
2683              (              (
2684                  (  //              (
2685                      !(abstime >= GetRunInfo()->RUNHEADER_TIME &&    // check on absolute time (s)  //                  !(abstime >= GetRunInfo()->RUNHEADER_TIME &&    // check on absolute time (s)
2686                        abstime <= GetRunInfo()->RUNTRAILER_TIME) &&  //                    abstime <= GetRunInfo()->RUNTRAILER_TIME) &&
2687                      !(obt >= GetRunInfo()->RUNHEADER_OBT &&         // additional check on OBT (ms)  //                  !(obt >= GetRunInfo()->RUNHEADER_OBT &&         // additional check on OBT (ms)
2688                        obt <= GetRunInfo()->RUNTRAILER_OBT)  //                    obt <= GetRunInfo()->RUNTRAILER_OBT)
2689                      )  //                  )
2690                  || GetRunInfo()->NEVENTS==0                  
2691                    !(abstime >= GetRunInfo()->RUNHEADER_TIME &&    // check on absolute time (s)
2692                      abstime <= GetRunInfo()->RUNTRAILER_TIME)
2693                    ||
2694                    !(obt >= gltsync->DBobt(GetRunInfo()->RUNHEADER_OBT) &&         // additional check on OBT (ms) // Emiliano
2695                      obt <= gltsync->DBobt(GetRunInfo()->RUNTRAILER_OBT))           // Emiliano
2696                    ||
2697                    GetRunInfo()->NEVENTS==0
2698  //              || !(irunentry < GetRunInfo()->NEVENTS-1-prevshift) // ERRORE!!! fa saltare i run con 1 evento  //              || !(irunentry < GetRunInfo()->NEVENTS-1-prevshift) // ERRORE!!! fa saltare i run con 1 evento
2699                  || !(irunentry <= GetRunInfo()->NEVENTS-1-prevshift)                  ||
2700                    !(irunentry <= GetRunInfo()->NEVENTS-1-prevshift)
2701                  )                  )
2702              && irun < run_tree->GetEntries() ){              && irun < run_tree->GetEntries() ){
2703    
2704    
2705    //          if( !(abstime >= GetRunInfo()->RUNHEADER_TIME &&abstime <= GetRunInfo()->RUNTRAILER_TIME)  )cout << "ABS TIME "<<abstime << " " <<GetRunInfo()->RUNTRAILER_TIME <<endl;
2706    //          if( !(obt >= GetRunInfo()->RUNHEADER_OBT && obt <= GetRunInfo()->RUNTRAILER_OBT) )cout << "OBT TIME "<< obt <<" "<< GetRunInfo()->RUNTRAILER_OBT << endl;
2707    //          if( GetRunInfo()->NEVENTS==0  )cout <<"GetRunInfo()->NEVENTS==0 "<<endl;
2708    //          if( !(irunentry <= GetRunInfo()->NEVENTS-1-prevshift) ) cout << "irunentry > "<<GetRunInfo()->NEVENTS-1-prevshift << endl;
2709              // - - - - - - - - - - - - -              // - - - - - - - - - - - - -
2710              // irunentry = position of current entry, relative to the run              // irunentry = position of current entry, relative to the run
2711              // prevshift = shift needed to synchronize l0 and l2 data (nested events)              // prevshift = shift needed to synchronize l0 and l2 data (nested events)
# Line 2645  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 2715  Bool_t PamLevel2::UpdateRunInfo(Long64_t
2715              // store dead and live-time of previous run              // store dead and live-time of previous run
2716              // -----------------------------------------              // -----------------------------------------
2717  //          if(SELLI==0){  //          if(SELLI==0){
2718                  if(fromfirst){            if(SELLI!=2){
2719                      if(oldrun==irun){              if(fromfirst){
2720                          /// decrement counters                  if(oldrun==irun){
2721                          if( GetTrigLevel2()){                      /// decrement counters
2722                              totdltime[0]-=GetTrigLevel2()->dltime[0];//live-time                      if( GetTrigLevel2()){
2723                              totdltime[1]-=GetTrigLevel2()->dltime[1];//dead-time                          totdltime[0]-=GetTrigLevel2()->dltime[0];//live-time
2724                          }                          totdltime[1]-=GetTrigLevel2()->dltime[1];//dead-time
                         totdltime[2]--;                              //event counter  
                         cout << endl;  
                         cout << "n.events     : "<<totdltime[2]<<endl;  
                         cout << "RUN LIVE-TIME: "<<totdltime[0]*0.16<<" ms"<<endl;  
                         cout << "RUN DEAD-TIME: "<<totdltime[1]*0.01<<" ms"<<endl;            
                     }else{  
                         totdltime[0]=0;//live-time  
                         totdltime[1]=0;//dead-time  
                         totdltime[2]=0;                             //event counter  
                         cout << " *** JUMP RUN *** irun "<<irun<<endl;  
2725                      }                      }
2726                      /// add an entry                      totdltime[2]--;                              //event counter
2727                      if(run_tree_clone)                      cout << endl;
2728                          if(run_tree_clone->GetBranch("DeadLiveTime")->GetEntries() < run_tree->GetEntries())                      cout << "n.events     : "<<totdltime[2]<<endl;
2729                              run_tree_clone->GetBranch("DeadLiveTime")->Fill();                      cout << "RUN LIVE-TIME: "<<totdltime[0]*0.16<<" ms"<<endl;
2730                      /// reset counters                      cout << "RUN DEAD-TIME: "<<totdltime[1]*0.01<<" ms"<<endl;      
2731                      if( GetTrigLevel2() ){                  }else{
2732                          totdltime[0]=GetTrigLevel2()->dltime[0];//live-time                      totdltime[0]=0;//live-time
2733                          totdltime[1]=0;                         //dead-time                      totdltime[1]=0;//dead-time
2734                      }                      totdltime[2]=0;                             //event counter
2735                      totdltime[2]=1;                             //event counter                      cout << " *** JUMP RUN *** irun "<<irun<<endl;
2736                    }
2737                    /// add an entry
2738                    if(run_tree_clone)
2739                        if(run_tree_clone->GetBranch("DeadLiveTime")->GetEntries() < run_tree->GetEntries())
2740                            run_tree_clone->GetBranch("DeadLiveTime")->Fill();
2741                    /// reset counters
2742                    if( GetTrigLevel2() ){
2743                        totdltime[0]=GetTrigLevel2()->dltime[0];//live-time
2744                        totdltime[1]=0;                         //dead-time
2745                  }                  }
2746  //          }                  totdltime[2]=1;                             //event counter
2747                }
2748              }
2749              //        }
2750    
2751              irun++;                      irun++;        
2752              // ------------------------------------              // ------------------------------------
# Line 2704  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 2776  Bool_t PamLevel2::UpdateRunInfo(Long64_t
2776              if(irun>0)runfirstentry += (GetRunInfo()->NEVENTS)-prevshift;              if(irun>0)runfirstentry += (GetRunInfo()->NEVENTS)-prevshift;
2777              irunentry = 0;              irunentry = 0;
2778              prevshift = 0;                        prevshift = 0;          
2779              run_tree->GetEntry(irun);              run_tree->GetEntry(irun);//update runinfo
2780              irunt = irun - irunoffset[run_tree->GetTreeNumber()];              irunt = irun - irunoffset[run_tree->GetTreeNumber()];
2781              if(GetRunInfo()->RUNHEADER_OBT>GetRunInfo()->RUNTRAILER_OBT ){              if ( gltsync ) delete gltsync; // Emiliano
2782                if(!dbc || (dbc && !dbc->IsConnected()) )SetDBConnection(); //Emiliano
2783                gltsync = new GL_TIMESYNC(GetRunInfo()->ID_ROOT_L0,"ID",dbc); // Emiliano
2784                if ( dbc ) dbc->Close(); // Emiliano
2785                if(gltsync->DBobt(GetRunInfo()->RUNHEADER_OBT)>gltsync->DBobt(GetRunInfo()->RUNTRAILER_OBT) ){ // Emiliano
2786                  cout << "Bool_t PamLevel2::UpdateRunInfo(Long64_t iev) -- WARNING -- irun "<<irun<<"  has RUNHEADER_OBT>=RUNTRAILER_OBT " <<endl;                  cout << "Bool_t PamLevel2::UpdateRunInfo(Long64_t iev) -- WARNING -- irun "<<irun<<"  has RUNHEADER_OBT>=RUNTRAILER_OBT " <<endl;
2787                  cout << "                                                            (NB!! in this case some events are assigned to a wrong run)"<<endl;                  cout << "                                                            (NB!! in this case some events are assigned to a wrong run)"<<endl;
2788              }              }
# Line 2727  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 2803  Bool_t PamLevel2::UpdateRunInfo(Long64_t
2803          // --------------------------------------          // --------------------------------------
2804    
2805    
   
   
2806          // --------------------------------------          // --------------------------------------
2807          // ---> exit with TRUE          // ---> exit with TRUE
2808          // --------------------------------------          // --------------------------------------
2809          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;
2810            // ----------------------------------------------------
2811            // update the tracker parameters
2812            // (non ho trovato nessun altro modo sicuro di farlo...)
2813            // ----------------------------------------------------
2814            if(!dbc || (dbc && !dbc->IsConnected()) )SetDBConnection();
2815            TrkParams::Set(GetRunInfo() ,dbc);
2816            if(dbc)dbc->Close();
2817    
2818          // ----------------------------------------------------          // ----------------------------------------------------
2819          // then check if the run has a fragment          // then check if the run has a fragment
2820          // in this case we have to switch to the next fragment          // in this case we have to switch to the next fragment
# Line 2741  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 2823  Bool_t PamLevel2::UpdateRunInfo(Long64_t
2823          if(          if(
2824              GetRunInfo()->ID_RUN_FRAG != 0 &&              GetRunInfo()->ID_RUN_FRAG != 0 &&
2825  //          GetRunInfo()->ID_RUN_FRAG != GetRunInfo()->ID &&  //          GetRunInfo()->ID_RUN_FRAG != GetRunInfo()->ID &&
2826                DBG &&
2827              true ){              true ){
2828              cout << "* fragment *"<<endl;                            cout << "* fragment *"<<endl;              
2829          }          }
# Line 2760  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 2843  Bool_t PamLevel2::UpdateRunInfo(Long64_t
2843              // check if the time is ok (with merged files it is not...)              // check if the time is ok (with merged files it is not...)
2844              // if not loop over run and look for the proper entry              // if not loop over run and look for the proper entry
2845              bool SECONDO_GIRO=false;              bool SECONDO_GIRO=false;
2846              Long64_t irun_start   = irun;              //      Long64_t irun_start   = irun;
2847              int      offset_start = irunoffset[sel_tree->GetTreeNumber()];              int      offset_start = irunoffset[sel_tree->GetTreeNumber()];
2848              while (              while (
2849                  (                  (
# Line 2786  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 2869  Bool_t PamLevel2::UpdateRunInfo(Long64_t
2869                      cout << " obt "<<obt;                      cout << " obt "<<obt;
2870                      cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT;                      cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT;
2871                      cout << " *** JUMP RUN *** irun "<<irun;                      cout << " *** JUMP RUN *** irun "<<irun;
 //              if(!SECONDO_GIRO)cout << " (don't worry)";  
 //              else             cout << " (start worring...)";  
2872                      cout << endl;                      cout << endl;
2873                  }                  }
2874  //              irun++;  //              irun++;
# Line 2819  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 2900  Bool_t PamLevel2::UpdateRunInfo(Long64_t
2900                  cout << " obt "<<obt;                  cout << " obt "<<obt;
2901                  cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT;                  cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT;
2902              }              }
2903              cout << endl;              if(DBG)cout << endl;
2904              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;
2905                // ----------------------------------------------------
2906                // update the tracker parameters
2907                // (non ho trovato nessun altro modo sicuro di farlo...)
2908                // ----------------------------------------------------
2909                if(!dbc || (dbc && !dbc->IsConnected()) )SetDBConnection();
2910                TrkParams::Set(GetRunInfo() ,dbc);
2911                if(dbc)dbc->Close();
2912  //          cout << endl;  //          cout << endl;
2913              prevshift = 0;              prevshift = 0;
2914              return true;              return true;
# Line 3560  void PamLevel2::CreateCloneTrees(TFile * Line 3648  void PamLevel2::CreateCloneTrees(TFile *
3648      // ------------------------------------      // ------------------------------------
3649      // add branch with dead and live times      // add branch with dead and live times
3650      // ------------------------------------      // ------------------------------------
3651      run_tree_clone->Branch("DeadLiveTime",totdltime,"dltime[3]/l");      if ( SELLI != 2 ){ // EMILIANO
3652      cout << "Run          : branch DeadLiveTime"<<endl;        run_tree_clone->Branch("DeadLiveTime",totdltime,"dltime[3]/l");
3653          cout << "Run          : branch DeadLiveTime"<<endl;
3654    
3655    
3656      sel_tree_clone = new TTree("SelectionList","List of selected events ");        sel_tree_clone = new TTree("SelectionList","List of selected events ");
3657  //    sel_tree_clone->Branch("RunEntry",&irun,"runentry/L");        //    sel_tree_clone->Branch("RunEntry",&irun,"runentry/L");
3658      sel_tree_clone->Branch("RunEntry",&irunt,"runentry/L");//NEWNEW        sel_tree_clone->Branch("RunEntry",&irunt,"runentry/L");//NEWNEW
3659      sel_tree_clone->Branch("EventEntry",&irunentry,"eventry/L");        sel_tree_clone->Branch("EventEntry",&irunentry,"eventry/L");
3660            };
3661    
3662      Int_t i=0;      Int_t i=0;
3663      if(TRK1||TRK2||TRKh){      if(TRK1||TRK2||TRKh){
# Line 3698  void PamLevel2::WriteCloneTrees(){ Line 3787  void PamLevel2::WriteCloneTrees(){
3787      cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl;      cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl;
3788      cout << "Write clones of PAMELA trees "<<endl;      cout << "Write clones of PAMELA trees "<<endl;
3789      cout << run_tree_clone->GetName()<<endl;        cout << run_tree_clone->GetName()<<endl;  
3790      if(run_tree_clone->GetBranch("DeadLiveTime")->GetEntries() < run_tree->GetEntries())      if ( SELLI != 2){// Emiliano
3791          if(run_tree_clone->GetBranch("DeadLiveTime")->GetEntries() < run_tree->GetEntries())
3792          run_tree_clone->GetBranch("DeadLiveTime")->Fill();          run_tree_clone->GetBranch("DeadLiveTime")->Fill();
3793        };
3794      run_tree_clone->Write();      run_tree_clone->Write();
3795      cout << sel_tree_clone->GetName()<<endl;          if ( SELLI != 2){ //Emiliano
3796      sel_tree_clone->Write();        cout << sel_tree_clone->GetName()<<endl;    
3797          sel_tree_clone->Write();
3798        };
3799      for(Int_t i=0; i<NCLONES; i++){          for(Int_t i=0; i<NCLONES; i++){    
3800          if(pam_tree_clone[i]){          if(pam_tree_clone[i]){
3801              cout << pam_tree_clone[i]->GetName()<<endl;              cout << pam_tree_clone[i]->GetName()<<endl;
# Line 3763  Int_t PamLevel2::GetEntry(Long64_t iee){ Line 3856  Int_t PamLevel2::GetEntry(Long64_t iee){
3856  //    Bool_t UPDATED = UpdateRunInfo(run_tree,ii);  //    Bool_t UPDATED = UpdateRunInfo(run_tree,ii);
3857  //    Bool_t UPDATED = UpdateRunInfo(ii);  //    Bool_t UPDATED = UpdateRunInfo(ii);
3858      UpdateRunInfo(ii);      UpdateRunInfo(ii);
3859      if(SELLI==0)irunentry = iee-runfirstentry;      if(SELLI==0||SELLI==2)irunentry = iee-runfirstentry;
3860  //    if(UPDATED && run_tree_clone)run_tree_clone->Fill();  //    if(UPDATED && run_tree_clone)run_tree_clone->Fill();
3861        
3862  //    cout << "PamLevel2::GetEntry("<<iee<<") "<<irun<<" "<<runfirstentry<<" "<<irunentry<<endl;  //    cout << "PamLevel2::GetEntry("<<iee<<") "<<irun<<" "<<runfirstentry<<" "<<irunentry<<endl;
# Line 3892  TTree* PamLevel2::GetYodaTree( ){ Line 3985  TTree* PamLevel2::GetYodaTree( ){
3985  //     }  //     }
3986    
3987      if ( TRK0 ){      if ( TRK0 ){
3988          TrkParams::Load(6);  //      TrkParams::Load(6);
3989          if( !TrkParams::IsLoaded(6) ){  //      if( !TrkParams::IsLoaded(6) ){
3990              cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- VK-mask not loaded"<<endl;  //          cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- VK-mask not loaded"<<endl;
3991          };  //      };
3992          if(!dbc || (dbc && !dbc->IsConnected()))SetDBConnection();  //      if(!dbc || (dbc && !dbc->IsConnected()))SetDBConnection();
3993          TrkParams::SetCalib(run_obj,dbc);          TrkParams::SetCalib(run_obj,dbc);
3994          TrkParams::LoadCalib( );          TrkParams::LoadCalib( );
3995          if( !TrkParams::CalibIsLoaded() ){          if( !TrkParams::CalibIsLoaded() ){
3996              cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- Calibration not loaded"<<endl;              cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- Calibration not loaded"<<endl;
3997          };          };
3998          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
3999      }      }
4000    
4001    
# Line 3971  Int_t PamLevel2::GetYodaEntry(){ Line 4064  Int_t PamLevel2::GetYodaEntry(){
4064      do{      do{
4065          if(shift>0){              if(shift>0){    
4066              cout << " PKTNUM  L2 --- "<< pktn << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl;              cout << " PKTNUM  L2 --- "<< pktn << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl;
4067              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;
4068              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;
4069          }          }
4070          answer = l0_tree->GetEntry(quellagiusta+(Long64_t)shift+(Long64_t)prevshift);          answer = l0_tree->GetEntry(quellagiusta+(Long64_t)shift+(Long64_t)prevshift);
4071          shift++;          shift++;
# Line 4005  Int_t PamLevel2::GetYodaEntry(){ Line 4098  Int_t PamLevel2::GetYodaEntry(){
4098              && (quellagiusta+(Long64_t)shift) < GetYodaTree()->GetEntries() && shift < maxshift);              && (quellagiusta+(Long64_t)shift) < GetYodaTree()->GetEntries() && shift < maxshift);
4099    
4100      if ( (quellagiusta+(Long64_t)shift+(Long64_t)prevshift) > GetYodaTree()->GetEntries() || shift == maxshift ) {      if ( (quellagiusta+(Long64_t)shift+(Long64_t)prevshift) > GetYodaTree()->GetEntries() || shift == maxshift ) {
4101          cout << " Big trouble here, no such event in Level0 data! " <<endl;          cout << " Big trouble here, no such event in Level0 data! (NB maxshift set to "<<maxshift<<" )" <<endl;
4102          return 0;          return 0;
4103      }      }
4104  //    cout << "LA ENTRY GIUSTA E`: "<<quellagiusta<<" (spero...)"<<endl;  //    cout << "LA ENTRY GIUSTA E`: "<<quellagiusta<<" (spero...)"<<endl;
# Line 4020  Int_t PamLevel2::GetYodaEntry(){ Line 4113  Int_t PamLevel2::GetYodaEntry(){
4113   */   */
4114  Bool_t PamLevel2::SetDBConnection(){  Bool_t PamLevel2::SetDBConnection(){
4115    
4116    //    cout << "PamLevel2::SetDBConnection()" << endl;
4117      if(DBG){      if(DBG){
4118          cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;          cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
4119          cout<<"Connecting to DB"<<endl;          cout<<"Connecting to DB"<<endl;

Legend:
Removed from v.1.61  
changed lines
  Added in v.1.72

  ViewVC Help
Powered by ViewVC 1.1.23