CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DQM/DTMonitorClient/src/DTCertificationSummary.cc

Go to the documentation of this file.
00001 
00002 /*
00003  *  See header file for a description of this class.
00004  *
00005  *  $Date: 2010/01/22 15:32:04 $
00006  *  $Revision: 1.5 $
00007  *  \author G. Cerminara - INFN Torino
00008  */
00009 
00010 
00011 #include "DQM/DTMonitorClient/src/DTCertificationSummary.h"
00012 #include "DataFormats/FEDRawData/interface/FEDNumbering.h"
00013 
00014 #include "FWCore/ServiceRegistry/interface/Service.h"
00015 #include "FWCore/Framework/interface/ESHandle.h"
00016 #include "FWCore/Framework/interface/EventSetup.h"
00017 
00018 #include "DQMServices/Core/interface/DQMStore.h"
00019 #include "DQMServices/Core/interface/MonitorElement.h"
00020 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00021 
00022 using namespace std;
00023 using namespace edm;
00024 
00025 
00026 
00027 DTCertificationSummary::DTCertificationSummary(const ParameterSet& pset) {}
00028 
00029 
00030 
00031 
00032 DTCertificationSummary::~DTCertificationSummary() {}
00033 
00034 
00035 
00036 void DTCertificationSummary::beginJob(){
00037   // get the DQMStore
00038   theDbe = Service<DQMStore>().operator->();
00039   
00040   // book the ME
00041   theDbe->setCurrentFolder("DT/EventInfo");
00042   // global fraction
00043   totalCertFraction = theDbe->bookFloat("CertificationSummary");  
00044   totalCertFraction->Fill(-1);
00045 
00046   // certification map
00047   certMap = theDbe->book2D("CertificationSummaryMap","DT Certification Summary Map",12,1,13,5,-2,3);
00048   certMap->setAxisTitle("sector",1);
00049   certMap->setAxisTitle("wheel",2);
00050 
00051   theDbe->setCurrentFolder("DT/EventInfo/CertificationContents");
00052   // Wheel "fractions" -> will be 0 or 1
00053   for(int wheel = -2; wheel != 3; ++wheel) {
00054     stringstream streams;
00055     streams << "DT_Wheel" << wheel;
00056     certFractions[wheel] = theDbe->bookFloat(streams.str());
00057     certFractions[wheel]->Fill(-1);
00058   }
00059 
00060   //
00061 
00062 }
00063 
00064 
00065 
00066 void DTCertificationSummary::beginLuminosityBlock(const LuminosityBlock& lumi, const  EventSetup& setup) {
00067 }
00068 
00069 
00070 
00071 
00072 void DTCertificationSummary::beginRun(const Run& run, const  EventSetup& setup) {
00073 }
00074 
00075 
00076 
00077 
00078 void DTCertificationSummary::endLuminosityBlock(const LuminosityBlock&  lumi, const  EventSetup& setup){
00079 }
00080 
00081 
00082 
00083 void DTCertificationSummary::endRun(const Run& run, const  EventSetup& setup){
00084   // get the relevant summary histos
00085   MonitorElement* effSummary = theDbe->get("DT/05-ChamberEff/EfficiencyGlbSummary");
00086   MonitorElement* resSummary = theDbe->get("DT/02-Segments/ResidualsGlbSummary");
00087   MonitorElement* segQualSummary = theDbe->get("DT/02-Segments/segmentSummary");
00088 
00089   // check that all needed histos are there
00090   if(effSummary == 0 || resSummary == 0 || segQualSummary == 0) {
00091     LogWarning("DQM|DTMonitorClient|DTCertificationSummary") << "*** Warning: not all needed summaries are present!" << endl;
00092     return;
00093   }
00094 
00095   // reset the MEs
00096   totalCertFraction->Fill(0.);
00097   certFractions[-2]->Fill(0.);
00098   certFractions[-1]->Fill(0.);
00099   certFractions[-0]->Fill(0.);
00100   certFractions[1]->Fill(0.);
00101   certFractions[2]->Fill(0.);
00102   certMap->Reset();
00103 
00104   // loop over all sectors and wheels
00105   for(int wheel = -2; wheel != 3; ++wheel) {
00106     for(int sector = 1; sector != 13; ++sector) {
00107       double eff = effSummary->getBinContent(sector, wheel+3);
00108       double res = resSummary->getBinContent(sector, wheel+3);
00109       double segQual = segQualSummary->getBinContent(sector, wheel+3);
00110       
00111       double total = 0;
00112       if(segQual != 0) {
00113         total = min(res,eff);
00114       } else {
00115         total = eff;
00116       }
00117       
00118       certMap->Fill(sector,wheel,total);      
00119       // can use variable weight depending on the sector
00120       double weight = 1./12.;
00121       certFractions[wheel]->Fill(certFractions[wheel]->getFloatValue() + weight*total);
00122       double totalWeight = 1./60.;
00123       totalCertFraction->Fill(totalCertFraction->getFloatValue() + totalWeight*total);
00124     }
00125   }
00126 
00127 }
00128 
00129 
00130 
00131 void DTCertificationSummary::endJob() {}
00132 
00133 
00134 
00135 void DTCertificationSummary::analyze(const Event& event, const EventSetup& setup){}
00136 
00137 
00138