CMS 3D CMS Logo

SiStripClassToMonitorCondData.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     SiStripMonitorSummary
00004 // Class  :     SiStripClassToMonitorCondData
00005 // 
00006 // Original Author:  Evelyne Delmeire
00007 //
00008 
00009 
00010 #include "FWCore/Framework/interface/ESHandle.h"
00011 #include "FWCore/ServiceRegistry/interface/Service.h"
00012 #include "FWCore/Framework/interface/Event.h"
00013 #include "FWCore/Framework/interface/EventSetup.h"
00014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00015 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00016 
00017 #include "DataFormats/Common/interface/Handle.h"
00018 #include "DataFormats/SiStripDetId/interface/SiStripSubStructure.h"
00019 
00020 #include "DQM/SiStripCommon/interface/SiStripFolderOrganizer.h"
00021 #include "DQM/SiStripCommon/interface/SiStripHistoId.h"
00022 #include "DQM/SiStripCommon/interface/ExtractTObject.h"
00023 #include "DQMServices/Core/interface/DQMStore.h"
00024 #include "DQMServices/Core/interface/MonitorElement.h"
00025 
00026 
00027 #include "DQM/SiStripMonitorSummary/interface/SiStripClassToMonitorCondData.h"
00028 
00029 #include "DQM/SiStripMonitorSummary/interface/SiStripPedestalsDQM.h" 
00030 #include "DQM/SiStripMonitorSummary/interface/SiStripNoisesDQM.h" 
00031 #include "DQM/SiStripMonitorSummary/interface/SiStripQualityDQM.h" 
00032 #include "DQM/SiStripMonitorSummary/interface/SiStripApvGainsDQM.h" 
00033 #include "DQM/SiStripMonitorSummary/interface/SiStripLorentzAngleDQM.h" 
00034 
00035 #include "CondFormats/SiStripObjects/interface/SiStripPedestals.h"
00036 #include "CondFormats/SiStripObjects/interface/SiStripNoises.h"
00037 #include "CondFormats/SiStripObjects/interface/SiStripApvGain.h"
00038 #include "CondFormats/SiStripObjects/interface/SiStripLorentzAngle.h"
00039 
00040 #include "CondFormats/DataRecord/interface/SiStripPedestalsRcd.h"
00041 #include "CondFormats/DataRecord/interface/SiStripApvGainRcd.h"
00042 #include "CondFormats/DataRecord/interface/SiStripNoisesRcd.h"
00043 
00044 #include "CalibFormats/SiStripObjects/interface/SiStripQuality.h"
00045 #include "CalibTracker/Records/interface/SiStripQualityRcd.h"
00046 
00047 #include "TH1F.h"
00048 #include "TH2F.h"
00049 #include "TProfile.h"
00050 
00051 // std
00052 #include <cstdlib>
00053 #include <string>
00054 //#include <cmath>
00055 //#include <numeric>
00056 #include <algorithm>
00057 
00058 
00059 //
00060 // ----- Constructor
00061 //
00062 SiStripClassToMonitorCondData::SiStripClassToMonitorCondData(edm::ParameterSet const& iConfig):conf_(iConfig){
00063   
00064   monitorPedestals_      = iConfig.getParameter<bool>("MonitorSiStripPedestal");
00065   monitorNoises_         = iConfig.getParameter<bool>("MonitorSiStripNoise");
00066   monitorQuality_        = iConfig.getParameter<bool>("MonitorSiStripQuality");
00067   monitorApvGains_       = iConfig.getParameter<bool>("MonitorSiStripApvGain");
00068   monitorLorentzAngle_   = iConfig.getParameter<bool>("MonitorSiStripLorentzAngle");
00069   
00070 }
00071 // -----
00072 
00073 
00074 
00075 //
00076 // ----- Destructor
00077 // 
00078 SiStripClassToMonitorCondData::~SiStripClassToMonitorCondData(){
00079   
00080   if(monitorPedestals_)  { delete pedestalsDQM_;}
00081   if(monitorNoises_)     { delete noisesDQM_;   }
00082   if(monitorQuality_)    { delete qualityDQM_;  }
00083   if(monitorApvGains_)   { delete apvgainsDQM_; }
00084   if(monitorLorentzAngle_){ delete lorentzangleDQM_; }
00085 
00086 }
00087 // -----
00088 
00089 
00090 
00091 
00092 //
00093 // ----- beginRun
00094 //    
00095 void SiStripClassToMonitorCondData::beginRun(edm::EventSetup const& eSetup) {
00096   
00097   if(monitorPedestals_){
00098     pedestalsDQM_ = new SiStripPedestalsDQM(eSetup,
00099                                             conf_.getParameter<edm::ParameterSet>("SiStripPedestalsDQM_PSet"),
00100                                             conf_.getParameter<edm::ParameterSet>("FillConditions_PSet"));
00101   }
00102   
00103   
00104   if(monitorNoises_){
00105     noisesDQM_ = new SiStripNoisesDQM(eSetup,
00106                                       conf_.getParameter<edm::ParameterSet>("SiStripNoisesDQM_PSet"),
00107                                       conf_.getParameter<edm::ParameterSet>("FillConditions_PSet"));
00108   }
00109  
00110   
00111   if(monitorQuality_){
00112     qualityDQM_ = new SiStripQualityDQM(eSetup,
00113                                         conf_.getParameter<edm::ParameterSet>("SiStripQualityDQM_PSet"),
00114                                         conf_.getParameter<edm::ParameterSet>("FillConditions_PSet"));
00115   } 
00116   
00117  
00118   if(monitorApvGains_){
00119     apvgainsDQM_ = new SiStripApvGainsDQM(eSetup,
00120                                           conf_.getParameter<edm::ParameterSet>("SiStripApvGainsDQM_PSet"),
00121                                           conf_.getParameter<edm::ParameterSet>("FillConditions_PSet"));
00122   }
00123   
00124   if(monitorLorentzAngle_){
00125     lorentzangleDQM_ = new SiStripLorentzAngleDQM(eSetup,
00126                                           conf_.getParameter<edm::ParameterSet>("SiStripLorentzAngleDQM_PSet"),
00127                                           conf_.getParameter<edm::ParameterSet>("FillConditions_PSet"));
00128   }
00129   
00130 
00131 } // beginRun
00132 // -----
00133 
00134 
00135 
00136 //
00137 // ----- beginJob
00138 //
00139 void SiStripClassToMonitorCondData::beginJob(void){} //beginJob
00140 
00141 
00142 //
00143 // ----- getModuleMEsOnDemand
00144 //
00145 void SiStripClassToMonitorCondData::getModMEsOnDemand(edm::EventSetup const& eSetup, uint32_t requestedDetId){
00146 
00147   if(monitorPedestals_)      { pedestalsDQM_     ->analysisOnDemand(eSetup,requestedDetId);}
00148   if(monitorNoises_)         { noisesDQM_        ->analysisOnDemand(eSetup,requestedDetId);}    
00149   if(monitorQuality_)        { qualityDQM_       ->analysisOnDemand(eSetup,requestedDetId);}
00150   if(monitorApvGains_)       { apvgainsDQM_      ->analysisOnDemand(eSetup,requestedDetId);} 
00151   if(monitorLorentzAngle_)   { lorentzangleDQM_  ->analysisOnDemand(eSetup,requestedDetId);} 
00152     
00153 }
00154 // -----
00155 
00156 //
00157 // ----- getlayerMEsOnDemand
00158 //
00159 void SiStripClassToMonitorCondData::getLayerMEsOnDemand(edm::EventSetup const& eSetup, std::string requestedSubDetector, 
00160                                                         uint32_t requestedSide, 
00161                                                         uint32_t requestedLayer){
00162  
00163   if(monitorPedestals_)      { pedestalsDQM_     ->analysisOnDemand(eSetup,requestedSubDetector, requestedSide,requestedLayer);}
00164   if(monitorNoises_)         { noisesDQM_        ->analysisOnDemand(eSetup,requestedSubDetector, requestedSide,requestedLayer);}    
00165   if(monitorQuality_)        { qualityDQM_       ->analysisOnDemand(eSetup,requestedSubDetector, requestedSide,requestedLayer);}
00166   if(monitorApvGains_)       { apvgainsDQM_      ->analysisOnDemand(eSetup,requestedSubDetector, requestedSide,requestedLayer);} 
00167   if(monitorLorentzAngle_)   { lorentzangleDQM_  ->analysisOnDemand(eSetup,requestedSubDetector, requestedSide,requestedLayer);} 
00168   
00169 }
00170 
00171 //
00172 // ----- Analyze
00173 //
00174 void SiStripClassToMonitorCondData::analyseCondData(edm::EventSetup const& eSetup){
00175 
00176   if(monitorPedestals_)      { pedestalsDQM_     ->analysis(eSetup);}
00177   if(monitorNoises_)         { noisesDQM_        ->analysis(eSetup);}    
00178   if(monitorQuality_)        { qualityDQM_       ->analysis(eSetup);}
00179   if(monitorApvGains_)       { apvgainsDQM_      ->analysis(eSetup);} 
00180   if(monitorLorentzAngle_)   { lorentzangleDQM_  ->analysis(eSetup);} 
00181     
00182 } // analyze
00183 // -----
00184 
00185 
00186 
00187 //
00188 // ----- endRun
00189 //    
00190 void SiStripClassToMonitorCondData::endRun(edm::EventSetup const& eSetup) {
00191   
00192   bool outputMEsInRootFile    = conf_.getParameter<bool>("OutputMEsInRootFile");
00193   std::string outputFileName  = conf_.getParameter<std::string>("OutputFileName");
00194 
00195   DQMStore* dqmStore_=edm::Service<DQMStore>().operator->();
00196   
00197   if (outputMEsInRootFile) { 
00198     dqmStore_->showDirStructure();
00199     dqmStore_->save(outputFileName);
00200   } 
00201  
00202 } // endRun
00203 // -----
00204 
00205 
00206 //
00207 // ----- endJob
00208 //
00209 void SiStripClassToMonitorCondData::endJob(void){} //endJob
00210 
00211 
00212   

Generated on Tue Jun 9 17:33:40 2009 for CMSSW by  doxygen 1.5.4