CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SiPixelDataQuality Class Reference

#include <SiPixelDataQuality.h>

Public Member Functions

void bookGlobalQualityFlag (DQMStore::IBooker &iBooker, bool Tier0Flag, int nFEDs)
 
void computeGlobalQualityFlag (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool init, int nFEDs, bool Tier0Flag)
 
void computeGlobalQualityFlagByLumi (DQMStore::IGetter &iGetter, bool init, int nFEDs, bool Tier0Flag, int nEvents_lastLS_, int nErrorsBarrel_lastLS_, int nErrorsEndcap_lastLS_)
 
void fillGlobalQualityPlot (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool init, edm::ESHandle< SiPixelFedCablingMap > theCablingMap, int nFEDs, bool Tier0Flag, int lumisec)
 
int getDetId (MonitorElement *mE)
 (Documentation under construction). More...
 
 SiPixelDataQuality (bool offlineXMLfile)
 Constructor of the SiPixelInformationExtractor class. More...
 
 ~SiPixelDataQuality ()
 Destructor of the SiPixelDataQuality class. More...
 

Private Attributes

int allMods_
 
TH2F * allmodsMap
 
TH1D * allmodsVec
 
float barrel_error_flag_
 
int barrelMods_
 
MonitorElementClusterChargeBarrel
 
MonitorElementClusterChargeEndcap
 
int clusterCounterBarrel
 
int clusterCounterEndcap
 
MonitorElementClusterMod1
 
MonitorElementClusterMod2
 
MonitorElementClusterMod3
 
MonitorElementClusterMod4
 
MonitorElementClusterModAll
 
MonitorElementClusterSizeBarrel
 
MonitorElementClusterSizeEndcap
 
bool clusterStatsBarrel
 
bool clusterStatsEndcap
 
int count
 
int count1
 
int count2
 
int count3
 
int count4
 
int count5
 
int count6
 
MonitorElementDigiChargeBarrel
 
MonitorElementDigiChargeEndcap
 
int digiCounterBarrel
 
int digiCounterEndcap
 
bool digiStatsBarrel
 
bool digiStatsEndcap
 
bool DONE_
 
float endcap_error_flag_
 
int endcapMods_
 
bool endOfModules_
 
int errcount
 
TH2F * errmodsMap
 
TH1D * errmodsVec
 
int errorMods_
 
MonitorElementFEDErrReportMap
 
TH2F * goodmodsMap
 
TH1D * goodmodsVec
 
bool gotDigis
 
float lastallmods_ [40]
 
float lasterrmods_ [40]
 
int lastLS_
 
int modCounter_
 
std::ofstream myfile_
 
int n_errors_barrel_
 
int n_errors_endcap_
 
int n_errors_pixel_
 
MonitorElementNClustersBarrel
 
MonitorElementNClustersEndcap
 
MonitorElementNDigisBarrel
 
MonitorElementNDigisEndcap
 
MonitorElementNErrorsBarrel
 
MonitorElementNErrorsEndcap
 
MonitorElementNErrorsFEDs
 
int nevents_
 
MonitorElementNPixelTracks
 
int objectCount_
 
bool offlineXMLfile_
 
float pixel_error_flag_
 
float qflag_
 
MonitorElementSummaryBarrel
 
MonitorElementSummaryEndcap
 
MonitorElementSummaryPixel
 
MonitorElementSummaryReportMap
 
edm::ESHandle< SiPixelFedCablingMaptheCablingMap
 
int timeoutCounter_
 
int trackCounterBarrel
 
int trackCounterEndcap
 
bool trackStatsBarrel
 
bool trackStatsEndcap
 

Detailed Description

Definition at line 37 of file SiPixelDataQuality.h.

Constructor & Destructor Documentation

SiPixelDataQuality::SiPixelDataQuality ( bool  offlineXMLfile)

Constructor of the SiPixelInformationExtractor class.

Definition at line 67 of file SiPixelDataQuality.cc.

References allMods_, allmodsMap, allmodsVec, errmodsMap, errmodsVec, errorMods_, goodmodsMap, goodmodsVec, mps_fire::i, lastallmods_, lasterrmods_, lastLS_, qflag_, and timeoutCounter_.

67  : offlineXMLfile_(offlineXMLfile) {
68  edm::LogInfo("SiPixelDataQuality") << " Creating SiPixelDataQuality "
69  << "\n";
70 
71  allMods_ = 0;
72  errorMods_ = 0;
73  qflag_ = 1.;
74 
75  allmodsMap = nullptr;
76  errmodsMap = nullptr;
77  goodmodsMap = nullptr;
78  allmodsVec = nullptr;
79  errmodsVec = nullptr;
80  goodmodsVec = nullptr;
81  for (int i = 0; i < 40; ++i) {
82  lastallmods_[i] = 0;
83  lasterrmods_[i] = 0;
84  }
85  timeoutCounter_ = 0;
86  lastLS_ = -1;
87 }
SiPixelDataQuality::~SiPixelDataQuality ( )

Destructor of the SiPixelDataQuality class.

Definition at line 93 of file SiPixelDataQuality.cc.

References allmodsMap, allmodsVec, errmodsMap, errmodsVec, goodmodsMap, and goodmodsVec.

93  {
94  edm::LogInfo("SiPixelDataQuality") << " Deleting SiPixelDataQuality "
95  << "\n";
96  if (allmodsMap)
97  delete allmodsMap;
98  if (errmodsMap)
99  delete errmodsMap;
100  if (goodmodsMap)
101  delete goodmodsMap;
102  if (allmodsVec)
103  delete allmodsVec;
104  if (errmodsVec)
105  delete errmodsVec;
106  if (goodmodsVec)
107  delete goodmodsVec;
108 }

Member Function Documentation

void SiPixelDataQuality::bookGlobalQualityFlag ( DQMStore::IBooker iBooker,
bool  Tier0Flag,
int  nFEDs 
)

Definition at line 132 of file SiPixelDataQuality.cc.

References allmodsMap, allmodsVec, DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), DQMStore::IBooker::bookInt(), DQMStore::IBooker::cd(), ClusterChargeBarrel, ClusterChargeEndcap, ClusterMod1, ClusterMod2, ClusterMod3, ClusterMod4, ClusterModAll, ClusterSizeBarrel, ClusterSizeEndcap, DigiChargeBarrel, DigiChargeEndcap, errmodsMap, errmodsVec, MonitorElement::Fill(), goodmodsMap, goodmodsVec, mps_fire::i, NClustersBarrel, NClustersEndcap, NDigisBarrel, NDigisEndcap, NErrorsBarrel, NErrorsEndcap, NErrorsFEDs, NPixelTracks, MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), SummaryBarrel, SummaryEndcap, SummaryPixel, and SummaryReportMap.

