CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiPixelHistoricInfoReader.cc
Go to the documentation of this file.
2 
5 
7 
8 #include <math.h>
9 #include <iostream>
10 #include <sstream>
11 #include <stdio.h>
12 #include <sys/time.h>
13 
14 #include "TH1F.h"
15 #include "TCanvas.h"
16 #include "TPad.h"
17 #include "TStyle.h"
18 
19 
20 using namespace cms;
21 using namespace std;
22 
23 
25  parameterSet_ = pSet;
26 
27  variables_ = parameterSet_.getUntrackedParameter<vstring>("variables");
28  for (int i=0; i<20; i++) variable_[i] = false;
29  for (vector<string>::const_iterator variable = variables_.begin(); variable!=variables_.end(); ++variable) {
30  if (variable->compare("errorType")==0) variable_[ 0] = true;
31  if (variable->compare("ndigis")==0) variable_[ 1] = true;
32  if (variable->compare("adc")==0) variable_[ 2] = true;
33  if (variable->compare("nclusters")==0) variable_[ 3] = true;
34  if (variable->compare("charge")==0) variable_[ 4] = true;
35  if (variable->compare("size")==0) variable_[ 5] = true;
36  if (variable->compare("sizeX")==0) variable_[ 6] = true;
37  if (variable->compare("sizeY")==0) variable_[ 7] = true;
38  if (variable->compare("nRecHits")==0) variable_[ 8] = true;
39  if (variable->compare("residualX")==0) variable_[ 9] = true;
40  if (variable->compare("residualY")==0) variable_[10] = true;
41  if (variable->compare("nPixHitsTrk")==0) variable_[11] = true;
42  if (variable->compare("nNoisPixels")==0) variable_[12] = true;
43  if (variable->compare("nDeadPixels")==0) variable_[13] = true;
44  if (variable->compare("tracks")==0) variable_[14] = true;
45  if (variable->compare("onTrackClusters")==0) variable_[15] = true;
46  if (variable->compare("offTrackClusters")==0) variable_[16] = true;
47  }
48  normEvents_ = parameterSet_.getUntrackedParameter<bool>("normEvents",false);
49  printDebug_ = parameterSet_.getUntrackedParameter<bool>("printDebug",false);
50  makePlots_ = parameterSet_.getUntrackedParameter<bool>("makePlots", true);
51  typePlots_ = parameterSet_.getUntrackedParameter<string>("typePlots", "gif");
52  outputDir_ = parameterSet_.getUntrackedParameter<string>("outputDir", ".");
53  outputFile_ = parameterSet_.getUntrackedParameter<string>("outputFile","pixelhistory.root");
54 
55  firstBeginRun_ = true;
56 }
57 
58 
60 
61 
63  string outputDirFile = outputDir_ + "/" + outputFile_;
64  outputDirFile_ = new TFile(outputDirFile.data(), "RECREATE");
65 }
66 
67 
68 string SiPixelHistoricInfoReader::getMEregionString(uint32_t detID) const {
69  uint32_t localMEdetID = detID;
70  TString regionStr;
71  if (localMEdetID>100000000) { regionStr = "det"; regionStr += localMEdetID; }
72  else if (localMEdetID<40) { regionStr = "FED"; regionStr += localMEdetID; }
73  else if (localMEdetID==80) regionStr = "Barrel";
74  else if (localMEdetID==81) regionStr = "Endcap";
75  else if (localMEdetID>99 && localMEdetID<120) {
76  localMEdetID -= 100;
77  if (localMEdetID<12) {
78  regionStr = "Barrel/";
79  if (localMEdetID<3) { regionStr += "Shell_mI/"; }
80  else if (localMEdetID<6) { regionStr += "Shell_mO/"; localMEdetID -= 3; }
81  else if (localMEdetID<9) { regionStr += "Shell_pI/"; localMEdetID -= 6; }
82  else { regionStr += "Shell_pO/"; localMEdetID -= 9; }
83  regionStr += "Layer_"; regionStr += (localMEdetID+1);
84  }
85  else {
86  regionStr = "Endcap/"; localMEdetID -= 12;
87  if (localMEdetID<2) { regionStr += "HalfCylinder_mI/"; }
88  else if (localMEdetID<4) { regionStr += "HalfCylinder_mO/"; localMEdetID -= 2; }
89  else if (localMEdetID<6) { regionStr += "HalfCylinder_pI/"; localMEdetID -= 4; }
90  else { regionStr += "HalfCylinder_pO/"; localMEdetID -= 6; }
91  regionStr += "Disk_"; regionStr += (localMEdetID+1);
92  }
93  }
94  else if (localMEdetID>999 && localMEdetID<1288) {
95  localMEdetID -= 1000;
96  if (localMEdetID<192) {
97  regionStr = "Barrel/";
98  if (localMEdetID<48) { regionStr += "Shell_mI/"; }
99  else if (localMEdetID<96) { regionStr += "Shell_mO/"; localMEdetID -= 48; }
100  else if (localMEdetID<144) { regionStr += "Shell_pI/"; localMEdetID -= 96; }
101  else { regionStr += "Shell_pO/"; localMEdetID -= 144; }
102  if (localMEdetID<10) { regionStr += "Layer_1/"; }
103  else if (localMEdetID<26) { regionStr += "Layer_2/"; localMEdetID -= 10; }
104  else { regionStr += "Layer_3/"; localMEdetID -= 26; }
105  regionStr += "Ladder_"; regionStr += (localMEdetID+1);
106  }
107  else {
108  regionStr = "Endcap/"; localMEdetID -= 192;
109  if (localMEdetID<24) { regionStr += "HalfCylinder_mI/"; }
110  else if (localMEdetID<48) { regionStr += "HalfCylinder_mO/"; localMEdetID -= 24; }
111  else if (localMEdetID<72) { regionStr += "HalfCylinder_pI/"; localMEdetID -= 48; }
112  else { regionStr += "HalfCylinder_pO/"; localMEdetID -= 72; }
113  if (localMEdetID<12) { regionStr += "Disk_1/"; }
114  else { regionStr += "Disk_2/"; localMEdetID -= 12; }
115  regionStr += "Blade_"; regionStr += (localMEdetID+1);
116  }
117  }
118  else if (localMEdetID==666) regionStr = "Dummy detID=666";
119  else { regionStr = "Wrong detID="; regionStr += localMEdetID; }
120 
121  return regionStr.Data();
122 }
123 
124 
127  iSetup.get<SiPixelPerformanceSummaryRcd>().get(pSummary);
128 
129  if (firstBeginRun_) {
130  firstBeginRun_ = false;
131 
132  allDetIds.clear();
133  allDetIds = pSummary->getAllDetIds(); // allDetIds.push_back(369345800);
134 
135  AllDetHistograms = new TObjArray();
136 
137  for (vector<uint32_t>::const_iterator iDet = allDetIds.begin(); iDet!=allDetIds.end(); ++iDet) {
138  string detRegion = getMEregionString(*iDet);
139 
140  if (variable_[0] && *iDet<40) {
141  for (int pBin=0; pBin<15; pBin++) {
142  hisID = "errorType"; hisID += (pBin+25); hisID += "_"; hisID += *iDet;
143  title = "errorType"; title += (pBin+25); title += " "; title += detRegion;
144  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
145  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
146  }
147  }
148  if (variable_[1] && *iDet>99) {
149  hisID = "nDigis_"; hisID += *iDet;
150  title = "nDigis "; title += detRegion;
151  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
152  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
153 
154  hisID = "nDigis_mFr_"; hisID += *iDet;
155  title = "Fraction of Empty Modules in nDigis "; title += detRegion;
156  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
157  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
158  }
159  if (variable_[2] && *iDet>99) {
160  hisID = "adc_"; hisID += *iDet;
161  title = "adc "; title += detRegion;
162  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
163  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
164 
165  hisID = "adc_mFr_"; hisID += *iDet;
166  title = "Fraction of Empty Modules in adc "; title += detRegion;
167  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
168  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
169  }
170  if (variable_[3] && *iDet>99) {
171  hisID = "nClusters_"; hisID += *iDet;
172  title = "nClusters "; title += detRegion;
173  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
174  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
175 
176  hisID = "nClusters_mFr_"; hisID += *iDet;
177  title = "Fraction of Empty Modules in nClusters "; title += detRegion;
178  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
179  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
180  }
181  if (variable_[4] && *iDet>99) {
182  hisID = "charge_"; hisID += *iDet;
183  title = "charge "; title += detRegion;
184  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
185  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
186 
187  hisID = "charge_mFr_"; hisID += *iDet;
188  title = "Fraction of Empty Modules in charge "; title += detRegion;
189  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
190  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
191  }
192  if (variable_[5] && *iDet>99) {
193  hisID = "clusterSize_"; hisID += *iDet;
194  title = "clusterSize "; title += detRegion;
195  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
196  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
197 
198  hisID = "clusterSize_mFr_"; hisID += *iDet;
199  title = "Fraction of Empty Modules in clusterSize "; title += detRegion;
200  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
201  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
202  }
203  if (variable_[6] && *iDet>99) {
204  hisID = "clusterSizeX_"; hisID += *iDet;
205  title = "clusterSizeX "; title += detRegion;
206  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
207  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
208 
209  hisID = "clusterSizeX_mFr_"; hisID += *iDet;
210  title = "Fraction of Empty Modules in clusterSizeX "; title += detRegion;
211  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
212  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
213  }
214  if (variable_[7] && *iDet>99) {
215  hisID = "clusterSizeY_"; hisID += *iDet;
216  title = "clusterSizeY "; title += detRegion;
217  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
218  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
219 
220  hisID = "clusterSizeY_mFr_"; hisID += *iDet;
221  title = "Fraction of Empty Modules in clusterSizeY "; title += detRegion;
222  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
223  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
224  }
225  if (variable_[8] && *iDet>99) {
226  hisID = "nRecHits_"; hisID += *iDet;
227  title = "nRecHits "; title += detRegion;
228  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
229  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
230 
231  hisID = "nRecHits_mFr_"; hisID += *iDet;
232  title = "Fraction of Empty Modules in nRecHits "; title += detRegion;
233  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
234  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
235  }
236  if (variable_[9] && *iDet>99) {
237  hisID = "residualX_"; hisID += *iDet;
238  title = "residualX "; title += detRegion;
239  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
240  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
241 
242  hisID = "residualX_mFr_"; hisID += *iDet;
243  title = "Fraction of Empty Modules in residualX "; title += detRegion;
244  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
245  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
246  }
247  if (variable_[10] && *iDet>99) {
248  hisID = "residualY_"; hisID += *iDet;
249  title = "residualY "; title += detRegion;
250  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
251  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
252 
253  hisID = "residualY_mFr_"; hisID += *iDet;
254  title = "Fraction of Empty Modules in residualY "; title += detRegion;
255  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
256  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
257  }
258  if (variable_[11] && *iDet>99) {
259  hisID = "nPixHitsTrk_"; hisID += *iDet;
260  title = "nPixHitsTrk "; title += detRegion;
261  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
262  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
263  }
264  if (variable_[12] && *iDet>99) {
265  hisID = "nNoisPixels_"; hisID += *iDet;
266  title = "nNoisPixels "; title += detRegion;
267  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
268  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
269  }
270  if (variable_[13] && *iDet>99) {
271  hisID = "nDeadPixels_"; hisID += *iDet;
272  title = "nDeadPixels "; title += detRegion;
273  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
274  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
275  }
276  if (variable_[14] && (*iDet==80 || *iDet==81)) {
277  hisID = "trkFrac_"; hisID += *iDet;
278  title = "Track Fraction - "; title += detRegion; title += "/All";
279  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
280  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
281  }
282  if (variable_[15] && (*iDet==80 || *iDet==81)) {
283  hisID = "nOnTrackClusters_"; hisID += *iDet;
284  title = "nOnTrackClusters "; title += detRegion;
285  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
286  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
287 
288  hisID = "onTrackClusterCharge_"; hisID += *iDet;
289  title = "onTrackClusterCharge "; title += detRegion;
290  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
291  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
292 
293  hisID = "onTrackClusterSize_"; hisID += *iDet;
294  title = "onTrackClusterSize "; title += detRegion;
295  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
296  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
297  }
298  if (variable_[16] && (*iDet==80 || *iDet==81)) {
299  hisID = "nOffTrackClusters_"; hisID += *iDet;
300  title = "nOffTrackClusters "; title += detRegion;
301  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
302  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
303 
304  hisID = "offTrackClusterCharge_"; hisID += *iDet;
305  title = "offTrackClusterCharge "; title += detRegion;
306  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
307  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
308 
309  hisID = "offTrackClusterSize_"; hisID += *iDet;
310  title = "offTrackClusterSize "; title += detRegion;
311  AllDetHistograms->Add(new TH1F(hisID, title, 1, 0, 1));
312  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBit(TH1::kCanRebin);
313  }
314  }
315  }
316  if (pSummary->getRunNumber()==run.run()) { // pSummary's run changes only when the table is newly retrieved
317  TString sRun; sRun += pSummary->getRunNumber();
318  float nEvents = pSummary->getNumberOfEvents();
319  float SF = 1.0; if (normEvents_) SF = 100000.0/nEvents;
320 
321  if (printDebug_) cout << "run "<< sRun.Data() <<" with "<< nEvents <<" events" << endl;
322 
323  for (vector<uint32_t>::const_iterator iDet = allDetIds.begin(); iDet!=allDetIds.end(); ++iDet) {
324  vector<float> performances = pSummary->getDetSummary(*iDet);
325 
326  if (*iDet<40) {
327  if (variable_[0]) {
328  for (int pBin=0; pBin<15; pBin++) {
329  hisID = "errorType"; hisID += (pBin+25); hisID += "_"; hisID += *iDet;
330  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[pBin]/nEvents);
331  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
332  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, sqrt(performances[pBin])/nEvents);
333  }
334  }
335  }
336  if (*iDet>99) {
337  if (variable_[1]) {
338  hisID = "nDigis_"; hisID += *iDet;
339  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[15]*SF);
340  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
341  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, performances[16]*SF);
342 
343  hisID = "nDigis_mFr_"; hisID += *iDet;
344  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[17]);
345  }
346  if (variable_[2]) {
347  hisID = "adc_"; hisID += *iDet;
348  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[18]*SF);
349  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
350  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, performances[19]*SF);
351 
352  hisID = "adc_mFr_"; hisID += *iDet;
353  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[20]);
354  }
355  if (variable_[3]) {
356  hisID = "nClusters_"; hisID += *iDet;
357  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[21]*SF);
358  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
359  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, performances[22]*SF);
360 
361  hisID = "nClusters_mFr_"; hisID += *iDet;
362  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[23]);
363  }
364  if (variable_[4]) {
365  hisID = "charge_"; hisID += *iDet;
366  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[24]*SF);
367  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
368  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, performances[25]*SF);
369 
370  hisID = "charge_mFr_"; hisID += *iDet;
371  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[26]);
372  }
373  if (variable_[5]) {
374  hisID = "clusterSize_"; hisID += *iDet;
375  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[27]*SF);
376  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
377  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, performances[28]*SF);
378 
379  hisID = "clusterSize_mFr_"; hisID += *iDet;
380  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[29]);
381  }
382  if (variable_[6]) {
383  hisID = "clusterSizeX_"; hisID += *iDet;
384  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[30]*SF);
385  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
386  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, performances[31]*SF);
387 
388  hisID = "clusterSizeX_mFr_"; hisID += *iDet;
389  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[32]);
390  }
391  if (variable_[7]) {
392  hisID = "clusterSizeY_"; hisID += *iDet;
393  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[33]*SF);
394  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
395  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, performances[34]*SF);
396 
397  hisID = "clusterSizeY_mFr_"; hisID += *iDet;
398  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[35]);
399  }
400  if (variable_[8]) {
401  hisID = "nRecHits_"; hisID += *iDet;
402  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[36]*SF);
403  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
404  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, performances[37]*SF);
405 
406  hisID = "nRecHits_mFr_"; hisID += *iDet;
407  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[38]);
408  }
409  if (variable_[9]) {
410  hisID = "residualX_"; hisID += *iDet;
411  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[39]*SF);
412  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
413  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, performances[40]*SF);
414 
415  hisID = "residualX_mFr_"; hisID += *iDet;
416  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[41]);
417  }
418  if (variable_[10]) {
419  hisID = "residualY_"; hisID += *iDet;
420  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[42]*SF);
421  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
422  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, performances[43]*SF);
423 
424  hisID = "residualY_mFr_"; hisID += *iDet;
425  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[44]);
426  }
427  if (variable_[11]) {
428  hisID = "nPixHitsTrk_"; hisID += *iDet;
429  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[45]*SF);
430  }
431  if (variable_[12]) {
432  hisID = "nNoisPixels_"; hisID += *iDet;
433  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[46]*SF);
434  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
435  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, sqrt(performances[46])/sqrt(nEvents));
436  }
437  if (variable_[13]) {
438  hisID = "nDeadPixels_"; hisID += *iDet;
439  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[47]*SF);
440  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
441  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, sqrt(performances[47])/sqrt(nEvents));
442  }
443  }
444  if (*iDet==80 || *iDet==81) {
445  if (variable_[14]) {
446  hisID = "trkFrac_"; hisID += *iDet;
447  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[48]);
448  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
449  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, performances[49]);
450  }
451  if (variable_[15]) {
452  hisID = "nOnTrackClusters_"; hisID += *iDet;
453  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[50]*SF);
454 
455  hisID = "onTrackClusterCharge_"; hisID += *iDet;
456  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[52]*SF);
457  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
458  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, performances[53]*SF);
459 
460  hisID = "onTrackClusterSize_"; hisID += *iDet;
461  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[56]*SF);
462  int jBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
463  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(jBin, performances[57]*SF);
464  }
465  if (variable_[16]) {
466  hisID = "nOffTrackClusters_"; hisID += *iDet;
467  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[51]*SF);
468 
469  hisID = "offTrackClusterCharge_"; hisID += *iDet;
470  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[54]*SF);
471  int iBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
472  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(iBin, performances[55]*SF);
473 
474  hisID = "offTrackClusterSize_"; hisID += *iDet;
475  ((TH1F*)AllDetHistograms->FindObject(hisID))->Fill(sRun, performances[58]*SF);
476  int jBin = ((TH1F*)AllDetHistograms->FindObject(hisID))->GetXaxis()->FindBin(sRun);
477  ((TH1F*)AllDetHistograms->FindObject(hisID))->SetBinError(jBin, performances[59]*SF);
478  }
479  }
480  }
481  }
482 }
483 
484 
486 
487 
489 
490 
492  for (vector<uint32_t>::const_iterator iDet=allDetIds.begin(); iDet!=allDetIds.end(); ++iDet) {
493  if (*iDet<40) {
494  if (variable_[0]) {
495  for (int pBin=0; pBin<15; pBin++) {
496  hisID = "errorType"; hisID += (pBin+25); hisID += "_"; hisID += *iDet;
497  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
498  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
499 
500  }
501  }
502  }
503  if (*iDet>99) {
504  if (variable_[1]) {
505  hisID = "nDigis_"; hisID += *iDet;
506  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
507  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
508 
509  hisID = "nDigis_mFr_"; hisID += *iDet;
510  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
511  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
512  }
513  if (variable_[2]) {
514  hisID = "adc_"; hisID += *iDet;
515  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
516  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
517 
518  hisID = "adc_mFr_"; hisID += *iDet;
519  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
520  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
521  }
522  if (variable_[3]) {
523  hisID = "nClusters_"; hisID += *iDet;
524  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
525  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
526 
527  hisID = "nClusters_mFr_"; hisID += *iDet;
528  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
529  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
530  }
531  if (variable_[4]) {
532  hisID = "charge_"; hisID += *iDet;
533  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
534  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
535 
536  hisID = "charge_mFr_"; hisID += *iDet;
537  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
538  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
539  }
540  if (variable_[5]) {
541  hisID = "clusterSize_"; hisID += *iDet;
542  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
543  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
544 
545  hisID = "clusterSize_mFr_"; hisID += *iDet;
546  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
547  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
548  }
549  if (variable_[6]) {
550  hisID = "clusterSizeX_"; hisID += *iDet;
551  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
552  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
553 
554  hisID = "clusterSizeX_mFr_"; hisID += *iDet;
555  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
556  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
557  }
558  if (variable_[7]) {
559  hisID = "clusterSizeY_"; hisID += *iDet;
560  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
561  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
562 
563  hisID = "clusterSizeY_mFr_"; hisID += *iDet;
564  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
565  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
566  }
567  if (variable_[8]) {
568  hisID = "nRecHits_"; hisID += *iDet;
569  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
570  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
571 
572  hisID = "nRecHits_mFr_"; hisID += *iDet;
573  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
574  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
575  }
576  if (variable_[9]) {
577  hisID = "residualX_"; hisID += *iDet;
578  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
579  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
580 
581  hisID = "residualX_mFr_"; hisID += *iDet;
582  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
583  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
584  }
585  if (variable_[10]) {
586  hisID = "residualY_"; hisID += *iDet;
587  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
588  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
589 
590  hisID = "residualY_mFr_"; hisID += *iDet;
591  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
592  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
593  }
594  if (variable_[11]) {
595  hisID = "nPixHitsTrk_"; hisID += *iDet;
596  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
597  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
598  }
599  if (variable_[12]) {
600  hisID = "nNoisPixels_"; hisID += *iDet;
601  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
602  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
603  }
604  if (variable_[13]) {
605  hisID = "nDeadPixels_"; hisID += *iDet;
606  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
607  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
608  }
609  }
610  if (*iDet==80 || *iDet==81) {
611  if (variable_[14]) {
612  hisID = "trkFrac_"; hisID += *iDet;
613  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
614  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
615  }
616  if (variable_[15]) {
617  hisID = "nOnTrackClusters_"; hisID += *iDet;
618  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
619  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
620 
621  hisID = "onTrackClusterCharge_"; hisID += *iDet;
622  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
623  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
624 
625  hisID = "onTrackClusterSize_"; hisID += *iDet;
626  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
627  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
628  }
629  if (variable_[16]) {
630  hisID = "nOffTrackClusters_"; hisID += *iDet;
631  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
632  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
633 
634  hisID = "offTrackClusterCharge_"; hisID += *iDet;
635  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
636  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
637 
638  hisID = "offTrackClusterSize_"; hisID += *iDet;
639  ((TH1F*)AllDetHistograms->FindObject(hisID))->LabelsDeflate("X");
640  ((TH1F*)AllDetHistograms->FindObject(hisID))->Write();
641  }
642  }
643  }
644  outputDirFile_->Write(); if (makePlots_) plot();
645  outputDirFile_->Close();
646 }
647 
648 
650  ostringstream spa; for (unsigned int i=0; i<typePlots_.size(); i++) spa << " ";
651  cout << "************************************ "<< spa.str() <<" *************" << endl;
652  cout << "SiPixelHistoricInfoReader::plot() in "<< typePlots_<<" with patience" << endl;
653  cout << "************************************ "<< spa.str() <<" *************" << endl;
654 
655  TStyle* sty1 = new TStyle("sty1","My Style.1 for Pixel History Plots");
656  sty1->SetCanvasDefW(1080);
657  sty1->SetCanvasDefH(250);
658  sty1->SetCanvasBorderMode(0);
659  sty1->SetPadBorderMode(0);
660  sty1->SetPadLeftMargin(0.05);
661  sty1->SetPadRightMargin(0.03);
662  sty1->SetPadTopMargin(0.16);
663  sty1->SetPadBottomMargin(0.15);
664  sty1->SetTitleBorderSize(0);
665  sty1->SetTitleFontSize(0.07);
666  sty1->SetOptStat(0);
667  sty1->cd();
668 
669  TCanvas* c1 = new TCanvas("c1","c1",1080,250);
670  c1->UseCurrentStyle();
671 
672  for (vector<uint32_t>::const_iterator iDet=allDetIds.begin(); iDet!=allDetIds.end(); ++iDet) {
673  if (*iDet<40) {
674  if (variable_[0]) {
675  for (int pBin=0; pBin<15; pBin++) {
676  hisID = "errorType"; hisID += (pBin+25); hisID += "_"; hisID += *iDet;
677  TH1F* errFED = (TH1F*)AllDetHistograms->FindObject(hisID);
678  if (errFED->Integral()>0.0) {
679  errFED->SetMinimum(0.0);
680  errFED->GetXaxis()->SetLabelSize(0.08);
681  errFED->GetYaxis()->SetLabelSize(0.06);
682  errFED->SetMarkerStyle(8);
683  errFED->SetMarkerSize(0.2);
684  errFED->Draw();
685  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
686  c1->SaveAs(title);
687  }
688  }
689  }
690  }
691  if (*iDet==80 || *iDet==81) {
692  if (variable_[14]) {
693  hisID = "trkFrac_"; hisID += *iDet;
694  TH1F* trkFrac = (TH1F*)AllDetHistograms->FindObject(hisID);
695  trkFrac->SetMinimum(0.0);
696  trkFrac->SetMarkerStyle(8);
697  trkFrac->SetMarkerSize(0.2);
698  trkFrac->GetXaxis()->SetLabelSize(0.08);
699  trkFrac->GetYaxis()->SetLabelSize(0.06);
700  trkFrac->Draw();
701  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
702  c1->SaveAs(title);
703  }
704  if (variable_[15]) {
705  hisID = "nOnTrackClusters_"; hisID += *iDet;
706  TH1F* nOnTrackClusters = (TH1F*)AllDetHistograms->FindObject(hisID);
707  nOnTrackClusters->SetMinimum(0.0);
708  nOnTrackClusters->SetMarkerStyle(8);
709  nOnTrackClusters->SetMarkerSize(0.2);
710  nOnTrackClusters->GetXaxis()->SetLabelSize(0.08);
711  nOnTrackClusters->GetYaxis()->SetLabelSize(0.06);
712  nOnTrackClusters->Draw();
713  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
714  c1->SaveAs(title);
715 
716  hisID = "onTrackClusterCharge_"; hisID += *iDet;
717  TH1F* onTrackClusterCharge = (TH1F*)AllDetHistograms->FindObject(hisID);
718  onTrackClusterCharge->SetMinimum(0.0);
719  onTrackClusterCharge->SetMarkerStyle(8);
720  onTrackClusterCharge->SetMarkerSize(0.2);
721  onTrackClusterCharge->GetXaxis()->SetLabelSize(0.08);
722  onTrackClusterCharge->GetYaxis()->SetLabelSize(0.06);
723  onTrackClusterCharge->Draw();
724  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
725  c1->SaveAs(title);
726 
727  hisID = "onTrackClusterSize_"; hisID += *iDet;
728  TH1F* onTrackClusterSize = (TH1F*)AllDetHistograms->FindObject(hisID);
729  onTrackClusterSize->SetMinimum(0.0);
730  onTrackClusterSize->SetMarkerStyle(8);
731  onTrackClusterSize->SetMarkerSize(0.2);
732  onTrackClusterSize->GetXaxis()->SetLabelSize(0.08);
733  onTrackClusterSize->GetYaxis()->SetLabelSize(0.06);
734  onTrackClusterSize->Draw();
735  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
736  c1->SaveAs(title);
737  }
738  if (variable_[16]) {
739  hisID = "nOffTrackClusters_"; hisID += *iDet;
740  TH1F* nOffTrackClusters = (TH1F*)AllDetHistograms->FindObject(hisID);
741  nOffTrackClusters->SetMinimum(0.0);
742  nOffTrackClusters->SetMarkerStyle(8);
743  nOffTrackClusters->SetMarkerSize(0.2);
744  nOffTrackClusters->GetXaxis()->SetLabelSize(0.08);
745  nOffTrackClusters->GetYaxis()->SetLabelSize(0.06);
746  nOffTrackClusters->Draw();
747  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
748  c1->SaveAs(title);
749 
750  hisID = "offTrackClusterCharge_"; hisID += *iDet;
751  TH1F* offTrackClusterCharge = (TH1F*)AllDetHistograms->FindObject(hisID);
752  offTrackClusterCharge->SetMinimum(0.0);
753  offTrackClusterCharge->SetMarkerStyle(8);
754  offTrackClusterCharge->SetMarkerSize(0.2);
755  offTrackClusterCharge->GetXaxis()->SetLabelSize(0.08);
756  offTrackClusterCharge->GetYaxis()->SetLabelSize(0.06);
757  offTrackClusterCharge->Draw();
758  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
759  c1->SaveAs(title);
760 
761  hisID = "offTrackClusterSize_"; hisID += *iDet;
762  TH1F* offTrackClusterSize = (TH1F*)AllDetHistograms->FindObject(hisID);
763  offTrackClusterSize->SetMinimum(0.0);
764  offTrackClusterSize->SetMarkerStyle(8);
765  offTrackClusterSize->SetMarkerSize(0.2);
766  offTrackClusterSize->GetXaxis()->SetLabelSize(0.08);
767  offTrackClusterSize->GetYaxis()->SetLabelSize(0.06);
768  offTrackClusterSize->Draw();
769  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
770  c1->SaveAs(title);
771  }
772  }
773  if (*iDet>99) {
774  if (variable_[1]) {
775  hisID = "nDigis_"; hisID += *iDet;
776  TH1F* nDigis = (TH1F*)AllDetHistograms->FindObject(hisID);
777  nDigis->SetMinimum(0.0);
778  nDigis->SetMarkerStyle(8);
779  nDigis->SetMarkerSize(0.2);
780  nDigis->GetXaxis()->SetLabelSize(0.08);
781  nDigis->GetYaxis()->SetLabelSize(0.06);
782  nDigis->Draw();
783  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
784  c1->SaveAs(title);
785  }
786  if (variable_[2]) {
787  hisID = "adc_"; hisID += *iDet;
788  TH1F* adc = (TH1F*)AllDetHistograms->FindObject(hisID);
789  adc->SetMinimum(0.0);
790  adc->SetMarkerStyle(8);
791  adc->SetMarkerSize(0.2);
792  adc->GetXaxis()->SetLabelSize(0.08);
793  adc->GetYaxis()->SetLabelSize(0.06);
794  adc->Draw();
795  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
796  c1->SaveAs(title);
797  }
798  if (variable_[3]) {
799  hisID = "nClusters_"; hisID += *iDet;
800  TH1F* nClusters = (TH1F*)AllDetHistograms->FindObject(hisID);
801  nClusters->SetMinimum(0.0);
802  nClusters->SetMarkerStyle(8);
803  nClusters->SetMarkerSize(0.2);
804  nClusters->GetXaxis()->SetLabelSize(0.08);
805  nClusters->GetYaxis()->SetLabelSize(0.06);
806  nClusters->Draw();
807  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
808  c1->SaveAs(title);
809  }
810  if (variable_[4]) {
811  hisID = "charge_"; hisID += *iDet;
812  TH1F* charge = (TH1F*)AllDetHistograms->FindObject(hisID);
813  charge->SetMinimum(0.0);
814  charge->SetMarkerStyle(8);
815  charge->SetMarkerSize(0.2);
816  charge->GetXaxis()->SetLabelSize(0.08);
817  charge->GetYaxis()->SetLabelSize(0.06);
818  charge->Draw();
819  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
820  c1->SaveAs(title);
821  }
822  if (variable_[5]) {
823  hisID = "clusterSize_"; hisID += *iDet;
824  TH1F* clusterSize = (TH1F*)AllDetHistograms->FindObject(hisID);
825  clusterSize->SetMinimum(0.0);
826  clusterSize->SetMarkerStyle(8);
827  clusterSize->SetMarkerSize(0.2);
828  clusterSize->GetXaxis()->SetLabelSize(0.08);
829  clusterSize->GetYaxis()->SetLabelSize(0.06);
830  clusterSize->Draw();
831  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
832  c1->SaveAs(title);
833  }
834  if (variable_[6]) {
835  hisID = "clusterSizeX_"; hisID += *iDet;
836  TH1F* sizeX = (TH1F*)AllDetHistograms->FindObject(hisID);
837  sizeX->SetMinimum(0.0);
838  sizeX->SetMarkerStyle(8);
839  sizeX->SetMarkerSize(0.2);
840  sizeX->GetXaxis()->SetLabelSize(0.08);
841  sizeX->GetYaxis()->SetLabelSize(0.06);
842  sizeX->Draw();
843  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
844  c1->SaveAs(title);
845  }
846  if (variable_[7]) {
847  hisID = "clusterSizeY_"; hisID += *iDet;
848  TH1F* sizeY = (TH1F*)AllDetHistograms->FindObject(hisID);
849  sizeY->SetMinimum(0.0);
850  sizeY->SetMarkerStyle(8);
851  sizeY->SetMarkerSize(0.2);
852  sizeY->GetXaxis()->SetLabelSize(0.08);
853  sizeY->GetYaxis()->SetLabelSize(0.06);
854  sizeY->Draw();
855  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
856  c1->SaveAs(title);
857  }
858  if (variable_[8]) {
859  hisID = "nRecHits_"; hisID += *iDet;
860  TH1F* nRecHits = (TH1F*)AllDetHistograms->FindObject(hisID);
861  nRecHits->SetMinimum(0.0);
862  nRecHits->SetMarkerStyle(8);
863  nRecHits->SetMarkerSize(0.2);
864  nRecHits->GetXaxis()->SetLabelSize(0.08);
865  nRecHits->GetYaxis()->SetLabelSize(0.06);
866  nRecHits->Draw();
867  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
868  c1->SaveAs(title);
869  }
870  if (variable_[9]) {
871  hisID = "residualX_"; hisID += *iDet;
872  TH1F* residualX = (TH1F*)AllDetHistograms->FindObject(hisID);
873  residualX->SetMinimum(0.0);
874  residualX->SetMarkerStyle(8);
875  residualX->SetMarkerSize(0.2);
876  residualX->GetXaxis()->SetLabelSize(0.08);
877  residualX->GetYaxis()->SetLabelSize(0.06);
878  residualX->Draw();
879  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
880  c1->SaveAs(title);
881  }
882  if (variable_[10]) {
883  hisID = "residualY_"; hisID += *iDet;
884  TH1F* residualY = (TH1F*)AllDetHistograms->FindObject(hisID);
885  residualY->SetMinimum(0.0);
886  residualY->SetMarkerStyle(8);
887  residualY->SetMarkerSize(0.2);
888  residualY->GetXaxis()->SetLabelSize(0.08);
889  residualY->GetYaxis()->SetLabelSize(0.06);
890  residualY->Draw();
891  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
892  c1->SaveAs(title);
893  }
894  if (variable_[11]) {
895  hisID = "nPixHitsTrk_"; hisID += *iDet;
896  TH1F* nPixHitsTrk = (TH1F*)AllDetHistograms->FindObject(hisID);
897  nPixHitsTrk->SetMinimum(0.0);
898  nPixHitsTrk->SetMarkerStyle(8);
899  nPixHitsTrk->SetMarkerSize(0.2);
900  nPixHitsTrk->GetXaxis()->SetLabelSize(0.08);
901  nPixHitsTrk->GetYaxis()->SetLabelSize(0.06);
902  nPixHitsTrk->Draw();
903  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
904  c1->SaveAs(title);
905  }
906  if (variable_[12]) {
907  hisID = "nNoisPixels_"; hisID += *iDet;
908  TH1F* nNoisPixels = (TH1F*)AllDetHistograms->FindObject(hisID);
909  nNoisPixels->SetMinimum(0.0);
910  nNoisPixels->SetMarkerStyle(8);
911  nNoisPixels->SetMarkerSize(0.2);
912  nNoisPixels->GetXaxis()->SetLabelSize(0.08);
913  nNoisPixels->GetYaxis()->SetLabelSize(0.06);
914  nNoisPixels->Draw();
915  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
916  c1->SaveAs(title);
917  }
918  if (variable_[13]) {
919  hisID = "nDeadPixels_"; hisID += *iDet;
920  TH1F* nDeadPixels = (TH1F*)AllDetHistograms->FindObject(hisID);
921  nDeadPixels->SetMinimum(0.0);
922  nDeadPixels->SetMarkerStyle(8);
923  nDeadPixels->SetMarkerSize(0.2);
924  nDeadPixels->GetXaxis()->SetLabelSize(0.08);
925  nDeadPixels->GetYaxis()->SetLabelSize(0.06);
926  nDeadPixels->Draw();
927  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
928  c1->SaveAs(title);
929  }
930  }
931  }
932  TStyle* sty2 = new TStyle("mSty2","My Style.2 for Pixel History Plots");
933  sty2->SetCanvasDefW(1080);
934  sty2->SetCanvasDefH(135);
935  sty2->SetCanvasBorderMode(0);
936  sty2->SetPadBorderMode(0);
937  sty2->SetPadLeftMargin(0.05);
938  sty2->SetPadRightMargin(0.03);
939  sty2->SetPadTopMargin(0.18);
940  sty2->SetPadBottomMargin(0.31);
941  sty2->SetTitleBorderSize(0);
942  sty2->SetTitleFontSize(0.144);
943  sty2->SetTitleX(0.409);
944  sty2->SetOptStat(0);
945  sty2->cd();
946 
947  TCanvas* c2 = new TCanvas("c2","c2",1080,135);
948  c2->UseCurrentStyle();
949 
950  for (vector<uint32_t>::const_iterator iDet=allDetIds.begin(); iDet!=allDetIds.end(); ++iDet) {
951  if (*iDet>99) {
952  if (variable_[1]) {
953  hisID = "nDigis_mFr_"; hisID += *iDet;
954  (TH1F*)AllDetHistograms->FindObject(hisID);
955  TH1F* mFr = (TH1F*)AllDetHistograms->FindObject(hisID);
956  mFr->SetMinimum(0.0);
957  mFr->GetXaxis()->SetLabelOffset(0.009);
958  mFr->GetXaxis()->SetLabelSize(0.165);
959  mFr->GetYaxis()->SetLabelSize(0.120);
960  mFr->Draw();
961  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
962  c2->SaveAs(title);
963  }
964  if (variable_[2]) {
965  hisID = "adc_mFr_"; hisID += *iDet;
966  TH1F* mFr = (TH1F*)AllDetHistograms->FindObject(hisID);
967  mFr->SetMinimum(0.0);
968  mFr->GetXaxis()->SetLabelOffset(0.009);
969  mFr->GetXaxis()->SetLabelSize(0.165);
970  mFr->GetYaxis()->SetLabelSize(0.120);
971  mFr->Draw();
972  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
973  c2->SaveAs(title);
974  }
975  if (variable_[3]) {
976  hisID = "nClusters_mFr_"; hisID += *iDet;
977  TH1F* mFr = (TH1F*)AllDetHistograms->FindObject(hisID);
978  mFr->SetMinimum(0.0);
979  mFr->GetXaxis()->SetLabelOffset(0.009);
980  mFr->GetXaxis()->SetLabelSize(0.165);
981  mFr->GetYaxis()->SetLabelSize(0.120);
982  mFr->Draw();
983  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
984  c2->SaveAs(title);
985  }
986  if (variable_[4]) {
987  hisID = "charge_mFr_"; hisID += *iDet;
988  TH1F* mFr = (TH1F*)AllDetHistograms->FindObject(hisID);
989  mFr->SetMinimum(0.0);
990  mFr->GetXaxis()->SetLabelOffset(0.009);
991  mFr->GetXaxis()->SetLabelSize(0.165);
992  mFr->GetYaxis()->SetLabelSize(0.120);
993  mFr->Draw();
994  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
995  c2->SaveAs(title);
996  }
997  if (variable_[5]) {
998  hisID = "clusterSize_mFr_"; hisID += *iDet;
999  TH1F* mFr = (TH1F*)AllDetHistograms->FindObject(hisID);
1000  mFr->SetMinimum(0.0);
1001  mFr->GetXaxis()->SetLabelOffset(0.009);
1002  mFr->GetXaxis()->SetLabelSize(0.165);
1003  mFr->GetYaxis()->SetLabelSize(0.120);
1004  mFr->Draw();
1005  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
1006  c2->SaveAs(title);
1007  }
1008  if (variable_[6]) {
1009  hisID = "clusterSizeX_mFr_"; hisID += *iDet;
1010  TH1F* mFr = (TH1F*)AllDetHistograms->FindObject(hisID);
1011  mFr->SetMinimum(0.0);
1012  mFr->GetXaxis()->SetLabelOffset(0.009);
1013  mFr->GetXaxis()->SetLabelSize(0.165);
1014  mFr->GetYaxis()->SetLabelSize(0.120);
1015  mFr->Draw();
1016  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
1017  c2->SaveAs(title);
1018  }
1019  if (variable_[7]) {
1020  hisID = "clusterSizeY_mFr_"; hisID += *iDet;
1021  TH1F* mFr = (TH1F*)AllDetHistograms->FindObject(hisID);
1022  mFr->SetMinimum(0.0);
1023  mFr->GetXaxis()->SetLabelOffset(0.009);
1024  mFr->GetXaxis()->SetLabelSize(0.165);
1025  mFr->GetYaxis()->SetLabelSize(0.120);
1026  mFr->Draw();
1027  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
1028  c2->SaveAs(title);
1029  }
1030  if (variable_[8]) {
1031  hisID = "nRecHits_mFr_"; hisID += *iDet;
1032  TH1F* mFr = (TH1F*)AllDetHistograms->FindObject(hisID);
1033  mFr->SetMinimum(0.0);
1034  mFr->GetXaxis()->SetLabelOffset(0.009);
1035  mFr->GetXaxis()->SetLabelSize(0.165);
1036  mFr->GetYaxis()->SetLabelSize(0.120);
1037  mFr->Draw();
1038  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
1039  c2->SaveAs(title);
1040  }
1041  if (variable_[9]) {
1042  hisID = "residualX_mFr_"; hisID += *iDet;
1043  TH1F* mFr = (TH1F*)AllDetHistograms->FindObject(hisID);
1044  mFr->SetMinimum(0.0);
1045  mFr->GetXaxis()->SetLabelOffset(0.009);
1046  mFr->GetXaxis()->SetLabelSize(0.165);
1047  mFr->GetYaxis()->SetLabelSize(0.120);
1048  mFr->Draw();
1049  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
1050  c2->SaveAs(title);
1051  }
1052  if (variable_[10]) {
1053  hisID = "residualY_mFr_"; hisID += *iDet;
1054  TH1F* mFr = (TH1F*)AllDetHistograms->FindObject(hisID);
1055  mFr->SetMinimum(0.0);
1056  mFr->GetXaxis()->SetLabelOffset(0.009);
1057  mFr->GetXaxis()->SetLabelSize(0.165);
1058  mFr->GetYaxis()->SetLabelSize(0.120);
1059  mFr->Draw();
1060  title = outputDir_; title += "/"; title += hisID; title += "."; title += typePlots_;
1061  c2->SaveAs(title);
1062  }
1063  }
1064  }
1065 }
int adc(sample_type sample)
get the ADC sample (12 bits)
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
RunNumber_t run() const
Definition: RunBase.h:42
virtual void endRun(const edm::Run &, const edm::EventSetup &)
double charge(const std::vector< uint8_t > &Ampls)
std::string getMEregionString(uint32_t) const
std::vector< std::string > vstring
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
T sqrt(T t)
Definition: SSEVec.h:46
SiPixelHistoricInfoReader(const edm::ParameterSet &)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
const T & get() const
Definition: EventSetup.h:55
tuple cout
Definition: gather_cfg.py:121
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
UInt_t nEvents
Definition: hcalCalib.cc:43
Definition: Run.h:33
virtual void analyze(const edm::Event &, const edm::EventSetup &)