21 m_kaliVector (m_numberOfElements) ,
22 m_kaliMatrix (evalX2Size ())
41 std::map<int,double>::const_iterator MapEnd ,
47 double inverror = 1./sigma ;
49 for (std::map<int,double>::const_iterator itMap1 =MapBegin ;
54 for (std::map<int,double>::const_iterator itMap2 = itMap1 ;
59 double dummy = itMap1->second * itMap2->second;
68 dummy *= itMap1->second ;
89 bef = (
i*m_numberOfElements+
j);
90 aft = (
j*m_numberOfElements +
i);
122 CLHEP::HepVector
result = CLHEP::solve (kaliMatrix,kaliVector) ;
123 for (
int i = 0 ;
i < kaliVector.num_row () ; ++
i)
124 if (result.normsq () < min * kaliVector.num_row () ||
125 result.normsq () > max * kaliVector.num_row ())
127 if (usingBlockSolver)
135 for (
int i = 0 ;
i < kaliVector.num_row () ; ++
i)
160 CLHEP::HepMatrix & vuota)
164 assert (piena.size () == max *
max) ;
165 assert (vuota.num_row () == int(max)) ;
166 assert (vuota.num_col () == int(max)) ;
167 for (
unsigned int i = 0 ;
i <
max ; ++
i)
168 for (
unsigned int j = 0 ;
j <
max ; ++
j)
170 else vuota[
i][
j] = piena[
i*max +
j] ;
180 CLHEP::HepVector & vuoto)
184 assert (vuoto.num_row () ==
max) ;
185 for (
int i = 0 ;
i <
max ; ++
i)
187 else vuoto[
i] = pieno[
i] ;
200 for (std::vector<double>::iterator vecIt =
m_kaliVector.begin () ;
207 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