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 Member Functions | Private Attributes
HcalDataCertification Class Reference

#include <DQM/HcalMonitorClient/src/HcalDataCertification.cc>

Inheritance diagram for HcalDataCertification:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 HcalDataCertification (const edm::ParameterSet &)
 
 ~HcalDataCertification ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginJob () override
 
virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
void CertifyHcal ()
 
virtual void endJob () override
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
void endRun (const edm::Run &r, const edm::EventSetup &c) override
 

Private Attributes

MonitorElementCertificationSummary
 
MonitorElementCertificationSummaryMap
 
edm::ParameterSet conf_
 
DQMStoredbe_
 
int debug_
 
MonitorElementHcal_HB
 
MonitorElementHcal_HE
 
MonitorElementHcal_HF
 
MonitorElementHcal_HFlumi
 
MonitorElementHcal_HO
 
MonitorElementHcal_HO0
 
MonitorElementHcal_HO12
 
std::string rootFolder_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 46 of file HcalDataCertification.cc.

Constructor & Destructor Documentation

HcalDataCertification::HcalDataCertification ( const edm::ParameterSet iConfig)
explicit

Definition at line 89 of file HcalDataCertification.cc.

References dbe_, debug_, edm::ParameterSet::getUntrackedParameter(), cppFunctionSkipper::operator, rootFolder_, and AlCaHLTBitMon_QueryRunRegistry::string.

90 {
91  // now do what ever initialization is needed
92  debug_ = iConfig.getUntrackedParameter<int>("debug",0);
93  rootFolder_ = iConfig.getUntrackedParameter<std::string>("subSystemFolder","Hcal");
95 }
T getUntrackedParameter(std::string const &, T const &) const
HcalDataCertification::~HcalDataCertification ( )

Definition at line 97 of file HcalDataCertification.cc.

98 {
99  // do anything here that needs to be done at desctruction time
100  // (e.g. close files, deallocate resources etc.)
101 }

Member Function Documentation

void HcalDataCertification::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 109 of file HcalDataCertification.cc.

