CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
HLTEventInfoClient Class Reference

#include <HLTEventInfoClient.h>

Inheritance diagram for HLTEventInfoClient:
edm::EDAnalyzer

Public Member Functions

 HLTEventInfoClient (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~HLTEventInfoClient ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Fake Analyze. More...
 
void beginJob ()
 BeginJob. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun. More...
 
void endJob ()
 Endjob. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 DQM Client Diagnostic. More...
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 EndRun. More...
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Member Functions

TH1F * get1DHisto (std::string meName, DQMStore *dbi)
 
TProfile * get1DProfile (std::string meName, DQMStore *dbi)
 
TH2F * get2DHisto (std::string meName, DQMStore *dbi)
 
TProfile2D * get2DProfile (std::string meName, DQMStore *dbi)
 
void initialize ()
 

Private Attributes

int counterEvt_
 counter More...
 
int counterLS_
 
DQMStoredbe_
 
std::string monitorDir_
 
int nChannels
 prescale on number of events More...
 
edm::ParameterSet parameters_
 
int prescaleEvt_
 units of lumi sections More...
 
int prescaleLS_
 counter More...
 
Float_t reportSummary
 
MonitorElementreportSummary_
 
MonitorElementreportSummaryContent_ [20]
 
MonitorElementreportSummaryMap_
 
Float_t summaryContent [20]
 
Float_t summarySum
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 23 of file HLTEventInfoClient.h.

Constructor & Destructor Documentation

HLTEventInfoClient::HLTEventInfoClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 34 of file HLTEventInfoClient.cc.

35 {
36  parameters_=ps;
37  initialize();
38 }
edm::ParameterSet parameters_
HLTEventInfoClient::~HLTEventInfoClient ( )
virtual

Destructor.

Definition at line 40 of file HLTEventInfoClient.cc.

References gather_cfg::cout.

40  {
41  if(verbose_) std::cout <<"[TriggerDQM]: ending... " << std::endl;
42 }
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

void HLTEventInfoClient::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Fake Analyze.

Implements edm::EDAnalyzer.

Definition at line 268 of file HLTEventInfoClient.cc.

References gather_cfg::cout.

268  {
269 
270  counterEvt_++;
271  if (prescaleEvt_<1) return;
272  if (prescaleEvt_>0 && counterEvt_%prescaleEvt_ != 0) return;
273 
274  if(verbose_) std::cout << "HLTEventInfoClient::analyze" << std::endl;
275 
276 
277 }
int prescaleEvt_
units of lumi sections
tuple cout
Definition: gather_cfg.py:121
void HLTEventInfoClient::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 70 of file HLTEventInfoClient.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), gather_cfg::cout, dbe_, MonitorElement::Fill(), DQMStore::get(), interpolateCardsSimple::histo, gen::k, n, cppFunctionSkipper::operator, DQMStore::removeElement(), MonitorElement::setAxisTitle(), and DQMStore::setCurrentFolder().

