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 Attributes
DTSummaryClients Class Reference

#include <DTSummaryClients.h>

Inheritance diagram for DTSummaryClients:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 DTSummaryClients (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTSummaryClients ()
 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
 
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 ()
 

Protected 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...
 
void endJob (void)
 EndJob. More...
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
 DQM Client Diagnostic. More...
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 EndRun. More...
 
- 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)
 

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 &)
 

Detailed Description

Definition at line 31 of file DTSummaryClients.h.

Constructor & Destructor Documentation

DTSummaryClients::DTSummaryClients ( const edm::ParameterSet ps)

Constructor.

Definition at line 27 of file DTSummaryClients.cc.

References dbe, and cppFunctionSkipper::operator.

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

Destructor.

Definition at line 36 of file DTSummaryClients.cc.

References nevents.

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

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 86 of file DTSummaryClients.cc.

References nevents.

86  {
87 
88  nevents++;
89  if(nevents%1000 == 0) {
90  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients") << "[DTSummaryClients] Analyze #Run: " << event.id().run()
91  << " #Event: " << event.id().event()
92  << " LS: " << event.luminosityBlock()
93  << endl;
94  }
95 }
void DTSummaryClients::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 41 of file DTSummaryClients.cc.

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

41  {
42 
43  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients") <<"[DTSummaryClients]: 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 * summaryReport
MonitorElement * summaryReportMap
void Fill(long long x)
std::vector< MonitorElement * > theSummaryContents
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void DTSummaryClients::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file DTSummaryClients.cc.

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

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 98 of file DTSummaryClients.cc.

References dbe, MonitorElement::Fill(), MonitorElement::getBinContent(), cuy::ii, LogTrace, MonitorElement::Reset(), relativeConstraints::station, summaryReport, summaryReportMap, and theSummaryContents.

98  {
99 
100  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients")
101  << "[DTSummaryClients]: End of LS transition, performing the DQM client operation" << endl;
102 
103  // reset the monitor elements
105  summaryReport->Reset();
106  for(int ii = 0; ii != 5; ++ii) {
107  theSummaryContents[ii]->Reset();
108  }
109 
110  bool noDTData = false;
111 
112  // Check if DT data in each ROS have been read out and set the SummaryContents and the ErrorSummary
113  // accordignly
114  MonitorElement * dataIntegritySummary = dbe->get("DT/00-DataIntegrity/DataIntegritySummary");
115  if(dataIntegritySummary != 0) {
116  int nDisabledFED = 0;
117  for(int wheel = 1; wheel != 6; ++wheel) { // loop over the wheels
118  int nDisablesROS = 0;
119  for(int sect = 1; sect != 13; ++sect) { // loop over sectors
120  if(dataIntegritySummary->getBinContent(sect,wheel) == 1) {
121  nDisablesROS++;
122  }
123  }
124  if(nDisablesROS == 12) {
125  nDisabledFED++;
126  theSummaryContents[wheel-1]->Fill(0);
127  }
128  }
129 
130  if(nDisabledFED == 5) {
131  noDTData = true;
132  summaryReport->Fill(-1);
133  }
134 
135  } else {
136  LogError("DTDQM|DTMonitorClient|DTSummaryClients")
137  << "Data Integrity Summary not found with name: DT/00-DataIntegrity/DataIntegritySummary" <<endl;
138  }
139 
140  double totalStatus = 0;
141  // protection
142  bool occupancyFound = true;
143 
144  // Fill the map using, at the moment, only the information from DT occupancy
145  // problems at a granularity smaller than the chamber are ignored
146  for(int wheel=-2; wheel<=2; wheel++){ // loop over wheels
147  // retrieve the occupancy summary
148  stringstream str;
149  str << "DT/01-Digi/OccupancySummary_W" << wheel;
150  MonitorElement * wheelOccupancySummary = dbe->get(str.str());
151  if(wheelOccupancySummary != 0) {
152  int nFailingChambers = 0;
153  for(int sector=1; sector<=12; sector++){ // loop over sectors
154  for(int station = 1; station != 5; ++station) { // loop over stations
155  double chamberStatus = wheelOccupancySummary->getBinContent(sector, station);
156  LogTrace("DTDQM|DTMonitorClient|DTSummaryClients")
157  << "Wheel: " << wheel << " Stat: " << station << " Sect: " << sector << " status: " << chamberStatus << endl;
158  if(chamberStatus != 4) {
159  summaryReportMap->Fill(sector, wheel, 0.25);
160  } else {
161  nFailingChambers++;
162  }
163  LogTrace("DTDQM|DTMonitorClient|DTSummaryClients") << " sector (" << sector << ") status on the map is: "
164  << summaryReportMap->getBinContent(sector, wheel+3) << endl;
165  }
166 
167  }
168  theSummaryContents[wheel+2]->Fill((48.-nFailingChambers)/48.);
169  totalStatus += (48.-nFailingChambers)/48.;
170  } else {
171  occupancyFound = false;
172  LogError("DTDQM|DTMonitorClient|DTSummaryClients")<< " Wheel Occupancy Summary not found with name: " << str.str() << endl;
173  }
174  }
175 
176 
177  if(occupancyFound && !noDTData)
178  summaryReport->Fill(totalStatus/5.);
179 
180 // cout << "-----------------------------------------------------------------------------" << endl;
181 // cout << " In the endLuminosityBlock: " << endl;
182 // for(int wheel = -2; wheel != 3; ++wheel) {
183 // for(int sector = 1; sector != 13; sector++) {
184 // cout << " wheel: " << wheel << " sector: " << sector << " status on the map is: "
185 // << summaryReportMap->getBinContent(sector, wheel+3) << endl;
186 // }
187 // }
188 // cout << "-----------------------------------------------------------------------------" << endl;
189 
190 
191 }
MonitorElement * summaryReport
MonitorElement * summaryReportMap
int ii
Definition: cuy.py:588
void Fill(long long x)
#define LogTrace(id)
double getBinContent(int binx) const
get content of bin (1-D)
std::vector< MonitorElement * > theSummaryContents
void Reset(void)
reset ME (ie. contents, errors, etc)
void DTSummaryClients::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 79 of file DTSummaryClients.cc.

79  {
80 
81  LogVerbatim ("DTDQM|DTMonitorClient|DTSummaryClients") <<"[DTSummaryClients]: endRun";
82 
83 }

Member Data Documentation

DQMStore* DTSummaryClients::dbe
private

Definition at line 61 of file DTSummaryClients.h.

Referenced by beginRun(), DTSummaryClients(), and endLuminosityBlock().

int DTSummaryClients::nevents
private

Definition at line 60 of file DTSummaryClients.h.

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

MonitorElement* DTSummaryClients::summaryReport
private

Definition at line 63 of file DTSummaryClients.h.

Referenced by beginRun(), and endLuminosityBlock().

MonitorElement* DTSummaryClients::summaryReportMap
private

Definition at line 64 of file DTSummaryClients.h.

Referenced by beginRun(), and endLuminosityBlock().

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

Definition at line 65 of file DTSummaryClients.h.

Referenced by beginRun(), and endLuminosityBlock().