CMS 3D CMS Logo

DTLocalTriggerTest.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author C. Battilana S. Marcellini - INFN Bologna
5  *
6  * threadsafe version (//-) oct/nov 2014 - WATWanAbdullah -ncpp-um-my
7  *
8  */
9 
10 
11 // This class header
13 
14 // Framework headers
19 
20 // Geometry
23 
24 // Root
25 #include "TF1.h"
26 #include "TProfile.h"
27 
28 
29 //C++ headers
30 #include <iostream>
31 #include <sstream>
32 
33 using namespace edm;
34 using namespace std;
35 
36 
38 
39  setConfig(ps,"DTLocalTrigger");
40  baseFolderTM = "DT/03-LocalTrigger-TM/";
41  baseFolderDDU = "DT/04-LocalTrigger-DDU/";
42  nMinEvts = ps.getUntrackedParameter<int>("nEventsCert", 5000);
43 
44  bookingdone = false;
45 
46 }
47 
48 
50 
51 }
52 
53 
55 
56  vector<string>::const_iterator iTr = trigSources.begin();
57  vector<string>::const_iterator trEnd = trigSources.end();
58  vector<string>::const_iterator iHw = hwSources.begin();
59  vector<string>::const_iterator hwEnd = hwSources.end();
60 
61  //Booking
62  if(parameters.getUntrackedParameter<bool>("staticBooking", true)){
63  for (; iTr != trEnd; ++iTr){
64  trigSource = (*iTr);
65  for (; iHw != hwEnd; ++iHw){
66  hwSource = (*iHw);
67  // Loop over the TriggerUnits
68  for (int wh=-2; wh<=2; ++wh){
69  if (hwSource=="COM") {
70 
71  bookWheelHistos(ibooker,wh,"MatchingPhi");
72  }
73  else {
74  for (int sect=1; sect<=12; ++sect){
75 
76  bookSectorHistos(ibooker,wh,sect,"BXDistribPhiIn");
77  bookSectorHistos(ibooker,wh,sect,"QualDistribPhiIn");
78  bookSectorHistos(ibooker,wh,sect,"BXDistribPhiOut");
79  bookSectorHistos(ibooker,wh,sect,"QualDistribPhiOut");
80  }
81 
82  bookWheelHistos(ibooker,wh,"CorrectBXPhiIn");
83  bookWheelHistos(ibooker,wh,"ResidualBXPhiIn");
84  bookWheelHistos(ibooker,wh,"CorrFractionPhiIn");
85  bookWheelHistos(ibooker,wh,"2ndFractionPhiIn");
86  bookWheelHistos(ibooker,wh,"TriggerInclusivePhiIn");
87 
88  bookWheelHistos(ibooker,wh,"CorrectBXPhiOut");
89  bookWheelHistos(ibooker,wh,"ResidualBXPhiOut");
90  bookWheelHistos(ibooker,wh,"CorrFractionPhiOut");
91  bookWheelHistos(ibooker,wh,"2ndFractionPhiOut");
92  bookWheelHistos(ibooker,wh,"TriggerInclusivePhiOut");
93 
94  }
95  }
96  }
97  }
98  }
99  // Summary test histo booking (only static)
100  for (iTr = trigSources.begin(); iTr != trEnd; ++iTr){
101  trigSource = (*iTr);
102  for (iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
103  hwSource = (*iHw);
104  // Loop over the TriggerUnits
105  for (int wh=-2; wh<=2; ++wh){
106  if (hwSource=="COM") {
107 
108  bookWheelHistos(ibooker,wh,"MatchingSummary","Summaries");
109  }
110  else {
111 
112  bookWheelHistos(ibooker,wh,"CorrFractionSummaryIn","Summaries");
113  bookWheelHistos(ibooker,wh,"2ndFractionSummaryIn","Summaries");
114  bookWheelHistos(ibooker,wh,"CorrFractionSummaryOut","Summaries");
115  bookWheelHistos(ibooker,wh,"2ndFractionSummaryOut","Summaries");
116  }
117  }
118  if (hwSource=="COM") {
119 
120  bookCmsHistos(ibooker,"MatchingSummary","Summaries");
121  }
122  else {
123 
124  bookCmsHistos(ibooker,"CorrFractionSummaryIn");
125  bookCmsHistos(ibooker,"2ndFractionSummaryIn");
126  bookCmsHistos(ibooker,"CorrFractionSummaryOut");
127  bookCmsHistos(ibooker,"2ndFractionSummaryOut");
128 
129  }
130  if (hwSource=="TM") {
131 
132  bookCmsHistos(ibooker,"TrigGlbSummary","",true);
133  }
134 
135  }
136  }
137 
138  bookingdone = true;
139 }
140 
141 
143 
145 
146 }
147 
149 
150  if (!bookingdone) Bookings(ibooker,igetter);
151 
152  // Loop over Trig & Hw sources
153  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
154  trigSource = (*iTr);
155 
156  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
157  hwSource = (*iHw);
158  // Loop over the TriggerUnits
159  for (int stat=1; stat<=4; ++stat){
160  for (int wh=-2; wh<=2; ++wh){
161  for (int sect=1; sect<=12; ++sect){
162  DTChamberId chId(wh,stat,sect);
163  int sector_id = (wh+wheelArrayShift)+(sect-1)*5;
164 
165  if (hwSource=="COM") {
166  // Perform TM-DDU matching test and generates summaries (Phi view)
167  TH2F * DDUvsTM = getHisto<TH2F>(igetter.get(getMEName("QualDDUvsQualTM","LocalTriggerPhiIn", chId)));
168  if (DDUvsTM) {
169 
170  int matchSummary = 1;
171 
172  if (DDUvsTM->GetEntries()>1) {
173 
174  double entries = DDUvsTM->GetEntries();
175  double corrEntries = 0;
176  for (int ibin=2; ibin<=8; ++ibin) {
177  corrEntries += DDUvsTM->GetBinContent(ibin,ibin);
178  }
179  double corrRatio = corrEntries/entries;
180 
181  if (corrRatio < parameters.getUntrackedParameter<double>("matchingFracError",.65)){
182  matchSummary = 2;
183  }
184  else if (corrRatio < parameters.getUntrackedParameter<double>("matchingFracWarning",.85)){
185  matchSummary = 3;
186  }
187  else {
188  matchSummary = 0;
189  }
190 
191  if( whME[wh].find(fullName("MatchingPhi")) == whME[wh].end() ){
192  bookWheelHistos(ibooker,wh,"MatchingPhi");
193  }
194 
195  whME[wh].find(fullName("MatchingPhi"))->second->setBinContent(sect,stat,corrRatio);
196 
197  }
198 
199  whME[wh].find(fullName("MatchingSummary"))->second->setBinContent(sect,stat,matchSummary);
200 
201  }
202  } //closes COM
203  else {
204  // IN part
205  TH2F * BXvsQual = getHisto<TH2F>(igetter.get(getMEName("BXvsQual_In","LocalTriggerPhiIn", chId)));
206  TH1F * BestQual = getHisto<TH1F>(igetter.get(getMEName("BestQual_In","LocalTriggerPhiIn", chId)));
207  TH2F * Flag1stvsQual = getHisto<TH2F>(igetter.get(getMEName("Flag1stvsQual_In","LocalTriggerPhiIn", chId)));
208  if (BXvsQual && Flag1stvsQual && BestQual) {
209  int corrSummary = 1;
210  int secondSummary = 1;
211  //default values for histograms
212  double BX_OK = 51.;
213  double BXMean = 51. ;
214  double corrFrac = 0.;
215  double secondFrac = 0.;
216  double besttrigs = 0.;
217  if (BestQual->GetEntries()>1) {
218  TH1D* BXHH = BXvsQual->ProjectionY("",6,7,"");
219  TH1D* Flag1st = Flag1stvsQual->ProjectionY();
220  int BXOK_bin = BXHH->GetEntries()>=1 ? BXHH->GetMaximumBin() : 51;
221  BXMean = BXHH->GetEntries()>=1 ? BXHH->GetMean() : 51;
222  BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
223  double trigsFlag2nd = Flag1st->GetBinContent(2);
224  double trigs = Flag1st->GetEntries();
225  besttrigs = BestQual->GetEntries();
226  double besttrigsCorr = BestQual->Integral(5,7,"");
227  delete BXHH;
228  delete Flag1st;
229 
230  corrFrac = besttrigsCorr/besttrigs;
231  secondFrac = trigsFlag2nd/trigs;
232  if (corrFrac < parameters.getUntrackedParameter<double>("corrFracError",.5)){
233  corrSummary = 2;
234  }
235  else if (corrFrac < parameters.getUntrackedParameter<double>("corrFracWarning",.6)){
236  corrSummary = 3;
237  }
238  else {
239  corrSummary = 0;
240  }
241  if (secondFrac > parameters.getUntrackedParameter<double>("secondFracError",.2)){
242  secondSummary = 2;
243  }
244  else if (secondFrac > parameters.getUntrackedParameter<double>("secondFracWarning",.1)){
245  secondSummary = 3;
246  }
247  else {
248  secondSummary = 0;
249  }
250 
251  if( secME[sector_id].find(fullName("BXDistribPhiIn")) == secME[sector_id].end() ){
252  bookSectorHistos(ibooker,wh,sect,"QualDistribPhiIn");
253  bookSectorHistos(ibooker,wh,sect,"BXDistribPhiIn");
254  }
255 
256  TH1D* BXDistr = BXvsQual->ProjectionY();
257  TH1D* QualDistr = BXvsQual->ProjectionX();
258  std::map<std::string,MonitorElement*> *innerME = &(secME[sector_id]);
259 
260  int nbinsBX = BXDistr->GetNbinsX();
261  int firstBinCenter = static_cast<int>(BXDistr->GetBinCenter(1));
262  int lastBinCenter = static_cast<int>(BXDistr->GetBinCenter(nbinsBX));
263  int iMin = firstBinCenter>-4 ? firstBinCenter : -4;
264  int iMax = lastBinCenter<20 ? lastBinCenter : 20;
265  for (int ibin=iMin+5;ibin<=iMax+5; ++ibin) {
266  innerME->find(fullName("BXDistribPhiIn"))->second->setBinContent(ibin,stat,BXDistr->GetBinContent(ibin-5-firstBinCenter+1));
267  }
268  for (int ibin=1;ibin<=7;++ibin) {
269  innerME->find(fullName("QualDistribPhiIn"))->second->setBinContent(ibin,stat,QualDistr->GetBinContent(ibin));
270  }
271 
272  delete BXDistr;
273  delete QualDistr;
274  }
275 
276  std::map<std::string,MonitorElement*> *innerME = &(secME[sector_id]);
277 
278  if( whME[wh].find(fullName("CorrectBXPhiIn")) == whME[wh].end() ){
279  bookWheelHistos(ibooker,wh,"ResidualBXPhiIn");
280  bookWheelHistos(ibooker,wh,"CorrectBXPhiIn");
281  bookWheelHistos(ibooker,wh,"CorrFractionPhiIn");
282  bookWheelHistos(ibooker,wh,"2ndFractionPhiIn");
283  bookWheelHistos(ibooker,wh,"TriggerInclusivePhiIn");
284  }
285 
286  innerME = &(whME[wh]);
287  innerME->find(fullName("CorrectBXPhiIn"))->second->setBinContent(sect,stat,BX_OK+0.00001);
288  innerME->find(fullName("ResidualBXPhiIn"))->second->setBinContent(sect,stat,round(25.*(BXMean-BX_OK))+0.00001);
289  innerME->find(fullName("CorrFractionPhiIn"))->second->setBinContent(sect,stat,corrFrac);
290  innerME->find(fullName("TriggerInclusivePhiIn"))->second->setBinContent(sect,stat,besttrigs);
291  innerME->find(fullName("2ndFractionPhiIn"))->second->setBinContent(sect,stat,secondFrac);
292 
293 
294  whME[wh].find(fullName("CorrFractionSummaryIn"))->second->setBinContent(sect,stat,corrSummary);
295  whME[wh].find(fullName("2ndFractionSummaryIn"))->second->setBinContent(sect,stat,secondSummary);
296 
297  } // closes BXvsQual && Flag1stvsQual && BestQual
298 
299  if (hwSource=="TM"){
300  //Out part
301 
302  TH2F * BXvsQual = getHisto<TH2F>(igetter.get(getMEName("BXvsQual_Out","LocalTriggerPhiOut", chId)));
303  TH1F * BestQual = getHisto<TH1F>(igetter.get(getMEName("BestQual_Out","LocalTriggerPhiOut", chId)));
304  TH2F * Flag1stvsQual = getHisto<TH2F>(igetter.get(getMEName("Flag1stvsQual_Out","LocalTriggerPhiOut", chId)));
305  if (BXvsQual && Flag1stvsQual && BestQual) {
306  int corrSummary = 1;
307  int secondSummary = 1;
308  //default values for histograms
309  double BX_OK = 51.;
310  double BXMean = 51. ;
311  double corrFrac = 0.;
312  double secondFrac = 0.;
313  double besttrigs = 0.;
314 
315  if (BestQual->GetEntries()>1) {
316  TH1D* BXHH = BXvsQual->ProjectionY("",6,7,"");
317  TH1D* Flag1st = Flag1stvsQual->ProjectionY();
318  int BXOK_bin = BXHH->GetEntries()>=1 ? BXHH->GetMaximumBin() : 51;
319  BXMean = BXHH->GetEntries()>=1 ? BXHH->GetMean() : 51;
320  BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
321  double trigsFlag2nd = Flag1st->GetBinContent(2);
322  double trigs = Flag1st->GetEntries();
323  besttrigs = BestQual->GetEntries();
324  double besttrigsCorr = BestQual->Integral(5,7,"");
325  delete BXHH;
326  delete Flag1st;
327 
328  corrFrac = besttrigsCorr/besttrigs;
329  secondFrac = trigsFlag2nd/trigs;
330  if (corrFrac < parameters.getUntrackedParameter<double>("corrFracError",.5)){
331  corrSummary = 2;
332  }
333  else if (corrFrac < parameters.getUntrackedParameter<double>("corrFracWarning",.6)){
334  corrSummary = 3;
335  }
336  else {
337  corrSummary = 0;
338  }
339  if (secondFrac > parameters.getUntrackedParameter<double>("secondFracError",.2)){
340  secondSummary = 2;
341  }
342  else if (secondFrac > parameters.getUntrackedParameter<double>("secondFracWarning",.1)){
343  secondSummary = 3;
344  }
345  else {
346  secondSummary = 0;
347  }
348 
349  if( secME[sector_id].find(fullName("BXDistribPhiOut")) == secME[sector_id].end() ){
350  bookSectorHistos(ibooker,wh,sect,"QualDistribPhiOut");
351  bookSectorHistos(ibooker,wh,sect,"BXDistribPhiOut");
352  }
353 
354  TH1D* BXDistr = BXvsQual->ProjectionY();
355  TH1D* QualDistr = BXvsQual->ProjectionX();
356  std::map<std::string,MonitorElement*> *innerME = &(secME[sector_id]);
357 
358  int nbinsBX = BXDistr->GetNbinsX();
359  int firstBinCenter = static_cast<int>(BXDistr->GetBinCenter(1));
360  int lastBinCenter = static_cast<int>(BXDistr->GetBinCenter(nbinsBX));
361  int iMin = firstBinCenter>-4 ? firstBinCenter : -4;
362  int iMax = lastBinCenter<20 ? lastBinCenter : 20;
363  for (int ibin=iMin+5;ibin<=iMax+5; ++ibin) {
364  innerME->find(fullName("BXDistribPhiOut"))->second->setBinContent(ibin,stat,BXDistr->GetBinContent(ibin-5-firstBinCenter+1));
365  }
366  for (int ibin=1;ibin<=7;++ibin) {
367  innerME->find(fullName("QualDistribPhiOut"))->second->setBinContent(ibin,stat,QualDistr->GetBinContent(ibin));
368  }
369 
370  delete BXDistr;
371  delete QualDistr;
372  }
373 
374  std::map<std::string,MonitorElement*> *innerME = &(secME[sector_id]);
375 
376  if( whME[wh].find(fullName("CorrectBXPhiOut")) == whME[wh].end() ){
377  bookWheelHistos(ibooker,wh,"ResidualBXPhiOut");
378  bookWheelHistos(ibooker,wh,"CorrectBXPhiOut");
379  bookWheelHistos(ibooker,wh,"CorrFractionPhiOut");
380  bookWheelHistos(ibooker,wh,"2ndFractionPhiOut");
381  bookWheelHistos(ibooker,wh,"TriggerInclusivePhiOut");
382  }
383 
384  innerME = &(whME[wh]);
385  innerME->find(fullName("CorrectBXPhiOut"))->second->setBinContent(sect,stat,BX_OK+0.00001);
386  innerME->find(fullName("ResidualBXPhiOut"))->second->setBinContent(sect,stat,round(25.*(BXMean-BX_OK))+0.00001);
387  innerME->find(fullName("CorrFractionPhiOut"))->second->setBinContent(sect,stat,corrFrac);
388  innerME->find(fullName("TriggerInclusivePhiOut"))->second->setBinContent(sect,stat,besttrigs);
389  innerME->find(fullName("2ndFractionPhiOut"))->second->setBinContent(sect,stat,secondFrac);
390 
391 
392  whME[wh].find(fullName("CorrFractionSummaryOut"))->second->setBinContent(sect,stat,corrSummary);
393  whME[wh].find(fullName("2ndFractionSummaryOut"))->second->setBinContent(sect,stat,secondSummary);
394 
395  } // closes BXvsQual && Flag1stvsQual && BestQual
396 
397  } // Check on TM source
398  //Theta part
399  if (hwSource=="DDU") {
400  TH2F * ThetaBXvsQual = getHisto<TH2F>(igetter.get(getMEName("ThetaBXvsQual","LocalTriggerTheta", chId)));
401  TH1F * ThetaBestQual = getHisto<TH1F>(igetter.get(getMEName("ThetaBestQual","LocalTriggerTheta", chId)));
402 
403  // no theta triggers in stat 4!
404  if (ThetaBXvsQual && ThetaBestQual && stat<4 && ThetaBestQual->GetEntries()>1) {
405  TH1D* BXH = ThetaBXvsQual->ProjectionY("",4,4,"");
406  int BXOK_bin = BXH->GetEffectiveEntries()>=1 ? BXH->GetMaximumBin(): 10;
407  double BX_OK = ThetaBXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
408  double trigs = ThetaBestQual->GetEntries();
409  double trigsH = ThetaBestQual->GetBinContent(4);
410  delete BXH;
411 
412  if( whME[wh].find(fullName("HFractionTheta")) == whME[wh].end() ){
413  bookWheelHistos(ibooker,wh,"CorrectBXTheta");
414  bookWheelHistos(ibooker,wh,"HFractionTheta");
415  }
416  std::map<std::string,MonitorElement*> *innerME = &(whME.find(wh)->second);
417  innerME->find(fullName("CorrectBXTheta"))->second->setBinContent(sect,stat,BX_OK+0.00001);
418  innerME->find(fullName("HFractionTheta"))->second->setBinContent(sect,stat,trigsH/trigs);
419 
420  }
421  }
422  else if (hwSource=="TM") {
423  // Perform TM plot analysis (Theta ones)
424  TH2F * ThetaPosvsBX = getHisto<TH2F>(igetter.get(getMEName("PositionvsBX","LocalTriggerTheta", chId)));
425  double BX_OK = 48;
426  // no theta triggers in stat 4!
427  if (ThetaPosvsBX && stat<4 && ThetaPosvsBX->GetEntries()>1) {
428  TH1D* BX = ThetaPosvsBX->ProjectionX();
429  int BXOK_bin = BX->GetEffectiveEntries()>=1 ? BX->GetMaximumBin(): 10;
430  BX_OK = ThetaPosvsBX->GetXaxis()->GetBinCenter(BXOK_bin);
431  delete BX;
432 
433  if( whME[wh].find(fullName("CorrectBXTheta")) == whME[wh].end() ){
434  bookWheelHistos(ibooker,wh,"CorrectBXTheta");
435  }
436  std::map<std::string,MonitorElement*> *innerME = &(whME.find(wh)->second);
437  innerME->find(fullName("CorrectBXTheta"))->second->setBinContent(sect,stat,BX_OK+0.00001);
438  }
439  // After TM the DDU is not used and the TM has information on the Theta Quality
440  // Adding trigger info to compute H fraction (11/10/2016) M.C.Fouz
441  TH2F * ThetaBXvsQual = getHisto<TH2F>(igetter.get(getMEName("ThetaBXvsQual","LocalTriggerTheta", chId)));
442  TH1F * ThetaBestQual = getHisto<TH1F>(igetter.get(getMEName("ThetaBestQual","LocalTriggerTheta", chId)));
443  if (ThetaBXvsQual && ThetaBestQual && stat<4 && ThetaBestQual->GetEntries()>1) {
444  double trigs = ThetaBestQual->GetEntries();
445  double trigsH = ThetaBestQual->GetBinContent(2); // Note that for the new plots H is at bin=2 and not 4 as in DDU!!!!
446  if( whME[wh].find(fullName("HFractionTheta")) == whME[wh].end() ){
447  bookWheelHistos(ibooker,wh,"HFractionTheta");
448  }
449  std::map<std::string,MonitorElement*> *innerME = &(whME.find(wh)->second);
450  innerME->find(fullName("HFractionTheta"))->second->setBinContent(sect,stat,trigsH/trigs);
451  }
452  // END ADDING H Fraction info
453  }
454  }
455 
456  }
457  }
458  }
459  }
460  }
461 
462 
463  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
464  trigSource = (*iTr);
465  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
466  hwSource = (*iHw);
467  for (int wh=-2; wh<=2; ++wh){
468  std::map<std::string,MonitorElement*> *innerME = &(whME[wh]);
469  if(hwSource=="COM") {
470  TH2F* matchWhSummary = getHisto<TH2F>(innerME->find(fullName("MatchingSummary"))->second);
471  for (int sect=1; sect<=12; ++sect){
472  int matchErr = 0;
473  int matchNoData = 0;
474  for (int stat=1; stat<=4; ++stat){
475  switch (static_cast<int>(matchWhSummary->GetBinContent(sect,stat))) {
476  case 1:
477  matchNoData++;
478  case 2:
479  matchErr++;
480  }
481  }
482  if (matchNoData == 4) matchErr = 5;
483  cmsME.find(fullName("MatchingSummary"))->second->setBinContent(sect,wh+wheelArrayShift,matchErr);
484  }
485  }
486  else {
487  // In part
488  TH2F* corrWhSummaryIn = getHisto<TH2F>(innerME->find(fullName("CorrFractionSummaryIn"))->second);
489  TH2F* secondWhSummaryIn = getHisto<TH2F>(innerME->find(fullName("2ndFractionSummaryIn"))->second);
490  for (int sect=1; sect<=12; ++sect){
491  int corrErr = 0;
492  int secondErr = 0;
493  int corrNoData = 0;
494  int secondNoData = 0;
495  for (int stat=1; stat<=4; ++stat){
496  switch (static_cast<int>(corrWhSummaryIn->GetBinContent(sect,stat))) {
497  case 1:
498  corrNoData++;
499  case 2:
500  corrErr++;
501  }
502  switch (static_cast<int>(secondWhSummaryIn->GetBinContent(sect,stat))) {
503  case 1:
504  secondNoData++;
505  case 2:
506  secondErr++;
507  }
508  }
509  if (corrNoData == 4) corrErr = 5;
510  if (secondNoData == 4) secondErr = 5;
511  cmsME.find(fullName("CorrFractionSummaryIn"))->second->setBinContent(sect,wh+wheelArrayShift,corrErr);
512  cmsME.find(fullName("2ndFractionSummaryIn"))->second->setBinContent(sect,wh+wheelArrayShift,secondErr);
513  }
514  // Out part
515  TH2F* corrWhSummaryOut = getHisto<TH2F>(innerME->find(fullName("CorrFractionSummaryOut"))->second);
516  TH2F* secondWhSummaryOut = getHisto<TH2F>(innerME->find(fullName("2ndFractionSummaryOut"))->second);
517  for (int sect=1; sect<=12; ++sect){
518  int corrErr = 0;
519  int secondErr = 0;
520  int corrNoData = 0;
521  int secondNoData = 0;
522  for (int stat=1; stat<=4; ++stat){
523  switch (static_cast<int>(corrWhSummaryOut->GetBinContent(sect,stat))) {
524  case 1:
525  corrNoData++;
526  case 2:
527  corrErr++;
528  }
529  switch (static_cast<int>(secondWhSummaryOut->GetBinContent(sect,stat))) {
530  case 1:
531  secondNoData++;
532  case 2:
533  secondErr++;
534  }
535  }
536  if (corrNoData == 4) corrErr = 5;
537  if (secondNoData == 4) secondErr = 5;
538  cmsME.find(fullName("CorrFractionSummaryOut"))->second->setBinContent(sect,wh+wheelArrayShift,corrErr);
539  cmsME.find(fullName("2ndFractionSummaryOut"))->second->setBinContent(sect,wh+wheelArrayShift,secondErr);
540  }
541  }
542  }
543  }
544  }
545 
546  fillGlobalSummary(igetter);
547 
548 }
549 
551 
552  float glbPerc[5] = { 1., 0.9, 0.6, 0.3, 0.01 };
553  trigSource = "";
554  hwSource = "TM";
555 
556  int nSecReadout = 0;
557 
558  for (int wh=-2; wh<=2; ++wh) {
559  for (int sect=1; sect<=12; ++sect) {
560 
561  float maxErr = 8.;
562  int corr = cmsME.find(fullName("CorrFractionSummaryIn"))->second->getBinContent(sect,wh+wheelArrayShift);
563  int second = cmsME.find(fullName("2ndFractionSummaryIn"))->second->getBinContent(sect,wh+wheelArrayShift);
564  int lut=0;
565  MonitorElement * lutsME = igetter.get(topFolder(hwSource=="TM") + "Summaries/TrigLutSummary");
566  if (lutsME) {
567  lut = lutsME->getBinContent(sect,wh+wheelArrayShift);
568  maxErr+=4;
569  } else {
570  LogTrace(category()) << "[" << testName
571  << "Test]: TM Lut test Summary histo not found." << endl;
572  }
573  (corr <5 || second<5) && nSecReadout++;
574  int errcode = ((corr<5 ? corr : 4) + (second<5 ? second : 4) + (lut<5 ? lut : 4) );
575  errcode = min(int((errcode/maxErr + 0.01)*5),5);
576  cmsME.find("TrigGlbSummary")->second->setBinContent(sect,wh+wheelArrayShift,glbPerc[errcode]);
577 
578  }
579  }
580 
581  if (!nSecReadout)
582  cmsME.find("TrigGlbSummary")->second->Reset(); // white histo id TM is not RO
583 
584  string nEvtsName = "DT/EventInfo/Counters/nProcessedEventsTrigger";
585  MonitorElement * meProcEvts = igetter.get(nEvtsName);
586 
587  if (meProcEvts) {
588  int nProcEvts = meProcEvts->getFloatValue();
589  cmsME.find("TrigGlbSummary")->second->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
590  } else {
591  cmsME.find("TrigGlbSummary")->second->setEntries(nMinEvts + 1);
592  LogVerbatim (category()) << "[" << testName
593  << "Test]: ME: " << nEvtsName << " not found!" << endl;
594  }
595 
596 }
597 
598 
599 
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
BeginRun.
T getUntrackedParameter(std::string const &, T const &) const
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
double getFloatValue() const
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
~DTLocalTriggerTest() override
Destructor.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
U second(std::pair< T, U > const &p)
void fillGlobalSummary(DQMStore::IGetter &)
EventID const & min(EventID const &lh, EventID const &rh)
Definition: EventID.h:137
#define end
Definition: vmac.h:39
#define LogTrace(id)
JetCorrectorParameters corr
Definition: classes.h:5
void beginRun(edm::Run const &run, edm::EventSetup const &context) override
BeginRun.
DTLocalTriggerTest(const edm::ParameterSet &ps)
Constructor.
double getBinContent(int binx) const
get content of bin (1-D)
HLT enums.
void runClientDiagnostic(DQMStore::IBooker &, DQMStore::IGetter &) override
Run client analysis.
Definition: Run.h:44