CMS 3D CMS Logo

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

#include <RPCClusterSizeTest.h>

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

Private Types

enum  MEArraySizes { kWheels = 5, kDisks = 10 }
 

Private Member Functions

void resetMEArrays (void)
 

Private Attributes

MonitorElementCLSDDisk [kDisks]
 
MonitorElementCLSDisk [kDisks]
 
MonitorElementCLSDWheel [kWheels]
 
MonitorElementCLSWheel [kWheels]
 
std::string globalFolder_
 
MonitorElementMEANDDisk [kDisks]
 
MonitorElementMEANDisk [kDisks]
 
MonitorElementMEANDWheel [kWheels]
 
MonitorElementMEANWheel [kWheels]
 
std::vector< MonitorElement * > myClusterMe_
 
std::vector< RPCDetIdmyDetIds_
 
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 7 of file RPCClusterSizeTest.h.

Member Enumeration Documentation

◆ MEArraySizes

Enumerator
kWheels 
kDisks 

Definition at line 28 of file RPCClusterSizeTest.h.

28 { kWheels = 5, kDisks = 10 };

Constructor & Destructor Documentation

◆ RPCClusterSizeTest()

RPCClusterSizeTest::RPCClusterSizeTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 10 of file RPCClusterSizeTest.cc.

10  {
11  edm::LogVerbatim("rpceventsummary") << "[RPCClusterSizeTest]: Constructor";
12 
13  prescaleFactor_ = ps.getUntrackedParameter<int>("DiagnosticPrescale", 1);
14 
15  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
16  numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
17  testMode_ = ps.getUntrackedParameter<bool>("testMode", false);
18  useRollInfo_ = ps.getUntrackedParameter<bool>("useRollInfo", false);
19 
20  resetMEArrays();
21 }

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

◆ ~RPCClusterSizeTest()

RPCClusterSizeTest::~RPCClusterSizeTest ( )
override

Destructor.

Definition at line 23 of file RPCClusterSizeTest.cc.

23 {}

Member Function Documentation

◆ beginJob()

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

Implements RPCClient.

Definition at line 25 of file RPCClusterSizeTest.cc.

25  {
26  edm::LogVerbatim("rpceventsummary") << "[RPCClusterSizeTest]: Begin job ";
27 
28  globalFolder_ = workingFolder;
29 }

References globalFolder_.

◆ clientOperation()

void RPCClusterSizeTest::clientOperation ( )
overridevirtual

Implements RPCClient.

Definition at line 45 of file RPCClusterSizeTest.cc.

45  {
46  edm::LogVerbatim("rpceventsummary") << "[RPCClusterSizeTest]:Client Operation";
47 
48  //check some statements and prescale Factor
49  if (myClusterMe_.empty() || myDetIds_.empty())
50  return;
51 
52  MonitorElement* CLS = nullptr; // ClusterSize in 1 bin, Roll vs Sector
53  MonitorElement* CLSD = nullptr; // ClusterSize in 1 bin, Distribution
54  MonitorElement* MEAN = nullptr; // Mean ClusterSize, Roll vs Sector
55  MonitorElement* MEAND = nullptr; // Mean ClusterSize, Distribution
56 
57  std::stringstream meName;
58  RPCDetId detId;
59  MonitorElement* myMe;
60 
61  //Loop on chambers
62  for (unsigned int i = 0; i < myClusterMe_.size(); i++) {
63  myMe = myClusterMe_[i];
64  if (!myMe || myMe->getEntries() == 0)
65  continue;
66 
67  detId = myDetIds_[i];
68 
69  if (detId.region() == 0) {
70  CLS = CLSWheel[detId.ring() + 2];
71  MEAN = MEANWheel[detId.ring() + 2];
72  if (testMode_) {
73  CLSD = CLSDWheel[detId.ring() + 2];
74  MEAND = MEANDWheel[detId.ring() + 2];
75  }
76  } else {
77  if (((detId.station() * detId.region()) + numberOfDisks_) >= 0) {
78  if (detId.region() < 0) {
79  CLS = CLSDisk[(detId.station() * detId.region()) + numberOfDisks_];
80  MEAN = MEANDisk[(detId.station() * detId.region()) + numberOfDisks_];
81  if (testMode_) {
82  CLSD = CLSDDisk[(detId.station() * detId.region()) + numberOfDisks_];
83  MEAND = MEANDDisk[(detId.station() * detId.region()) + numberOfDisks_];
84  }
85  } else {
86  CLS = CLSDisk[(detId.station() * detId.region()) + numberOfDisks_ - 1];
87  MEAN = MEANDisk[(detId.station() * detId.region()) + numberOfDisks_ - 1];
88  if (testMode_) {
89  CLSD = CLSDDisk[(detId.station() * detId.region()) + numberOfDisks_ - 1];
90  MEAND = MEANDDisk[(detId.station() * detId.region()) + numberOfDisks_ - 1];
91  }
92  }
93  }
94  }
95 
96  int xBin, yBin;
97 
98  if (detId.region() == 0) { //Barrel
99 
100  rpcdqm::utils rollNumber;
101  yBin = rollNumber.detId2RollNr(detId);
102  xBin = detId.sector();
103  } else { //Endcap
104 
105  //get segment number
106  RPCGeomServ RPCServ(detId);
107  xBin = RPCServ.segment();
108  (numberOfRings_ == 3 ? yBin = detId.ring() * 3 - detId.roll() + 1
109  : yBin = (detId.ring() - 1) * 3 - detId.roll() + 1);
110  }
111 
112  // Normalization -> # of Entries in first Bin normalaized by total Entries
113 
114  float NormCLS = myMe->getBinContent(1) / myMe->getEntries();
115  float meanCLS = myMe->getMean();
116 
117  if (CLS)
118  CLS->setBinContent(xBin, yBin, NormCLS);
119  if (MEAN)
120  MEAN->setBinContent(xBin, yBin, meanCLS);
121 
122  if (testMode_) {
123  if (MEAND)
124  MEAND->Fill(meanCLS);
125  if (CLSD)
126  CLSD->Fill(NormCLS);
127  }
128 
129  } //End loop on chambers
130 }

