From c4d8f786c755b6d0ff12297c5303350508b799e5 Mon Sep 17 00:00:00 2001 From: Sachiko Toda Date: Fri, 28 Aug 2015 01:54:15 +0200 Subject: [PATCH] adding scal monitoring --- .../clients/scal_dqm_sourceclient-live_cfg.py | 94 +++++++++++++++++++ DQMServices/Components/src/DQMScalInfo.cc | 45 +++++++++ DQMServices/Components/src/DQMScalInfo.h | 10 ++ 3 files changed, 149 insertions(+) create mode 100755 DQM/Integration/python/clients/scal_dqm_sourceclient-live_cfg.py diff --git a/DQM/Integration/python/clients/scal_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/scal_dqm_sourceclient-live_cfg.py new file mode 100755 index 0000000000000..95a91979e9375 --- /dev/null +++ b/DQM/Integration/python/clients/scal_dqm_sourceclient-live_cfg.py @@ -0,0 +1,94 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("DQM") + +#---------------------------- +#### Event Source +#---------------------------- +# for live online DQM in P5 +process.load("DQM.Integration.config.inputsource_cfi") + +# for testing in lxplus +#process.load("DQM.Integration.config.fileinputsource_cfi") + +#---------------------------- +#### DQM Environment +#---------------------------- +process.load("DQM.Integration.config.environment_cfi") +process.dqmEnv.subSystemFolder = 'Scal' +process.dqmSaver.tag = 'Scal' +#----------------------------- +process.load("DQMServices.Components.DQMScalInfo_cfi") + +# message logger +process.MessageLogger = cms.Service("MessageLogger", + destinations = cms.untracked.vstring('cout'), + cout = cms.untracked.PSet(threshold = cms.untracked.string('WARNING')) + ) + +# Global tag +# Condition for P5 cluster +process.load("DQM.Integration.config.FrontierCondition_GT_cfi") +process.load("EventFilter.L1GlobalTriggerRawToDigi.l1GtUnpack_cfi") +process.load("EventFilter.L1GlobalTriggerRawToDigi.l1GtEvmUnpack_cfi") +process.load("EventFilter.L1GlobalTriggerRawToDigi.l1GtRecord_cfi") + +import EventFilter.L1GlobalTriggerRawToDigi.l1GtUnpack_cfi +gtDigis = EventFilter.L1GlobalTriggerRawToDigi.l1GtUnpack_cfi.l1GtUnpack.clone() +import EventFilter.L1GlobalTriggerRawToDigi.l1GtEvmUnpack_cfi +gtEvmDigis = EventFilter.L1GlobalTriggerRawToDigi.l1GtEvmUnpack_cfi.l1GtEvmUnpack.clone() + +if (process.runType.getRunType() == process.runType.pp_run): + process.source.SelectEvents = cms.untracked.vstring('HLT_ZeroBias*') + +process.physicsBitSelector = cms.EDFilter("PhysDecl", + applyfilter = cms.untracked.bool(False), + debugOn = cms.untracked.bool(False), + HLTriggerResults = cms.InputTag("TriggerResults","","HLT") + ) + + +process.load("EventFilter.ScalersRawToDigi.ScalersRawToDigi_cfi") + +## Collision Reconstruction +process.load("Configuration.StandardSequences.RawToDigi_Data_cff") +#process.load("Configuration.StandardSequences.Reconstruction_cff") + +#----------------------------- +#### Sub-system configuration follows +process.dump = cms.EDAnalyzer('EventContentAnalyzer') + +# DQM Modules +process.dqmmodules = cms.Sequence(process.dqmEnv + process.dqmSaver) +process.evfDQMmodulesPath = cms.Path( + process.l1GtUnpack* + process.gtDigis* + process.l1GtRecord* + process.physicsBitSelector* + process.scalersRawToDigi* + process.dqmscalInfo* + process.dqmmodules + ) +process.schedule = cms.Schedule(process.evfDQMmodulesPath) + +if (process.runType.getRunType() == process.runType.hi_run): + process.castorDigis.InputLabel = cms.InputTag("rawDataRepacker") + process.csctfDigis.producer = cms.InputTag("rawDataRepacker") + process.dttfDigis.DTTF_FED_Source = cms.InputTag("rawDataRepacker") + process.ecalDigis.InputLabel = cms.InputTag("rawDataRepacker") + process.ecalPreshowerDigis.sourceTag = cms.InputTag("rawDataRepacker") + process.gctDigis.inputLabel = cms.InputTag("rawDataRepacker") + process.gtDigis.DaqGtInputTag = cms.InputTag("rawDataRepacker") + process.gtEvmDigis.EvmGtInputTag = cms.InputTag("rawDataRepacker") + process.hcalDigis.InputLabel = cms.InputTag("rawDataRepacker") + process.muonCSCDigis.InputObjects = cms.InputTag("rawDataRepacker") + process.muonDTDigis.inputLabel = cms.InputTag("rawDataRepacker") + process.muonRPCDigis.InputLabel = cms.InputTag("rawDataRepacker") + process.scalersRawToDigi.scalersInputTag = cms.InputTag("rawDataRepacker") + process.siPixelDigis.InputLabel = cms.InputTag("rawDataRepacker") + process.siStripDigis.ProductLabel = cms.InputTag("rawDataRepacker") + + +### process customizations included here +from DQM.Integration.config.online_customizations_cfi import * +process = customise(process) diff --git a/DQMServices/Components/src/DQMScalInfo.cc b/DQMServices/Components/src/DQMScalInfo.cc index 4ed89951a11ca..6f6882e4c4fa9 100755 --- a/DQMServices/Components/src/DQMScalInfo.cc +++ b/DQMServices/Components/src/DQMScalInfo.cc @@ -11,6 +11,12 @@ #include "DataFormats/L1GlobalTrigger/interface/L1GtFdlWord.h" #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" +#include "DataFormats/Scalers/interface/Level1TriggerScalers.h" +#include "DataFormats/Scalers/interface/Level1TriggerRates.h" +#include "DataFormats/Scalers/interface/ScalersRaw.h" +#include "DataFormats/Scalers/interface/TimeSpec.h" +#include "DataFormats/Scalers/interface/LumiScalers.h" + using namespace std; @@ -25,6 +31,7 @@ DQMScalInfo::DQMScalInfo(const edm::ParameterSet& ps) gtCollection_ = consumes(parameters_.getUntrackedParameter("gtCollection","gtDigis")); dcsStatusCollection_ = consumes(parameters_.getUntrackedParameter("dcsStatusCollection","scalersRawToDigi")); l1tscollectionToken_ = consumes(parameters_.getUntrackedParameter("l1TSCollection", "scalersRawToDigi")); + lumicollectionToken_ = consumes(parameters_.getUntrackedParameter("lumiCollection", "scalersRawToDigi")); } @@ -35,6 +42,8 @@ void DQMScalInfo::bookHistograms(DQMStore::IBooker & ibooker, edm::Run const & /* iRun */, edm::EventSetup const & /* iSetup */) { + const int maxNbins = 2001; + // Fetch GlobalTag information and fill the string/ME. ibooker.cd(); ibooker.setCurrentFolder(scalfolder_ +"/L1TriggerScalers/"); @@ -46,10 +55,18 @@ void DQMScalInfo::bookHistograms(DQMStore::IBooker & ibooker, hlstart_ = ibooker.book1D("lstart","Orbit of last Start",fracLS*maxLS,0,maxLS*262144); hlEC0_ = ibooker.book1D("lEC0","Orbit of last EC0",fracLS*maxLS,0,maxLS*262144); hlHR_ = ibooker.book1D("lHR","Orbit of last HardReset",fracLS*maxLS,0,maxLS*262144); + + hphysTrig_ = ibooker.book1D("Physics_Triggers", "Physics Triggers", maxNbins, -0.5, double(maxNbins)-0.5); + hphysTrig_->setAxisTitle("Lumi Section", 1); + + ibooker.cd(); + ibooker.setCurrentFolder(scalfolder_ +"/LumiScalers/"); + hinstLumi_ = ibooker.book1D("Instant_Lumi", "Instant Lumi", maxNbins, -0.5, double(maxNbins)-0.5); } void DQMScalInfo::analyze(const edm::Event& e, const edm::EventSetup& c){ makeL1Scalars(e); + makeLumiScalars(e); return; } @@ -58,6 +75,11 @@ DQMScalInfo::makeL1Scalars(const edm::Event& e) { edm::Handle l1ts; e.getByToken(l1tscollectionToken_,l1ts); + edm::Handle lumiScalers; + e.getByToken(lumicollectionToken_,lumiScalers); + + Level1TriggerScalersCollection::const_iterator it = l1ts->begin(); + if(l1ts->size()==0) return; hlresync_->Fill((*l1ts)[0].lastResync()); hlOC0_->Fill((*l1ts)[0].lastOrbitCounter0()); @@ -66,5 +88,28 @@ DQMScalInfo::makeL1Scalars(const edm::Event& e) hlEC0_->Fill((*l1ts)[0].lastEventCounter0()); hlHR_->Fill((*l1ts)[0].lastHardReset()); + unsigned int lumisection = it->lumiSegmentNr(); + if(lumisection){ + hphysTrig_->setBinContent(lumisection + 1, it->l1AsPhysics()); + } + return ; } + +void +DQMScalInfo::makeLumiScalars(const edm::Event& e) +{ + edm::Handle lumiScalers; + e.getByToken(lumicollectionToken_,lumiScalers); + + LumiScalersCollection::const_iterator it = lumiScalers->begin(); + + if(lumiScalers->size()){ + unsigned int lumisection = it->sectionNumber(); + if(lumisection){ + hinstLumi_->setBinContent(lumisection + 1, it->instantLumi()); + } + } + + return; +} diff --git a/DQMServices/Components/src/DQMScalInfo.h b/DQMServices/Components/src/DQMScalInfo.h index 74c00f9ae3cba..f5c200422215c 100755 --- a/DQMServices/Components/src/DQMScalInfo.h +++ b/DQMServices/Components/src/DQMScalInfo.h @@ -24,6 +24,12 @@ #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" #include "DataFormats/Scalers/interface/Level1TriggerScalers.h" +#include "DataFormats/Scalers/interface/Level1TriggerScalers.h" +#include "DataFormats/Scalers/interface/Level1TriggerRates.h" +#include "DataFormats/Scalers/interface/ScalersRaw.h" +#include "DataFormats/Scalers/interface/TimeSpec.h" +#include "DataFormats/Scalers/interface/LumiScalers.h" + class DQMScalInfo: public DQMEDAnalyzer{ public: @@ -43,12 +49,14 @@ class DQMScalInfo: public DQMEDAnalyzer{ private: void makeL1Scalars(const edm::Event& e); + void makeLumiScalars(const edm::Event& e); edm::ParameterSet parameters_; std::string scalfolder_; edm::EDGetTokenT gtCollection_; edm::EDGetTokenT dcsStatusCollection_; edm::EDGetTokenT l1tscollectionToken_; + edm::EDGetTokenT lumicollectionToken_; // histograms MonitorElement * hlresync_; MonitorElement * hlOC0_; @@ -56,7 +64,9 @@ class DQMScalInfo: public DQMEDAnalyzer{ MonitorElement * hlstart_; MonitorElement * hlEC0_; MonitorElement * hlHR_; + MonitorElement * hphysTrig_; + MonitorElement * hinstLumi_; }; #endif