132  {
133  // std::cout<<"BOOK GLOBAL QUALITY FLAG MEs!"<<std::endl;
134  iBooker.cd();
135 
136  iBooker.setCurrentFolder("Pixel/Barrel");
137  if (!Tier0Flag) {
138  ClusterModAll = iBooker.book1D("NClustertoChargeRatio_AllMod", "Cluster Noise All Modules", 768, 0., 768.);
139  ClusterMod1 = iBooker.book1D(
140  "NClustertoChargeRatio_NormMod1", "Normalized N_{Clusters} to Charge Ratio per Module1", 192, 0., 192.);
141  ClusterMod2 = iBooker.book1D(
142  "NClustertoChargeRatio_NormMod2", "Normalized N_{Clusters} to Charge Ratio per Module2", 192, 0., 192.);
143  ClusterMod3 = iBooker.book1D(
144  "NClustertoChargeRatio_NormMod3", "Normalized N_{Clusters} to Charge Ratio per Module3", 192, 0., 192.);
145  ClusterMod4 = iBooker.book1D(
146  "NClustertoChargeRatio_NormMod4", "Normalized N_{Clusters} to Charge Ratio per Module4", 192, 0., 192.);
147  }
148  iBooker.setCurrentFolder("Pixel/EventInfo");
149  if (!Tier0Flag) {
150  SummaryReportMap = iBooker.book2D("reportSummaryMap", "Pixel Summary Map", 3000, 0., 3000., 40, 0., 40.);
151  SummaryReportMap->setAxisTitle("Lumi Section", 1);
152  SummaryReportMap->setAxisTitle("Pixel FED #", 2);
153  allmodsVec = new TH1D("allmodsVec", "allmodsVec", 40, 0., 40.);
154  errmodsVec = new TH1D("errmodsVec", "errmodsVec", 40, 0., 40.);
155  goodmodsVec = new TH1D("goodmodsVec", "goodmodsVec", 40, 0., 40.);
156  } else {
157  SummaryReportMap = iBooker.book2D("reportSummaryMap", "Pixel Summary Map", 2, 0., 2., 7, 0., 7.);
158  SummaryReportMap->setBinLabel(1, "Barrel", 1);
159  SummaryReportMap->setBinLabel(2, "Endcaps", 1);
160  SummaryReportMap->setBinLabel(1, "Errors", 2);
161  SummaryReportMap->setBinLabel(2, "NDigis", 2);
162  SummaryReportMap->setBinLabel(3, "DigiCharge", 2);
163  SummaryReportMap->setBinLabel(4, "ClusterSize", 2);
164  SummaryReportMap->setBinLabel(5, "NClusters", 2);
165  SummaryReportMap->setBinLabel(6, "ClusterCharge", 2);
166  SummaryReportMap->setBinLabel(7, "HitEff", 2);
167  allmodsMap = new TH2F("allmodsMap", "allmodsMap", 2, 0., 2., 7, 0., 7.);
168  errmodsMap = new TH2F("errmodsMap", "errmodsMap", 2, 0., 2., 7, 0., 7.);
169  goodmodsMap = new TH2F("goodmodsMap", "goodmodsMap", 2, 0., 2., 7, 0., 7.);
170  }
171  SummaryPixel = iBooker.bookFloat("reportSummary");
172  iBooker.setCurrentFolder("Pixel/EventInfo/reportSummaryContents");
173  SummaryBarrel = iBooker.bookFloat("PixelBarrelFraction");
174  SummaryEndcap = iBooker.bookFloat("PixelEndcapFraction");
175  // book the data certification cuts:
176  iBooker.setCurrentFolder("Pixel/AdditionalPixelErrors");
177  NErrorsFEDs = iBooker.bookFloat("FEDsNErrorsCut");
178  iBooker.setCurrentFolder("Pixel/Barrel");
179  NErrorsBarrel = iBooker.bookFloat("BarrelNErrorsCut");
180  NDigisBarrel = iBooker.bookInt("BarrelNDigisCut");
181  DigiChargeBarrel = iBooker.bookInt("BarrelDigiChargeCut");
182  ClusterSizeBarrel = iBooker.bookInt("BarrelClusterSizeCut");
183  NClustersBarrel = iBooker.bookInt("BarrelNClustersCut");
184  ClusterChargeBarrel = iBooker.bookInt("BarrelClusterChargeCut");
185  iBooker.setCurrentFolder("Pixel/Endcap");
186  NErrorsEndcap = iBooker.bookFloat("EndcapNErrorsCut");
187  NDigisEndcap = iBooker.bookInt("EndcapNDigisCut");
188  DigiChargeEndcap = iBooker.bookInt("EndcapDigiChargeCut");
189  ClusterSizeEndcap = iBooker.bookInt("EndcapClusterSizeCut");
190  NClustersEndcap = iBooker.bookInt("EndcapNClustersCut");
191  ClusterChargeEndcap = iBooker.bookInt("EndcapClusterChargeCut");
192  if (Tier0Flag) {
193  iBooker.setCurrentFolder("Pixel/Tracks");
194  NPixelTracks = iBooker.bookInt("PixelTracksCut");
195  }
196 
197  // Init MonitoringElements:
198  if (nFEDs > 0) {
199  if (SummaryPixel)
200  SummaryPixel->Fill(1.);
201  if (SummaryBarrel)
202  SummaryBarrel->Fill(1.);
203  if (SummaryEndcap)
204  SummaryEndcap->Fill(1.);
205  } else {
206  if (SummaryPixel)
207  SummaryPixel->Fill(-1.);
208  if (SummaryBarrel)
209  SummaryBarrel->Fill(-1.);
210  if (SummaryEndcap)
211  SummaryEndcap->Fill(-1.);
212  }
213  if (NErrorsBarrel)
214  NErrorsBarrel->Fill(1.);
215  if (NErrorsEndcap)
216  NErrorsEndcap->Fill(1.);
217  if (NErrorsFEDs)
218  NErrorsFEDs->Fill(1.);
219  if (NDigisBarrel)
220  NDigisBarrel->Fill(1);
221  if (NDigisEndcap)
222  NDigisEndcap->Fill(1);
223  if (DigiChargeBarrel)
225  if (DigiChargeEndcap)
227  if (ClusterSizeBarrel)
229  if (ClusterSizeEndcap)
235  if (NClustersBarrel)
236  NClustersBarrel->Fill(1);
237  if (NClustersEndcap)
238  NClustersEndcap->Fill(1);
239  if (Tier0Flag) {
240  if (NPixelTracks)
241  NPixelTracks->Fill(1);
242  }
243 
244  if (SummaryReportMap) {
245  if (!Tier0Flag)
246  for (int i = 1; i != 3001; i++)
247  for (int j = 1; j != 41; j++)
248  SummaryReportMap->setBinContent(i, j, -1.);
249  if (Tier0Flag)
250  for (int i = 1; i != 3; i++)
251  for (int j = 1; j != 8; j++)
252  SummaryReportMap->setBinContent(i, j, -1.);
253  }
254  if (!Tier0Flag) {
255  for (int j = 1; j != 41; j++) {
256  if (allmodsVec)
257  allmodsVec->SetBinContent(j, 0.);
258  if (errmodsVec)
259  errmodsVec->SetBinContent(j, 0.);
260  if (goodmodsVec)
261  goodmodsVec->SetBinContent(j, 0.);
262  }
263  }
264  if (Tier0Flag) {
265  for (int i = 1; i != 3; i++)
266  for (int j = 1; j != 8; j++) {
267  if (allmodsMap)
268  allmodsMap->SetBinContent(i, j, 0.);
269  if (errmodsMap)
270  errmodsMap->SetBinContent(i, j, 0.);
271  if (goodmodsMap)
272  goodmodsMap->SetBinContent(i, j, 0.);
273  }
274  }
275 
276  iBooker.cd();
277 }
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * ClusterChargeBarrel
MonitorElement * ClusterModAll
MonitorElement * bookInt(Args &&...args)
Definition: DQMStore.h:104
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * SummaryBarrel
MonitorElement * ClusterSizeEndcap
MonitorElement * NPixelTracks
MonitorElement * NErrorsFEDs
void Fill(long long x)
MonitorElement * NDigisEndcap
MonitorElement * SummaryPixel
MonitorElement * NErrorsEndcap
MonitorElement * ClusterMod3
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * ClusterMod1
MonitorElement * ClusterMod4
MonitorElement * NErrorsBarrel
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * ClusterMod2
MonitorElement * NClustersEndcap
MonitorElement * ClusterSizeBarrel
MonitorElement * SummaryReportMap
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * DigiChargeEndcap
MonitorElement * SummaryEndcap
MonitorElement * NDigisBarrel
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:105
MonitorElement * ClusterChargeEndcap
MonitorElement * DigiChargeBarrel
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * NClustersBarrel
void SiPixelDataQuality::computeGlobalQualityFlag ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
bool  init,
int  nFEDs,
bool  Tier0Flag 
)

Definition at line 281 of file SiPixelDataQuality.cc.

