![]() |
![]() |
#include <MuonResidualsTwoBin.h>
Public Member Functions | |
double | antisym (int parNum) |
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< double * > ::const_iterator | residualsPos_begin () const |
std::vector< double * > ::const_iterator | residualsPos_end () const |
void | setPrintLevel (int printLevel) const |
void | setStrategy (int strategy) const |
double | stdev (int which, double truncate) |
double | sumofweights () |
int | type () 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] |
double MuonResidualsTwoBin::errorerror | ( | int | parNum | ) | [inline] |
Definition at line 60 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 35 of file MuonResidualsTwoBin.h.
References MuonResidualsFitter::fixed(), m_neg, and m_pos.
double MuonResidualsTwoBin::loglikelihood | ( | ) | [inline] |
Definition at line 66 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 126 of file MuonResidualsTwoBin.h.
References m_twoBin, n, csvReporter::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 111 of file MuonResidualsTwoBin.h.
References m_twoBin, csvReporter::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 69 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 77 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 201 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 213 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 227 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 228 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<double*>::const_iterator MuonResidualsTwoBin::residualsPos_begin | ( | ) | const [inline] |
Definition at line 225 of file MuonResidualsTwoBin.h.
References m_pos, and MuonResidualsFitter::residuals_begin().
Referenced by mean(), median(), stdev(), and wmean().
{ return m_pos->residuals_begin(); };
std::vector<double*>::const_iterator MuonResidualsTwoBin::residualsPos_end | ( | ) | const [inline] |
Definition at line 226 of file MuonResidualsTwoBin.h.
References m_pos, and MuonResidualsFitter::residuals_end().
Referenced by mean(), median(), stdev(), and wmean().
{ return m_pos->residuals_end(); };
void MuonResidualsTwoBin::setPrintLevel | ( | int | printLevel | ) | const [inline] |
Definition at line 39 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 44 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 176 of file MuonResidualsTwoBin.h.
References m_twoBin, n, funct::pow(), csvReporter::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 72 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] |
double MuonResidualsTwoBin::value | ( | int | parNum | ) | [inline] |
double MuonResidualsTwoBin::wmean | ( | int | which, |
int | whichredchi2, | ||
double | truncate | ||
) | [inline] |
Definition at line 148 of file MuonResidualsTwoBin.h.
References m_twoBin, n, csvReporter::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] |
MuonResidualsFitter * MuonResidualsTwoBin::m_neg [protected] |
Definition at line 232 of file MuonResidualsTwoBin.h.
Referenced by antisym(), errorerror(), fill(), fit(), fix(), fixed(), loglikelihood(), ndata(), npar(), numResidualsNeg(), numsegments(), plot(), plotsimple(), plotweighted(), read(), residualsModel(), residualsNeg_begin(), residualsNeg_end(), setPrintLevel(), setStrategy(), sumofweights(), type(), value(), write(), and ~MuonResidualsTwoBin().
MuonResidualsFitter* MuonResidualsTwoBin::m_pos [protected] |
Definition at line 232 of file MuonResidualsTwoBin.h.
Referenced by antisym(), errorerror(), fill(), fit(), fix(), fixed(), loglikelihood(), ndata(), npar(), numResidualsPos(), numsegments(), plot(), plotsimple(), plotweighted(), read(), residualsModel(), residualsPos_begin(), residualsPos_end(), setPrintLevel(), setStrategy(), sumofweights(), type(), value(), write(), and ~MuonResidualsTwoBin().
bool MuonResidualsTwoBin::m_twoBin [protected] |
Definition at line 228 of file MuonResidualsTwoBin.h.
Referenced by antisym(), errorerror(), fill(), fit(), loglikelihood(), mean(), median(), numsegments(), plot(), plotsimple(), plotweighted(), read(), stdev(), sumofweights(), value(), wmean(), and write().