CMS 3D CMS Logo

Functions
SiPixelSCurveCalibrationAnalysis.cc File Reference
#include "CalibTracker/SiPixelSCurveCalibration/interface/SiPixelSCurveCalibrationAnalysis.h"
#include "TMath.h"
#include <fstream>
#include <iostream>
#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

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

Definition at line 269 of file SiPixelSCurveCalibrationAnalysis.cc.

References objects.autophobj::float.

Referenced by SiPixelSCurveCalibrationAnalysis::doFits().

269  {
270  eff = (float)nADCResponse / (float)nTriggers;
271  double effForErrorCalculation = eff;
272  if (eff <= 0 || eff >= 1)
273  effForErrorCalculation = 0.5 / (double)nTriggers;
274  error = TMath::Sqrt(effForErrorCalculation * (1 - effForErrorCalculation) / (double)nTriggers);
275 }
void chi2toMinimize ( int &  npar,
double *  grad,
double &  fcnval,
double *  xval,
int  iflag 
)

Definition at line 92 of file SiPixelSCurveCalibrationAnalysis.cc.

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

Referenced by SiPixelSCurveCalibrationAnalysis::doFits().

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