CMS 3D CMS Logo

Functions | Variables
MuonResiduals1DOFFitter.cc File Reference
#include "Alignment/MuonAlignmentAlgorithms/interface/MuonResiduals1DOFFitter.h"
#include "TMath.h"

Go to the source code of this file.

Functions

void MuonResiduals1DOFFitter_FCN (int &npar, double *gin, double &fval, double *par, int iflag)
 

Variables

static double MuonResiduals1DOFFitter_number_of_hits
 
static double MuonResiduals1DOFFitter_sum_of_weights
 
static TMinuit * MuonResiduals1DOFFitter_TMinuit
 
static bool MuonResiduals1DOFFitter_weightAlignment
 

Function Documentation

void MuonResiduals1DOFFitter_FCN ( int &  npar,
double *  gin,
double &  fval,
double *  par,
int  iflag 
)

Definition at line 13 of file MuonResiduals1DOFFitter.cc.

References MuonResidualsFitterFitInfo::fitter(), MuonResiduals1DOFFitter::kAlign, MuonResiduals1DOFFitter::kGamma, MuonResidualsFitter::kGaussPowerTails, MuonResidualsFitter::kPowerLawTails, MuonResidualsFitter::kPureGaussian, MuonResiduals1DOFFitter::kRedChi2, MuonResiduals1DOFFitter::kResid, MuonResidualsFitter::kROOTVoigt, MuonResiduals1DOFFitter::kSigma, MuonResiduals1DOFFitter_number_of_hits, MuonResiduals1DOFFitter_sum_of_weights, MuonResiduals1DOFFitter_TMinuit, MuonResiduals1DOFFitter_weightAlignment, MuonResidualsFitter_logGaussPowerTails(), MuonResidualsFitter_logPowerLawTails(), MuonResidualsFitter_logPureGaussian(), MuonResidualsFitter_logROOTVoigt(), MuonResidualsFitter::residuals_begin(), MuonResidualsFitter::residuals_end(), and MuonResidualsFitter::residualsModel().

Referenced by MuonResiduals1DOFFitter::fit().

13  {
15  MuonResidualsFitter *fitter = fitinfo->fitter();
16 
17  fval = 0.;
18  for (std::vector<double*>::const_iterator resiter = fitter->residuals_begin(); resiter != fitter->residuals_end(); ++resiter) {
19  const double residual = (*resiter)[MuonResiduals1DOFFitter::kResid];
20  const double redchi2 = (*resiter)[MuonResiduals1DOFFitter::kRedChi2];
21 
22  const double residpeak = par[MuonResiduals1DOFFitter::kAlign];
23  const double residsigma = par[MuonResiduals1DOFFitter::kSigma];
24  const double residgamma = par[MuonResiduals1DOFFitter::kGamma];
25 
28 
29  if (!MuonResiduals1DOFFitter_weightAlignment || TMath::Prob(redchi2*8, 8) < 0.99) { // no spikes allowed
31  fval += -weight * MuonResidualsFitter_logPureGaussian(residual, residpeak, residsigma);
32  }
34  fval += -weight * MuonResidualsFitter_logPowerLawTails(residual, residpeak, residsigma, residgamma);
35  }
36  else if (fitter->residualsModel() == MuonResidualsFitter::kROOTVoigt) {
37  fval += -weight * MuonResidualsFitter_logROOTVoigt(residual, residpeak, residsigma, residgamma);
38  }
40  fval += -weight * MuonResidualsFitter_logGaussPowerTails(residual, residpeak, residsigma);
41  }
42  else { assert(false); }
43 
44  }
45  }
46 }
double MuonResidualsFitter_logGaussPowerTails(double residual, double center, double sigma)
static double MuonResiduals1DOFFitter_number_of_hits
MuonResidualsFitter * fitter()
Definition: weight.py:1
double MuonResidualsFitter_logROOTVoigt(double residual, double center, double sigma, double gamma)
static TMinuit * MuonResiduals1DOFFitter_TMinuit
double MuonResidualsFitter_logPowerLawTails(double residual, double center, double sigma, double gamma)
static bool MuonResiduals1DOFFitter_weightAlignment
static double MuonResiduals1DOFFitter_sum_of_weights
std::vector< double * >::const_iterator residuals_end() const
std::vector< double * >::const_iterator residuals_begin() const
double MuonResidualsFitter_logPureGaussian(double residual, double center, double sigma)

Variable Documentation

double MuonResiduals1DOFFitter_number_of_hits
static
double MuonResiduals1DOFFitter_sum_of_weights
static
TMinuit* MuonResiduals1DOFFitter_TMinuit
static
bool MuonResiduals1DOFFitter_weightAlignment
static