CMS 3D CMS Logo

L1TGCTClient.cc
Go to the documentation of this file.
2 
9 
10 using namespace edm;
11 using namespace std;
12 
13 // Define statics for bins etc.
14 const unsigned int ETABINS = 22;
15 const float ETAMIN = -0.5;
16 const float ETAMAX = 21.5;
17 
18 const unsigned int PHIBINS = 18;
19 const float PHIMIN = -0.5;
20 const float PHIMAX = 17.5;
21 
23  : monitorDir_(ps.getUntrackedParameter<string>("monitorDir", "")),
24  counterLS_(0),
25  counterEvt_(0),
26  prescaleLS_(ps.getUntrackedParameter<int>("prescaleLS", -1)),
27  prescaleEvt_(ps.getUntrackedParameter<int>("prescaleEvt", -1)),
28  m_runInEventLoop(ps.getUntrackedParameter<bool>("runInEventLoop", false)),
29  m_runInEndLumi(ps.getUntrackedParameter<bool>("runInEndLumi", false)),
30  m_runInEndRun(ps.getUntrackedParameter<bool>("runInEndRun", false)),
31  m_runInEndJob(ps.getUntrackedParameter<bool>("runInEndJob", false)),
32  m_stage1_layer2_(ps.getUntrackedParameter<bool>("stage1_layer2_"))
33 
34 {}
35 
37 
39  // Set to directory with ME in
41 
42  l1GctIsoEmOccEta_ = ibooker.book1D("IsoEmOccEta", "ISO EM #eta OCCUPANCY", ETABINS, ETAMIN, ETAMAX);
43  l1GctIsoEmOccPhi_ = ibooker.book1D("IsoEmOccPhi", "ISO EM #phi OCCUPANCY", PHIBINS, PHIMIN, PHIMAX);
44  l1GctNonIsoEmOccEta_ = ibooker.book1D("NonIsoEmOccEta", "NON-ISO EM #eta OCCUPANCY", ETABINS, ETAMIN, ETAMAX);
45  l1GctNonIsoEmOccPhi_ = ibooker.book1D("NonIsoEmOccPhi", "NON-ISO EM #phi OCCUPANCY", PHIBINS, PHIMIN, PHIMAX);
47  ibooker.book1D("AllJetsOccEta", "CENTRAL AND FORWARD JET #eta OCCUPANCY", ETABINS, ETAMIN, ETAMAX);
49  ibooker.book1D("AllJetsOccPhi", "CENTRAL AND FORWARD JET #phi OCCUPANCY", PHIBINS, PHIMIN, PHIMAX);
50  l1GctCenJetsOccEta_ = ibooker.book1D("CenJetsOccEta", "CENTRAL JET #eta OCCUPANCY", ETABINS, ETAMIN, ETAMAX);
51  l1GctCenJetsOccPhi_ = ibooker.book1D("CenJetsOccPhi", "CENTRAL JET #phi OCCUPANCY", PHIBINS, PHIMIN, PHIMAX);
52  l1GctForJetsOccEta_ = ibooker.book1D("ForJetsOccEta", "FORWARD JET #eta OCCUPANCY", ETABINS, ETAMIN, ETAMAX);
53  l1GctForJetsOccPhi_ = ibooker.book1D("ForJetsOccPhi", "FORWARD JET #phi OCCUPANCY", PHIBINS, PHIMIN, PHIMAX);
54  l1GctTauJetsOccEta_ = ibooker.book1D("TauJetsOccEta", "TAU JET #eta OCCUPANCY", ETABINS, ETAMIN, ETAMAX);
55  l1GctTauJetsOccPhi_ = ibooker.book1D("TauJetsOccPhi", "TAU JET #phi OCCUPANCY", PHIBINS, PHIMIN, PHIMAX);
56  if (m_stage1_layer2_ == true) {
57  l1GctIsoTauJetsOccEta_ = ibooker.book1D("IsoTauJetsOccEta", "TAU JET #eta OCCUPANCY", ETABINS, ETAMIN, ETAMAX);
58  l1GctIsoTauJetsOccPhi_ = ibooker.book1D("IsoTauJetsOccPhi", "TAU JET #phi OCCUPANCY", PHIBINS, PHIMIN, PHIMAX);
59  }
60 }
61 
63  DQMStore::IGetter& igetter,
64  const edm::LuminosityBlock& lumiSeg,
65  const edm::EventSetup& c) {
66  if (m_runInEndLumi) {
67  book(ibooker);
68  processHistograms(igetter);
69  }
70 }
71 
73  if (m_runInEndRun) {
74  book(ibooker);
75  processHistograms(igetter);
76  }
77 }
78 
81 
82  if (m_stage1_layer2_ == false) {
83  InputDir = "L1T/L1TGCT/";
84  } else {
85  InputDir = "L1T/L1TStage1Layer2/";
86  }
87 
88  Input = igetter.get(InputDir + "IsoEmOccEtaPhi");
89  if (Input != nullptr) {
92  }
93 
94  Input = igetter.get(InputDir + "NonIsoEmOccEtaPhi");
95  if (Input != nullptr) {
98  }
99 
100  Input = igetter.get(InputDir + "AllJetsOccEtaPhi");
101  if (Input != nullptr) {
104  }
105 
106  Input = igetter.get(InputDir + "CenJetsOccEtaPhi");
107  if (Input != nullptr) {
110  }
111 
112  Input = igetter.get(InputDir + "ForJetsOccEtaPhi");
113  if (Input != nullptr) {
116  }
117 
118  Input = igetter.get(InputDir + "TauJetsOccEtaPhi");
119  if (Input != nullptr) {
122  }
123 
124  if (m_stage1_layer2_ == true) {
125  Input = igetter.get(InputDir + "IsoTauJetsOccEtaPhi");
126  if (Input != nullptr) {
129  }
130  }
131 }
132 
134  // Are the provided input and output consistent
135  if (input->GetNbinsX() != output->getNbinsX())
136  return;
137 
138  // Make the projection
139  TH1D* projX = input->ProjectionX();
140 
141  for (Int_t i = 0; i < projX->GetNbinsX(); i++) {
142  output->setBinContent(i + 1, projX->GetBinContent(i + 1));
143  }
144  delete projX;
145 }
146 
148  // Are the provided input and output consistent
149  if (input->GetNbinsY() != output->getNbinsX())
150  return;
151 
152  // Make the projection
153  TH1D* projY = input->ProjectionY();
154 
155  for (Int_t i = 0; i < projY->GetNbinsX(); i++) {
156  output->setBinContent(i + 1, projY->GetBinContent(i + 1));
157  }
158  delete projY;
159 }
L1TGCTClient(const edm::ParameterSet &ps)
Constructor.
Definition: L1TGCTClient.cc:22
void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
Definition: L1TGCTClient.cc:62
MonitorElement * l1GctForJetsOccPhi_
Definition: L1TGCTClient.h:62
void book(DQMStore::IBooker &ibooker)
Definition: L1TGCTClient.cc:38
void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override
Definition: L1TGCTClient.cc:72
MonitorElement * l1GctTauJetsOccEta_
Definition: L1TGCTClient.h:63
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
const float PHIMAX
Definition: L1TGCTClient.cc:20
std::string monitorDir_
Definition: L1TGCTClient.h:39
const float ETAMIN
Definition: L1TGCTClient.cc:15
const float ETAMAX
Definition: L1TGCTClient.cc:16
MonitorElement * l1GctIsoTauJetsOccPhi_
Definition: L1TGCTClient.h:66
MonitorElement * l1GctTauJetsOccPhi_
Definition: L1TGCTClient.h:64
MonitorElement * l1GctIsoEmOccEta_
Definition: L1TGCTClient.h:53
MonitorElement * l1GctAllJetsOccPhi_
Definition: L1TGCTClient.h:58
MonitorElement * l1GctForJetsOccEta_
Definition: L1TGCTClient.h:61
static std::string const input
Definition: EdmProvDump.cc:50
MonitorElement * l1GctCenJetsOccPhi_
Definition: L1TGCTClient.h:60
void processHistograms(DQMStore::IGetter &igetter)
Definition: L1TGCTClient.cc:79
const float PHIMIN
Definition: L1TGCTClient.cc:19
void makeXProjection(TH2F *input, MonitorElement *output)
bool m_stage1_layer2_
Definition: L1TGCTClient.h:49
const unsigned int ETABINS
Definition: L1TGCTClient.cc:14
MonitorElement * l1GctAllJetsOccEta_
Definition: L1TGCTClient.h:57
MonitorElement * l1GctNonIsoEmOccPhi_
Definition: L1TGCTClient.h:56
MonitorElement * l1GctIsoTauJetsOccEta_
Definition: L1TGCTClient.h:65
bool m_runInEndLumi
Definition: L1TGCTClient.h:46
MonitorElement * l1GctIsoEmOccPhi_
Definition: L1TGCTClient.h:54
void makeYProjection(TH2F *input, MonitorElement *output)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
MonitorElement * l1GctNonIsoEmOccEta_
Definition: L1TGCTClient.h:55
const unsigned int PHIBINS
Definition: L1TGCTClient.cc:18
HLT enums.
~L1TGCTClient() override
Destructor.
Definition: L1TGCTClient.cc:36
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::string InputDir
Definition: L1TGCTClient.h:51
MonitorElement * l1GctCenJetsOccEta_
Definition: L1TGCTClient.h:59
bool m_runInEndRun
Definition: L1TGCTClient.h:47