323 |
Long64_t deltapkt = 5000LL; |
Long64_t deltapkt = 5000LL; |
324 |
Long64_t deltaobt = 50000LL; |
Long64_t deltaobt = 50000LL; |
325 |
// |
// |
326 |
// pcksList packetsNames; |
pcksList packetsNames; |
327 |
// pcksList::iterator Iter; |
pcksList::iterator Iter; |
328 |
// getPacketsNames(packetsNames); |
getPacketsNames(packetsNames); |
329 |
// |
// |
330 |
pktfirst = 0; |
pktfirst = 0; |
331 |
obtfirst = 0; |
obtfirst = 0; |
332 |
|
ppktfirst = 0; |
333 |
|
pobtfirst = 0; |
334 |
// |
// |
335 |
TTree *T = 0; |
TTree *T = 0; |
336 |
T = (TTree*)file->Get("Physics"); |
T = (TTree*)file->Get("Physics"); |
344 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
345 |
pktfirst = ph->GetCounter(); |
pktfirst = ph->GetCounter(); |
346 |
obtfirst = ph->GetOrbitalTime(); |
obtfirst = ph->GetOrbitalTime(); |
347 |
|
ppktfirst = pktfirst; |
348 |
|
pobtfirst = obtfirst; |
349 |
// |
// |
350 |
// code = eh->GetCounter(); |
code = eh->GetCounter(); |
351 |
// UInt_t en = 0; |
UInt_t en = 0; |
352 |
// for(Iter = packetsNames.begin(); Iter != packetsNames.end(); Iter++){ |
for(Iter = packetsNames.begin(); Iter != packetsNames.end(); Iter++){ |
353 |
// en = code->Get(GetPacketType(*Iter)); |
en = code->Get(GetPacketType(*Iter)); |
354 |
// if ( en ) printf(" Packet type is %s, entries: %i \n",*Iter,en); |
if ( !strcmp("CalibCalPed",*Iter) || !strcmp("CalibTrk1",*Iter) || !strcmp("CalibTrk2",*Iter) || !strcmp("CalibS4",*Iter) ){ |
355 |
//}; |
if ( IsDebug() ) printf(" We have a calibration before the first physic packet: packet type is %s, entries: %i \n",*Iter,en); |
356 |
|
// |
357 |
|
TTree *TC = 0; |
358 |
|
TC = (TTree*)file->Get("CalibCalPed"); |
359 |
|
if ( !TC || TC->IsZombie() ) throw -16; |
360 |
|
EventHeader *ehc = 0; |
361 |
|
PscuHeader *phc = 0; |
362 |
|
TC->SetBranchAddress("Header", &ehc); |
363 |
|
TC->GetEntry(0); |
364 |
|
phc = ehc->GetPscuHeader(); |
365 |
|
pktfirst = phc->GetCounter(); |
366 |
|
obtfirst = phc->GetOrbitalTime(); |
367 |
|
// |
368 |
|
}; |
369 |
|
}; |
370 |
// |
// |
371 |
T->GetEntry(nevent-1); |
T->GetEntry(nevent-1); |
372 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
470 |
// |
// |
471 |
if ( rhev || rtev ){ |
if ( rhev || rtev ){ |
472 |
|
|
473 |
|
T->GetEntry(upperentry); |
474 |
T->GetEntry(upperentry); |
code = eh->GetCounter(); |
475 |
code = eh->GetCounter(); |
Int_t lasttrail = code->Get(pctp->RunTrailer); |
476 |
Int_t lasttrail = code->Get(pctp->RunTrailer); |
Int_t lasthead = code->Get(pctp->RunHeader); |
477 |
Int_t lasthead = code->Get(pctp->RunHeader); |
if ( lasttrail < rtev ){ |
478 |
if ( lasttrail < rtev ){ |
rt->GetEntry(lasttrail); |
479 |
rt->GetEntry(lasttrail); |
pht = eht->GetPscuHeader(); |
480 |
pht = eht->GetPscuHeader(); |
pktt = PKT(pht->GetCounter()); |
481 |
pktt = PKT(pht->GetCounter()); |
obtt = OBT(pht->GetOrbitalTime()); |
482 |
obtt = OBT(pht->GetOrbitalTime()); |
}; |
483 |
}; |
// |
484 |
// |
if ( lasthead < rhev ){ |
485 |
if ( lasthead < rhev ){ |
rh->GetEntry(lasthead); |
486 |
rh->GetEntry(lasthead); |
phh = ehh->GetPscuHeader(); |
487 |
phh = ehh->GetPscuHeader(); |
pkth = PKT(phh->GetCounter()); |
488 |
pkth = PKT(phh->GetCounter()); |
obth = OBT(phh->GetOrbitalTime()); |
489 |
obth = OBT(phh->GetOrbitalTime()); |
}; |
490 |
}; |
// |
491 |
// |
if ( IsDebug() ) printf(" rhev before %i ph %lld upperp %lld oh %lld uppero %lld \n",rhev,pkth,upperpkt,obth,upperobt); |
492 |
if ( IsDebug() ) printf(" rhev before %i ph %lld upperp %lld oh %lld uppero %lld \n",rhev,pkth,upperpkt,obth,upperobt); |
if ( pkth > upperpkt && obth > upperobt ){ |
493 |
if ( pkth > upperpkt && obth > upperobt ){ |
if ( IsDebug() ) printf(" Upper limits extended to include last header: ph %lld upperp %lld oh %lld uppero %lld \n",pkth,upperpkt,obth,upperobt); |
494 |
if ( IsDebug() ) printf(" Upper limits extended to include last header: ph %lld upperp %lld oh %lld uppero %lld \n",pkth,upperpkt,obth,upperobt); |
upperpkt = pkth; |
495 |
upperpkt = pkth; |
upperobt = obth; |
496 |
upperobt = obth; |
rhev = lasthead+1; |
497 |
rhev = lasthead+1; |
} else { |
498 |
} else { |
rhev = lasthead; |
499 |
rhev = lasthead; |
}; |
500 |
}; |
if ( IsDebug() ) printf(" rhev after %i ph %lld upperp %lld oh %lld uppero %lld \n",rhev,pkth,upperpkt,obth,upperobt); |
501 |
if ( IsDebug() ) printf(" rhev after %i ph %lld upperp %lld oh %lld uppero %lld \n",rhev,pkth,upperpkt,obth,upperobt); |
// |
502 |
// |
if ( IsDebug() ) printf(" rtev beforev %i pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt); |
503 |
if ( IsDebug() ) printf(" rtev beforev %i pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt); |
if ( pktt > upperpkt && obtt > upperobt ){ |
504 |
if ( pktt > upperpkt && obtt > upperobt ){ |
if ( IsDebug() ) printf(" Upper limits extended to include last trailer: pt %lld upperp %lld ot %lld uppero %lld \n",pktt,upperpkt,obtt,upperobt); |
505 |
if ( IsDebug() ) printf(" Upper limits extended to include last trailer: pt %lld upperp %lld ot %lld uppero %lld \n",pktt,upperpkt,obtt,upperobt); |
upperpkt = pktt; |
506 |
upperpkt = pktt; |
upperobt = obtt; |
507 |
upperobt = obtt; |
rtev = lasttrail+1; |
508 |
rtev = lasttrail+1; |
} else { |
509 |
} else { |
rtev = lasttrail; |
510 |
rtev = lasttrail; |
}; |
511 |
}; |
if ( IsDebug() ) printf(" rtev after %i pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt); |
512 |
if ( IsDebug() ) printf(" rtev after %i pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt); |
// goto kikko; |
513 |
// goto kikko; |
// |
514 |
// |
// |
515 |
// |
// Check if runtrailer/runheader are within lower limits |
516 |
// Check if runtrailer/runheader are within lower limits |
// |
517 |
// |
// |
518 |
// |
pkth = 0LL; |
519 |
pkth = 0LL; |
obth = 0LL; |
520 |
obth = 0LL; |
spkth = 0LL; |
521 |
spkth = 0LL; |
sobth = 0LL; |
522 |
sobth = 0LL; |
for (Int_t k=0; k<rhev; k++){ |
523 |
for (Int_t k=0; k<rhev; k++){ |
if ( k > 0 ){ |
524 |
if ( k > 0 ){ |
spkth = pkth; |
525 |
spkth = pkth; |
sobth = obth; |
526 |
sobth = obth; |
}; |
527 |
}; |
rh->GetEntry(k); |
528 |
rh->GetEntry(k); |
phh = ehh->GetPscuHeader(); |
529 |
phh = ehh->GetPscuHeader(); |
pkth = PKT(phh->GetCounter()); |
530 |
pkth = PKT(phh->GetCounter()); |
obth = OBT(phh->GetOrbitalTime()); |
531 |
obth = OBT(phh->GetOrbitalTime()); |
// |
532 |
// |
// if ( IsDebug() ) printf(" k %i rhev before %i ph %u upperp %u oh %u uppero %u \n",k,rhev,pkth,spkth,obth,sobth); |
533 |
// if ( IsDebug() ) printf(" k %i rhev before %i ph %u upperp %u oh %u uppero %u \n",k,rhev,pkth,spkth,obth,sobth); |
// |
534 |
// |
if ( pkth < spkth && obth < sobth ){ |
535 |
if ( pkth < spkth && obth < sobth ){ |
if ( IsDebug() ) printf(" RH PROBLEMS determining the event repetition at the end of the file lasthead %i \n",rhev); |
536 |
if ( IsDebug() ) printf(" RH PROBLEMS determining the event repetition at the end of the file lasthead %i \n",rhev); |
// |
537 |
// |
rhev = k-1; |
538 |
rhev = k-1; |
rh->GetEntry(rhev); |
539 |
rh->GetEntry(rhev); |
pkth = spkth; |
540 |
pkth = spkth; |
obth = sobth; |
541 |
obth = sobth; |
// |
542 |
// |
UInt_t evbefh = 0; |
543 |
UInt_t evbefh = 0; |
code = ehh->GetCounter(); |
544 |
code = ehh->GetCounter(); |
evbefh = code->Get(pctp->Physics); |
545 |
evbefh = code->Get(pctp->Physics); |
if ( evbefh >= 0 ){ |
546 |
if ( evbefh >= 0 ){ |
T->GetEntry(evbefh); |
|
T->GetEntry(evbefh); |
|
|
ph = eh->GetPscuHeader(); |
|
|
t_pktlast = PKT(ph->GetCounter()); |
|
|
t_obtlast = OBT(ph->GetOrbitalTime()); |
|
|
if ( t_pktlast <= spkth && t_obtlast <= sobth ){ // jump |
|
|
upperpkt = pkth; |
|
|
upperobt = obth; |
|
|
upperentry = evbefh-1; |
|
|
} else { |
|
|
while ( t_pktlast > spkth && t_obtlast > sobth && evbefh < nevent ){ |
|
|
evbefh++; |
|
|
T->GetEntry(evbefh); |
|
|
ph = eh->GetPscuHeader(); |
|
|
t_pktlast = PKT(ph->GetCounter()); |
|
|
t_obtlast = OBT(ph->GetOrbitalTime()); |
|
|
}; |
|
|
T->GetEntry(evbefh-1); |
|
547 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
548 |
upperpkt = PKT(ph->GetCounter()); |
t_pktlast = PKT(ph->GetCounter()); |
549 |
upperobt = OBT(ph->GetOrbitalTime()); |
t_obtlast = OBT(ph->GetOrbitalTime()); |
550 |
upperentry = evbefh-1; |
if ( t_pktlast <= spkth && t_obtlast <= sobth ){ // jump |
551 |
}; |
upperpkt = pkth; |
552 |
|
upperobt = obth; |
553 |
|
upperentry = evbefh-1; |
554 |
|
} else { |
555 |
|
while ( t_pktlast > spkth && t_obtlast > sobth && evbefh < nevent ){ |
556 |
|
evbefh++; |
557 |
|
T->GetEntry(evbefh); |
558 |
|
ph = eh->GetPscuHeader(); |
559 |
|
t_pktlast = PKT(ph->GetCounter()); |
560 |
|
t_obtlast = OBT(ph->GetOrbitalTime()); |
561 |
|
}; |
562 |
|
T->GetEntry(evbefh-1); |
563 |
|
ph = eh->GetPscuHeader(); |
564 |
|
upperpkt = PKT(ph->GetCounter()); |
565 |
|
upperobt = OBT(ph->GetOrbitalTime()); |
566 |
|
upperentry = evbefh-1; |
567 |
|
}; |
568 |
|
}; |
569 |
|
if ( IsDebug() ) printf(" rhev after %i ph %lld upperp %lld oh %lld uppero %lld \n",rhev,pkth,upperpkt,obth,upperobt); |
570 |
|
goto kikko0; |
571 |
}; |
}; |
|
if ( IsDebug() ) printf(" rhev after %i ph %lld upperp %lld oh %lld uppero %lld \n",rhev,pkth,upperpkt,obth,upperobt); |
|
|
goto kikko0; |
|
|
}; |
|
|
}; |
|
|
kikko0: |
|
|
// |
|
|
// |
|
|
// |
|
|
pktt = 0LL; |
|
|
obtt = 0LL; |
|
|
spktt = 0LL; |
|
|
sobtt = 0LL; |
|
|
for (Int_t k=0; k<rtev; k++){ |
|
|
if ( k > 0 ){ |
|
|
spktt = pktt; |
|
|
sobtt = obtt; |
|
572 |
}; |
}; |
573 |
rt->GetEntry(k); |
kikko0: |
574 |
pht = eht->GetPscuHeader(); |
// |
|
pktt = PKT(pht->GetCounter()); |
|
|
obtt = OBT(pht->GetOrbitalTime()); |
|
575 |
// |
// |
|
// if ( IsDebug() ) printf(" k %i rtev beforev %i pt %i upperp %i ot %llu uppero %llu \n",k,rtev,pktt,spktt,obtt,sobtt); |
|
576 |
// |
// |
577 |
if ( pktt < spktt && obtt < sobtt ){ |
pktt = 0LL; |
578 |
if ( IsDebug() ) printf(" RT PROBLEMS determining the event repetition at the end of the file lasttrail %i \n",rtev); |
obtt = 0LL; |
579 |
|
spktt = 0LL; |
580 |
|
sobtt = 0LL; |
581 |
|
for (Int_t k=0; k<rtev; k++){ |
582 |
|
if ( k > 0 ){ |
583 |
|
spktt = pktt; |
584 |
|
sobtt = obtt; |
585 |
|
}; |
586 |
|
rt->GetEntry(k); |
587 |
|
pht = eht->GetPscuHeader(); |
588 |
|
pktt = PKT(pht->GetCounter()); |
589 |
|
obtt = OBT(pht->GetOrbitalTime()); |
590 |
// |
// |
591 |
rtev = k-1; |
// if ( IsDebug() ) printf(" k %i rtev beforev %i pt %i upperp %i ot %llu uppero %llu \n",k,rtev,pktt,spktt,obtt,sobtt); |
|
rt->GetEntry(rtev); |
|
|
pktt = spktt; |
|
|
obtt = sobtt; |
|
|
if ( IsDebug() ) printf(" lasttrail %i pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt); |
|
592 |
// |
// |
593 |
UInt_t evbeft = 0; |
if ( pktt < spktt && obtt < sobtt ){ |
594 |
code = eht->GetCounter(); |
if ( IsDebug() ) printf(" RT PROBLEMS determining the event repetition at the end of the file lasttrail %i \n",rtev); |
595 |
evbeft = code->Get(pctp->Physics); |
// |
596 |
if ( evbeft >= 0 ){ |
rtev = k-1; |
597 |
T->GetEntry(evbeft); |
rt->GetEntry(rtev); |
598 |
ph = eh->GetPscuHeader(); |
pktt = spktt; |
599 |
t_pktlast = PKT(ph->GetCounter()); |
obtt = sobtt; |
600 |
t_obtlast = OBT(ph->GetOrbitalTime()); |
if ( IsDebug() ) printf(" lasttrail %i pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt); |
601 |
if ( t_pktlast <= spktt && t_obtlast <= sobtt ){ // jump |
// |
602 |
upperpkt = pktt; |
UInt_t evbeft = 0; |
603 |
upperobt = obtt; |
code = eht->GetCounter(); |
604 |
upperentry = evbeft-1; |
evbeft = code->Get(pctp->Physics); |
605 |
} else { |
if ( evbeft >= 0 ){ |
606 |
while ( t_pktlast > spktt && t_obtlast > sobtt && evbeft < nevent ){ |
T->GetEntry(evbeft); |
607 |
evbeft++; |
ph = eh->GetPscuHeader(); |
608 |
T->GetEntry(evbeft); |
t_pktlast = PKT(ph->GetCounter()); |
609 |
|
t_obtlast = OBT(ph->GetOrbitalTime()); |
610 |
|
if ( t_pktlast <= spktt && t_obtlast <= sobtt ){ // jump |
611 |
|
upperpkt = pktt; |
612 |
|
upperobt = obtt; |
613 |
|
upperentry = evbeft-1; |
614 |
|
} else { |
615 |
|
while ( t_pktlast > spktt && t_obtlast > sobtt && evbeft < nevent ){ |
616 |
|
evbeft++; |
617 |
|
T->GetEntry(evbeft); |
618 |
|
ph = eh->GetPscuHeader(); |
619 |
|
t_pktlast = PKT(ph->GetCounter()); |
620 |
|
t_obtlast = OBT(ph->GetOrbitalTime()); |
621 |
|
}; |
622 |
|
T->GetEntry(evbeft-1); |
623 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
624 |
t_pktlast = PKT(ph->GetCounter()); |
upperpkt = PKT(ph->GetCounter()); |
625 |
t_obtlast = OBT(ph->GetOrbitalTime()); |
upperobt = OBT(ph->GetOrbitalTime()); |
626 |
|
upperentry = evbeft-1; |
627 |
}; |
}; |
|
T->GetEntry(evbeft-1); |
|
|
ph = eh->GetPscuHeader(); |
|
|
upperpkt = PKT(ph->GetCounter()); |
|
|
upperobt = OBT(ph->GetOrbitalTime()); |
|
|
upperentry = evbeft-1; |
|
628 |
}; |
}; |
629 |
|
if ( IsDebug() ) printf(" rtev after %i pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt); |
630 |
|
goto kikko; |
631 |
|
// break; |
632 |
|
// |
633 |
}; |
}; |
634 |
if ( IsDebug() ) printf(" rtev after %i pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt); |
// |
|
goto kikko; |
|
|
// break; |
|
|
// |
|
635 |
}; |
}; |
636 |
// |
// |
637 |
}; |
kikko: |
638 |
// |
// |
639 |
kikko: |
T->GetEntry(upperentry); |
640 |
// |
code = eh->GetCounter(); |
641 |
T->GetEntry(upperentry); |
lasttrail = code->Get(pctp->RunTrailer); |
642 |
code = eh->GetCounter(); |
lasthead = code->Get(pctp->RunHeader); |
643 |
lasttrail = code->Get(pctp->RunTrailer); |
if ( lasttrail < rtev ){ |
644 |
lasthead = code->Get(pctp->RunHeader); |
rt->GetEntry(lasttrail); |
645 |
if ( lasttrail < rtev ){ |
pht = eht->GetPscuHeader(); |
646 |
rt->GetEntry(lasttrail); |
pktt = PKT(pht->GetCounter()); |
647 |
pht = eht->GetPscuHeader(); |
obtt = OBT(pht->GetOrbitalTime()); |
648 |
pktt = PKT(pht->GetCounter()); |
}; |
649 |
obtt = OBT(pht->GetOrbitalTime()); |
// |
650 |
}; |
if ( lasthead < rhev ){ |
651 |
// |
rh->GetEntry(lasthead); |
652 |
if ( lasthead < rhev ){ |
phh = ehh->GetPscuHeader(); |
653 |
rh->GetEntry(lasthead); |
pkth = PKT(phh->GetCounter()); |
654 |
phh = ehh->GetPscuHeader(); |
obth = OBT(phh->GetOrbitalTime()); |
655 |
pkth = PKT(phh->GetCounter()); |
}; |
656 |
obth = OBT(phh->GetOrbitalTime()); |
// |
657 |
}; |
if ( IsDebug() ) printf(" rhev before %i ph %lld upperp %lld oh %lld uppero %lld \n",rhev,pkth,upperpkt,obth,upperobt); |
658 |
// |
if ( pkth > upperpkt && obth > upperobt ){ |
659 |
if ( IsDebug() ) printf(" rhev before %i ph %lld upperp %lld oh %lld uppero %lld \n",rhev,pkth,upperpkt,obth,upperobt); |
if ( IsDebug() ) printf(" Upper limits extended to include last header: ph %lld upperp %lld oh %lld uppero %lld \n",pkth,upperpkt,obth,upperobt); |
660 |
if ( pkth > upperpkt && obth > upperobt ){ |
upperpkt = pkth; |
661 |
if ( IsDebug() ) printf(" Upper limits extended to include last header: ph %lld upperp %lld oh %lld uppero %lld \n",pkth,upperpkt,obth,upperobt); |
upperobt = obth; |
662 |
upperpkt = pkth; |
rhev = lasthead+1; |
663 |
upperobt = obth; |
} else { |
664 |
rhev = lasthead+1; |
rhev = lasthead; |
665 |
} else { |
}; |
666 |
rhev = lasthead; |
if ( IsDebug() ) printf(" rhev after %i ph %lld upperp %lld oh %lld uppero %lld \n",rhev,pkth,upperpkt,obth,upperobt); |
667 |
}; |
// |
668 |
if ( IsDebug() ) printf(" rhev after %i ph %lld upperp %lld oh %lld uppero %lld \n",rhev,pkth,upperpkt,obth,upperobt); |
if ( IsDebug() ) printf(" rtev beforev %i pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt); |
669 |
// |
if ( pktt > upperpkt && obtt > upperobt ){ |
670 |
if ( IsDebug() ) printf(" rtev beforev %i pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt); |
if ( IsDebug() ) printf(" Upper limits extended to include last trailer: pt %lld upperp %lld ot %lld uppero %lld \n",pktt,upperpkt,obtt,upperobt); |
671 |
if ( pktt > upperpkt && obtt > upperobt ){ |
upperpkt = pktt; |
672 |
if ( IsDebug() ) printf(" Upper limits extended to include last trailer: pt %lld upperp %lld ot %lld uppero %lld \n",pktt,upperpkt,obtt,upperobt); |
upperobt = obtt; |
673 |
upperpkt = pktt; |
rtev = lasttrail+1; |
674 |
upperobt = obtt; |
} else { |
675 |
rtev = lasttrail+1; |
rtev = lasttrail; |
676 |
} else { |
}; |
677 |
rtev = lasttrail; |
if ( IsDebug() ) printf(" rtev after %i pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt); |
678 |
}; |
// |
|
if ( IsDebug() ) printf(" rtev after %i pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt); |
|
|
// |
|
|
|
|
|
|
|
679 |
}; |
}; |
680 |
// |
// |
681 |
if ( IsDebug() ) printf(" Upper limits are: OBT %lld pkt_num %lld upper entry %i \n",upperobt,upperpkt,upperentry); |
if ( IsDebug() ) printf(" Upper limits are: OBT %lld pkt_num %lld upper entry %i \n",upperobt,upperpkt,upperentry); |
837 |
*/ |
*/ |
838 |
Long64_t PamelaDBOperations::PKT(UInt_t pkt_num){ |
Long64_t PamelaDBOperations::PKT(UInt_t pkt_num){ |
839 |
// |
// |
840 |
if ( IsDebug() ) printf(" pkt conversion: pkt_num is %u pktfirst is %u (UInt_t)(16777214/2)) is %u \n",pkt_num,pktfirst,(UInt_t)(16777214/2)); |
if ( IsDebug() ) printf(" pkt conversion: pkt_num is %u pktfirst is %u (UInt_t)(16777214/2)) is %u \n",pkt_num,ppktfirst,(UInt_t)(16777214/2)); |
841 |
// |
// |
842 |
if ( pkt_num < (pktfirst/2) && pktfirst > (16777214/2) ){ |
if ( pkt_num < (ppktfirst/2) && ppktfirst > (16777214/2) ){ |
843 |
if ( IsDebug() ) printf(" rise up pktnum %lld \n",(Long64_t)pkt_num+16777215LL); |
if ( IsDebug() ) printf(" rise up pktnum %lld \n",(Long64_t)pkt_num+16777215LL); |
844 |
return((Long64_t)pkt_num+16777215LL); |
return((Long64_t)pkt_num+16777215LL); |
845 |
}; |
}; |
846 |
// |
// |
847 |
if ( pkt_num > pktfirst*2 && pkt_num > (16777214/2) ){ |
if ( pkt_num > ppktfirst*2 && pkt_num > (16777214/2) ){ |
848 |
if ( IsDebug() ) printf(" rise down pktnum %lld \n",(Long64_t)pkt_num-16777215LL); |
if ( IsDebug() ) printf(" rise down pktnum %lld \n",(Long64_t)pkt_num-16777215LL); |
849 |
return((Long64_t)pkt_num-16777215LL); |
return((Long64_t)pkt_num-16777215LL); |
850 |
}; |
}; |
859 |
*/ |
*/ |
860 |
Long64_t PamelaDBOperations::OBT(UInt_t obt){ |
Long64_t PamelaDBOperations::OBT(UInt_t obt){ |
861 |
// |
// |
862 |
if ( obt < (obtfirst/2) && obtfirst > (numeric_limits<UInt_t>::max()/2) ) return((Long64_t)(obt+numeric_limits<UInt_t>::max())); |
if ( obt < (pobtfirst/2) && pobtfirst > (numeric_limits<UInt_t>::max()/2) ) return((Long64_t)(obt+numeric_limits<UInt_t>::max())); |
863 |
// |
// |
864 |
if ( obt > (obtfirst*2) && obt > (numeric_limits<UInt_t>::max()/2) ){ |
if ( obt > (pobtfirst*2) && obt > (numeric_limits<UInt_t>::max()/2) ){ |
865 |
return((Long64_t)obt-(Long64_t)numeric_limits<UInt_t>::max()); |
return((Long64_t)obt-(Long64_t)numeric_limits<UInt_t>::max()); |
866 |
}; |
}; |
867 |
// |
// |
2923 |
// |
// |
2924 |
} else { |
} else { |
2925 |
// |
// |
2926 |
if ( IsDebug() ) printf(" Repetead calo calibration for section %i at time %i obt %i pkt %i \n",section,fromtime,obt,pkt); |
if ( IsDebug() ) printf(" Repeated calo calibration for section %i at time %i obt %i pkt %i \n",section,fromtime,obt,pkt); |
2927 |
// |
// |
2928 |
}; |
}; |
2929 |
// |
// |