CMS 3D CMS Logo

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

#include <RPCOccupancyTest.h>

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

Protected Member Functions

void fillGlobalME (RPCDetId &, MonitorElement *)
 

Private Attributes

MonitorElementActive_Dead
 
MonitorElementActive_Fraction
 
MonitorElementAsyMeDisk [10]
 
MonitorElementAsyMeWheel [5]
 
MonitorElementBarrel_OccBySt
 
MonitorElementEndCap_OccByDisk
 
MonitorElementEndCap_OccByRng
 
std::string globalFolder_
 
std::vector< RPCDetIdmyDetIds_
 
std::vector< MonitorElement * > myOccupancyMe_
 
MonitorElementNormOccupDDisk [10]
 
MonitorElementNormOccupDisk [10]
 
MonitorElementNormOccupDWheel [5]
 
MonitorElementNormOccupWheel [5]
 
int numberOfDisks_
 
int numberOfRings_
 
std::string prefixDir_
 
int prescaleFactor_
 
float rpcevents_
 
float totalActive_
 
float totalStrips_
 
bool useNormalization_
 
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 12 of file RPCOccupancyTest.h.

Constructor & Destructor Documentation

◆ RPCOccupancyTest()

RPCOccupancyTest::RPCOccupancyTest ( const edm::ParameterSet ps)

Definition at line 12 of file RPCOccupancyTest.cc.

12  {
13  edm::LogVerbatim("rpceventsummary") << "[RPCOccupancyTest]: Constructor";
14 
15  prescaleFactor_ = ps.getUntrackedParameter<int>("DiagnosticPrescale", 1);
16  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
17  numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
18  useNormalization_ = ps.getUntrackedParameter<bool>("testMode", true);
19  useRollInfo_ = ps.getUntrackedParameter<bool>("useRollInfo_", false);
20 
21  std::string subsystemFolder = ps.getUntrackedParameter<std::string>("RPCFolder", "RPC");
22  std::string recHitTypeFolder = ps.getUntrackedParameter<std::string>("RecHitTypeFolder", "AllHits");
23 
24  prefixDir_ = subsystemFolder + "/" + recHitTypeFolder;
25 }

References edm::ParameterSet::getUntrackedParameter(), numberOfDisks_, numberOfRings_, prefixDir_, prescaleFactor_, AlCaHLTBitMon_QueryRunRegistry::string, useNormalization_, and useRollInfo_.

◆ ~RPCOccupancyTest()

RPCOccupancyTest::~RPCOccupancyTest ( )
override

Definition at line 27 of file RPCOccupancyTest.cc.

27 {}

Member Function Documentation

◆ beginJob()

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

Implements RPCClient.

Definition at line 29 of file RPCOccupancyTest.cc.

29  {
30  edm::LogVerbatim("rpceventsummary") << "[RPCOccupancyTest]: Begin job ";
31  globalFolder_ = workingFolder;
32 
33  totalStrips_ = 0.;
34  totalActive_ = 0.;
35 }

References globalFolder_, totalActive_, and totalStrips_.

◆ clientOperation()

void RPCOccupancyTest::clientOperation ( )
overridevirtual

Implements RPCClient.

Definition at line 51 of file RPCOccupancyTest.cc.

51  {
52  edm::LogVerbatim("rpceventsummary") << "[RPCOccupancyTest]: Client Operation";
53 
54  //Loop on MEs
55  for (unsigned int i = 0; i < myOccupancyMe_.size(); i++) {
57  } //End loop on MEs
58 
59  //Active Channels
60  if (Active_Fraction && totalStrips_ != 0.) {
62  }
63  if (Active_Dead) {
66  }
67 }

References Active_Dead, Active_Fraction, fillGlobalME(), mps_fire::i, myDetIds_, myOccupancyMe_, dqm::impl::MonitorElement::setBinContent(), totalActive_, and totalStrips_.

◆ fillGlobalME()

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

Definition at line 123 of file RPCOccupancyTest.cc.

