CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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=default
 
- 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 11 of file RPCOccupancyTest.cc.

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

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

◆ ~RPCOccupancyTest()

RPCOccupancyTest::~RPCOccupancyTest ( )
overridedefault

Member Function Documentation

◆ beginJob()

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

Implements RPCClient.

Definition at line 26 of file RPCOccupancyTest.cc.

References Active_Dead, Active_Fraction, globalFolder_, totalActive_, and totalStrips_.

26  {
27  edm::LogVerbatim("rpceventsummary") << "[RPCOccupancyTest]: Begin job ";
28  globalFolder_ = workingFolder;
29 
30  totalStrips_ = 0.;
31  totalActive_ = 0.;
32 
33  Active_Dead = nullptr;
34  Active_Fraction = nullptr;
35 }
Log< level::Info, true > LogVerbatim
MonitorElement * Active_Fraction
std::string globalFolder_
MonitorElement * Active_Dead

◆ clientOperation()

void RPCOccupancyTest::clientOperation ( )
overridevirtual

Implements RPCClient.

Definition at line 51 of file RPCOccupancyTest.cc.

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

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 }
Log< level::Info, true > LogVerbatim
MonitorElement * Active_Fraction
std::vector< RPCDetId > myDetIds_
void fillGlobalME(RPCDetId &, MonitorElement *)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * Active_Dead
std::vector< MonitorElement * > myOccupancyMe_

◆ fillGlobalME()

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

Definition at line 109 of file RPCOccupancyTest.cc.

References AsyMeDisk, AsyMeWheel, hcalRecHitTable_cff::detId, rpcdqm::utils::detId2RollNr(), nano_mu_digi_cff::float, dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getEntries(), dqm::impl::MonitorElement::getNbinsX(), numberOfDisks_, numberOfRings_, RPCGeomServ::segment(), dqm::impl::MonitorElement::setBinContent(), nano_mu_digi_cff::strip, totalActive_, totalStrips_, photonAnalyzer_cfi::xBin, and photonAnalyzer_cfi::yBin.

Referenced by clientOperation().

109  {
110  if (!myMe)
111  return;
112 
113  MonitorElement* AsyMe = nullptr; //Left Right Asymetry
114 
115  if (detId.region() == 0) {
116  AsyMe = AsyMeWheel[detId.ring() + 2];
117 
118  } else {
119  if (-detId.station() + numberOfDisks_ >= 0) {
120  if (detId.region() < 0) {
121  AsyMe = AsyMeDisk[-detId.station() + numberOfDisks_];
122  } else {
123  AsyMe = AsyMeDisk[detId.station() + numberOfDisks_ - 1];
124  }
125  }
126  }
127 
128  int xBin, yBin;
129  if (detId.region() == 0) { //Barrel
130  xBin = detId.sector();
131  rpcdqm::utils rollNumber;
132  yBin = rollNumber.detId2RollNr(detId);
133  } else { //Endcap
134  //get segment number
135  RPCGeomServ RPCServ(detId);
136  xBin = RPCServ.segment();
137  (numberOfRings_ == 3 ? yBin = detId.ring() * 3 - detId.roll() + 1
138  : yBin = (detId.ring() - 1) * 3 - detId.roll() + 1);
139  }
140 
141  int stripInRoll = myMe->getNbinsX();
142  totalStrips_ += (float)stripInRoll;
143  float FOccupancy = 0;
144  float BOccupancy = 0;
145 
146  float totEnt = myMe->getEntries();
147  for (int strip = 1; strip <= stripInRoll; strip++) {
148  float stripEntries = myMe->getBinContent(strip);
149  if (stripEntries > 0) {
150  totalActive_++;
151  }
152  if (strip <= stripInRoll / 2) {
153  FOccupancy += myMe->getBinContent(strip);
154  } else {
155  BOccupancy += myMe->getBinContent(strip);
156  }
157  }
158 
159  float asym = 0;
160  if (totEnt != 0)
161  asym = fabs((FOccupancy - BOccupancy) / totEnt);
162 
163  if (AsyMe)
164  AsyMe->setBinContent(xBin, yBin, asym);
165 }
MonitorElement * AsyMeWheel[5]
MonitorElement * AsyMeDisk[10]
virtual double getEntries() const
get # of entries
int detId2RollNr(const RPCDetId &_id)
Definition: utils.h:31
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual int getNbinsX() const
get # of bins in X-axis
virtual double getBinContent(int binx) const
get content of bin (1-D)

◆ 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.

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

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 }
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myOccupancyMe_

◆ myBooker()

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

Implements RPCClient.

Definition at line 69 of file RPCOccupancyTest.cc.

References Active_Dead, Active_Fraction, AsyMeDisk, AsyMeWheel, dqm::implementation::IBooker::book1D(), RPCRollMapHisto::bookBarrel(), RPCRollMapHisto::bookEndcap(), ztail::d, globalFolder_, HltBtagPostValidation_cff::histoName, hlt_dqm_clientPB-live_cfg::me, numberOfDisks_, hltrates_dqm_sourceclient-live_cfg::offset, dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::NavigatorBase::setCurrentFolder(), useRollInfo_, and w().

69  {
71 
72  std::stringstream histoName;
73 
74  histoName.str("");
75  histoName << "RPC_Active_Channel_Fractions";
76  Active_Fraction = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 1, 0.5, 1.5);
77  Active_Fraction->setBinLabel(1, "Active Fraction", 1);
78 
79  histoName.str("");
80  histoName << "RPC_Active_Inactive_Strips";
81  Active_Dead = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 2, 0.5, 2.5);
82  Active_Dead->setBinLabel(1, "Active Strips", 1);
83  Active_Dead->setBinLabel(2, "Inactive Strips", 1);
84 
85  for (int w = -2; w <= 2; w++) { //loop on wheels
86 
87  histoName.str("");
88  histoName << "AsymmetryLeftRight_Roll_vs_Sector_Wheel" << w;
89 
90  auto me = RPCRollMapHisto::bookBarrel(ibooker, w, histoName.str(), histoName.str(), useRollInfo_);
91  AsyMeWheel[w + 2] = dynamic_cast<MonitorElement*>(me);
92  } //end Barrel
93 
94  for (int d = -numberOfDisks_; d <= numberOfDisks_; d++) {
95  if (d == 0)
96  continue;
97 
98  int offset = numberOfDisks_;
99  if (d > 0)
100  offset--; //used to skip case equale to zero
101 
102  histoName.str("");
103  histoName << "AsymmetryLeftRight_Ring_vs_Segment_Disk" << d;
104  auto me = RPCRollMapHisto::bookEndcap(ibooker, d, histoName.str(), histoName.str(), useRollInfo_);
105  AsyMeDisk[d + offset] = dynamic_cast<MonitorElement*>(me);
106  } //End loop on Endcap
107 }
MonitorElement * AsyMeWheel[5]
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
T w() const
MonitorElement * Active_Fraction
MonitorElement * AsyMeDisk[10]
std::string globalFolder_
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)
d
Definition: ztail.py:151
MonitorElement * Active_Dead
static MonitorElement * bookBarrel(IBooker &booker, const int wheel, const std::string &prefix, const std::string &title, const bool useRollInfo)
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)

Member Data Documentation

◆ Active_Dead

MonitorElement* RPCOccupancyTest::Active_Dead
private

Definition at line 41 of file RPCOccupancyTest.h.

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

◆ Active_Fraction

MonitorElement* RPCOccupancyTest::Active_Fraction
private

Definition at line 40 of file RPCOccupancyTest.h.

Referenced by beginJob(), 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(), 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().