CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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=default
 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 10 of file RPCClusterSizeTest.h.

Member Enumeration Documentation

Enumerator
kWheels 
kDisks 

Definition at line 31 of file RPCClusterSizeTest.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 8 of file RPCClusterSizeTest.cc.

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

8  {
9  edm::LogVerbatim("rpceventsummary") << "[RPCClusterSizeTest]: Constructor";
10 
11  prescaleFactor_ = ps.getUntrackedParameter<int>("DiagnosticPrescale", 1);
12 
13  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
14  numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
15  testMode_ = ps.getUntrackedParameter<bool>("testMode", false);
16  useRollInfo_ = ps.getUntrackedParameter<bool>("useRollInfo", false);
17 
18  resetMEArrays();
19 }
Log< level::Info, true > LogVerbatim
T getUntrackedParameter(std::string const &, T const &) const
RPCClusterSizeTest::~RPCClusterSizeTest ( )
overridedefault

Destructor.

Member Function Documentation

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

Implements RPCClient.

Definition at line 21 of file RPCClusterSizeTest.cc.

References globalFolder_.

21  {
22  edm::LogVerbatim("rpceventsummary") << "[RPCClusterSizeTest]: Begin job ";
23 
24  globalFolder_ = workingFolder;
25 }
Log< level::Info, true > LogVerbatim
void RPCClusterSizeTest::clientOperation ( )
overridevirtual

Implements RPCClient.

Definition at line 41 of file RPCClusterSizeTest.cc.

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_, and cuy::yBin.

41  {
42  edm::LogVerbatim("rpceventsummary") << "[RPCClusterSizeTest]:Client Operation";
43 
44  //check some statements and prescale Factor
45  if (myClusterMe_.empty() || myDetIds_.empty())
46  return;
47 
48  MonitorElement* CLS = nullptr; // ClusterSize in 1 bin, Roll vs Sector
49  MonitorElement* CLSD = nullptr; // ClusterSize in 1 bin, Distribution
50  MonitorElement* MEAN = nullptr; // Mean ClusterSize, Roll vs Sector
51  MonitorElement* MEAND = nullptr; // Mean ClusterSize, Distribution
52 
53  std::stringstream meName;
54 
55  //Loop on chambers
56  for (unsigned int i = 0; i < myClusterMe_.size(); ++i) {
57  MonitorElement* myMe = myClusterMe_[i];
58  if (!myMe || myMe->getEntries() == 0)
59  continue;
60 
61  const RPCDetId& detId = myDetIds_[i];
62 
63  if (detId.region() == 0) {
64  CLS = CLSWheel[detId.ring() + 2];
65  MEAN = MEANWheel[detId.ring() + 2];
66  if (testMode_) {
67  CLSD = CLSDWheel[detId.ring() + 2];
68  MEAND = MEANDWheel[detId.ring() + 2];
69  }
70  } else {
71  if (((detId.station() * detId.region()) + numberOfDisks_) >= 0) {
72  if (detId.region() < 0) {
73  CLS = CLSDisk[(detId.station() * detId.region()) + numberOfDisks_];
74  MEAN = MEANDisk[(detId.station() * detId.region()) + numberOfDisks_];
75  if (testMode_) {
76  CLSD = CLSDDisk[(detId.station() * detId.region()) + numberOfDisks_];
77  MEAND = MEANDDisk[(detId.station() * detId.region()) + numberOfDisks_];
78  }
79  } else {
80  CLS = CLSDisk[(detId.station() * detId.region()) + numberOfDisks_ - 1];
81  MEAN = MEANDisk[(detId.station() * detId.region()) + numberOfDisks_ - 1];
82  if (testMode_) {
83  CLSD = CLSDDisk[(detId.station() * detId.region()) + numberOfDisks_ - 1];
84  MEAND = MEANDDisk[(detId.station() * detId.region()) + numberOfDisks_ - 1];
85  }
86  }
87  }
88  }
89 
90  int xBin = 0, yBin = 0;
91 
92  if (detId.region() == 0) { //Barrel
93 
94  rpcdqm::utils rollNumber;
95  yBin = rollNumber.detId2RollNr(detId);
96  xBin = detId.sector();
97  } else { //Endcap
98 
99  //get segment number
100  RPCGeomServ RPCServ(detId);
101  xBin = RPCServ.segment();
102  (numberOfRings_ == 3 ? yBin = detId.ring() * 3 - detId.roll() + 1
103  : yBin = (detId.ring() - 1) * 3 - detId.roll() + 1);
104  }
105 
106  // Normalization -> # of Entries in first Bin normalaized by total Entries
107  const float NormCLS = myMe->getBinContent(1) / myMe->getEntries();
108  const float meanCLS = myMe->getMean();
109 
110  if (CLS)
111  CLS->setBinContent(xBin, yBin, NormCLS);
112  if (MEAN)
113  MEAN->setBinContent(xBin, yBin, meanCLS);
114 
115  if (testMode_) {
116  if (MEAND)
117  MEAND->Fill(meanCLS);
118  if (CLSD)
119  CLSD->Fill(NormCLS);
120  }
121 
122  } //End loop on chambers
123 }
Log< level::Info, true > LogVerbatim
MonitorElement * MEANWheel[kWheels]
tuple yBin
Definition: cuy.py:892
MonitorElement * MEANDWheel[kWheels]
MonitorElement * CLSDisk[kDisks]
MonitorElement * CLSDWheel[kWheels]
void Fill(long long x)
int roll() const
Definition: RPCDetId.h:92
virtual double getEntries() const
get # of entries
int ring() const
Definition: RPCDetId.h:59
MonitorElement * MEANDisk[kDisks]
MonitorElement * MEANDDisk[kDisks]
std::vector< MonitorElement * > myClusterMe_
virtual double getBinContent(int binx) const
get content of bin (1-D)
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)
std::vector< RPCDetId > myDetIds_
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
MonitorElement * CLSDDisk[kDisks]
MonitorElement * CLSWheel[kWheels]
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
int station() const
Definition: RPCDetId.h:78
void RPCClusterSizeTest::getMonitorElements ( std::vector< MonitorElement * > &  meVector,
std::vector< RPCDetId > &  detIdVector,
std::string &  clientHistoName 
)
overridevirtual

