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 }
MessageLogger.h
ESHandle.h
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm
HLT enums.
Definition: AlignableModifier.h:19
L1TdeGEMTPGClient::L1TdeGEMTPGClient
L1TdeGEMTPGClient(const edm::ParameterSet &ps)
Constructor.
Definition: L1TdeGEMTPGClient.cc:13
L1TdeGEMTPGClient::clusterNBin_
std::vector< unsigned > clusterNBin_
Definition: L1TdeGEMTPGClient.h:37
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
DQMStore.h
L1TdeGEMTPGClient::chamberHistos_
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos_
Definition: L1TdeGEMTPGClient.h:43
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
L1TdeGEMTPGClient::clusterMaxBin_
std::vector< double > clusterMaxBin_
Definition: L1TdeGEMTPGClient.h:39
L1TdeGEMTPGClient::monitorDir_
std::string monitorDir_
Definition: L1TdeGEMTPGClient.h:32
L1TdeGEMTPGClient::clusterVars_
std::vector< std::string > clusterVars_
Definition: L1TdeGEMTPGClient.h:36
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:479
L1TdeGEMTPGClient::chambers_
std::vector< std::string > chambers_
Definition: L1TdeGEMTPGClient.h:34
L1TdeGEMTPGClient::book
void book(DQMStore::IBooker &ibooker)
Definition: L1TdeGEMTPGClient.cc:39
L1TdeGEMTPGClient::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: L1TdeGEMTPGClient.cc:25
Service.h
L1TdeGEMTPGClient::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: L1TdeGEMTPGClient.cc:34
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
L1TdeGEMTPGClient::clusterMinBin_
std::vector< double > clusterMinBin_
Definition: L1TdeGEMTPGClient.h:38
B2GTnPMonitor_cfi.histTitle
histTitle
Definition: B2GTnPMonitor_cfi.py:112
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::EventSetup
Definition: EventSetup.h:58
L1TdeGEMTPGClient::processHistograms
void processHistograms(DQMStore::IGetter &)
Definition: L1TdeGEMTPGClient.cc:58
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
dqm::implementation::IBooker
Definition: DQMStore.h:43
L1TdeGEMTPGClient.h
ParameterSet.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
crabWrapper.key
key
Definition: crabWrapper.py:19
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
L1TdeGEMTPGClient::~L1TdeGEMTPGClient
~L1TdeGEMTPGClient() override
Destructor.
Definition: L1TdeGEMTPGClient.cc:23