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=default
 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::RPCMultiplicityTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 11 of file RPCMultiplicityTest.cc.

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

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

◆ ~RPCMultiplicityTest()

RPCMultiplicityTest::~RPCMultiplicityTest ( )
overridedefault

Destructor.

Member Function Documentation

◆ beginJob()

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

Implements RPCClient.

Definition at line 20 of file RPCMultiplicityTest.cc.

References globalFolder_.

20  {
21  edm::LogVerbatim("multiplicity") << "[RPCMultiplicityTest]: Begin job";
22  globalFolder_ = workingFolder;
23 }
Log< level::Info, true > LogVerbatim

◆ clientOperation()

void RPCMultiplicityTest::clientOperation ( )
overridevirtual

Implements RPCClient.

Definition at line 81 of file RPCMultiplicityTest.cc.

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

81  {
82  edm::LogVerbatim("multiplicity") << "[RPCMultiplicityTest]: Client Operation";
83 
84  //Loop on MEs
85  for (unsigned int i = 0; i < myNumDigiMe_.size(); i++) {
87  } //End loop on MEs
88 }
Log< level::Info, true > LogVerbatim
void fillGlobalME(RPCDetId &detId, MonitorElement *myMe)
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myNumDigiMe_

◆ fillGlobalME()

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

Definition at line 90 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().

90  {
91  MonitorElement* MULT = nullptr;
92  MonitorElement* MULTD = nullptr;
93 
94  if (detId.region() == 0) {
95  MULT = MULTWheel[detId.ring() + 2];
96  if (testMode_) {
97  MULTD = MULTDWheel[detId.ring() + 2];
98  }
99  } else {
100  if (-detId.station() + numberOfDisks_ >= 0) {
101  if (detId.region() < 0) {
102  MULT = MULTDisk[-detId.station() + numberOfDisks_];
103  if (testMode_) {
104  MULTD = MULTDDisk[-detId.station() + numberOfDisks_];
105  }
106  } else {
107  MULT = MULTDisk[detId.station() + numberOfDisks_ - 1];
108  if (testMode_) {
109  MULTD = MULTDDisk[detId.station() + numberOfDisks_ - 1];
110  }
111  }
112  }
113  }
114 
115  int xBin, yBin;
116  if (detId.region() == 0) { //Barrel
117  xBin = detId.sector();
118  rpcdqm::utils rollNumber;
119  yBin = rollNumber.detId2RollNr(detId);
120  } else { //Endcap
121  //get segment number
122  RPCGeomServ RPCServ(detId);
123  xBin = RPCServ.segment();
124  (numberOfRings_ == 3 ? yBin = detId.ring() * 3 - detId.roll() + 1
125  : yBin = (detId.ring() - 1) * 3 - detId.roll() + 1);
126  }
127 
128  float mean = myMe->getMean();
129 
130  if (MULT) {
131  MULT->setBinContent(xBin, yBin, mean);
132  }
133  if (testMode_ && MULTD) {
134  MULTD->Fill(mean);
135  }
136 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
MonitorElement * MULTDDisk[10]
MonitorElement * MULTDisk[10]
int ring() const
Definition: RPCDetId.h:59
void Fill(long long x)
MonitorElement * MULTDWheel[5]
MonitorElement * MULTWheel[5]
int roll() const
Definition: RPCDetId.h:92
int detId2RollNr(const RPCDetId &_id)
Definition: utils.h:31
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
int station() const
Definition: RPCDetId.h:78
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)

◆ getMonitorElements()

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

Implements RPCClient.

Definition at line 67 of file RPCMultiplicityTest.cc.

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

69  {
70  //Get NumberOfDigi ME for each roll
71  for (unsigned int i = 0; i < meVector.size(); i++) {
72  std::string meName = meVector[i]->getName();
73 
74  if (meName.find(clientHistoName) != std::string::npos) {
75  myNumDigiMe_.push_back(meVector[i]);
76  myDetIds_.push_back(detIdVector[i]);
77  }
78  }
79 }
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myNumDigiMe_

◆ myBooker()

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

Implements RPCClient.

Definition at line 25 of file RPCMultiplicityTest.cc.