References allMods_, barrel_error_flag_, barrelMods_, DQMStore::IBooker::cd(), DQMStore::IGetter::cd(), ClusterChargeBarrel, ClusterChargeEndcap, clusterCounterBarrel, clusterCounterEndcap, ClusterSizeBarrel, ClusterSizeEndcap, clusterStatsBarrel, clusterStatsEndcap, pfDeepCMVADiscriminatorsJetTags_cfi::denominator, DigiChargeBarrel, DigiChargeEndcap, digiCounterBarrel, digiCounterEndcap, digiStatsBarrel, digiStatsEndcap, RefreshWebPage::dname, DONE_, endcap_error_flag_, endcapMods_, errorMods_, MonitorElement::Fill(), objects.autophobj::float, DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getEntries(), MonitorElement::getFloatValue(), MonitorElement::getIntValue(), DQMStore::IGetter::getMEs(), DQMStore::IGetter::getSubdirs(), DQMStore::IBooker::goUp(), MonitorElement::hasError(), mps_fire::i, createfilelist::int, gen::k, n_errors_barrel_, n_errors_endcap_, n_errors_pixel_, NClustersBarrel, NClustersEndcap, NDigisBarrel, NDigisEndcap, NErrorsBarrel, NErrorsEndcap, NPixelTracks, pfDeepCMVADiscriminatorsJetTags_cfi::numerator, objectCount_, pixel_error_flag_, DQMStore::IBooker::pwd(), qflag_, DQMStore::IGetter::setCurrentFolder(), SummaryBarrel, SummaryEndcap, SummaryPixel, trackCounterBarrel, trackCounterEndcap, trackStatsBarrel, and trackStatsEndcap.

