CMS 3D CMS Logo

List of all members | 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 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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 ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, 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

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 31 of file DQMLumiMonitor.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file DQMLumiMonitor.cc.

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

25  : parameters_(ps) {
26 
27 
30  pixelClusterInputTag_= consumes<edmNew::DetSetVector<SiPixelCluster> >(parameters_.getParameter<edm::InputTag>("PixelClusterInputTag"));
31  lumiRecordName_ = consumes<LumiSummary,edm::InLumi>(parameters_.getParameter<std::string>("LumiRecordName"));
32 
33  nClusME_ = nullptr;
34  nClusVsLSME_ = nullptr;
35  intLumiVsLSME_= nullptr;
36  corrIntLumiAndClusVsLSME_ = nullptr;
37 }
T getParameter(std::string const &) const
edm::EDGetTokenT< LumiSummary > lumiRecordName_
MonitorElement * corrIntLumiAndClusVsLSME_
edm::ParameterSet parameters_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusterInputTag_
MonitorElement * nClusVsLSME_
std::string moduleName_
MonitorElement * nClusME_
std::string folderName_
MonitorElement * intLumiVsLSME_
DQMLumiMonitor::~DQMLumiMonitor ( )
overridedefault

Referenced by DQMLumiMonitor().

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 88 of file DQMLumiMonitor.cc.

References corrIntLumiAndClusVsLSME_, MonitorElement::Fill(), edm::Event::getByToken(), intLumi_, edm::HandleBase::isValid(), nClusME_, nClusVsLSME_, nLumi_, pixelClusterInputTag_, and HIInitialJetCoreClusterSplitting_cff::siPixelClusters.

88  {
89 
90  //Access Pixel Clusters
92  iEvent.getByToken(pixelClusterInputTag_, siPixelClusters);
93 
94  if(!siPixelClusters.isValid()) {
95  edm::LogError("PixelLumiMonotor") << "Could not find Cluster Collection ";
96  return;
97  }
98  unsigned int nClusterPix = (*siPixelClusters).dataSize();
99  nClusME_->Fill(nClusterPix);
100  if (nLumi_ != -1) nClusVsLSME_->Fill(nLumi_, nClusterPix);
101  if (intLumi_ != -1 || nLumi_ != -1) corrIntLumiAndClusVsLSME_->Fill(nLumi_, intLumi_, nClusterPix);
102 }
MonitorElement * corrIntLumiAndClusVsLSME_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusterInputTag_
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:230
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * nClusVsLSME_
MonitorElement * nClusME_
void DQMLumiMonitor::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 78 of file DQMLumiMonitor.cc.

References dbe_, intLumi_, nLumi_, and Utilities::operator.

78  {
80  intLumi_ = -1.0;
81  nLumi_ = -1;
82 }
DQMStore * dbe_
void DQMLumiMonitor::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 84 of file DQMLumiMonitor.cc.

References bookHistograms().

84  {
86 
87 }
void DQMLumiMonitor::bookHistograms ( )
private

Definition at line 41 of file DQMLumiMonitor.cc.

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

Referenced by beginRun().

