CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

Public Member Functions

 DQMLumiMonitor (const edm::ParameterSet &)
 
 ~DQMLumiMonitor ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Member Functions

void bookHistograms ()
 

Private Attributes

MonitorElementcorrIntLumiAndClusVsLSME_
 
DQMStoredbe_
 
std::string folderName_
 
float intLumi_
 
MonitorElementintLumiVsLSME_
 
std::string lumiRecordName_
 
unsigned long long m_cacheID_
 
std::string moduleName_
 
MonitorElementnClusME_
 
MonitorElementnClusVsLSME_
 
int nLumi_
 
edm::ParameterSet parameters_
 
edm::InputTag pixelClusterInputTag_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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 29 of file DQMLumiMonitor.h.

Constructor & Destructor Documentation

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

Definition at line 28 of file DQMLumiMonitor.cc.

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

28  : parameters_(ps) {
29 
30 
31  moduleName_ = parameters_.getParameter<std::string>("ModuleName");
32  folderName_ = parameters_.getParameter<std::string>("FolderName");
34  lumiRecordName_ = parameters_.getParameter<std::string>("LumiRecordName");
35 
36  nClusME_ = 0;
37  nClusVsLSME_ = 0;
38  intLumiVsLSME_= 0;
40 }
T getParameter(std::string const &) const
MonitorElement * corrIntLumiAndClusVsLSME_
edm::ParameterSet parameters_
MonitorElement * nClusVsLSME_
std::string moduleName_
MonitorElement * nClusME_
std::string folderName_
std::string lumiRecordName_
edm::InputTag pixelClusterInputTag_
MonitorElement * intLumiVsLSME_
DQMLumiMonitor::~DQMLumiMonitor ( )

Definition at line 42 of file DQMLumiMonitor.cc.

42  {
43 
44 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 93 of file DQMLumiMonitor.cc.

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

93  {
94 
95  //Access Pixel Clusters
97  // edm::Handle< SiPixelClusterCollectionNew > siPixelClusters;
98  iEvent.getByLabel(pixelClusterInputTag_, siPixelClusters);
99 
100  if(!siPixelClusters.isValid()) {
101  edm::LogError("PixelLumiMonotor") << "Could not find Cluster Collection " << pixelClusterInputTag_;
102  return;
103  }
104  unsigned int nClusterPix = (*siPixelClusters).dataSize();
105  nClusME_->Fill(nClusterPix);
106  if (nLumi_ != -1) nClusVsLSME_->Fill(nLumi_, nClusterPix);
107  if (intLumi_ != -1 || nLumi_ != -1) corrIntLumiAndClusVsLSME_->Fill(nLumi_, intLumi_, nClusterPix);
108 }
MonitorElement * corrIntLumiAndClusVsLSME_
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:243
bool isValid() const
Definition: HandleBase.h:76
MonitorElement * nClusVsLSME_
MonitorElement * nClusME_
edm::InputTag pixelClusterInputTag_
void DQMLumiMonitor::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 83 of file DQMLumiMonitor.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 89 of file DQMLumiMonitor.cc.

References bookHistograms().

89  {
91 
92 }
void DQMLumiMonitor::bookHistograms ( )
private

Definition at line 46 of file DQMLumiMonitor.cc.

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

Referenced by beginRun().

46  {
47 
48  edm::ParameterSet ClusHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1ClusPar");
49  edm::ParameterSet LumiHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1LumiPar");
50  edm::ParameterSet LumiSecHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1LSPar");
51 
52  std::string currentFolder = moduleName_ + "/" + folderName_ ;
53  dbe_->setCurrentFolder(currentFolder.c_str());
54 
55  if (nClusME_ == 0) nClusME_ = dbe_->book1D("nPlxClus", " Number of Pixel Clusters ",
56  ClusHistoPar.getParameter<int32_t>("Xbins"),
57  ClusHistoPar.getParameter<double>("Xmin"),
58  ClusHistoPar.getParameter<double>("Xmax"));
59  else nClusME_->Reset();
60  if (nClusVsLSME_ == 0) nClusVsLSME_ = dbe_->bookProfile("nClusVsLS", " Number of Pixel Cluster Vs LS number",
61  LumiSecHistoPar.getParameter<int32_t>("Xbins"),
62  LumiSecHistoPar.getParameter<double>("Xmin"),
63  LumiSecHistoPar.getParameter<double>("Xmax"),
64  0.0, 0.0, "");
65  else nClusVsLSME_->Reset();
66  if (intLumiVsLSME_ == 0) intLumiVsLSME_ = dbe_->bookProfile("intLumiVsLS", " Integrated Luminosity Vs LS number",
67  LumiSecHistoPar.getParameter<int32_t>("Xbins"),
68  LumiSecHistoPar.getParameter<double>("Xmin"),
69  LumiSecHistoPar.getParameter<double>("Xmax"),
70  0.0, 0.0, "");
71  else intLumiVsLSME_->Reset();
72 
73  if (corrIntLumiAndClusVsLSME_== 0) corrIntLumiAndClusVsLSME_ = dbe_->bookProfile2D("corrIntLumiAndClusVsLS", " Correlation of nCluster and Integrated Luminosity Vs LS number",
74  LumiSecHistoPar.getParameter<int32_t>("Xbins"),
75  LumiSecHistoPar.getParameter<double>("Xmin"),
76  LumiSecHistoPar.getParameter<double>("Xmax"),
77  LumiHistoPar.getParameter<int32_t>("Xbins"),
78  LumiHistoPar.getParameter<double>("Xmin"),
79  LumiHistoPar.getParameter<double>("Xmax"),
80  0.0, 0.0);
82 }
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:717
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:1031
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:429
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:1175
void DQMLumiMonitor::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 142 of file DQMLumiMonitor.cc.

142  {
143 
144 }
void DQMLumiMonitor::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 110 of file DQMLumiMonitor.cc.

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

110  {
111  edm::LogInfo("PixelLumiMonotor") <<" Run Number "<<lumiBlock.run() <<" Lumi Section Numnber "<< lumiBlock.luminosityBlock();
112 
113  nLumi_ = lumiBlock.luminosityBlock();
114 
115  // Access Lumi Summary
116  edm::Handle<LumiSummary> lumiSummary_;
117  lumiBlock.getByLabel(lumiRecordName_, lumiSummary_);
118  if(lumiSummary_->isValid()){
119  intLumi_ = lumiSummary_->intgDelLumi();
120  edm::LogInfo("PixelLumiMonotor") <<" Luminosity in this Lumi Section " << intLumi_ ;
122  } else {
123  edm::LogError("PixelLumiMonotor") << "No valid data found!";
124  }
125  /*
126  // Access Lumi Details
127  Handle<LumiDetails> lumiDetails;
128  lumiBlock.getByLabel("expressLumiProducer", lumiDetails);
129  if(lumiDetails->isValid()){
130  std::cout<<"valid detail"<<std::endl;
131  }else{
132  std::cout << "no valid lumi detail data" <<std::endl;
133  } */
134 
135 }
void Fill(long long x)
bool isValid() const
Definition: HandleBase.h:76
std::string lumiRecordName_
MonitorElement * intLumiVsLSME_
void DQMLumiMonitor::endRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 137 of file DQMLumiMonitor.cc.

137  {
138 
139 }

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

std::string 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::InputTag DQMLumiMonitor::pixelClusterInputTag_
private

Definition at line 51 of file DQMLumiMonitor.h.

Referenced by analyze(), and DQMLumiMonitor().