282  {
283  if (init) {
284  allMods_ = 0;
285  errorMods_ = 0;
286  qflag_ = 0.;
287  barrelMods_ = 0;
288  endcapMods_ = 0;
289  objectCount_ = 0;
290  DONE_ = false;
291 
292  // Error counters and flags:
293  n_errors_barrel_ = 0;
294  barrel_error_flag_ = 0.;
295  n_errors_endcap_ = 0;
296  endcap_error_flag_ = 0.;
297  n_errors_pixel_ = 0;
298  pixel_error_flag_ = 0.;
299  digiStatsBarrel = false, clusterStatsBarrel = false, trackStatsBarrel = false;
301  digiStatsEndcap = false, clusterStatsEndcap = false, trackStatsEndcap = false;
303  init = false;
304  }
305  if (nFEDs == 0)
306  return;
307 
308  string currDir = iBooker.pwd();
309  string dname = currDir.substr(currDir.find_last_of("/") + 1);
310 
311  if ((!Tier0Flag && dname.find("Module_") != string::npos) ||
312  (Tier0Flag && (dname.find("Ladder_") != string::npos || dname.find("Blade_") != string::npos))) {
313  objectCount_++;
314 
315  if (currDir.find("Pixel") != string::npos)
316  allMods_++;
317  if (currDir.find("Barrel") != string::npos)
318  barrelMods_++;
319  if (currDir.find("Endcap") != string::npos)
320  endcapMods_++;
321  vector<string> meVec = iGetter.getMEs();
322  for (vector<string>::const_iterator it = meVec.begin(); it != meVec.end(); it++) {
323  string full_path = currDir + "/" + (*it);
324  if (full_path.find("ndigis_") != string::npos) {
325  MonitorElement *me = iGetter.get(full_path);
326  if (!me)
327  continue;
328  if (me->getEntries() > 25) {
329  if (full_path.find("Barrel") != string::npos)
331  if (full_path.find("Endcap") != string::npos)
333  }
334  } else if (Tier0Flag && full_path.find("nclusters_OnTrack_") != string::npos) {
335  MonitorElement *me = iGetter.get(full_path);
336  if (!me)
337  continue;
338  if (me->getEntries() > 25) {
339  if (full_path.find("Barrel") != string::npos)
341  if (full_path.find("Endcap") != string::npos)
343  }
344  } else if (!Tier0Flag && full_path.find("nclusters_") != string::npos) {
345  MonitorElement *me = iGetter.get(full_path);
346  if (!me)
347  continue;
348  if (me->getEntries() > 25) {
349  if (full_path.find("Barrel") != string::npos)
351  if (full_path.find("Endcap") != string::npos)
353  }
354  }
355  }
356  }
357  vector<string> subDirVec = iGetter.getSubdirs();
358  for (vector<string>::const_iterator ic = subDirVec.begin(); ic != subDirVec.end(); ic++) {
359  iGetter.cd(*ic);
360  iBooker.cd(*ic);
361  init = false;
362  computeGlobalQualityFlag(iBooker, iGetter, init, nFEDs, Tier0Flag);
363  iBooker.goUp();
364  iGetter.setCurrentFolder(iBooker.pwd());
365  }
366 
367  // Make sure I have finished looping over all Modules/Ladders/Blades:
368  if (!Tier0Flag) { // online case
369  if (objectCount_ == 1440)
370  DONE_ = true;
371  } else { // offline case
372  if (objectCount_ == 288)
373  DONE_ = true;
374  }
375 
376  if (DONE_ && currDir == "Pixel/EventInfo/reportSummaryContents") {
377  // Evaluate error flag now, only stored in AdditionalPixelErrors:
378  MonitorElement *me_err = iGetter.get("Pixel/AdditionalPixelErrors/FedETypeNErr");
379  MonitorElement *me_evt = iGetter.get("Pixel/EventInfo/processedEvents");
380  if (me_err && me_evt) {
381  for (int i = 1; i != 41; i++)
382  for (int j = 1; j != 22; j++)
383  if (me_err->getBinContent(i, j) > 0) {
385  if (i < 33)
387  if (i > 32)
389  }
390  int NProcEvts = me_evt->getIntValue();
391  if (NProcEvts > 0) {
392  barrel_error_flag_ = (float(NProcEvts) - float(n_errors_barrel_)) / float(NProcEvts);
393  endcap_error_flag_ = (float(NProcEvts) - float(n_errors_endcap_)) / float(NProcEvts);
394  pixel_error_flag_ = (float(NProcEvts) - float(n_errors_barrel_) - float(n_errors_endcap_)) / float(NProcEvts);
395  }
396  }
397  NErrorsBarrel = iGetter.get("Pixel/Barrel/BarrelNErrorsCut");
398  if (NErrorsBarrel)
400  NErrorsEndcap = iGetter.get("Pixel/Endcap/EndcapNErrorsCut");
401  if (NErrorsEndcap)
403 
404  string meName0;
405  MonitorElement *me;
406 
407  // Fill the Digi flags:
408  if (!Tier0Flag) {
409  meName0 = "Pixel/Barrel/SUMDIG_ndigis_Barrel";
410  if (digiCounterBarrel / 768 > 0.5)
411  digiStatsBarrel = true;
412  if (digiCounterEndcap / 672 > 0.5)
413  digiStatsEndcap = true;
414  } else {
415  meName0 = "Pixel/Barrel/SUMOFF_ndigis_Barrel";
416  if (digiCounterBarrel / 192 > 0.5)
417  digiStatsBarrel = true;
418  if (digiCounterEndcap / 96 > 0.5)
419  digiStatsEndcap = true;
420  }
421  me = iGetter.get(meName0);
422  if (me) {
423  NDigisBarrel = iGetter.get("Pixel/Barrel/BarrelNDigisCut");
424  if (NDigisBarrel && digiStatsBarrel) {
425  if (me->hasError())
426  NDigisBarrel->Fill(0);
427  else
428  NDigisBarrel->Fill(1);
429  }
430  }
431  if (!Tier0Flag)
432  meName0 = "Pixel/Endcap/SUMDIG_ndigis_Endcap";
433  else
434  meName0 = "Pixel/Endcap/SUMOFF_ndigis_Endcap";
435  me = iGetter.get(meName0);
436  if (me) {
437  NDigisEndcap = iGetter.get("Pixel/Endcap/EndcapNDigisCut");
438  if (NDigisEndcap && digiStatsEndcap) {
439  if (me->hasError())
440  NDigisEndcap->Fill(0);
441  else
442  NDigisEndcap->Fill(1);
443  }
444  }
445  if (!Tier0Flag)
446  meName0 = "Pixel/Barrel/SUMDIG_adc_Barrel";
447  else
448  meName0 = "Pixel/Barrel/SUMOFF_adc_Barrel";
449  me = iGetter.get(meName0);
450  if (me) {
451  DigiChargeBarrel = iGetter.get("Pixel/Barrel/BarrelDigiChargeCut");
453  if (me->hasError())
455  else
457  }
458  }
459  if (!Tier0Flag)
460  meName0 = "Pixel/Endcap/SUMDIG_adc_Endcap";
461  else
462  meName0 = "Pixel/Endcap/SUMOFF_adc_Endcap";
463  me = iGetter.get(meName0);
464  if (me) {
465  DigiChargeEndcap = iGetter.get("Pixel/Endcap/EndcapDigiChargeCut");
467  if (me->hasError())
469  else
471  }
472  }
473 
474  // Fill the Cluster flags:
475  if (!Tier0Flag) {
476  meName0 = "Pixel/Barrel/SUMCLU_size_Barrel";
477  if (clusterCounterBarrel / 768 > 0.5)
478  clusterStatsBarrel = true;
479  if (clusterCounterEndcap / 672 > 0.5)
480  clusterStatsEndcap = true;
481  } else {
482  meName0 = "Pixel/Barrel/SUMOFF_size_OnTrack_Barrel";
483  if (clusterCounterBarrel / 192 > 0.5)
484  clusterStatsBarrel = true;
485  if (clusterCounterEndcap / 96 > 0.5)
486  clusterStatsEndcap = true;
487  }
488  me = iGetter.get(meName0);
489  if (me) {
490  ClusterSizeBarrel = iGetter.get("Pixel/Barrel/BarrelClusterSizeCut");
492  if (me->hasError())
494  else
496  }
497  }
498  if (!Tier0Flag)
499  meName0 = "Pixel/Endcap/SUMCLU_size_Endcap";
500  else
501  meName0 = "Pixel/Endcap/SUMOFF_size_OnTrack_Endcap";
502  me = iGetter.get(meName0);
503  if (me) {
504  ClusterSizeEndcap = iGetter.get("Pixel/Endcap/EndcapClusterSizeCut");
506  if (me->hasError())
508  else
510  }
511  }
512  if (!Tier0Flag)
513  meName0 = "Pixel/Barrel/SUMCLU_charge_Barrel";
514  else
515  meName0 = "Pixel/Barrel/SUMOFF_charge_OnTrack_Barrel";
516  me = iGetter.get(meName0);
517  if (me) {
518  ClusterChargeBarrel = iGetter.get("Pixel/Barrel/BarrelClusterChargeCut");
520  if (me->hasError())
522  else
524  }
525  }
526  if (!Tier0Flag)
527  meName0 = "Pixel/Endcap/SUMCLU_charge_Endcap";
528  else
529  meName0 = "Pixel/Endcap/SUMOFF_charge_OnTrack_Endcap";
530  me = iGetter.get(meName0);
531  if (me) {
532  ClusterChargeEndcap = iGetter.get("Pixel/Endcap/EndcapClusterChargeCut");
534  if (me->hasError())
536  else
538  }
539  }
540  if (!Tier0Flag)
541  meName0 = "Pixel/Barrel/SUMCLU_nclusters_Barrel";
542  else
543  meName0 = "Pixel/Barrel/SUMOFF_nclusters_OnTrack_Barrel";
544  me = iGetter.get(meName0);
545  if (me) {
546  NClustersBarrel = iGetter.get("Pixel/Barrel/BarrelNClustersCut");
548  if (me->hasError())
549  NClustersBarrel->Fill(0);
550  else
551  NClustersBarrel->Fill(1);
552  }
553  }
554  if (!Tier0Flag)
555  meName0 = "Pixel/Endcap/SUMCLU_nclusters_Endcap";
556  else
557  meName0 = "Pixel/Endcap/SUMOFF_nclusters_OnTrack_Endcap";
558  me = iGetter.get(meName0);
559  if (me) {
560  NClustersEndcap = iGetter.get("Pixel/Endcap/EndcapNClustersCut");
562  if (me->hasError())
563  NClustersEndcap->Fill(0);
564  else
565  NClustersEndcap->Fill(1);
566  }
567  }
568  // Pixel Track multiplicity / Pixel hit efficiency
569  meName0 = "Pixel/Tracks/ntracks_generalTracks";
570  me = iGetter.get(meName0);
571  if (me) {
572  NPixelTracks = iGetter.get("Pixel/Tracks/PixelTracksCut");
573  if (NPixelTracks && me->getBinContent(1) > 1000) {
574  if ((float)me->getBinContent(2) / (float)me->getBinContent(1) < 0.01) {
575  NPixelTracks->Fill(0);
576  } else {
577  NPixelTracks->Fill(1);
578  }
579  }
580  }
581 
582  //********************************************************************************************************
583 
584  // Final combination of all Data Quality results:
585  float pixelFlag = -1., barrelFlag = -1., endcapFlag = -1.;
586  float barrel_errors_temp[1] = {-1.};
587  int barrel_cuts_temp[5] = {5 * -1};
588  float endcap_errors_temp[1] = {-1.};
589  int endcap_cuts_temp[5] = {5 * -1};
590  int pixel_cuts_temp[1] = {-1};
591  float combinedCuts = 1.;
592  int numerator = 0, denominator = 0;
593 
594  // Barrel results:
595  me = iGetter.get("Pixel/Barrel/BarrelNErrorsCut");
596  if (me)
597  barrel_errors_temp[0] = me->getFloatValue();
598  me = iGetter.get("Pixel/Barrel/BarrelNDigisCut");
599  if (me)
600  barrel_cuts_temp[0] = me->getIntValue();
601  me = iGetter.get("Pixel/Barrel/BarrelDigiChargeCut");
602  if (me)
603  barrel_cuts_temp[1] = me->getIntValue();
604  me = iGetter.get("Pixel/Barrel/BarrelClusterSizeCut");
605  if (me)
606  barrel_cuts_temp[2] = me->getIntValue();
607  me = iGetter.get("Pixel/Barrel/BarrelNClustersCut");
608  if (me)
609  barrel_cuts_temp[3] = me->getIntValue();
610  me = iGetter.get("Pixel/Barrel/BarrelClusterChargeCut");
611  if (me)
612  barrel_cuts_temp[4] = me->getIntValue();
613  for (int k = 0; k != 5; k++) {
614  if (barrel_cuts_temp[k] >= 0) {
615  numerator = numerator + barrel_cuts_temp[k];
616  denominator++;
617  }
618  }
619  if (denominator != 0)
620  combinedCuts = float(numerator) / float(denominator);
621  barrelFlag = barrel_errors_temp[0] * combinedCuts;
622 
623  // Endcap results:
624  combinedCuts = 1.;
625  numerator = 0;
626  denominator = 0;
627  me = iGetter.get("Pixel/Endcap/EndcapNErrorsCut");
628  if (me)
629  endcap_errors_temp[0] = me->getFloatValue();
630  me = iGetter.get("Pixel/Endcap/EndcapNDigisCut");
631  if (me)
632  endcap_cuts_temp[0] = me->getIntValue();
633  me = iGetter.get("Pixel/Endcap/EndcapDigiChargeCut");
634  if (me)
635  endcap_cuts_temp[1] = me->getIntValue();
636  me = iGetter.get("Pixel/Endcap/EndcapClusterSizeCut");
637  if (me)
638  endcap_cuts_temp[2] = me->getIntValue();
639  me = iGetter.get("Pixel/Endcap/EndcapNClustersCut");
640  if (me)
641  endcap_cuts_temp[3] = me->getIntValue();
642  me = iGetter.get("Pixel/Endcap/EndcapClusterChargeCut");
643  if (me)
644  endcap_cuts_temp[4] = me->getIntValue();
645  for (int k = 0; k != 5; k++) {
646  if (endcap_cuts_temp[k] >= 0) {
647  numerator = numerator + endcap_cuts_temp[k];
648  denominator++;
649  }
650  }
651  if (denominator != 0)
652  combinedCuts = float(numerator) / float(denominator);
653  endcapFlag = endcap_errors_temp[0] * combinedCuts;
654 
655  // Track results:
656  combinedCuts = 1.;
657  numerator = 0;
658  denominator = 0;
659  me = iGetter.get("Pixel/Tracks/PixelTracksCut");
660  if (me)
661  pixel_cuts_temp[0] = me->getIntValue();
662 
663  // Combination of all:
664  combinedCuts = 1.;
665  numerator = 0;
666  denominator = 0;
667  for (int k = 0; k != 5; k++) {
668  if (barrel_cuts_temp[k] >= 0) {
669  numerator = numerator + barrel_cuts_temp[k];
670  denominator++;
671  }
672  if (endcap_cuts_temp[k] >= 0) {
673  numerator = numerator + endcap_cuts_temp[k];
674  denominator++;
675  }
676  if (k < 1 && pixel_cuts_temp[k] >= 0) {
677  numerator = numerator + pixel_cuts_temp[k];
678  denominator++;
679  }
680  }
681  if (denominator != 0)
682  combinedCuts = float(numerator) / float(denominator);
683  pixelFlag = float(pixel_error_flag_) * float(combinedCuts);
684 
685  SummaryPixel = iGetter.get("Pixel/EventInfo/reportSummary");
686  if (SummaryPixel)
687  SummaryPixel->Fill(pixelFlag);
688  SummaryBarrel = iGetter.get("Pixel/EventInfo/reportSummaryContents/PixelBarrelFraction");
689  if (SummaryBarrel)
690  SummaryBarrel->Fill(barrelFlag);
691  SummaryEndcap = iGetter.get("Pixel/EventInfo/reportSummaryContents/PixelEndcapFraction");
692  if (SummaryEndcap)
693  SummaryEndcap->Fill(endcapFlag);
694  }
695 }
int64_t getIntValue() const
MonitorElement * ClusterChargeBarrel
double getFloatValue() const
bool hasError() const
true if at least of one of the quality tests returned an error
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:361
MonitorElement * SummaryBarrel
MonitorElement * ClusterSizeEndcap
MonitorElement * NPixelTracks
void Fill(long long x)
MonitorElement * NDigisEndcap
MonitorElement * SummaryPixel
MonitorElement * NErrorsEndcap
MonitorElement * NErrorsBarrel
MonitorElement * NClustersEndcap
MonitorElement * ClusterSizeBarrel
void computeGlobalQualityFlag(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool init, int nFEDs, bool Tier0Flag)
MonitorElement * get(std::string const &path)
Definition: DQMStore.cc:303
int k[5][pyjets_maxn]
Definition: init.py:1
double getEntries() const
get # of entries
std::string const & pwd()
Definition: DQMStore.cc:278
MonitorElement * DigiChargeEndcap
MonitorElement * SummaryEndcap
double getBinContent(int binx) const
get content of bin (1-D)
std::vector< std::string > getSubdirs()
Definition: DQMStore.cc:325
MonitorElement * NDigisBarrel
std::vector< std::string > getMEs()
Definition: DQMStore.cc:331
MonitorElement * ClusterChargeEndcap
MonitorElement * DigiChargeBarrel
MonitorElement * NClustersBarrel
void SiPixelDataQuality::computeGlobalQualityFlagByLumi ( DQMStore::IGetter iGetter,
bool  init,
int  nFEDs,
bool  Tier0Flag,
int  nEvents_lastLS_,
int  nErrorsBarrel_lastLS_,
int  nErrorsEndcap_lastLS_ 
)

