20 m_kaliVector (m_numberOfElements) ,
21 m_kaliMatrix (evalX2Size ())
40 std::map<int,double>::const_iterator MapEnd ,
46 double inverror = 1./
sigma ;
48 for (std::map<int,double>::const_iterator itMap1 =MapBegin ;
53 for (std::map<int,double>::const_iterator itMap2 = itMap1 ;
58 double dummy = itMap1->second * itMap2->second;
67 dummy *= itMap1->second ;
88 bef = (
i*m_numberOfElements+
j);
89 aft = (
j*m_numberOfElements +
i);
121 CLHEP::HepVector
result = CLHEP::solve (kaliMatrix,kaliVector) ;
122 for (
int i = 0 ;
i < kaliVector.num_row () ; ++
i)
123 if (result.normsq () < min * kaliVector.num_row () ||
124 result.normsq () > max * kaliVector.num_row ())
126 if (usingBlockSolver)
134 for (
int i = 0 ;
i < kaliVector.num_row () ; ++
i)
159 CLHEP::HepMatrix & vuota)
163 assert (piena.size () == max *
max) ;
164 assert (vuota.num_row () == int(max)) ;
165 assert (vuota.num_col () == int(max)) ;
166 for (
unsigned int i = 0 ;
i <
max ; ++
i)
167 for (
unsigned int j = 0 ;
j <
max ; ++
j)
169 else vuota[
i][
j] = piena[
i*max +
j] ;
179 CLHEP::HepVector & vuoto)
183 assert (vuoto.num_row () ==
max) ;
184 for (
int i = 0 ;
i <
max ; ++
i)
186 else vuoto[
i] = pieno[
i] ;
199 for (std::vector<double>::iterator vecIt =
m_kaliVector.begin () ;
206 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
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