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

◆ MuonResiduals1DOFFitter_FCN()

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

Definition at line 11 of file MuonResiduals1DOFFitter.cc.

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

References cms::cuda::assert(), 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().

Variable Documentation

◆ MuonResiduals1DOFFitter_number_of_hits

double MuonResiduals1DOFFitter_number_of_hits
static

◆ MuonResiduals1DOFFitter_sum_of_weights

double MuonResiduals1DOFFitter_sum_of_weights
static

◆ MuonResiduals1DOFFitter_TMinuit

TMinuit* MuonResiduals1DOFFitter_TMinuit
static

◆ MuonResiduals1DOFFitter_weightAlignment

bool MuonResiduals1DOFFitter_weightAlignment
static
MuonResidualsFitter
Definition: MuonResidualsFitter.h:84
MuonResiduals1DOFFitter_weightAlignment
static bool MuonResiduals1DOFFitter_weightAlignment
Definition: MuonResiduals1DOFFitter.cc:7
MuonResidualsFitter_logROOTVoigt
double MuonResidualsFitter_logROOTVoigt(double residual, double center, double sigma, double gamma)
Definition: MuonResidualsFitter.cc:120
cms::cuda::assert
assert(be >=bs)
MuonResidualsFitter::kGaussPowerTails
Definition: MuonResidualsFitter.h:86
MuonResiduals1DOFFitter::kRedChi2
Definition: MuonResiduals1DOFFitter.h:16
MuonResiduals1DOFFitter::kSigma
Definition: MuonResiduals1DOFFitter.h:14
MuonResiduals1DOFFitter::kAlign
Definition: MuonResiduals1DOFFitter.h:14
MuonResiduals1DOFFitter::kGamma
Definition: MuonResiduals1DOFFitter.h:14
MuonResidualsFitterFitInfo
Definition: MuonResidualsFitter.h:250
MuonResiduals1DOFFitter::kResid
Definition: MuonResiduals1DOFFitter.h:16
MuonResiduals1DOFFitter_number_of_hits
static double MuonResiduals1DOFFitter_number_of_hits
Definition: MuonResiduals1DOFFitter.cc:6
MuonResidualsFitter::kPowerLawTails
Definition: MuonResidualsFitter.h:86
MuonResidualsFitter::kPureGaussian
Definition: MuonResidualsFitter.h:86
MuonResidualsFitter::residuals_end
std::vector< double * >::const_iterator residuals_end() const
Definition: MuonResidualsFitter.h:191
MuonResiduals1DOFFitter_sum_of_weights
static double MuonResiduals1DOFFitter_sum_of_weights
Definition: MuonResiduals1DOFFitter.cc:5
MuonResidualsFitter_logPowerLawTails
double MuonResidualsFitter_logPowerLawTails(double residual, double center, double sigma, double gamma)
Definition: MuonResidualsFitter.cc:85
MuonResidualsFitter::kROOTVoigt
Definition: MuonResidualsFitter.h:86
MuonResidualsFitterFitInfo::fitter
MuonResidualsFitter * fitter()
Definition: MuonResidualsFitter.h:253
MuonResidualsFitter_logGaussPowerTails
double MuonResidualsFitter_logGaussPowerTails(double residual, double center, double sigma)
Definition: MuonResidualsFitter.cc:128
MuonResidualsFitter::residualsModel
int residualsModel() const
Definition: MuonResidualsFitter.h:124
MuonResidualsFitter::residuals_begin
std::vector< double * >::const_iterator residuals_begin() const
Definition: MuonResidualsFitter.h:190
weight
Definition: weight.py:1
MuonResiduals1DOFFitter_TMinuit
static TMinuit * MuonResiduals1DOFFitter_TMinuit
Definition: MuonResiduals1DOFFitter.cc:4
MuonResidualsFitter_logPureGaussian
double MuonResidualsFitter_logPureGaussian(double residual, double center, double sigma)
Definition: MuonResidualsFitter.cc:31