123  {
124  if (!myMe)
125  return;
126 
127  MonitorElement* AsyMe = nullptr; //Left Right Asymetry
128 
129  if (detId.region() == 0) {
130  AsyMe = AsyMeWheel[detId.ring() + 2];
131 
132  } else {
133  if (-detId.station() + numberOfDisks_ >= 0) {
134  if (detId.region() < 0) {
135  AsyMe = AsyMeDisk[-detId.station() + numberOfDisks_];
136  } else {
137  AsyMe = AsyMeDisk[detId.station() + numberOfDisks_ - 1];
138  }
139  }
140  }
141 
142  int xBin, yBin;
143  if (detId.region() == 0) { //Barrel
144  xBin = detId.sector();
145  rpcdqm::utils rollNumber;
146  yBin = rollNumber.detId2RollNr(detId);
147  } else { //Endcap
148  //get segment number
149  RPCGeomServ RPCServ(detId);
150  xBin = RPCServ.segment();
151  (numberOfRings_ == 3 ? yBin = detId.ring() * 3 - detId.roll() + 1
152  : yBin = (detId.ring() - 1) * 3 - detId.roll() + 1);
153  }
154 
155  int stripInRoll = myMe->getNbinsX();
156  totalStrips_ += (float)stripInRoll;
157  float FOccupancy = 0;
158  float BOccupancy = 0;
159 
160  float totEnt = myMe->getEntries();
161  for (int strip = 1; strip <= stripInRoll; strip++) {
162  float stripEntries = myMe->getBinContent(strip);
163  if (stripEntries > 0) {
164  totalActive_++;
165  }
166  if (strip <= stripInRoll / 2) {
167  FOccupancy += myMe->getBinContent(strip);
168  } else {
169  BOccupancy += myMe->getBinContent(strip);
170  }
171  }
172 
173  float asym = 0;
174  if (totEnt != 0)
175  asym = fabs((FOccupancy - BOccupancy) / totEnt);
176 
177  if (AsyMe)
178  AsyMe->setBinContent(xBin, yBin, asym);
179 }

References AsyMeDisk, AsyMeWheel, rpcdqm::utils::detId2RollNr(), dqmMemoryStats::float, dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getEntries(), dqm::impl::MonitorElement::getNbinsX(), numberOfDisks_, numberOfRings_, RPCDetId::region(), RPCDetId::ring(), RPCDetId::roll(), RPCDetId::sector(), RPCGeomServ::segment(), dqm::impl::MonitorElement::setBinContent(), RPCDetId::station(), digitizers_cfi::strip, totalActive_, totalStrips_, photonAnalyzer_cfi::xBin, and photonAnalyzer_cfi::yBin.

Referenced by clientOperation().

◆ getMonitorElements()

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

Implements RPCClient.

Definition at line 37 of file RPCOccupancyTest.cc.

39  {
40  //Get NumberOfDigi ME for each roll
41  for (unsigned int i = 0; i < meVector.size(); i++) {
42  std::string meName = meVector[i]->getName();
43 
44  if (meName.find(clientHistoName) != std::string::npos) {
45  myOccupancyMe_.push_back(meVector[i]);
46  myDetIds_.push_back(detIdVector[i]);
47  }
48  }
49 }

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

◆ myBooker()

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

Implements RPCClient.

Definition at line 69 of file RPCOccupancyTest.cc.

69  {
71 
72  std::stringstream histoName;
73  rpcdqm::utils rpcUtils;
74 
75  histoName.str("");
76  histoName << "RPC_Active_Channel_Fractions";
77  Active_Fraction = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 1, 0.5, 1.5);
78  Active_Fraction->setBinLabel(1, "Active Fraction", 1);
79 
80  histoName.str("");
81  histoName << "RPC_Active_Inactive_Strips";
82  Active_Dead = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 2, 0.5, 2.5);
83  Active_Dead->setBinLabel(1, "Active Strips", 1);
84  Active_Dead->setBinLabel(2, "Inactive Strips", 1);
85 
86  for (int w = -2; w <= 2; w++) { //loop on wheels
87 
88  histoName.str("");
89  histoName << "AsymmetryLeftRight_Roll_vs_Sector_Wheel" << w;
90 
91  AsyMeWheel[w + 2] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
92 
93  rpcUtils.labelXAxisSector(AsyMeWheel[w + 2]);
94  rpcUtils.labelYAxisRoll(AsyMeWheel[w + 2], 0, w, useRollInfo_);
95 
96  } //end Barrel
97 
98  for (int d = -numberOfDisks_; d <= numberOfDisks_; d++) {
99  if (d == 0)
100  continue;
101 
102  int offset = numberOfDisks_;
103  if (d > 0)
104  offset--; //used to skip case equale to zero
105 
106  histoName.str("");
107  histoName << "AsymmetryLeftRight_Ring_vs_Segment_Disk" << d;
108  AsyMeDisk[d + offset] = ibooker.book2D(histoName.str().c_str(),
109  histoName.str().c_str(),
110  36,
111  0.5,
112  36.5,
113  3 * numberOfRings_,
114  0.5,
115  3 * numberOfRings_ + 0.5);
116 
117  rpcUtils.labelXAxisSegment(AsyMeDisk[d + offset]);
119 
120  } //End loop on Endcap
121 }

