CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RPCDeadChannelTest Class Reference

#include <RPCDeadChannelTest.h>

Inheritance diagram for RPCDeadChannelTest:
RPCClient

Public Member Functions

void beginJob (std::string &) override
 
void clientOperation () override
 
void getMonitorElements (std::vector< MonitorElement * > &, std::vector< RPCDetId > &, std::string &) override
 
void myBooker (DQMStore::IBooker &) override
 
 RPCDeadChannelTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~RPCDeadChannelTest () override
 Destructor. More...
 
- Public Member Functions inherited from RPCClient
virtual ~RPCClient (void)
 

Private Attributes

MonitorElementDEADDisk [10]
 
MonitorElementDEADWheel [5]
 
std::string globalFolder_
 
std::vector< RPCDetIdmyDetIds_
 
std::vector< MonitorElement * > myOccupancyMe_
 
int numberOfDisks_
 
int numberOfRings_
 
int prescaleFactor_
 
bool useRollInfo_
 

Additional Inherited Members

- Public Types inherited from RPCClient
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 

Detailed Description

Definition at line 8 of file RPCDeadChannelTest.h.

Constructor & Destructor Documentation

◆ RPCDeadChannelTest()

RPCDeadChannelTest::RPCDeadChannelTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 13 of file RPCDeadChannelTest.cc.

13  {
14  edm::LogVerbatim("rpcdeadchanneltest") << "[RPCDeadChannelTest]: Constructor";
15 
16  useRollInfo_ = ps.getUntrackedParameter<bool>("UseRollInfo", false);
17 
18  prescaleFactor_ = ps.getUntrackedParameter<int>("DiagnosticPrescale", 1);
19  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
20  numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
21 }

References edm::ParameterSet::getUntrackedParameter(), numberOfDisks_, numberOfRings_, prescaleFactor_, and useRollInfo_.

◆ ~RPCDeadChannelTest()

RPCDeadChannelTest::~RPCDeadChannelTest ( )
override

Destructor.

Definition at line 23 of file RPCDeadChannelTest.cc.

23 {}

Member Function Documentation

◆ beginJob()

void RPCDeadChannelTest::beginJob ( std::string &  workingFolder)
overridevirtual

Implements RPCClient.

Definition at line 25 of file RPCDeadChannelTest.cc.

25  {
26  edm::LogVerbatim("rpcdeadchanneltest") << "[RPCDeadChannelTest]: Begin Job";
27  globalFolder_ = workingFolder;
28 }

References globalFolder_.

◆ clientOperation()

void RPCDeadChannelTest::clientOperation ( )
overridevirtual

Implements RPCClient.

Definition at line 43 of file RPCDeadChannelTest.cc.

43  {
44  edm::LogVerbatim("rpcdeadchanneltest") << "[RPCDeadChannelTest]:Client Operation";
45 
46  MonitorElement* DEAD = nullptr;
47 
48  //Loop on chambers
49  for (unsigned int i = 0; i < myOccupancyMe_.size(); i++) {
50  RPCDetId& detId = myDetIds_[i];
52 
53  if (!myMe)
54  continue;
55 
56  const QReport* theOccupancyQReport = myMe->getQReport("DeadChannel_0");
57 
58  float deadFraction = 0.0;
59 
60  if (theOccupancyQReport) {
61  float qtresult = theOccupancyQReport->getQTresult();
62  // std::vector<dqm::me_util::Channel> badChannels = theOccupancyQReport->getBadChannels();
63  deadFraction = 1.0 - qtresult;
64 
65  } else {
66  int xBins = myMe->getNbinsX();
67  float emptyBins = 0.0;
68  for (int x = 1; x <= xBins; x++) {
69  if (myMe->getBinContent(x) == 0) {
70  emptyBins++;
71  }
72  }
73  if (xBins != 0) {
74  deadFraction = emptyBins / xBins;
75  }
76  }
77 
78  if (detId.region() == 0)
79  DEAD = DEADWheel[detId.ring() + 2];
80  else {
81  if (-detId.station() + numberOfDisks_ >= 0) {
82  if (detId.region() < 0) {
83  DEAD = DEADDisk[-detId.station() + numberOfDisks_];
84  } else {
85  DEAD = DEADDisk[detId.station() + numberOfDisks_ - 1];
86  }
87  }
88  }
89 
90  if (DEAD) {
91  int xBin, yBin;
92  if (detId.region() == 0) { //Barrel
93  xBin = detId.sector();
94  rpcdqm::utils rollNumber;
95  yBin = rollNumber.detId2RollNr(detId);
96  } else { //Endcap
97  //get segment number
98  RPCGeomServ RPCServ(detId);
99  xBin = RPCServ.segment();
100  (numberOfRings_ == 3 ? yBin = detId.ring() * 3 - detId.roll() + 1
101  : yBin = (detId.ring() - 1) * 3 - detId.roll() + 1);
102  }
103  DEAD->setBinContent(xBin, yBin, deadFraction);
104  }
105 
106  } //End loop on rolls in given chambers
107 }