41  {
42 
43  edm::ParameterSet ClusHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1ClusPar");
44  edm::ParameterSet LumiHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1LumiPar");
45  edm::ParameterSet LumiSecHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1LSPar");
46 
47  std::string currentFolder = moduleName_ + "/" + folderName_ ;
48  dbe_->setCurrentFolder(currentFolder);
49 
50  if (nClusME_ == nullptr) nClusME_ = dbe_->book1D("nPlxClus", " Number of Pixel Clusters ",
51  ClusHistoPar.getParameter<int32_t>("Xbins"),
52  ClusHistoPar.getParameter<double>("Xmin"),
53  ClusHistoPar.getParameter<double>("Xmax"));
54  else nClusME_->Reset();
55  if (nClusVsLSME_ == nullptr) nClusVsLSME_ = dbe_->bookProfile("nClusVsLS", " Number of Pixel Cluster Vs LS number",
56  LumiSecHistoPar.getParameter<int32_t>("Xbins"),
57  LumiSecHistoPar.getParameter<double>("Xmin"),
58  LumiSecHistoPar.getParameter<double>("Xmax"),
59  0.0, 0.0, "");
60  else nClusVsLSME_->Reset();
61  if (intLumiVsLSME_ == nullptr) intLumiVsLSME_ = dbe_->bookProfile("intLumiVsLS", " Integrated Luminosity Vs LS number",
62  LumiSecHistoPar.getParameter<int32_t>("Xbins"),
63  LumiSecHistoPar.getParameter<double>("Xmin"),
64  LumiSecHistoPar.getParameter<double>("Xmax"),
65  0.0, 0.0, "");
66  else intLumiVsLSME_->Reset();
67 
68  if (corrIntLumiAndClusVsLSME_== nullptr) corrIntLumiAndClusVsLSME_ = dbe_->bookProfile2D("corrIntLumiAndClusVsLS", " Correlation of nCluster and Integrated Luminosity Vs LS number",
69  LumiSecHistoPar.getParameter<int32_t>("Xbins"),
70  LumiSecHistoPar.getParameter<double>("Xmin"),
71  LumiSecHistoPar.getParameter<double>("Xmax"),
72  LumiHistoPar.getParameter<int32_t>("Xbins"),
73  LumiHistoPar.getParameter<double>("Xmin"),
74  LumiHistoPar.getParameter<double>("Xmax"),
75  0.0, 0.0);
77 }
MonitorElement * bookProfile2D(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s")
Definition: DQMStore.cc:1367
T getParameter(std::string const &) const
MonitorElement * corrIntLumiAndClusVsLSME_
edm::ParameterSet parameters_
DQMStore * dbe_
MonitorElement * book1D(char_string const &name, char_string const &title, int const nchX, double const lowX, double const highX)
Book 1D histogram.
Definition: DQMStore.cc:1086
void Reset()
reset ME (ie. contents, errors, etc)
MonitorElement * nClusVsLSME_
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:565
MonitorElement * bookProfile(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
Definition: DQMStore.cc:1273
std::string moduleName_
MonitorElement * nClusME_
std::string folderName_
MonitorElement * intLumiVsLSME_
void DQMLumiMonitor::endJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 136 of file DQMLumiMonitor.cc.

References DEFINE_FWK_MODULE.

136  {
137 
138 }
void DQMLumiMonitor::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 104 of file DQMLumiMonitor.cc.

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

104  {
105  edm::LogInfo("PixelLumiMonotor") <<" Run Number "<<lumiBlock.run() <<" Lumi Section Numnber "<< lumiBlock.luminosityBlock();
106 
107  nLumi_ = lumiBlock.luminosityBlock();
108 
109  // Access Lumi Summary
110  edm::Handle<LumiSummary> lumiSummary_;
111  lumiBlock.getByToken(lumiRecordName_, lumiSummary_);
112  if(lumiSummary_->isValid()){
113  intLumi_ = lumiSummary_->intgDelLumi();
114  edm::LogInfo("PixelLumiMonotor") <<" Luminosity in this Lumi Section " << intLumi_ ;
116  } else {
117  edm::LogError("PixelLumiMonotor") << "No valid data found!";
118  }
119  /*
120  // Access Lumi Details
121  Handle<LumiDetails> lumiDetails;
122  lumiBlock.getByLabel("expressLumiProducer", lumiDetails);
123  if(lumiDetails->isValid()){
124  std::cout<<"valid detail"<<std::endl;
125  }else{
126  std::cout << "no valid lumi detail data" <<std::endl;
127  } */
128 
129 }
edm::EDGetTokenT< LumiSummary > lumiRecordName_
void Fill(long long x)
float intgDelLumi() const
Definition: LumiSummary.cc:17
bool isValid() const
Definition: LumiSummary.cc:78
MonitorElement * intLumiVsLSME_
void DQMLumiMonitor::endRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 131 of file DQMLumiMonitor.cc.

131  {
132 
133 }

Member Data Documentation

MonitorElement* DQMLumiMonitor::corrIntLumiAndClusVsLSME_
private

Definition at line 61 of file DQMLumiMonitor.h.

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

DQMStore* DQMLumiMonitor::dbe_
private

Definition at line 56 of file DQMLumiMonitor.h.

Referenced by beginJob(), and bookHistograms().

std::string DQMLumiMonitor::folderName_
private

Definition at line 52 of file DQMLumiMonitor.h.

Referenced by bookHistograms(), and DQMLumiMonitor().

float DQMLumiMonitor::intLumi_
private

Definition at line 63 of file DQMLumiMonitor.h.

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

MonitorElement* DQMLumiMonitor::intLumiVsLSME_
private

Definition at line 59 of file DQMLumiMonitor.h.

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

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

Definition at line 54 of file DQMLumiMonitor.h.

Referenced by DQMLumiMonitor(), and endLuminosityBlock().

unsigned long long DQMLumiMonitor::m_cacheID_
private

Definition at line 65 of file DQMLumiMonitor.h.

std::string DQMLumiMonitor::moduleName_
private

Definition at line 51 of file DQMLumiMonitor.h.

Referenced by bookHistograms(), and DQMLumiMonitor().

MonitorElement* DQMLumiMonitor::nClusME_
private

Definition at line 58 of file DQMLumiMonitor.h.

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

MonitorElement* DQMLumiMonitor::nClusVsLSME_
private

Definition at line 60 of file DQMLumiMonitor.h.

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

int DQMLumiMonitor::nLumi_
private

Definition at line 64 of file DQMLumiMonitor.h.

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

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

Definition at line 53 of file DQMLumiMonitor.h.

Referenced by analyze(), and DQMLumiMonitor().