CMS 3D CMS Logo

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

Go to the source code of this file.

Functions

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

Variables

static TMinuit * MuonResidualsBfieldAngleFitter_TMinuit
 

Function Documentation

◆ MuonResidualsBfieldAngleFitter_FCN()

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

Definition at line 7 of file MuonResidualsBfieldAngleFitter.cc.

References cms::cuda::assert(), MuonResidualsFitterFitInfo::fitter(), MuonResidualsBfieldAngleFitter::kAngle, MuonResidualsBfieldAngleFitter::kBfrompt, MuonResidualsBfieldAngleFitter::kBfrompz, MuonResidualsBfieldAngleFitter::kdEdx, MuonResidualsBfieldAngleFitter::kGamma, MuonResidualsFitter::kGaussPowerTails, MuonResidualsFitter::kPowerLawTails, MuonResidualsFitter::kPureGaussian, MuonResidualsBfieldAngleFitter::kQoverPt, MuonResidualsBfieldAngleFitter::kQoverPz, MuonResidualsBfieldAngleFitter::kResidual, MuonResidualsFitter::kROOTVoigt, MuonResidualsBfieldAngleFitter::kSigma, MuonResidualsBfieldAngleFitter_TMinuit, MuonResidualsFitter_logGaussPowerTails(), MuonResidualsFitter_logPowerLawTails(), MuonResidualsFitter_logPureGaussian(), MuonResidualsFitter_logROOTVoigt(), MuonResidualsFitter::residuals_begin(), MuonResidualsFitter::residuals_end(), and MuonResidualsFitter::residualsModel().

Referenced by MuonResidualsBfieldAngleFitter::fit().

7  {
10  MuonResidualsFitter *fitter = fitinfo->fitter();
11 
12  fval = 0.;
13  for (std::vector<double *>::const_iterator resiter = fitter->residuals_begin(); resiter != fitter->residuals_end();
14  ++resiter) {
15  const double residual = (*resiter)[MuonResidualsBfieldAngleFitter::kResidual];
16  const double qoverpt = (*resiter)[MuonResidualsBfieldAngleFitter::kQoverPt];
17  const double qoverpz = (*resiter)[MuonResidualsBfieldAngleFitter::kQoverPz];
18 
19  double center = 0.;
21  center += par[MuonResidualsBfieldAngleFitter::kBfrompt] * qoverpt;
22  center += par[MuonResidualsBfieldAngleFitter::kBfrompz] * qoverpz;
23  center += par[MuonResidualsBfieldAngleFitter::kdEdx] * (1. / qoverpt / qoverpt + 1. / qoverpz / qoverpz) *
24  (qoverpt > 0. ? 1. : -1.);
25 
28  } else if (fitter->residualsModel() == MuonResidualsFitter::kPowerLawTails) {
31  } else if (fitter->residualsModel() == MuonResidualsFitter::kROOTVoigt) {
34  } else if (fitter->residualsModel() == MuonResidualsFitter::kGaussPowerTails) {
36  } else {
37  assert(false);
38  }
39  }
40 }
double MuonResidualsFitter_logGaussPowerTails(double residual, double center, double sigma)
std::vector< double * >::const_iterator residuals_begin() const
MuonResidualsFitter * fitter()
std::vector< double * >::const_iterator residuals_end() const
assert(be >=bs)
double MuonResidualsFitter_logROOTVoigt(double residual, double center, double sigma, double gamma)
double MuonResidualsFitter_logPowerLawTails(double residual, double center, double sigma, double gamma)
static TMinuit * MuonResidualsBfieldAngleFitter_TMinuit
double MuonResidualsFitter_logPureGaussian(double residual, double center, double sigma)

Variable Documentation

◆ MuonResidualsBfieldAngleFitter_TMinuit

TMinuit* MuonResidualsBfieldAngleFitter_TMinuit
static