CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DQMLumiMonitor Class Reference

#include <DQMLumiMonitor.h>

Inheritance diagram for DQMLumiMonitor:
edm::EDAnalyzer edm::EDConsumerBase

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 DQMLumiMonitor (const edm::ParameterSet &)
 
 ~DQMLumiMonitor () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (edm::Event const &iEvent, edm::EventSetup const &iSetup) override
 
void beginJob () override
 
void beginRun (edm::Run const &iRun, edm::EventSetup const &iSetup) override
 
void endJob () override
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) override
 
void endRun (edm::Run const &iRun, edm::EventSetup const &iSetup) override
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Private Member Functions

void bookHistograms ()
 

Private Attributes

MonitorElementcorrIntLumiAndClusVsLSME_
 
DQMStoredbe_
 
std::string folderName_
 
float intLumi_
 
MonitorElementintLumiVsLSME_
 
edm::EDGetTokenT< LumiSummarylumiRecordName_
 
unsigned long long m_cacheID_
 
std::string moduleName_
 
MonitorElementnClusME_
 
MonitorElementnClusVsLSME_
 
int nLumi_
 
edm::ParameterSet parameters_
 
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusterInputTag_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Detailed Description

Definition at line 30 of file DQMLumiMonitor.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 32 of file DQMLumiMonitor.h.

◆ MonitorElement

Definition at line 33 of file DQMLumiMonitor.h.

Constructor & Destructor Documentation

◆ DQMLumiMonitor()

DQMLumiMonitor::DQMLumiMonitor ( const edm::ParameterSet ps)

Definition at line 24 of file DQMLumiMonitor.cc.

24  : parameters_(ps) {
28  consumes<edmNew::DetSetVector<SiPixelCluster> >(parameters_.getParameter<edm::InputTag>("PixelClusterInputTag"));
29  lumiRecordName_ = consumes<LumiSummary, edm::InLumi>(parameters_.getParameter<std::string>("LumiRecordName"));
30 
31  nClusME_ = nullptr;
32  nClusVsLSME_ = nullptr;
33  intLumiVsLSME_ = nullptr;
34  corrIntLumiAndClusVsLSME_ = nullptr;
35 }

References corrIntLumiAndClusVsLSME_, folderName_, edm::ParameterSet::getParameter(), intLumiVsLSME_, lumiRecordName_, moduleName_, nClusME_, nClusVsLSME_, parameters_, pixelClusterInputTag_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~DQMLumiMonitor()

DQMLumiMonitor::~DQMLumiMonitor ( )
overridedefault

Member Function Documentation

◆ analyze()

void DQMLumiMonitor::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements edm::EDAnalyzer.

Definition at line 99 of file DQMLumiMonitor.cc.

99  {
100  //Access Pixel Clusters
103 
104  if (!siPixelClusters.isValid()) {
105  edm::LogError("PixelLumiMonotor") << "Could not find Cluster Collection ";
106  return;
107  }
108  unsigned int nClusterPix = (*siPixelClusters).dataSize();
109  nClusME_->Fill(nClusterPix);
110  if (nLumi_ != -1)
111  nClusVsLSME_->Fill(nLumi_, nClusterPix);
112  if (intLumi_ != -1 || nLumi_ != -1)
114 }

References corrIntLumiAndClusVsLSME_, dqm::impl::MonitorElement::Fill(), iEvent, intLumi_, nClusME_, nClusVsLSME_, nLumi_, pixelClusterInputTag_, and siPixelClusters_cfi::siPixelClusters.

◆ beginJob()

void DQMLumiMonitor::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 92 of file DQMLumiMonitor.cc.

92  {
93  dbe_ = edm::Service<DQMStore>().operator->();
94  intLumi_ = -1.0;
95  nLumi_ = -1;
96 }

References dbe_, intLumi_, and nLumi_.

◆ beginRun()

void DQMLumiMonitor::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 98 of file DQMLumiMonitor.cc.

98 { bookHistograms(); }

References bookHistograms().

◆ bookHistograms()

void DQMLumiMonitor::bookHistograms ( )
private

Definition at line 39 of file DQMLumiMonitor.cc.

