CMS 3D CMS Logo

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

#include <RPCMultiplicityTest.h>

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

Protected Member Functions

void fillGlobalME (RPCDetId &detId, MonitorElement *myMe)
 

Private Attributes

std::string globalFolder_
 
MonitorElementMULTDDisk [10]
 
MonitorElementMULTDisk [10]
 
MonitorElementMULTDWheel [5]
 
MonitorElementMULTWheel [5]
 
std::vector< RPCDetIdmyDetIds_
 
std::vector< MonitorElement * > myNumDigiMe_
 
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 RPCMultiplicityTest.h.

Constructor & Destructor Documentation

RPCMultiplicityTest::RPCMultiplicityTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 16 of file RPCMultiplicityTest.cc.

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

16  {
17  edm::LogVerbatim("multiplicity") << "[RPCMultiplicityTest]: Constructor";
18  useRollInfo_ = ps.getUntrackedParameter<bool>("UseRollInfo", false);
19  prescaleFactor_ = ps.getUntrackedParameter<int>("DiagnosticPrescale", 1);
20  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
21  numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
22  testMode_ = ps.getUntrackedParameter<bool>("testMode", false);
23 }
T getUntrackedParameter(std::string const &, T const &) const
RPCMultiplicityTest::~RPCMultiplicityTest ( )
override

Destructor.

Definition at line 25 of file RPCMultiplicityTest.cc.

25 {}

Member Function Documentation

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

Implements RPCClient.

Definition at line 27 of file RPCMultiplicityTest.cc.

References globalFolder_.

27  {
28  edm::LogVerbatim("multiplicity") << "[RPCMultiplicityTest]: Begin job";
29  globalFolder_ = workingFolder;
30 }
void RPCMultiplicityTest::clientOperation ( )
overridevirtual

Implements RPCClient.

Definition at line 99 of file RPCMultiplicityTest.cc.

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

99  {
100  edm::LogVerbatim("multiplicity") << "[RPCMultiplicityTest]: Client Operation";
101 
102  //Loop on MEs
103  for (unsigned int i = 0; i < myNumDigiMe_.size(); i++) {
104  this->fillGlobalME(myDetIds_[i], myNumDigiMe_[i]);
105  } //End loop on MEs
106 }
void fillGlobalME(RPCDetId &detId, MonitorElement *myMe)
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myNumDigiMe_
void RPCMultiplicityTest::fillGlobalME ( RPCDetId detId,
MonitorElement myMe 
)
protected

Definition at line 108 of file RPCMultiplicityTest.cc.

References rpcdqm::utils::detId2RollNr(), dqm::impl::MonitorElement::Fill(), dqm::impl::MonitorElement::getMean(), SiStripPI::mean, MULTDDisk, MULTDisk, MULTDWheel, MULTWheel, 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.

Referenced by clientOperation().

108  {
109  MonitorElement* MULT = nullptr;
110  MonitorElement* MULTD = nullptr;
111 
112  if (detId.region() == 0) {
113  MULT = MULTWheel[detId.ring() + 2];
114  if (testMode_) {
115  MULTD = MULTDWheel[detId.ring() + 2];
116  }
117  } else {
118  if (-detId.station() + numberOfDisks_ >= 0) {
119  if (detId.region() < 0) {
120  MULT = MULTDisk[-detId.station() + numberOfDisks_];
121  if (testMode_) {
122  MULTD = MULTDDisk[-detId.station() + numberOfDisks_];
123  }
124  } else {
125  MULT = MULTDisk[detId.station() + numberOfDisks_ - 1];
126  if (testMode_) {
127  MULTD = MULTDDisk[detId.station() + numberOfDisks_ - 1];
128  }
129  }
130  }
131  }
132 
133  int xBin, yBin;
134  if (detId.region() == 0) { //Barrel
135  xBin = detId.sector();
136  rpcdqm::utils rollNumber;
137  yBin = rollNumber.detId2RollNr(detId);
138  } else { //Endcap
139  //get segment number
140  RPCGeomServ RPCServ(detId);
141  xBin = RPCServ.segment();
142  (numberOfRings_ == 3 ? yBin = detId.ring() * 3 - detId.roll() + 1
143  : yBin = (detId.ring() - 1) * 3 - detId.roll() + 1);
144  }
145 
146  float mean = myMe->getMean();
147 
148  if (MULT) {
149  MULT->setBinContent(xBin, yBin, mean);
150  }
151  if (testMode_ && MULTD) {
152  MULTD->Fill(mean);
153  }
154 }
MonitorElement * MULTDDisk[10]
MonitorElement * MULTDisk[10]
void Fill(long long x)
int roll() const
Definition: RPCDetId.h:92
int ring() const
Definition: RPCDetId.h:59
MonitorElement * MULTDWheel[5]
MonitorElement * MULTWheel[5]
int detId2RollNr(const RPCDetId &_id)
Definition: utils.h:31
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
int station() const
Definition: RPCDetId.h:78
void RPCMultiplicityTest::getMonitorElements ( std::vector< MonitorElement * > &  meVector,
std::vector< RPCDetId > &  detIdVector,
std::string &  clientHistoName 
)
overridevirtual

