#include <MuonResidualsTwoBin.h>
Public Member Functions | |
double | antisym (int parNum) |
void | correctBField () |
void | eraseNotSelectedResiduals () |
double | errorerror (int parNum) |
void | fill (char charge, double *residual) |
bool | fit (Alignable *ali) |
void | fix (int parNum, bool value=true) |
bool | fixed (int parNum) |
double | loglikelihood () |
double | mean (int which, double truncate) |
double | median (int which) |
MuonResidualsTwoBin (bool twoBin, MuonResidualsFitter *pos, MuonResidualsFitter *neg) | |
int | ndata () |
int | npar () |
long | numResidualsNeg () const |
long | numResidualsPos () const |
double | numsegments () |
double | plot (std::string name, TFileDirectory *dir, Alignable *ali) |
void | plotsimple (std::string name, TFileDirectory *dir, int which, double multiplier) |
void | plotweighted (std::string name, TFileDirectory *dir, int which, int whichredchi2, double multiplier) |
void | read (FILE *file, int which=0) |
int | residualsModel () const |
std::vector< double * > ::const_iterator | residualsNeg_begin () const |
std::vector< double * > ::const_iterator | residualsNeg_end () const |
std::vector< bool >::const_iterator | residualsNeg_ok_begin () const |
std::vector< bool >::const_iterator | residualsNeg_ok_end () const |
std::vector< double * > ::const_iterator | residualsPos_begin () const |
std::vector< double * > ::const_iterator | residualsPos_end () const |
std::vector< bool >::const_iterator | residualsPos_ok_begin () const |
std::vector< bool >::const_iterator | residualsPos_ok_end () const |
void | selectPeakResiduals (double nsigma, int nvar, int *vars) |
void | setPrintLevel (int printLevel) const |
void | setStrategy (int strategy) const |
double | stdev (int which, double truncate) |
double | sumofweights () |
int | type () const |
int | useRes () const |
double | value (int parNum) |
double | wmean (int which, int whichredchi2, double truncate) |
void | write (FILE *file, int which=0) |
~MuonResidualsTwoBin () | |
Protected Attributes | |
MuonResidualsFitter * | m_neg |
MuonResidualsFitter * | m_pos |
bool | m_twoBin |
MuonResidualsTwoBin::MuonResidualsTwoBin | ( | bool | twoBin, |
MuonResidualsFitter * | pos, | ||
MuonResidualsFitter * | neg | ||
) | [inline] |
MuonResidualsTwoBin::~MuonResidualsTwoBin | ( | ) | [inline] |
double MuonResidualsTwoBin::antisym | ( | int | parNum | ) | [inline] |
void MuonResidualsTwoBin::correctBField | ( | ) | [inline] |
Definition at line 237 of file MuonResidualsTwoBin.h.
References MuonResidualsFitter::correctBField(), and m_pos.
Referenced by MuonAlignmentFromReference::correctBField().
{ m_pos->correctBField(); //if (m_twoBin) m_neg->correctBField(); };
void MuonResidualsTwoBin::eraseNotSelectedResiduals | ( | ) | [inline] |
Definition at line 243 of file MuonResidualsTwoBin.h.
References MuonResidualsFitter::eraseNotSelectedResiduals(), m_neg, m_pos, and m_twoBin.
Referenced by MuonAlignmentFromReference::eraseNotSelectedResiduals().
{ if (m_twoBin) { m_pos->eraseNotSelectedResiduals(); m_neg->eraseNotSelectedResiduals(); } else { m_pos->eraseNotSelectedResiduals(); } }
double MuonResidualsTwoBin::errorerror | ( | int | parNum | ) | [inline] |
Definition at line 61 of file MuonResidualsTwoBin.h.
References MuonResidualsFitter::errorerror(), m_neg, m_pos, m_twoBin, funct::pow(), and mathSSE::sqrt().
{ return (m_twoBin ? (sqrt(pow(m_pos->errorerror(parNum), 2.) + pow(m_neg->errorerror(parNum), 2.)) / 2.) : m_pos->errorerror(parNum)); };
void MuonResidualsTwoBin::fill | ( | char | charge, |
double * | residual | ||
) | [inline] |
bool MuonResidualsTwoBin::fit | ( | Alignable * | ali | ) | [inline] |
void MuonResidualsTwoBin::fix | ( | int | parNum, |
bool | value = true |
||
) | [inline] |
bool MuonResidualsTwoBin::fixed | ( | int | parNum | ) | [inline] |
Definition at line 36 of file MuonResidualsTwoBin.h.
References MuonResidualsFitter::fixed(), m_neg, and m_pos.
double MuonResidualsTwoBin::loglikelihood | ( | ) | [inline] |
Definition at line 67 of file MuonResidualsTwoBin.h.
References MuonResidualsFitter::loglikelihood(), m_neg, m_pos, and m_twoBin.
{ return (m_twoBin ? (m_pos->loglikelihood() + m_neg->loglikelihood()) : m_pos->loglikelihood()); };
double MuonResidualsTwoBin::mean | ( | int | which, |
double | truncate | ||
) | [inline] |
Definition at line 127 of file MuonResidualsTwoBin.h.
References m_twoBin, n, alignCSCRings::r, residualsNeg_begin(), residualsNeg_end(), residualsPos_begin(), residualsPos_end(), and value().
{ double sum = 0.; double n = 0.; for (std::vector<double*>::const_iterator r = residualsPos_begin(); r != residualsPos_end(); ++r) { double value = (*r)[which]; if (fabs(value) < truncate) { sum += value; n += 1.; } } if (m_twoBin) { for (std::vector<double*>::const_iterator r = residualsNeg_begin(); r != residualsNeg_end(); ++r) { double value = (*r)[which]; if (fabs(value) < truncate) { sum += value; n += 1.; } } } return sum/n; };
double MuonResidualsTwoBin::median | ( | int | which | ) | [inline] |
Definition at line 112 of file MuonResidualsTwoBin.h.
References m_twoBin, alignCSCRings::r, residualsNeg_begin(), residualsNeg_end(), residualsPos_begin(), residualsPos_end(), and python::multivaluedict::sort().
{ std::vector<double> residuals; for (std::vector<double*>::const_iterator r = residualsPos_begin(); r != residualsPos_end(); ++r) { residuals.push_back((*r)[which]); } if (m_twoBin) { for (std::vector<double*>::const_iterator r = residualsNeg_begin(); r != residualsNeg_end(); ++r) { residuals.push_back((*r)[which]); } } std::sort(residuals.begin(), residuals.end()); int length = residuals.size(); return residuals[length/2]; };
int MuonResidualsTwoBin::ndata | ( | ) | [inline] |
int MuonResidualsTwoBin::npar | ( | ) | [inline] |
long MuonResidualsTwoBin::numResidualsNeg | ( | ) | const [inline] |
Definition at line 25 of file MuonResidualsTwoBin.h.
References m_neg, and MuonResidualsFitter::numResiduals().
{ return m_neg->numResiduals(); };
long MuonResidualsTwoBin::numResidualsPos | ( | ) | const [inline] |
Definition at line 24 of file MuonResidualsTwoBin.h.
References m_pos, and MuonResidualsFitter::numResiduals().
{ return m_pos->numResiduals(); };
double MuonResidualsTwoBin::numsegments | ( | ) | [inline] |
Definition at line 70 of file MuonResidualsTwoBin.h.
References m_neg, m_pos, m_twoBin, and MuonResidualsFitter::numsegments().
{ return (m_twoBin ? (m_pos->numsegments() + m_neg->numsegments()) : m_pos->numsegments()); };
double MuonResidualsTwoBin::plot | ( | std::string | name, |
TFileDirectory * | dir, | ||
Alignable * | ali | ||
) | [inline] |
Definition at line 78 of file MuonResidualsTwoBin.h.
References m_neg, m_pos, m_twoBin, convertSQLitetoXML_cfg::output, and MuonResidualsFitter::plot().
void MuonResidualsTwoBin::plotsimple | ( | std::string | name, |
TFileDirectory * | dir, | ||
int | which, | ||
double | multiplier | ||
) | [inline] |
Definition at line 202 of file MuonResidualsTwoBin.h.
References m_neg, m_pos, m_twoBin, and MuonResidualsFitter::plotsimple().
{ if (m_twoBin) { std::string namePos = name + std::string("Pos"); std::string nameNeg = name + std::string("Neg"); m_pos->plotsimple(namePos, dir, which, multiplier); m_neg->plotsimple(nameNeg, dir, which, multiplier); } else { m_pos->plotsimple(name, dir, which, multiplier); } };
void MuonResidualsTwoBin::plotweighted | ( | std::string | name, |
TFileDirectory * | dir, | ||
int | which, | ||
int | whichredchi2, | ||
double | multiplier | ||
) | [inline] |
Definition at line 214 of file MuonResidualsTwoBin.h.
References m_neg, m_pos, m_twoBin, and MuonResidualsFitter::plotweighted().
{ if (m_twoBin) { std::string namePos = name + std::string("Pos"); std::string nameNeg = name + std::string("Neg"); m_pos->plotweighted(namePos, dir, which, whichredchi2, multiplier); m_neg->plotweighted(nameNeg, dir, which, whichredchi2, multiplier); } else { m_pos->plotweighted(name, dir, which, whichredchi2, multiplier); } };
void MuonResidualsTwoBin::read | ( | FILE * | file, |
int | which = 0 |
||
) | [inline] |
int MuonResidualsTwoBin::residualsModel | ( | ) | const [inline] |
Definition at line 23 of file MuonResidualsTwoBin.h.
References m_neg, m_pos, and MuonResidualsFitter::residualsModel().
{ assert(m_pos->residualsModel() == m_neg->residualsModel()); return m_pos->residualsModel(); };
std::vector<double*>::const_iterator MuonResidualsTwoBin::residualsNeg_begin | ( | ) | const [inline] |
Definition at line 256 of file MuonResidualsTwoBin.h.
References m_neg, and MuonResidualsFitter::residuals_begin().
Referenced by mean(), median(), stdev(), and wmean().
{ return m_neg->residuals_begin(); };
std::vector<double*>::const_iterator MuonResidualsTwoBin::residualsNeg_end | ( | ) | const [inline] |
Definition at line 257 of file MuonResidualsTwoBin.h.
References m_neg, and MuonResidualsFitter::residuals_end().
Referenced by mean(), median(), stdev(), and wmean().
{ return m_neg->residuals_end(); };
std::vector<bool>::const_iterator MuonResidualsTwoBin::residualsNeg_ok_begin | ( | ) | const [inline] |
Definition at line 261 of file MuonResidualsTwoBin.h.
References m_neg, and MuonResidualsFitter::selectedResidualsFlags().
{ return m_neg->selectedResidualsFlags().begin(); };
std::vector<bool>::const_iterator MuonResidualsTwoBin::residualsNeg_ok_end | ( | ) | const [inline] |
Definition at line 262 of file MuonResidualsTwoBin.h.
References m_neg, and MuonResidualsFitter::selectedResidualsFlags().
{ return m_neg->selectedResidualsFlags().end(); };
std::vector<double*>::const_iterator MuonResidualsTwoBin::residualsPos_begin | ( | ) | const [inline] |
Definition at line 254 of file MuonResidualsTwoBin.h.
References m_pos, and MuonResidualsFitter::residuals_begin().
Referenced by MuonAlignmentFromReference::fillNtuple(), mean(), median(), stdev(), and wmean().
{ return m_pos->residuals_begin(); };
std::vector<double*>::const_iterator MuonResidualsTwoBin::residualsPos_end | ( | ) | const [inline] |
Definition at line 255 of file MuonResidualsTwoBin.h.
References m_pos, and MuonResidualsFitter::residuals_end().
Referenced by MuonAlignmentFromReference::fillNtuple(), mean(), median(), stdev(), and wmean().
{ return m_pos->residuals_end(); };
std::vector<bool>::const_iterator MuonResidualsTwoBin::residualsPos_ok_begin | ( | ) | const [inline] |
Definition at line 259 of file MuonResidualsTwoBin.h.
References m_pos, and MuonResidualsFitter::selectedResidualsFlags().
Referenced by MuonAlignmentFromReference::fillNtuple().
{ return m_pos->selectedResidualsFlags().begin(); };
std::vector<bool>::const_iterator MuonResidualsTwoBin::residualsPos_ok_end | ( | ) | const [inline] |
Definition at line 260 of file MuonResidualsTwoBin.h.
References m_pos, and MuonResidualsFitter::selectedResidualsFlags().
{ return m_pos->selectedResidualsFlags().end(); };
void MuonResidualsTwoBin::selectPeakResiduals | ( | double | nsigma, |
int | nvar, | ||
int * | vars | ||
) | [inline] |
Definition at line 226 of file MuonResidualsTwoBin.h.
References m_neg, m_pos, m_twoBin, and MuonResidualsFitter::selectPeakResiduals().
Referenced by MuonAlignmentFromReference::selectResidualsPeaks().
{ if (m_twoBin) { m_pos->selectPeakResiduals(nsigma, nvar, vars); m_neg->selectPeakResiduals(nsigma, nvar, vars); } else { m_pos->selectPeakResiduals(nsigma, nvar, vars); } }
void MuonResidualsTwoBin::setPrintLevel | ( | int | printLevel | ) | const [inline] |
Definition at line 40 of file MuonResidualsTwoBin.h.
References m_neg, m_pos, and MuonResidualsFitter::setPrintLevel().
{ m_pos->setPrintLevel(printLevel); m_neg->setPrintLevel(printLevel); }
void MuonResidualsTwoBin::setStrategy | ( | int | strategy | ) | const [inline] |
Definition at line 45 of file MuonResidualsTwoBin.h.
References m_neg, m_pos, and MuonResidualsFitter::setStrategy().
{ m_pos->setStrategy(strategy); m_neg->setStrategy(strategy); }
double MuonResidualsTwoBin::stdev | ( | int | which, |
double | truncate | ||
) | [inline] |
Definition at line 177 of file MuonResidualsTwoBin.h.
References m_twoBin, n, funct::pow(), alignCSCRings::r, residualsNeg_begin(), residualsNeg_end(), residualsPos_begin(), residualsPos_end(), mathSSE::sqrt(), and value().
{ double sum2 = 0.; double sum = 0.; double n = 0.; for (std::vector<double*>::const_iterator r = residualsPos_begin(); r != residualsPos_end(); ++r) { double value = (*r)[which]; if (fabs(value) < truncate) { sum2 += value*value; sum += value; n += 1.; } } if (m_twoBin) { for (std::vector<double*>::const_iterator r = residualsNeg_begin(); r != residualsNeg_end(); ++r) { double value = (*r)[which]; if (fabs(value) < truncate) { sum2 += value*value; sum += value; n += 1.; } } } return sqrt(sum2/n - pow(sum/n, 2)); };
double MuonResidualsTwoBin::sumofweights | ( | ) | [inline] |
Definition at line 73 of file MuonResidualsTwoBin.h.
References m_neg, m_pos, m_twoBin, and MuonResidualsFitter::sumofweights().
{ return (m_twoBin ? (m_pos->sumofweights() + m_neg->sumofweights()) : m_pos->sumofweights()); };
int MuonResidualsTwoBin::type | ( | ) | const [inline] |
Definition at line 28 of file MuonResidualsTwoBin.h.
References m_neg, m_pos, and MuonResidualsFitter::type().
Referenced by MuonAlignmentFromReference::fillNtuple(), and MuonAlignmentFromReference::selectResidualsPeaks().
int MuonResidualsTwoBin::useRes | ( | ) | const [inline] |
Definition at line 29 of file MuonResidualsTwoBin.h.
References m_pos, and MuonResidualsFitter::useRes().
Referenced by MuonAlignmentFromReference::selectResidualsPeaks().
double MuonResidualsTwoBin::value | ( | int | parNum | ) | [inline] |
double MuonResidualsTwoBin::wmean | ( | int | which, |
int | whichredchi2, | ||
double | truncate | ||
) | [inline] |
Definition at line 149 of file MuonResidualsTwoBin.h.
References m_twoBin, n, alignCSCRings::r, residualsNeg_begin(), residualsNeg_end(), residualsPos_begin(), residualsPos_end(), value(), and CommonMethods::weight().
{ double sum = 0.; double n = 0.; for (std::vector<double*>::const_iterator r = residualsPos_begin(); r != residualsPos_end(); ++r) { double value = (*r)[which]; if (fabs(value) < truncate) { double weight = 1./(*r)[whichredchi2]; if (TMath::Prob(1./weight*12, 12) < 0.99) { sum += weight*value; n += weight; } } } if (m_twoBin) { for (std::vector<double*>::const_iterator r = residualsNeg_begin(); r != residualsNeg_end(); ++r) { double value = (*r)[which]; if (fabs(value) < truncate) { double weight = 1./(*r)[whichredchi2]; if (TMath::Prob(1./weight*12, 12) < 0.99) { sum += weight*value; n += weight; } } } } return sum/n; };
void MuonResidualsTwoBin::write | ( | FILE * | file, |
int | which = 0 |
||
) | [inline] |
Definition at line 93 of file MuonResidualsTwoBin.h.
References m_neg, m_pos, m_twoBin, and MuonResidualsFitter::write().
Referenced by MuonAlignmentFromReference::writeTmpFiles().
MuonResidualsFitter * MuonResidualsTwoBin::m_neg [protected] |
Definition at line 266 of file MuonResidualsTwoBin.h.
Referenced by antisym(), eraseNotSelectedResiduals(), errorerror(), fill(), fit(), fix(), fixed(), loglikelihood(), ndata(), npar(), numResidualsNeg(), numsegments(), plot(), plotsimple(), plotweighted(), read(), residualsModel(), residualsNeg_begin(), residualsNeg_end(), residualsNeg_ok_begin(), residualsNeg_ok_end(), selectPeakResiduals(), setPrintLevel(), setStrategy(), sumofweights(), type(), value(), write(), and ~MuonResidualsTwoBin().
MuonResidualsFitter* MuonResidualsTwoBin::m_pos [protected] |
Definition at line 266 of file MuonResidualsTwoBin.h.
Referenced by antisym(), correctBField(), eraseNotSelectedResiduals(), errorerror(), fill(), fit(), fix(), fixed(), loglikelihood(), ndata(), npar(), numResidualsPos(), numsegments(), plot(), plotsimple(), plotweighted(), read(), residualsModel(), residualsPos_begin(), residualsPos_end(), residualsPos_ok_begin(), residualsPos_ok_end(), selectPeakResiduals(), setPrintLevel(), setStrategy(), sumofweights(), type(), useRes(), value(), write(), and ~MuonResidualsTwoBin().
bool MuonResidualsTwoBin::m_twoBin [protected] |
Definition at line 262 of file MuonResidualsTwoBin.h.
Referenced by antisym(), eraseNotSelectedResiduals(), errorerror(), fill(), fit(), loglikelihood(), mean(), median(), numsegments(), plot(), plotsimple(), plotweighted(), read(), selectPeakResiduals(), stdev(), sumofweights(), value(), wmean(), and write().