CMS 3D CMS Logo

L1TdeCSCTPGClient.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  alctVars_(ps.getParameter<std::vector<std::string>>("alctVars")),
18  clctVars_(ps.getParameter<std::vector<std::string>>("clctVars")),
19  lctVars_(ps.getParameter<std::vector<std::string>>("lctVars")),
20  // binning
21  alctNBin_(ps.getParameter<std::vector<unsigned>>("alctNBin")),
22  clctNBin_(ps.getParameter<std::vector<unsigned>>("clctNBin")),
23  lctNBin_(ps.getParameter<std::vector<unsigned>>("lctNBin")),
24  alctMinBin_(ps.getParameter<std::vector<double>>("alctMinBin")),
25  clctMinBin_(ps.getParameter<std::vector<double>>("clctMinBin")),
26  lctMinBin_(ps.getParameter<std::vector<double>>("lctMinBin")),
27  alctMaxBin_(ps.getParameter<std::vector<double>>("alctMaxBin")),
28  clctMaxBin_(ps.getParameter<std::vector<double>>("clctMaxBin")),
29  lctMaxBin_(ps.getParameter<std::vector<double>>("lctMaxBin")) {}
30 
32 
34  DQMStore::IGetter &igetter,
35  const edm::LuminosityBlock &lumiSeg,
36  const edm::EventSetup &c) {
37  book(ibooker);
38  processHistograms(igetter);
39 }
40 
41 //--------------------------------------------------------
43  book(ibooker);
44  processHistograms(igetter);
45 }
46 
49 
50  // chamber type
51  for (unsigned iType = 0; iType < chambers_.size(); iType++) {
52  // alct variable
53  for (unsigned iVar = 0; iVar < alctVars_.size(); iVar++) {
54  const std::string key("alct_" + alctVars_[iVar] + "_diff");
55  const std::string histName(key + "_" + chambers_[iType]);
56  const std::string histTitle(chambers_[iType] + " ALCT " + alctVars_[iVar] + " (Emul - Data)");
57  if (chamberHistos_[iType][key] == nullptr)
58  chamberHistos_[iType][key] =
59  iBooker.book1D(histName, histTitle, alctNBin_[iVar], alctMinBin_[iVar], alctMaxBin_[iVar]);
60  else
61  chamberHistos_[iType][key]->Reset();
62  }
63 
64  // clct variable
65  for (unsigned iVar = 0; iVar < clctVars_.size(); iVar++) {
66  const std::string key("clct_" + clctVars_[iVar] + "_diff");
67  const std::string histName(key + "_" + chambers_[iType]);
68  const std::string histTitle(chambers_[iType] + " CLCT " + clctVars_[iVar] + " (Emul - Data)");
69  if (chamberHistos_[iType][key] == nullptr)
70  chamberHistos_[iType][key] =
71  iBooker.book1D(histName, histTitle, clctNBin_[iVar], clctMinBin_[iVar], clctMaxBin_[iVar]);
72  else
73  chamberHistos_[iType][key]->Reset();
74  }
75 
76  // lct variable
77  for (unsigned iVar = 0; iVar < lctVars_.size(); iVar++) {
78  const std::string key("lct_" + lctVars_[iVar] + "_diff");
79  const std::string histName(key + "_" + chambers_[iType]);
80  const std::string histTitle(chambers_[iType] + " LCT " + lctVars_[iVar] + " (Emul - Data)");
81  if (chamberHistos_[iType][key] == nullptr)
82  chamberHistos_[iType][key] =
83  iBooker.book1D(histName, histTitle, lctNBin_[iVar], lctMinBin_[iVar], lctMaxBin_[iVar]);
84  else
85  chamberHistos_[iType][key]->Reset();
86  }
87  }
88 }
89 
91  MonitorElement *dataMon;
92  MonitorElement *emulMon;
93 
94  // chamber type
95  for (unsigned iType = 0; iType < chambers_.size(); iType++) {
96  // alct variable
97  for (unsigned iVar = 0; iVar < alctVars_.size(); iVar++) {
98  const std::string key("alct_" + alctVars_[iVar]);
99  const std::string histData(key + "_data_" + chambers_[iType]);
100  const std::string histEmul(key + "_emul_" + chambers_[iType]);
101 
102  dataMon = igetter.get(monitorDir_ + "/" + histData);
103  emulMon = igetter.get(monitorDir_ + "/" + histEmul);
104 
105  TH1F *hDiff = chamberHistos_[iType][key + "_diff"]->getTH1F();
106 
107  if (dataMon && emulMon) {
108  TH1F *hData = dataMon->getTH1F();
109  TH1F *hEmul = emulMon->getTH1F();
110  hDiff->Add(hEmul, hData, 1, -1);
111  }
112  }
113 
114  // clct variable
115  for (unsigned iVar = 0; iVar < clctVars_.size(); iVar++) {
116  const std::string key("clct_" + clctVars_[iVar]);
117  const std::string histData(key + "_data_" + chambers_[iType]);
118  const std::string histEmul(key + "_emul_" + chambers_[iType]);
119 
120  dataMon = igetter.get(monitorDir_ + "/" + histData);
121  emulMon = igetter.get(monitorDir_ + "/" + histEmul);
122 
123  TH1F *hDiff = chamberHistos_[iType][key + "_diff"]->getTH1F();
124 
125  if (dataMon && emulMon) {
126  TH1F *hData = dataMon->getTH1F();
127  TH1F *hEmul = emulMon->getTH1F();
128  hDiff->Add(hEmul, hData, 1, -1);
129  }
130  }
131 
132  // lct variable
133  for (unsigned iVar = 0; iVar < lctVars_.size(); iVar++) {
134  const std::string key("lct_" + lctVars_[iVar]);
135  const std::string histData(key + "_data_" + chambers_[iType]);
136  const std::string histEmul(key + "_emul_" + chambers_[iType]);
137 
138  dataMon = igetter.get(monitorDir_ + "/" + histData);
139  emulMon = igetter.get(monitorDir_ + "/" + histEmul);
140 
141  TH1F *hDiff = chamberHistos_[iType][key + "_diff"]->getTH1F();
142 
143  if (dataMon && emulMon) {
144  TH1F *hData = dataMon->getTH1F();
145  TH1F *hEmul = emulMon->getTH1F();
146  hDiff->Add(hEmul, hData, 1, -1);
147  }
148  }
149  }
150 }
L1TdeCSCTPGClient::alctVars_
std::vector< std::string > alctVars_
Definition: L1TdeCSCTPGClient.h:36
L1TdeCSCTPGClient::monitorDir_
std::string monitorDir_
Definition: L1TdeCSCTPGClient.h:32
L1TdeCSCTPGClient::clctVars_
std::vector< std::string > clctVars_
Definition: L1TdeCSCTPGClient.h:37
MessageLogger.h
ESHandle.h
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
L1TdeCSCTPGClient::clctMaxBin_
std::vector< double > clctMaxBin_
Definition: L1TdeCSCTPGClient.h:47
edm
HLT enums.
Definition: AlignableModifier.h:19
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
DQMStore.h
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
L1TdeCSCTPGClient::L1TdeCSCTPGClient
L1TdeCSCTPGClient(const edm::ParameterSet &ps)
Constructor.
Definition: L1TdeCSCTPGClient.cc:13
L1TdeCSCTPGClient::~L1TdeCSCTPGClient
~L1TdeCSCTPGClient() override
Destructor.
Definition: L1TdeCSCTPGClient.cc:31
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:479
L1TdeCSCTPGClient::book
void book(DQMStore::IBooker &ibooker)
Definition: L1TdeCSCTPGClient.cc:47
L1TdeCSCTPGClient::lctMinBin_
std::vector< double > lctMinBin_
Definition: L1TdeCSCTPGClient.h:45
L1TdeCSCTPGClient::alctNBin_
std::vector< unsigned > alctNBin_
Definition: L1TdeCSCTPGClient.h:40
L1TdeCSCTPGClient::processHistograms
void processHistograms(DQMStore::IGetter &)
Definition: L1TdeCSCTPGClient.cc:90
L1TdeCSCTPGClient::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: L1TdeCSCTPGClient.cc:42
Service.h
L1TdeCSCTPGClient::lctNBin_
std::vector< unsigned > lctNBin_
Definition: L1TdeCSCTPGClient.h:42
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
B2GTnPMonitor_cfi.histTitle
histTitle
Definition: B2GTnPMonitor_cfi.py:112
L1TdeCSCTPGClient::alctMinBin_
std::vector< double > alctMinBin_
Definition: L1TdeCSCTPGClient.h:43
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
L1TdeCSCTPGClient::clctMinBin_
std::vector< double > clctMinBin_
Definition: L1TdeCSCTPGClient.h:44
edm::EventSetup
Definition: EventSetup.h:58
L1TdeCSCTPGClient.h
std
Definition: JetResolutionObject.h:76
dqm::implementation::IGetter
Definition: DQMStore.h:484
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
EventSetup.h
L1TdeCSCTPGClient::chamberHistos_
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos_
Definition: L1TdeCSCTPGClient.h:52
dqm::implementation::IBooker
Definition: DQMStore.h:43
L1TdeCSCTPGClient::alctMaxBin_
std::vector< double > alctMaxBin_
Definition: L1TdeCSCTPGClient.h:46
L1TdeCSCTPGClient::chambers_
std::vector< std::string > chambers_
Definition: L1TdeCSCTPGClient.h:34
ParameterSet.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
crabWrapper.key
key
Definition: crabWrapper.py:19
L1TdeCSCTPGClient::lctMaxBin_
std::vector< double > lctMaxBin_
Definition: L1TdeCSCTPGClient.h:48
L1TdeCSCTPGClient::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: L1TdeCSCTPGClient.cc:33
L1TdeCSCTPGClient::clctNBin_
std::vector< unsigned > clctNBin_
Definition: L1TdeCSCTPGClient.h:41
L1TdeCSCTPGClient::lctVars_
std::vector< std::string > lctVars_
Definition: L1TdeCSCTPGClient.h:38
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98