References L1DTConfigBti_cff::DEAD, DEADDisk, DEADWheel, rpcdqm::utils::detId2RollNr(), dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getNbinsX(), dqm::impl::MonitorElement::getQReport(), MonitorElementData::QReport::getQTresult(), mps_fire::i, myDetIds_, myOccupancyMe_, numberOfDisks_, numberOfRings_, RPCDetId::region(), RPCDetId::ring(), RPCDetId::roll(), RPCDetId::sector(), RPCGeomServ::segment(), RPCDetId::station(), x, photonAnalyzer_cfi::xBin, multiplicitycorr_cfi::xBins, and photonAnalyzer_cfi::yBin.

◆ getMonitorElements()

void RPCDeadChannelTest::getMonitorElements ( std::vector< MonitorElement * > &  meVector,
std::vector< RPCDetId > &  detIdVector,
std::string &  clientHistoName 
)
overridevirtual

Implements RPCClient.

Definition at line 30 of file RPCDeadChannelTest.cc.

32  {
33  for (unsigned int i = 0; i < meVector.size(); i++) {
34  std::string meName = meVector[i]->getName();
35 
36  if (meName.find(clientHistoName) != std::string::npos) {
37  myOccupancyMe_.push_back(meVector[i]);
38  myDetIds_.push_back(detIdVector[i]);
39  }
40  }
41 }

References mps_fire::i, myDetIds_, myOccupancyMe_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ myBooker()

void RPCDeadChannelTest::myBooker ( DQMStore::IBooker ibooker)
overridevirtual

Implements RPCClient.

Definition at line 109 of file RPCDeadChannelTest.cc.

109  {
111 
112  std::stringstream histoName;
113 
114  rpcdqm::utils rpcUtils;
115 
116  int limit = numberOfDisks_;
117  if (numberOfDisks_ < 2)
118  limit = 2;
119 
120  for (int i = -1 * limit; i <= limit; i++) { //loop on wheels and disks
121  if (i > -3 && i < 3) { //wheels
122  histoName.str("");
123  histoName << "DeadChannelFraction_Roll_vs_Sector_Wheel" << i;
124  DEADWheel[i + 2] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
125 
126  for (int x = 1; x <= 12; x++) {
127  for (int y = 1; y <= 21; y++) {
128  DEADWheel[i + 2]->setBinContent(x, y, -1);
129  }
130  }
131 
132  rpcUtils.labelXAxisSector(DEADWheel[i + 2]);
133  rpcUtils.labelYAxisRoll(DEADWheel[i + 2], 0, i, useRollInfo_);
134  } //end wheels
135 
136  if (i == 0 || i > numberOfDisks_ || i < (-1 * numberOfDisks_)) {
137  continue;
138  }
139 
140  int offset = numberOfDisks_;
141  if (i > 0) {
142  offset--;
143  } //used to skip case equale to zero
144 
145  histoName.str("");
146  histoName << "DeadChannelFraction_Ring_vs_Segment_Disk" << i;
147  DEADDisk[i + offset] = ibooker.book2D(histoName.str().c_str(),
148  histoName.str().c_str(),
149  36,
150  0.5,
151  36.5,
152  3 * numberOfRings_,
153  0.5,
154  3 * numberOfRings_ + 0.5);
155 
156  rpcUtils.labelXAxisSegment(DEADDisk[i + offset]);
158 
159  } //end loop on wheels and disks
160 }

References dqm::implementation::IBooker::book2D(), DEADDisk, DEADWheel, globalFolder_, HltBtagPostValidation_cff::histoName, mps_fire::i, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), remoteMonitoring_LED_IterMethod_cfg::limit, numberOfDisks_, numberOfRings_, hltrates_dqm_sourceclient-live_cfg::offset, dqm::impl::MonitorElement::setBinContent(), dqm::implementation::NavigatorBase::setCurrentFolder(), useRollInfo_, x, and y.

Member Data Documentation

◆ DEADDisk

MonitorElement* RPCDeadChannelTest::DEADDisk[10]
private

Definition at line 31 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), and myBooker().

◆ DEADWheel

MonitorElement* RPCDeadChannelTest::DEADWheel[5]
private

