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

#include <DTOfflineSummaryClients.h>

Inheritance diagram for DTOfflineSummaryClients:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginRun (edm::Run const &run, edm::EventSetup const &eSetup)
 BeginRun. More...
 
 DTOfflineSummaryClients (const edm::ParameterSet &ps)
 Constructor. More...
 
void endJob (void)
 EndJob. More...
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
 EndLumi. More...
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 DQM Client Diagnostic. More...
 
virtual ~DTOfflineSummaryClients ()
 Destructor. More...
 
- 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

DQMStoredbe
 
int nevents
 
MonitorElementsummaryReport
 
MonitorElementsummaryReportMap
 
std::vector< MonitorElement * > theSummaryContents
 

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

Definition at line 21 of file DTOfflineSummaryClients.h.

Constructor & Destructor Documentation

DTOfflineSummaryClients::DTOfflineSummaryClients ( const edm::ParameterSet ps)

Constructor.

Definition at line 27 of file DTOfflineSummaryClients.cc.

References dbe, and cppFunctionSkipper::operator.

27  : nevents(0) {
28 
29  LogVerbatim("DTDQM|DTMonitorClient|DTOfflineSummaryClients") << "[DTOfflineSummaryClients]: Constructor";
30 
31 
33 
34 }
DTOfflineSummaryClients::~DTOfflineSummaryClients ( )
virtual

Destructor.

Definition at line 36 of file DTOfflineSummaryClients.cc.

References nevents.

36  {
37  LogVerbatim ("DTDQM|DTMonitorClient|DTOfflineSummaryClients") << "DTOfflineSummaryClients: analyzed " << nevents << " events";
38 
39 }

Member Function Documentation

void DTOfflineSummaryClients::analyze ( const edm::Event e,
const edm::EventSetup c 
)
virtual

Analyze.

Implements edm::EDAnalyzer.

Definition at line 79 of file DTOfflineSummaryClients.cc.

References nevents.

79  {
80 
81  nevents++;
82  if(nevents%1000 == 0) {
83  LogVerbatim("DTDQM|DTMonitorClient|DTOfflineSummaryClients") << "[DTOfflineSummaryClients] Analyze #Run: " << event.id().run()
84  << " #Event: " << event.id().event()
85  << " LS: " << event.luminosityBlock()
86  << endl;
87  }
88 }
void DTOfflineSummaryClients::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
virtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 41 of file DTOfflineSummaryClients.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), dbe, MonitorElement::Fill(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), hcal_dqm_sourceclient-file_cfg::streams, summaryReport, summaryReportMap, and theSummaryContents.

41  {
42 
43  LogVerbatim("DTDQM|DTMonitorClient|DTOfflineSummaryClients") <<"[DTOfflineSummaryClients]: BeginRun";
44 
45  // book the summary histos
46  dbe->setCurrentFolder("DT/EventInfo");
47  summaryReport = dbe->bookFloat("reportSummary");
48  // Initialize to 1 so that no alarms are thrown at the beginning of the run
49  summaryReport->Fill(1.);
50 
51  summaryReportMap = dbe->book2D("reportSummaryMap","DT Report Summary Map",12,1,13,5,-2,3);
52  summaryReportMap->setAxisTitle("sector",1);
53  summaryReportMap->setAxisTitle("wheel",2);
54 
55  dbe->setCurrentFolder("DT/EventInfo/reportSummaryContents");
56 
57  for(int wheel = -2; wheel != 3; ++wheel) {
58  stringstream streams;
59  streams << "DT_Wheel" << wheel;
60  string meName = streams.str();
61  theSummaryContents.push_back(dbe->bookFloat(meName));
62  // Initialize to 1 so that no alarms are thrown at the beginning of the run
63  theSummaryContents[wheel+2]->Fill(1.);
64  }
65 
66 
67 
68 
69 }
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:810
void Fill(long long x)
std::vector< MonitorElement * > theSummaryContents
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:1001
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:585
void DTOfflineSummaryClients::endJob ( void  )
virtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file DTOfflineSummaryClients.cc.

72  {
73 
74  LogVerbatim ("DTDQM|DTMonitorClient|DTOfflineSummaryClients") <<"[DTOfflineSummaryClients]: endJob";
75 
76 }
void DTOfflineSummaryClients::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
)
virtual

EndLumi.

Reimplemented from edm::EDAnalyzer.

Definition at line 91 of file DTOfflineSummaryClients.cc.

91  {
92 
93  LogVerbatim("DTDQM|DTMonitorClient|DTOfflineSummaryClients")
94  << "[DTOfflineSummaryClients]: End of LS transition" << endl;
95 
96 }
void DTOfflineSummaryClients::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
virtual

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 99 of file DTOfflineSummaryClients.cc.

