/[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.30 by mocchiut, Sun Mar 18 20:25:54 2007 UTC revision 1.31 by mocchiut, Mon Mar 19 05:39:36 2007 UTC
# Line 1548  Bool_t PamLevel2::UpdateRunInfo(TChain * Line 1548  Bool_t PamLevel2::UpdateRunInfo(TChain *
1548        }        }
1549        // modificato il controllo sull'aggiornamento del run, per evitare problemi        // modificato il controllo sull'aggiornamento del run, per evitare problemi
1550        // dovuti agli eventi annidati (NB! NEVENTS conta anche questi!!)        // dovuti agli eventi annidati (NB! NEVENTS conta anche questi!!)
1551        while ( GetOrbitalInfo()->absTime > GetRunInfo()->RUNTRAILER_TIME && irun < run->GetEntries() ){        //
1552          bool fromfirst = true;
1553          //
1554          while ( !(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) && irun < run->GetEntries() ){
1555  //      while ( iev > (runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS-1)) && irun < run->GetEntries() ){  //      while ( iev > (runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS-1)) && irun < run->GetEntries() ){
 //      printf(" iev %llu %u %llu \n",iev,this->GetRunInfo()->NEVENTS,(ULong64_t)(runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS)));  
1556            irun++;            irun++;
1557            run->GetEntry(irun);            run->GetEntry(irun);
1558            runfirstentry = runlastentry;            runfirstentry = runlastentry;
1559            if ( (ULong64_t)(this->GetRunInfo()->NEVENTS) > 0ULL ) runfirstentry += 1ULL;            if ( (ULong64_t)(this->GetRunInfo()->NEVENTS) > 0ULL ) runfirstentry += 1ULL;
1560            runlastentry += (ULong64_t)(this->GetRunInfo()->NEVENTS);            runlastentry += (ULong64_t)(this->GetRunInfo()->NEVENTS);
1561              //      printf(" iev %llu %u %llu \n",iev,this->GetRunInfo()->NEVENTS,(ULong64_t)(runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS)));
1562              //      printf(" abstime %u trailertime %u \n",GetOrbitalInfo()->absTime,GetRunInfo()->RUNTRAILER_TIME);
1563              //      printf(" IDRUN %u \n",GetRunInfo()->ID);
1564              //
1565              prevshift = 0;
1566              //
1567              if ( irun == run->GetEntries()-1 && fromfirst && !(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME)){
1568                //      printf(" resetting irun \n");
1569                fromfirst = false;
1570                irun = 0;
1571                run->GetEntry(irun);
1572                runfirstentry = 0ULL;
1573                runlastentry += (ULong64_t)(this->GetRunInfo()->NEVENTS);
1574                if ( (ULong64_t)(this->GetRunInfo()->NEVENTS) > 0ULL ) runlastentry -= 1ULL;
1575              };
1576              //
1577        };        };
1578                //
1579          if ( !fromfirst && !(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) ) printf(" Something very wrong here: cannot find RUN containing absolute time %u \n",GetOrbitalInfo()->absTime);
1580        //        //
1581        if ( irun == oldrun || irun >= run->GetEntries() ) return(false);        if ( irun == oldrun || irun >= run->GetEntries() ) return(false);
1582        //        //
# Line 2567  Int_t PamLevel2::GetYodaEntry(){ Line 2586  Int_t PamLevel2::GetYodaEntry(){
2586      // ---------------------------------------------------------------------      // ---------------------------------------------------------------------
2587      Int_t answer = 0;      Int_t answer = 0;
2588      Int_t shift =0;      Int_t shift =0;
2589        //    printf(" siamo qui %i %i \n",shift,prevshift);
2590      do{      do{
2591          if(shift>0){              if(shift>0){    
2592            cout << " level0 <--> level2 mismatch ( irun "<<irun<<" irunentry "<<irunentry<<" shift "<<shift<<" )"<<endl;            cout << " level0 <--> level2 mismatch ( irun "<<irun<<" irunentry "<<irunentry<<" shift "<<shift<<" )"<<endl;
# Line 2582  Int_t PamLevel2::GetYodaEntry(){ Line 2602  Int_t PamLevel2::GetYodaEntry(){
2602  //      cout << " GetEventHeader()->GetPscuHeader()->GetOrbitalTime() "<< GetEventHeader()->GetPscuHeader()->GetOrbitalTime() << endl;  //      cout << " GetEventHeader()->GetPscuHeader()->GetOrbitalTime() "<< GetEventHeader()->GetPscuHeader()->GetOrbitalTime() << endl;
2603  //      cout << " GetOrbitalInfo()->pkt_num "<< GetOrbitalInfo()->pkt_num << endl;  //      cout << " GetOrbitalInfo()->pkt_num "<< GetOrbitalInfo()->pkt_num << endl;
2604  //      cout << " GetEventHeader()->GetPscuHeader()->GetCounter() "<< GetEventHeader()->GetPscuHeader()->GetCounter() << endl;  //      cout << " GetEventHeader()->GetPscuHeader()->GetCounter() "<< GetEventHeader()->GetPscuHeader()->GetCounter() << endl;
2605    //      printf(" IDRUN %u \n",GetRunInfo()->ID);
2606    //
2607          if ( prevshift != 0 && (quellagiusta+shift) == GetYodaTree()->GetEntries() ){          if ( prevshift != 0 && (quellagiusta+shift) == GetYodaTree()->GetEntries() ){
2608            prevshift = 0;            prevshift = 0;
2609            shift = -1;            shift = -1;

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

  ViewVC Help
Powered by ViewVC 1.1.23