CMS 3D CMS Logo

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