Definition at line 699 of file SiPixelDataQuality.cc.

References MonitorElement::Fill(), DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getMean(), mps_fire::i, SummaryBarrel, SummaryEndcap, and SummaryPixel.

705  {
706  if (nFEDs == 0)
707  return;
708 
709  // evaluate fatal FED errors for data quality:
710  float BarrelRate_LS = 1.;
711  float EndcapRate_LS = 1.;
712  float PixelRate_LS = 1.;
713  MonitorElement *me = iGetter.get("Pixel/AdditionalPixelErrors/byLumiErrors");
714  if (me) {
715  double nBarrelErrors_LS = me->getBinContent(1) - nErrorsBarrel_lastLS_;
716  double nEndcapErrors_LS = me->getBinContent(2) - nErrorsEndcap_lastLS_;
717  double nEvents_LS = me->getBinContent(0) - nEvents_lastLS_;
718  if (nBarrelErrors_LS / nEvents_LS > 0.5)
719  BarrelRate_LS = 0.;
720  if (nEndcapErrors_LS / nEvents_LS > 0.5)
721  EndcapRate_LS = 0.;
722  if ((nBarrelErrors_LS + nEndcapErrors_LS) / nEvents_LS > 0.5)
723  PixelRate_LS = 0.;
724  }
725 
726  // evaluate mean cluster charge on tracks for data quality:
727  float BarrelClusterCharge = 1.;
728  float EndcapClusterCharge = 1.;
729  float PixelClusterCharge = 1.;
730  MonitorElement *me1 = iGetter.get("Pixel/Clusters/OnTrack/charge_siPixelClusters_Barrel");
731  if (me1 && me1->getMean() < 12.)
732  BarrelClusterCharge = 0.;
733  MonitorElement *me2 = iGetter.get("Pixel/Clusters/OnTrack/charge_siPixelClusters_Endcap");
734  if (me2 && me2->getMean() < 12.)
735  EndcapClusterCharge = 0.;
736  MonitorElement *me3 = iGetter.get("Pixel/Clusters/OnTrack/charge_siPixelClusters");
737  if (me3 && me3->getMean() < 12.)
738  PixelClusterCharge = 0.;
739 
740  // evaluate average FED occupancy for data quality:
741  float BarrelOccupancy = 1.;
742  float EndcapOccupancy = 1.;
743  float PixelOccupancy = 1.;
744  MonitorElement *me4 = iGetter.get("Pixel/averageDigiOccupancy");
745  if (me4) {
746  double minBarrelOcc = 999999.;
747  double maxBarrelOcc = -1.;
748  double meanBarrelOcc = 0.;
749  double minEndcapOcc = 999999.;
750  double maxEndcapOcc = -1.;
751  double meanEndcapOcc = 0.;
752  for (int i = 1; i != 41; i++) {
753  if (i <= 32 && me4->getBinContent(i) < minBarrelOcc)
754  minBarrelOcc = me4->getBinContent(i);
755  if (i <= 32 && me4->getBinContent(i) > maxBarrelOcc)
756  maxBarrelOcc = me4->getBinContent(i);
757  if (i <= 32)
758  meanBarrelOcc += me4->getBinContent(i);
759  if (i > 32 && me4->getBinContent(i) < minEndcapOcc)
760  minEndcapOcc = me4->getBinContent(i);
761  if (i > 32 && me4->getBinContent(i) > maxEndcapOcc)
762  maxEndcapOcc = me4->getBinContent(i);
763  if (i > 32)
764  meanEndcapOcc += me4->getBinContent(i);
765  }
766  meanBarrelOcc = meanBarrelOcc / 32.;
767  meanEndcapOcc = meanEndcapOcc / 8.;
768  if (minBarrelOcc < 0.1 * meanBarrelOcc || maxBarrelOcc > 2.5 * meanBarrelOcc)
769  BarrelOccupancy = 0.;
770  if (minEndcapOcc < 0.2 * meanEndcapOcc || maxEndcapOcc > 1.8 * meanEndcapOcc)
771  EndcapOccupancy = 0.;
772  PixelOccupancy = BarrelOccupancy * EndcapOccupancy;
773  }
774 
775  float pixelFlag = PixelRate_LS * PixelClusterCharge * PixelOccupancy;
776  float barrelFlag = BarrelRate_LS * BarrelClusterCharge * BarrelOccupancy;
777  float endcapFlag = EndcapRate_LS * EndcapClusterCharge * EndcapOccupancy;
778  SummaryPixel = iGetter.get("Pixel/EventInfo/reportSummary");
779  if (SummaryPixel)
780  SummaryPixel->Fill(pixelFlag);
781  SummaryBarrel = iGetter.get("Pixel/EventInfo/reportSummaryContents/PixelBarrelFraction");
782  if (SummaryBarrel)
783  SummaryBarrel->Fill(barrelFlag);
784  SummaryEndcap = iGetter.get("Pixel/EventInfo/reportSummaryContents/PixelEndcapFraction");
785  if (SummaryEndcap)
786  SummaryEndcap->Fill(endcapFlag);
787 }
MonitorElement * SummaryBarrel
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
void Fill(long long x)
MonitorElement * SummaryPixel
MonitorElement * get(std::string const &path)
Definition: DQMStore.cc:303
MonitorElement * SummaryEndcap
double getBinContent(int binx) const
get content of bin (1-D)
void SiPixelDataQuality::fillGlobalQualityPlot ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
bool  init,
edm::ESHandle< SiPixelFedCablingMap theCablingMap,
int  nFEDs,
bool  Tier0Flag,
int  lumisec 
)