Definition at line 30 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), and myBooker().

◆ globalFolder_

std::string RPCDeadChannelTest::globalFolder_
private

Definition at line 23 of file RPCDeadChannelTest.h.

Referenced by beginJob(), and myBooker().

◆ myDetIds_

std::vector<RPCDetId> RPCDeadChannelTest::myDetIds_
private

Definition at line 25 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), and getMonitorElements().

◆ myOccupancyMe_

std::vector<MonitorElement *> RPCDeadChannelTest::myOccupancyMe_
private

Definition at line 24 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), and getMonitorElements().

◆ numberOfDisks_

int RPCDeadChannelTest::numberOfDisks_
private

Definition at line 28 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), myBooker(), and RPCDeadChannelTest().

◆ numberOfRings_

int RPCDeadChannelTest::numberOfRings_
private

Definition at line 29 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), myBooker(), and RPCDeadChannelTest().

◆ prescaleFactor_

int RPCDeadChannelTest::prescaleFactor_
private

Definition at line 22 of file RPCDeadChannelTest.h.

Referenced by RPCDeadChannelTest().

◆ useRollInfo_

bool RPCDeadChannelTest::useRollInfo_
private

Definition at line 26 of file RPCDeadChannelTest.h.

Referenced by myBooker(), and RPCDeadChannelTest().

rpcdqm::utils::labelXAxisSegment
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:247
DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:428
RPCGeomServ
Definition: RPCGeomServ.h:8
RPCDetId::station
int station() const
Definition: RPCDetId.h:78
RPCDetId::region
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
photonAnalyzer_cfi.xBin
xBin
Definition: photonAnalyzer_cfi.py:81
RPCDeadChannelTest::numberOfRings_
int numberOfRings_
Definition: RPCDeadChannelTest.h:29
RPCDetId
Definition: RPCDetId.h:16
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
rpcdqm::utils::labelYAxisRoll
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:265
photonAnalyzer_cfi.yBin
yBin
Definition: photonAnalyzer_cfi.py:85
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DDAxes::x
RPCDeadChannelTest::prescaleFactor_
int prescaleFactor_
Definition: RPCDeadChannelTest.h:22
L1DTConfigBti_cff.DEAD
DEAD
Definition: L1DTConfigBti_cff.py:7
rpcdqm::utils
Definition: utils.h:29
MonitorElementData::QReport::getQTresult
float getQTresult() const
get test result i.e. prob value
Definition: MonitorElementCollection.h:103
multiplicitycorr_cfi.xBins
xBins
Definition: multiplicitycorr_cfi.py:5
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
dqm::impl::MonitorElement::getQReport
const MonitorElementData::QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (null pointer if QReport does not exist)
Definition: MonitorElement.cc:481
RPCDetId::roll
int roll() const
Definition: RPCDetId.h:92
RPCDeadChannelTest::DEADWheel
MonitorElement * DEADWheel[5]
Definition: RPCDeadChannelTest.h:30
MonitorElementData::QReport
Definition: MonitorElementCollection.h:55
rpcdqm::utils::labelYAxisRing
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:291
RPCDeadChannelTest::myOccupancyMe_
std::vector< MonitorElement * > myOccupancyMe_
Definition: RPCDeadChannelTest.h:24
RPCDeadChannelTest::globalFolder_
std::string globalFolder_
Definition: RPCDeadChannelTest.h:23
rpcdqm::utils::detId2RollNr
int detId2RollNr(const RPCDetId &_id)
Definition: utils.h:31
RPCDeadChannelTest::numberOfDisks_
int numberOfDisks_
Definition: RPCDeadChannelTest.h:28
RPCDetId::ring
int ring() const
Definition: RPCDetId.h:59
RPCDeadChannelTest::myDetIds_
std::vector< RPCDetId > myDetIds_
Definition: RPCDeadChannelTest.h:25
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
remoteMonitoring_LED_IterMethod_cfg.limit
limit
Definition: remoteMonitoring_LED_IterMethod_cfg.py:427
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
dqm::impl::MonitorElement::getNbinsX
virtual int getNbinsX() const
get # of bins in X-axis
Definition: MonitorElement.cc:574
RPCDetId::sector
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
rpcdqm::utils::labelXAxisSector
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:231
HltBtagPostValidation_cff.histoName
histoName
Definition: HltBtagPostValidation_cff.py:17
RPCDeadChannelTest::useRollInfo_
bool useRollInfo_
Definition: RPCDeadChannelTest.h:26
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
RPCDeadChannelTest::DEADDisk
MonitorElement * DEADDisk[10]
Definition: RPCDeadChannelTest.h:31
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:592