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 
35 {
36 }
37 
39 
41 {
42  // Get backendinterface
44 
45  // Set to directory with ME in
47 
48  l1GctIsoEmOccEta_ = dbe_->book1D("IsoEmOccEta","ISO EM #eta OCCUPANCY", ETABINS, ETAMIN, ETAMAX);
49  l1GctIsoEmOccPhi_ = dbe_->book1D("IsoEmOccPhi","ISO EM #phi OCCUPANCY", PHIBINS, PHIMIN, PHIMAX);
50  l1GctNonIsoEmOccEta_ = dbe_->book1D("NonIsoEmOccEta","NON-ISO EM #eta OCCUPANCY", ETABINS, ETAMIN, ETAMAX);
51  l1GctNonIsoEmOccPhi_ = dbe_->book1D("NonIsoEmOccPhi","NON-ISO EM #phi OCCUPANCY", PHIBINS, PHIMIN, PHIMAX);
52  l1GctAllJetsOccEta_ = dbe_->book1D("AllJetsOccEta","CENTRAL AND FORWARD JET #eta OCCUPANCY", ETABINS, ETAMIN, ETAMAX);
53  l1GctAllJetsOccPhi_ = dbe_->book1D("AllJetsOccPhi","CENTRAL AND FORWARD JET #phi OCCUPANCY", PHIBINS, PHIMIN, PHIMAX);
54  l1GctCenJetsOccEta_ = dbe_->book1D("CenJetsOccEta","CENTRAL JET #eta OCCUPANCY", ETABINS, ETAMIN, ETAMAX);
55  l1GctCenJetsOccPhi_ = dbe_->book1D("CenJetsOccPhi","CENTRAL JET #phi OCCUPANCY", PHIBINS, PHIMIN, PHIMAX);
56  l1GctForJetsOccEta_ = dbe_->book1D("ForJetsOccEta","FORWARD JET #eta OCCUPANCY", ETABINS, ETAMIN, ETAMAX);
57  l1GctForJetsOccPhi_ = dbe_->book1D("ForJetsOccPhi","FORWARD JET #phi OCCUPANCY", PHIBINS, PHIMIN, PHIMAX);
58  l1GctTauJetsOccEta_ = dbe_->book1D("TauJetsOccEta","TAU JET #eta OCCUPANCY", ETABINS, ETAMIN, ETAMAX);
59  l1GctTauJetsOccPhi_ = dbe_->book1D("TauJetsOccPhi","TAU JET #phi OCCUPANCY", PHIBINS, PHIMIN, PHIMAX);
60 }
61 
62 void L1TGCTClient::beginRun(const Run& r, const EventSetup& context) {}
63 
64 void L1TGCTClient::beginLuminosityBlock(const LuminosityBlock& lumiSeg, const EventSetup& context) {}
65 
67 {
68 
69  if (m_runInEndLumi) {
70 
72  }
73 
74 }
75 
76 void L1TGCTClient::analyze(const Event& e, const EventSetup& context){
77 
78  // there is no loop on events in the offline harvesting step
79  // code here will not be executed offline
80 
81  if (m_runInEventLoop) {
82 
84  }
85 
86 }
87 
88 void L1TGCTClient::endRun(const Run& r, const EventSetup& context) {
89 
90  if (m_runInEndRun) {
91 
93  }
94 
95 }
96 
98 
99  if (m_runInEndJob) {
100 
102  }
103 }
104 
106 
108 
109  Input = dbe_->get("L1T/L1TGCT/IsoEmOccEtaPhi");
110  if (Input!=NULL){
113  }
114 
115  Input = dbe_->get("L1T/L1TGCT/NonIsoEmOccEtaPhi");
116  if (Input!=NULL){
119  }
120 
121  Input = dbe_->get("L1T/L1TGCT/AllJetsOccEtaPhi");
122  if (Input!=NULL){
125  }
126 
127  Input = dbe_->get("L1T/L1TGCT/CenJetsOccEtaPhi");
128  if (Input!=NULL){
131  }
132 
133  Input = dbe_->get("L1T/L1TGCT/ForJetsOccEtaPhi");
134  if (Input!=NULL){
137  }
138 
139  Input = dbe_->get("L1T/L1TGCT/TauJetsOccEtaPhi");
140  if (Input!=NULL){
143  }
144 
145 }
146 
147 
149 {
150  // Are the provided input and output consistent
151  if (input->GetNbinsX() != output->getNbinsX()) return;
152 
153  // Make the projection
154  TH1D* projX = input->ProjectionX();
155 
156  for (Int_t i=0; i<projX->GetNbinsX(); i++) {
157  output->setBinContent(i+1,projX->GetBinContent(i+1));
158  }
159  delete projX;
160 }
161 
163 {
164  // Are the provided input and output consistent
165  if (input->GetNbinsY() != output->getNbinsX()) return;
166 
167  // Make the projection
168  TH1D* projY = input->ProjectionY();
169 
170  for (Int_t i=0; i<projY->GetNbinsX(); i++) {
171  output->setBinContent(i+1,projY->GetBinContent(i+1));
172  }
173  delete projY;
174 }
175 
176 
#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:82
#define Input(cl)
Definition: vmac.h:189
void beginJob(void)
BeginJob.
Definition: L1TGCTClient.cc:40
MonitorElement * l1GctTauJetsOccEta_
Definition: L1TGCTClient.h:83
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
std::string monitorDir_
Definition: L1TGCTClient.h:60
void endJob()
Endjob.
Definition: L1TGCTClient.cc:97
#define NULL
Definition: scimark2.h:8
MonitorElement * l1GctTauJetsOccPhi_
Definition: L1TGCTClient.h:84
MonitorElement * l1GctIsoEmOccEta_
Definition: L1TGCTClient.h:73
DQMStore * dbe_
Definition: L1TGCTClient.h:59
MonitorElement * l1GctAllJetsOccPhi_
Definition: L1TGCTClient.h:78
MonitorElement * l1GctForJetsOccEta_
Definition: L1TGCTClient.h:81
MonitorElement * l1GctCenJetsOccPhi_
Definition: L1TGCTClient.h:80
#define ETAMAX
#define ETAMIN
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
Definition: L1TGCTClient.cc:62
void makeXProjection(TH2F *input, MonitorElement *output)
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
Definition: L1TGCTClient.cc:64
MonitorElement * l1GctAllJetsOccEta_
Definition: L1TGCTClient.h:77
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
#define PHIMIN
void processHistograms()
MonitorElement * l1GctNonIsoEmOccPhi_
Definition: L1TGCTClient.h:76
bool m_runInEventLoop
prescale on number of events
Definition: L1TGCTClient.h:66
bool m_runInEndLumi
Definition: L1TGCTClient.h:67
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
Definition: L1TGCTClient.cc:76
MonitorElement * l1GctIsoEmOccPhi_
Definition: L1TGCTClient.h:74
virtual ~L1TGCTClient()
Destructor.
Definition: L1TGCTClient.cc:38
#define ETABINS
void makeYProjection(TH2F *input, MonitorElement *output)
bool m_runInEndJob
Definition: L1TGCTClient.h:69
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
DQM Client Diagnostic.
Definition: L1TGCTClient.cc:66
MonitorElement * l1GctNonIsoEmOccEta_
Definition: L1TGCTClient.h:75
int getNbinsX(void) const
get # of bins in X-axis
#define PHIBINS
TH2F * getTH2F(void) const
MonitorElement * l1GctCenJetsOccEta_
Definition: L1TGCTClient.h:79
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
Definition: L1TGCTClient.cc:88
Definition: Run.h:36
bool m_runInEndRun
Definition: L1TGCTClient.h:68