Implements RPCClient.

Definition at line 27 of file RPCClusterSizeTest.cc.

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

29  {
30  //Get ME for each roll
31  for (unsigned int i = 0; i < meVector.size(); i++) {
32  const std::string& meName = meVector[i]->getName();
33 
34  if (meName.find(clientHistoName) != std::string::npos) {
35  myClusterMe_.push_back(meVector[i]);
36  myDetIds_.push_back(detIdVector[i]);
37  }
38  }
39 }
std::vector< MonitorElement * > myClusterMe_
std::vector< RPCDetId > myDetIds_
void RPCClusterSizeTest::myBooker ( DQMStore::IBooker ibooker)
overridevirtual

Implements RPCClient.

Definition at line 137 of file RPCClusterSizeTest.cc.

References dqm::implementation::IBooker::book1D(), RPCRollMapHisto::bookBarrel(), RPCRollMapHisto::bookEndcap(), CLSDDisk, CLSDisk, CLSDWheel, CLSWheel, ztail::d, globalFolder_, hlt_dqm_clientPB-live_cfg::me, MEANDDisk, MEANDisk, MEANDWheel, MEANWheel, numberOfDisks_, hltrates_dqm_sourceclient-live_cfg::offset, resetMEArrays(), dqm::implementation::NavigatorBase::setCurrentFolder(), testMode_, useRollInfo_, and w().

137  {
138  resetMEArrays();
139 
141 
142  std::stringstream histoName;
143 
144  rpcdqm::utils rpcUtils;
145 
146  // Loop over wheels
147  for (int w = -2; w <= 2; w++) {
148  histoName.str("");
149  histoName << "ClusterSizeIn1Bin_Roll_vs_Sector_Wheel"
150  << w; // ClusterSize in first bin norm. by Entries (2D Roll vs Sector)
151  auto me = RPCRollMapHisto::bookBarrel(ibooker, w, histoName.str(), histoName.str(), useRollInfo_);
152  CLSWheel[w + 2] = dynamic_cast<MonitorElement*>(me);
153 
154  histoName.str("");
155  histoName << "ClusterSizeMean_Roll_vs_Sector_Wheel" << w; // Avarage ClusterSize (2D Roll vs Sector)
156  me = RPCRollMapHisto::bookBarrel(ibooker, w, histoName.str(), histoName.str(), useRollInfo_);
157  MEANWheel[w + 2] = dynamic_cast<MonitorElement*>(me);
158 
159  if (testMode_) {
160  histoName.str("");
161  histoName << "ClusterSizeIn1Bin_Distribution_Wheel" << w; // ClusterSize in first bin, distribution
162  CLSDWheel[w + 2] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 20, 0.0, 1.0);
163 
164  histoName.str("");
165  histoName << "ClusterSizeMean_Distribution_Wheel" << w; // Avarage ClusterSize Distribution
166  MEANDWheel[w + 2] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 10.5);
167  }
168  } //end loop on wheels
169 
170  for (int d = -numberOfDisks_; d <= numberOfDisks_; d++) {
171  if (d == 0)
172  continue;
173  //Endcap
174  int offset = numberOfDisks_;
175  if (d > 0)
176  offset--;
177 
178  histoName.str("");
179  histoName << "ClusterSizeIn1Bin_Ring_vs_Segment_Disk"
180  << d; // ClusterSize in first bin norm. by Entries (2D Roll vs Sector)
181  auto me = RPCRollMapHisto::bookEndcap(ibooker, d, histoName.str(), histoName.str(), useRollInfo_);
182  CLSDisk[d + offset] = dynamic_cast<MonitorElement*>(me);
183 
184  if (testMode_) {
185  histoName.str("");
186  histoName << "ClusterSizeIn1Bin_Distribution_Disk" << d; // ClusterSize in first bin, distribution
187  CLSDDisk[d + offset] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 20, 0.0, 1.0);
188 
189  histoName.str("");
190  histoName << "ClusterSizeMean_Distribution_Disk" << d; // Avarage ClusterSize Distribution
191  MEANDDisk[d + offset] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 10.5);
192  }
193 
194  histoName.str("");
195  histoName << "ClusterSizeMean_Ring_vs_Segment_Disk" << d; // Avarage ClusterSize (2D Roll vs Sector)
196  me = RPCRollMapHisto::bookEndcap(ibooker, d, histoName.str(), histoName.str(), useRollInfo_);
197  MEANDisk[d + offset] = dynamic_cast<MonitorElement*>(me);
198  }
199 }
MonitorElement * MEANWheel[kWheels]
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * MEANDWheel[kWheels]
MonitorElement * CLSDisk[kDisks]
MonitorElement * CLSDWheel[kWheels]
tuple d
Definition: ztail.py:151
MonitorElement * MEANDisk[kDisks]
MonitorElement * MEANDDisk[kDisks]
static MonitorElement * bookBarrel(IBooker &booker, const int wheel, const std::string &prefix, const std::string &title, const bool useRollInfo)
MonitorElement * CLSDDisk[kDisks]
T w() const
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)
MonitorElement * CLSWheel[kWheels]
void RPCClusterSizeTest::resetMEArrays ( void  )
private