Implements RPCClient.

Definition at line 85 of file RPCMultiplicityTest.cc.

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

87  {
88  //Get NumberOfDigi ME for each roll
89  for (unsigned int i = 0; i < meVector.size(); i++) {
90  std::string meName = meVector[i]->getName();
91 
92  if (meName.find(clientHistoName) != std::string::npos) {
93  myNumDigiMe_.push_back(meVector[i]);
94  myDetIds_.push_back(detIdVector[i]);
95  }
96  }
97 }
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myNumDigiMe_
void RPCMultiplicityTest::myBooker ( DQMStore::IBooker ibooker)
overridevirtual

Implements RPCClient.

Definition at line 32 of file RPCMultiplicityTest.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), ztail::d, globalFolder_, HltBtagPostValidation_cff::histoName, mps_fire::i, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), MULTDDisk, MULTDisk, MULTDWheel, MULTWheel, numberOfDisks_, numberOfRings_, hltrates_dqm_sourceclient-live_cfg::offset, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), testMode_, and useRollInfo_.

32  {
33  ibooker.setCurrentFolder(globalFolder_);
34 
35  std::stringstream histoName;
36  rpcdqm::utils rpcUtils;
37 
38  for (int i = -2; i <= 2; i++) { //loop on wheels and disks
39 
40  histoName.str("");
41  histoName << "NumberOfDigi_Mean_Roll_vs_Sector_Wheel" << i;
42 
43  MULTWheel[i + 2] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
44 
45  rpcUtils.labelXAxisSector(MULTWheel[i + 2]);
46  rpcUtils.labelYAxisRoll(MULTWheel[i + 2], 0, i, useRollInfo_);
47 
48  if (testMode_) {
49  histoName.str("");
50  histoName << "NumberOfDigi_Mean_Distribution_Wheel" << i;
51  MULTDWheel[i + 2] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 50.5);
52  }
53 
54  } //end wheels
55 
56  for (int d = -numberOfDisks_; d <= numberOfDisks_; d++) {
57  if (d == 0)
58  continue;
59 
60  int offset = numberOfDisks_;
61  if (d > 0)
62  offset--; //used to skip case equale to zero
63 
64  histoName.str("");
65  histoName << "NumberOfDigi_Mean_Ring_vs_Segment_Disk" << d;
66  MULTDisk[d + offset] = ibooker.book2D(histoName.str().c_str(),
67  histoName.str().c_str(),
68  36,
69  0.5,
70  36.5,
71  3 * numberOfRings_,
72  0.5,
73  3 * numberOfRings_ + 0.5);
74  rpcUtils.labelXAxisSegment(MULTDisk[d + offset]);
75  rpcUtils.labelYAxisRing(MULTDisk[d + offset], numberOfRings_, useRollInfo_);
76 
77  if (testMode_) {
78  histoName.str("");
79  histoName << "NumberOfDigi_Mean_Distribution_Disk" << d;
80  MULTDDisk[d + offset] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 50.5);
81  }
82  } //end loop on wheels and disks
83 }
MonitorElement * MULTDDisk[10]
MonitorElement * MULTDisk[10]
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:247
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:265
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:291
MonitorElement * MULTDWheel[5]
MonitorElement * MULTWheel[5]
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:231
d
Definition: ztail.py:151

Member Data Documentation

std::string RPCMultiplicityTest::globalFolder_
private

Definition at line 25 of file RPCMultiplicityTest.h.

Referenced by beginJob(), and myBooker().

MonitorElement* RPCMultiplicityTest::MULTDDisk[10]
private

Definition at line 35 of file RPCMultiplicityTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCMultiplicityTest::MULTDisk[10]
private

Definition at line 34 of file RPCMultiplicityTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCMultiplicityTest::MULTDWheel[5]
private

Definition at line 33 of file RPCMultiplicityTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCMultiplicityTest::MULTWheel[5]
private

Definition at line 32 of file RPCMultiplicityTest.h.

Referenced by fillGlobalME(), and myBooker().

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

Definition at line 30 of file RPCMultiplicityTest.h.

Referenced by clientOperation(), and getMonitorElements().

std::vector<MonitorElement *> RPCMultiplicityTest::myNumDigiMe_
private

Definition at line 29 of file RPCMultiplicityTest.h.

Referenced by clientOperation(), and getMonitorElements().

int RPCMultiplicityTest::numberOfDisks_
private

Definition at line 26 of file RPCMultiplicityTest.h.

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

int RPCMultiplicityTest::numberOfRings_
private

Definition at line 27 of file RPCMultiplicityTest.h.

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

int RPCMultiplicityTest::prescaleFactor_
private

Definition at line 24 of file RPCMultiplicityTest.h.

Referenced by RPCMultiplicityTest().

bool RPCMultiplicityTest::testMode_
private

Definition at line 31 of file RPCMultiplicityTest.h.

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

bool RPCMultiplicityTest::useRollInfo_
private

Definition at line 28 of file RPCMultiplicityTest.h.

Referenced by myBooker(), and RPCMultiplicityTest().