CMS 3D CMS Logo

Functions
SiPixelSCurveCalibrationAnalysis.cc File Reference
#include "CalibTracker/SiPixelSCurveCalibration/interface/SiPixelSCurveCalibrationAnalysis.h"
#include "TMath.h"
#include <iostream>
#include <fstream>
#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
#include "DataFormats/SiPixelDigi/interface/SiPixelCalibDigiError.h"
#include "CondFormats/SiPixelObjects/interface/SiPixelFrameConverter.h"
#include "CondFormats/SiPixelObjects/interface/ElectronicIndex.h"
#include "CondFormats/SiPixelObjects/interface/DetectorIndex.h"
#include "CondFormats/SiPixelObjects/interface/LocalPixel.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 250 of file SiPixelSCurveCalibrationAnalysis.cc.

References objects.autophobj::float.

Referenced by SiPixelSCurveCalibrationAnalysis::doFits().

251 {
252  eff = (float)nADCResponse / (float)nTriggers;
253  double effForErrorCalculation = eff;
254  if (eff <= 0 || eff >= 1)
255  effForErrorCalculation = 0.5 / (double)nTriggers;
256  error = TMath::Sqrt(effForErrorCalculation*(1-effForErrorCalculation) / (double)nTriggers);
257 }
void chi2toMinimize ( int &  npar,
double *  grad,
double &  fcnval,
double *  xval,
int  iflag 
)

Definition at line 86 of file SiPixelSCurveCalibrationAnalysis.cc.

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

Referenced by SiPixelSCurveCalibrationAnalysis::doFits().

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