251 |
}; |
}; |
252 |
// if ( event->GetCaloLevel1()->qtotpl(0) > 7. ) return false; |
// if ( event->GetCaloLevel1()->qtotpl(0) > 7. ) return false; |
253 |
|
|
254 |
// if ( rigidity > 2.2 || rigidity < 1.5 ) return false; |
if ( rigidity > 2.2 || rigidity < 1.5 ) return false; |
255 |
// printf(" rig %f CRIG %i SRIG %i \n",rigidity,CRIG,SRIG); |
// printf(" rig %f CRIG %i SRIG %i \n",rigidity,CRIG,SRIG); |
256 |
// |
// |
257 |
return true; |
return true; |
305 |
memset(ntot, 0, 17*sizeof(Int_t)); |
memset(ntot, 0, 17*sizeof(Int_t)); |
306 |
// memset(finmat, 0, 43*191*sizeof(Int_t)); |
// memset(finmat, 0, 43*191*sizeof(Int_t)); |
307 |
// |
// |
308 |
for (Int_t i=0; i < 17 ; i++){ |
// for (Int_t i=0; i < 17 ; i++){ |
309 |
//for (Int_t i=3; i < 4 ; i++){ |
for (Int_t i=3; i < 4 ; i++){ |
310 |
if ( !FULL ){ |
if ( !FULL ){ |
311 |
matrix[i] = new TMatrixD(43,43); |
matrix[i] = new TMatrixD(43,43); |
312 |
qplane[i] = new TArrayF(43); |
qplane[i] = new TArrayF(43); |
600 |
// |
// |
601 |
// Int_t mindgf = 48; |
// Int_t mindgf = 48; |
602 |
// Int_t dgf = 143; |
// Int_t dgf = 143; |
603 |
Int_t mindgf = 0; |
// Int_t mindgf = 0; //tutto |
604 |
Int_t dgf = 191; |
// Int_t dgf = 191; //tutto |
605 |
// Int_t mindgf = 85; |
// Int_t mindgf = 94; |
606 |
// Int_t dgf = 115; |
// Int_t dgf = 96; |
607 |
|
Int_t mindgf = 84; |
608 |
|
Int_t dgf = 106; |
609 |
Int_t cs = 0; |
Int_t cs = 0; |
610 |
Int_t cd = 0; |
Int_t cd = 0; |
611 |
Int_t mstrip = 0; |
Int_t mstrip = 0; |
718 |
// (*fmatrix[rbi])[mi][mj] += (mipv[nplane1][mstrip1] - cf->GetFullAverageAt(nplane1,mstrip1,erig)) * (mipv[nplane2][mstrip2] - cf->GetFullAverageAt(nplane2,mstrip2,erig)); |
// (*fmatrix[rbi])[mi][mj] += (mipv[nplane1][mstrip1] - cf->GetFullAverageAt(nplane1,mstrip1,erig)) * (mipv[nplane2][mstrip2] - cf->GetFullAverageAt(nplane2,mstrip2,erig)); |
719 |
// (*fnmat[rbi])[mi][mj] += 1.; |
// (*fnmat[rbi])[mi][mj] += 1.; |
720 |
(*fmatrix)[mi][mj] += (mip1 * mip2); // giusto |
(*fmatrix)[mi][mj] += (mip1 * mip2); // giusto |
721 |
|
// (*fmatrix)[mi][mj] += (mip1 * mip2) * 1000000.; |
722 |
toto++; |
toto++; |
723 |
// (*fmatrix)[mi][mj] += 1.; |
// (*fmatrix)[mi][mj] += 1.; |
724 |
// cf->GetFullAverageAt(nplane1,mstrip1,erig,rbi); |
// cf->GetFullAverageAt(nplane1,mstrip1,erig,rbi); |
825 |
// }; |
// }; |
826 |
// }; |
// }; |
827 |
// |
// |
828 |
|
// TMatrixF *mymat = new TMatrixF(129,129); |
829 |
|
TMatrixF *mymat = new TMatrixF(989,989); |
830 |
Int_t i1 = -1; |
Int_t i1 = -1; |
831 |
Int_t j1 = -1; |
Int_t j1 = -1; |
832 |
|
int mi,mj; |
833 |
Int_t nonzero = 0; |
Int_t nonzero = 0; |
834 |
Int_t nonzero1 = 0; |
Int_t nonzero1 = 0; |
835 |
for (Int_t ii=0; ii<43; ii++){ |
for (Int_t ii=0; ii<43; ii++){ |
849 |
// if ( finmat[ii][j] > 0 ){ |
// if ( finmat[ii][j] > 0 ){ |
850 |
// (*fmatrix)[i1][j1] /= finmat[ii][j]; |
// (*fmatrix)[i1][j1] /= finmat[ii][j]; |
851 |
if ( (*fnmat[i])[ii][j] == 0. || (*fmatrix)[i1][j1] == 0. || !((*fmatrix)[i1][j1] == (*fmatrix)[i1][j1]) ){ |
if ( (*fnmat[i])[ii][j] == 0. || (*fmatrix)[i1][j1] == 0. || !((*fmatrix)[i1][j1] == (*fmatrix)[i1][j1]) ){ |
852 |
(*fmatrix)[i1][j1] = 0.; |
(*fmatrix)[i1][j1] = 1.; |
853 |
} else { |
} else { |
854 |
(*fmatrix)[i1][j1] /= (*fnmat[i])[ii][j]; |
(*fmatrix)[i1][j1] /= (*fnmat[i])[ii][j]; |
855 |
nonzero++; |
nonzero++; |
856 |
if ( i1 == 0 ) nonzero1++; |
if ( i1 == 0 ) nonzero1++; |
857 |
}; |
}; |
858 |
|
// if ( j>=94 && j <=96 && jj >=94 && jj<=96 ){ |
859 |
|
// mi = (ii*3) + j -94; |
860 |
|
// mj = (iij*3) + jj -94; |
861 |
|
// (*mymat)[mi][mj] = (*fmatrix)[i1][j1]; |
862 |
|
// }; |
863 |
|
|
864 |
|
|
865 |
|
if ( j>=84 && j <=106 && jj >=84 && jj<=106 ){ |
866 |
|
mi = (ii*3) + j -84; |
867 |
|
mj = (iij*3) + jj -84; |
868 |
|
(*mymat)[mi][mj] = (*fmatrix)[i1][j1]; |
869 |
|
}; |
870 |
|
|
871 |
}; |
}; |
872 |
}; |
}; |
873 |
}; |
}; |
919 |
printf(" Bin %i determinant is %f \n",i,det); |
printf(" Bin %i determinant is %f \n",i,det); |
920 |
cf->WriteInvertedFullMatrix((TMatrixF)invmatrix,i); |
cf->WriteInvertedFullMatrix((TMatrixF)invmatrix,i); |
921 |
}; |
}; |
922 |
|
|
923 |
|
if ( mymat->Determinant() == 0. ){ |
924 |
|
printf(" ERROR: the matrix at bin %i is singular, determinant = 0., it cannot be inverted! \n",i); |
925 |
|
} else { |
926 |
|
Double_t det = 0.; |
927 |
|
TMatrixF invmatrix = (TMatrixF)(mymat->Invert(&det)); |
928 |
|
printf(" Bin %i determinant is %f \n",i,det); |
929 |
|
cf->WriteInvertedFullMatrix((TMatrixF)invmatrix,i); |
930 |
|
}; |
931 |
|
cf->WriteFullMatrix(mymat, 99); |
932 |
|
|
933 |
|
|
934 |
// |
// |
935 |
cf->UnLoadFullMatrix(i); |
cf->UnLoadFullMatrix(i); |
936 |
// cf->UnLoadFullNMatrix(i); |
// cf->UnLoadFullNMatrix(i); |