CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiPixelGainCalibrationAnalysis.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelGainCalibrationAnalysis
4 // Class: SiPixelGainCalibrationAnalysis
5 //
13 //
14 // Original Author: Freya Blekman
15 // Created: Wed Nov 14 15:02:06 CET 2007
16 // $Id: SiPixelGainCalibrationAnalysis.cc,v 1.41 2009/10/21 09:28:07 rougny Exp $
17 //
18 //
19 
20 // user include files
22 
24 #include <sstream>
25 #include <vector>
26 #include <math.h>
27 #include "TGraphErrors.h"
28 #include "TMath.h"
29 
30 using std::cout;
31 using std::endl;
32 //
33 // constructors and destructor
34 //
37  conf_(iConfig),
38  bookkeeper_(),
39  bookkeeper_pixels_(),
40  nfitparameters_(iConfig.getUntrackedParameter<int>("numberOfFitParameters",2)),
41  fitfunction_(iConfig.getUntrackedParameter<std::string>("fitFunctionRootFormula","pol1")),
42  listofdetids_(conf_.getUntrackedParameter<std::vector<uint32_t> >("listOfDetIDs")),
43  ignoreMode_(conf_.getUntrackedParameter<bool>("ignoreMode",false)),
44  reject_plateaupoints_(iConfig.getUntrackedParameter<bool>("suppressPlateauInFit",true)),
45  reject_single_entries_(iConfig.getUntrackedParameter<bool>("suppressPointsWithOneEntryOrLess",true)),
46  plateau_max_slope_(iConfig.getUntrackedParameter<double>("plateauSlopeMax",1.0)),
47  reject_first_point_(iConfig.getUntrackedParameter<bool>("rejectVCalZero",true)),
48  reject_badpoints_frac_(iConfig.getUntrackedParameter<double>("suppressZeroAndPlateausInFitFrac",0)),
49  bookBIGCalibPayload_(iConfig.getUntrackedParameter<bool>("saveFullPayloads",false)),
50  savePixelHists_(iConfig.getUntrackedParameter<bool>("savePixelLevelHists",false)),
51  chi2Threshold_(iConfig.getUntrackedParameter<double>("minChi2NDFforHistSave",10)),
52  chi2ProbThreshold_(iConfig.getUntrackedParameter<double>("minChi2ProbforHistSave",0.05)),
53  maxGainInHist_(iConfig.getUntrackedParameter<double>("maxGainInHist",10)),
54  maxChi2InHist_(iConfig.getUntrackedParameter<double>("maxChi2InHist",25)),
55  saveALLHistograms_(iConfig.getUntrackedParameter<bool>("saveAllHistograms",false)),
56 
57 
58  filldb_(iConfig.getUntrackedParameter<bool>("writeDatabase",false)),
59  writeSummary_(iConfig.getUntrackedParameter<bool>("writeSummary",true)),
60  recordName_(conf_.getParameter<std::string>("record")),
61 
62  appendMode_(conf_.getUntrackedParameter<bool>("appendMode",true)),
63  /*theGainCalibrationDbInput_(0),
64  theGainCalibrationDbInputOffline_(0),
65  theGainCalibrationDbInputHLT_(0),
66  theGainCalibrationDbInputService_(iConfig),*/
67  gainlow_(10.),gainhi_(0.),pedlow_(255.),pedhi_(0.),
68  useVcalHigh_(conf_.getParameter<bool>("useVCALHIGH")),
69  scalarVcalHigh_VcalLow_(conf_.getParameter<double>("vcalHighToLowConversionFac"))
70 {
72  min_nentries_=1;
73  else
74  min_nentries_=0;
75  ::putenv((char*)"CORAL_AUTH_USER=me");
76  ::putenv((char*)"CORAL_AUTH_PASSWORD=test");
77  edm::LogInfo("SiPixelGainCalibrationAnalysis") << "now using fit function " << fitfunction_ << ", which has " << nfitparameters_ << " free parameters. " << std::endl;
78  func_= new TF1("func",fitfunction_.c_str(),0,256*scalarVcalHigh_VcalLow_);
79  graph_ = new TGraphErrors();
80  currentDetID_=0;
81  summary_.open("SummaryPerDetID.txt");
82  statusNumbers_ = new int[10];
83  for(int ii=0;ii<10;ii++)
84  statusNumbers_[ii]=0;
85 }
86 
88 {
89 }
90 // member functions
91 //
92 // ------------ method called once each job just before starting event loop ------------
93 
95  std::vector<float> result;
96  int ncols= bookkeeper_[detid][label]->getNbinsX();
97  int nrows= bookkeeper_[detid][label]->getNbinsY();
98  for(int icol=1; icol<=ncols; ++icol){
99  float val=0;
100  float ntimes =0;
101  for(int irow=1; irow<=nrows; ++irow){
102  val+= bookkeeper_[detid][label]->getBinContent(icol,irow);
103  ntimes++;
104  }
105  val/= ntimes;
106  result.push_back(val);
107  }
108  return result;
109 }
110 
111 bool
113 {
114  if(calibrationMode_=="GainCalibration")
115  return true;
116  else if(ignoreMode_==true)
117  return true;
118  else if(calibrationMode_=="unknown"){
119  edm::LogInfo("SiPixelGainCalibrationAnalysis") << "calibration mode is: " << calibrationMode_ << ", continuing anyway..." ;
120  return true;
121  }
122  else{
123  // edm::LogError("SiPixelGainCalibrationAnalysis") << "unknown calibration mode for Gain calibration, should be \"Gain\" and is \"" << calibrationMode_ << "\"";
124  }
125  return false;
126 }
127 
129 {
130 }
131 //------- summary printing method. Very verbose.
132 void
134 
135  uint32_t detid=0;
136  for(std::map<uint32_t,std::map<std::string,MonitorElement *> >::const_iterator idet = bookkeeper_.begin(); idet != bookkeeper_.end(); ++idet){
137  if(detid==idet->first)
138  continue;// only do things once per detid
139  detid=idet->first;
140  std::vector<float> gainvec=CalculateAveragePerColumn(detid,"gain_2d");
141  std::vector<float> pedvec =CalculateAveragePerColumn(detid,"ped_2d");
142  std::vector<float> chi2vec = CalculateAveragePerColumn(detid,"chi2_2d");
143  std::ostringstream summarytext;
144 
145  summarytext << "Summary for det ID " << detid << "(" << translateDetIdToString(detid) << ")\n";
146  summarytext << "\t Following: values per column: column #, gain, pedestal, chi2\n";
147  for(uint32_t i=0; i<gainvec.size(); i++)
148  summarytext << "\t " << i << " \t" << gainvec[i] << " \t" << pedvec[i] << " \t" << chi2vec[i] << "\n";
149  summarytext << "\t list of pixels with high chi2 (chi2> " << chi2Threshold_ << "): \n";
150 
151 
152  for(std::map<std::string, MonitorElement *>::const_iterator ipix = bookkeeper_pixels_[detid].begin(); ipix!=bookkeeper_pixels_[detid].end(); ++ipix)
153  summarytext << "\t " << ipix->first << "\n";
154  edm::LogInfo("SiPixelGainCalibrationAnalysis") << summarytext.str() << std::endl;
155 
156  }
157  if(summary_.is_open()){
158  summary_.close();
159  summary_.open("Summary.txt");
160  summary_<<"Total Number of Pixel computed :"<<statusNumbers_[9]<<endl;
161  summary_<<"Number of pixel tagged with status :"<<endl;
162  for(int ii=0;ii<9;ii++)
163  summary_<<ii<<" -> "<<statusNumbers_[ii]<<" ~ "<<double(statusNumbers_[ii])/double(statusNumbers_[9])*100.<<" %"<<endl;
164 
165  summary_.close();
166 
167  }
168 
169 }
170 
171 // ------------ method called once each job just after ending the event loop ------------
172 
173 void
175 
177 
178  // this is where we loop over all histograms and save the database objects
179  if(filldb_)
180  fillDatabase();
181 }
182 //-----------method to fill the database
184  // only create when necessary.
185  // process the minimum and maximum gain & ped values...
186  edm::LogError("SiPixelGainCalibration::fillDatabase()") << "PLEASE do not fill the database directly from the gain calibration analyzer. This function is currently disabled and no DB payloads will be produced!" << std::endl;
187 
188 }
189 // ------------ method called to do fits to all objects available ------------
190 bool
191 SiPixelGainCalibrationAnalysis::doFits(uint32_t detid, std::vector<SiPixelCalibDigi>::const_iterator ipix)
192 {
193  float lowmeanval=255;
194  float highmeanval=0;
195  bool makehistopersistent = saveALLHistograms_;
196  std::vector<uint32_t>::const_iterator detidfinder=find(listofdetids_.begin(),listofdetids_.end(),detid);
197  if(detidfinder!=listofdetids_.end())
198  makehistopersistent=true;
199  // first, fill the input arrays to the TLinearFitter.
200  double xvals[257];
201  double yvals[256];
202  double yerrvals[256];
203  double xvalsall[257];
204  double yvalsall[256];
205  double yerrvalsall[256];
206  int npoints=0;
207  int nallpoints=0;
208  bool use_point=true;
209  int status=0;
210  statusNumbers_[9]++;
211 
212  bookkeeper_[detid]["status_2d"]->setBinContent(ipix->col()+1,ipix->row()+1,0);
213  if(writeSummary_ && detid!=currentDetID_){
215  summary_<<endl<<"DetId_"<<currentDetID_<<endl;
216  }
217 
218  for(uint32_t ii=0; ii< ipix->getnpoints() && ii<200; ii++){
219  // std::cout << ipix->getsum(ii) << " " << ipix->getnentries(ii) << " " << ipix->getsumsquares(ii) << std::endl;
220  nallpoints++;
221  use_point=true;
222  if(useVcalHigh_){
224  }
225  else
226  xvalsall[ii]=vCalValues_[ii];
227  yerrvalsall[ii]=yvalsall[ii]=0;
228 
229  if(ipix->getnentries(ii)>min_nentries_){
230  yvalsall[ii]=ipix->getsum(ii)/(float)ipix->getnentries(ii);
231  yerrvalsall[ii]=ipix->getsumsquares(ii)/(float)(ipix->getnentries(ii));
232  yerrvalsall[ii]-=pow(yvalsall[ii],2);
233  yerrvalsall[ii]=sqrt(yerrvalsall[ii])/sqrt(ipix->getnentries(ii));
234 
235  if(yvalsall[ii]<lowmeanval)
236  lowmeanval=yvalsall[ii];
237  if(yvalsall[ii]>highmeanval)
238  highmeanval=yvalsall[ii];
239  }
240  }
241 
242  // calculate plateau value from last 4 entries
243  double plateauval=0;
244  bool noPlateau=0;
245  if(nallpoints>=4){
246  for(int ii=nallpoints-1; ii>nallpoints-5; --ii) plateauval+=yvalsall[ii];
247  plateauval/=4;
248  for(int ii=nallpoints-1; ii>nallpoints-5; --ii){
249  if(fabs(yvalsall[ii]-plateauval)>5){
250  plateauval=255;
251  noPlateau=1;
252  continue;
253  }
254  }
255 
256  int NbofPointsInPlateau=0;
257  for(int ii=0; ii<nallpoints; ++ii)
258  if(fabs(yvalsall[ii]-plateauval)<10 || yvalsall[ii]==0) NbofPointsInPlateau++;
259  //summary_<<"row_"<<ipix->row()<<" col_"<<ipix->col()<<" "<<plateauval<<" "<<NbofPointsInPlateau<<" "<<nallpoints<<endl;
260  if(NbofPointsInPlateau>=(nallpoints-2)){
261  status=-2;
262  bookkeeper_[detid]["status_2d"]->setBinContent(ipix->col()+1,ipix->row()+1,status);
263  if(writeSummary_){
264  summary_<<"row_"<<ipix->row()<<" col_"<<ipix->col()<<" status_"<<status<<endl;
265  statusNumbers_[abs(status)]++;
266  }
267  return false;
268  }
269  }
270  else plateauval=255;
271 
272  double maxgoodvalinfit=plateauval*(1.-reject_badpoints_frac_);
273  npoints=0;
274  for(int ii=0; ii<nallpoints; ++ii){
275 
276  // now selecting the appropriate points for the fit.
277  use_point=true;
278  if(reject_first_point_ && xvalsall[ii]<0.1)
279  use_point=false;
280  if(ipix->getnentries(ii)<=min_nentries_ && reject_single_entries_)
281  use_point=false;
282  if(ipix->getnentries(ii)==0 && reject_badpoints_)
283  use_point=false;
284  if(yvalsall[ii]>maxgoodvalinfit && !noPlateau)
285  use_point=false;
286  if(ii>1 && fabs(yvalsall[ii]-yvalsall[ii-1])<5. && yvalsall[ii]>0.8*maxgoodvalinfit && reject_plateaupoints_){
287  use_point=false;
288  break;
289  }
290 
291  if(use_point){
292  xvals[npoints]=xvalsall[ii];
293  yvals[npoints]=yvalsall[ii];
294  yerrvals[npoints]=yerrvalsall[ii];
295  npoints++;
296  }
297  }
298 
299  float chi2,slope,intercept,prob,slopeerror,intercepterror;
300  prob=chi2=-1;
301  slope=intercept=slopeerror=intercepterror=0;
302 
303 
304  // now check on number of points. If bad just start taking the first 4:
305 
306  if(npoints<4){
307  npoints=0;
308  for(int ii=0; ii<nallpoints && npoints<4 && yvalsall[ii]<plateauval*0.97; ++ii){
309  if(yvalsall[ii]>0){
310  if(ii>0 && yvalsall[ii]-yvalsall[ii-1]<0.1)
311  continue;
312  xvals[npoints]=xvalsall[ii];
313  yvals[npoints]=yvalsall[ii];
314  yerrvals[npoints]=yerrvalsall[ii];
315  npoints++;
316  }
317  }
318  }
319  if(npoints<2){
320  status = -7;
321  bookkeeper_[detid]["status_2d"]->setBinContent(ipix->col()+1,ipix->row()+1,status);
322  if(writeSummary_){
323  summary_<<"row_"<<ipix->row()<<" col_"<<ipix->col()<<" status_"<<status<<endl;
324  statusNumbers_[abs(status)]++;
325  }
326  std::ostringstream pixelinfo;
327  pixelinfo << "GainCurve_row_" << ipix->row() << "_col_" << ipix->col();
328  std::string tempname=translateDetIdToString(detid);
329  tempname+="_";
330  tempname+=pixelinfo.str();
331  setDQMDirectory(detid);
332  bookkeeper_pixels_[detid][pixelinfo.str()] = bookDQMHistogram1D(detid,pixelinfo.str(),tempname,105*nallpoints,xvalsall[0],xvalsall[nallpoints-1]*1.05);
333  for(int ii=0; ii<nallpoints; ++ii)
334  bookkeeper_pixels_[detid][pixelinfo.str()]->Fill(xvalsall[ii],yvalsall[ii]);
335  return false;
336  }
337 
338  // std::cout << "starting fit!" << std::endl;
339  graph_->Set(npoints);
340 
341  func_->SetParameter(0,50.);
342  func_->SetParameter(1,0.25);
343  for(int ipointtemp=0; ipointtemp<npoints; ++ipointtemp){
344  graph_->SetPoint(ipointtemp,xvals[ipointtemp],yvals[ipointtemp]);
345  graph_->SetPointError(ipointtemp,0,yerrvals[ipointtemp]);
346  }
347  Int_t tempresult = graph_->Fit("func","FQ0N");
348  slope=func_->GetParameter(1);
349  slopeerror=func_->GetParError(1);
350  intercept=func_->GetParameter(0);
351  intercepterror=func_->GetParError(0);
352  chi2=func_->GetChisquare()/((float)npoints-func_->GetNpar());
353  prob= TMath::Prob(func_->GetChisquare(),npoints-func_->GetNpar());
354  size_t ntimes=0;
355  while((isnan(slope) || isnan(intercept) )&& ntimes<10){
356  ntimes++;
357  makehistopersistent=true;
358  // std::cout << slope << " " << intercept << " " << prob << std::endl;
359  edm::LogWarning("SiPixelGainCalibrationAnalysis") << "impossible to fit values, try " << ntimes << ": " ;
360  for(int ii=0; ii<npoints; ++ii){
361  edm::LogWarning("SiPixelGainCalibrationAnalysis")<< "vcal " << xvals[ii] << " response: " << yvals[ii] << "+/-" << yerrvals[ii] << std::endl;
362  }
363  tempresult = graph_->Fit("func","FQ0NW");
364  slope=func_->GetParameter(1);
365  slopeerror=func_->GetParError(1);
366  intercept = func_->GetParameter(0);
367  intercepterror=func_->GetParError(0);
368  chi2=func_->GetChisquare()/((float)npoints-func_->GetNpar());
369  prob= TMath::Prob(func_->GetChisquare(),npoints-func_->GetNpar());
370  }
371 
372  if(tempresult==0)
373  status=1;
374  else
375  status=0;
376  if(slope!=0)
377  slope = 1./slope;
378  if(isnan(slope) || isnan(intercept)){
379  status=-6;
380  bookkeeper_[detid]["status_2d"]->setBinContent(ipix->col()+1,ipix->row()+1,status);
381  if(writeSummary_){
382  summary_<<"row_"<<ipix->row()<<" col_"<<ipix->col()<<" status_"<<status<<endl;
383  statusNumbers_[abs(status)]++;
384  }
385  //return false;
386  }
387  if(chi2>chi2Threshold_ && chi2Threshold_>=0)
388  status=5;
389  if(prob<chi2ProbThreshold_)
390  status=5;
391  if(noPlateau)
392  status=3;
393  if(nallpoints<4)
394  status=-7;
395  if(TMath::Abs(slope>maxGainInHist_) || slope < 0)
396  status=-8;
397  if(status!=1)
398  makehistopersistent=true;
399  statusNumbers_[abs(status)]++;
400 
401 
402  if(slope<gainlow_)
403  gainlow_=slope;
404  if(slope>gainhi_)
405  gainhi_=slope;
406  if(intercept>pedhi_)
407  pedhi_=intercept;
408  if(intercept<pedlow_)
409  pedlow_=intercept;
410  bookkeeper_[detid]["gain_1d"]->Fill(slope);
411  if(slope>maxGainInHist_){
412  makehistopersistent=true;
413  edm::LogWarning("SiPixelGainCalibration") << "For DETID " << detid << "pixel row,col " << ipix->row() << "," << ipix->col() << " Gain was measured to be " << slope << " which is outside the range of the summary plot (" <<maxGainInHist_ << ") !!!! " << std::endl;
414  }
415  bookkeeper_[detid]["dynamicrange_2d"]->setBinContent(ipix->col()+1,ipix->row()+1,highmeanval-lowmeanval);
416  bookkeeper_[detid]["plateau_2d"]->setBinContent(ipix->col()+1,ipix->row()+1,highmeanval);
417  bookkeeper_[detid]["gain_2d"]->setBinContent(ipix->col()+1,ipix->row()+1,slope);
418  bookkeeper_[detid]["errorgain_2d"]->setBinContent(ipix->col()+1,ipix->row()+1,slopeerror);
419  bookkeeper_[detid]["ped_1d"]->Fill(intercept);
420  bookkeeper_[detid]["ped_2d"]->setBinContent(ipix->col()+1,ipix->row()+1,intercept);
421  bookkeeper_[detid]["errorped_2d"]->setBinContent(ipix->col()+1,ipix->row()+1,intercepterror);
422  bookkeeper_[detid]["chi2_1d"]->Fill(chi2);
423  bookkeeper_[detid]["chi2_2d"]->setBinContent(ipix->col()+1,ipix->row()+1,chi2);
424  bookkeeper_[detid]["prob_1d"]->Fill(prob);
425  bookkeeper_[detid]["prob_2d"]->setBinContent(ipix->col()+1,ipix->row()+1,prob);
426  bookkeeper_[detid]["lowpoint_1d"]->Fill(xvals[0]);
427  bookkeeper_[detid]["lowpoint_2d"]->setBinContent(ipix->col()+1,ipix->row()+1,xvals[0]);
428  bookkeeper_[detid]["highpoint_1d"]->Fill(xvals[npoints-1]);
429  bookkeeper_[detid]["highpoint_2d"]->setBinContent(ipix->col()+1,ipix->row()+1,xvals[npoints-1]);
430  bookkeeper_[detid]["nfitpoints_1d"]->Fill(npoints);
431  bookkeeper_[detid]["endpoint_1d"]->Fill((255 - intercept)*slope);
432  bookkeeper_[detid]["status_2d"]->setBinContent(ipix->col()+1,ipix->row()+1,status);
433 
434  if(!savePixelHists_)
435  return true;
436  if(detidfinder==listofdetids_.end() && listofdetids_.size()!=0)
437  return true;
438  if(makehistopersistent){
439  std::ostringstream pixelinfo;
440  pixelinfo << "GainCurve_row_" << ipix->row() << "_col_" << ipix->col();
441  std::string tempname=translateDetIdToString(detid);
442  tempname+="_";
443  tempname+=pixelinfo.str();
444 
445  // and book the histo
446  // fill the last value of the vcal array...
447 
448  setDQMDirectory(detid);
449  bookkeeper_pixels_[detid][pixelinfo.str()] = bookDQMHistogram1D(detid,pixelinfo.str(),tempname,105*nallpoints,xvalsall[0],xvalsall[nallpoints-1]*1.05);
450 
451  edm::LogInfo("SiPixelGainCalibrationAnalysis") << "now saving histogram for pixel " << tempname << ", gain = " << slope << ", pedestal = " << intercept << ", chi2/NDF=" << chi2 << "(prob:" << prob << "), fit status " << status;
452  for(int ii=0; ii<nallpoints; ++ii){
453  // std::cout << xvalsall[ii]<<","<<yvalsall[ii]<< " " << tempfloats[ii] << std::endl;
454  bookkeeper_pixels_[detid][pixelinfo.str()]->Fill(xvalsall[ii],yvalsall[ii]);
455  }
456 
457  // addTF1ToDQMMonitoringElement(bookkeeper_pixels_[detid][pixelinfo.str()],func_);
458 
459 
460  if(writeSummary_){
461  summary_<<"row_"<<ipix->row()<<" col_"<<ipix->col();
462  summary_<<" status_"<<status;
463  summary_<<endl;
464 
465  //std::cout<<detid<<" "<<"row " <<ipix->row()<<" col "<<ipix->col()<<" "<<status<<" "<<chi2<<" "<<prob<<" "<<npoints<<" "<<xvals[0]<<" "<<xvals[npoints-1]<<" "<<plateauval<<std::endl;
466  }
467  }
468  return true;
469 }
470 // ------------ method called to do fill new detids ------------
471 void
473 {
474  setDQMDirectory(detid);
475  std::string tempname=translateDetIdToString(detid);
476  bookkeeper_[detid]["gain_1d"] = bookDQMHistogram1D(detid,"Gain1d","gain for "+tempname,100,0.,maxGainInHist_);
477  bookkeeper_[detid]["gain_2d"] = bookDQMHistoPlaquetteSummary2D(detid, "Gain2d","gain for "+tempname);
478  bookkeeper_[detid]["errorgain_2d"] = bookDQMHistoPlaquetteSummary2D(detid, "ErrorGain2d","error on gain for "+tempname);
479  bookkeeper_[detid]["ped_1d"] = bookDQMHistogram1D(detid,"Pedestal1d","pedestal for "+tempname,256,0.,256.0);
480  bookkeeper_[detid]["ped_2d"] = bookDQMHistoPlaquetteSummary2D(detid,"Pedestal2d","pedestal for "+tempname);
481  bookkeeper_[detid]["errorped_2d"] = bookDQMHistoPlaquetteSummary2D(detid,"ErrorPedestal2d","error on pedestal for "+tempname);
482  bookkeeper_[detid]["chi2_1d"] = bookDQMHistogram1D(detid,"GainChi2NDF1d","#chi^{2}/NDOF for "+tempname,100,0.,maxChi2InHist_);
483  bookkeeper_[detid]["chi2_2d"] = bookDQMHistoPlaquetteSummary2D(detid,"GainChi2NDF2d","#chi^{2}/NDOF for "+tempname);
484  bookkeeper_[detid]["prob_1d"] = bookDQMHistogram1D(detid,"GainChi2Prob1d","P(#chi^{2},NDOF) for "+tempname,100,0.,1.0);
485  bookkeeper_[detid]["prob_2d"] = bookDQMHistoPlaquetteSummary2D(detid,"GainChi2Prob2d","P(#chi^{2},NDOF) for "+tempname);
486  bookkeeper_[detid]["status_2d"] = bookDQMHistoPlaquetteSummary2D(detid,"GainFitResult2d","Fit result for "+tempname);
487  bookkeeper_[detid]["endpoint_1d"]= bookDQMHistogram1D(detid,"GainEndPoint1d","point where fit meets ADC=255 for "+tempname,256,0.,256.*scalarVcalHigh_VcalLow_);
488  bookkeeper_[detid]["lowpoint_1d"]= bookDQMHistogram1D(detid,"GainLowPoint1d","lowest fit point for "+tempname,256,0.,256.*scalarVcalHigh_VcalLow_);
489  bookkeeper_[detid]["highpoint_1d"]= bookDQMHistogram1D(detid,"GainHighPoint1d","highest fit point for "+tempname,256,0.,256.*scalarVcalHigh_VcalLow_);
490  bookkeeper_[detid]["nfitpoints_1d"]= bookDQMHistogram1D(detid,"GainNPoints1d","number of fit point for "+tempname,20,0.,20);
491  bookkeeper_[detid]["dynamicrange_2d"]=bookDQMHistoPlaquetteSummary2D(detid,"GainDynamicRange2d","Difference lowest and highest points on gain curve for "+tempname);
492  bookkeeper_[detid]["lowpoint_2d"]=bookDQMHistoPlaquetteSummary2D(detid,"GainLowPoint2d","lowest fit point for "+tempname);
493  bookkeeper_[detid]["highpoint_2d"]=bookDQMHistoPlaquetteSummary2D(detid,"GainHighPoint2d","highest fit point for "+tempname);
494  bookkeeper_[detid]["plateau_2d"]=bookDQMHistoPlaquetteSummary2D(detid,"GainSaturate2d","Highest points on gain curve for "+tempname);
495 
496 }
497 //define this as a plug-in
int i
Definition: DBlmapReader.cc:9
std::map< uint32_t, std::map< std::string, MonitorElement * > > bookkeeper_pixels_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
static const double slope[3]
#define abs(x)
Definition: mlp_lapack.h:159
std::string translateDetIdToString(uint32_t detid)
virtual void calibrationSetup(const edm::EventSetup &iSetup)
int ii
Definition: cuy.py:588
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
SiPixelGainCalibrationAnalysis(const edm::ParameterSet &iConfig)
MonitorElement * bookDQMHistoPlaquetteSummary2D(uint32_t detid, std::string name, std::string title)
dictionary map
Definition: Association.py:205
virtual bool doFits(uint32_t detid, std::vector< SiPixelCalibDigi >::const_iterator ipix)
bool isnan(float x)
Definition: math.h:13
T sqrt(T t)
Definition: SSEVec.h:48
MonitorElement * bookDQMHistogram1D(uint32_t detid, std::string name, std::string title, int nchX, double lowX, double highX)
tuple result
Definition: query.py:137
std::map< uint32_t, std::map< std::string, MonitorElement * > > bookkeeper_
std::vector< float > CalculateAveragePerColumn(uint32_t detid, std::string label)
#define begin
Definition: vmac.h:31
tuple cout
Definition: gather_cfg.py:121
tuple status
Definition: ntuplemaker.py:245
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40