39  {
40  edm::ParameterSet ClusHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1ClusPar");
41  edm::ParameterSet LumiHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1LumiPar");
42  edm::ParameterSet LumiSecHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1LSPar");
43 
44  std::string currentFolder = moduleName_ + "/" + folderName_;
45  dbe_->setCurrentFolder(currentFolder);
46 
47  if (nClusME_ == nullptr)
48  nClusME_ = dbe_->book1D("nPlxClus",
49  " Number of Pixel Clusters ",
50  ClusHistoPar.getParameter<int32_t>("Xbins"),
51  ClusHistoPar.getParameter<double>("Xmin"),
52  ClusHistoPar.getParameter<double>("Xmax"));
53  else
54  nClusME_->Reset();
55  if (nClusVsLSME_ == nullptr)
56  nClusVsLSME_ = dbe_->bookProfile("nClusVsLS",
57  " Number of Pixel Cluster Vs LS number",
58  LumiSecHistoPar.getParameter<int32_t>("Xbins"),
59  LumiSecHistoPar.getParameter<double>("Xmin"),
60  LumiSecHistoPar.getParameter<double>("Xmax"),
61  0.0,
62  0.0,
63  "");
64  else
66  if (intLumiVsLSME_ == nullptr)
67  intLumiVsLSME_ = dbe_->bookProfile("intLumiVsLS",
68  " Integrated Luminosity Vs LS number",
69  LumiSecHistoPar.getParameter<int32_t>("Xbins"),
70  LumiSecHistoPar.getParameter<double>("Xmin"),
71  LumiSecHistoPar.getParameter<double>("Xmax"),
72  0.0,
73  0.0,
74  "");
75  else
77 
78  if (corrIntLumiAndClusVsLSME_ == nullptr)
79  corrIntLumiAndClusVsLSME_ = dbe_->bookProfile2D("corrIntLumiAndClusVsLS",
80  " Correlation of nCluster and Integrated Luminosity Vs LS number",
81  LumiSecHistoPar.getParameter<int32_t>("Xbins"),
82  LumiSecHistoPar.getParameter<double>("Xmin"),
83  LumiSecHistoPar.getParameter<double>("Xmax"),
84  LumiHistoPar.getParameter<int32_t>("Xbins"),
85  LumiHistoPar.getParameter<double>("Xmin"),
86  LumiHistoPar.getParameter<double>("Xmax"),
87  0.0,
88  0.0);
89  else
91 }

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::bookProfile(), dqm::implementation::IBooker::bookProfile2D(), corrIntLumiAndClusVsLSME_, dbe_, folderName_, edm::ParameterSet::getParameter(), intLumiVsLSME_, moduleName_, nClusME_, nClusVsLSME_, parameters_, dqm::impl::MonitorElement::Reset(), dqm::implementation::DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by beginRun().

◆ endJob()

void DQMLumiMonitor::endJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 145 of file DQMLumiMonitor.cc.

145 {}

◆ endLuminosityBlock()

void DQMLumiMonitor::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 116 of file DQMLumiMonitor.cc.

116  {
117  edm::LogInfo("PixelLumiMonotor") << " Run Number " << lumiBlock.run() << " Lumi Section Numnber "
118  << lumiBlock.luminosityBlock();
119 
120  nLumi_ = lumiBlock.luminosityBlock();
121 
122  // Access Lumi Summary
123  edm::Handle<LumiSummary> lumiSummary_;
124  lumiBlock.getByToken(lumiRecordName_, lumiSummary_);
125  if (lumiSummary_->isValid()) {
126  intLumi_ = lumiSummary_->intgDelLumi();
127  edm::LogInfo("PixelLumiMonotor") << " Luminosity in this Lumi Section " << intLumi_;
129  } else {
130  edm::LogError("PixelLumiMonotor") << "No valid data found!";
131  }
132  /*
133  // Access Lumi Details
134  Handle<LumiDetails> lumiDetails;
135  lumiBlock.getByLabel("expressLumiProducer", lumiDetails);
136  if(lumiDetails->isValid()){
137  std::cout<<"valid detail"<<std::endl;
138  }else{
139  std::cout << "no valid lumi detail data" <<std::endl;
140  } */
141 }

References dqm::impl::MonitorElement::Fill(), edm::LuminosityBlock::getByToken(), LumiSummary::intgDelLumi(), intLumi_, intLumiVsLSME_, LumiSummary::isValid(), edm::LuminosityBlockBase::luminosityBlock(), lumiRecordName_, nLumi_, and edm::LuminosityBlockBase::run().

◆ endRun()

void DQMLumiMonitor::endRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 143 of file DQMLumiMonitor.cc.

143 {}

Member Data Documentation

◆ corrIntLumiAndClusVsLSME_

MonitorElement* DQMLumiMonitor::corrIntLumiAndClusVsLSME_
private

Definition at line 60 of file DQMLumiMonitor.h.

Referenced by analyze(), bookHistograms(), and DQMLumiMonitor().

◆ dbe_

DQMStore* DQMLumiMonitor::dbe_
private

Definition at line 55 of file DQMLumiMonitor.h.

Referenced by beginJob(), and bookHistograms().

◆ folderName_

std::string DQMLumiMonitor::folderName_
private

