CMS 3D CMS Logo

L1TdeGEMTPGClient.cc
Go to the documentation of this file.
2 
9 #include "TRandom.h"
10 using namespace edm;
11 using namespace std;
12 
14  : monitorDir_(ps.getParameter<string>("monitorDir")),
15  chambers_(ps.getParameter<std::vector<std::string>>("chambers")),
16  // variables
17  clusterVars_(ps.getParameter<std::vector<std::string>>("clusterVars")),
18  // binning
19  clusterNBin_(ps.getParameter<std::vector<unsigned>>("clusterNBin")),
20  clusterMinBin_(ps.getParameter<std::vector<double>>("clusterMinBin")),
21  clusterMaxBin_(ps.getParameter<std::vector<double>>("clusterMaxBin")) {}
22 
24 
26  DQMStore::IGetter &igetter,
27  const edm::LuminosityBlock &lumiSeg,
28  const edm::EventSetup &c) {
29  book(ibooker);
30  processHistograms(igetter);
31 }
32 
33 //--------------------------------------------------------
35  book(ibooker);
36  processHistograms(igetter);
37 }
38 
41 
42  // chamber type
43  for (unsigned iType = 0; iType < chambers_.size(); iType++) {
44  // cluster variable
45  for (unsigned iVar = 0; iVar < clusterVars_.size(); iVar++) {
46  const std::string key("cluster_" + clusterVars_[iVar] + "_diff");
47  const std::string histName(key + "_" + chambers_[iType]);
48  const std::string histTitle(chambers_[iType] + " Cluster " + clusterVars_[iVar] + " (Emul - Data)");
49  if (chamberHistos_[iType][key] == nullptr)
50  chamberHistos_[iType][key] =
51  iBooker.book1D(histName, histTitle, clusterNBin_[iVar], clusterMinBin_[iVar], clusterMaxBin_[iVar]);
52  else
53  chamberHistos_[iType][key]->Reset();
54  }
55  }
56 }
57 
59  MonitorElement *dataMon;
60  MonitorElement *emulMon;
61 
62  // chamber type
63  for (unsigned iType = 0; iType < chambers_.size(); iType++) {
64  // cluster variable
65  for (unsigned iVar = 0; iVar < clusterVars_.size(); iVar++) {
66  const std::string key("cluster_" + clusterVars_[iVar]);
67  const std::string histData(key + "_data_" + chambers_[iType]);
68  const std::string histEmul(key + "_emul_" + chambers_[iType]);
69 
70  dataMon = igetter.get(monitorDir_ + "/" + histData);
71  emulMon = igetter.get(monitorDir_ + "/" + histEmul);
72 
73  TH1F *hDiff = chamberHistos_[iType][key + "_diff"]->getTH1F();
74 
75  if (dataMon && emulMon) {
76  TH1F *dataHist = dataMon->getTH1F();
77  TH1F *emulHist = emulMon->getTH1F();
78  hDiff->Add(emulHist, dataHist, 1, -1);
79  }
80  }
81  }
82 }
~L1TdeGEMTPGClient() override
Destructor.
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos_
std::string monitorDir_
L1TdeGEMTPGClient(const edm::ParameterSet &ps)
Constructor.
std::vector< std::string > clusterVars_
std::vector< unsigned > clusterNBin_
std::vector< double > clusterMaxBin_
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
std::vector< std::string > chambers_
void book(DQMStore::IBooker &ibooker)
std::vector< double > clusterMinBin_
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
virtual TH1F * getTH1F() const
void processHistograms(DQMStore::IGetter &)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:697
HLT enums.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98