CMS 3D CMS Logo

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