Definition at line 791 of file SiPixelDataQuality.cc.

References allmodsMap, allmodsVec, stringResolutionProvider_cfi::bin, DQMStore::IBooker::cd(), DQMStore::IGetter::cd(), ws_sso_content_reader::content, relmon_rootfiles_spy::contents, count, count1, count2, count3, count4, count5, count6, RefreshWebPage::dname, errcount, errmodsMap, errmodsVec, l1t::stage2::layer2::fedId, DQMStore::IGetter::get(), MonitorElement::getBinContent(), getDetId(), MonitorElement::getEntries(), MonitorElement::getFloatValue(), MonitorElement::getIntValue(), DQMStore::IGetter::getMEs(), MonitorElement::getNbinsX(), DQMStore::IGetter::getSubdirs(), goodmodsMap, goodmodsVec, DQMStore::IBooker::goUp(), mps_fire::i, createfilelist::int, gen::k, lastallmods_, lasterrmods_, modCounter_, edm::ESHandle< T >::product(), DQMStore::IBooker::pwd(), MonitorElement::setBinContent(), DQMStore::IGetter::setCurrentFolder(), and SummaryReportMap.

797  {
798  // std::cout<<"Entering SiPixelDataQuality::fillGlobalQualityPlot:
799  // "<<nFEDs<<std::endl;
800  if (init) {
801  count = 0;
802  errcount = 0;
803  init = false;
804  count1 = 0;
805  count2 = 0;
806  count3 = 0;
807  count4 = 0;
808  count5 = 0;
809  count6 = 0;
810  modCounter_ = 0;
811  if (!Tier0Flag) {
812  // The plots that these Vecs are integrated throughout a run
813  // So at each lumi section I save their last values (lastmods)
814  // And then subtract them out later when filling the SummaryMap
815  for (int j = 1; j != 41; j++) {
816  if (allmodsVec)
817  lastallmods_[j - 1] = allmodsVec->GetBinContent(j);
818  if (errmodsVec)
819  lasterrmods_[j - 1] = errmodsVec->GetBinContent(j);
820  if (allmodsVec)
821  allmodsVec->SetBinContent(j, 0.);
822  if (errmodsVec)
823  errmodsVec->SetBinContent(j, 0.);
824  if (goodmodsVec)
825  goodmodsVec->SetBinContent(j, 0.);
826  }
827  }
828  if (Tier0Flag) {
829  for (int i = 1; i != 3; i++)
830  for (int j = 1; j != 8; j++) {
831  if (allmodsMap)
832  allmodsMap->SetBinContent(i, j, 0.);
833  if (errmodsMap)
834  errmodsMap->SetBinContent(i, j, 0.);
835  if (goodmodsMap)
836  goodmodsMap->SetBinContent(i, j, 0.);
837  }
838  }
839  }
840 
841  //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
842  // Fill Maps:
843  // Online:
844  if (nFEDs == 0)
845  return;
846 
847  if (!Tier0Flag) {
848  // Not elegant, but not sure where else to put this sweet new plot!
849  MonitorElement *meTmp = iGetter.get("Pixel/Barrel/NClustertoChargeRatio_AllMod");
850  MonitorElement *meTop = iGetter.get("Pixel/Barrel/SUMCLU_nclusters_Barrel");
851  MonitorElement *meBot = iGetter.get("Pixel/Barrel/SUMCLU_charge_Barrel");
852  if (meTop && meBot && meTmp) {
853  for (int bin = 1; bin < 769; ++bin) {
854  float content = 0.0;
855  if (meBot->getBinContent(bin) > 0.0) {
856  content = meTop->getBinContent(bin) / meBot->getBinContent(bin);
857  }
858  meTmp->setBinContent(bin, content);
859  }
860  for (int j = 0; j < 4; ++j) {
861  static const char buf[] = "Pixel/Barrel/NClustertoChargeRatio_NormMod%i";
862  char modplot[sizeof(buf) + 2];
863  sprintf(modplot, buf, j + 1);
864  MonitorElement *meFinal = iGetter.get(modplot);
865  if (!meFinal)
866  continue;
867  for (int i = 1; i < 769; ++i) {
868  int k = 3 - j;
869  if (int(i + k) % 4 == 0)
870  meFinal->setBinContent(int((i + k) / 4), meTmp->getBinContent(i));
871  }
872  // Filling done. Now modification.
873  float SFLay[3], TotLay[3];
874  for (int ll = 0; ll < 3; ++ll)
875  TotLay[ll] = 0.0;
876  for (int bin = 1; bin < (meFinal->getNbinsX() + 1); ++bin) {
877  int layer = int((bin % 48) / 16);
878  TotLay[layer] += meFinal->getBinContent(bin);
879  }
880  float laynorm = TotLay[1] / 64.;
881  for (int ll = 0; ll < 3; ++ll) {
882  SFLay[ll] = 0.0;
883  if (TotLay[ll] > 0.0 && TotLay[1] > 0.0)
884  SFLay[ll] = TotLay[1] / TotLay[ll] * (1. / laynorm);
885  }
886  // now loop through plot
887  for (int bin = 1; bin < (meFinal->getNbinsX() + 1); ++bin) {
888  // access the layer number for bin: int((i%48)/16)
889  int layer = int((bin % 48) / 16);
890  float content = meFinal->getBinContent(bin);
891  // apply scale factor to bin content
892  meFinal->setBinContent(bin, content * SFLay[layer]);
893  }
894  }
895  }
896 
897  string currDir = iBooker.pwd();
898  if (currDir.find("Reference") != string::npos || currDir.find("Additional") != string::npos)
899  return;
900  string dname = currDir.substr(currDir.find_last_of("/") + 1);
901  if (dname.find("Module_") != string::npos && currDir.find("Reference") == string::npos) {
902  vector<string> meVec = iGetter.getMEs();
903  int detId = -1;
904  int fedId = -1;
905  for (vector<string>::const_iterator it = meVec.begin(); it != meVec.end();
906  it++) { // loop over all modules and fill ndigis into allmodsMap
907  // checking for any digis or FED errors to decide if this module is in
908  // DAQ:
909  string full_path = currDir + "/" + (*it);
910  if (detId == -1 && full_path.find("SUMOFF") == string::npos &&
911  (full_path.find("ndigis") != string::npos && full_path.find("SUMDIG") == string::npos) &&
912  (getDetId(iGetter.get(full_path)) > 100)) {
913  MonitorElement *me = iGetter.get(full_path);
914  if (!me)
915  continue;
916  if ((full_path.find("ndigis") != string::npos)) {
917  modCounter_++;
918  detId = getDetId(me);
919  for (int fedid = 0; fedid != 40; ++fedid) {
920  SiPixelFrameConverter converter(theCablingMap.product(), fedid);
921  uint32_t newDetId = detId;
922  if (converter.hasDetUnit(newDetId)) {
923  fedId = fedid;
924  break;
925  }
926  }
927  double NDigis = 0;
928  if (full_path.find("ndigis") != string::npos)
929  NDigis = me->getEntries();
930  float weight = (allmodsVec->GetBinContent(fedId + 1)) + NDigis;
931  allmodsVec->SetBinContent(fedId + 1, weight);
932  }
933  }
934  } // end loop over MEs
935  } // end of module dir's
936  vector<string> subDirVec = iGetter.getSubdirs();
937  for (vector<string>::const_iterator ic = subDirVec.begin(); ic != subDirVec.end(); ic++) {
938  iBooker.cd(*ic);
939  iGetter.cd(*ic);
940  init = false;
941  fillGlobalQualityPlot(iBooker, iGetter, init, theCablingMap, nFEDs, Tier0Flag, lumisec);
942  iBooker.goUp();
943  iGetter.setCurrentFolder(iBooker.pwd());
944  }
945  if (modCounter_ == 1440) {
946  iBooker.cd("Pixel/EventInfo/reportSummaryContents");
947  iGetter.cd("Pixel/EventInfo/reportSummaryContents");
948  if (iBooker.pwd() == "Pixel/EventInfo/reportSummaryContents") {
949  for (int i = 0; i != 40; i++) { // loop over FEDs to fetch the errors
950  static const char buf[] = "Pixel/AdditionalPixelErrors/FED_%d/FedChNErr";
951  char fedplot[sizeof(buf) + 4];
952  int NErrors = 0;
953  for (int j = 0; j != 37; j++) { // loop over FED channels within a FED
954  sprintf(fedplot, buf, i);
955  MonitorElement *me = iGetter.get(fedplot);
956  if (me)
957  NErrors = NErrors + me->getBinContent(j + 1);
958  }
959  // If I fill, then I end up majorly overcounting the numbers of
960  // errors...
961  if (NErrors > 0) {
962  errmodsVec->SetBinContent(i + 1, NErrors);
963  }
964  }
965  SummaryReportMap = iGetter.get("Pixel/EventInfo/reportSummaryMap");
966  if (SummaryReportMap) {
967  float contents = 0.;
968  for (int i = 1; i != 41; i++) {
969  // Dynamically subtracting previous (integrated) lumi section values
970  // in order to only show current lumi section's numbers
971  float mydigis = allmodsVec->GetBinContent(i) - lastallmods_[i - 1];
972  float myerrs = errmodsVec->GetBinContent(i) - lasterrmods_[i - 1];
973  if ((mydigis + myerrs) > 0.) {
974  contents = mydigis / (mydigis + myerrs);
975  } else {
976  // Changed so that dynamic zooming will still
977  // advance over these bins(in renderplugins)
978  contents = -0.5;
979  }
980  SummaryReportMap->setBinContent(lumisec + 1, i, contents);
981  } // end for loop over summaryReportMap bins
982  } // end if reportSummaryMap ME exists
983  } // end if in summary directory
984  } // end if modCounter_
985  } else { // Offline
986  float barrel_errors_temp[1] = {-1.};
987  int barrel_cuts_temp[6] = {6 * -1};
988  float endcap_errors_temp[1] = {-1.};
989  int endcap_cuts_temp[6] = {6 * -1};
990  int pixel_cuts_temp[1] = {-1};
991  // Barrel results:
992  MonitorElement *me;
993  me = iGetter.get("Pixel/Barrel/BarrelNErrorsCut");
994  if (me)
995  barrel_errors_temp[0] = me->getFloatValue();
996  me = iGetter.get("Pixel/Endcap/EndcapNErrorsCut");
997  if (me)
998  endcap_errors_temp[0] = me->getFloatValue();
999  SummaryReportMap->setBinContent(1, 1, barrel_errors_temp[0]);
1000  SummaryReportMap->setBinContent(2, 1, endcap_errors_temp[0]);
1001  me = iGetter.get("Pixel/Barrel/BarrelNDigisCut");
1002  if (me)
1003  barrel_cuts_temp[0] = me->getIntValue();
1004  me = iGetter.get("Pixel/Barrel/BarrelDigiChargeCut");
1005  if (me)
1006  barrel_cuts_temp[1] = me->getIntValue();
1007  me = iGetter.get("Pixel/Barrel/BarrelClusterSizeCut");
1008  if (me)
1009  barrel_cuts_temp[2] = me->getIntValue();
1010  me = iGetter.get("Pixel/Barrel/BarrelNClustersCut");
1011  if (me)
1012  barrel_cuts_temp[3] = me->getIntValue();
1013  me = iGetter.get("Pixel/Barrel/BarrelClusterChargeCut");
1014  if (me)
1015  barrel_cuts_temp[4] = me->getIntValue();
1016  me = iGetter.get("Pixel/Endcap/EndcapNDigisCut");
1017  if (me)
1018  endcap_cuts_temp[0] = me->getIntValue();
1019  me = iGetter.get("Pixel/Endcap/EndcapDigiChargeCut");
1020  if (me)
1021  endcap_cuts_temp[1] = me->getIntValue();
1022  me = iGetter.get("Pixel/Endcap/EndcapClusterSizeCut");
1023  if (me)
1024  endcap_cuts_temp[2] = me->getIntValue();
1025  me = iGetter.get("Pixel/Endcap/EndcapNClustersCut");
1026  if (me)
1027  endcap_cuts_temp[3] = me->getIntValue();
1028  me = iGetter.get("Pixel/Endcap/EndcapClusterChargeCut");
1029  if (me)
1030  endcap_cuts_temp[4] = me->getIntValue();
1031  for (int j = 2; j != 7; j++) {
1032  SummaryReportMap->setBinContent(1, j, barrel_cuts_temp[j - 2]);
1033  SummaryReportMap->setBinContent(2, j, endcap_cuts_temp[j - 2]);
1034  }
1035  me = iGetter.get("Pixel/Tracks/PixelTracksCut");
1036  if (me)
1037  pixel_cuts_temp[0] = me->getIntValue();
1038  SummaryReportMap->setBinContent(1, 7, pixel_cuts_temp[0]);
1039  SummaryReportMap->setBinContent(2, 7, pixel_cuts_temp[0]);
1040  } // end of offline map
1041  if (allmodsMap)
1042  allmodsMap->Clear();
1043  if (goodmodsMap)
1044  goodmodsMap->Clear();
1045  if (errmodsMap)
1046  errmodsMap->Clear();
1047 }
int64_t getIntValue() const
void setBinContent(int binx, double content)
set content of bin (1-D)
double getFloatValue() const
void fillGlobalQualityPlot(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool init, edm::ESHandle< SiPixelFedCablingMap > theCablingMap, int nFEDs, bool Tier0Flag, int lumisec)
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:361
Definition: weight.py:1
int getDetId(MonitorElement *mE)
(Documentation under construction).
MonitorElement * get(std::string const &path)
Definition: DQMStore.cc:303
int k[5][pyjets_maxn]
bin
set the eta bin as selection string.
Definition: init.py:1
MonitorElement * SummaryReportMap
double getEntries() const
get # of entries
std::string const & pwd()
Definition: DQMStore.cc:278
double getBinContent(int binx) const
get content of bin (1-D)
std::vector< std::string > getSubdirs()
Definition: DQMStore.cc:325
int getNbinsX() const
get # of bins in X-axis
std::vector< std::string > getMEs()
Definition: DQMStore.cc:331
T const * product() const
Definition: ESHandle.h:86
int SiPixelDataQuality::getDetId ( MonitorElement mE)