References dqm::implementation::IBooker::book1D(), RPCRollMapHisto::bookBarrel(), RPCRollMapHisto::bookEndcap(), ztail::d, globalFolder_, HltBtagPostValidation_cff::histoName, mps_fire::i, hlt_dqm_clientPB-live_cfg::me, MULTDDisk, MULTDisk, MULTDWheel, MULTWheel, numberOfDisks_, hltrates_dqm_sourceclient-live_cfg::offset, dqm::implementation::NavigatorBase::setCurrentFolder(), testMode_, and useRollInfo_.

25  {
27 
28  std::stringstream histoName;
29 
30  for (int i = -2; i <= 2; i++) { //loop on wheels and disks
31 
32  histoName.str("");
33  histoName << "NumberOfDigi_Mean_Roll_vs_Sector_Wheel" << i;
34 
35  auto me = RPCRollMapHisto::bookBarrel(ibooker, i, histoName.str(), histoName.str(), useRollInfo_);
36  MULTWheel[i + 2] = dynamic_cast<MonitorElement*>(me);
37 
38  if (testMode_) {
39  histoName.str("");
40  histoName << "NumberOfDigi_Mean_Distribution_Wheel" << i;
41  MULTDWheel[i + 2] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 50.5);
42  }
43 
44  } //end wheels
45 
46  for (int d = -numberOfDisks_; d <= numberOfDisks_; d++) {
47  if (d == 0)
48  continue;
49 
50  int offset = numberOfDisks_;
51  if (d > 0)
52  offset--; //used to skip case equale to zero
53 
54  histoName.str("");
55  histoName << "NumberOfDigi_Mean_Ring_vs_Segment_Disk" << d;
56  auto me = RPCRollMapHisto::bookEndcap(ibooker, d, histoName.str(), histoName.str(), useRollInfo_);
57  MULTDisk[d + offset] = dynamic_cast<MonitorElement*>(me);
58 
59  if (testMode_) {
60  histoName.str("");
61  histoName << "NumberOfDigi_Mean_Distribution_Disk" << d;
62  MULTDDisk[d + offset] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 50.5);
63  }
64  } //end loop on wheels and disks
65 }
MonitorElement * MULTDDisk[10]
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * MULTDisk[10]
MonitorElement * MULTDWheel[5]
MonitorElement * MULTWheel[5]
d
Definition: ztail.py:151
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

◆ globalFolder_

std::string RPCMultiplicityTest::globalFolder_
private

Definition at line 25 of file RPCMultiplicityTest.h.

Referenced by beginJob(), and myBooker().

◆ MULTDDisk

MonitorElement* RPCMultiplicityTest::MULTDDisk[10]
private

Definition at line 35 of file RPCMultiplicityTest.h.

Referenced by fillGlobalME(), and myBooker().

◆ MULTDisk

MonitorElement* RPCMultiplicityTest::MULTDisk[10]
private

Definition at line 34 of file RPCMultiplicityTest.h.

Referenced by fillGlobalME(), and myBooker().

◆ MULTDWheel

MonitorElement* RPCMultiplicityTest::MULTDWheel[5]
private

Definition at line 33 of file RPCMultiplicityTest.h.

Referenced by fillGlobalME(), and myBooker().

◆ MULTWheel

MonitorElement* RPCMultiplicityTest::MULTWheel[5]
private

Definition at line 32 of file RPCMultiplicityTest.h.

Referenced by fillGlobalME(), and myBooker().

◆ myDetIds_

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

Definition at line 30 of file RPCMultiplicityTest.h.

Referenced by clientOperation(), and getMonitorElements().

◆ myNumDigiMe_

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

Definition at line 29 of file RPCMultiplicityTest.h.

Referenced by clientOperation(), and getMonitorElements().

◆ numberOfDisks_

int RPCMultiplicityTest::numberOfDisks_
private

Definition at line 26 of file RPCMultiplicityTest.h.

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

◆ numberOfRings_

int RPCMultiplicityTest::numberOfRings_
private

Definition at line 27 of file RPCMultiplicityTest.h.

Referenced by fillGlobalME(), and RPCMultiplicityTest().

◆ prescaleFactor_

int RPCMultiplicityTest::prescaleFactor_
private

Definition at line 24 of file RPCMultiplicityTest.h.

Referenced by RPCMultiplicityTest().

◆ testMode_

bool RPCMultiplicityTest::testMode_
private

Definition at line 31 of file RPCMultiplicityTest.h.

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

◆ useRollInfo_

bool RPCMultiplicityTest::useRollInfo_
private

Definition at line 28 of file RPCMultiplicityTest.h.

Referenced by myBooker(), and RPCMultiplicityTest().