CMS 3D CMS Logo

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

#include <ESSummaryClient.h>

Inheritance diagram for ESSummaryClient:
ESClient

Public Member Functions

void analyze (void)
 Analyze. More...
 
void beginJob (DQMStore *dqmStore)
 BeginJob. More...
 
void beginRun (void)
 BeginRun. More...
 
void cleanup (void)
 Cleanup. More...
 
void endJob (void)
 EndJob. More...
 
void endLumiAnalyze ()
 EndLumiAnalyze. More...
 
void endRun (void)
 EndRun. More...
 
 ESSummaryClient (const edm::ParameterSet &ps)
 Constructor. More...
 
int getEvtPerJob ()
 Get Functions. More...
 
int getEvtPerRun ()
 
void setFriends (const std::vector< ESClient * > &clients)
 Set Clients. More...
 
void setup (void)
 Setup. More...
 
void softReset (bool flag)
 SoftReset. More...
 
virtual ~ESSummaryClient ()
 Destructor. More...
 
- Public Member Functions inherited from ESClient
virtual ~ESClient (void)
 

Private Attributes

std::vector< ESClient * > clients_
 
bool cloneME_
 
bool debug_
 
DQMStoredqmStore_
 
bool enableCleanup_
 
int ievt_
 
int jevt_
 
std::string prefixME_
 
bool verbose_
 

Detailed Description

Definition at line 14 of file ESSummaryClient.h.

Constructor & Destructor Documentation

ESSummaryClient::ESSummaryClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 14 of file ESSummaryClient.cc.

References edm::ParameterSet::getUntrackedParameter().

14  {
15 
16  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
17  verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
18  debug_ = ps.getUntrackedParameter<bool>("debug", false);
19  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
20  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
21 
22 }
T getUntrackedParameter(std::string const &, T const &) const
std::string prefixME_
ESSummaryClient::~ESSummaryClient ( )
virtual

Destructor.

Definition at line 24 of file ESSummaryClient.cc.

24  {
25 }

Member Function Documentation

void ESSummaryClient::analyze ( void  )
virtual

Analyze.

Implements ESClient.

Definition at line 120 of file ESSummaryClient.cc.

References MonitorElement::Fill(), MonitorElement::getBinContent(), timingPdfMaker::histo, i, j, AlCaHLTBitMon_ParallelJobs::p, MonitorElement::setBinContent(), x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

