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
L1TdeECALClient Class Reference

#include <L1TdeECALClient.h>

Inheritance diagram for L1TdeECALClient:
edm::EDAnalyzer

Public Member Functions

 L1TdeECALClient (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~L1TdeECALClient ()
 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 (void)
 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_
 
MonitorElementecalEtMapDiff1D_proj
 prescale on number of events More...
 
MonitorElementecalEtMapDiff1D_proj_badChs
 
MonitorElementecalEtMapDiff_badChs
 
std::string monitorDir_
 
edm::ParameterSet parameters_
 
int prescaleEvt_
 units of lumi sections More...
 
int prescaleLS_
 counter More...
 
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)
 

Detailed Description

Definition at line 21 of file L1TdeECALClient.h.

Constructor & Destructor Documentation

L1TdeECALClient::L1TdeECALClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 21 of file L1TdeECALClient.cc.

22 {
23  parameters_=ps;
24  initialize();
25 }
edm::ParameterSet parameters_
L1TdeECALClient::~L1TdeECALClient ( )
virtual

Destructor.

Definition at line 27 of file L1TdeECALClient.cc.

References gather_cfg::cout.

27  {
28  if(verbose_) cout <<"[TriggerDQM]: ending... " << endl;
29 }
tuple cout
Definition: gather_cfg.py:41

Member Function Documentation

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

Fake Analyze.

Implements edm::EDAnalyzer.

Definition at line 158 of file L1TdeECALClient.cc.

References gather_cfg::cout, dbe_, i, and j.

