82 |
|
|
83 |
void CaloLevel0::SetCrossTalk(Bool_t ct){ |
void CaloLevel0::SetCrossTalk(Bool_t ct){ |
84 |
crosst = ct; |
crosst = ct; |
85 |
}; |
} |
86 |
|
|
87 |
void CaloLevel0::SetCrossTalkType(Bool_t ct){ |
void CaloLevel0::SetCrossTalkType(Bool_t ct){ |
88 |
ctground = ct; |
ctground = ct; |
89 |
}; |
} |
90 |
|
|
91 |
void CaloLevel0::SetVerbose(Bool_t ct){ |
void CaloLevel0::SetVerbose(Bool_t ct){ |
92 |
verbose = ct; |
verbose = ct; |
93 |
}; |
} |
94 |
|
|
95 |
/** |
/** |
96 |
* Initialize CaloLevel0 object |
* Initialize CaloLevel0 object |
307 |
fread(&tmp,sizeof(clevel1->xalig),1,f); |
fread(&tmp,sizeof(clevel1->xalig),1,f); |
308 |
fread(&tmp,sizeof(clevel1->yalig),1,f); |
fread(&tmp,sizeof(clevel1->yalig),1,f); |
309 |
fread(&tmp,sizeof(clevel1->zalig),1,f); |
fread(&tmp,sizeof(clevel1->zalig),1,f); |
310 |
|
// clevel1->zalig = -265.82; |
311 |
// |
// |
312 |
}; |
}; |
313 |
fread(&clevel1->emin,sizeof(clevel1->emin),1,f); |
fread(&clevel1->emin,sizeof(clevel1->emin),1,f); |
726 |
}; |
}; |
727 |
// |
// |
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.; |
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. ) savel1 += 5000.; |
if ( dexyc[l][m][j4] == 32767. ){ |
1117 |
|
savel1 += 5000.; |
1118 |
|
clevel2->nsatstrip += 1.; |
1119 |
|
}; |
1120 |
// |
// |
1121 |
tim = 100000.; |
tim = 100000.; |
1122 |
plo = m; |
plo = m; |
1268 |
memcpy(ca->swerr,clevel2->swerr,sizeof(clevel2->swerr)); |
memcpy(ca->swerr,clevel2->swerr,sizeof(clevel2->swerr)); |
1269 |
memcpy(ca->crc,clevel2->crc,sizeof(clevel2->crc)); |
memcpy(ca->crc,clevel2->crc,sizeof(clevel2->crc)); |
1270 |
ca->nstrip = (Int_t)clevel2->nstrip; |
ca->nstrip = (Int_t)clevel2->nstrip; |
1271 |
|
ca->nsatstrip = (Int_t)clevel2->nsatstrip; |
1272 |
ca->qtot = clevel2->qtot; |
ca->qtot = clevel2->qtot; |
1273 |
// ca->impx = clevel2->impx; |
// ca->impx = clevel2->impx; |
1274 |
// ca->impy = clevel2->impy; |
// ca->impy = clevel2->impy; |
1359 |
clevel2->wartrig = 0.; |
clevel2->wartrig = 0.; |
1360 |
clevel2->good = 0; |
clevel2->good = 0; |
1361 |
clevel2->nstrip = 0.; |
clevel2->nstrip = 0.; |
1362 |
|
clevel2->nsatstrip = 0.; |
1363 |
clevel2->qtot = 0.; |
clevel2->qtot = 0.; |
1364 |
// clevel2->impx = 0.; |
// clevel2->impx = 0.; |
1365 |
// clevel2->impy = 0.; |
// clevel2->impy = 0.; |