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:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual void dqmEndJob (DQMStore::IBooker &ib, DQMStore::IGetter &ig) override
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &ib, DQMStore::IGetter &ig, const edm::LuminosityBlock &, const edm::EventSetup &) override
 
 HcalDataCertification (const edm::ParameterSet &)
 
 ~HcalDataCertification ()
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

void bookHistograms (DQMStore::IBooker &)
 
void CertifyHcal (DQMStore::IBooker &, DQMStore::IGetter &)
 

Private Attributes

MonitorElementCertificationSummary
 
MonitorElementCertificationSummaryMap
 
edm::ParameterSet conf_
 
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::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 CertificationSummary, debug_, edm::ParameterSet::getUntrackedParameter(), NULL, 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");
94 
96 }
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * CertificationSummary
#define NULL
Definition: scimark2.h:8
HcalDataCertification::~HcalDataCertification ( )

Definition at line 98 of file HcalDataCertification.cc.

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

Member Function Documentation

void HcalDataCertification::bookHistograms ( DQMStore::IBooker ib)
private

Definition at line 110 of file HcalDataCertification.cc.

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

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

111 {
112  if (debug_>0) std::cout<<"<HcalDataCertification> bookHistograms"<< std::endl;
113 
115  std::string currDir = ib.pwd();
116 
117  ib.setCurrentFolder(rootFolder_+"/EventInfo/");
118 
119  CertificationSummary = ib.bookFloat("CertificationSummary");
120 
121  CertificationSummaryMap = ib.book2D("CertificationSummaryMap","HcalCertificationSummaryMap",7,0.,7.,1,0.,1.);
130  CertificationSummaryMap->setBinLabel(1,"Status",2);
131 
132  ib.setCurrentFolder(rootFolder_+"/EventInfo/CertificationContents/");
133  Hcal_HB = ib.bookFloat("Hcal_HB");
134  Hcal_HE = ib.bookFloat("Hcal_HE");
135  Hcal_HF = ib.bookFloat("Hcal_HF");
136  Hcal_HO = ib.bookFloat("Hcal_HO");
137  Hcal_HFlumi = ib.bookFloat("Hcal_HFlumi");
138  Hcal_HO0 = ib.bookFloat("Hcal_HO0");
139  Hcal_HO12 = ib.bookFloat("Hcal_HO12");
140 
141 }
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
const std::string & pwd(void)
Definition: DQMStore.cc:281
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 * CertificationSummaryMap
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
tuple cout
Definition: gather_cfg.py:145
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
void HcalDataCertification::CertifyHcal ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
private

Definition at line 168 of file HcalDataCertification.cc.

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

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

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

Implements DQMEDHarvester.

Definition at line 158 of file HcalDataCertification.cc.

References bookHistograms(), CertificationSummary, and CertifyHcal().

159 {
160  // check if MonitorElements exits
161  // book them if not
162  if ( !CertificationSummary ) {
163  bookHistograms(ib);
164  }
165  CertifyHcal(ib,ig);
166 }
void bookHistograms(DQMStore::IBooker &)
MonitorElement * CertificationSummary
void CertifyHcal(DQMStore::IBooker &, DQMStore::IGetter &)
void HcalDataCertification::dqmEndLuminosityBlock ( DQMStore::IBooker ib,
DQMStore::IGetter ig,
const edm::LuminosityBlock run,
const edm::EventSetup c 
)
overridevirtual

Reimplemented from DQMEDHarvester.

Definition at line 147 of file HcalDataCertification.cc.

References bookHistograms(), CertificationSummary, and CertifyHcal().

148 {
149  // check if MonitorElements exits
150  // book them if not
151  if ( !CertificationSummary ) {
152  bookHistograms(ib);
153  }
154  CertifyHcal(ib,ig);
155 }
void bookHistograms(DQMStore::IBooker &)
MonitorElement * CertificationSummary
void CertifyHcal(DQMStore::IBooker &, DQMStore::IGetter &)

Member Data Documentation

MonitorElement* HcalDataCertification::CertificationSummary
private
MonitorElement* HcalDataCertification::CertificationSummaryMap
private

Definition at line 64 of file HcalDataCertification.cc.

Referenced by bookHistograms(), and CertifyHcal().

edm::ParameterSet HcalDataCertification::conf_
private

Definition at line 62 of file HcalDataCertification.cc.

int HcalDataCertification::debug_
private

Definition at line 72 of file HcalDataCertification.cc.

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

MonitorElement* HcalDataCertification::Hcal_HB
private

Definition at line 65 of file HcalDataCertification.cc.

Referenced by bookHistograms(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HE
private

Definition at line 66 of file HcalDataCertification.cc.

Referenced by bookHistograms(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HF
private

Definition at line 67 of file HcalDataCertification.cc.

Referenced by bookHistograms(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HFlumi
private

Definition at line 69 of file HcalDataCertification.cc.

Referenced by bookHistograms(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HO
private

Definition at line 68 of file HcalDataCertification.cc.

Referenced by bookHistograms(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HO0
private

Definition at line 70 of file HcalDataCertification.cc.

Referenced by bookHistograms(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HO12
private

Definition at line 71 of file HcalDataCertification.cc.

Referenced by bookHistograms(), and CertifyHcal().

std::string HcalDataCertification::rootFolder_
private

Definition at line 73 of file HcalDataCertification.cc.

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