17 m_kaliVector (m_numberOfElements) ,
18 m_kaliMatrix (evalX2Size ())
37 std::map<int,double>::const_iterator MapEnd ,
43 double inverror = 1./sigma ;
45 for (std::map<int,double>::const_iterator itMap1 =MapBegin ;
50 for (std::map<int,double>::const_iterator itMap2 = itMap1 ;
55 double dummy = itMap1->second * itMap2->second;
64 dummy *= itMap1->second ;
85 bef = (
i*m_numberOfElements+
j);
86 aft = (
j*m_numberOfElements +
i);
118 CLHEP::HepVector
result = CLHEP::solve (kaliMatrix,kaliVector) ;
119 for (
int i = 0 ;
i < kaliVector.num_row () ; ++
i)
120 if (result.normsq () < min * kaliVector.num_row () ||
121 result.normsq () > max * kaliVector.num_row ())
123 if (usingBlockSolver)
131 for (
int i = 0 ;
i < kaliVector.num_row () ; ++
i)
156 CLHEP::HepMatrix & vuota)
160 assert (piena.size () == max *
max) ;
161 assert (vuota.num_row () == int(max)) ;
162 assert (vuota.num_col () == int(max)) ;
163 for (
unsigned int i = 0 ;
i <
max ; ++
i)
164 for (
unsigned int j = 0 ;
j <
max ; ++
j)
166 else vuota[
i][
j] = piena[
i*max +
j] ;
176 CLHEP::HepVector & vuoto)
180 assert (vuoto.num_row () ==
max) ;
181 for (
int i = 0 ;
i <
max ; ++
i)
183 else vuoto[
i] = pieno[
i] ;
196 for (std::vector<double>::iterator vecIt =
m_kaliVector.begin () ;
203 for (std::vector<double>::iterator vecIt =
m_kaliMatrix.begin () ;
IMACalibBlock(const int)
ctor
void Fill(std::map< int, double >::const_iterator, std::map< int, double >::const_iterator, double pTk, double pSubtract, double sigma=1.)
insert an entry
element for the single ECAL block intercalibration
std::vector< double > m_kaliVector
vector for the chi2 inversion
void riempiMtr(const std::vector< double > &piena, CLHEP::HepMatrix &vuota)
copy a vector into a CLHEP object
const T & max(const T &a, const T &b)
std::vector< double > m_kaliMatrix
matrix for the chi2 inversion
void riempiVtr(const std::vector< double > &pieno, CLHEP::HepVector &vuoto)
copy a vector into a CLHEP object
int evalX2Size()
give the size of a chi2 matrix
solves at best the matrix invertion for calibration
int solve(int usingBlockSolver, double min, double max)
solve the chi2 linear system
std::map< unsigned int, float > m_coefficients
map of coefficients
void reset()
reset the chi2 matrices
return(e1-e2)*(e1-e2)+dp *dp
unsigned int m_numberOfElements
The only parameter!
void fillMap(const CLHEP::HepVector &result)
fill the coefficients map from the CLHEP vector solution
void complete()
complete the triangolar chi2 matrix to a sym one