| 164 |
Int_t sgnl = 0; |
Int_t sgnl = 0; |
| 165 |
for ( Int_t s = 0; s < 4; s++){ |
for ( Int_t s = 0; s < 4; s++){ |
| 166 |
if ( atime > totime[s] ){ |
if ( atime > totime[s] ){ |
| 167 |
|
if ( !dbc->IsConnected() ) throw -116; |
| 168 |
sgnl = Update(dbc,atime,s); |
sgnl = Update(dbc,atime,s); |
| 169 |
if ( sgnl < 0 ) return(sgnl); |
if ( sgnl < 0 ) return(sgnl); |
| 170 |
}; |
}; |
| 363 |
Int_t val = 0; |
Int_t val = 0; |
| 364 |
Int_t del = 1100; |
Int_t del = 1100; |
| 365 |
if ( clevel2->trigty != 2. ){ |
if ( clevel2->trigty != 2. ){ |
| 366 |
|
Bool_t ck = false; |
| 367 |
for (Int_t sec = 0; sec < 4; sec++){ |
for (Int_t sec = 0; sec < 4; sec++){ |
| 368 |
val = (Int_t)de->calselftrig[sec][6]; |
val = (Int_t)de->calselftrig[sec][6]; |
| 369 |
del = delay(val); |
del = delay(val); |
| 370 |
if ( del < 1100 ){ |
if ( del < 1100 ){ |
| 371 |
|
clevel2->wartrig = 0.; |
| 372 |
clevel2->trigty = 3.; |
clevel2->trigty = 3.; |
| 373 |
|
ck = true; |
| 374 |
break; |
break; |
| 375 |
}; |
}; |
| 376 |
}; |
}; |
| 377 |
|
if ( !ck ) clevel2->wartrig = 100.; |
| 378 |
|
} else { |
| 379 |
|
Bool_t ck = false; |
| 380 |
|
for (Int_t sec = 0; sec < 4; sec++){ |
| 381 |
|
val = (Int_t)de->calselftrig[sec][6]; |
| 382 |
|
del = delay(val); |
| 383 |
|
if ( del < 1100 ){ |
| 384 |
|
clevel2->wartrig = 0.; |
| 385 |
|
ck = true; |
| 386 |
|
}; |
| 387 |
|
}; |
| 388 |
|
if ( !ck ) clevel2->wartrig = 100.; |
| 389 |
}; |
}; |
| 390 |
// |
// |
| 391 |
Int_t se = 5; |
Int_t se = 5; |
| 593 |
}; |
}; |
| 594 |
}; |
}; |
| 595 |
// |
// |
| 596 |
if ( ener0 == 0. && cbase0 == 0. && !pproblem ){ |
if ( ener0 == 0. && cbase0 == 0. && !pproblem && clevel2->perr[se] == 0){ |
| 597 |
if ( verbose ) printf(" Calorimeter power problems! event marked as bad \n"); |
if ( verbose ) printf(" Entry %i : calorimeter power problems! event marked as bad \n",ei); |
| 598 |
pproblem = true; |
pproblem = true; |
| 599 |
pe++; |
pe++; |
| 600 |
}; |
}; |
| 630 |
tim = 100000.; |
tim = 100000.; |
| 631 |
plo = m; |
plo = m; |
| 632 |
fbi = 0; |
fbi = 0; |
| 633 |
if ( clevel1->estrip[j4][m][l] > 1. ){ |
if ( clevel1->estrip[j4][m][l] > 0.99995 ){ |
| 634 |
tim = 10000.; |
tim = 10000.; |
| 635 |
plo = m; |
plo = m; |
| 636 |
fbi = 1; |
fbi = 1; |
| 637 |
}; |
}; |
| 638 |
if ( clevel1->estrip[j4][m][l] > 10. ){ |
if ( clevel1->estrip[j4][m][l] > 9.9995 ){ |
| 639 |
tim = 1000.; |
tim = 1000.; |
| 640 |
plo = 22 + m; |
plo = 22 + m; |
| 641 |
fbi = 1; |
fbi = 1; |
| 642 |
}; |
}; |
| 643 |
if ( clevel1->estrip[j4][m][l] > 100. ){ |
if ( clevel1->estrip[j4][m][l] > 99.995 ){ |
| 644 |
tim = 100.; |
tim = 100.; |
| 645 |
plo = 22 + m; |
plo = 22 + m; |
| 646 |
fbi = 0; |
fbi = 0; |
| 647 |
}; |
}; |
| 648 |
if ( clevel1->estrip[j4][m][l] > 1000. ){ |
if ( clevel1->estrip[j4][m][l] > 999.95 ){ |
| 649 |
tim = 10.; |
tim = 10.; |
| 650 |
plo = 44 + m; |
plo = 44 + m; |
| 651 |
fbi = 0; |
fbi = 0; |
| 652 |
}; |
}; |
| 653 |
if ( clevel1->estrip[j4][m][l] > 10000. ){ |
if ( clevel1->estrip[j4][m][l] > 9999.5 ){ |
| 654 |
tim = 1.; |
tim = 1.; |
| 655 |
plo = 66 + m; |
plo = 66 + m; |
| 656 |
fbi = 0; |
fbi = 0; |
| 666 |
} else { |
} else { |
| 667 |
svstrip[istrip] = -(fbi*1000000000 + plo*10000000 + j4*100000 + cle); |
svstrip[istrip] = -(fbi*1000000000 + plo*10000000 + j4*100000 + cle); |
| 668 |
}; |
}; |
| 669 |
// if ( ei == 770 ) printf(" j %i l %i m %i estrip %f \n",j4,l,m,clevel1->estrip[j4][m][l]); |
// |
| 670 |
// if ( ei == 770 ) printf(" num lim %i fbi %i tim %f plo %i cle %i \n",numeric_limits<Int_t>::max(),fbi,tim,plo,cle); |
// if ( ei >= -770 ) printf(" j %i l %i m %i estrip %f \n",j4,l,m,clevel1->estrip[j4][m][l]); |
| 671 |
// if ( ei == 770 ) printf(" svstrip %i \n",svstrip[istrip]); |
// if ( ei >= -770 ) printf(" num lim %i fbi %i tim %f plo %i cle %i \n",numeric_limits<Int_t>::max(),fbi,tim,plo,cle); |
| 672 |
|
// if ( ei >= -770 ) printf(" svstrip %i \n",svstrip[istrip]); |
| 673 |
// |
// |
| 674 |
istrip++; |
istrip++; |
| 675 |
}; |
}; |
| 724 |
t_ca->qlow = clevel2->qlow; |
t_ca->qlow = clevel2->qlow; |
| 725 |
t_ca->nlow = (Int_t)clevel2->nlow; |
t_ca->nlow = (Int_t)clevel2->nlow; |
| 726 |
// |
// |
|
memcpy(t_ca->tibar,clevel2->tibar,sizeof(clevel2->tibar)); |
|
|
memcpy(t_ca->tbar,clevel2->tbar,sizeof(clevel2->tbar)); |
|
|
// |
|
| 727 |
if ( trkseqno == -1 ){ |
if ( trkseqno == -1 ){ |
| 728 |
ca->impx = clevel2->impx; |
// ca->impx = clevel2->impx; |
| 729 |
ca->impy = clevel2->impy; |
// ca->impy = clevel2->impy; |
| 730 |
ca->tanx = clevel2->tanx; |
ca->tanx[1] = clevel2->tanx; |
| 731 |
ca->tany = clevel2->tany; |
ca->tany[1] = clevel2->tany; |
| 732 |
ca->elen = clevel2->elen; |
ca->elen = clevel2->elen; |
| 733 |
ca->selen = clevel2->selen; |
ca->selen = clevel2->selen; |
| 734 |
memcpy(ca->cibar,clevel2->cibar,sizeof(clevel2->cibar)); |
// memcpy(ca->cibar,clevel2->cibar,sizeof(clevel2->cibar)); |
| 735 |
memcpy(ca->cbar,clevel2->cbar,sizeof(clevel2->cbar)); |
// memcpy(ca->cbar,clevel2->cbar,sizeof(clevel2->cbar)); |
| 736 |
|
memcpy(t_ca->tibar,clevel2->cibar,sizeof(clevel2->cibar)); |
| 737 |
|
memcpy(t_ca->tbar,clevel2->cbar,sizeof(clevel2->cbar)); |
| 738 |
memcpy(ca->planemax,clevel2->planemax,sizeof(clevel2->planemax)); |
memcpy(ca->planemax,clevel2->planemax,sizeof(clevel2->planemax)); |
| 739 |
memcpy(ca->varcfit,clevel2->varcfit,sizeof(clevel2->varcfit)); |
ca->varcfit[2] = clevel2->varcfit[0]; |
| 740 |
memcpy(ca->npcfit,clevel2->npcfit,sizeof(clevel2->npcfit)); |
ca->varcfit[3] = clevel2->varcfit[1]; |
| 741 |
|
ca->npcfit[2] = clevel2->npcfit[0]; |
| 742 |
|
ca->npcfit[3] = clevel2->npcfit[1]; |
| 743 |
|
// memcpy(ca->varcfit,clevel2->varcfit,sizeof(clevel2->varcfit)); |
| 744 |
|
// memcpy(ca->npcfit,clevel2->npcfit,sizeof(clevel2->npcfit)); |
| 745 |
|
} else { |
| 746 |
|
memcpy(t_ca->tibar,clevel2->tibar,sizeof(clevel2->tibar)); |
| 747 |
|
memcpy(t_ca->tbar,clevel2->tbar,sizeof(clevel2->tbar)); |
| 748 |
}; |
}; |
| 749 |
|
// |
| 750 |
// |
// |
| 751 |
|
if ( !(ca->CaloTrk) ) ca->CaloTrk = new TClonesArray("CaloTrkVar",1); //ELENA |
| 752 |
TClonesArray &t = *ca->CaloTrk; |
TClonesArray &t = *ca->CaloTrk; |
| 753 |
new(t[nutrk]) CaloTrkVar(*t_ca); |
new(t[nutrk]) CaloTrkVar(*t_ca); |
| 754 |
// |
// |
| 761 |
calol2cm(); |
calol2cm(); |
| 762 |
} |
} |
| 763 |
|
|
| 764 |
void CaloProcessing::FillCommonVar(CaloLevel2 *ca){ |
void CaloProcessing::FillCommonVar(CaloLevel1 *c1, CaloLevel2 *ca){ |
| 765 |
// |
// |
| 766 |
ca->good = clevel2->good; |
ca->good = clevel2->good; |
| 767 |
if ( clevel2->trigty == 2. ){ |
if ( clevel2->trigty == 2. ){ |
| 769 |
} else { |
} else { |
| 770 |
ca->selftrigger = 0; |
ca->selftrigger = 0; |
| 771 |
}; |
}; |
| 772 |
|
// |
| 773 |
|
ca->selftrigger += (Int_t)clevel2->wartrig; |
| 774 |
|
// |
| 775 |
memcpy(ca->perr,clevel2->perr,sizeof(clevel2->perr)); |
memcpy(ca->perr,clevel2->perr,sizeof(clevel2->perr)); |
| 776 |
memcpy(ca->swerr,clevel2->swerr,sizeof(clevel2->swerr)); |
memcpy(ca->swerr,clevel2->swerr,sizeof(clevel2->swerr)); |
| 777 |
memcpy(ca->crc,clevel2->crc,sizeof(clevel2->crc)); |
memcpy(ca->crc,clevel2->crc,sizeof(clevel2->crc)); |
| 778 |
ca->nstrip = (Int_t)clevel2->nstrip; |
ca->nstrip = (Int_t)clevel2->nstrip; |
| 779 |
ca->qtot = clevel2->qtot; |
ca->qtot = clevel2->qtot; |
| 780 |
ca->impx = clevel2->impx; |
// ca->impx = clevel2->impx; |
| 781 |
ca->impy = clevel2->impy; |
// ca->impy = clevel2->impy; |
| 782 |
ca->tanx = clevel2->tanx; |
ca->tanx[0] = clevel2->tanx; |
| 783 |
ca->tany = clevel2->tany; |
ca->tany[0] = clevel2->tany; |
| 784 |
ca->nx22 = (Int_t)clevel2->nx22; |
ca->nx22 = (Int_t)clevel2->nx22; |
| 785 |
ca->qx22 = clevel2->qx22; |
ca->qx22 = clevel2->qx22; |
| 786 |
ca->qmax = clevel2->qmax; |
ca->qmax = clevel2->qmax; |
| 787 |
ca->elen = clevel2->elen; |
ca->elen = clevel2->elen; |
| 788 |
ca->selen = clevel2->selen; |
ca->selen = clevel2->selen; |
|
ca->estrip = TArrayI(ca->nstrip,svstrip); |
|
| 789 |
memcpy(ca->qq,clevel2->qq,sizeof(clevel2->qq)); |
memcpy(ca->qq,clevel2->qq,sizeof(clevel2->qq)); |
| 790 |
memcpy(ca->planemax,clevel2->planemax,sizeof(clevel2->planemax)); |
memcpy(ca->planemax,clevel2->planemax,sizeof(clevel2->planemax)); |
| 791 |
memcpy(ca->varcfit,clevel2->varcfit,sizeof(clevel2->varcfit)); |
ca->varcfit[0] = clevel2->varcfit[0]; |
| 792 |
memcpy(ca->npcfit,clevel2->npcfit,sizeof(clevel2->npcfit)); |
ca->varcfit[1] = clevel2->varcfit[1]; |
| 793 |
|
ca->npcfit[0] = clevel2->npcfit[0]; |
| 794 |
|
ca->npcfit[1] = clevel2->npcfit[1]; |
| 795 |
|
ca->fitmode[0] = clevel2->fmode[0]; |
| 796 |
|
ca->fitmode[1] = clevel2->fmode[1]; |
| 797 |
|
// memcpy(ca->varcfit,clevel2->varcfit,sizeof(clevel2->varcfit)); |
| 798 |
|
// memcpy(ca->npcfit,clevel2->npcfit,sizeof(clevel2->npcfit)); |
| 799 |
memcpy(ca->cibar,clevel2->cibar,sizeof(clevel2->cibar)); |
memcpy(ca->cibar,clevel2->cibar,sizeof(clevel2->cibar)); |
| 800 |
memcpy(ca->cbar,clevel2->cbar,sizeof(clevel2->cbar)); |
memcpy(ca->cbar,clevel2->cbar,sizeof(clevel2->cbar)); |
| 801 |
// |
// |
| 802 |
|
if ( c1 ){ |
| 803 |
|
c1->istrip = istrip; |
| 804 |
|
c1->estrip = TArrayI(istrip,svstrip); |
| 805 |
|
}; |
| 806 |
|
// |
| 807 |
} |
} |
| 808 |
|
|
| 809 |
void CaloProcessing::ClearStructs(){ |
void CaloProcessing::ClearStructs(){ |
| 860 |
void CaloProcessing::ClearCommonVar(){ |
void CaloProcessing::ClearCommonVar(){ |
| 861 |
istrip = 0; |
istrip = 0; |
| 862 |
clevel2->trigty = -1.; |
clevel2->trigty = -1.; |
| 863 |
|
clevel2->wartrig = 0.; |
| 864 |
clevel2->good = 0; |
clevel2->good = 0; |
| 865 |
clevel2->nstrip = 0.; |
clevel2->nstrip = 0.; |
| 866 |
clevel2->qtot = 0.; |
clevel2->qtot = 0.; |
| 867 |
clevel2->impx = 0.; |
// clevel2->impx = 0.; |
| 868 |
clevel2->impy = 0.; |
// clevel2->impy = 0.; |
| 869 |
clevel2->tanx = 0.; |
clevel2->tanx = 0.; // this is correct since it refers to the fortran structure |
| 870 |
clevel2->tany = 0.; |
clevel2->tany = 0.; // this is correct since it refers to the fortran structure |
| 871 |
clevel2->qmax = 0.; |
clevel2->qmax = 0.; |
| 872 |
clevel2->nx22 = 0.; |
clevel2->nx22 = 0.; |
| 873 |
clevel2->qx22 = 0.; |
clevel2->qx22 = 0.; |
| 875 |
memset(clevel2->swerr, 0, 4*sizeof(Int_t)); |
memset(clevel2->swerr, 0, 4*sizeof(Int_t)); |
| 876 |
memset(clevel2->crc, 0, 4*sizeof(Int_t)); |
memset(clevel2->crc, 0, 4*sizeof(Int_t)); |
| 877 |
memset(clevel2->qq, 0, 4*sizeof(Int_t)); |
memset(clevel2->qq, 0, 4*sizeof(Int_t)); |
| 878 |
memset(clevel2->varcfit, 0, 2*sizeof(Float_t)); |
memset(clevel2->varcfit, 0, 4*sizeof(Float_t)); |
| 879 |
memset(clevel2->npcfit, 0, 2*sizeof(Int_t)); |
memset(clevel2->npcfit, 0, 4*sizeof(Int_t)); |
| 880 |
memset(clevel2->planemax, 0, 2*sizeof(Int_t)); |
memset(clevel2->planemax, 0, 2*sizeof(Int_t)); |
| 881 |
|
memset(clevel2->fmode, 0, 2*sizeof(Int_t)); |
| 882 |
memset(clevel2->cibar, 0, 2*22*sizeof(Int_t)); |
memset(clevel2->cibar, 0, 2*22*sizeof(Int_t)); |
| 883 |
memset(clevel2->cbar, 0, 2*22*sizeof(Float_t)); |
memset(clevel2->cbar, 0, 2*22*sizeof(Float_t)); |
| 884 |
} |
} |