test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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/stage1layer2/";
92  }
93 
94  Input = igetter.get(InputDir + "IsoEmOccEtaPhi");
95  if (Input!=NULL){
98  }
99 
100  Input = igetter.get(InputDir + "NonIsoEmOccEtaPhi");
101  if (Input!=NULL){
104  }
105 
106  Input = igetter.get(InputDir + "AllJetsOccEtaPhi");
107  if (Input!=NULL){
110  }
111 
112  Input = igetter.get(InputDir + "CenJetsOccEtaPhi");
113  if (Input!=NULL){
116  }
117 
118  Input = igetter.get(InputDir + "ForJetsOccEtaPhi");
119  if (Input!=NULL){
122  }
123 
124  Input = igetter.get(InputDir + "TauJetsOccEtaPhi");
125  if (Input!=NULL){
128  }
129 
130  if (m_stage1_layer2_ == true){
131  Input = igetter.get(InputDir + "IsoTauJetsOccEtaPhi");
132  if (Input!=NULL){
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 
#define PHIMAX
int i
Definition: DBlmapReader.cc:9
L1TGCTClient(const edm::ParameterSet &ps)
Constructor.
Definition: L1TGCTClient.cc:24
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * l1GctForJetsOccPhi_
Definition: L1TGCTClient.h:64
#define Input(cl)
Definition: vmac.h:188
void book(DQMStore::IBooker &ibooker)
Definition: L1TGCTClient.cc:41
virtual void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override
Definition: L1TGCTClient.cc:75
MonitorElement * l1GctTauJetsOccEta_
Definition: L1TGCTClient.h:65
std::string monitorDir_
Definition: L1TGCTClient.h:41
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
#define NULL
Definition: scimark2.h:8
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:43
MonitorElement * l1GctCenJetsOccPhi_
Definition: L1TGCTClient.h:62
#define ETAMAX
void processHistograms(DQMStore::IGetter &igetter)
Definition: L1TGCTClient.cc:84
#define ETAMIN
void makeXProjection(TH2F *input, MonitorElement *output)
bool m_stage1_layer2_
Definition: L1TGCTClient.h:51
MonitorElement * l1GctAllJetsOccEta_
Definition: L1TGCTClient.h:59
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
virtual void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
Definition: L1TGCTClient.cc:65
#define PHIMIN
MonitorElement * l1GctNonIsoEmOccPhi_
Definition: L1TGCTClient.h:58
MonitorElement * l1GctIsoTauJetsOccEta_
Definition: L1TGCTClient.h:67
bool m_runInEndLumi
Definition: L1TGCTClient.h:48
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * l1GctIsoEmOccPhi_
Definition: L1TGCTClient.h:56
virtual ~L1TGCTClient()
Destructor.
Definition: L1TGCTClient.cc:39
#define ETABINS
void makeYProjection(TH2F *input, MonitorElement *output)
MonitorElement * l1GctNonIsoEmOccEta_
Definition: L1TGCTClient.h:57
int getNbinsX(void) const
get # of bins in X-axis
#define PHIBINS
volatile std::atomic< bool > shutdown_flag false
TH2F * getTH2F(void) const
std::string InputDir
Definition: L1TGCTClient.h:53
MonitorElement * l1GctCenJetsOccEta_
Definition: L1TGCTClient.h:61
bool m_runInEndRun
Definition: L1TGCTClient.h:49