(Documentation under construction).

Given a pointer to ME returns the associated detId

Definition at line 115 of file SiPixelDataQuality.cc.

References MonitorElement::getName().

Referenced by fillGlobalQualityPlot().

115  {
116  const string &mEName = mE->getName();
117 
118  int detId = 0;
119 
120  if (mEName.find("_3") != string::npos) {
121  string detIdString = mEName.substr((mEName.find_last_of("_")) + 1, 9);
122  std::istringstream isst;
123  isst.str(detIdString);
124  isst >> detId;
125  }
126 
127  return detId;
128 }
const std::string & getName() const
get name of ME

Member Data Documentation

int SiPixelDataQuality::allMods_
private

Definition at line 98 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag(), and SiPixelDataQuality().

TH2F* SiPixelDataQuality::allmodsMap
private
TH1D* SiPixelDataQuality::allmodsVec
private
float SiPixelDataQuality::barrel_error_flag_
private

Definition at line 106 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

int SiPixelDataQuality::barrelMods_
private

Definition at line 98 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::ClusterChargeBarrel
private

Definition at line 122 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag(), and computeGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::ClusterChargeEndcap
private

Definition at line 123 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag(), and computeGlobalQualityFlag().

int SiPixelDataQuality::clusterCounterBarrel
private