109 {}
void HcalDataCertification::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 113 of file HcalDataCertification.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), CertificationSummary, CertificationSummaryMap, gather_cfg::cout, dbe_, debug_, DQMStore::getAllContents(), Hcal_HB, Hcal_HE, Hcal_HF, Hcal_HFlumi, Hcal_HO, Hcal_HO0, Hcal_HO12, DQMStore::pwd(), rootFolder_, MonitorElement::setAxisRange(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

114 {
115  if (debug_>0) std::cout<<"<HcalDataCertification> beginJob"<< std::endl;
116 
118  std::string currDir = dbe_->pwd();
119  if (debug_>0) std::cout << "--- Current Directory " << currDir << std::endl;
120  std::vector<MonitorElement*> mes = dbe_->getAllContents("");
121  if (debug_>0) std::cout << "found " << mes.size() << " monitoring elements:" << std::endl;
122 
123  dbe_->setCurrentFolder(rootFolder_+"/EventInfo/");
124 
125  CertificationSummary = dbe_->bookFloat("CertificationSummary");
126 
127  CertificationSummaryMap = dbe_->book2D("CertificationSummaryMap","HcalCertificationSummaryMap",7,0.,7.,1,0.,1.);
136  CertificationSummaryMap->setBinLabel(1,"Status",2);
137 
138  dbe_->setCurrentFolder(rootFolder_+"/EventInfo/CertificationContents/");
139  Hcal_HB = dbe_->bookFloat("Hcal_HB");
140  Hcal_HE = dbe_->bookFloat("Hcal_HE");
141  Hcal_HF = dbe_->bookFloat("Hcal_HF");
142  Hcal_HO = dbe_->bookFloat("Hcal_HO");
143  Hcal_HFlumi = dbe_->bookFloat("Hcal_HFlumi");
144  Hcal_HO0 = dbe_->bookFloat("Hcal_HO0");
145  Hcal_HO12 = dbe_->bookFloat("Hcal_HO12");
146 
147 }
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
MonitorElement * CertificationSummary
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:879
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
Definition: DQMStore.cc:1909
MonitorElement * CertificationSummaryMap
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:1070
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
const std::string & pwd(void) const
Definition: DQMStore.cc:627
void HcalDataCertification::beginLuminosityBlock ( const edm::LuminosityBlock run,
const edm::EventSetup c 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 158 of file HcalDataCertification.cc.

References gather_cfg::cout, and debug_.

159 {
160  if (debug_>0) std::cout<<"<HcalDataCertification> beginLuminosityBlock"<<std::endl;
161 }
tuple cout
Definition: gather_cfg.py:121
void HcalDataCertification::CertifyHcal ( )
private

Definition at line 175 of file HcalDataCertification.cc.

References CertificationSummary, CertificationSummaryMap, gather_cfg::cout, dbe_, debug_, MonitorElement::Fill(), DQMStore::get(), DQMStore::getAllContents(), Hcal_HB, Hcal_HE, Hcal_HF, Hcal_HFlumi, Hcal_HO, Hcal_HO0, Hcal_HO12, cuy::ii, findQualityFiles::jj, siStripFEDMonitor_P5_cff::Min, DQMStore::pwd(), rootFolder_, MonitorElement::setBinContent(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by endLuminosityBlock(), and endRun().

176 {
177 
178  float hcalFrac,reportFrac,dcsFrac,daqFrac;
179  float fracHCAL[7][3];
180  float certHcal[7];
181 
182  if (debug_>0) {
184  std::string currDir = dbe_->pwd();
185  std::cout << "<HcalDataCertification::endLuminosityBlock> --- Current Directory " << currDir << std::endl;
186  std::vector<MonitorElement*> mes = dbe_->getAllContents("");
187  std::cout << "found " << mes.size() << " monitoring elements:" << std::endl;
188  }
189 
190  if (dbe_->get(rootFolder_+"/EventInfo/DCSSummary")) {
191  dcsFrac = (dbe_->get(rootFolder_+"/EventInfo/DCSSummary"))->getFloatValue();
192  }
193  else dcsFrac = -1;
194 
195  if (dbe_->get(rootFolder_+"/EventInfo/DAQSummary")) {
196  daqFrac = (dbe_->get(rootFolder_+"/EventInfo/DAQSummary"))->getFloatValue();
197  }
198  else daqFrac = -1;
199 
200  if (dbe_->get(rootFolder_+"/EventInfo/reportSummary")) {
201  reportFrac = (dbe_->get(rootFolder_+"/EventInfo/reportSummary"))->getFloatValue();
202  }
203  else reportFrac = -1;
204 
205  hcalFrac = 99.;
206  hcalFrac = TMath::Min(hcalFrac,reportFrac);
207  hcalFrac = TMath::Min(hcalFrac,daqFrac);
208  hcalFrac = TMath::Min(hcalFrac,dcsFrac);
209  if (debug_>0) {
210  std::cout<<"dcsFrac= "<<dcsFrac<<std::endl;
211  std::cout<<"daqFrac= "<<daqFrac<<std::endl;
212  std::cout<<"reportFrac= "<<reportFrac<<std::endl;
213  std::cout<<"CertificationSummary= "<<hcalFrac<<std::endl;
214  }
215 
216  // reportSummary
217 
218  if (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HB")) {
219  fracHCAL[0][0] = (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HB"))->getFloatValue();
220  }
221  else fracHCAL[0][0] = -1;
222 
223  if (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HE")) {
224  fracHCAL[1][0] = (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HE"))->getFloatValue();
225  }
226  else fracHCAL[1][0] = -1;
227 
228  if (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HO")) {
229  fracHCAL[2][0] = (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HO"))->getFloatValue();
230  }
231  else fracHCAL[2][0] = -1;
232 
233  if (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HF")) {
234  fracHCAL[3][0] = (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HF"))->getFloatValue();
235  }
236  else fracHCAL[3][0] = -1;
237 
238  if (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HO0")) {
239  fracHCAL[4][0] = (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HO0"))->getFloatValue();
240  }
241  else fracHCAL[4][0] = -1;
242 
243  if (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HO12")) {
244  fracHCAL[5][0] = (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HO12"))->getFloatValue();
245  }
246  else fracHCAL[5][0] = -1;
247 
248 
249  if (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HFlumi")) {
250  fracHCAL[6][0] = (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HFlumi"))->getFloatValue();
251  }
252  else fracHCAL[6][0] = -1;
253 
254  // DAQ
255 
256  if (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HB")) {
257  fracHCAL[0][1] = (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HB"))->getFloatValue();
258  }
259  else fracHCAL[0][1] = -1;
260 
261  if (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HE")) {
262  fracHCAL[1][1] = (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HE"))->getFloatValue();
263  }
264  else fracHCAL[1][1] = -1;
265 
266  if (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HO")) {
267  fracHCAL[2][1] = (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HO"))->getFloatValue();
268  }
269  else fracHCAL[2][1] = -1;
270 
271  if (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HF")) {
272  fracHCAL[3][1] = (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HF"))->getFloatValue();
273  }
274  else fracHCAL[3][1] = -1;
275 
276  if (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HO0")) {
277  fracHCAL[4][1] = (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HO0"))->getFloatValue();
278  }
279  else fracHCAL[4][1] = -1;
280 
281  if (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HO12")) {
282  fracHCAL[5][1] = (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HO12"))->getFloatValue();
283  }
284  else fracHCAL[5][1] = -1;
285 
286  if (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HFlumi")) {
287  fracHCAL[6][1] = (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HFlumi"))->getFloatValue();
288  }
289  else fracHCAL[6][1] = -1;
290 
291  // DCS
292 
293  if (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HB")) {
294  fracHCAL[0][2] = (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HB"))->getFloatValue();
295  }
296  else fracHCAL[0][2] = -1;
297 
298  if (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HE")) {
299  fracHCAL[1][2] = (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HE"))->getFloatValue();
300  }
301  else fracHCAL[1][2] = -1;
302 
303  if (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HO")) {
304  fracHCAL[2][2] = (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HO"))->getFloatValue();
305  }
306  else fracHCAL[2][2] = -1;
307 
308  if (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HF")) {
309  fracHCAL[3][2] = (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HF"))->getFloatValue();
310  }
311  else fracHCAL[3][2] = -1;
312 
313  if (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HO0")) {
314  fracHCAL[4][2] = (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HO0"))->getFloatValue();
315  }
316  else fracHCAL[4][2] = -1;
317 
318  if (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HO12")) {
319  fracHCAL[5][2] = (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HO12"))->getFloatValue();
320  }
321  else fracHCAL[5][2] = -1;
322 
323 
324  if (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HFlumi")) {
325  fracHCAL[6][2] = (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HFlumi"))->getFloatValue();
326  }
327  else fracHCAL[6][2] = -1;
328 
329  for (int ii=0;ii<7;ii++) {
330  certHcal[ii] = 99.0;
331  for (int jj=0; jj<2;jj++) certHcal[ii] = TMath::Min(certHcal[ii],fracHCAL[ii][jj]);
332  CertificationSummaryMap->setBinContent(ii+1,1,certHcal[ii]);
333  if (debug_>0) std::cout<<"certFrac["<<ii<<"]= "<<certHcal[ii]<<std::endl;
334  }
335 
336  CertificationSummary->Fill(hcalFrac);
337  Hcal_HB->Fill(certHcal[0]);
338  Hcal_HE->Fill(certHcal[1]);
339  Hcal_HO->Fill(certHcal[2]);
340  Hcal_HF->Fill(certHcal[3]);
341  Hcal_HO0->Fill(certHcal[4]);
342  Hcal_HO12->Fill(certHcal[5]);
343  Hcal_HFlumi->Fill(certHcal[6]);
344 
345 // ---------------------- end of certification
346  if (debug_>0) std::cout << "<HcalDataCertification::MEfilled= " << std::endl;
347 
348 }
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * CertificationSummary
int ii
Definition: cuy.py:588
void Fill(long long x)
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
Definition: DQMStore.cc:1909
MonitorElement * CertificationSummaryMap
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1696
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
const std::string & pwd(void) const
Definition: DQMStore.cc:627
void HcalDataCertification::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 151 of file HcalDataCertification.cc.

References gather_cfg::cout, and debug_.

152 {
153  if (debug_>0) std::cout << "<HcalDataCertification> endJob " << std::endl;
154 }
tuple cout
Definition: gather_cfg.py:121
void HcalDataCertification::endLuminosityBlock ( const edm::LuminosityBlock run,
const edm::EventSetup c 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 165 of file HcalDataCertification.cc.

References CertifyHcal().

166 {
167  CertifyHcal();
168 }
void HcalDataCertification::endRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 170 of file HcalDataCertification.cc.

References CertifyHcal().

171 {
172  CertifyHcal();
173 }

Member Data Documentation

MonitorElement* HcalDataCertification::CertificationSummary
private

Definition at line 64 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

MonitorElement* HcalDataCertification::CertificationSummaryMap
private

Definition at line 65 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

edm::ParameterSet HcalDataCertification::conf_
private

Definition at line 62 of file HcalDataCertification.cc.

DQMStore* HcalDataCertification::dbe_
private

Definition at line 63 of file HcalDataCertification.cc.

Referenced by beginJob(), CertifyHcal(), and HcalDataCertification().

int HcalDataCertification::debug_
private
MonitorElement* HcalDataCertification::Hcal_HB
private

Definition at line 66 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HE
private

Definition at line 67 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HF
private

Definition at line 68 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HFlumi
private

Definition at line 70 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HO
private

Definition at line 69 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HO0
private

Definition at line 71 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HO12
private

Definition at line 72 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

std::string HcalDataCertification::rootFolder_
private

Definition at line 74 of file HcalDataCertification.cc.

Referenced by beginJob(), CertifyHcal(), and HcalDataCertification().