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

Public Member Functions

 DTSummaryClients (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTSummaryClients ()
 Destructor. More...
 
- 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
 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 (const std::string &iProcessName, std::vector< const char * > &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 ()
 

Protected Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

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

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 36 of file DTSummaryClients.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 28 of file DTSummaryClients.cc.

References bookingdone.

28  : nevents(0) {
29 
30  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients") << "[DTSummaryClients]: Constructor";
31 
32  bookingdone = 0;
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::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 41 of file DTSummaryClients.cc.

41  {
42 
43  LogVerbatim ("DTDQM|DTMonitorClient|DTSummaryClients") <<"[DTSummaryClients]: endJob";
44 
45 }
void DTSummaryClients::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
protectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 47 of file DTSummaryClients.cc.

References DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), bookingdone, MonitorElement::Fill(), DQMStore::IGetter::get(), MonitorElement::getBinContent(), cuy::ii, LogTrace, MonitorElement::Reset(), MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), relativeConstraints::station, hcal_dqm_sourceclient-file_cfg::streams, summaryReport, summaryReportMap, and theSummaryContents.

48  {
49 
50  if (!bookingdone) {
51 
52  // book the summary histos
53 
54  ibooker.setCurrentFolder("DT/EventInfo");
55 
56  summaryReport = ibooker.bookFloat("reportSummary");
57  // Initialize to 1 so that no alarms are thrown at the beginning of the run
58  summaryReport->Fill(1.);
59 
60  summaryReportMap = ibooker.book2D("reportSummaryMap","DT Report Summary Map",12,1,13,5,-2,3);
61  summaryReportMap->setAxisTitle("sector",1);
62  summaryReportMap->setAxisTitle("wheel",2);
63 
64  ibooker.setCurrentFolder("DT/EventInfo/reportSummaryContents");
65 
66  for(int wheel = -2; wheel != 3; ++wheel) {
67  stringstream streams;
68  streams << "DT_Wheel" << wheel;
69  string meName = streams.str();
70 
71  theSummaryContents.push_back(ibooker.bookFloat(meName));
72  // Initialize to 1 so that no alarms are thrown at the beginning of the run
73  theSummaryContents[wheel+2]->Fill(1.);
74  }
75 
76 }
77  bookingdone = 1;
78 
79 
80  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients")
81  << "[DTSummaryClients]: End of LS transition, performing the DQM client operation" << endl;
82 
83  // reset the monitor elements
86  for(int ii = 0; ii != 5; ++ii) {
87  theSummaryContents[ii]->Reset();
88  }
89 
90  bool noDTData = false;
91 
92  // Check if DT data in each ROS have been read out and set the SummaryContents and the ErrorSummary
93  // accordignly
94  MonitorElement * dataIntegritySummary = igetter.get("DT/00-DataIntegrity/DataIntegritySummary");
95  if(dataIntegritySummary != 0) {
96  int nDisabledFED = 0;
97  for(int wheel = 1; wheel != 6; ++wheel) { // loop over the wheels
98  int nDisablesROS = 0;
99  for(int sect = 1; sect != 13; ++sect) { // loop over sectors
100  if(dataIntegritySummary->getBinContent(sect,wheel) == 1) {
101  nDisablesROS++;
102  }
103  }
104  if(nDisablesROS == 12) {
105  nDisabledFED++;
106  theSummaryContents[wheel-1]->Fill(0);
107  }
108  }
109 
110  if(nDisabledFED == 5) {
111  noDTData = true;
112  summaryReport->Fill(-1);
113  }
114 
115  } else {
116  LogError("DTDQM|DTMonitorClient|DTSummaryClients")
117  << "Data Integrity Summary not found with name: DT/00-DataIntegrity/DataIntegritySummary" <<endl;
118  }
119 
120  double totalStatus = 0;
121  // protection
122  bool occupancyFound = true;
123 
124  // Fill the map using, at the moment, only the information from DT occupancy
125  // problems at a granularity smaller than the chamber are ignored
126  for(int wheel=-2; wheel<=2; wheel++){ // loop over wheels
127  // retrieve the occupancy summary
128  stringstream str;
129  str << "DT/01-Digi/OccupancySummary_W" << wheel;
130  MonitorElement * wheelOccupancySummary = igetter.get(str.str());
131  if(wheelOccupancySummary != 0) {
132  int nFailingChambers = 0;
133  for(int sector=1; sector<=12; sector++){ // loop over sectors
134  for(int station = 1; station != 5; ++station) { // loop over stations
135  double chamberStatus = wheelOccupancySummary->getBinContent(sector, station);
136  LogTrace("DTDQM|DTMonitorClient|DTSummaryClients")
137  << "Wheel: " << wheel << " Stat: " << station << " Sect: " << sector << " status: " << chamberStatus << endl;
138  if(chamberStatus != 4) {
139  summaryReportMap->Fill(sector, wheel, 0.25);
140  } else {
141  nFailingChambers++;
142  }
143  LogTrace("DTDQM|DTMonitorClient|DTSummaryClients") << " sector (" << sector << ") status on the map is: "
144  << summaryReportMap->getBinContent(sector, wheel+3) << endl;
145  }
146 
147  }
148  theSummaryContents[wheel+2]->Fill((48.-nFailingChambers)/48.);
149  totalStatus += (48.-nFailingChambers)/48.;
150  } else {
151  occupancyFound = false;
152  LogError("DTDQM|DTMonitorClient|DTSummaryClients")<< " Wheel Occupancy Summary not found with name: " << str.str() << endl;
153  }
154  }
155 
156 
157  if(occupancyFound && !noDTData)
158  summaryReport->Fill(totalStatus/5.);
159 
160 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
MonitorElement * summaryReport
MonitorElement * summaryReportMap
int ii
Definition: cuy.py:588
void Fill(long long x)
#define LogTrace(id)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
double getBinContent(int binx) const
get content of bin (1-D)
std::vector< MonitorElement * > theSummaryContents
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)

Member Data Documentation

bool DTSummaryClients::bookingdone
private

Definition at line 60 of file DTSummaryClients.h.

Referenced by dqmEndLuminosityBlock(), and DTSummaryClients().

int DTSummaryClients::nevents
private

Definition at line 54 of file DTSummaryClients.h.

Referenced by ~DTSummaryClients().

MonitorElement* DTSummaryClients::summaryReport
private

Definition at line 56 of file DTSummaryClients.h.

Referenced by dqmEndLuminosityBlock().

MonitorElement* DTSummaryClients::summaryReportMap
private

Definition at line 57 of file DTSummaryClients.h.

Referenced by dqmEndLuminosityBlock().

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

Definition at line 58 of file DTSummaryClients.h.

Referenced by dqmEndLuminosityBlock().