#include <MuonResidualsFitter.h>
Public Types | |
enum | { kPureGaussian, kPowerLawTails, kROOTVoigt, kGaussPowerTails } |
enum | { k1DOF, k5DOF, k6DOF, k6DOFrphi, kPositionFitter, kAngleFitter, kAngleBfieldFitter } |
Public Member Functions | |
double | errorerror (int parNum) |
void | fill (double *residual) |
virtual bool | fit (Alignable *ali)=0 |
void | fix (int parNum, bool value=true) |
bool | fixed (int parNum) |
double | loglikelihood () |
MuonResidualsFitter (int residualsModel, int minHits, bool weightAlignment=true) | |
virtual int | ndata ()=0 |
virtual int | npar ()=0 |
long | numResiduals () const |
long | numsegments () |
virtual double | plot (std::string name, TFileDirectory *dir, Alignable *ali)=0 |
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) |
std::vector< double * > ::const_iterator | residuals_begin () const |
std::vector< double * > ::const_iterator | residuals_end () const |
int | residualsModel () const |
void | setPrintLevel (int printLevel) |
void | setStrategy (int strategy) |
virtual double | sumofweights ()=0 |
virtual int | type () const =0 |
double | value (int parNum) |
void | write (FILE *file, int which=0) |
virtual | ~MuonResidualsFitter () |
Protected Member Functions | |
bool | dofit (void(*fcn)(int &, double *, double &, double *, int), std::vector< int > &parNum, std::vector< std::string > &parName, std::vector< double > &start, std::vector< double > &step, std::vector< double > &low, std::vector< double > &high) |
virtual void | inform (TMinuit *tMinuit)=0 |
void | initialize_table () |
Protected Attributes | |
std::vector< double > | m_error |
std::vector< bool > | m_fixed |
double | m_loglikelihood |
int | m_minHits |
int | m_printLevel |
std::vector< double * > | m_residuals |
int | m_residualsModel |
int | m_strategy |
std::vector< double > | m_value |
bool | m_weightAlignment |
anonymous enum |
Definition at line 29 of file MuonResidualsFitter.h.
anonymous enum |
Definition at line 36 of file MuonResidualsFitter.h.
MuonResidualsFitter::MuonResidualsFitter | ( | int | residualsModel, |
int | minHits, | ||
bool | weightAlignment = true |
||
) | [inline] |
Definition at line 46 of file MuonResidualsFitter.h.
References Exception, kGaussPowerTails, kPowerLawTails, kPureGaussian, kROOTVoigt, and m_residualsModel.
: m_residualsModel(residualsModel), m_minHits(minHits), m_weightAlignment(weightAlignment), m_printLevel(0), m_strategy(2), m_loglikelihood(0.) { if (m_residualsModel != kPureGaussian && m_residualsModel != kPowerLawTails && m_residualsModel != kROOTVoigt && m_residualsModel != kGaussPowerTails) throw cms::Exception("MuonResidualsFitter") << "unrecognized residualsModel"; };
virtual MuonResidualsFitter::~MuonResidualsFitter | ( | ) | [inline, virtual] |
Definition at line 51 of file MuonResidualsFitter.h.
References residuals_begin(), and residuals_end().
{ for (std::vector<double*>::const_iterator residual = residuals_begin(); residual != residuals_end(); ++residual) { delete [] (*residual); } };
bool MuonResidualsFitter::dofit | ( | void(*)(int &, double *, double &, double *, int) | fcn, |
std::vector< int > & | parNum, | ||
std::vector< std::string > & | parName, | ||
std::vector< double > & | start, | ||
std::vector< double > & | step, | ||
std::vector< double > & | low, | ||
std::vector< double > & | high | ||
) | [protected] |
Definition at line 192 of file MuonResidualsFitter.cc.
References fitWZ::arglist, ExpressReco_HICollisions_FallBack::e, fcn(), fixed(), i, inform(), m_error, m_loglikelihood, m_printLevel, m_strategy, m_value, MuonResidualsFitter_TMinuit, npar(), and v.
Referenced by MuonResiduals6DOFFitter::fit(), MuonResiduals6DOFrphiFitter::fit(), MuonResiduals5DOFFitter::fit(), MuonResidualsPositionFitter::fit(), MuonResidualsBfieldAngleFitter::fit(), MuonResiduals1DOFFitter::fit(), and MuonResidualsAngleFitter::fit().
{ MuonResidualsFitterFitInfo *fitinfo = new MuonResidualsFitterFitInfo(this); MuonResidualsFitter_TMinuit = new TMinuit(npar()); MuonResidualsFitter_TMinuit->SetPrintLevel(m_printLevel); MuonResidualsFitter_TMinuit->SetObjectFit(fitinfo); MuonResidualsFitter_TMinuit->SetFCN(fcn); inform(MuonResidualsFitter_TMinuit); std::vector<int>::const_iterator iNum = parNum.begin(); std::vector<std::string>::const_iterator iName = parName.begin(); std::vector<double>::const_iterator istart = start.begin(); std::vector<double>::const_iterator istep = step.begin(); std::vector<double>::const_iterator ilow = low.begin(); std::vector<double>::const_iterator ihigh = high.begin(); for (; iNum != parNum.end(); ++iNum, ++iName, ++istart, ++istep, ++ilow, ++ihigh) { MuonResidualsFitter_TMinuit->DefineParameter(*iNum, iName->c_str(), *istart, *istep, *ilow, *ihigh); if (fixed(*iNum)) MuonResidualsFitter_TMinuit->FixParameter(*iNum); } double arglist[10]; int ierflg; int smierflg; //second MIGRAD ierflg // chi^2 errors should be 1.0, log-likelihood should be 0.5 for (int i = 0; i < 10; i++) arglist[i] = 0.; arglist[0] = 0.5; ierflg = 0; smierflg = 0; MuonResidualsFitter_TMinuit->mnexcm("SET ERR", arglist, 1, ierflg); if (ierflg != 0) { delete MuonResidualsFitter_TMinuit; delete fitinfo; return false; } // set strategy = 2 (more refined fits) for (int i = 0; i < 10; i++) arglist[i] = 0.; arglist[0] = m_strategy; ierflg = 0; MuonResidualsFitter_TMinuit->mnexcm("SET STR", arglist, 1, ierflg); if (ierflg != 0) { delete MuonResidualsFitter_TMinuit; delete fitinfo; return false; } bool try_again = false; // minimize for (int i = 0; i < 10; i++) arglist[i] = 0.; arglist[0] = 50000; ierflg = 0; MuonResidualsFitter_TMinuit->mnexcm("MIGRAD", arglist, 1, ierflg); if (ierflg != 0) try_again = true; // just once more, if needed (using the final Minuit parameters from the failed fit; often works) if (try_again) { // minimize for (int i = 0; i < 10; i++) arglist[i] = 0.; arglist[0] = 50000; MuonResidualsFitter_TMinuit->mnexcm("MIGRAD", arglist, 1, smierflg); } Double_t fmin, fedm, errdef; Int_t npari, nparx, istat; MuonResidualsFitter_TMinuit->mnstat(fmin, fedm, errdef, npari, nparx, istat); if (istat != 3) { for (int i = 0; i < 10; i++) arglist[i] = 0.; ierflg = 0; MuonResidualsFitter_TMinuit->mnexcm("HESSE", arglist, 0, ierflg); } // read-out the results m_loglikelihood = -fmin; m_value.clear(); m_error.clear(); for (int i = 0; i < npar(); i++) { double v, e; MuonResidualsFitter_TMinuit->GetParameter(i, v, e); m_value.push_back(v); m_error.push_back(e); } delete MuonResidualsFitter_TMinuit; delete fitinfo; if (smierflg != 0) return false; return true; }
double MuonResidualsFitter::errorerror | ( | int | parNum | ) | [inline] |
Definition at line 93 of file MuonResidualsFitter.h.
References m_error, and npar().
Referenced by MuonResidualsTwoBin::errorerror().
void MuonResidualsFitter::fill | ( | double * | residual | ) | [inline] |
Definition at line 85 of file MuonResidualsFitter.h.
References m_residuals.
Referenced by MuonResidualsTwoBin::fill(), and read().
{ m_residuals.push_back(residual); };
virtual bool MuonResidualsFitter::fit | ( | Alignable * | ali | ) | [pure virtual] |
void MuonResidualsFitter::fix | ( | int | parNum, |
bool | value = true |
||
) | [inline] |
Definition at line 64 of file MuonResidualsFitter.h.
References i, m_fixed, npar(), and value().
Referenced by MuonResidualsTwoBin::fix().
bool MuonResidualsFitter::fixed | ( | int | parNum | ) | [inline] |
Definition at line 74 of file MuonResidualsFitter.h.
References m_fixed, and npar().
Referenced by dofit(), MuonResiduals6DOFFitter::fit(), MuonResiduals6DOFrphiFitter::fit(), MuonResiduals5DOFFitter::fit(), MuonResiduals1DOFFitter::fit(), and MuonResidualsTwoBin::fixed().
virtual void MuonResidualsFitter::inform | ( | TMinuit * | tMinuit | ) | [protected, pure virtual] |
Implemented in MuonResiduals1DOFFitter, MuonResiduals5DOFFitter, MuonResiduals6DOFFitter, MuonResiduals6DOFrphiFitter, MuonResidualsAngleFitter, MuonResidualsBfieldAngleFitter, and MuonResidualsPositionFitter.
Referenced by dofit().
void MuonResidualsFitter::initialize_table | ( | ) | [protected] |
Definition at line 120 of file MuonResidualsFitter.cc.
References gather_cfg::cout, Exception, kPowerLawTails, MuonResidualsFitter_compute_log_convolution(), MuonResidualsFitter_gsbinsize, MuonResidualsFitter_lookup_table, MuonResidualsFitter_numgsbins, MuonResidualsFitter_numtsbins, MuonResidualsFitter_table_initialized, MuonResidualsFitter_tsbinsize, residualsModel(), and value().
Referenced by MuonResiduals6DOFFitter::fit(), MuonResiduals5DOFFitter::fit(), MuonResiduals6DOFrphiFitter::fit(), MuonResidualsPositionFitter::fit(), MuonResidualsBfieldAngleFitter::fit(), MuonResiduals1DOFFitter::fit(), and MuonResidualsAngleFitter::fit().
{ if (MuonResidualsFitter_table_initialized || residualsModel() != kPowerLawTails) return; MuonResidualsFitter_table_initialized = true; std::ifstream convolution_table("convolution_table.txt"); if (convolution_table.is_open()) { int numgsbins = 0; int numtsbins = 0; double tsbinsize = 0.; double gsbinsize = 0.; convolution_table >> numgsbins >> numtsbins >> tsbinsize >> gsbinsize; if (numgsbins != MuonResidualsFitter_numgsbins || numtsbins != MuonResidualsFitter_numtsbins || tsbinsize != MuonResidualsFitter_tsbinsize || gsbinsize != MuonResidualsFitter_gsbinsize) { throw cms::Exception("MuonResidualsFitter") << "convolution_table.txt has the wrong bin width/bin size. Throw it away and let the fitter re-create the file." << std::endl; } for (int gsbin = 0; gsbin < MuonResidualsFitter_numgsbins; gsbin++) { for (int tsbin = 0; tsbin < MuonResidualsFitter_numtsbins; tsbin++) { int read_gsbin = 0; int read_tsbin = 0; double value = 0.; convolution_table >> read_gsbin >> read_tsbin >> value; if (read_gsbin != gsbin || read_tsbin != tsbin) { throw cms::Exception("MuonResidualsFitter") << "convolution_table.txt is out of order. Throw it away and let the fitter re-create the file." << std::endl; } MuonResidualsFitter_lookup_table[gsbin][tsbin] = value; } } convolution_table.close(); } else { std::ofstream convolution_table2("convolution_table.txt"); if (!convolution_table2.is_open()) { throw cms::Exception("MuonResidualsFitter") << "Couldn't write to file convolution_table.txt" << std::endl; } convolution_table2 << MuonResidualsFitter_numgsbins << " " << MuonResidualsFitter_numtsbins << " " << MuonResidualsFitter_tsbinsize << " " << MuonResidualsFitter_gsbinsize << std::endl; edm::LogWarning("MuonResidualsFitter") << "Initializing convolution look-up table (takes a few minutes)..." << std::endl; std::cout << "Initializing convolution look-up table (takes a few minutes)..." << std::endl; for (int gsbin = 0; gsbin < MuonResidualsFitter_numgsbins; gsbin++) { double gammaoversigma = double(gsbin) * MuonResidualsFitter_gsbinsize; std::cout << " gsbin " << gsbin << "/" << MuonResidualsFitter_numgsbins << std::endl; for (int tsbin = 0; tsbin < MuonResidualsFitter_numtsbins; tsbin++) { double toversigma = double(tsbin) * MuonResidualsFitter_tsbinsize; // 1e-6 errors (out of a value of ~0.01) with max=100, step=0.001, power=4 (max=1000 does a little better with the tails) MuonResidualsFitter_lookup_table[gsbin][tsbin] = MuonResidualsFitter_compute_log_convolution(toversigma, gammaoversigma); // <10% errors with max=20, step=0.005, power=4 (faster computation for testing) // MuonResidualsFitter_lookup_table[gsbin][tsbin] = MuonResidualsFitter_compute_log_convolution(toversigma, gammaoversigma, 100., 0.005, 4.); convolution_table2 << gsbin << " " << tsbin << " " << MuonResidualsFitter_lookup_table[gsbin][tsbin] << std::endl; } } convolution_table2.close(); edm::LogWarning("MuonResidualsFitter") << "Initialization done!" << std::endl; std::cout << "Initialization done!" << std::endl; } }
double MuonResidualsFitter::loglikelihood | ( | ) | [inline] |
Definition at line 94 of file MuonResidualsFitter.h.
References m_loglikelihood.
Referenced by MuonResidualsTwoBin::loglikelihood().
{ return m_loglikelihood; };
virtual int MuonResidualsFitter::ndata | ( | ) | [pure virtual] |
Implemented in MuonResiduals1DOFFitter, MuonResiduals5DOFFitter, MuonResiduals6DOFFitter, MuonResiduals6DOFrphiFitter, MuonResidualsAngleFitter, MuonResidualsBfieldAngleFitter, and MuonResidualsPositionFitter.
Referenced by MuonResidualsTwoBin::ndata(), read(), and write().
virtual int MuonResidualsFitter::npar | ( | ) | [pure virtual] |
Implemented in MuonResiduals1DOFFitter, MuonResiduals5DOFFitter, MuonResiduals6DOFFitter, MuonResiduals6DOFrphiFitter, MuonResidualsAngleFitter, MuonResidualsBfieldAngleFitter, and MuonResidualsPositionFitter.
Referenced by dofit(), errorerror(), fix(), fixed(), MuonResidualsTwoBin::npar(), and value().
long MuonResidualsFitter::numResiduals | ( | ) | const [inline] |
Definition at line 60 of file MuonResidualsFitter.h.
References m_residuals.
Referenced by MuonResidualsTwoBin::numResidualsNeg(), MuonResidualsTwoBin::numResidualsPos(), MuonResidualsBfieldAngleFitter::plot(), MuonResidualsPositionFitter::plot(), MuonResidualsAngleFitter::plot(), MuonResidualsAngleFitter::sumofweights(), MuonResidualsPositionFitter::sumofweights(), MuonResidualsBfieldAngleFitter::sumofweights(), and write().
{ return m_residuals.size(); };
long MuonResidualsFitter::numsegments | ( | ) | [inline] |
Definition at line 95 of file MuonResidualsFitter.h.
References residuals_begin(), and residuals_end().
Referenced by MuonResidualsTwoBin::numsegments().
{ long num = 0; for (std::vector<double*>::const_iterator resiter = residuals_begin(); resiter != residuals_end(); ++resiter) { num++; } return num; };
virtual double MuonResidualsFitter::plot | ( | std::string | name, |
TFileDirectory * | dir, | ||
Alignable * | ali | ||
) | [pure virtual] |
void MuonResidualsFitter::plotsimple | ( | std::string | name, |
TFileDirectory * | dir, | ||
int | which, | ||
double | multiplier | ||
) |
Definition at line 355 of file MuonResidualsFitter.cc.
References estimatePileup::hist, TFileDirectory::make(), csvReporter::r, residuals_begin(), residuals_end(), and svgfig::window().
Referenced by MuonResidualsTwoBin::plotsimple().
{ double window = 100.; if (which == 0) window = 2.*30.; else if (which == 1) window = 2.*30.; else if (which == 2) window = 2.*20.; else if (which == 3) window = 2.*50.; TH1F *hist = dir->make<TH1F>(name.c_str(), "", 200, -window, window); for (std::vector<double*>::const_iterator r = residuals_begin(); r != residuals_end(); ++r) { hist->Fill(multiplier * (*r)[which]); } }
void MuonResidualsFitter::plotweighted | ( | std::string | name, |
TFileDirectory * | dir, | ||
int | which, | ||
int | whichredchi2, | ||
double | multiplier | ||
) |
Definition at line 369 of file MuonResidualsFitter.cc.
References estimatePileup::hist, TFileDirectory::make(), csvReporter::r, residuals_begin(), residuals_end(), CommonMethods::weight(), and svgfig::window().
Referenced by MuonResidualsTwoBin::plotweighted().
{ double window = 100.; if (which == 0) window = 2.*30.; else if (which == 1) window = 2.*30.; else if (which == 2) window = 2.*20.; else if (which == 3) window = 2.*50.; TH1F *hist = dir->make<TH1F>(name.c_str(), "", 200, -window, window); for (std::vector<double*>::const_iterator r = residuals_begin(); r != residuals_end(); ++r) { double weight = 1./(*r)[whichredchi2]; if (TMath::Prob(1./weight*12, 12) < 0.99) { hist->Fill(multiplier * (*r)[which], weight); } } }
void MuonResidualsFitter::read | ( | FILE * | file, |
int | which = 0 |
||
) |
Definition at line 311 of file MuonResidualsFitter.cc.
References ExpressReco_HICollisions_FallBack::e, Exception, fill(), i, ndata(), and tablePrinter::rows.
Referenced by MuonResidualsTwoBin::read().
{ long rows = -100; int cols = -100; int readwhich = -100; fread(&rows, sizeof(long), 1, file); fread(&cols, sizeof(int), 1, file); fread(&readwhich, sizeof(int), 1, file); if (cols != ndata() || rows < 0 || readwhich != which) throw cms::Exception("MuonResidualsFitter") << "temporary file is corrupted (which = " << which << " readwhich = " << readwhich << " rows = " << rows << " cols = " << cols << ")" << std::endl; double *likeAChecksum = new double[cols]; double *likeAChecksum2 = new double[cols]; for (int i = 0; i < cols; i++) { likeAChecksum[i] = 0.; likeAChecksum2[i] = 0.; } for (long row = 0; row < rows; row++) { double *residual = new double[cols]; fread(residual, sizeof(double), cols, file); fill(residual); for (int i = 0; i < cols; i++) { if (fabs(residual[i]) > likeAChecksum[i]) likeAChecksum[i] = fabs(residual[i]); if (fabs(residual[i]) < likeAChecksum2[i]) likeAChecksum2[i] = fabs(residual[i]); } } // end loop over records in file double *readChecksum = new double[cols]; double *readChecksum2 = new double[cols]; fread(readChecksum, sizeof(double), cols, file); fread(readChecksum2, sizeof(double), cols, file); for (int i = 0; i < cols; i++) { if (fabs(likeAChecksum[i] - readChecksum[i]) > 1e-10 || fabs(1./likeAChecksum2[i] - 1./readChecksum2[i]) > 1e10) { throw cms::Exception("MuonResidualsFitter") << "temporary file is corrupted (which = " << which << " rows = " << rows << " likeAChecksum " << likeAChecksum[i] << " != readChecksum " << readChecksum[i] << " " << " likeAChecksum2 " << likeAChecksum2[i] << " != readChecksum2 " << readChecksum2[i] << ")" << std::endl; } } delete [] likeAChecksum; delete [] likeAChecksum2; }
std::vector<double*>::const_iterator MuonResidualsFitter::residuals_begin | ( | ) | const [inline] |
Definition at line 112 of file MuonResidualsFitter.h.
References m_residuals.
Referenced by MuonResidualsPositionFitter::fit(), MuonResidualsBfieldAngleFitter::fit(), MuonResiduals1DOFFitter::fit(), MuonResidualsAngleFitter::fit(), MuonResiduals1DOFFitter_FCN(), MuonResiduals5DOFFitter_FCN(), MuonResiduals6DOFFitter_FCN(), MuonResiduals6DOFrphiFitter_FCN(), MuonResidualsAngleFitter_FCN(), MuonResidualsBfieldAngleFitter_FCN(), MuonResidualsPositionFitter_FCN(), numsegments(), MuonResiduals6DOFrphiFitter::plot(), MuonResiduals6DOFFitter::plot(), MuonResidualsBfieldAngleFitter::plot(), MuonResiduals5DOFFitter::plot(), MuonResidualsPositionFitter::plot(), MuonResidualsAngleFitter::plot(), MuonResiduals1DOFFitter::plot(), plotsimple(), plotweighted(), MuonResidualsTwoBin::residualsNeg_begin(), MuonResidualsTwoBin::residualsPos_begin(), MuonResiduals5DOFFitter::sumofweights(), MuonResiduals6DOFFitter::sumofweights(), MuonResiduals1DOFFitter::sumofweights(), MuonResiduals6DOFrphiFitter::sumofweights(), write(), and ~MuonResidualsFitter().
{ return m_residuals.begin(); };
std::vector<double*>::const_iterator MuonResidualsFitter::residuals_end | ( | ) | const [inline] |
Definition at line 113 of file MuonResidualsFitter.h.
References m_residuals.
Referenced by MuonResidualsPositionFitter::fit(), MuonResidualsBfieldAngleFitter::fit(), MuonResiduals1DOFFitter::fit(), MuonResidualsAngleFitter::fit(), MuonResiduals1DOFFitter_FCN(), MuonResiduals5DOFFitter_FCN(), MuonResiduals6DOFFitter_FCN(), MuonResiduals6DOFrphiFitter_FCN(), MuonResidualsAngleFitter_FCN(), MuonResidualsBfieldAngleFitter_FCN(), MuonResidualsPositionFitter_FCN(), numsegments(), MuonResiduals6DOFrphiFitter::plot(), MuonResiduals6DOFFitter::plot(), MuonResidualsBfieldAngleFitter::plot(), MuonResiduals5DOFFitter::plot(), MuonResidualsPositionFitter::plot(), MuonResidualsAngleFitter::plot(), MuonResiduals1DOFFitter::plot(), plotsimple(), plotweighted(), MuonResidualsTwoBin::residualsNeg_end(), MuonResidualsTwoBin::residualsPos_end(), MuonResiduals5DOFFitter::sumofweights(), MuonResiduals6DOFFitter::sumofweights(), MuonResiduals1DOFFitter::sumofweights(), MuonResiduals6DOFrphiFitter::sumofweights(), write(), and ~MuonResidualsFitter().
{ return m_residuals.end(); };
int MuonResidualsFitter::residualsModel | ( | ) | const [inline] |
Definition at line 59 of file MuonResidualsFitter.h.
References m_residualsModel.
Referenced by MuonResiduals6DOFFitter::fit(), MuonResiduals6DOFrphiFitter::fit(), MuonResiduals5DOFFitter::fit(), MuonResidualsPositionFitter::fit(), MuonResidualsBfieldAngleFitter::fit(), MuonResiduals1DOFFitter::fit(), MuonResidualsAngleFitter::fit(), initialize_table(), MuonResiduals1DOFFitter_FCN(), MuonResiduals5DOFFitter_FCN(), MuonResiduals6DOFFitter_FCN(), MuonResiduals6DOFrphiFitter_FCN(), MuonResidualsAngleFitter_FCN(), MuonResidualsBfieldAngleFitter_FCN(), MuonResidualsPositionFitter_FCN(), MuonResidualsAngleFitter::npar(), MuonResidualsBfieldAngleFitter::npar(), MuonResiduals5DOFFitter::npar(), MuonResiduals6DOFFitter::npar(), MuonResiduals1DOFFitter::npar(), MuonResidualsPositionFitter::npar(), MuonResiduals6DOFrphiFitter::npar(), MuonResiduals6DOFrphiFitter::plot(), MuonResiduals6DOFFitter::plot(), MuonResidualsBfieldAngleFitter::plot(), MuonResiduals5DOFFitter::plot(), MuonResidualsPositionFitter::plot(), MuonResidualsAngleFitter::plot(), MuonResiduals1DOFFitter::plot(), and MuonResidualsTwoBin::residualsModel().
{ return m_residualsModel; };
void MuonResidualsFitter::setPrintLevel | ( | int | printLevel | ) | [inline] |
Definition at line 80 of file MuonResidualsFitter.h.
References m_printLevel.
Referenced by MuonResidualsTwoBin::setPrintLevel().
{ m_printLevel = printLevel; };
void MuonResidualsFitter::setStrategy | ( | int | strategy | ) | [inline] |
Definition at line 81 of file MuonResidualsFitter.h.
References m_strategy.
Referenced by MuonResidualsTwoBin::setStrategy().
{ m_strategy = strategy; };
virtual double MuonResidualsFitter::sumofweights | ( | ) | [pure virtual] |
virtual int MuonResidualsFitter::type | ( | ) | const [pure virtual] |
double MuonResidualsFitter::value | ( | int | parNum | ) | [inline] |
Definition at line 92 of file MuonResidualsFitter.h.
References m_value, and npar().
Referenced by MuonResidualsTwoBin::antisym(), fix(), initialize_table(), MuonResiduals6DOFrphiFitter::plot(), MuonResiduals6DOFFitter::plot(), MuonResidualsBfieldAngleFitter::plot(), MuonResiduals5DOFFitter::plot(), MuonResidualsPositionFitter::plot(), MuonResidualsAngleFitter::plot(), MuonResiduals1DOFFitter::plot(), and MuonResidualsTwoBin::value().
void MuonResidualsFitter::write | ( | FILE * | file, |
int | which = 0 |
||
) |
Definition at line 277 of file MuonResidualsFitter.cc.
References i, ndata(), numResiduals(), residuals_begin(), residuals_end(), and tablePrinter::rows.
Referenced by MuonResidualsTwoBin::write().
{ long rows = numResiduals(); int cols = ndata(); int whichcopy = which; fwrite(&rows, sizeof(long), 1, file); fwrite(&cols, sizeof(int), 1, file); fwrite(&whichcopy, sizeof(int), 1, file); double *likeAChecksum = new double[cols]; double *likeAChecksum2 = new double[cols]; for (int i = 0; i < cols; i++) { likeAChecksum[i] = 0.; likeAChecksum2[i] = 0.; } for (std::vector<double*>::const_iterator residual = residuals_begin(); residual != residuals_end(); ++residual) { fwrite((*residual), sizeof(double), cols, file); for (int i = 0; i < cols; i++) { if (fabs((*residual)[i]) > likeAChecksum[i]) likeAChecksum[i] = fabs((*residual)[i]); if (fabs((*residual)[i]) < likeAChecksum2[i]) likeAChecksum2[i] = fabs((*residual)[i]); } } // end loop over residuals // the idea is that mal-formed doubles are likely to be huge values (or tiny values) // because the exponent gets screwed up; we want to check for that fwrite(likeAChecksum, sizeof(double), cols, file); fwrite(likeAChecksum2, sizeof(double), cols, file); delete [] likeAChecksum; delete [] likeAChecksum2; }
std::vector<double> MuonResidualsFitter::m_error [protected] |
Definition at line 132 of file MuonResidualsFitter.h.
Referenced by dofit(), and errorerror().
std::vector<bool> MuonResidualsFitter::m_fixed [protected] |
Definition at line 126 of file MuonResidualsFitter.h.
double MuonResidualsFitter::m_loglikelihood [protected] |
Definition at line 133 of file MuonResidualsFitter.h.
Referenced by dofit(), and loglikelihood().
int MuonResidualsFitter::m_minHits [protected] |
Definition at line 124 of file MuonResidualsFitter.h.
Referenced by MuonResidualsPositionFitter::fit(), MuonResidualsBfieldAngleFitter::fit(), and MuonResidualsAngleFitter::fit().
int MuonResidualsFitter::m_printLevel [protected] |
Definition at line 127 of file MuonResidualsFitter.h.
Referenced by dofit(), and setPrintLevel().
std::vector<double*> MuonResidualsFitter::m_residuals [protected] |
Definition at line 129 of file MuonResidualsFitter.h.
Referenced by fill(), numResiduals(), residuals_begin(), and residuals_end().
int MuonResidualsFitter::m_residualsModel [protected] |
Definition at line 123 of file MuonResidualsFitter.h.
Referenced by MuonResidualsFitter(), and residualsModel().
int MuonResidualsFitter::m_strategy [protected] |
Definition at line 127 of file MuonResidualsFitter.h.
Referenced by dofit(), and setStrategy().
std::vector<double> MuonResidualsFitter::m_value [protected] |
Definition at line 131 of file MuonResidualsFitter.h.
bool MuonResidualsFitter::m_weightAlignment [protected] |
Definition at line 125 of file MuonResidualsFitter.h.
Referenced by MuonResiduals1DOFFitter::fit(), MuonResiduals6DOFrphiFitter::plot(), MuonResiduals6DOFFitter::plot(), MuonResiduals5DOFFitter::plot(), MuonResiduals1DOFFitter::plot(), MuonResiduals5DOFFitter::sumofweights(), MuonResiduals6DOFFitter::sumofweights(), MuonResiduals1DOFFitter::sumofweights(), and MuonResiduals6DOFrphiFitter::sumofweights().