70  {
71 
72  if(verbose_) std::cout <<"[TriggerDQM]: Begin Job" << std::endl;
73  // get backendinterface
75 
76  dbe_->setCurrentFolder("HLT/EventInfo");
77 
78 // sprintf(histo, "reportSummary");
79  reportSummary_ = dbe_->get("HLT/EventInfo/reportSumamry");
80  if ( reportSummary_ ) {
82  }
83 
84  reportSummary_ = dbe_->bookFloat("reportSummary");
85 
86  int nPDs = 20;
87 
88  //initialize reportSummary to 1
90 
91  dbe_->setCurrentFolder("HLT/EventInfo/reportSummaryContents");
92 
93 
94  char histo[100];
95 
96  for (int n = 0; n < nPDs; n++) {
97 
98  switch(n){
99  case 0 : sprintf(histo,"hlt_dqm_EGamma"); break;
100  case 1 : sprintf(histo,"hlt_dqm_Muon"); break;
101  case 2 : sprintf(histo,"hlt_dqm_JetMet"); break;
102  case 3 : sprintf(histo,"hlt_dqm_BJets"); break;
103  case 4 : sprintf(histo,"hlt_dqm_Tau"); break;
104  case 5 : sprintf(histo,"hlt_dqm_Test1"); break;
105  case 6 : sprintf(histo,"hlt_dqm_Test2"); break;
106  case 7 : sprintf(histo,"hlt_dqm_Test3"); break;
107  case 8 : sprintf(histo,"hlt_dqm_Test4"); break;
108  case 9 : sprintf(histo,"hlt_dqm_Test5"); break;
109  case 10 : sprintf(histo,"hlt_dqm_Test6"); break;
110  case 11 : sprintf(histo,"hlt_dqm_Test7"); break;
111  case 12 : sprintf(histo,"hlt_dqm_Test8"); break;
112  case 13 : sprintf(histo,"hlt_dqm_Test9"); break;
113  case 14 : sprintf(histo,"hlt_dqm_Test10"); break;
114  case 15 : sprintf(histo,"hlt_dqm_Test11"); break;
115  case 16 : sprintf(histo,"hlt_dqm_Test12"); break;
116  case 17 : sprintf(histo,"hlt_dqm_Test13"); break;
117  case 18 : sprintf(histo,"hlt_dqm_Test14"); break;
118  case 19 : sprintf(histo,"hlt_dqm_Test15"); break;
119  }
120 
121 
122 
123 // if( reportSummaryContent_[i] = dbe_->get("HLT/EventInfo/reportSummaryContents/" + histo) )
124 // {
125 // dbe_->removeElement(reportSummaryContent_[i]->getName());
126 // }
127 
129  }
130 
131  //initialize reportSummaryContents to 1
132  for (int k = 0; k < nPDs; k++) {
133  summaryContent[k] = 1;
135  }
136 
137 
138  dbe_->setCurrentFolder("HLT/EventInfo");
139 
140  reportSummaryMap_ = dbe_->get("HLT/EventInfo/reportSummaryMap");
141  if ( reportSummaryMap_ ) {
143  }
144 
145 
146  reportSummaryMap_ = dbe_->book2D("reportSummaryMap", "reportSummaryMap", 1, 1, 2, 10, 1, 11);
149  reportSummaryMap_->setBinLabel(1,"SingleElectron",2);
150  reportSummaryMap_->setBinLabel(2,"DoubleElectron",2);
151  reportSummaryMap_->setBinLabel(3,"SingleMu",2);
152  reportSummaryMap_->setBinLabel(4,"DoubleMu",2);
153  reportSummaryMap_->setBinLabel(5,"Photon",2);
154  reportSummaryMap_->setBinLabel(6,"Tau",2);
155  reportSummaryMap_->setBinLabel(7,"BTag",2);
156  reportSummaryMap_->setBinLabel(8,"HT",2);
157  reportSummaryMap_->setBinLabel(9,"Jet",2);
158  reportSummaryMap_->setBinLabel(10,"MET",2);
159  reportSummaryMap_->setBinLabel(1," ",1);
160 
161 }
const std::string & getName(void) const
get name of ME
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
void Fill(long long x)
MonitorElement * reportSummaryContent_[20]
MonitorElement * reportSummaryMap_
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
Float_t summaryContent[20]
int k[5][pyjets_maxn]
tuple cout
Definition: gather_cfg.py:121
MonitorElement * reportSummary_
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void HLTEventInfoClient::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 168 of file HLTEventInfoClient.cc.

168  {
169  // optionally reset histograms here
170 }
void HLTEventInfoClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 164 of file HLTEventInfoClient.cc.

164  {
165 }
void HLTEventInfoClient::endJob ( void  )
protectedvirtual

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 284 of file HLTEventInfoClient.cc.

284  {
285 }
void HLTEventInfoClient::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protectedvirtual

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 172 of file HLTEventInfoClient.cc.

References dbe_, DQMStore::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), i, edm::LuminosityBlockBase::id(), j, gen::k, edm::LuminosityBlockID::luminosityBlock(), and m.

