CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DQMLumiMonitor Class Reference
Inheritance diagram for DQMLumiMonitor:
edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Types

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

Public Member Functions

 DQMLumiMonitor (const edm::ParameterSet &)
 
 ~DQMLumiMonitor () override=default
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (edm::Event const &iEvent, edm::EventSetup const &iSetup) override
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) 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< Bconsumes (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 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 ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
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::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 32 of file DQMLumiMonitor.cc.

Member Typedef Documentation

◆ DQMStore

Definition at line 34 of file DQMLumiMonitor.cc.

◆ MonitorElement

Definition at line 35 of file DQMLumiMonitor.cc.

Constructor & Destructor Documentation

◆ DQMLumiMonitor()

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

Definition at line 73 of file DQMLumiMonitor.cc.

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

73  : parameters_(ps) {
77  consumes<edmNew::DetSetVector<SiPixelCluster> >(parameters_.getParameter<edm::InputTag>("PixelClusterInputTag"));
78  lumiRecordName_ = consumes<LumiSummary, edm::InLumi>(parameters_.getParameter<std::string>("LumiRecordName"));
79 
80  nClusME_ = nullptr;
81  nClusVsLSME_ = nullptr;
82  intLumiVsLSME_ = nullptr;
83  corrIntLumiAndClusVsLSME_ = nullptr;
84 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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::~DQMLumiMonitor ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 146 of file DQMLumiMonitor.cc.

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

146  {
147  //Access Pixel Clusters
150 
151  if (!siPixelClusters.isValid()) {
152  edm::LogError("PixelLumiMonotor") << "Could not find Cluster Collection ";
153  return;
154  }
155  unsigned int nClusterPix = (*siPixelClusters).dataSize();
156  nClusME_->Fill(nClusterPix);
157  if (nLumi_ != -1)
158  nClusVsLSME_->Fill(nLumi_, nClusterPix);
159  if (intLumi_ != -1 || nLumi_ != -1)
161 }
MonitorElement * corrIntLumiAndClusVsLSME_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusterInputTag_
Log< level::Error, false > LogError
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
MonitorElement * nClusVsLSME_
MonitorElement * nClusME_

◆ beginJob()

void DQMLumiMonitor::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 139 of file DQMLumiMonitor.cc.

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

139  {
141  intLumi_ = -1.0;
142  nLumi_ = -1;
143 }
DQMStore * dbe_

◆ beginLuminosityBlock()

void DQMLumiMonitor::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
overrideprotected

Definition at line 163 of file DQMLumiMonitor.cc.

163 {}

◆ beginRun()

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

Definition at line 145 of file DQMLumiMonitor.cc.

References bookHistograms().

145 { bookHistograms(); }

◆ bookHistograms()

void DQMLumiMonitor::bookHistograms ( )
private

Definition at line 86 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().

86  {
87  edm::ParameterSet ClusHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1ClusPar");
88  edm::ParameterSet LumiHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1LumiPar");
89  edm::ParameterSet LumiSecHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1LSPar");
90 
91  std::string currentFolder = moduleName_ + "/" + folderName_;
92  dbe_->setCurrentFolder(currentFolder);
93 
94  if (nClusME_ == nullptr)
95  nClusME_ = dbe_->book1D("nPlxClus",
96  " Number of Pixel Clusters ",
97  ClusHistoPar.getParameter<int32_t>("Xbins"),
98  ClusHistoPar.getParameter<double>("Xmin"),
99  ClusHistoPar.getParameter<double>("Xmax"));
100  else
101  nClusME_->Reset();
102  if (nClusVsLSME_ == nullptr)
103  nClusVsLSME_ = dbe_->bookProfile("nClusVsLS",
104  " Number of Pixel Cluster Vs LS number",
105  LumiSecHistoPar.getParameter<int32_t>("Xbins"),
106  LumiSecHistoPar.getParameter<double>("Xmin"),
107  LumiSecHistoPar.getParameter<double>("Xmax"),
108  0.0,
109  0.0,
110  "");
111  else
112  nClusVsLSME_->Reset();
113  if (intLumiVsLSME_ == nullptr)
114  intLumiVsLSME_ = dbe_->bookProfile("intLumiVsLS",
115  " Integrated Luminosity Vs LS number",
116  LumiSecHistoPar.getParameter<int32_t>("Xbins"),
117  LumiSecHistoPar.getParameter<double>("Xmin"),
118  LumiSecHistoPar.getParameter<double>("Xmax"),
119  0.0,
120  0.0,
121  "");
122  else
124 
125  if (corrIntLumiAndClusVsLSME_ == nullptr)
126  corrIntLumiAndClusVsLSME_ = dbe_->bookProfile2D("corrIntLumiAndClusVsLS",
127  " Correlation of nCluster and Integrated Luminosity Vs LS number",
128  LumiSecHistoPar.getParameter<int32_t>("Xbins"),
129  LumiSecHistoPar.getParameter<double>("Xmin"),
130  LumiSecHistoPar.getParameter<double>("Xmax"),
131  LumiHistoPar.getParameter<int32_t>("Xbins"),
132  LumiHistoPar.getParameter<double>("Xmin"),
133  LumiHistoPar.getParameter<double>("Xmax"),
134  0.0,
135  0.0);
136  else
138 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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:485
MonitorElement * corrIntLumiAndClusVsLSME_
edm::ParameterSet parameters_
DQMStore * dbe_
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:656
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:408
MonitorElement * nClusVsLSME_
std::string moduleName_
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_

◆ endLuminosityBlock()

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

Definition at line 165 of file DQMLumiMonitor.cc.

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

165  {
166  edm::LogInfo("PixelLumiMonotor") << " Run Number " << lumiBlock.run() << " Lumi Section Numnber "
167  << lumiBlock.luminosityBlock();
168 
169  nLumi_ = lumiBlock.luminosityBlock();
170 
171  // Access Lumi Summary
172  edm::Handle<LumiSummary> lumiSummary_;
173  lumiBlock.getByToken(lumiRecordName_, lumiSummary_);
174  if (lumiSummary_->isValid()) {
175  intLumi_ = lumiSummary_->intgDelLumi();
176  edm::LogInfo("PixelLumiMonotor") << " Luminosity in this Lumi Section " << intLumi_;
178  } else {
179  edm::LogError("PixelLumiMonotor") << "No valid data found!";
180  }
181  /*
182  // Access Lumi Details
183  Handle<LumiDetails> lumiDetails;
184  lumiBlock.getByLabel("expressLumiProducer", lumiDetails);
185  if(lumiDetails->isValid()){
186  std::cout<<"valid detail"<<std::endl;
187  }else{
188  std::cout << "no valid lumi detail data" <<std::endl;
189  } */
190 }
bool isValid() const
Definition: LumiSummary.cc:50
edm::EDGetTokenT< LumiSummary > lumiRecordName_
float intgDelLumi() const
Definition: LumiSummary.cc:16
Log< level::Error, false > LogError
void Fill(long long x)
Log< level::Info, false > LogInfo
MonitorElement * intLumiVsLSME_

◆ endRun()

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

Definition at line 192 of file DQMLumiMonitor.cc.

192 {}

Member Data Documentation

◆ corrIntLumiAndClusVsLSME_

MonitorElement* DQMLumiMonitor::corrIntLumiAndClusVsLSME_
private

Definition at line 62 of file DQMLumiMonitor.cc.

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

◆ dbe_

DQMStore* DQMLumiMonitor::dbe_
private

Definition at line 57 of file DQMLumiMonitor.cc.

Referenced by beginJob(), and bookHistograms().

◆ folderName_

std::string DQMLumiMonitor::folderName_
private

Definition at line 53 of file DQMLumiMonitor.cc.

Referenced by bookHistograms(), and DQMLumiMonitor().

◆ intLumi_

float DQMLumiMonitor::intLumi_
private

Definition at line 64 of file DQMLumiMonitor.cc.

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

◆ intLumiVsLSME_

MonitorElement* DQMLumiMonitor::intLumiVsLSME_
private

Definition at line 60 of file DQMLumiMonitor.cc.

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

◆ lumiRecordName_

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

Definition at line 55 of file DQMLumiMonitor.cc.

Referenced by DQMLumiMonitor(), and endLuminosityBlock().

◆ m_cacheID_

unsigned long long DQMLumiMonitor::m_cacheID_
private

Definition at line 66 of file DQMLumiMonitor.cc.

◆ moduleName_

std::string DQMLumiMonitor::moduleName_
private

Definition at line 52 of file DQMLumiMonitor.cc.

Referenced by bookHistograms(), and DQMLumiMonitor().

◆ nClusME_

MonitorElement* DQMLumiMonitor::nClusME_
private

Definition at line 59 of file DQMLumiMonitor.cc.

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

◆ nClusVsLSME_

MonitorElement* DQMLumiMonitor::nClusVsLSME_
private

Definition at line 61 of file DQMLumiMonitor.cc.

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

◆ nLumi_

int DQMLumiMonitor::nLumi_
private

Definition at line 65 of file DQMLumiMonitor.cc.

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

◆ parameters_

edm::ParameterSet DQMLumiMonitor::parameters_
private

◆ pixelClusterInputTag_

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

Definition at line 54 of file DQMLumiMonitor.cc.

Referenced by analyze(), and DQMLumiMonitor().