--- PamelaLevel2/src/PamLevel2.cpp 2007/03/28 15:29:14 1.37 +++ PamelaLevel2/src/PamLevel2.cpp 2007/09/12 09:25:22 1.46 @@ -11,6 +11,8 @@ calo_track = 0; tof_track = 0; candeleteobj = 0; + pscore = 0; + iscore = 0; }; //-------------------------------------- // @@ -60,6 +62,9 @@ calo_track = 0; tof_track = 0; } + pscore = 0; + iscore = 0; + } void PamTrack::Delete(){ // cout << "PamTrack::Delete() "<Clear(); // if(trk0_obj) trk0_obj->Clear(); - if(calo0_obj) calo0_obj->Clear(); if(trk1_obj) trk1_obj->Clear(); if(trk2_obj) trk2_obj->Clear(); if(trkh_obj) trkh_obj->Clear(); + if(calo0_obj) calo0_obj->Clear(); if(calo1_obj)calo1_obj->Clear(); if(calo2_obj)calo2_obj->Clear(); if(tof_obj) tof_obj->Clear(); @@ -401,8 +399,23 @@ runfirstentry = 0ULL; runlastentry = 0ULL; // + totdltime[0] = 0LL; + totdltime[1] = 0LL; + // }; +Bool_t PamLevel2::IsGood(){ + Bool_t goodev=true; + // if(trk2_obj && trk2_obj->UnpackError() != 0 ) goodev = false; + if(calo2_obj && calo2_obj->good != 1) goodev = false; + if(tof_obj && tof_obj->unpackError != 0) goodev = false; + if(trig_obj && trig_obj->unpackError != 0) goodev = false; + if(s4_obj && s4_obj->unpackError != 0) goodev = false; + if(nd_obj && nd_obj->unpackError != 0) goodev = false; + if(ac_obj && ac_obj->unpackError != 255) goodev = false; + // if(orb_obj) + return goodev; +}; //-------------------------------------- // @@ -623,7 +636,7 @@ void PamLevel2::SortTracks(){ TString how = howtosort; - // cout <<" PamLevel2::SortTracks(TString how) "<TrkLevel2::GetNTracks(); i++){ TrkTrack *ts = 0; @@ -668,15 +701,21 @@ ToFTrkVar *os = 0; // get tracker tracks - TrkTrack *tp = trk2_obj->TrkLevel2::GetTrack(i); //tracker + TrkTrack *tp = trk2_obj->TrkLevel2::GetTrack(i); //tracker CaloTrkVar *cp = GetCaloStoredTrack(tp->GetSeqNo()); ToFTrkVar *op = GetToFStoredTrack(tp->GetSeqNo()); - TrkTrack *ti = 0; //tracker (image) + TrkTrack *ti = 0; //tracker (image) CaloTrkVar *ci = 0; ToFTrkVar *oi = 0; // cout << "trk track n. "<HasImage()){ ti = trk2_obj->TrkLevel2::GetTrackImage(i); //tracker (image) @@ -686,46 +725,72 @@ // cout << "its image "<npcfit[1] > 5 && //no. of fit planes on Y view - calo2_obj->varcfit[1] < 1000. && //fit variance on Y view +// calo2_obj->npcfit[1] > 5 && //no. of fit planes on Y view +// calo2_obj->varcfit[1] < 1000. && //fit variance on Y view cp && ci && true){ - Float_t resy_p = cp->tbar[0][1] - calo2_obj->cbar[0][1]; if(resy_p < 0)resy_p= - resy_p; - Float_t resy_i = ci->tbar[0][1] - calo2_obj->cbar[0][1]; if(resy_i < 0)resy_i= - resy_i; +// Float_t resy_p = cp->tbar[0][1] - calo2_obj->cbar[0][1]; if(resy_p < 0)resy_p= - resy_p; +// Float_t resy_i = ci->tbar[0][1] - calo2_obj->cbar[0][1]; if(resy_i < 0)resy_i= - resy_i; - if(resy_p <= resy_i) tp_score++; - else ti_score++; +// if(resy_p <= resy_i) tp_score++; +// else ti_score++; + + if( cp->npresh > ci->npresh){ + tp_score++; + totp_score++; + }; + if( cp->npresh < ci->npresh){ + ti_score++; + toti_score++; + }; + // cout << "CALO "<npmtadc; ih++){ @@ -737,7 +802,7 @@ if ( pl == 2 || pl == 3 || pl == 4 || pl == 5 ) sen += (oi->dedx).At(ih); }; // - if ( sen >= sortthr ){ + if ( sen >= sortthr && false){ // temporary disabled NUCLEI special algorithm since the new one should work for every particle (to be checked!) //printf(" IS A NUCLEUS! en = %f \n",sen); // // is a nucleus use a different algorithm @@ -830,7 +895,7 @@ if( - use_TOF && + (use_TOF || use_S1 || use_S2 || use_S3) && (nphit_p+nphit_i) !=0 && true){ @@ -863,52 +928,105 @@ cout << "image: npmtadc "<< oi->npmtadc << endl; cout << "image: npmttdc "<< oi->npmttdc << endl;*/ - for (Int_t ih=0; ih < op->npmtadc; ih++){ - Int_t pl = tof_obj->GetPlaneIndex( (op->pmtadc).At(ih) ); - if(pl == 1 || pl == 2 || pl == 5)nphit_p++; +// for (Int_t ih=0; ih < op->npmtadc; ih++){ +// Int_t pl = tof_obj->GetPlaneIndex( (op->pmtadc).At(ih) ); +// if(pl == 1 || pl == 2 || pl == 5)nphit_p++; +// }; + +// for (Int_t ih=0; ih < oi->npmtadc; ih++){ +// Int_t pl = tof_obj->GetPlaneIndex( (oi->pmtadc).At(ih) ); +// if(pl == 1 || pl == 2 || pl == 5)nphit_i++; +// }; + // --- modified to count tdc signals (more efficient?) + // --- and to implement check on tdcflag + for (Int_t ih=0; ih < op->npmttdc; ih++){ + Int_t pl = tof_obj->GetPlaneIndex( (op->pmttdc).At(ih) ); +// if( (op->tdcflag).At(ih)==0 && (pl == 1 || pl == 2 || pl == 5) )nphit_p++; + if ( (use_S1 && ( pl == 0 || pl == 1 )) || (use_S2 && ( pl == 2 || pl == 3 )) || (use_S3 && ( pl == 4 || pl == 5 )) ){ + if( (op->tdcflag).At(ih)==0 )nphit_p++; + }; }; - for (Int_t ih=0; ih < oi->npmtadc; ih++){ - Int_t pl = tof_obj->GetPlaneIndex( (oi->pmtadc).At(ih) ); - if(pl == 1 || pl == 2 || pl == 5)nphit_i++; + for (Int_t ih=0; ih < oi->npmttdc; ih++){ + Int_t pl = tof_obj->GetPlaneIndex( (oi->pmttdc).At(ih) ); +// if( (oi->tdcflag).At(ih)==0 && (pl == 1 || pl == 2 || pl == 5) )nphit_i++; + if ( (use_S1 && ( pl == 0 || pl == 1 )) || (use_S2 && ( pl == 2 || pl == 3 )) || (use_S3 && ( pl == 4 || pl == 5 )) ){ + if( (oi->tdcflag).At(ih)==0 )nphit_i++; + }; }; if( - use_TOF && (nphit_p+nphit_i) !=0 && true){ - if( nphit_p >= nphit_i) tp_score++; - else ti_score++; + if ( nphit_p != nphit_i ){ + totp_score += nphit_p; + toti_score += nphit_i; + }; + if ( nphit_p > nphit_i) tp_score++; + else if( nphit_p < nphit_i) ti_score++; + else ;//niente }; }; // cout << "TOF "<chi2 > 0 && tp->chi2 < ti->chi2 ) tp_score++ ; - else if( ti->chi2 > 0 && ti->chi2 < tp->chi2 ) ti_score++ ; +// if( tp->chi2 > 0 && tp->chi2 < ti->chi2 ) tp_score++ ; +// else if( ti->chi2 > 0 && ti->chi2 < tp->chi2 ) ti_score++ ; + + // CHECK 1 : number of points along X + if ( tp->GetNX() >= ti->GetNX() ){ + tp_score++ ; + totp_score++ ; + }; + if ( tp->GetNX() <= ti->GetNX() ){ + ti_score++ ; + toti_score++ ; + }; + // CHECK 2 : number of points along Y + if ( tp->GetNY() >= ti->GetNY() ){ + tp_score++ ; + totp_score++ ; + }; + if ( tp->GetNY() <= ti->GetNY() ){ + ti_score++ ; + toti_score++ ; + }; + // CHECK 3 : chi**2 along X +// if( tp->GetChi2X() > 0 && (tp->GetChi2X() < ti->GetChi2X() || ti->GetChi2X() <=0) ) tp_score++ ; +// if( ti->GetChi2X() > 0 && (ti->GetChi2X() < tp->GetChi2X() || tp->GetChi2X() <=0) ) ti_score++ ; + // CHECK 4 : chi**2 along Y +// if( tp->GetChi2Y() > 0 && (tp->GetChi2Y() < ti->GetChi2Y() || ti->GetChi2Y() <=0) ) tp_score++ ; +// if( ti->GetChi2Y() > 0 && (ti->GetChi2Y() < tp->GetChi2Y() || tp->GetChi2Y() <=0) ) ti_score++ ; + // CHECK 5 : total chi**2 +// if( tp->chi2 > 0 && (tp->chi2 < ti->chi2 || ti->chi2 <=0) ) tp_score++ ; +// if( ti->chi2 > 0 && (ti->chi2 < tp->chi2 || tp->chi2 <=0) ) ti_score++ ; + // cout << "TRK "< ti_score) { - // ts = tp;//the track sorted by the tracker!! - // cs = cp; - // os = op; - // cout << "It's primary!" << endl; + }else if (tp_score < ti_score) { - // cout << "It's image!" << endl; ts = ti;//its image!! cs = ci; @@ -924,14 +1042,15 @@ }else { - // ts = tp; - // cs = cp; - // os = op; - cout << "Warning - track image ambiguity not solved" << endl; - // cout << ts->GetNtot() << " "<< ts->chi2 << " " << npcfit[1] << " "<< nphit_p << endl; + +// cout << "Warning - track image ambiguity not solved" << endl; + }; }else{ + totp_score = 1; + toti_score = 0; + // ts = tp; // cs = cp; // os = op; @@ -945,8 +1064,12 @@ // cout<<"o "<SetPScore(totp_score); + ((PamTrack*)(ttimage[i]))->SetIScore(toti_score); }; if( tsorted->GetEntries() != trk2_obj->GetNTracks() ){ @@ -1863,11 +1986,15 @@ // // the absolute time is necessary to relate the event with the run // - if( !GetOrbitalInfo() ){ + if( !GetOrbitalInfo() && !ISGP){ cout << "Bool_t PamLevel2::UpdateRunInfo(TChain *run, ULong64_t iev) -- ERROR -- missing OrbitalInfo "<absTime; + + // // the first time the routine is called, set run search from the beginning // @@ -1877,11 +2004,19 @@ runfirstentry = 0LL; runlastentry += (Long64_t)(this->GetRunInfo()->NEVENTS); if ( (Long64_t)(this->GetRunInfo()->NEVENTS) > 0LL ) runlastentry -= 1LL; + + if( ISGP && run->GetEntries()!=1 ){ + cout << "** WARNING ** simulated files are assumed to have 1 single run, not "<< run->GetEntries() << endl; + cout << "** WARNING ** run will not be updated"<GetEntries()-1LL && - !(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && - GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) + if(ISGP)abstime = GetRunInfo()->RUNHEADER_TIME; // BARBATRUCCO + // + if ( irun == run->GetEntries()-1LL && + !(abstime >= GetRunInfo()->RUNHEADER_TIME && + abstime <= GetRunInfo()->RUNTRAILER_TIME) ){ irun = -1LL; runfirstentry = 0LL; @@ -1892,7 +2027,7 @@ // bool fromfirst = true; // - while ( !(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) && irun < run->GetEntries()-1LL ){ + while ( !(abstime >= GetRunInfo()->RUNHEADER_TIME && abstime <= GetRunInfo()->RUNTRAILER_TIME) && irun < run->GetEntries()-1LL ){ // while ( iev > (runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS-1)) && irun < run->GetEntries() ){ irun++; run->GetEntry(irun); @@ -1902,12 +2037,12 @@ // cout << " ))))) UPDATE RUN INFO ((((( @iev "<ID<<" irun "<GetRunInfo()->NEVENTS,(ULong64_t)(runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS))); - // printf(" abstime %u trailertime %u \n",GetOrbitalInfo()->absTime,GetRunInfo()->RUNTRAILER_TIME); + // printf(" abstime %u trailertime %u \n",abstime,GetRunInfo()->RUNTRAILER_TIME); // printf(" IDRUN %u \n",GetRunInfo()->ID); // // prevshift = 0; // - if ( irun == (Long64_t)(run->GetEntries()-1LL) && fromfirst && !(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME)){ + if ( irun == (Long64_t)(run->GetEntries()-1LL) && fromfirst && !(abstime >= GetRunInfo()->RUNHEADER_TIME && abstime <= GetRunInfo()->RUNTRAILER_TIME)){ printf(" resetting irun (it should NOT happen!!!)\n"); fromfirst = false; irun = 0; @@ -1920,10 +2055,10 @@ }; // if ( - !(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && - GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) + !(abstime >= GetRunInfo()->RUNHEADER_TIME && + abstime <= GetRunInfo()->RUNTRAILER_TIME) ) { - printf(" Something very wrong here: cannot find RUN containing absolute time %u \n",GetOrbitalInfo()->absTime); + printf(" Something very wrong here: cannot find RUN containing absolute time %llu \n",abstime); return false; } // @@ -1975,9 +2110,29 @@ if(SELLI==0){ // --------------------------------------------------------------- + // increment dead and live-time counters + // --------------------------------------------------------------- + if( GetTrigLevel2() ){ + totdltime[0]+=GetTrigLevel2()->dltime[0]; + totdltime[1]+=GetTrigLevel2()->dltime[1]; + } + totdltime[2]++; + +// cout << setw(10)<absTime; + obt = GetOrbitalInfo()->OBT; + } + // --------------------------------------------------------------- // the absolute time is necessary to relate the event with the run // --------------------------------------------------------------- - if( !GetOrbitalInfo() ){ + if( !GetOrbitalInfo() && !ISGP ){ cout << "Bool_t PamLevel2::UpdateRunInfo(Long64_t iev) -- ERROR -- missing OrbitalInfo "<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"<RUNHEADER_TIME; // BARBATRUCCO + obt = GetRunInfo()->RUNHEADER_OBT; // BARBATRUCCO + } // bool fromfirst = true; // first loop over runs + +// 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; + // ------------------------------------------------------ // loop over runs to find the one that contains the event // ------------------------------------------------------ - while ( !(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && // check on absolute time (s) - GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) && - !(GetOrbitalInfo()->OBT >= GetRunInfo()->RUNHEADER_OBT && // additional check on OBT (ms) - GetOrbitalInfo()->OBT <= GetRunInfo()->RUNTRAILER_OBT) && - irun < run_tree->GetEntries() ){ + while ( + ( + ( + !(abstime >= GetRunInfo()->RUNHEADER_TIME && // check on absolute time (s) + abstime <= GetRunInfo()->RUNTRAILER_TIME) && + !(obt >= GetRunInfo()->RUNHEADER_OBT && // additional check on OBT (ms) + obt <= GetRunInfo()->RUNTRAILER_OBT) + ) + || GetRunInfo()->NEVENTS==0 + || !(irunentry < GetRunInfo()->NEVENTS-1-prevshift) + ) + && irun < run_tree->GetEntries() ){ + + + + + // ----------------------------------------- + // store dead and live-time of previous run + // ----------------------------------------- + if(fromfirst){ + if(oldrun==irun){ + /// decrement counters + if( GetTrigLevel2()){ + totdltime[0]-=GetTrigLevel2()->dltime[0];//live-time + totdltime[1]-=GetTrigLevel2()->dltime[1];//dead-time + } + totdltime[2]--; //event counter + cout << endl; + cout << "n.events : "<GetBranch("DeadLiveTime")->GetEntries() < run_tree->GetEntries()) + run_tree_clone->GetBranch("DeadLiveTime")->Fill(); + /// reset counters + if( GetTrigLevel2() ){ + totdltime[0]=GetTrigLevel2()->dltime[0];//live-time + totdltime[1]=0; //dead-time + } + totdltime[2]=1; //event counter + } + + irun++; // ------------------------------------ // if the end of run tree is reached... @@ -2024,13 +2244,20 @@ // save the index of the first entry of the run, relative to pam_tree, // and read a new run // ------------------------------------------------------------------- - if(irun>0)runfirstentry += (GetRunInfo()->NEVENTS); + if(irun>0)runfirstentry += (GetRunInfo()->NEVENTS)-prevshift; + irunentry = 0; + prevshift = 0; run_tree->GetEntry(irun); - if(GetRunInfo()->RUNHEADER_OBT>=GetRunInfo()->RUNTRAILER_OBT ){ + if(GetRunInfo()->RUNHEADER_OBT>GetRunInfo()->RUNTRAILER_OBT ){ cout << "Bool_t PamLevel2::UpdateRunInfo(Long64_t iev) -- WARNING -- irun "<=RUNTRAILER_OBT " <ID){ +// cout << "... where is the next fragment ??"< exit with FALSE @@ -2039,10 +2266,75 @@ // -------------------------------------- // ... otherwise + // -------------------------------------- + + + +// // ----------------------------------------- +// // store dead and live-time of previous run +// // ----------------------------------------- +// // -------------------------------------------------------------- +// // if the run is empty, fill the dead-live time branch with zeros +// // -------------------------------------------------------------- +// /// if some runs have been jumped, fill with zeros +// if(irun-oldrun>1){ +// ULong64_t temp[3]; +// temp[0]=totdltime[0]; +// temp[1]=totdltime[1]; +// temp[2]=totdltime[2]; +// for(int i=oldrun+1; iGetBranch("DeadLiveTime")->GetEntries() < run_tree->GetEntries()) +// run_tree_clone->GetBranch("DeadLiveTime")->Fill(); +// } +// totdltime[0]=temp[0]; +// totdltime[1]=temp[1]; +// totdltime[2]=temp[2]; +// } +// /// decrement counters +// if( GetTrigLevel2() ){ +// totdltime[0]-=GetTrigLevel2()->dltime[0];//live-time +// totdltime[1]-=GetTrigLevel2()->dltime[1];//dead-time +// } +// totdltime[2]--; //event counter +// /// add an entry +// if(irun>0 ){ +// cout << endl; +// cout << "n.events : "<GetBranch("DeadLiveTime")->GetEntries() < run_tree->GetEntries()) +// run_tree_clone->GetBranch("DeadLiveTime")->Fill(); +// } +// /// reset counters +// if( GetTrigLevel2() ){ +// totdltime[0]=GetTrigLevel2()->dltime[0];//live-time +// totdltime[1]=0; //dead-time +// } +// totdltime[2]=1; //event counter + + + // -------------------------------------- // ---> exit with TRUE // -------------------------------------- cout << endl << " ))))) UPDATE RUN INFO ((((( @iev "<ID<<" irun "<ID_RUN_FRAG != 0 && +// GetRunInfo()->ID_RUN_FRAG != GetRunInfo()->ID && + true ){ + cout << "* fragment *"<cd(); cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <Branch("DeadLiveTime",totdltime,"dltime[3]/l"); + cout << "Run : branch DeadLiveTime"<Branch("RunEntry",&irun,"runentry/L"); @@ -2840,7 +3146,9 @@ void PamLevel2::WriteCloneTrees(){ cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <GetName()<GetName()<GetBranch("DeadLiveTime")->GetEntries() < run_tree->GetEntries()) + run_tree_clone->GetBranch("DeadLiveTime")->Fill(); run_tree_clone->Write(); cout << sel_tree_clone->GetName()<Write(); @@ -2860,6 +3168,9 @@ //Int_t PamLevel2::GetEntry(Int_t iee){ Int_t PamLevel2::GetEntry(Long64_t iee){ +// cout << "-------------------------------------"<NEVENTS<< endl; + +// if( TRK0 || CAL0 || TOF0 ){ +// if( !GetYodaEntry( ) ){ +// cout << " Int_t PamLevel2::GetEntry(Int_t) -- ERROR -- error reading level0 tree"<ID_ROOT_L0; -// cout << "iroot "<SetBranchAddress("Tracker" ,trk0_obj->GetPointerToTrackerEvent()); } - //--------------------------------------------------- + //-------------------------------------------------- // CALORIMETER: if(CAL0){ if(!calo0_obj){ @@ -3057,14 +3390,21 @@ // cout << " irun "<< irun << " irunentry "<< irunentry<<" run_obj->EV_FROM "<EV_FROM <<" quella giusta "<ID_ROOT_L0 "<ID_ROOT_L0<absTime << endl; +// cout << " time "<< abstime << endl; // cout << " trk_calib_used "<TRK_CALIB_USED<< endl; - if( !GetOrbitalInfo() ){ + ULong64_t obt = 0; + ULong64_t pktn = 0; + if( GetOrbitalInfo() ){ + obt = GetOrbitalInfo()->OBT; + pktn = GetOrbitalInfo()->pkt_num; + } + + if( !GetOrbitalInfo() && !ISGP){ cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- missing OrbitalInfo "<OBT==0 && GetOrbitalInfo()->pkt_num==0 ){ + if( obt==0 && pktn==0 && !ISGP ){ cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- level2 event corrupted ?? "<0){ - cout << " PKTNUM L2 --- "<< GetOrbitalInfo()->pkt_num << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<GetPscuHeader()->GetCounter()<ID << " ID_ROOT_L0 "<ID_ROOT_L0<<" ID_RUN_FRAG "<ID_RUN_FRAG << " EV_FROM "<EV_FROM < L0 mismatch ( irun "<pkt_num << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<OBT << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetOrbitalTime()<GetPscuHeader()->GetOrbitalTime()); //BARBATRUCCO + pktn = (UInt_t)(GetEventHeader()->GetPscuHeader()->GetCounter()); //BARBATRUCCO + } + +// cout << "PKTNUM "<GetPscuHeader()->GetCounter()<GetPscuHeader()->GetOrbitalTime()<GetEntries()+1 )cout << ">>> end of level0 tree <<<"<OBT "<< GetOrbitalInfo()->OBT << endl; +// cout << " obt "<< obt << endl; // cout << " GetEventHeader()->GetPscuHeader()->GetOrbitalTime() "<< GetEventHeader()->GetPscuHeader()->GetOrbitalTime() << endl; -// cout << " GetOrbitalInfo()->pkt_num "<< GetOrbitalInfo()->pkt_num << endl; +// cout << " pktn "<< pktn << endl; // cout << " GetEventHeader()->GetPscuHeader()->GetCounter() "<< GetEventHeader()->GetPscuHeader()->GetCounter() << endl; // printf(" IDRUN %u \n",GetRunInfo()->ID); // @@ -3110,9 +3456,11 @@ shift = -1; }; - }while( ( GetOrbitalInfo()->OBT != (UInt_t)(GetEventHeader()->GetPscuHeader()->GetOrbitalTime()) || GetOrbitalInfo()->pkt_num != (UInt_t)(GetEventHeader()->GetPscuHeader()->GetCounter())) && (quellagiusta+(Long64_t)shift) < GetYodaTree()->GetEntries() && shift < maxshift); + }while( ( obt != (UInt_t)(GetEventHeader()->GetPscuHeader()->GetOrbitalTime()) || + pktn != (UInt_t)(GetEventHeader()->GetPscuHeader()->GetCounter()) ) + && (quellagiusta+(Long64_t)shift) < GetYodaTree()->GetEntries() && shift < maxshift); - if ( (quellagiusta+(Long64_t)shift) == GetYodaTree()->GetEntries() || shift == maxshift ) { + if ( (quellagiusta+(Long64_t)shift+(Long64_t)prevshift) > GetYodaTree()->GetEntries() || shift == maxshift ) { cout << " Big trouble here, no such event in Level0 data! " <IsConnected() )return false; + cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<GetListOfFiles() ); + Int_t nf = 0; + TChainElement* element = 0; + while ((element = (TChainElement*) next())) { + c->Add(element->GetTitle()); + nf++; + } + + GetPamTree()->AddFriend(cname.Data()); + + cout << "external chain created and added to pamela friends :"<