CMS 3D CMS Logo

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

#include <RPCNoisyStripTest.h>

Inheritance diagram for RPCNoisyStripTest:
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
 
 RPCNoisyStripTest (const edm::ParameterSet &ps)
 
 ~RPCNoisyStripTest () override=default
 
- Public Member Functions inherited from RPCClient
virtual ~RPCClient (void)
 

Protected Member Functions

void fillGlobalME (RPCDetId &, MonitorElement *)
 

Private Attributes

MonitorElementDEVDDisk [10]
 
MonitorElementDEVDWheel [5]
 
std::string globalFolder_
 
std::vector< RPCDetIdmyDetIds_
 
std::vector< MonitorElement * > myOccupancyMe_
 
MonitorElementNOISEDDisk [10]
 
MonitorElementNOISEDisk [10]
 
MonitorElementNOISEDWheel [5]
 
MonitorElementNOISEWheel [5]
 
int numberOfDisks_
 
int numberOfRings_
 
int prescaleFactor_
 
bool testMode_
 
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 RPCNoisyStripTest.h.

Constructor & Destructor Documentation

◆ RPCNoisyStripTest()

RPCNoisyStripTest::RPCNoisyStripTest ( const edm::ParameterSet ps)

Definition at line 8 of file RPCNoisyStripTest.cc.

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

8  {
9  edm::LogVerbatim("rpcnoisetest") << "[RPCNoisyStripTest]: Constructor";
10 
11  prescaleFactor_ = ps.getUntrackedParameter<int>("DiagnosticPrescale", 1);
12  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
13  numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
14  useRollInfo_ = ps.getUntrackedParameter<bool>("UseRollInfo", false);
15  testMode_ = ps.getUntrackedParameter<bool>("testMode", false);
16 }
Log< level::Info, true > LogVerbatim
T getUntrackedParameter(std::string const &, T const &) const

◆ ~RPCNoisyStripTest()

RPCNoisyStripTest::~RPCNoisyStripTest ( )
overridedefault

Member Function Documentation

◆ beginJob()

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

Implements RPCClient.

Definition at line 18 of file RPCNoisyStripTest.cc.

References globalFolder_.

18  {
19  edm::LogVerbatim("rpcnoisetest") << "[RPCNoisyStripTest]: Begin job ";
20  globalFolder_ = workingFolder;
21 }
Log< level::Info, true > LogVerbatim
std::string globalFolder_

◆ clientOperation()

void RPCNoisyStripTest::clientOperation ( )
overridevirtual

Implements RPCClient.

Definition at line 23 of file RPCNoisyStripTest.cc.

References fillGlobalME(), mps_fire::i, myDetIds_, and myOccupancyMe_.

23  {
24  edm::LogVerbatim("rpcnoisetest") << "[RPCNoisyStripTest]: Client Operation";
25 
26  //Loop on MEs
27  for (unsigned int i = 0; i < myOccupancyMe_.size(); i++) {
29  } //End loop on MEs
30 }
Log< level::Info, true > LogVerbatim
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myOccupancyMe_
void fillGlobalME(RPCDetId &, MonitorElement *)

◆ fillGlobalME()

void RPCNoisyStripTest::fillGlobalME ( RPCDetId detId,
MonitorElement myMe 
)
protected

Definition at line 95 of file RPCNoisyStripTest.cc.

References isotrackApplyRegressor::bins, hcalRecHitTable_cff::detId, rpcdqm::utils::detId2RollNr(), DEVDDisk, DEVDWheel, dqm::impl::MonitorElement::Fill(), dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getEntries(), dqm::impl::MonitorElement::getNbinsX(), mps_fire::i, createfilelist::int, sistrip::NOISE, NOISEDDisk, NOISEDisk, NOISEDWheel, NOISEWheel, numberOfDisks_, numberOfRings_, RPCGeomServ::segment(), testMode_, photonAnalyzer_cfi::xBin, and photonAnalyzer_cfi::yBin.

Referenced by clientOperation().