References Active_Dead, Active_Fraction, AsyMeDisk, AsyMeWheel, dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), ztail::d, globalFolder_, HltBtagPostValidation_cff::histoName, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), numberOfDisks_, numberOfRings_, hltrates_dqm_sourceclient-live_cfg::offset, dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::NavigatorBase::setCurrentFolder(), useRollInfo_, and w.

Member Data Documentation

◆ Active_Dead

MonitorElement* RPCOccupancyTest::Active_Dead
private

Definition at line 41 of file RPCOccupancyTest.h.

Referenced by clientOperation(), and myBooker().

◆ Active_Fraction

MonitorElement* RPCOccupancyTest::Active_Fraction
private

Definition at line 40 of file RPCOccupancyTest.h.

Referenced by clientOperation(), and myBooker().

◆ AsyMeDisk

MonitorElement* RPCOccupancyTest::AsyMeDisk[10]
private

Definition at line 47 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

◆ AsyMeWheel

MonitorElement* RPCOccupancyTest::AsyMeWheel[5]
private

Definition at line 43 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

◆ Barrel_OccBySt

MonitorElement* RPCOccupancyTest::Barrel_OccBySt
private

Definition at line 51 of file RPCOccupancyTest.h.

◆ EndCap_OccByDisk

MonitorElement* RPCOccupancyTest::EndCap_OccByDisk
private

Definition at line 53 of file RPCOccupancyTest.h.

◆ EndCap_OccByRng

MonitorElement* RPCOccupancyTest::EndCap_OccByRng
private

Definition at line 52 of file RPCOccupancyTest.h.

◆ globalFolder_

std::string RPCOccupancyTest::globalFolder_
private

Definition at line 27 of file RPCOccupancyTest.h.

Referenced by beginJob(), and myBooker().

◆ myDetIds_

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

Definition at line 31 of file RPCOccupancyTest.h.

Referenced by clientOperation(), and getMonitorElements().

◆ myOccupancyMe_

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

Definition at line 30 of file RPCOccupancyTest.h.

Referenced by clientOperation(), and getMonitorElements().

◆ NormOccupDDisk

MonitorElement* RPCOccupancyTest::NormOccupDDisk[10]
private

Definition at line 49 of file RPCOccupancyTest.h.

◆ NormOccupDisk

MonitorElement* RPCOccupancyTest::NormOccupDisk[10]
private

Definition at line 48 of file RPCOccupancyTest.h.

◆ NormOccupDWheel

MonitorElement* RPCOccupancyTest::NormOccupDWheel[5]
private

Definition at line 45 of file RPCOccupancyTest.h.

◆ NormOccupWheel

MonitorElement* RPCOccupancyTest::NormOccupWheel[5]
private

Definition at line 44 of file RPCOccupancyTest.h.

◆ numberOfDisks_

int RPCOccupancyTest::numberOfDisks_
private

Definition at line 36 of file RPCOccupancyTest.h.

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

◆ numberOfRings_

int RPCOccupancyTest::numberOfRings_
private

Definition at line 36 of file RPCOccupancyTest.h.

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

◆ prefixDir_

std::string RPCOccupancyTest::prefixDir_
private

Definition at line 27 of file RPCOccupancyTest.h.