References CLSDDisk, CLSDisk, CLSDWheel, CLSWheel, rpcdqm::utils::detId2RollNr(), dqm::impl::MonitorElement::Fill(), dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getEntries(), dqm::impl::MonitorElement::getMean(), mps_fire::i, PVValHelper::MEAN, MEANDDisk, MEANDisk, MEANDWheel, MEANWheel, myClusterMe_, myDetIds_, numberOfDisks_, numberOfRings_, RPCDetId::region(), RPCDetId::ring(), RPCDetId::roll(), RPCDetId::sector(), RPCGeomServ::segment(), dqm::impl::MonitorElement::setBinContent(), RPCDetId::station(), testMode_, photonAnalyzer_cfi::xBin, and photonAnalyzer_cfi::yBin.

◆ getMonitorElements()

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

Implements RPCClient.

Definition at line 31 of file RPCClusterSizeTest.cc.

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

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

◆ myBooker()

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

Implements RPCClient.

Definition at line 144 of file RPCClusterSizeTest.cc.

144  {
145  resetMEArrays();
146 
147  ibooker.setCurrentFolder(globalFolder_);
148 
149  std::stringstream histoName;
150 
151  rpcdqm::utils rpcUtils;
152 
153  // Loop over wheels
154  for (int w = -2; w <= 2; w++) {
155  histoName.str("");
156  histoName << "ClusterSizeIn1Bin_Roll_vs_Sector_Wheel"
157  << w; // ClusterSize in first bin norm. by Entries (2D Roll vs Sector)
158  CLSWheel[w + 2] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
159  rpcUtils.labelXAxisSector(CLSWheel[w + 2]);
160  rpcUtils.labelYAxisRoll(CLSWheel[w + 2], 0, w, useRollInfo_);
161 
162  histoName.str("");
163  histoName << "ClusterSizeMean_Roll_vs_Sector_Wheel" << w; // Avarage ClusterSize (2D Roll vs Sector)
164  MEANWheel[w + 2] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
165 
166  rpcUtils.labelXAxisSector(MEANWheel[w + 2]);
167  rpcUtils.labelYAxisRoll(MEANWheel[w + 2], 0, w, useRollInfo_);
168 
169  if (testMode_) {
170  histoName.str("");
171  histoName << "ClusterSizeIn1Bin_Distribution_Wheel" << w; // ClusterSize in first bin, distribution
172  CLSDWheel[w + 2] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 20, 0.0, 1.0);
173 
174  histoName.str("");
175  histoName << "ClusterSizeMean_Distribution_Wheel" << w; // Avarage ClusterSize Distribution
176  MEANDWheel[w + 2] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 10.5);
177  }
178  } //end loop on wheels
179 
180  for (int d = -numberOfDisks_; d <= numberOfDisks_; d++) {
181  if (d == 0)
182  continue;
183  //Endcap
184  int offset = numberOfDisks_;
185  if (d > 0)
186  offset--;
187 
188  histoName.str("");
189  histoName << "ClusterSizeIn1Bin_Ring_vs_Segment_Disk"
190  << d; // ClusterSize in first bin norm. by Entries (2D Roll vs Sector)
191  CLSDisk[d + offset] = ibooker.book2D(histoName.str().c_str(),
192  histoName.str().c_str(),
193  36,
194  0.5,
195  36.5,
196  3 * numberOfRings_,
197  0.5,
198  3 * numberOfRings_ + 0.5);
199  rpcUtils.labelXAxisSegment(CLSDisk[d + offset]);
201 
202  if (testMode_) {
203  histoName.str("");
204  histoName << "ClusterSizeIn1Bin_Distribution_Disk" << d; // ClusterSize in first bin, distribution
205  CLSDDisk[d + offset] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 20, 0.0, 1.0);
206 
207  histoName.str("");
208  histoName << "ClusterSizeMean_Distribution_Disk" << d; // Avarage ClusterSize Distribution
209  MEANDDisk[d + offset] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 10.5);
210  }
211 
212  histoName.str("");
213  histoName << "ClusterSizeMean_Ring_vs_Segment_Disk" << d; // Avarage ClusterSize (2D Roll vs Sector)
214  MEANDisk[d + offset] = ibooker.book2D(histoName.str().c_str(),
215  histoName.str().c_str(),
216  36,
217  0.5,
218  36.5,
219  3 * numberOfRings_,
220  0.5,
221  3 * numberOfRings_ + 0.5);
222  rpcUtils.labelXAxisSegment(MEANDisk[d + offset]);
224  }
225 }

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), CLSDDisk, CLSDisk, CLSDWheel, CLSWheel, ztail::d, globalFolder_, HltBtagPostValidation_cff::histoName, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), MEANDDisk, MEANDisk, MEANDWheel, MEANWheel, numberOfDisks_, numberOfRings_, hltrates_dqm_sourceclient-live_cfg::offset, resetMEArrays(), dqm::implementation::NavigatorBase::setCurrentFolder(), testMode_, useRollInfo_, and w.