95  {
96  std::stringstream meName;
97 
98  MonitorElement* NOISE = nullptr;
99  MonitorElement* DEVD = nullptr;
100  MonitorElement* NOISED = nullptr;
101 
102  if (detId.region() == 0) { //BARREL
103  NOISE = NOISEWheel[detId.ring() + 2];
104  if (testMode_) {
105  DEVD = DEVDWheel[detId.ring() + 2];
106  NOISED = NOISEDWheel[detId.ring() + 2];
107  }
108  } else if (detId.region() < 0 && (-detId.station() + numberOfDisks_) >= 0) { //ENDCAP-
109  NOISE = NOISEDisk[-detId.station() + numberOfDisks_];
110  if (testMode_) {
111  DEVD = DEVDDisk[-detId.station() + numberOfDisks_];
112  NOISED = NOISEDDisk[-detId.station() + numberOfDisks_];
113  }
114  } else if ((-detId.station() + numberOfDisks_) >= 0) { //ENDCAP +
115  NOISE = NOISEDisk[detId.station() + numberOfDisks_ - 1];
116  if (testMode_) {
117  DEVD = DEVDDisk[detId.station() + numberOfDisks_ - 1];
118  NOISED = NOISEDDisk[detId.station() + numberOfDisks_ - 1];
119  }
120  }
121 
122  int entries = (int)myMe->getEntries();
123  int bins = (int)myMe->getNbinsX();
124 
125  std::vector<float> myvector;
126 
127  // count alive strips and alive strip values put in the vector
128  for (int xbin = 1; xbin <= bins; xbin++) {
129  float binContent = myMe->getBinContent(xbin);
130  if (binContent > 0)
131  myvector.push_back(binContent);
132  }
133 
134  int noisyStrips = 0;
135  // calculate mean on YAxis and check diff between bins and mean
136  if (!myvector.empty()) {
137  float ymean = entries / myvector.size(); //mean on Yaxis
138  for (unsigned int i = 0; i < myvector.size(); i++) {
139  float deviation = myvector[i] / ymean;
140  if (deviation > 3.5)
141  noisyStrips++;
142  if (deviation > 5)
143  deviation = 5; //overflow
144  if (DEVD)
145  DEVD->Fill(deviation);
146  }
147 
148  int xBin, yBin;
149  if (detId.region() == 0) { //Barrel
150  xBin = detId.sector();
151  rpcdqm::utils rollNumber;
152  yBin = rollNumber.detId2RollNr(detId);
153  } else { //Endcap
154  //get segment number
155  RPCGeomServ RPCServ(detId);
156  xBin = RPCServ.segment();
157  (numberOfRings_ == 3 ? yBin = detId.ring() * 3 - detId.roll() + 1
158  : yBin = (detId.ring() - 1) * 3 - detId.roll() + 1);
159  }
160 
161  if (NOISE)
162  NOISE->setBinContent(xBin, yBin, noisyStrips);
163  if (NOISED)
164  NOISED->Fill(noisyStrips);
165  }
166 }
MonitorElement * NOISEDDisk[10]
void Fill(long long x)
MonitorElement * NOISEDWheel[5]
virtual double getEntries() const
get # of entries
MonitorElement * DEVDWheel[5]
int detId2RollNr(const RPCDetId &_id)
Definition: utils.h:31
MonitorElement * NOISEDisk[10]
virtual int getNbinsX() const
get # of bins in X-axis
MonitorElement * DEVDDisk[10]
MonitorElement * NOISEWheel[5]
virtual double getBinContent(int binx) const
get content of bin (1-D)

◆ getMonitorElements()

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

Implements RPCClient.

Definition at line 81 of file RPCNoisyStripTest.cc.

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

83  {
84  //Get NumberOfDigi ME for each roll
85  for (unsigned int i = 0; i < meVector.size(); i++) {
86  std::string meName = meVector[i]->getName();
87 
88  if (meName.find(clientHistoName) != std::string::npos) {
89  myOccupancyMe_.push_back(meVector[i]);
90  myDetIds_.push_back(detIdVector[i]);
91  }
92  }
93 }
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myOccupancyMe_

◆ myBooker()

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

Implements RPCClient.

Definition at line 32 of file RPCNoisyStripTest.cc.

References dqm::implementation::IBooker::book1D(), RPCRollMapHisto::bookBarrel(), RPCRollMapHisto::bookEndcap(), ztail::d, DEVDDisk, DEVDWheel, globalFolder_, HltBtagPostValidation_cff::histoName, hlt_dqm_clientPB-live_cfg::me, NOISEDDisk, NOISEDisk, NOISEDWheel, NOISEWheel, numberOfDisks_, HLT_IsoTrack_cff::offset, dqm::implementation::NavigatorBase::setCurrentFolder(), testMode_, useRollInfo_, and w().

