46 |
// |
// |
47 |
|
|
48 |
CaloProcessing::~CaloProcessing(){ |
CaloProcessing::~CaloProcessing(){ |
49 |
|
delete de; |
50 |
delete this; |
delete this; |
51 |
} |
} |
52 |
|
|
53 |
CaloProcessing::CaloProcessing(){ |
CaloProcessing::CaloProcessing(){ |
|
e_clevel1 = new struct FlCaLevel1; |
|
|
e_clevel2 = new struct FlCaLevel2; |
|
|
e_clevel2->ncore = 0; |
|
|
e_clevel2->qcore = 0.; |
|
|
e_clevel2->noint = 0.; |
|
|
e_clevel2->ncyl = 0.; |
|
|
e_clevel2->qcyl = 0.; |
|
|
e_clevel2->qtrack = 0.; |
|
|
e_clevel2->qtrackx = 0.; |
|
|
e_clevel2->qtracky = 0.; |
|
|
e_clevel2->dxtrack = 0.; |
|
|
e_clevel2->dytrack = 0.; |
|
|
e_clevel2->qlast = 0.; |
|
|
e_clevel2->nlast = 0.; |
|
|
e_clevel2->qpre = 0.; |
|
|
e_clevel2->npre = 0.; |
|
|
e_clevel2->qpresh = 0.; |
|
|
e_clevel2->npresh = 0.; |
|
|
e_clevel2->qlow = 0.; |
|
|
e_clevel2->nlow = 0.; |
|
|
e_clevel2->qtr = 0.; |
|
|
e_clevel2->ntr = 0.; |
|
|
e_clevel2->elen = 0.; |
|
|
e_clevel2->selen = 0.; |
|
|
e_clevel1->good2 = 0; |
|
|
e_clevel1->trkchi2 = 0; |
|
|
for (Int_t il = 0; il<2 ; il++){ |
|
|
for ( Int_t jl = 0; jl<22; jl++){ |
|
|
if ( jl < 5 ) e_clevel1->al_p[jl][il] = 0.; |
|
|
for ( Int_t ml = 0; ml<96; ml++){ |
|
|
e_clevel1->estrip[ml][jl][il] = 0.; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
e_clevel2->trigty = 0.; |
|
|
e_clevel2->good = 0; |
|
|
e_clevel2->nstrip = 0.; |
|
|
e_clevel2->qtot = 0.; |
|
|
e_clevel2->impx = 0.; |
|
|
e_clevel2->impy = 0.; |
|
|
e_clevel2->tanx = 0.; |
|
|
e_clevel2->tany = 0.; |
|
|
e_clevel2->qmax = 0.; |
|
|
e_clevel2->nx22 = 0.; |
|
|
e_clevel2->qx22 = 0.; |
|
|
e_clevel2->planetot = 0.; |
|
|
e_clevel2->qmean = 0.; |
|
|
e_clevel2->dX0l = 0.; |
|
|
for (Int_t il = 0; il<4 ; il++){ |
|
|
e_clevel2->perr[il] = 0; |
|
|
e_clevel2->swerr[il] = 0; |
|
|
e_clevel2->crc[il] = 0; |
|
|
e_clevel2->qq[il] = 0.; |
|
|
if ( il < 2 ){ |
|
|
e_clevel2->varcfit[il] = 0.; |
|
|
e_clevel2->planemax[il] = 0; |
|
|
e_clevel2->npcfit[il] = 0; |
|
|
for ( Int_t jl = 0; jl<22; jl++){ |
|
|
e_clevel2->cibar[jl][il] = 0; |
|
|
e_clevel2->tibar[jl][il] = 0; |
|
|
e_clevel2->cbar[jl][il] = 0.; |
|
|
e_clevel2->tbar[jl][il] = 0.; |
|
|
}; |
|
|
}; |
|
|
}; |
|
54 |
// |
// |
55 |
extern struct FlCaLevel1 clevel1_; |
extern struct FlCaLevel1 clevel1_; |
56 |
extern struct FlCaLevel2 clevel2_; |
extern struct FlCaLevel2 clevel2_; |
59 |
// |
// |
60 |
trkseqno = 0; |
trkseqno = 0; |
61 |
ClearStructs(); |
ClearStructs(); |
62 |
for ( Int_t l = 0; l < 2; l++ ){ |
// |
63 |
for ( Int_t m = 0; m < 22; m++ ){ |
memset(dexy, 0, 2*22*96*sizeof(Float_t)); |
64 |
for ( Int_t n = 0; n < 96; n++ ){ |
memset(dexyc, 0, 2*22*96*sizeof(Float_t)); |
65 |
dexy[l][m][n] = 0.; |
memset(mip, 0, 2*22*96*sizeof(Float_t)); |
66 |
dexyc[l][m][n] = 0.; |
memset(base, 0, 2*22*6*sizeof(Float_t)); |
67 |
mip[l][m][n] = 0.; |
memset(sbase, 0, 2*22*6*sizeof(Float_t)); |
|
if ( n < 6 ){ |
|
|
base[l][m][n] = 0.; |
|
|
sbase[l][m][n] = 0.; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
68 |
calopar1 = true; |
calopar1 = true; |
69 |
calopar2 = true; |
calopar2 = true; |
70 |
ftcalopar1 = 0ULL; |
ftcalopar1 = 0ULL; |
422 |
doneb = 0; |
doneb = 0; |
423 |
donec = 0; |
donec = 0; |
424 |
pre++; |
pre++; |
425 |
qpre[pre] = 0; |
qpre[pre] = 0.; |
426 |
}; |
}; |
427 |
// |
// |
428 |
// baseline check and calculation |
// baseline check and calculation |
495 |
ipre = ip[i] - 1; |
ipre = ip[i] - 1; |
496 |
}; |
}; |
497 |
for (Int_t j = ipre*16 ; j < (ipre+1)*16 ; j++){ |
for (Int_t j = ipre*16 ; j < (ipre+1)*16 ; j++){ |
498 |
clevel1->estrip[j][m][l] = clevel1->estrip[j][m][l] + (qpre[ipre] - qpre[ip[i]]) * 0.00478; |
clevel1->estrip[j][m][l] += (qpre[ipre] - qpre[ip[i]]) * 0.00478; |
499 |
}; |
}; |
500 |
}; |
}; |
501 |
if (ck == 2){ |
if (ck == 2){ |
502 |
for (Int_t j = i*32 ; j < (i+1)*32 ; j++){ |
for (Int_t j = i*32 ; j < (i+1)*32 ; j++){ |
503 |
ipre = j/16 + 1; |
ipre = j/16 + 1; |
504 |
clevel1->estrip[j][m][l] = clevel1->estrip[j][m][l] + qpre[ipre] * 0.00478; |
clevel1->estrip[j][m][l] += qpre[ipre] * 0.00478; |
505 |
}; |
}; |
506 |
}; |
}; |
507 |
}; |
}; |
515 |
j4++; |
j4++; |
516 |
if ( j < 96 ) ene[j] = clevel1->estrip[j][m][l]; |
if ( j < 96 ) ene[j] = clevel1->estrip[j][m][l]; |
517 |
if ( jj >= 0 && jj < 96 ){ |
if ( jj >= 0 && jj < 96 ){ |
518 |
if ( jj != 0 && jj != 32 && jj != 64 ) ene[jj-1] = ene[jj-1] - clevel1->estrip[jj][m][l] * 0.01581; |
if ( jj != 0 && jj != 32 && jj != 64 ) ene[jj-1] += -clevel1->estrip[jj][m][l] * 0.01581; |
519 |
if ( jj != 31 && jj != 63 && jj != 95 ) ene[jj+1] = ene[jj+1] - clevel1->estrip[jj][m][l] * 0.01581; |
if ( jj != 31 && jj != 63 && jj != 95 ) ene[jj+1] += -clevel1->estrip[jj][m][l] * 0.01581; |
520 |
}; |
}; |
521 |
if ( jjj >= 0 && jjj < 96 ){ |
if ( jjj >= 0 && jjj < 96 ){ |
522 |
if ( jjj != 0 && jjj != 32 && jjj != 64 ) clevel1->estrip[jjj-1][m][l] = clevel1->estrip[jjj-1][m][l] - ene[jjj] * 0.01581; |
if ( jjj != 0 && jjj != 32 && jjj != 64 ) clevel1->estrip[jjj-1][m][l] += -ene[jjj] * 0.01581; |
523 |
if ( jjj != 31 && jjj != 63 && jjj != 95 ) clevel1->estrip[jjj+1][m][l] = clevel1->estrip[jjj+1][m][l] - ene[jjj] * 0.01581; |
if ( jjj != 31 && jjj != 63 && jjj != 95 ) clevel1->estrip[jjj+1][m][l] += -ene[jjj] * 0.01581; |
524 |
}; |
}; |
525 |
if ( j4 >= 0 && j4 < 96 ){ |
if ( j4 >= 0 && j4 < 96 ){ |
526 |
// |
// |
661 |
void CaloProcessing::RunClose(){ |
void CaloProcessing::RunClose(){ |
662 |
l0tr->Delete(); |
l0tr->Delete(); |
663 |
ClearStructs(); |
ClearStructs(); |
664 |
for ( Int_t l = 0; l < 2; l++ ){ |
// |
665 |
for ( Int_t m = 0; m < 22; m++ ){ |
memset(dexy, 0, 2*22*96*sizeof(Float_t)); |
666 |
for ( Int_t n = 0; n < 96; n++ ){ |
memset(dexyc, 0, 2*22*96*sizeof(Float_t)); |
667 |
dexy[l][m][n] = 0.; |
memset(base, 0, 2*22*6*sizeof(Float_t)); |
668 |
dexyc[l][m][n] = 0.; |
memset(sbase, 0, 2*22*6*sizeof(Float_t)); |
669 |
if ( n < 6 ){ |
// |
|
base[l][m][n] = 0.; |
|
|
sbase[l][m][n] = 0.; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
670 |
} |
} |
671 |
|
|
672 |
// |
// |
699 |
clevel2->dX0l = 0.; |
clevel2->dX0l = 0.; |
700 |
clevel2->elen = 0.; |
clevel2->elen = 0.; |
701 |
clevel2->selen = 0.; |
clevel2->selen = 0.; |
702 |
memcpy(clevel1->al_p,e_clevel1->al_p,sizeof(clevel1->al_p)); |
memset(clevel1->al_p, 0, 5*2*sizeof(Double_t)); |
703 |
memcpy(clevel2->tibar,e_clevel2->tibar,sizeof(clevel2->tibar)); |
memset(clevel2->tibar, 0, 2*22*sizeof(Int_t)); |
704 |
memcpy(clevel2->tbar,e_clevel2->tbar,sizeof(clevel2->tbar)); |
memset(clevel2->tbar, 0, 2*22*sizeof(Float_t)); |
705 |
} |
} |
706 |
|
|
707 |
void CaloProcessing::ClearCommonVar(){ |
void CaloProcessing::ClearCommonVar(){ |
717 |
clevel2->qmax = 0.; |
clevel2->qmax = 0.; |
718 |
clevel2->nx22 = 0.; |
clevel2->nx22 = 0.; |
719 |
clevel2->qx22 = 0.; |
clevel2->qx22 = 0.; |
720 |
memcpy(clevel2->perr,e_clevel2->perr,sizeof(clevel2->perr)); |
memset(clevel2->perr, 0, 4*sizeof(Int_t)); |
721 |
memcpy(clevel2->swerr,e_clevel2->swerr,sizeof(clevel2->swerr)); |
memset(clevel2->swerr, 0, 4*sizeof(Int_t)); |
722 |
memcpy(clevel2->crc,e_clevel2->crc,sizeof(clevel2->crc)); |
memset(clevel2->crc, 0, 4*sizeof(Int_t)); |
723 |
memcpy(clevel2->qq,e_clevel2->qq,sizeof(clevel2->qq)); |
memset(clevel2->qq, 0, 4*sizeof(Int_t)); |
724 |
memcpy(clevel2->planemax,e_clevel2->planemax,sizeof(clevel2->planemax)); |
memset(clevel2->varcfit, 0, 2*sizeof(Float_t)); |
725 |
memcpy(clevel2->varcfit,e_clevel2->varcfit,sizeof(clevel2->varcfit)); |
memset(clevel2->npcfit, 0, 2*sizeof(Int_t)); |
726 |
memcpy(clevel2->npcfit,e_clevel2->npcfit,sizeof(clevel2->npcfit)); |
memset(clevel2->planemax, 0, 2*sizeof(Int_t)); |
727 |
memcpy(clevel2->cibar,e_clevel2->cibar,sizeof(clevel2->cibar)); |
memset(clevel2->cibar, 0, 2*22*sizeof(Int_t)); |
728 |
memcpy(clevel2->cbar,e_clevel2->cbar,sizeof(clevel2->cbar)); |
memset(clevel2->cbar, 0, 2*22*sizeof(Float_t)); |
729 |
} |
} |
730 |
|
|
731 |
void CaloProcessing::ClearCalibVals(Int_t s){ |
void CaloProcessing::ClearCalibVals(Int_t s){ |