158  {
159  counterEvt_++;
160  if (prescaleEvt_<1) return;
161  if (prescaleEvt_>0 && counterEvt_%prescaleEvt_ != 0) return;
162 
163  if(verbose_) cout << "L1TdeECALClient::analyze" << endl;
164 
165 // Example: get ROOT object
166  TProfile2D * ecalEtMapDiffRoot_;
167  ecalEtMapDiffRoot_ = this->get2DProfile("L1TEMU/xpert/Ecal/EcalEtMapDiff",dbe_);
168 
169 
170  if (ecalEtMapDiffRoot_) {
171  int lastBinX=(*ecalEtMapDiffRoot_).GetNbinsX();
172  int lastBinY=(*ecalEtMapDiffRoot_).GetNbinsY();
173  for(int i=0; i<lastBinX ; i++){
174  for(int j=0; j<lastBinY ; j++){
175  int ibin=lastBinY*(i%lastBinX)+j;
176  if(ecalEtMapDiffRoot_->GetBinContent(i,j))
177  ecalEtMapDiff1D_proj->setBinContent(ibin,ecalEtMapDiffRoot_->GetBinContent(i,j));
178  }
179  }
180 
181  }
182 
183 
184 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
int prescaleEvt_
units of lumi sections
MonitorElement * ecalEtMapDiff1D_proj
prescale on number of events
int j
Definition: DBlmapReader.cc:9
int counterEvt_
counter
tuple cout
Definition: gather_cfg.py:41
TProfile2D * get2DProfile(std::string meName, DQMStore *dbi)
void L1TdeECALClient::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 57 of file L1TdeECALClient.cc.

References DQMStore::book1D(), DQMStore::book2D(), gather_cfg::cout, dbe_, cmsCodeRules.cppFunctionSkipper::operator, and DQMStore::setCurrentFolder().

57  {
58 
59  if(verbose_) cout <<"[TriggerDQM]: Begin Job" << endl;
60  // get backendinterface
62 
63  // do your thing
65 
66  ecalEtMapDiff1D_proj = dbe_->book1D("ecalEtMapDiff1D_proj","ecalEtMapDiff1D_proj",2520,0,2520.);
67 
68 
69 // bad channels from QTs results
70  ecalEtMapDiff1D_proj_badChs = dbe_->book1D("ecalEtMapDiff1D_proj_badChs","ecalEtMapDiff1D_proj_badChs",2520,0,2520.);
71  ecalEtMapDiff_badChs = dbe_->book2D("ecalEtMapDiff2D_badChs","ecalEtMapDiff2D_badChs",35, -17.5, 17.5,72, -10., 350.);
72 
73 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
MonitorElement * ecalEtMapDiff1D_proj
prescale on number of events
MonitorElement * ecalEtMapDiff_badChs
std::string monitorDir_
tuple cout
Definition: gather_cfg.py:41
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:642
MonitorElement * ecalEtMapDiff1D_proj_badChs
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
void L1TdeECALClient::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 80 of file L1TdeECALClient.cc.

80  {
81  // optionally reset histograms here
82 }
void L1TdeECALClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 76 of file L1TdeECALClient.cc.

76  {
77 }
void L1TdeECALClient::endJob ( void  )
protectedvirtual

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 191 of file L1TdeECALClient.cc.

191  {
192 }
void L1TdeECALClient::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protectedvirtual

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 84 of file L1TdeECALClient.cc.

References gather_cfg::cout, dbe_, dqm::qstatus::DISABLED, dqm::qstatus::ERROR, DQMStore::get(), MonitorElement::getEntries(), DQMStore::getMEs(), MonitorElement::getQReports(), dqm::qstatus::INSUF_STAT, dqm::qstatus::INVALID, DQMStore::pwd(), and dqm::qstatus::WARNING.

85  {
86 
87 // retrieve all MEs in current dir
88  vector<string> meVec = dbe_->getMEs();
89  if(verbose_) cout << "meVec size = " << meVec.size() << endl;
90  string currDir = dbe_->pwd();
91  if(verbose_) cout << "currDir = " << currDir << endl;
92  for (vector<string>::const_iterator it = meVec.begin(); it != meVec.end(); it++) {
93  string full_path = currDir + "/" + (*it);
94  if(verbose_) cout << "full path = " << full_path << endl;
95  MonitorElement * me =dbe_->get(full_path);
96  float me_entries=me->getEntries();
97 
98 // for this MEs, get list of associated QTs
99 
100  std::vector<QReport *> Qtest_map = me->getQReports();
101 
102  if (Qtest_map.size() > 0) {
103  for (std::vector<QReport *>::const_iterator it = Qtest_map.begin(); it != Qtest_map.end(); it++) {
104  cout << endl;
105  string qt_name = (*it)->getQRName();
106  int qt_status = (*it)->getStatus();
107 
108  switch(qt_status){
110  if(verbose_) cout << "****** QT name: " << qt_name << "; Status: WARNING; "<< " Message: " << (*it)->getMessage() <<endl;
111  break;
112 
113  case dqm::qstatus::ERROR:
114  if(verbose_) cout << "****** QT name: " << qt_name << "; Status: ERROR; "<< " Message: " << (*it)->getMessage() <<endl;
115  break;
116 
118  if(verbose_) cout << "****** QT name: " << qt_name << "; Status: DISABLED; "<< " Message: " << (*it)->getMessage() <<endl;
119  break;
120 
122  if(verbose_) cout << "****** QT name: " << qt_name << "; Status: INVALID; "<< " Message: " << (*it)->getMessage() <<endl;
123  break;
124 
126  if(verbose_) cout << "****** QT name: " << qt_name << "; Status: NOT ENOUGH STATISTICS; "<< " Message: " <<(*it)->getMessage() <<endl;
127  if(qt_status == dqm::qstatus::INSUF_STAT) cout << " entries = " << me_entries << endl;
128  break;
129 
130  default:
131  if(verbose_) cout << "****** Unknown QTest qith status="<<qt_status<< endl;
132  }
133 
134 // get bad channel list
135 
136  std::vector<dqm::me_util::Channel> badChannels=(*it)->getBadChannels();
137  if(!badChannels.empty() && verbose_ ) cout << " Number of channels that failed test " <<qt_name << " = " << badChannels.size()<< "\n";
138  vector<dqm::me_util::Channel>::iterator badchsit = badChannels.begin();
139 
140  while(badchsit != badChannels.end())
141  {
142  int ix = (*badchsit).getBinX();
143  int iy = (*badchsit).getBinY();
144  if(verbose_) cout <<" Bad channel ("<< ix<<"," << iy << ") with contents "<<(*badchsit).getContents() << endl;
145  if(qt_name=="testdeDiffInYRange") ecalEtMapDiff1D_proj_badChs->setBinContent(ix,(*badchsit).getContents());
146  if(qt_name=="testdeDiffInRange2DProfile") ecalEtMapDiff_badChs->setBinContent(ix,iy,(*badchsit).getContents());
147  ++badchsit;
148  }
149 
150  }
151  }
152 
153  }
154 
155 }
void setBinContent(int binx, double content)
set content of bin (1-D)
static const int WARNING
double getEntries(void) const
get # of entries
static const int INVALID
static const int INSUF_STAT
static const int DISABLED
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1265
std::vector< QReport * > getQReports(void) const
get map of QReports
MonitorElement * ecalEtMapDiff_badChs
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
Definition: DQMStore.cc:1239
tuple cout
Definition: gather_cfg.py:41
MonitorElement * ecalEtMapDiff1D_proj_badChs
static const int ERROR
const std::string & pwd(void) const
Definition: DQMStore.cc:204
void L1TdeECALClient::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 187 of file L1TdeECALClient.cc.

187  {
188 }
TH1F * L1TdeECALClient::get1DHisto ( std::string  meName,
DQMStore dbi 
)
private

Definition at line 196 of file L1TdeECALClient.cc.

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

197 {
198 
199  MonitorElement * me_ = dbi->get(meName);
200 
201  if (!me_) {
202  if(verbose_) cout << "ME NOT FOUND." << endl;
203  return NULL;
204  }
205 
206  return me_->getTH1F();
207 }
#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:1265
TH1F * getTH1F(void) const
tuple cout
Definition: gather_cfg.py:41
TProfile * L1TdeECALClient::get1DProfile ( std::string  meName,
DQMStore dbi 
)
private

Definition at line 240 of file L1TdeECALClient.cc.

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

241 {
242 
243 
244  MonitorElement * me_ = dbi->get(meName);
245 
246  if (!me_) {
247  if(verbose_) cout << "ME NOT FOUND." << endl;
248  return NULL;
249  }
250 
251  return me_->getTProfile();
252 }
#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:1265
TProfile * getTProfile(void) const
tuple cout
Definition: gather_cfg.py:41
TH2F * L1TdeECALClient::get2DHisto ( std::string  meName,
DQMStore dbi 
)
private

Definition at line 209 of file L1TdeECALClient.cc.

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

210 {
211 
212 
213  MonitorElement * me_ = dbi->get(meName);
214 
215  if (!me_) {
216  if(verbose_) cout << "ME NOT FOUND." << endl;
217  return NULL;
218  }
219 
220  return me_->getTH2F();
221 }
#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:1265
tuple cout
Definition: gather_cfg.py:41
TH2F * getTH2F(void) const
TProfile2D * L1TdeECALClient::get2DProfile ( std::string  meName,
DQMStore dbi 
)
private

Definition at line 225 of file L1TdeECALClient.cc.

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

226 {
227 
228 
229  MonitorElement * me_ = dbi->get(meName);
230 
231  if (!me_) {
232  if(verbose_) cout << "ME NOT FOUND." << endl;
233  return NULL;
234  }
235 
236  return me_->getTProfile2D();
237 }
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:1265
tuple cout
Definition: gather_cfg.py:41
void L1TdeECALClient::initialize ( )
private

Definition at line 32 of file L1TdeECALClient.cc.

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

32  {
33 
34  counterLS_=0;
35  counterEvt_=0;
36 
37  // get back-end interface
39 
40  // base folder for the contents of this job
41  verbose_ = parameters_.getUntrackedParameter<bool>("verbose", false);
42 
43  monitorDir_ = parameters_.getUntrackedParameter<string>("monitorDir","");
44  if(verbose_) cout << "Monitor dir = " << monitorDir_ << endl;
45 
46  prescaleLS_ = parameters_.getUntrackedParameter<int>("prescaleLS", -1);
47  if(verbose_) cout << "DQM lumi section prescale = " << prescaleLS_ << " lumi section(s)"<< endl;
48 
49  prescaleEvt_ = parameters_.getUntrackedParameter<int>("prescaleEvt", -1);
50  if(verbose_) cout << "DQM event prescale = " << prescaleEvt_ << " events(s)"<< endl;
51 
52 
53 
54 }
T getUntrackedParameter(std::string const &, T const &) const
int prescaleLS_
counter
int prescaleEvt_
units of lumi sections
edm::ParameterSet parameters_
int counterEvt_
counter
std::string monitorDir_
tuple cout
Definition: gather_cfg.py:41

Member Data Documentation

int L1TdeECALClient::counterEvt_
private

counter

Definition at line 68 of file L1TdeECALClient.h.

int L1TdeECALClient::counterLS_
private

Definition at line 67 of file L1TdeECALClient.h.

DQMStore* L1TdeECALClient::dbe_
private

Definition at line 64 of file L1TdeECALClient.h.

MonitorElement* L1TdeECALClient::ecalEtMapDiff1D_proj
private

prescale on number of events

Definition at line 73 of file L1TdeECALClient.h.

MonitorElement* L1TdeECALClient::ecalEtMapDiff1D_proj_badChs
private

Definition at line 74 of file L1TdeECALClient.h.

MonitorElement* L1TdeECALClient::ecalEtMapDiff_badChs
private

Definition at line 75 of file L1TdeECALClient.h.

std::string L1TdeECALClient::monitorDir_
private

Definition at line 65 of file L1TdeECALClient.h.

edm::ParameterSet L1TdeECALClient::parameters_
private
int L1TdeECALClient::prescaleEvt_
private

units of lumi sections

Definition at line 70 of file L1TdeECALClient.h.

int L1TdeECALClient::prescaleLS_
private

counter

Definition at line 69 of file L1TdeECALClient.h.

bool L1TdeECALClient::verbose_
private

Definition at line 66 of file L1TdeECALClient.h.