| 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 |
// |
// |
| 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; |
| 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; |