00001 // -*- C++ -*- 00002 // 00003 // Package: SiStripMonitorSummary 00004 // Class : SiStripMonitorCondDataOnDemandExample 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 "DQM/SiStripMonitorSummary/interface/SiStripMonitorCondDataOnDemandExample.h" 00018 #include "DQM/SiStripMonitorSummary/interface/SiStripClassToMonitorCondData.h" 00019 00020 #include "TH1F.h" 00021 #include "TH2F.h" 00022 #include "TProfile.h" 00023 00024 // std 00025 #include <cstdlib> 00026 #include <string> 00027 #include <cmath> 00028 #include <numeric> 00029 #include <algorithm> 00030 00031 00032 // 00033 // ----- Constructor 00034 // 00035 SiStripMonitorCondDataOnDemandExample::SiStripMonitorCondDataOnDemandExample(edm::ParameterSet const& iConfig):conf_(iConfig){} 00036 // ----- 00037 00038 00039 00040 // 00041 // ----- Destructor 00042 // 00043 SiStripMonitorCondDataOnDemandExample::~SiStripMonitorCondDataOnDemandExample(){} 00044 // ----- 00045 00046 00047 00048 00049 // 00050 // ----- beginRun 00051 // 00052 void SiStripMonitorCondDataOnDemandExample::beginRun(edm::Run const& run, edm::EventSetup const& eSetup) { 00053 eventCounter_=0; 00054 condDataMonitoring_ = new SiStripClassToMonitorCondData(conf_); 00055 condDataMonitoring_->beginRun(eSetup); 00056 00057 00058 00059 } // beginRun 00060 // ----- 00061 00062 00063 00064 // 00065 // ----- beginJob 00066 // 00067 void SiStripMonitorCondDataOnDemandExample::beginJob(void){} //beginJob 00068 00069 00070 00071 // 00072 // ----- Analyze 00073 // 00074 void SiStripMonitorCondDataOnDemandExample::analyze(edm::Event const& iEvent, edm::EventSetup const& eSetup){ 00075 //eventCounter_++; 00076 00077 // on demand type I : eventSetup and detId to be passed 00078 // output : ME's corresponding to that detId 00079 00080 00081 //if(eventCounter_==1){ condDataMonitoring_ -> getModMEsOnDemand(eSetup,369125542);} 00082 00083 // on demand type II : eventSetup, subdetector-type(TIB/TOB/TEC/TID), 00084 // subdetector-side for TEC/TID (0 for TIB and TOB) 00085 // layer_number (0=all layers) 00086 00087 //if(eventCounter_==2){ condDataMonitoring_ -> getLayerMEsOnDemand(eSetup,"TEC",0,1);} 00088 //condDataMonitoring_ -> getModMEsOnDemand(eSetup,369125542); 00089 condDataMonitoring_ -> getLayerMEsOnDemand(eSetup,"TEC",2,4); 00090 00091 00092 00093 } // analyze 00094 // ----- 00095 00096 00097 00098 // 00099 // ----- endRun 00100 // 00101 void SiStripMonitorCondDataOnDemandExample::endRun(edm::Run const& run, edm::EventSetup const& eSetup) { 00102 00103 condDataMonitoring_->endRun(eSetup); 00104 00105 } // endRun 00106 // ----- 00107 00108 00109 00110 // 00111 // ----- endJob 00112 // 00113 void SiStripMonitorCondDataOnDemandExample::endJob(void){} //endJob 00114 00115 00116 #include "FWCore/Framework/interface/MakerMacros.h" 00117 DEFINE_FWK_MODULE(SiStripMonitorCondDataOnDemandExample); 00118 00119