32  {
34 
35  std::stringstream histoName;
36 
37  for (int w = -2; w <= 2; w++) { //loop on wheels and disks
38 
39  if (testMode_) {
40  histoName.str("");
41  histoName << "RPCNoisyStrips_Distribution_Wheel" << w;
42  NOISEDWheel[w + 2] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 6, -0.5, 5.5);
43 
44  histoName.str("");
45  histoName << "RPCStripsDeviation_Distribution_Wheel" << w;
46  DEVDWheel[w + 2] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 101, -0.01, 10.01);
47  }
48 
49  histoName.str("");
50  histoName << "RPCNoisyStrips_Roll_vs_Sector_Wheel" << w;
51  auto me = RPCRollMapHisto::bookBarrel(ibooker, w, histoName.str(), histoName.str(), useRollInfo_);
52  NOISEWheel[w + 2] = dynamic_cast<MonitorElement*>(me);
53  }
54 
55  for (int d = -numberOfDisks_; d <= numberOfDisks_; d++) { //ENDCAP
56 
57  if (d == 0)
58  continue;
59 
60  int offset = numberOfDisks_;
61  if (d > 0)
62  offset--;
63 
64  if (testMode_) {
65  histoName.str("");
66  histoName << "RPCNoisyStrips_Distribution_Disk" << d;
67  NOISEDDisk[d + offset] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 6, -0.5, 5.5);
68 
69  histoName.str("");
70  histoName << "RPCStripsDeviation_Distribution_Disk" << d;
71  DEVDDisk[d + offset] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 101, -0.01, 10.01);
72  }
73 
74  histoName.str("");
75  histoName << "RPCNoisyStrips_Ring_vs_Segment_Disk" << d;
76  auto me = RPCRollMapHisto::bookEndcap(ibooker, d, histoName.str(), histoName.str(), useRollInfo_);
77  NOISEDisk[d + offset] = dynamic_cast<MonitorElement*>(me);
78  }
79 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
T w() const
MonitorElement * NOISEDDisk[10]
std::string globalFolder_
MonitorElement * NOISEDWheel[5]
d
Definition: ztail.py:151
MonitorElement * DEVDWheel[5]
MonitorElement * NOISEDisk[10]
static MonitorElement * bookBarrel(IBooker &booker, const int wheel, const std::string &prefix, const std::string &title, const bool useRollInfo)
MonitorElement * DEVDDisk[10]
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
static MonitorElement * bookEndcap(IBooker &booker, const int disk, const std::string &prefix, const std::string &title, const bool useRollInfo)
MonitorElement * NOISEWheel[5]

Member Data Documentation

◆ DEVDDisk

MonitorElement* RPCNoisyStripTest::DEVDDisk[10]
private

Definition at line 35 of file RPCNoisyStripTest.h.

Referenced by fillGlobalME(), and myBooker().

◆ DEVDWheel

MonitorElement* RPCNoisyStripTest::DEVDWheel[5]
private

Definition at line 31 of file RPCNoisyStripTest.h.

Referenced by fillGlobalME(), and myBooker().

◆ globalFolder_

std::string RPCNoisyStripTest::globalFolder_
private

Definition at line 21 of file RPCNoisyStripTest.h.

Referenced by beginJob(), and myBooker().

◆ myDetIds_

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

Definition at line 27 of file RPCNoisyStripTest.h.

Referenced by clientOperation(), and getMonitorElements().

◆ myOccupancyMe_

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

Definition at line 26 of file RPCNoisyStripTest.h.

Referenced by clientOperation(), and getMonitorElements().

◆ NOISEDDisk

MonitorElement* RPCNoisyStripTest::NOISEDDisk[10]
private

Definition at line 34 of file RPCNoisyStripTest.h.

Referenced by fillGlobalME(), and myBooker().

◆ NOISEDisk

MonitorElement* RPCNoisyStripTest::NOISEDisk[10]
private

Definition at line 33 of file RPCNoisyStripTest.h.

Referenced by fillGlobalME(), and myBooker().

◆ NOISEDWheel

MonitorElement* RPCNoisyStripTest::NOISEDWheel[5]
private

Definition at line 30 of file RPCNoisyStripTest.h.

Referenced by fillGlobalME(), and myBooker().

◆ NOISEWheel

MonitorElement* RPCNoisyStripTest::NOISEWheel[5]
private

Definition at line 29 of file RPCNoisyStripTest.h.

Referenced by fillGlobalME(), and myBooker().

◆ numberOfDisks_

int RPCNoisyStripTest::numberOfDisks_
private

Definition at line 36 of file RPCNoisyStripTest.h.

Referenced by fillGlobalME(), myBooker(), and RPCNoisyStripTest().

◆ numberOfRings_

int RPCNoisyStripTest::numberOfRings_
private

Definition at line 22 of file RPCNoisyStripTest.h.

Referenced by fillGlobalME(), and RPCNoisyStripTest().

◆ prescaleFactor_

int RPCNoisyStripTest::prescaleFactor_
private

Definition at line 23 of file RPCNoisyStripTest.h.

Referenced by RPCNoisyStripTest().

◆ testMode_

bool RPCNoisyStripTest::testMode_
private

Definition at line 24 of file RPCNoisyStripTest.h.

Referenced by fillGlobalME(), myBooker(), and RPCNoisyStripTest().

◆ useRollInfo_

bool RPCNoisyStripTest::useRollInfo_
private

Definition at line 28 of file RPCNoisyStripTest.h.

Referenced by myBooker(), and RPCNoisyStripTest().