120  {
121 
122  char histo[200];
123 
124  float nDI_FedErr[80][80];
125  float DCC[80][80];
126  float eCount;
127 
128  MonitorElement* me;
129 
130  for (int i=0; i<80; ++i)
131  for (int j=0; j<80; ++j) {
132  nDI_FedErr[i][j] = -1;
133  DCC[i][j]=0;
134  }
135 
136  for (int i=0; i<2; ++i) {
137  for (int j=0; j<2; ++j) {
138 
139  int iz = (i==0)? 1:-1;
140 
141  sprintf(histo, "ES Integrity Errors Z %d P %d", iz, j+1);
142  me = dqmStore_->get(prefixME_ + "/ESIntegrityTask/" + histo);
143  if (me)
144  for (int x=0; x<40; ++x)
145  for (int y=0; y<40; ++y)
146  nDI_FedErr[i*40+x][(1-j)*40+y] = me->getBinContent(x+1, y+1);
147 
148  sprintf(histo, "ES Integrity Summary 1 Z %d P %d", iz, j+1);
149  me = dqmStore_->get(prefixME_ + "/ESIntegrityClient/" + histo);
150  if (me)
151  for (int x=0; x<40; ++x)
152  for (int y=0; y<40; ++y)
153  DCC[i*40+x][(1-j)*40+y] = me->getBinContent(x+1, y+1);
154 
155  sprintf(histo, "ES RecHit 2D Occupancy Z %d P %d", iz, j+1);
156  me = dqmStore_->get(prefixME_ + "/ESOccupancyTask/" + histo);
157  if (me)
158  eCount = me->getBinContent(40,40);
159  else
160  eCount = 1.;
161 
162  }
163  }
164 
165  //The global-summary
166  //ReportSummary Map
167  // ES+F ES-F
168  // ES+R ES-R
169  float nValidChannels=0;
170  float nGlobalErrors=0;
171  float nValidChannelsES[2][2]={};
172  float nGlobalErrorsES[2][2]={};
173 
174  me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummaryMap");
175  if (me) {
176  for (int x=0; x<80; ++x) {
177  if (eCount < 1) break; //Fill reportSummaryMap after have 1 event
178  for (int y=0; y<80; ++y) {
179 
180  int z = (x<40) ? 0:1;
181  int p = (y>=40) ? 0:1;
182 
183  if (DCC[x][y]==0.) {
184  me->setBinContent(x+1, y+1, -1.);
185  } else {
186  if (nDI_FedErr[x][y] >= 0) {
187  me->setBinContent(x+1, y+1, 1-(nDI_FedErr[x][y]/eCount));
188 
189  nValidChannels++;
190  nGlobalErrors += nDI_FedErr[x][y]/eCount;
191 
192  nValidChannelsES[z][p]++;
193  nGlobalErrorsES[z][p] += nDI_FedErr[x][y]/eCount;
194  }
195  else {
196  me->setBinContent(x+1, y+1, -1.);
197  }
198  }
199 
200  }
201  }
202  }
203 
204  for (int i=0; i<2; ++i) {
205  for (int j=0; j<2; ++j) {
206  int iz = (i==0)? 1:-1;
207  float reportSummaryES = -1.;
208  if (nValidChannelsES[i][j] != 0)
209  reportSummaryES = 1.0 - nGlobalErrorsES[i][j]/nValidChannelsES[i][j];
210  sprintf(histo, "EcalPreshower Z %d P %d", iz, j+1);
211  me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummaryContents/" + histo);
212  if ( me ) me->Fill(reportSummaryES);
213  }
214  }
215 
216  //Return ratio of good channels
217  float reportSummary = -1.0;
218  if ( nValidChannels != 0 )
219  reportSummary = 1.0 - nGlobalErrors/nValidChannels;
220  me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummary");
221  if ( me ) me->Fill(reportSummary);
222 
223 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
float float float z
void Fill(long long x)
int j
Definition: DBlmapReader.cc:9
std::string prefixME_
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
double getBinContent(int binx) const
get content of bin (1-D)
Definition: DDAxes.h:10
DQMStore * dqmStore_
void ESSummaryClient::beginJob ( DQMStore dqmStore)
virtual

BeginJob.

Implements ESClient.

Definition at line 27 of file ESSummaryClient.cc.

References gather_cfg::cout, MonitorElement::Fill(), MonitorElement::getName(), timingPdfMaker::histo, i, j, MonitorElement::setAxisTitle(), and MonitorElement::setBinContent().

27  {
28 
29  dqmStore_ = dqmStore;
30 
31  if ( debug_ ) cout << "ESSummaryClient: beginJob" << endl;
32 
33  ievt_ = 0;
34  jevt_ = 0;
35 
36  char histo[200];
37 
38  MonitorElement* me;
39 
40  dqmStore_->setCurrentFolder( prefixME_ + "/EventInfo" );
41 
42  sprintf(histo, "reportSummary");
43  me = dqmStore_->get(prefixME_ + "/EventInfo/" + histo);
44  if ( me ) {
46  }
47  me = dqmStore_->bookFloat(histo);
48  me->Fill(-1.0);
49 
50  dqmStore_->setCurrentFolder( prefixME_ + "/EventInfo/reportSummaryContents" );
51 
52  for (int i=0 ; i<2; ++i){
53  for (int j=0 ; j<2; ++j){
54  int iz = (i==0)? 1:-1;
55  sprintf(histo, "EcalPreshower Z %d P %d", iz, j+1);
56  me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummaryContents/" + histo);
57  if(me){
59  }
60  me = dqmStore_->bookFloat(histo);
61  me->Fill(-1.0);
62  }
63  }
64 
65  dqmStore_->setCurrentFolder( prefixME_ + "/EventInfo" );
66 
67  sprintf(histo, "reportSummaryMap");
68  me = dqmStore_->get(prefixME_ + "/EventInfo/" + histo);
69  if ( me ) {
71  }
72  me = dqmStore_->book2D(histo, histo, 80, 0.5, 80.5, 80, 0.5, 80.5);
73  me->setAxisTitle("Si X", 1);
74  me->setAxisTitle("Si Y", 2);
75 
76  for ( int i = 0; i < 80; i++ ) {
77  for ( int j = 0; j < 80; j++ ) {
78  me->setBinContent( i+1, j+1, -1. );
79  }
80  }
81 
82 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:809
void Fill(long long x)
void removeElement(const std::string &name)
Definition: DQMStore.cc:2772
int j
Definition: DBlmapReader.cc:9
std::string prefixME_
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
tuple cout
Definition: gather_cfg.py:121
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:1000
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:584
DQMStore * dqmStore_
void ESSummaryClient::beginRun ( void  )
virtual

BeginRun.

Implements ESClient.

Definition at line 84 of file ESSummaryClient.cc.

References gather_cfg::cout, and HcalObjRepresent::setup().

84  {
85 
86  if ( debug_ ) cout << "ESSummaryClient: beginRun" << endl;
87 
88  jevt_ = 0;
89 
90  this->setup();
91 
92 }
tuple cout
Definition: gather_cfg.py:121
void setup(void)
Setup.
void ESSummaryClient::cleanup ( void  )
virtual

Cleanup.

Implements ESClient.

Definition at line 114 of file ESSummaryClient.cc.

114  {
115 
116  if ( ! enableCleanup_ ) return;
117 
118 }
void ESSummaryClient::endJob ( void  )
virtual

EndJob.

Implements ESClient.

Definition at line 94 of file ESSummaryClient.cc.

References edm::cleanup(), and gather_cfg::cout.

94  {
95 
96  if ( debug_ ) cout << "ESSummaryClient: endJob, ievt = " << ievt_ << endl;
97 
98  this->cleanup();
99 
100 }
void cleanup(void)
Cleanup.
tuple cout
Definition: gather_cfg.py:121
void ESSummaryClient::endLumiAnalyze ( void  )
virtual

EndLumiAnalyze.

Implements ESClient.

Definition at line 228 of file ESSummaryClient.cc.

References MonitorElement::Fill(), MonitorElement::getBinContent(), timingPdfMaker::histo, i, and j.

228  {
229 
230  char histo[200];
231  MonitorElement* me = 0;
232  MonitorElement* me_report = 0;
233  sprintf(histo, "ES Good Channel Fraction");
234  me = dqmStore_->get(prefixME_+"/ESIntegrityTask/"+histo);
235  if (!me) return;
236  for (int i=0; i<2; ++i) {
237  for (int j=0; j<2; ++j) {
238  int iz = (i==0)? 1:-1;
239  sprintf(histo, "EcalPreshower Z %d P %d", iz, j+1);
240  me_report = dqmStore_->get(prefixME_+"/EventInfo/reportSummaryContents/" + histo);
241  if (me_report) {
242  me_report->Fill(me->getBinContent(i+1, j+1));
243  }
244  }
245  }
246  me_report = dqmStore_->get(prefixME_ + "/EventInfo/reportSummary");
247  if ( me_report ) me_report->Fill(me->getBinContent(3,3));
248 
249 }
int i
Definition: DBlmapReader.cc:9
void Fill(long long x)
int j
Definition: DBlmapReader.cc:9
std::string prefixME_
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
double getBinContent(int binx) const
get content of bin (1-D)
DQMStore * dqmStore_
void ESSummaryClient::endRun ( void  )
virtual

EndRun.

Implements ESClient.

Definition at line 102 of file ESSummaryClient.cc.

References edm::cleanup(), and gather_cfg::cout.

102  {
103 
104  if ( debug_ ) cout << "ESSummaryClient: endRun, jevt = " << jevt_ << endl;
105 
106  this->cleanup();
107 
108 }
void cleanup(void)
Cleanup.
tuple cout
Definition: gather_cfg.py:121
int ESSummaryClient::getEvtPerJob ( void  )
inline

Get Functions.

Definition at line 49 of file ESSummaryClient.h.

References ievt_.

49 { return ievt_; }
int ESSummaryClient::getEvtPerRun ( void  )
inline

Definition at line 50 of file ESSummaryClient.h.

References jevt_.

50 { return jevt_; }
void ESSummaryClient::setFriends ( const std::vector< ESClient * > &  clients)
inline

Set Clients.

Definition at line 53 of file ESSummaryClient.h.

References clients_.

53 { clients_ = clients; }
std::vector< ESClient * > clients_
void ESSummaryClient::setup ( void  )
virtual

Setup.

Implements ESClient.

Definition at line 110 of file ESSummaryClient.cc.

110  {
111 
112 }
void ESSummaryClient::softReset ( bool  flag)

SoftReset.

Definition at line 225 of file ESSummaryClient.cc.

225  {
226 }

Member Data Documentation

std::vector<ESClient*> ESSummaryClient::clients_
private

Definition at line 70 of file ESSummaryClient.h.

Referenced by setFriends().

bool ESSummaryClient::cloneME_
private

Definition at line 63 of file ESSummaryClient.h.

bool ESSummaryClient::debug_
private

Definition at line 65 of file ESSummaryClient.h.

DQMStore* ESSummaryClient::dqmStore_
private

Definition at line 72 of file ESSummaryClient.h.

bool ESSummaryClient::enableCleanup_
private

Definition at line 66 of file ESSummaryClient.h.

int ESSummaryClient::ievt_
private

Definition at line 60 of file ESSummaryClient.h.

Referenced by getEvtPerJob().

int ESSummaryClient::jevt_
private

Definition at line 61 of file ESSummaryClient.h.

Referenced by getEvtPerRun().

std::string ESSummaryClient::prefixME_
private

Definition at line 68 of file ESSummaryClient.h.

bool ESSummaryClient::verbose_
private

Definition at line 64 of file ESSummaryClient.h.