Definition at line 51 of file DQMLumiMonitor.h.

Referenced by bookHistograms(), and DQMLumiMonitor().

◆ intLumi_

float DQMLumiMonitor::intLumi_
private

Definition at line 62 of file DQMLumiMonitor.h.

Referenced by analyze(), beginJob(), and endLuminosityBlock().

◆ intLumiVsLSME_

MonitorElement* DQMLumiMonitor::intLumiVsLSME_
private

Definition at line 58 of file DQMLumiMonitor.h.

Referenced by bookHistograms(), DQMLumiMonitor(), and endLuminosityBlock().

◆ lumiRecordName_

edm::EDGetTokenT<LumiSummary> DQMLumiMonitor::lumiRecordName_
private

Definition at line 53 of file DQMLumiMonitor.h.

Referenced by DQMLumiMonitor(), and endLuminosityBlock().

◆ m_cacheID_

unsigned long long DQMLumiMonitor::m_cacheID_
private

Definition at line 64 of file DQMLumiMonitor.h.

◆ moduleName_

std::string DQMLumiMonitor::moduleName_
private

Definition at line 50 of file DQMLumiMonitor.h.

Referenced by bookHistograms(), and DQMLumiMonitor().

◆ nClusME_

MonitorElement* DQMLumiMonitor::nClusME_
private

Definition at line 57 of file DQMLumiMonitor.h.

Referenced by analyze(), bookHistograms(), and DQMLumiMonitor().

◆ nClusVsLSME_

MonitorElement* DQMLumiMonitor::nClusVsLSME_
private

Definition at line 59 of file DQMLumiMonitor.h.

Referenced by analyze(), bookHistograms(), and DQMLumiMonitor().

◆ nLumi_

int DQMLumiMonitor::nLumi_
private

Definition at line 63 of file DQMLumiMonitor.h.

Referenced by analyze(), beginJob(), and endLuminosityBlock().

◆ parameters_

edm::ParameterSet DQMLumiMonitor::parameters_
private

◆ pixelClusterInputTag_

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > DQMLumiMonitor::pixelClusterInputTag_
private

Definition at line 52 of file DQMLumiMonitor.h.

Referenced by analyze(), and DQMLumiMonitor().

DQMLumiMonitor::moduleName_
std::string moduleName_
Definition: DQMLumiMonitor.h:50
LumiSummary::intgDelLumi
float intgDelLumi() const
Definition: LumiSummary.cc:16
DQMLumiMonitor::dbe_
DQMStore * dbe_
Definition: DQMLumiMonitor.h:55
siPixelClusters_cfi.siPixelClusters
siPixelClusters
Definition: siPixelClusters_cfi.py:3
DQMLumiMonitor::pixelClusterInputTag_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusterInputTag_
Definition: DQMLumiMonitor.h:52
dqm::implementation::IBooker::bookProfile2D
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
edm::LogInfo
Definition: MessageLogger.h:254
DQMLumiMonitor::nClusME_
MonitorElement * nClusME_
Definition: DQMLumiMonitor.h:57
DQMLumiMonitor::bookHistograms
void bookHistograms()
Definition: DQMLumiMonitor.cc:39
edm::Handle
Definition: AssociativeIterator.h:50
LumiSummary::isValid
bool isValid() const
Definition: LumiSummary.cc:50
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
dqm::impl::MonitorElement::Reset
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
Definition: MonitorElement.cc:354
dqm::implementation::IBooker::bookProfile
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:322
DQMLumiMonitor::intLumi_
float intLumi_
Definition: DQMLumiMonitor.h:62
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
DQMLumiMonitor::parameters_
edm::ParameterSet parameters_
Definition: DQMLumiMonitor.h:48
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DQMLumiMonitor::intLumiVsLSME_
MonitorElement * intLumiVsLSME_
Definition: DQMLumiMonitor.h:58
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
edm::Service
Definition: Service.h:30
iEvent
int iEvent
Definition: GenABIO.cc:224
DQMLumiMonitor::nLumi_
int nLumi_
Definition: DQMLumiMonitor.h:63
DQMLumiMonitor::lumiRecordName_
edm::EDGetTokenT< LumiSummary > lumiRecordName_
Definition: DQMLumiMonitor.h:53
DQMLumiMonitor::corrIntLumiAndClusVsLSME_
MonitorElement * corrIntLumiAndClusVsLSME_
Definition: DQMLumiMonitor.h:60
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
DQMLumiMonitor::folderName_
std::string folderName_
Definition: DQMLumiMonitor.h:51
edm::InputTag
Definition: InputTag.h:15
DQMLumiMonitor::nClusVsLSME_
MonitorElement * nClusVsLSME_
Definition: DQMLumiMonitor.h:59
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98