CMS 3D CMS Logo

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