Definition at line 125 of file RPCClusterSizeTest.cc.

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

Referenced by myBooker(), and RPCClusterSizeTest().

125  {
126  memset((void*)CLSWheel, 0, sizeof(MonitorElement*) * kWheels);
127  memset((void*)CLSDWheel, 0, sizeof(MonitorElement*) * kWheels);
128  memset((void*)MEANWheel, 0, sizeof(MonitorElement*) * kWheels);
129  memset((void*)MEANDWheel, 0, sizeof(MonitorElement*) * kWheels);
130 
131  memset((void*)CLSDisk, 0, sizeof(MonitorElement*) * kDisks);
132  memset((void*)CLSDDisk, 0, sizeof(MonitorElement*) * kDisks);
133  memset((void*)MEANDisk, 0, sizeof(MonitorElement*) * kDisks);
134  memset((void*)MEANDDisk, 0, sizeof(MonitorElement*) * kDisks);
135 }
MonitorElement * MEANWheel[kWheels]
MonitorElement * MEANDWheel[kWheels]
MonitorElement * CLSDisk[kDisks]
MonitorElement * CLSDWheel[kWheels]
MonitorElement * MEANDisk[kDisks]
MonitorElement * MEANDDisk[kDisks]
MonitorElement * CLSDDisk[kDisks]
MonitorElement * CLSWheel[kWheels]

Member Data Documentation

MonitorElement* RPCClusterSizeTest::CLSDDisk[kDisks]
private

Definition at line 39 of file RPCClusterSizeTest.h.

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

MonitorElement* RPCClusterSizeTest::CLSDisk[kDisks]
private

Definition at line 38 of file RPCClusterSizeTest.h.

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

MonitorElement* RPCClusterSizeTest::CLSDWheel[kWheels]
private

Definition at line 34 of file RPCClusterSizeTest.h.

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

MonitorElement* RPCClusterSizeTest::CLSWheel[kWheels]
private

Definition at line 33 of file RPCClusterSizeTest.h.

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

std::string RPCClusterSizeTest::globalFolder_
private

Definition at line 23 of file RPCClusterSizeTest.h.

Referenced by beginJob(), and myBooker().

MonitorElement* RPCClusterSizeTest::MEANDDisk[kDisks]
private

Definition at line 41 of file RPCClusterSizeTest.h.

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

MonitorElement* RPCClusterSizeTest::MEANDisk[kDisks]
private

Definition at line 40 of file RPCClusterSizeTest.h.

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

MonitorElement* RPCClusterSizeTest::MEANDWheel[kWheels]
private

Definition at line 36 of file RPCClusterSizeTest.h.

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

MonitorElement* RPCClusterSizeTest::MEANWheel[kWheels]
private

Definition at line 35 of file RPCClusterSizeTest.h.

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

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

Definition at line 29 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), and getMonitorElements().

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

Definition at line 30 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), and getMonitorElements().

int RPCClusterSizeTest::numberOfDisks_
private

Definition at line 24 of file RPCClusterSizeTest.h.

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

int RPCClusterSizeTest::numberOfRings_
private

Definition at line 25 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), and RPCClusterSizeTest().

int RPCClusterSizeTest::prescaleFactor_
private

Definition at line 26 of file RPCClusterSizeTest.h.

Referenced by RPCClusterSizeTest().

bool RPCClusterSizeTest::testMode_
private

Definition at line 27 of file RPCClusterSizeTest.h.

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

bool RPCClusterSizeTest::useRollInfo_
private

Definition at line 28 of file RPCClusterSizeTest.h.

Referenced by myBooker(), and RPCClusterSizeTest().