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)
 
 ~RPCDeadChannelTest () override=default
 
- 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)

Definition at line 12 of file RPCDeadChannelTest.cc.

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

12  {
13  edm::LogVerbatim("rpcdeadchanneltest") << "[RPCDeadChannelTest]: Constructor";
14 
15  useRollInfo_ = ps.getUntrackedParameter<bool>("UseRollInfo", false);
16 
17  prescaleFactor_ = ps.getUntrackedParameter<int>("DiagnosticPrescale", 1);
18  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
19  numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
20 }
Log< level::Info, true > LogVerbatim
T getUntrackedParameter(std::string const &, T const &) const

◆ ~RPCDeadChannelTest()

RPCDeadChannelTest::~RPCDeadChannelTest ( )
overridedefault

Member Function Documentation

◆ beginJob()

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

Implements RPCClient.

Definition at line 22 of file RPCDeadChannelTest.cc.

References globalFolder_.

22  {
23  edm::LogVerbatim("rpcdeadchanneltest") << "[RPCDeadChannelTest]: Begin Job";
24  globalFolder_ = workingFolder;
25 }
Log< level::Info, true > LogVerbatim

◆ clientOperation()

void RPCDeadChannelTest::clientOperation ( )
overridevirtual

Implements RPCClient.

Definition at line 40 of file RPCDeadChannelTest.cc.

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.