◆ resetMEArrays()

void RPCClusterSizeTest::resetMEArrays ( void  )
private

Definition at line 132 of file RPCClusterSizeTest.cc.

132  {
133  memset((void*)CLSWheel, 0, sizeof(MonitorElement*) * kWheels);
134  memset((void*)CLSDWheel, 0, sizeof(MonitorElement*) * kWheels);
135  memset((void*)MEANWheel, 0, sizeof(MonitorElement*) * kWheels);
136  memset((void*)MEANDWheel, 0, sizeof(MonitorElement*) * kWheels);
137 
138  memset((void*)CLSDisk, 0, sizeof(MonitorElement*) * kDisks);
139  memset((void*)CLSDDisk, 0, sizeof(MonitorElement*) * kDisks);
140  memset((void*)MEANDisk, 0, sizeof(MonitorElement*) * kDisks);
141  memset((void*)MEANDDisk, 0, sizeof(MonitorElement*) * kDisks);
142 }

References CLSDDisk, CLSDisk, CLSDWheel, CLSWheel, kDisks, kWheels, MEANDDisk, MEANDisk, MEANDWheel, and MEANWheel.

Referenced by myBooker(), and RPCClusterSizeTest().

Member Data Documentation

◆ CLSDDisk

MonitorElement* RPCClusterSizeTest::CLSDDisk[kDisks]
private

Definition at line 36 of file RPCClusterSizeTest.h.

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

◆ CLSDisk

MonitorElement* RPCClusterSizeTest::CLSDisk[kDisks]
private

Definition at line 35 of file RPCClusterSizeTest.h.

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

◆ CLSDWheel

MonitorElement* RPCClusterSizeTest::CLSDWheel[kWheels]
private

Definition at line 31 of file RPCClusterSizeTest.h.

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

◆ CLSWheel

MonitorElement* RPCClusterSizeTest::CLSWheel[kWheels]
private

Definition at line 30 of file RPCClusterSizeTest.h.

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

◆ globalFolder_

std::string RPCClusterSizeTest::globalFolder_
private

Definition at line 20 of file RPCClusterSizeTest.h.

Referenced by beginJob(), and myBooker().

◆ MEANDDisk

MonitorElement* RPCClusterSizeTest::MEANDDisk[kDisks]
private

Definition at line 38 of file RPCClusterSizeTest.h.

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

◆ MEANDisk

MonitorElement* RPCClusterSizeTest::MEANDisk[kDisks]
private

Definition at line 37 of file RPCClusterSizeTest.h.

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

◆ MEANDWheel

MonitorElement* RPCClusterSizeTest::MEANDWheel[kWheels]
private

Definition at line 33 of file RPCClusterSizeTest.h.

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

◆ MEANWheel

MonitorElement* RPCClusterSizeTest::MEANWheel[kWheels]
private

Definition at line 32 of file RPCClusterSizeTest.h.

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

◆ myClusterMe_

