CMS 3D CMS Logo

Functions
SiPixelSCurveCalibrationAnalysis.cc File Reference
#include "CalibTracker/SiPixelSCurveCalibration/interface/SiPixelSCurveCalibrationAnalysis.h"
#include "TMath.h"
#include <fstream>
#include <iostream>
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "CondFormats/SiPixelObjects/interface/DetectorIndex.h"
#include "CondFormats/SiPixelObjects/interface/ElectronicIndex.h"
#include "CondFormats/SiPixelObjects/interface/LocalPixel.h"
#include "CondFormats/SiPixelObjects/interface/SiPixelFrameConverter.h"
#include "DataFormats/SiPixelDigi/interface/SiPixelCalibDigiError.h"
#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
#include <sstream>

Go to the source code of this file.

Functions

void calculateEffAndError (int nADCResponse, int nTriggers, float &eff, float &error)
 
void chi2toMinimize (int &npar, double *grad, double &fcnval, double *xval, int iflag)
 

Function Documentation

◆ calculateEffAndError()

void calculateEffAndError ( int  nADCResponse,
int  nTriggers,
float &  eff,
float &  error 
)

Definition at line 270 of file SiPixelSCurveCalibrationAnalysis.cc.

References relativeConstraints::error, and nano_mu_digi_cff::float.

Referenced by SiPixelSCurveCalibrationAnalysis::doFits().

270  {
271  eff = (float)nADCResponse / (float)nTriggers;
272  double effForErrorCalculation = eff;
273  if (eff <= 0 || eff >= 1)
274  effForErrorCalculation = 0.5 / (double)nTriggers;
275  error = TMath::Sqrt(effForErrorCalculation * (1 - effForErrorCalculation) / (double)nTriggers);
276 }

◆ chi2toMinimize()

void chi2toMinimize ( int &  npar,
double *  grad,
double &  fcnval,
double *  xval,
int  iflag 
)

Definition at line 93 of file SiPixelSCurveCalibrationAnalysis.cc.

References SiPixelSCurveCalibrationAnalysis::effErrors_, SiPixelSCurveCalibrationAnalysis::efficiencies_, SiPixelOfflineCalibAnalysisBase::fitFunction_, SiPixelOfflineCalibAnalysisBase::getVcalValues(), mps_fire::i, and makeMEIFBenchmarkPlots::xval.

Referenced by SiPixelSCurveCalibrationAnalysis::doFits().

93  {
95  // setup function parameters
96  for (int i = 0; i < npar; i++)
97  theFormula->SetParameter(i, xval[i]);
98  fcnval = 0;
99  // compute Chi2 of all points
100  const std::vector<short> *theVCalValues = SiPixelSCurveCalibrationAnalysis::getVcalValues();
101  for (uint32_t i = 0; i < theVCalValues->size(); i++) {
102  float chi = (SiPixelSCurveCalibrationAnalysis::efficiencies_[i] - theFormula->Eval((*theVCalValues)[i]));
104  fcnval += chi * chi;
105  }
106 }
static const std::vector< short > * getVcalValues()