40  {
41  edm::LogVerbatim("rpcdeadchanneltest") << "[RPCDeadChannelTest]:Client Operation";
42 
43  MonitorElement* DEAD = nullptr;
44 
45  //Loop on chambers
46  for (unsigned int i = 0; i < myOccupancyMe_.size(); i++) {
47  RPCDetId& detId = myDetIds_[i];
49 
50  if (!myMe)
51  continue;
52 
53  const QReport* theOccupancyQReport = myMe->getQReport("DeadChannel_0");
54 
55  float deadFraction = 0.0;
56 
57  if (theOccupancyQReport) {
58  float qtresult = theOccupancyQReport->getQTresult();
59  // std::vector<dqm::me_util::Channel> badChannels = theOccupancyQReport->getBadChannels();
60  deadFraction = 1.0 - qtresult;
61 
62  } else {
63  int xBins = myMe->getNbinsX();
64  float emptyBins = 0.0;
65  for (int x = 1; x <= xBins; x++) {
66  if (myMe->getBinContent(x) == 0) {
67  emptyBins++;
68  }
69  }
70  if (xBins != 0) {
71  deadFraction = emptyBins / xBins;
72  }
73  }
74 
75  if (detId.region() == 0)
76  DEAD = DEADWheel[detId.ring() + 2];
77  else {
78  if (-detId.station() + numberOfDisks_ >= 0) {
79  if (detId.region() < 0) {
80  DEAD = DEADDisk[-detId.station() + numberOfDisks_];
81  } else {
82  DEAD = DEADDisk[detId.station() + numberOfDisks_ - 1];
83  }
84  }
85  }
86 
87  if (DEAD) {
88  int xBin, yBin;
89  if (detId.region() == 0) { //Barrel
90  xBin = detId.sector();
91  rpcdqm::utils rollNumber;
92  yBin = rollNumber.detId2RollNr(detId);
93  } else { //Endcap
94  //get segment number
95  RPCGeomServ RPCServ(detId);
96  xBin = RPCServ.segment();
97  (numberOfRings_ == 3 ? yBin = detId.ring() * 3 - detId.roll() + 1
98  : yBin = (detId.ring() - 1) * 3 - detId.roll() + 1);
99  }
100  DEAD->setBinContent(xBin, yBin, deadFraction);
101  }
102 
103  } //End loop on rolls in given chambers
104 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
Log< level::Info, true > LogVerbatim
MonitorElement * DEADWheel[5]
float getQTresult() const
get test result i.e. prob value
int ring() const
Definition: RPCDetId.h:59
const MonitorElementData::QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (null pointer if QReport does not exist)
int roll() const
Definition: RPCDetId.h:92
std::vector< MonitorElement * > myOccupancyMe_
int detId2RollNr(const RPCDetId &_id)
Definition: utils.h:31
std::vector< RPCDetId > myDetIds_
int station() const
Definition: RPCDetId.h:78
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
virtual int getNbinsX() const
get # of bins in X-axis
MonitorElement * DEADDisk[10]
virtual double getBinContent(int binx) const
get content of bin (1-D)

◆ getMonitorElements()

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

Implements RPCClient.

Definition at line 27 of file RPCDeadChannelTest.cc.

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

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

◆ myBooker()

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

Implements RPCClient.

Definition at line 106 of file RPCDeadChannelTest.cc.

References RPCRollMapHisto::bookBarrel(), RPCRollMapHisto::bookEndcap(), DEADDisk, DEADWheel, globalFolder_, HltBtagPostValidation_cff::histoName, mps_fire::i, remoteMonitoring_LASER_era2018_cfg::limit, hlt_dqm_clientPB-live_cfg::me, numberOfDisks_, hltrates_dqm_sourceclient-live_cfg::offset, dqm::impl::MonitorElement::setBinContent(), dqm::implementation::NavigatorBase::setCurrentFolder(), useRollInfo_, x, and y.

106  {
108 
109  std::stringstream histoName;
110 
111  int limit = numberOfDisks_;
112  if (numberOfDisks_ < 2)
113  limit = 2;
114 
115  for (int i = -1 * limit; i <= limit; i++) { //loop on wheels and disks
116  if (i > -3 && i < 3) { //wheels
117  histoName.str("");
118  histoName << "DeadChannelFraction_Roll_vs_Sector_Wheel" << i;
119  auto me = RPCRollMapHisto::bookBarrel(ibooker, i, histoName.str(), histoName.str(), useRollInfo_);
120  DEADWheel[i + 2] = dynamic_cast<MonitorElement*>(me);
121 
122  for (int x = 1; x <= 12; x++) {
123  for (int y = 1; y <= 21; y++) {
124  DEADWheel[i + 2]->setBinContent(x, y, -1);
125  }
126  }
127 
128  } //end wheels
129 
130  if (i == 0 || i > numberOfDisks_ || i < (-1 * numberOfDisks_)) {
131  continue;
132  }
133 
134  int offset = numberOfDisks_;
135  if (i > 0) {
136  offset--;
137  } //used to skip case equale to zero
138 
139  histoName.str("");
140  histoName << "DeadChannelFraction_Ring_vs_Segment_Disk" << i;
141  auto me = RPCRollMapHisto::bookEndcap(ibooker, i, histoName.str(), histoName.str(), useRollInfo_);
142  DEADDisk[i + offset] = dynamic_cast<MonitorElement*>(me);
143  } //end loop on wheels and disks
144 }
MonitorElement * DEADWheel[5]
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
static MonitorElement * bookBarrel(IBooker &booker, const int wheel, const std::string &prefix, const std::string &title, const bool useRollInfo)
MonitorElement * DEADDisk[10]
static MonitorElement * bookEndcap(IBooker &booker, const int disk, const std::string &prefix, const std::string &title, const bool useRollInfo)

Member Data Documentation

◆ DEADDisk

MonitorElement* RPCDeadChannelTest::DEADDisk[10]
private

Definition at line 28 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), and myBooker().

◆ DEADWheel

MonitorElement* RPCDeadChannelTest::DEADWheel[5]
private

Definition at line 27 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), and myBooker().

◆ globalFolder_

std::string RPCDeadChannelTest::globalFolder_
private

Definition at line 20 of file RPCDeadChannelTest.h.

Referenced by beginJob(), and myBooker().

◆ myDetIds_

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

Definition at line 22 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), and getMonitorElements().

◆ myOccupancyMe_

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

Definition at line 21 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), and getMonitorElements().

◆ numberOfDisks_

int RPCDeadChannelTest::numberOfDisks_
private

Definition at line 25 of file RPCDeadChannelTest.h.

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

◆ numberOfRings_

int RPCDeadChannelTest::numberOfRings_
private

Definition at line 26 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), and RPCDeadChannelTest().

◆ prescaleFactor_

int RPCDeadChannelTest::prescaleFactor_
private

Definition at line 19 of file RPCDeadChannelTest.h.

Referenced by RPCDeadChannelTest().

◆ useRollInfo_

bool RPCDeadChannelTest::useRollInfo_
private

Definition at line 23 of file RPCDeadChannelTest.h.

Referenced by myBooker(), and RPCDeadChannelTest().