Referenced by RPCOccupancyTest().

◆ prescaleFactor_

int RPCOccupancyTest::prescaleFactor_
private

Definition at line 32 of file RPCOccupancyTest.h.

Referenced by RPCOccupancyTest().

◆ rpcevents_

float RPCOccupancyTest::rpcevents_
private

Definition at line 38 of file RPCOccupancyTest.h.

◆ totalActive_

float RPCOccupancyTest::totalActive_
private

Definition at line 34 of file RPCOccupancyTest.h.

Referenced by beginJob(), clientOperation(), and fillGlobalME().

◆ totalStrips_

float RPCOccupancyTest::totalStrips_
private

Definition at line 34 of file RPCOccupancyTest.h.

Referenced by beginJob(), clientOperation(), and fillGlobalME().

◆ useNormalization_

bool RPCOccupancyTest::useNormalization_
private

Definition at line 28 of file RPCOccupancyTest.h.

Referenced by RPCOccupancyTest().

◆ useRollInfo_

bool RPCOccupancyTest::useRollInfo_
private

Definition at line 29 of file RPCOccupancyTest.h.

Referenced by myBooker(), and RPCOccupancyTest().

rpcdqm::utils::labelXAxisSegment
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:247
RPCOccupancyTest::useRollInfo_
bool useRollInfo_
Definition: RPCOccupancyTest.h:29
RPCOccupancyTest::Active_Dead
MonitorElement * Active_Dead
Definition: RPCOccupancyTest.h:41
mps_fire.i
i
Definition: mps_fire.py:428
RPCGeomServ
Definition: RPCGeomServ.h:8
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
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
RPCOccupancyTest::globalFolder_
std::string globalFolder_
Definition: RPCOccupancyTest.h:27
RPCOccupancyTest::totalActive_
float totalActive_
Definition: RPCOccupancyTest.h:34
RPCOccupancyTest::prefixDir_
std::string prefixDir_
Definition: RPCOccupancyTest.h:27
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
RPCOccupancyTest::numberOfDisks_
int numberOfDisks_
Definition: RPCOccupancyTest.h:36
RPCOccupancyTest::useNormalization_
bool useNormalization_
Definition: RPCOccupancyTest.h:28
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
RPCOccupancyTest::totalStrips_
float totalStrips_
Definition: RPCOccupancyTest.h:34
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
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
RPCOccupancyTest::fillGlobalME
void fillGlobalME(RPCDetId &, MonitorElement *)
Definition: RPCOccupancyTest.cc:123
RPCOccupancyTest::myOccupancyMe_
std::vector< MonitorElement * > myOccupancyMe_
Definition: RPCOccupancyTest.h:30
rpcdqm::utils
Definition: utils.h:29
w
const double w
Definition: UKUtility.cc:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
dqm::impl::MonitorElement::getEntries
virtual double getEntries() const
get # of entries
Definition: MonitorElement.cc:628
RPCDetId::roll
int roll() const
Definition: RPCDetId.h:92
RPCOccupancyTest::AsyMeWheel
MonitorElement * AsyMeWheel[5]
Definition: RPCOccupancyTest.h:43
dqm::impl::MonitorElement::setBinLabel
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:771
rpcdqm::utils::labelYAxisRing
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:291
RPCOccupancyTest::prescaleFactor_
int prescaleFactor_
Definition: RPCOccupancyTest.h:32
rpcdqm::utils::detId2RollNr
int detId2RollNr(const RPCDetId &_id)
Definition: utils.h:31
RPCOccupancyTest::Active_Fraction
MonitorElement * Active_Fraction
Definition: RPCOccupancyTest.h:40
RPCDetId::ring
int ring() const
Definition: RPCDetId.h:59
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
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
ztail.d
d
Definition: ztail.py:151
RPCOccupancyTest::AsyMeDisk
MonitorElement * AsyMeDisk[10]
Definition: RPCOccupancyTest.h:47
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:592
RPCOccupancyTest::numberOfRings_
int numberOfRings_
Definition: RPCOccupancyTest.h:36
RPCOccupancyTest::myDetIds_
std::vector< RPCDetId > myDetIds_
Definition: RPCOccupancyTest.h:31
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98