728 |
return(0); |
return(0); |
729 |
} |
} |
730 |
|
|
731 |
|
void CaloLevel0::FindBaseCompress(Int_t l, Int_t m, Int_t pre){ |
732 |
|
for (Int_t e = pre*16; e < (pre+1)*16 ; e++){ |
733 |
|
dexy[l][m][e] = dexyc[l][m][e]; |
734 |
|
}; |
735 |
|
this->FindBaseRaw(l,m,pre); |
736 |
|
} |
737 |
|
|
738 |
void CaloLevel0::FindBaseRaw(Int_t l, Int_t m, Int_t pre){ |
void CaloLevel0::FindBaseRaw(Int_t l, Int_t m, Int_t pre){ |
739 |
Float_t minstrip = 100000.; |
Float_t minstrip = 100000.; |
740 |
Float_t rms = 0.; |
Float_t rms = 0.; |
745 |
rms = calthr[l][m][pre]; |
rms = calthr[l][m][pre]; |
746 |
}; |
}; |
747 |
}; |
}; |
748 |
|
if ( debug && l==1 ){ |
749 |
|
printf("\n BASELINE CALCULATION for view %i pl %i pre %i: \n => minstrip %f rms %f \n",l,m,pre,minstrip,rms); |
750 |
|
}; |
751 |
if ( minstrip != 100000. ) { |
if ( minstrip != 100000. ) { |
752 |
Float_t strip6s = 0.; |
Float_t strip6s = 0.; |
753 |
for (Int_t e = pre*16; e < (pre+1)*16 ; e++){ |
for (Int_t e = pre*16; e < (pre+1)*16 ; e++){ |
764 |
dexyc[l][m][e] = dexy[l][m][e]; |
dexyc[l][m][e] = dexy[l][m][e]; |
765 |
}; |
}; |
766 |
}; |
}; |
767 |
if ( strip6s >= 9. ){ |
if ( debug && l==1 ){ |
768 |
|
printf(" strip6s %f \n",strip6s); |
769 |
|
}; |
770 |
|
// if ( strip6s >= 9. ){ |
771 |
|
if ( strip6s >= 2. ){ |
772 |
Double_t arro = base[l][m][pre]/strip6s; |
Double_t arro = base[l][m][pre]/strip6s; |
773 |
Float_t deci = 1000.*((float)arro - float(int(arro))); |
Float_t deci = 1000.*((float)arro - float(int(arro))); |
774 |
if ( deci < 500. ) { |
if ( deci < 500. ) { |
796 |
// |
// |
797 |
// if it was not a selftrigger event, could it ever been a selftrigger event? if so trigty = 3. |
// if it was not a selftrigger event, could it ever been a selftrigger event? if so trigty = 3. |
798 |
// |
// |
799 |
|
clevel2->nsatstrip = 0.; |
800 |
Int_t val = 0; |
Int_t val = 0; |
801 |
Int_t del = 1100; |
Int_t del = 1100; |
802 |
for (Int_t sec = 0; sec < 4; sec++){ |
for (Int_t sec = 0; sec < 4; sec++){ |
927 |
// |
// |
928 |
// baseline check and calculation |
// baseline check and calculation |
929 |
// |
// |
930 |
if ( !isRAW ) { |
if ( !isRAW ){ |
931 |
base[l][m][pre] = de->base[l][m][pre] ; |
if ( de->base[l][m][pre] != 0. && de->base[l][m][pre]<31000. ) { |
932 |
|
base[l][m][pre] = de->base[l][m][pre] ; |
933 |
|
} else { |
934 |
|
FindBaseCompress(l,m,pre); |
935 |
|
}; |
936 |
cbase0 += base[l][m][pre]; |
cbase0 += base[l][m][pre]; |
937 |
} else { |
} else { |
938 |
// |
// |
992 |
case 0: |
case 0: |
993 |
base0 = base[l][m][pre]; |
base0 = base[l][m][pre]; |
994 |
base2 = calbase[l][m][pre]; |
base2 = calbase[l][m][pre]; |
995 |
if ( debug ) printf(" base0 = base l m pre = %f base2 = calbase l m pre = %f \n",base[l][m][pre],calbase[l][m][pre]); |
if ( debug ) printf(" base0 = base l%i m%i pre%i = %f base2 = calbase l m pre = %f \n",l,m,pre,base[l][m][pre],calbase[l][m][pre]); |
996 |
break; |
break; |
997 |
case 1: |
case 1: |
998 |
base0 = base[l][m][ip[i]]; |
base0 = base[l][m][ip[i]]; |
999 |
base2 = calbase[l][m][ip[i]]; |
base2 = calbase[l][m][ip[i]]; |
1000 |
if ( debug ) printf(" base0 = base l m ip(i) = %f base2 = calbase l m ip(i) = %f \n",base[l][m][ip[i]],calbase[l][m][ip[i]]); |
if ( debug ) printf(" base0 = base l%i m%i ip(i)%i = %f base2 = calbase l m ip(i) = %f \n",l,m,ip[i],base[l][m][ip[i]],calbase[l][m][ip[i]]); |
1001 |
break; |
break; |
1002 |
case 2: |
case 2: |
1003 |
base0 = sbase[l][m][pre]; |
base0 = sbase[l][m][pre]; |
1004 |
base2 = calbase[l][m][pre]; |
base2 = calbase[l][m][pre]; |
1005 |
if ( debug ) printf(" base0 = sbase l m pre = %f base2 = calbase l m pre = %f \n",sbase[l][m][pre],calbase[l][m][pre]); |
if ( debug ) printf(" base0 = sbase l%i m%i pre%i = %f base2 = calbase l m pre = %f \n",l,m,pre,sbase[l][m][pre],calbase[l][m][pre]); |
1006 |
break; |
break; |
1007 |
case 3: |
case 3: |
1008 |
base0 = calbase[l][m][pre]; |
base0 = calbase[l][m][pre]; |
1009 |
base2 = calbase[l][m][pre]; |
base2 = calbase[l][m][pre]; |
1010 |
if ( debug ) printf(" base0 = calbase l m pre = %f base2 = calbase l m pre = %f \n",calbase[l][m][pre],calbase[l][m][pre]); |
if ( debug ) printf(" base0 = calbase l%i m%i pre%i = %f base2 = calbase l m pre = %f \n",l,m,pre,calbase[l][m][pre],calbase[l][m][pre]); |
1011 |
break; |
break; |
1012 |
}; |
}; |
1013 |
base1 = calbase[l][m][pre]; |
base1 = calbase[l][m][pre]; |
1113 |
if ( clevel1->estrip[j4][m][l] > clevel1->emin ){ |
if ( clevel1->estrip[j4][m][l] > clevel1->emin ){ |
1114 |
// |
// |
1115 |
Float_t savel1 = clevel1->estrip[j4][m][l]; |
Float_t savel1 = clevel1->estrip[j4][m][l]; |
1116 |
if ( dexyc[j4][m][l] == 32767. ){ |
if ( dexyc[l][m][j4] == 32767. ){ |
1117 |
savel1 += 5000.; |
savel1 += 5000.; |
1118 |
clevel2->nsatstrip += 1.; |
clevel2->nsatstrip += 1.; |
1119 |
}; |
}; |