CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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 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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Detailed Description

Definition at line 30 of file DQMLumiMonitor.h.

Member Typedef Documentation

Definition at line 32 of file DQMLumiMonitor.h.

Definition at line 33 of file DQMLumiMonitor.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file DQMLumiMonitor.cc.

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

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 }
edm::EDGetTokenT< LumiSummary > lumiRecordName_
MonitorElement * corrIntLumiAndClusVsLSME_
edm::ParameterSet parameters_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusterInputTag_
MonitorElement * nClusVsLSME_
std::string moduleName_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * nClusME_
std::string folderName_
MonitorElement * intLumiVsLSME_
DQMLumiMonitor::~DQMLumiMonitor ( )
overridedefault

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 99 of file DQMLumiMonitor.cc.

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

99  {
100  //Access Pixel Clusters
102  iEvent.getByToken(pixelClusterInputTag_, siPixelClusters);
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 }
MonitorElement * corrIntLumiAndClusVsLSME_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusterInputTag_
Log< level::Error, false > LogError
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
bool isValid() const
Definition: HandleBase.h:70
MonitorElement * nClusVsLSME_
MonitorElement * nClusME_
void DQMLumiMonitor::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 92 of file DQMLumiMonitor.cc.

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

92  {
94  intLumi_ = -1.0;
95  nLumi_ = -1;
96 }
DQMStore * dbe_
void DQMLumiMonitor::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 98 of file DQMLumiMonitor.cc.

References bookHistograms().

98 { bookHistograms(); }
void DQMLumiMonitor::bookHistograms ( )
private

Definition at line 39 of file DQMLumiMonitor.cc.

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().

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 }
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
MonitorElement * corrIntLumiAndClusVsLSME_
edm::ParameterSet parameters_
DQMStore * dbe_
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
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
MonitorElement * nClusVsLSME_
std::string moduleName_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * nClusME_
std::string folderName_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * intLumiVsLSME_
void DQMLumiMonitor::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 116 of file DQMLumiMonitor.cc.

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

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 }
edm::EDGetTokenT< LumiSummary > lumiRecordName_
Log< level::Error, false > LogError
void Fill(long long x)
bool isValid() const
Definition: HandleBase.h:70
Log< level::Info, false > LogInfo
MonitorElement * intLumiVsLSME_
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

MonitorElement* DQMLumiMonitor::corrIntLumiAndClusVsLSME_
private

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().

edm::EDGetTokenT<LumiSummary> 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
edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > DQMLumiMonitor::pixelClusterInputTag_
private

Definition at line 51 of file DQMLumiMonitor.h.

Referenced by analyze(), and DQMLumiMonitor().