std::vector<MonitorElement *> RPCClusterSizeTest::myClusterMe_
private

Definition at line 26 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), and getMonitorElements().

◆ myDetIds_

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

Definition at line 27 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), and getMonitorElements().

◆ numberOfDisks_

int RPCClusterSizeTest::numberOfDisks_
private

Definition at line 21 of file RPCClusterSizeTest.h.

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

◆ numberOfRings_

int RPCClusterSizeTest::numberOfRings_
private

Definition at line 22 of file RPCClusterSizeTest.h.

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

◆ prescaleFactor_

int RPCClusterSizeTest::prescaleFactor_
private

Definition at line 23 of file RPCClusterSizeTest.h.

Referenced by RPCClusterSizeTest().

◆ testMode_

bool RPCClusterSizeTest::testMode_
private

Definition at line 24 of file RPCClusterSizeTest.h.

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

◆ useRollInfo_

bool RPCClusterSizeTest::useRollInfo_
private

Definition at line 25 of file RPCClusterSizeTest.h.

Referenced by myBooker(), and RPCClusterSizeTest().

rpcdqm::utils::labelXAxisSegment
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:247
RPCClusterSizeTest::numberOfRings_
int numberOfRings_
Definition: RPCClusterSizeTest.h:22
mps_fire.i
i
Definition: mps_fire.py:355
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
RPCClusterSizeTest::MEANDisk
MonitorElement * MEANDisk[kDisks]
Definition: RPCClusterSizeTest.h:37
photonAnalyzer_cfi.xBin
xBin
Definition: photonAnalyzer_cfi.py:81
RPCClusterSizeTest::kWheels
Definition: RPCClusterSizeTest.h:28
RPCClusterSizeTest::prescaleFactor_
int prescaleFactor_
Definition: RPCClusterSizeTest.h:23
RPCDetId
Definition: RPCDetId.h:16
RPCClusterSizeTest::CLSDWheel
MonitorElement * CLSDWheel[kWheels]
Definition: RPCClusterSizeTest.h:31
RPCClusterSizeTest::numberOfDisks_
int numberOfDisks_
Definition: RPCClusterSizeTest.h:21
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
RPCClusterSizeTest::testMode_
bool testMode_
Definition: RPCClusterSizeTest.h:24
RPCClusterSizeTest::MEANWheel
MonitorElement * MEANWheel[kWheels]
Definition: RPCClusterSizeTest.h:32
RPCClusterSizeTest::MEANDDisk
MonitorElement * MEANDDisk[kDisks]
Definition: RPCClusterSizeTest.h:38
rpcdqm::utils
Definition: utils.h:29
w
const double w
Definition: UKUtility.cc:23
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RPCClusterSizeTest::resetMEArrays
void resetMEArrays(void)
Definition: RPCClusterSizeTest.cc:132
dqm::impl::MonitorElement::getEntries
virtual double getEntries() const
get # of entries
Definition: MonitorElement.cc:628
RPCDetId::roll
int roll() const
Definition: RPCDetId.h:92
RPCClusterSizeTest::CLSDDisk
MonitorElement * CLSDDisk[kDisks]
Definition: RPCClusterSizeTest.h:36
edm::LogVerbatim
Definition: MessageLogger.h:297
rpcdqm::utils::labelYAxisRing
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:291
rpcdqm::utils::detId2RollNr
int detId2RollNr(const RPCDetId &_id)
Definition: utils.h:31
RPCClusterSizeTest::useRollInfo_
bool useRollInfo_
Definition: RPCClusterSizeTest.h:25
PVValHelper::MEAN
Definition: PVValidationHelpers.h:44
RPCClusterSizeTest::kDisks
Definition: RPCClusterSizeTest.h:28
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
RPCClusterSizeTest::CLSWheel
MonitorElement * CLSWheel[kWheels]
Definition: RPCClusterSizeTest.h:30
RPCClusterSizeTest::myClusterMe_
std::vector< MonitorElement * > myClusterMe_
Definition: RPCClusterSizeTest.h:26
RPCClusterSizeTest::globalFolder_
std::string globalFolder_
Definition: RPCClusterSizeTest.h:20
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
dqm::impl::MonitorElement::getMean
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:549
RPCClusterSizeTest::MEANDWheel
MonitorElement * MEANDWheel[kWheels]
Definition: RPCClusterSizeTest.h:33
ztail.d
d
Definition: ztail.py:151
RPCClusterSizeTest::myDetIds_
std::vector< RPCDetId > myDetIds_
Definition: RPCClusterSizeTest.h:27
RPCClusterSizeTest::CLSDisk
MonitorElement * CLSDisk[kDisks]
Definition: RPCClusterSizeTest.h:35
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:78
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:592