172  {
173 
174 
175  int ilumi = int(lumiSeg.id().luminosityBlock());
176 
177  const int nPDs = 10;
178  MonitorElement* Pass_Hists[nPDs];
179  int nPathsPD[nPDs];
180  double PDResult[nPDs];
181  int nTotPD[nPDs];
182  for( int i = 0; i < nPDs; i++ ) {
183  PDResult[i] = 1.0;
184  nTotPD[i] = 0.0;
185  }
186  bool isCollision = true;
187 
188  for( int i = 0; i < nPDs; i++ ) {
189  if( i == 0 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_SingleElectron_Pass_Any"); // SingleElectron
190  if( i == 1 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_DoubleElectron_Pass_Any"); // DoubleElectron
191  if( i == 2 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_SingleMu_Pass_Any"); // SingleMu
192  if( i == 3 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_DoubleMu_Pass_Any"); // DoubleMu
193  if( i == 4 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_Photon_Pass_Any"); // Photon
194  if( i == 5 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_Tau_Pass_Any"); // Tau
195  if( i == 6 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_BTag_Pass_Any"); // BTag
196  if( i == 7 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_HT_Pass_Any"); // HT
197  if( i == 8 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_Jet_Pass_Any"); // Jet
198  if( i == 9 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_MET_Pass_Any"); // MET
199 
200  if( Pass_Hists[i] ) {
201  if( i == 5 && !isCollision ) continue;
202  nPathsPD[i] = Pass_Hists[i]->getNbinsX();
203  int noBins = 2;
204  if( i == 1 ) noBins = 3; // the last trigger is low rate
205  if( i == 8 ) noBins = 4; // two last triggers are low rate
206 
207  for( int j = 0; j < nPathsPD[i]-noBins; j++ ) {
208  // if triggers in each PD are too much prescaled (or low rate), skip in the summary
209 
210  if( i == 1 && (j == 0) ) continue; // DoubleElectron
211  if( i == 3 && (j == 1 || j == 4) ) continue; // DoubleMu
212  if( i == 4 && (j > 1) ) continue; // Photon
213  if( i == 5 && (j > 4) ) continue; // Tau
214  if( i == 7 && (j == 7) ) continue; // HT
215  if( i == 8 && (j == 8) ) continue; // Jet
216  if( i == 9 && (j == 8 || j == 13 || j == 15) ) continue; // MET
217 
218  double val = Pass_Hists[i]->getBinContent(j+1);
219  if( val == 0 ) {
220  if( ilumi > 5 ) PDResult[i] = 0.5;
221  }
222  nTotPD[i] += val;
223  }
224  if( nTotPD[i] == 0 ) {
225  if( ilumi > 5 ) PDResult[i] = 0.0;
226  }
227  }
228  else {
229  isCollision = false;
230  }
231  }
232 
233  for (int k = 0; k < nPDs; k++) {
234  if( k < 10 ) {
235  summaryContent[k] = PDResult[k];
236  reportSummaryContent_[k]->Fill(PDResult[k]);
237  }
238  else {
239  summaryContent[k] = 1;
241  }
242  }
243  summarySum = 0;
244 
245  for (int m = 0; m < nPDs; m++) {
247  }
248 
249 
250  reportSummary = summarySum / nPDs;;
252 
253 
254  reportSummaryMap_->setBinContent(1,1,summaryContent[0]);//SingleElectron
255  reportSummaryMap_->setBinContent(1,2,summaryContent[1]);//DoubleElectron
264 
265 }
LuminosityBlockID id() const
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
void Fill(long long x)
MonitorElement * reportSummaryContent_[20]
MonitorElement * reportSummaryMap_
int j
Definition: DBlmapReader.cc:9
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
Float_t summaryContent[20]
int k[5][pyjets_maxn]
LuminosityBlockNumber_t luminosityBlock() const
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
MonitorElement * reportSummary_
void HLTEventInfoClient::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 280 of file HLTEventInfoClient.cc.

280  {
281 }
TH1F * HLTEventInfoClient::get1DHisto ( std::string  meName,
DQMStore dbi 
)
private

Definition at line 289 of file HLTEventInfoClient.cc.

References gather_cfg::cout, DQMStore::get(), MonitorElement::getTH1F(), and NULL.

290 {
291 
292  MonitorElement * me_ = dbi->get(meName);
293 
294  if (!me_) {
295  if(verbose_) std::cout << "ME NOT FOUND." << std::endl;
296  return NULL;
297  }
298 
299  return me_->getTH1F();
300 }
#define NULL
Definition: scimark2.h:8
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
TH1F * getTH1F(void) const
tuple cout
Definition: gather_cfg.py:121
TProfile * HLTEventInfoClient::get1DProfile ( std::string  meName,
DQMStore dbi 
)
private

Definition at line 333 of file HLTEventInfoClient.cc.

References gather_cfg::cout, DQMStore::get(), MonitorElement::getTProfile(), and NULL.

334 {
335 
336 
337  MonitorElement * me_ = dbi->get(meName);
338 
339  if (!me_) {
340  if(verbose_) std::cout << "ME NOT FOUND." << std::endl;
341  return NULL;
342  }
343 
344  return me_->getTProfile();
345 }
#define NULL
Definition: scimark2.h:8
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
TProfile * getTProfile(void) const
tuple cout
Definition: gather_cfg.py:121
TH2F * HLTEventInfoClient::get2DHisto ( std::string  meName,
DQMStore dbi 
)
private

Definition at line 302 of file HLTEventInfoClient.cc.

References gather_cfg::cout, DQMStore::get(), MonitorElement::getTH2F(), and NULL.

303 {
304 
305 
306  MonitorElement * me_ = dbi->get(meName);
307 
308  if (!me_) {
309  if(verbose_) std::cout << "ME NOT FOUND." << std::endl;
310  return NULL;
311  }
312 
313  return me_->getTH2F();
314 }
#define NULL
Definition: scimark2.h:8
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
tuple cout
Definition: gather_cfg.py:121
TH2F * getTH2F(void) const
TProfile2D * HLTEventInfoClient::get2DProfile ( std::string  meName,
DQMStore dbi 
)
private

Definition at line 318 of file HLTEventInfoClient.cc.

References gather_cfg::cout, DQMStore::get(), MonitorElement::getTProfile2D(), and NULL.

319 {
320 
321 
322  MonitorElement * me_ = dbi->get(meName);
323 
324  if (!me_) {
325  if(verbose_) std::cout << "ME NOT FOUND." << std::endl;
326  return NULL;
327  }
328 
329  return me_->getTProfile2D();
330 }
TProfile2D * getTProfile2D(void) const
#define NULL
Definition: scimark2.h:8
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
tuple cout
Definition: gather_cfg.py:121
void HLTEventInfoClient::initialize ( )
private

Definition at line 45 of file HLTEventInfoClient.cc.

References gather_cfg::cout, dbe_, and cppFunctionSkipper::operator.

45  {
46 
47  counterLS_=0;
48  counterEvt_=0;
49 
50  // get back-end interface
52 
53  // base folder for the contents of this job
54  verbose_ = parameters_.getUntrackedParameter<bool>("verbose", false);
55 
56  monitorDir_ = parameters_.getUntrackedParameter<std::string>("monitorDir","");
57  if(verbose_) std::cout << "Monitor dir = " << monitorDir_ << std::endl;
58 
59  prescaleLS_ = parameters_.getUntrackedParameter<int>("prescaleLS", -1);
60  if(verbose_) std::cout << "DQM lumi section prescale = " << prescaleLS_ << " lumi section(s)"<< std::endl;
61 
62  prescaleEvt_ = parameters_.getUntrackedParameter<int>("prescaleEvt", -1);
63  if(verbose_) std::cout << "DQM event prescale = " << prescaleEvt_ << " events(s)"<< std::endl;
64 
65 
66 
67 }
T getUntrackedParameter(std::string const &, T const &) const
int prescaleEvt_
units of lumi sections
edm::ParameterSet parameters_
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

int HLTEventInfoClient::counterEvt_
private

counter

Definition at line 70 of file HLTEventInfoClient.h.

int HLTEventInfoClient::counterLS_
private

Definition at line 69 of file HLTEventInfoClient.h.

DQMStore* HLTEventInfoClient::dbe_
private

Definition at line 66 of file HLTEventInfoClient.h.

std::string HLTEventInfoClient::monitorDir_
private

Definition at line 67 of file HLTEventInfoClient.h.

int HLTEventInfoClient::nChannels
private

prescale on number of events

Definition at line 73 of file HLTEventInfoClient.h.

edm::ParameterSet HLTEventInfoClient::parameters_
private
int HLTEventInfoClient::prescaleEvt_
private

units of lumi sections

Definition at line 72 of file HLTEventInfoClient.h.

int HLTEventInfoClient::prescaleLS_
private

counter

Definition at line 71 of file HLTEventInfoClient.h.

Float_t HLTEventInfoClient::reportSummary
private

Definition at line 74 of file HLTEventInfoClient.h.

MonitorElement* HLTEventInfoClient::reportSummary_
private

Definition at line 79 of file HLTEventInfoClient.h.

MonitorElement* HLTEventInfoClient::reportSummaryContent_[20]
private

Definition at line 80 of file HLTEventInfoClient.h.

MonitorElement* HLTEventInfoClient::reportSummaryMap_
private

Definition at line 81 of file HLTEventInfoClient.h.

Float_t HLTEventInfoClient::summaryContent[20]
private

Definition at line 76 of file HLTEventInfoClient.h.

Float_t HLTEventInfoClient::summarySum
private

Definition at line 75 of file HLTEventInfoClient.h.

bool HLTEventInfoClient::verbose_
private

Definition at line 68 of file HLTEventInfoClient.h.