CMS 3D CMS Logo

SiPixelCertification.cc
Go to the documentation of this file.
2 
6 
9 
13 
14 #include <cmath>
15 #include <cstdio>
16 #include <iomanip>
17 #include <iostream>
18 #include <sstream>
19 #include <string>
20 
21 using namespace std;
22 using namespace edm;
24  edm::LogInfo("SiPixelCertification") << "SiPixelCertification::Creating SiPixelCertification ";
25  firstLumi = true;
26 }
27 
29  edm::LogInfo("SiPixelCertification") << "SiPixelCertification::Deleting SiPixelCertification ";
30 }
31 
33  DQMStore::IGetter &iGetter,
34  const edm::LuminosityBlock &lumiBlock,
35  const edm::EventSetup &iSetup) {
36  // cout<<"Entering SiPixelCertification::endLuminosityBlock: "<<endl;
37 
38  // If first run, book some histograms
39  if (firstLumi) {
40  iBooker.setCurrentFolder("Pixel/EventInfo");
41  CertificationPixel = iBooker.bookFloat("CertificationSummary");
42  iBooker.setCurrentFolder("Pixel/EventInfo/CertificationContents");
43  CertificationBarrel = iBooker.bookFloat("PixelBarrelFraction");
44  CertificationEndcap = iBooker.bookFloat("PixelEndcapFraction");
45 
46  CertificationPixel->Fill(1.);
47  CertificationBarrel->Fill(1.);
48  CertificationEndcap->Fill(1.);
49 
50  firstLumi = false;
51  }
52 
53  edm::LogInfo("SiPixelCertification") << "SiPixelCertification::endLuminosityBlock ";
54  // Compute and fill overall certification bits, for now use smallest single
55  // value:
56  float dcsFrac = (iGetter.getElement("Pixel/EventInfo/DCSSummary"))->getFloatValue();
57  float daqFrac = (iGetter.getElement("Pixel/EventInfo/DAQSummary"))->getFloatValue();
58  float dqmFrac = (iGetter.getElement("Pixel/EventInfo/reportSummary"))->getFloatValue();
59  float pixel_all = std::min(dcsFrac, daqFrac);
60  pixel_all = std::min(pixel_all, dqmFrac);
61  // std::cout<<"Pixel numbers: "<<dcsFrac<<" , "<<daqFrac<<" , "<<dqmFrac<<" ,
62  // "<<pixel_all<<std::endl;
63  CertificationPixel = iGetter.getElement("Pixel/EventInfo/CertificationSummary");
64  if (CertificationPixel)
65  CertificationPixel->Fill(pixel_all);
66 
67  dcsFrac = (iGetter.getElement("Pixel/EventInfo/DCSContents/PixelBarrelFraction"))->getFloatValue();
68  daqFrac = (iGetter.getElement("Pixel/EventInfo/DAQContents/PixelBarrelFraction"))->getFloatValue();
69  dqmFrac = (iGetter.getElement("Pixel/EventInfo/reportSummaryContents/PixelBarrelFraction"))->getFloatValue();
70  float pixel_barrel = std::min(dcsFrac, daqFrac);
71  pixel_barrel = std::min(pixel_barrel, dqmFrac);
72  // std::cout<<"Barrel numbers: "<<dcsFrac<<" , "<<daqFrac<<" , "<<dqmFrac<<" ,
73  // "<<pixel_barrel<<std::endl;
74  CertificationBarrel = iGetter.getElement("Pixel/EventInfo/CertificationContents/PixelBarrelFraction");
75  if (CertificationBarrel)
76  CertificationBarrel->Fill(pixel_barrel);
77 
78  dcsFrac = (iGetter.getElement("Pixel/EventInfo/DCSContents/PixelEndcapFraction"))->getFloatValue();
79  daqFrac = (iGetter.getElement("Pixel/EventInfo/DAQContents/PixelEndcapFraction"))->getFloatValue();
80  dqmFrac = (iGetter.getElement("Pixel/EventInfo/reportSummaryContents/PixelEndcapFraction"))->getFloatValue();
81  float pixel_endcap = std::min(dcsFrac, daqFrac);
82  pixel_endcap = std::min(pixel_endcap, dqmFrac);
83  // std::cout<<"Endcap numbers: "<<dcsFrac<<" , "<<daqFrac<<" , "<<dqmFrac<<" ,
84  // "<<pixel_endcap<<std::endl;
85  CertificationEndcap = iGetter.getElement("Pixel/EventInfo/CertificationContents/PixelEndcapFraction");
86  if (CertificationEndcap)
87  CertificationEndcap->Fill(pixel_endcap);
88 }
89 
91  // cout<<"Entering SiPixelCertification::endRun: "<<endl;
92  edm::LogInfo("SiPixelCertification") << "SiPixelCertification::endRun ";
93  // Compute and fill overall certification bits, for now use smallest single
94  // value:
95  float dcsFrac = (iGetter.getElement("Pixel/EventInfo/DCSSummary"))->getFloatValue();
96  float daqFrac = (iGetter.getElement("Pixel/EventInfo/DAQSummary"))->getFloatValue();
97  float dqmFrac = (iGetter.getElement("Pixel/EventInfo/reportSummary"))->getFloatValue();
98  float pixel_all = std::min(dcsFrac, daqFrac);
99  pixel_all = std::min(pixel_all, dqmFrac);
100  // std::cout<<"Pixel numbers: "<<dcsFrac<<" , "<<daqFrac<<" , "<<dqmFrac<<" ,
101  // "<<pixel_all<<std::endl;
102  if (CertificationPixel)
103  CertificationPixel->Fill(pixel_all);
104 
105  dcsFrac = (iGetter.getElement("Pixel/EventInfo/DCSContents/PixelBarrelFraction"))->getFloatValue();
106  daqFrac = (iGetter.getElement("Pixel/EventInfo/DAQContents/PixelBarrelFraction"))->getFloatValue();
107  dqmFrac = (iGetter.getElement("Pixel/EventInfo/reportSummaryContents/PixelBarrelFraction"))->getFloatValue();
108  float pixel_barrel = std::min(dcsFrac, daqFrac);
109  pixel_barrel = std::min(pixel_barrel, dqmFrac);
110  // std::cout<<"Barrel numbers: "<<dcsFrac<<" , "<<daqFrac<<" , "<<dqmFrac<<" ,
111  // "<<pixel_barrel<<std::endl;
112  if (CertificationBarrel)
113  CertificationBarrel->Fill(pixel_barrel);
114 
115  dcsFrac = (iGetter.getElement("Pixel/EventInfo/DCSContents/PixelEndcapFraction"))->getFloatValue();
116  daqFrac = (iGetter.getElement("Pixel/EventInfo/DAQContents/PixelEndcapFraction"))->getFloatValue();
117  dqmFrac = (iGetter.getElement("Pixel/EventInfo/reportSummaryContents/PixelEndcapFraction"))->getFloatValue();
118  float pixel_endcap = std::min(dcsFrac, daqFrac);
119  pixel_endcap = std::min(pixel_endcap, dqmFrac);
120  // std::cout<<"Endcap numbers: "<<dcsFrac<<" , "<<daqFrac<<" , "<<dqmFrac<<" ,
121  // "<<pixel_endcap<<std::endl;
122  if (CertificationEndcap)
123  CertificationEndcap->Fill(pixel_endcap);
124 }
void Fill(long long x)
MonitorElement * getElement(std::string const &path)
Definition: DQMStore.cc:309
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
T min(T a, T b)
Definition: MathUtil.h:58
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
HLT enums.
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, const edm::LuminosityBlock &, const edm::EventSetup &) override
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:105
SiPixelCertification(const edm::ParameterSet &)