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 ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
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)
 
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)
 
- 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 &)
 

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_, and AlCaHLTBitMon_QueryRunRegistry::string.

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_ = 0;
34  nClusVsLSME_ = 0;
35  intLumiVsLSME_= 0;
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 ( )

Definition at line 39 of file DQMLumiMonitor.cc.

39  {
40 
41 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 90 of file DQMLumiMonitor.cc.

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

90  {
91 
92  //Access Pixel Clusters
94  iEvent.getByToken(pixelClusterInputTag_, siPixelClusters);
95 
96  if(!siPixelClusters.isValid()) {
97  edm::LogError("PixelLumiMonotor") << "Could not find Cluster Collection ";
98  return;
99  }
100  unsigned int nClusterPix = (*siPixelClusters).dataSize();
101  nClusME_->Fill(nClusterPix);
102  if (nLumi_ != -1) nClusVsLSME_->Fill(nLumi_, nClusterPix);
103  if (intLumi_ != -1 || nLumi_ != -1) corrIntLumiAndClusVsLSME_->Fill(nLumi_, intLumi_, nClusterPix);
104 }
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  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 80 of file DQMLumiMonitor.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 86 of file DQMLumiMonitor.cc.

References bookHistograms().

86  {
88 
89 }
void DQMLumiMonitor::bookHistograms ( )
private

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 138 of file DQMLumiMonitor.cc.

References DEFINE_FWK_MODULE.

138  {
139 
140 }
void DQMLumiMonitor::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

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

106  {
107  edm::LogInfo("PixelLumiMonotor") <<" Run Number "<<lumiBlock.run() <<" Lumi Section Numnber "<< lumiBlock.luminosityBlock();
108 
109  nLumi_ = lumiBlock.luminosityBlock();
110 
111  // Access Lumi Summary
112  edm::Handle<LumiSummary> lumiSummary_;
113  lumiBlock.getByToken(lumiRecordName_, lumiSummary_);
114  if(lumiSummary_->isValid()){
115  intLumi_ = lumiSummary_->intgDelLumi();
116  edm::LogInfo("PixelLumiMonotor") <<" Luminosity in this Lumi Section " << intLumi_ ;
118  } else {
119  edm::LogError("PixelLumiMonotor") << "No valid data found!";
120  }
121  /*
122  // Access Lumi Details
123  Handle<LumiDetails> lumiDetails;
124  lumiBlock.getByLabel("expressLumiProducer", lumiDetails);
125  if(lumiDetails->isValid()){
126  std::cout<<"valid detail"<<std::endl;
127  }else{
128  std::cout << "no valid lumi detail data" <<std::endl;
129  } */
130 
131 }
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 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 133 of file DQMLumiMonitor.cc.

133  {
134 
135 }

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