CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/DQM/SiPixelMonitorClient/src/SiPixelCertification.cc

Go to the documentation of this file.
00001 #include "DQM/SiPixelMonitorClient/interface/SiPixelCertification.h"
00002 
00003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00004 #include "FWCore/ServiceRegistry/interface/Service.h"
00005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00006 
00007 #include "DQMServices/Core/interface/DQMStore.h"
00008 #include "DQMServices/Core/interface/MonitorElement.h"
00009 
00010 #include "CondFormats/RunInfo/interface/RunInfo.h"
00011 #include "CondFormats/RunInfo/interface/RunSummary.h"
00012 #include "CondFormats/DataRecord/interface/RunSummaryRcd.h"
00013 
00014 #include <iostream>
00015 #include <iomanip>
00016 #include <stdio.h>
00017 #include <string>
00018 #include <sstream>
00019 #include <math.h>
00020 
00021 using namespace std;
00022 using namespace edm;
00023 SiPixelCertification::SiPixelCertification(const edm::ParameterSet& ps) {
00024   edm::LogInfo( "SiPixelCertification") << "SiPixelCertification::Creating SiPixelCertification ";
00025   dbe_ = 0;
00026   dbe_ = Service<DQMStore>().operator->();
00027 }
00028 
00029 SiPixelCertification::~SiPixelCertification(){
00030   edm::LogInfo( "SiPixelCertification") << "SiPixelCertification::Deleting SiPixelCertification ";
00031 }
00032 
00033 void SiPixelCertification::beginJob(){
00034   edm::LogInfo( "SiPixelCertification") << "SiPixelCertification::beginJob ";
00035 
00036   dbe_->setCurrentFolder("Pixel/EventInfo");
00037   CertificationPixel= dbe_->bookFloat("CertificationSummary");  
00038   dbe_->setCurrentFolder("Pixel/EventInfo/CertificationContents");
00039   CertificationBarrel= dbe_->bookFloat("PixelBarrelFraction");  
00040   CertificationEndcap= dbe_->bookFloat("PixelEndcapFraction");  
00041 
00042   CertificationPixel->Fill(1.);  
00043   CertificationBarrel->Fill(1.);  
00044   CertificationEndcap->Fill(1.);  
00045 }
00046 
00047 
00048 void SiPixelCertification::beginLuminosityBlock(const LuminosityBlock& lumiBlock, const  EventSetup& iSetup){
00049   edm::LogInfo( "SiPixelCertification") << "SiPixelCertification::beginLuminosityBlock ";
00050 }
00051 
00052 
00053 void SiPixelCertification::endLuminosityBlock(const edm::LuminosityBlock&  lumiBlock, const  edm::EventSetup& iSetup){
00054 //cout<<"Entering SiPixelCertification::endLuminosityBlock: "<<endl;
00055   edm::LogInfo( "SiPixelCertification") << "SiPixelCertification::endLuminosityBlock ";
00056   // Compute and fill overall certification bits, for now use smallest single value:
00057   float dcsFrac = (dbe_->get("Pixel/EventInfo/DCSSummary"))->getFloatValue();
00058   float daqFrac = (dbe_->get("Pixel/EventInfo/DAQSummary"))->getFloatValue();
00059   float dqmFrac = (dbe_->get("Pixel/EventInfo/reportSummary"))->getFloatValue();
00060   float pixel_all = std::min(dcsFrac,daqFrac);
00061   pixel_all = std::min(pixel_all,dqmFrac);
00062 //std::cout<<"Pixel numbers: "<<dcsFrac<<" , "<<daqFrac<<" , "<<dqmFrac<<" , "<<pixel_all<<std::endl;
00063   CertificationPixel = dbe_->get("Pixel/EventInfo/CertificationSummary");
00064   if(CertificationPixel) CertificationPixel->Fill(pixel_all);
00065 
00066   dcsFrac = (dbe_->get("Pixel/EventInfo/DCSContents/PixelBarrelFraction"))->getFloatValue();
00067   daqFrac = (dbe_->get("Pixel/EventInfo/DAQContents/PixelBarrelFraction"))->getFloatValue();
00068   dqmFrac = (dbe_->get("Pixel/EventInfo/reportSummaryContents/PixelBarrelFraction"))->getFloatValue();
00069   float pixel_barrel = std::min(dcsFrac,daqFrac);
00070   pixel_barrel = std::min(pixel_barrel,dqmFrac);
00071 //std::cout<<"Barrel numbers: "<<dcsFrac<<" , "<<daqFrac<<" , "<<dqmFrac<<" , "<<pixel_barrel<<std::endl;
00072   CertificationBarrel = dbe_->get("Pixel/EventInfo/CertificationContents/PixelBarrelFraction");
00073   if(CertificationBarrel) CertificationBarrel->Fill(pixel_barrel);
00074 
00075   dcsFrac = (dbe_->get("Pixel/EventInfo/DCSContents/PixelEndcapFraction"))->getFloatValue();
00076   daqFrac = (dbe_->get("Pixel/EventInfo/DAQContents/PixelEndcapFraction"))->getFloatValue();
00077   dqmFrac = (dbe_->get("Pixel/EventInfo/reportSummaryContents/PixelEndcapFraction"))->getFloatValue();
00078   float pixel_endcap = std::min(dcsFrac,daqFrac);
00079   pixel_endcap = std::min(pixel_endcap,dqmFrac);
00080 //std::cout<<"Endcap numbers: "<<dcsFrac<<" , "<<daqFrac<<" , "<<dqmFrac<<" , "<<pixel_endcap<<std::endl;
00081   CertificationEndcap = dbe_->get("Pixel/EventInfo/CertificationContents/PixelEndcapFraction");
00082   if(CertificationEndcap) CertificationEndcap->Fill(pixel_endcap);
00083 
00084 }
00085 
00086 
00087 void SiPixelCertification::endRun(const edm::Run& r, const  edm::EventSetup& iSetup){
00088 //cout<<"Entering SiPixelCertification::endRun: "<<endl;
00089   edm::LogInfo( "SiPixelCertification") << "SiPixelCertification::endRun ";
00090   // Compute and fill overall certification bits, for now use smallest single value:
00091   float dcsFrac = (dbe_->get("Pixel/EventInfo/DCSSummary"))->getFloatValue();
00092   float daqFrac = (dbe_->get("Pixel/EventInfo/DAQSummary"))->getFloatValue();
00093   float dqmFrac = (dbe_->get("Pixel/EventInfo/reportSummary"))->getFloatValue();
00094   float pixel_all = std::min(dcsFrac,daqFrac);
00095   pixel_all = std::min(pixel_all,dqmFrac);
00096 //std::cout<<"Pixel numbers: "<<dcsFrac<<" , "<<daqFrac<<" , "<<dqmFrac<<" , "<<pixel_all<<std::endl;
00097   CertificationPixel = dbe_->get("Pixel/EventInfo/CertificationSummary");
00098   if(CertificationPixel) CertificationPixel->Fill(pixel_all);
00099 
00100   dcsFrac = (dbe_->get("Pixel/EventInfo/DCSContents/PixelBarrelFraction"))->getFloatValue();
00101   daqFrac = (dbe_->get("Pixel/EventInfo/DAQContents/PixelBarrelFraction"))->getFloatValue();
00102   dqmFrac = (dbe_->get("Pixel/EventInfo/reportSummaryContents/PixelBarrelFraction"))->getFloatValue();
00103   float pixel_barrel = std::min(dcsFrac,daqFrac);
00104   pixel_barrel = std::min(pixel_barrel,dqmFrac);
00105 //std::cout<<"Barrel numbers: "<<dcsFrac<<" , "<<daqFrac<<" , "<<dqmFrac<<" , "<<pixel_barrel<<std::endl;
00106   CertificationBarrel = dbe_->get("Pixel/EventInfo/CertificationContents/PixelBarrelFraction");
00107   if(CertificationBarrel) CertificationBarrel->Fill(pixel_barrel);
00108 
00109   dcsFrac = (dbe_->get("Pixel/EventInfo/DCSContents/PixelEndcapFraction"))->getFloatValue();
00110   daqFrac = (dbe_->get("Pixel/EventInfo/DAQContents/PixelEndcapFraction"))->getFloatValue();
00111   dqmFrac = (dbe_->get("Pixel/EventInfo/reportSummaryContents/PixelEndcapFraction"))->getFloatValue();
00112   float pixel_endcap = std::min(dcsFrac,daqFrac);
00113   pixel_endcap = std::min(pixel_endcap,dqmFrac);
00114 //std::cout<<"Endcap numbers: "<<dcsFrac<<" , "<<daqFrac<<" , "<<dqmFrac<<" , "<<pixel_endcap<<std::endl;
00115   CertificationEndcap = dbe_->get("Pixel/EventInfo/CertificationContents/PixelEndcapFraction");
00116   if(CertificationEndcap) CertificationEndcap->Fill(pixel_endcap);
00117 
00118 }
00119 
00120 
00121 void SiPixelCertification::endJob() {
00122   edm::LogInfo( "SiPixelCertification") << "SiPixelCertification::endJob ";
00123 }
00124 
00125 
00126 
00127 void SiPixelCertification::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup){
00128   edm::LogInfo( "SiPixelCertification") << "SiPixelCertification::analyze ";
00129 }