References dbe, MonitorElement::Fill(), DQMStore::get(), MonitorElement::getBinContent(), MonitorElement::getBinError(), MonitorElement::getFloatValue(), cuy::ii, LogTrace, funct::pow(), MonitorElement::Reset(), relativeConstraints::station, summaryReport, summaryReportMap, and theSummaryContents.

99  {
100 
101  LogVerbatim ("DTDQM|DTMonitorClient|DTOfflineSummaryClients") <<"[DTOfflineSummaryClients]: endRun. Performin client operation";
102 
103 
104  // reset the monitor elements
106  summaryReport->Fill(0.);
107  for(int ii = 0; ii != 5; ++ii) {
108  theSummaryContents[ii]->Fill(0.);
109  }
110 
111  // Fill the map using, at the moment, only the information from DT chamber efficiency
112  // problems at a granularity smaller than the chamber are ignored
113  for(int wheel=-2; wheel<=2; wheel++) { // loop over wheels
114  // retrieve the chamber efficiency summary
115  stringstream str;
116  str << "DT/05-ChamberEff/EfficiencyMap_All_W" << wheel;
117  MonitorElement * segmentWheelSummary = dbe->get(str.str());
118  if(segmentWheelSummary != 0) {
119 
120  float nFailingChambers = 0.;
121 
122  for(int sector=1; sector<=12; sector++) { // loop over sectors
123 
124  double meaneff = 0.;
125  double errorsum = 0.;
126 
127  for(int station = 1; station != 5; ++station) { // loop over stations
128 
129  const double tmpefficiency = segmentWheelSummary->getBinContent(sector, station);
130  const double tmpvariance = pow(segmentWheelSummary->getBinError(sector, station),2);
131 
132  if(tmpefficiency == 0 || tmpvariance == 0){
133  nFailingChambers++;
134  continue;
135  }
136 
137  meaneff += tmpefficiency/tmpvariance;
138  errorsum += 1./tmpvariance;
139 
140  if(tmpefficiency < 0.2) nFailingChambers++;
141 
142  LogTrace("DTDQM|DTMonitorClient|DTOfflineSummaryClients")
143  << "Wheel: " << wheel << " Stat: " << station << " Sect: " << sector << " status: " << meaneff/errorsum << endl;
144  }
145 
146  const double eff_result = meaneff/errorsum;
147 
148  if(eff_result > 0.7) summaryReportMap->Fill(sector,wheel,1.);
149  else if(eff_result < 0.7 && eff_result > 0.5) summaryReportMap->Fill(sector,wheel,0.6);
150  else if(eff_result < 0.5 && eff_result > 0.3) summaryReportMap->Fill(sector,wheel,0.4);
151  else if(eff_result < 0.3 && eff_result > 0.) summaryReportMap->Fill(sector,wheel,0.15);
152 
153  }
154  theSummaryContents[wheel+2]->Fill((48.-nFailingChambers)/48.);
155  summaryReport->Fill(summaryReport->getFloatValue() + theSummaryContents[wheel+2]->getFloatValue()/5.);
156  } else {
157  LogWarning("DTDQM|DTMonitorClient|DTOfflineSummaryClients")
158  << " [DTOfflineSummaryClients] Segment Summary not found with name: " << str.str() << endl;
159  }
160  }
161 
162 }
int ii
Definition: cuy.py:588
void Fill(long long x)
double getFloatValue(void) const
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1624
#define LogTrace(id)
double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
std::vector< MonitorElement * > theSummaryContents
double getBinContent(int binx) const
get content of bin (1-D)
void Reset(void)
reset ME (ie. contents, errors, etc)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

Member Data Documentation

DQMStore* DTOfflineSummaryClients::dbe
private

Definition at line 52 of file DTOfflineSummaryClients.h.

Referenced by beginRun(), DTOfflineSummaryClients(), and endRun().

int DTOfflineSummaryClients::nevents
private

Definition at line 51 of file DTOfflineSummaryClients.h.

Referenced by analyze(), and ~DTOfflineSummaryClients().

MonitorElement* DTOfflineSummaryClients::summaryReport
private

Definition at line 54 of file DTOfflineSummaryClients.h.

Referenced by beginRun(), and endRun().

MonitorElement* DTOfflineSummaryClients::summaryReportMap
private

Definition at line 55 of file DTOfflineSummaryClients.h.

Referenced by beginRun(), and endRun().

std::vector<MonitorElement*> DTOfflineSummaryClients::theSummaryContents
private

Definition at line 56 of file DTOfflineSummaryClients.h.

Referenced by beginRun(), and endRun().