#include <DQMLumiMonitor.h>
Public Member Functions | |
DQMLumiMonitor (const edm::ParameterSet &) | |
~DQMLumiMonitor () | |
Protected Member Functions | |
void | analyze (edm::Event const &iEvent, edm::EventSetup const &iSetup) |
void | beginJob () |
void | beginRun (edm::Run const &iRun, edm::EventSetup const &iSetup) |
void | endJob () |
void | endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) |
void | endRun (edm::Run const &iRun, edm::EventSetup const &iSetup) |
Private Member Functions | |
void | bookHistograms () |
Private Attributes | |
MonitorElement * | corrIntLumiAndClusVsLSME_ |
DQMStore * | dbe_ |
std::string | folderName_ |
float | intLumi_ |
MonitorElement * | intLumiVsLSME_ |
std::string | lumiRecordName_ |
unsigned long long | m_cacheID_ |
std::string | moduleName_ |
MonitorElement * | nClusME_ |
MonitorElement * | nClusVsLSME_ |
int | nLumi_ |
edm::ParameterSet | parameters_ |
edm::InputTag | pixelClusterInputTag_ |
Definition at line 29 of file DQMLumiMonitor.h.
DQMLumiMonitor::DQMLumiMonitor | ( | const edm::ParameterSet & | ps | ) |
Definition at line 29 of file DQMLumiMonitor.cc.
References corrIntLumiAndClusVsLSME_, folderName_, edm::ParameterSet::getParameter(), intLumiVsLSME_, lumiRecordName_, moduleName_, nClusME_, nClusVsLSME_, parameters_, and pixelClusterInputTag_.
: parameters_(ps) { moduleName_ = parameters_.getParameter<std::string>("ModuleName"); folderName_ = parameters_.getParameter<std::string>("FolderName"); pixelClusterInputTag_= parameters_.getParameter<edm::InputTag>("PixelClusterInputTag"); lumiRecordName_ = parameters_.getParameter<std::string>("LumiRecordName"); nClusME_ = 0; nClusVsLSME_ = 0; intLumiVsLSME_= 0; corrIntLumiAndClusVsLSME_ = 0; }
DQMLumiMonitor::~DQMLumiMonitor | ( | ) |
Definition at line 43 of file DQMLumiMonitor.cc.
{ }
void DQMLumiMonitor::analyze | ( | edm::Event const & | iEvent, |
edm::EventSetup const & | iSetup | ||
) | [protected, virtual] |
Implements edm::EDAnalyzer.
Definition at line 94 of file DQMLumiMonitor.cc.
References corrIntLumiAndClusVsLSME_, MonitorElement::Fill(), edm::Event::getByLabel(), intLumi_, edm::HandleBase::isValid(), nClusME_, nClusVsLSME_, nLumi_, pixelClusterInputTag_, and SiPixelClusterizer_cfi::siPixelClusters.
{ //Access Pixel Clusters edm::Handle< edmNew::DetSetVector<SiPixelCluster> > siPixelClusters; // edm::Handle< SiPixelClusterCollectionNew > siPixelClusters; iEvent.getByLabel(pixelClusterInputTag_, siPixelClusters); if(!siPixelClusters.isValid()) { edm::LogError("PixelLumiMonotor") << "Could not find Cluster Collection " << pixelClusterInputTag_; return; } unsigned int nClusterPix = (*siPixelClusters).dataSize(); nClusME_->Fill(nClusterPix); if (nLumi_ != -1) nClusVsLSME_->Fill(nLumi_, nClusterPix); if (intLumi_ != -1 || nLumi_ != -1) corrIntLumiAndClusVsLSME_->Fill(nLumi_, intLumi_, nClusterPix); }
void DQMLumiMonitor::beginJob | ( | void | ) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 84 of file DQMLumiMonitor.cc.
References dbe_, intLumi_, nLumi_, and cmsCodeRules::cppFunctionSkipper::operator.
{ dbe_ = edm::Service<DQMStore>().operator->(); intLumi_ = -1.0; nLumi_ = -1; }
void DQMLumiMonitor::beginRun | ( | edm::Run const & | iRun, |
edm::EventSetup const & | iSetup | ||
) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 90 of file DQMLumiMonitor.cc.
References bookHistograms().
{ bookHistograms(); }
void DQMLumiMonitor::bookHistograms | ( | ) | [private] |
Definition at line 47 of file DQMLumiMonitor.cc.
References DQMStore::book1D(), DQMStore::bookProfile(), DQMStore::bookProfile2D(), corrIntLumiAndClusVsLSME_, dbe_, folderName_, edm::ParameterSet::getParameter(), intLumiVsLSME_, moduleName_, nClusME_, nClusVsLSME_, parameters_, MonitorElement::Reset(), and DQMStore::setCurrentFolder().
Referenced by beginRun().
{ edm::ParameterSet ClusHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1ClusPar"); edm::ParameterSet LumiHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1LumiPar"); edm::ParameterSet LumiSecHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1LSPar"); std::string currentFolder = moduleName_ + "/" + folderName_ ; dbe_->setCurrentFolder(currentFolder.c_str()); if (nClusME_ == 0) nClusME_ = dbe_->book1D("nPlxClus", " Number of Pixel Clusters ", ClusHistoPar.getParameter<int32_t>("Xbins"), ClusHistoPar.getParameter<double>("Xmin"), ClusHistoPar.getParameter<double>("Xmax")); else nClusME_->Reset(); if (nClusVsLSME_ == 0) nClusVsLSME_ = dbe_->bookProfile("nClusVsLS", " Number of Pixel Cluster Vs LS number", LumiSecHistoPar.getParameter<int32_t>("Xbins"), LumiSecHistoPar.getParameter<double>("Xmin"), LumiSecHistoPar.getParameter<double>("Xmax"), 0.0, 0.0, ""); else nClusVsLSME_->Reset(); if (intLumiVsLSME_ == 0) intLumiVsLSME_ = dbe_->bookProfile("intLumiVsLS", " Integrated Luminosity Vs LS number", LumiSecHistoPar.getParameter<int32_t>("Xbins"), LumiSecHistoPar.getParameter<double>("Xmin"), LumiSecHistoPar.getParameter<double>("Xmax"), 0.0, 0.0, ""); else intLumiVsLSME_->Reset(); if (corrIntLumiAndClusVsLSME_== 0) corrIntLumiAndClusVsLSME_ = dbe_->bookProfile2D("corrIntLumiAndClusVsLS", " Correlation of nCluster and Integrated Luminosity Vs LS number", LumiSecHistoPar.getParameter<int32_t>("Xbins"), LumiSecHistoPar.getParameter<double>("Xmin"), LumiSecHistoPar.getParameter<double>("Xmax"), LumiHistoPar.getParameter<int32_t>("Xbins"), LumiHistoPar.getParameter<double>("Xmin"), LumiHistoPar.getParameter<double>("Xmax"), 0.0, 0.0); else corrIntLumiAndClusVsLSME_->Reset(); }
void DQMLumiMonitor::endJob | ( | void | ) | [protected, virtual] |
void DQMLumiMonitor::endLuminosityBlock | ( | edm::LuminosityBlock const & | lumiSeg, |
edm::EventSetup const & | eSetup | ||
) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 111 of file DQMLumiMonitor.cc.
References gather_cfg::cout, MonitorElement::Fill(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), edm::EventSetup::getData(), DIPLumiSummary::intgDelLumiByLS(), intLumi_, intLumiVsLSME_, DIPLumiSummary::isNull(), edm::ESHandleBase::isValid(), edm::LuminosityBlockBase::luminosityBlock(), lumiRecordName_, nLumi_, edm::ESHandle< T >::product(), edm::LuminosityBlockBase::run(), and edm::eventsetup::EventSetupRecordKey::type().
{ std::cout <<" Run Number "<<lumiBlock.run() <<" Lumi Section Numnber "<< lumiBlock.luminosityBlock()<<std::endl; nLumi_ = lumiBlock.luminosityBlock(); edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType(lumiRecordName_)); if( recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) { std::cout <<"Record \"DIPLuminosityRcd"<<"\" does not exist "<<std::endl; return; } edm::ESHandle<DIPLumiSummary> datahandle; eSetup.getData(datahandle); if(datahandle.isValid()){ const DIPLumiSummary* dipLumiSummary_=datahandle.product(); if (!dipLumiSummary_->isNull()) { intLumi_ = dipLumiSummary_->intgDelLumiByLS(); edm::LogInfo("PixelLumiMonotor") <<" Luminosity in this Lumi Section " << intLumi_ ; intLumiVsLSME_->Fill(nLumi_, intLumi_); }else{ edm::LogError("PixelLumiMonotor") << "Empty data found !"; } } else { edm::LogError("PixelLumiMonotor") << "No valid data found!"; } }
void DQMLumiMonitor::endRun | ( | edm::Run const & | iRun, |
edm::EventSetup const & | iSetup | ||
) | [protected, virtual] |
Definition at line 59 of file DQMLumiMonitor.h.
Referenced by analyze(), bookHistograms(), and DQMLumiMonitor().
DQMStore* DQMLumiMonitor::dbe_ [private] |
Definition at line 54 of file DQMLumiMonitor.h.
Referenced by beginJob(), and bookHistograms().
std::string DQMLumiMonitor::folderName_ [private] |
Definition at line 50 of file DQMLumiMonitor.h.
Referenced by bookHistograms(), and DQMLumiMonitor().
float DQMLumiMonitor::intLumi_ [private] |
Definition at line 61 of file DQMLumiMonitor.h.
Referenced by analyze(), beginJob(), and endLuminosityBlock().
MonitorElement* DQMLumiMonitor::intLumiVsLSME_ [private] |
Definition at line 57 of file DQMLumiMonitor.h.
Referenced by bookHistograms(), DQMLumiMonitor(), and endLuminosityBlock().
std::string DQMLumiMonitor::lumiRecordName_ [private] |
Definition at line 52 of file DQMLumiMonitor.h.
Referenced by DQMLumiMonitor(), and endLuminosityBlock().
unsigned long long DQMLumiMonitor::m_cacheID_ [private] |
Definition at line 63 of file DQMLumiMonitor.h.
std::string DQMLumiMonitor::moduleName_ [private] |
Definition at line 49 of file DQMLumiMonitor.h.
Referenced by bookHistograms(), and DQMLumiMonitor().
MonitorElement* DQMLumiMonitor::nClusME_ [private] |
Definition at line 56 of file DQMLumiMonitor.h.
Referenced by analyze(), bookHistograms(), and DQMLumiMonitor().
MonitorElement* DQMLumiMonitor::nClusVsLSME_ [private] |
Definition at line 58 of file DQMLumiMonitor.h.
Referenced by analyze(), bookHistograms(), and DQMLumiMonitor().
int DQMLumiMonitor::nLumi_ [private] |
Definition at line 62 of file DQMLumiMonitor.h.
Referenced by analyze(), beginJob(), and endLuminosityBlock().
edm::ParameterSet DQMLumiMonitor::parameters_ [private] |
Definition at line 47 of file DQMLumiMonitor.h.
Referenced by bookHistograms(), and DQMLumiMonitor().
Definition at line 51 of file DQMLumiMonitor.h.
Referenced by analyze(), and DQMLumiMonitor().