Definition at line 109 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

int SiPixelDataQuality::clusterCounterEndcap
private

Definition at line 111 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::ClusterMod1
private

Definition at line 92 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::ClusterMod2
private

Definition at line 93 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::ClusterMod3
private

Definition at line 94 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::ClusterMod4
private

Definition at line 95 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::ClusterModAll
private

Definition at line 91 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::ClusterSizeBarrel
private

Definition at line 120 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag(), and computeGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::ClusterSizeEndcap
private

Definition at line 121 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag(), and computeGlobalQualityFlag().

bool SiPixelDataQuality::clusterStatsBarrel
private

Definition at line 108 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

bool SiPixelDataQuality::clusterStatsEndcap
private

Definition at line 110 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

int SiPixelDataQuality::count
private

Definition at line 74 of file SiPixelDataQuality.h.

Referenced by fillGlobalQualityPlot().

int SiPixelDataQuality::count1
private

Definition at line 130 of file SiPixelDataQuality.h.

Referenced by fillGlobalQualityPlot().

int SiPixelDataQuality::count2
private

Definition at line 131 of file SiPixelDataQuality.h.

Referenced by fillGlobalQualityPlot().

int SiPixelDataQuality::count3
private

Definition at line 132 of file SiPixelDataQuality.h.

Referenced by fillGlobalQualityPlot().

int SiPixelDataQuality::count4
private

Definition at line 133 of file SiPixelDataQuality.h.

Referenced by fillGlobalQualityPlot().

int SiPixelDataQuality::count5
private

Definition at line 134 of file SiPixelDataQuality.h.

Referenced by fillGlobalQualityPlot().

int SiPixelDataQuality::count6
private

Definition at line 135 of file SiPixelDataQuality.h.

Referenced by fillGlobalQualityPlot().

MonitorElement* SiPixelDataQuality::DigiChargeBarrel
private

Definition at line 116 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag(), and computeGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::DigiChargeEndcap
private

Definition at line 117 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag(), and computeGlobalQualityFlag().

int SiPixelDataQuality::digiCounterBarrel
private

Definition at line 109 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

int SiPixelDataQuality::digiCounterEndcap
private

Definition at line 111 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

bool SiPixelDataQuality::digiStatsBarrel
private

Definition at line 108 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

bool SiPixelDataQuality::digiStatsEndcap
private

Definition at line 110 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

bool SiPixelDataQuality::DONE_
private

Definition at line 79 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

float SiPixelDataQuality::endcap_error_flag_
private

Definition at line 106 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

int SiPixelDataQuality::endcapMods_
private

Definition at line 98 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

bool SiPixelDataQuality::endOfModules_
private

Definition at line 83 of file SiPixelDataQuality.h.

int SiPixelDataQuality::errcount
private

Definition at line 75 of file SiPixelDataQuality.h.

Referenced by fillGlobalQualityPlot().

TH2F* SiPixelDataQuality::errmodsMap
private
TH1D* SiPixelDataQuality::errmodsVec
private
int SiPixelDataQuality::errorMods_
private

Definition at line 98 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag(), and SiPixelDataQuality().

MonitorElement* SiPixelDataQuality::FEDErrReportMap
private

Definition at line 101 of file SiPixelDataQuality.h.

TH2F* SiPixelDataQuality::goodmodsMap
private
TH1D* SiPixelDataQuality::goodmodsVec
private
bool SiPixelDataQuality::gotDigis
private

Definition at line 76 of file SiPixelDataQuality.h.

float SiPixelDataQuality::lastallmods_[40]
private

Definition at line 141 of file SiPixelDataQuality.h.

Referenced by fillGlobalQualityPlot(), and SiPixelDataQuality().

float SiPixelDataQuality::lasterrmods_[40]
private

Definition at line 140 of file SiPixelDataQuality.h.

Referenced by fillGlobalQualityPlot(), and SiPixelDataQuality().

int SiPixelDataQuality::lastLS_
private

Definition at line 139 of file SiPixelDataQuality.h.

Referenced by SiPixelDataQuality().

int SiPixelDataQuality::modCounter_
private

Definition at line 138 of file SiPixelDataQuality.h.

Referenced by fillGlobalQualityPlot().

std::ofstream SiPixelDataQuality::myfile_
private

Definition at line 81 of file SiPixelDataQuality.h.

int SiPixelDataQuality::n_errors_barrel_
private

Definition at line 105 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

int SiPixelDataQuality::n_errors_endcap_
private

Definition at line 105 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

int SiPixelDataQuality::n_errors_pixel_
private

Definition at line 105 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::NClustersBarrel
private

Definition at line 124 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag(), and computeGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::NClustersEndcap
private

Definition at line 125 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag(), and computeGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::NDigisBarrel
private

Definition at line 114 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag(), and computeGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::NDigisEndcap
private

Definition at line 115 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag(), and computeGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::NErrorsBarrel
private

Definition at line 102 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag(), and computeGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::NErrorsEndcap
private

Definition at line 103 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag(), and computeGlobalQualityFlag().

MonitorElement* SiPixelDataQuality::NErrorsFEDs
private

Definition at line 104 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag().

int SiPixelDataQuality::nevents_
private

Definition at line 82 of file SiPixelDataQuality.h.

MonitorElement* SiPixelDataQuality::NPixelTracks
private

Definition at line 128 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag(), and computeGlobalQualityFlag().

int SiPixelDataQuality::objectCount_
private

Definition at line 78 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

bool SiPixelDataQuality::offlineXMLfile_
private

Definition at line 66 of file SiPixelDataQuality.h.

float SiPixelDataQuality::pixel_error_flag_
private

Definition at line 106 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

float SiPixelDataQuality::qflag_
private

Definition at line 97 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag(), and SiPixelDataQuality().

MonitorElement* SiPixelDataQuality::SummaryBarrel
private
MonitorElement* SiPixelDataQuality::SummaryEndcap
private
MonitorElement* SiPixelDataQuality::SummaryPixel
private
MonitorElement* SiPixelDataQuality::SummaryReportMap
private

Definition at line 87 of file SiPixelDataQuality.h.

Referenced by bookGlobalQualityFlag(), and fillGlobalQualityPlot().

edm::ESHandle<SiPixelFedCablingMap> SiPixelDataQuality::theCablingMap
private

Definition at line 84 of file SiPixelDataQuality.h.

int SiPixelDataQuality::timeoutCounter_
private

Definition at line 137 of file SiPixelDataQuality.h.

Referenced by SiPixelDataQuality().

int SiPixelDataQuality::trackCounterBarrel
private

Definition at line 109 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

int SiPixelDataQuality::trackCounterEndcap
private

Definition at line 111 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

bool SiPixelDataQuality::trackStatsBarrel
private

Definition at line 108 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().

bool SiPixelDataQuality::trackStatsEndcap
private

Definition at line 110 of file SiPixelDataQuality.h.

Referenced by computeGlobalQualityFlag().