CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
RPCDeadChannelTest Class Reference

#include <RPCDeadChannelTest.h>

Inheritance diagram for RPCDeadChannelTest:
RPCClient

Public Member Functions

void beginJob (std::string &)
 
void clientOperation ()
 
void getMonitorElements (std::vector< MonitorElement * > &, std::vector< RPCDetId > &, std::string &)
 
void myBooker (DQMStore::IBooker &)
 
 RPCDeadChannelTest (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~RPCDeadChannelTest ()
 Destructor. More...
 
- Public Member Functions inherited from RPCClient
virtual ~RPCClient (void)
 

Private Attributes

MonitorElementDEADDisk [10]
 
MonitorElementDEADWheel [5]
 
std::string globalFolder_
 
std::vector< RPCDetIdmyDetIds_
 
std::vector< MonitorElement * > myOccupancyMe_
 
int numberOfDisks_
 
int numberOfRings_
 
int prescaleFactor_
 
bool useRollInfo_
 

Detailed Description

Definition at line 10 of file RPCDeadChannelTest.h.

Constructor & Destructor Documentation

RPCDeadChannelTest::RPCDeadChannelTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 13 of file RPCDeadChannelTest.cc.

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

13  {
14 
15  edm::LogVerbatim ("rpcdeadchanneltest") << "[RPCDeadChannelTest]: Constructor";
16 
17  useRollInfo_ = ps.getUntrackedParameter<bool>("UseRollInfo", false);
18 
19  prescaleFactor_ = ps.getUntrackedParameter<int>("DiagnosticPrescale", 1);
20  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
21  numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
22 }
T getUntrackedParameter(std::string const &, T const &) const
RPCDeadChannelTest::~RPCDeadChannelTest ( )
virtual

Destructor.

Definition at line 24 of file RPCDeadChannelTest.cc.

24 {}

Member Function Documentation

void RPCDeadChannelTest::beginJob ( std::string &  workingFolder)
virtual

Implements RPCClient.

Definition at line 26 of file RPCDeadChannelTest.cc.

References globalFolder_.

26  {
27  edm::LogVerbatim ("rpcdeadchanneltest") << "[RPCDeadChannelTest]: Begin Job";
28  globalFolder_ = workingFolder;
29 
30 }
void RPCDeadChannelTest::clientOperation ( )
virtual

Implements RPCClient.

Definition at line 47 of file RPCDeadChannelTest.cc.

References DEADDisk, DEADWheel, rpcdqm::utils::detId2RollNr(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), MonitorElement::getQReport(), QReport::getQTresult(), i, myDetIds_, myOccupancyMe_, NULL, numberOfDisks_, numberOfRings_, RPCDetId::region(), RPCDetId::ring(), RPCDetId::roll(), RPCDetId::sector(), RPCGeomServ::segment(), MonitorElement::setBinContent(), RPCDetId::station(), x, and cuy::yBin.

47  {
48 
49  edm::LogVerbatim ("rpcdeadchanneltest") <<"[RPCDeadChannelTest]:Client Operation";
50 
51 
52  MonitorElement * DEAD = NULL;
53 
54  //Loop on chambers
55  for (unsigned int i = 0 ; i<myOccupancyMe_.size();i++){
56 
57  RPCDetId & detId = myDetIds_[i];
59 
60  if (! myMe ) continue;
61 
62  const QReport * theOccupancyQReport = myMe->getQReport("DeadChannel_0");
63 
64  float deadFraction = 0.0 ;
65 
66  if(theOccupancyQReport) {
67 
68  float qtresult = theOccupancyQReport->getQTresult();
69  // std::vector<dqm::me_util::Channel> badChannels = theOccupancyQReport->getBadChannels();
70  deadFraction = 1.0 - qtresult;
71 
72  }else{
73  int xBins = myMe->getNbinsX();
74  float emptyBins = 0.0;
75  for(int x = 1 ; x<= xBins ; x++){if(myMe->getBinContent(x) == 0 ) {emptyBins++;}}
76  if (xBins != 0){ deadFraction = emptyBins/xBins;}
77  }
78 
79  if (detId.region()==0) DEAD = DEADWheel[detId.ring() + 2] ;
80  else{
81  if(-detId.station()+ numberOfDisks_ >= 0 ){
82 
83  if(detId.region()<0){
84  DEAD = DEADDisk[-detId.station() + numberOfDisks_];
85  }else{
86  DEAD = DEADDisk[detId.station() + numberOfDisks_-1];
87  }
88  }
89  }
90 
91  if (DEAD){
92  int xBin,yBin;
93  if(detId.region()==0){//Barrel
94  xBin= detId.sector();
95  rpcdqm::utils rollNumber;
96  yBin = rollNumber.detId2RollNr(detId);
97  }else{//Endcap
98  //get segment number
99  RPCGeomServ RPCServ(detId);
100  xBin = RPCServ.segment();
101  (numberOfRings_ == 3 ? yBin= detId.ring()*3-detId.roll()+1 : yBin= (detId.ring()-1)*3-detId.roll()+1);
102  }
103  DEAD->setBinContent(xBin,yBin, deadFraction );
104 
105  }
106 
107  }//End loop on rolls in given chambers
108 
109 }
int i
Definition: DBlmapReader.cc:9
const QReport * getQReport(const std::string &qtname) const
get QReport corresponding to &lt;qtname&gt; (null pointer if QReport does not exist)
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * DEADWheel[5]
tuple yBin
Definition: cuy.py:891
#define NULL
Definition: scimark2.h:8
int roll() const
Definition: RPCDetId.h:120
int ring() const
Definition: RPCDetId.h:72
std::vector< MonitorElement * > myOccupancyMe_
int detId2RollNr(const RPCDetId &_id)
Definition: utils.h:18
std::vector< RPCDetId > myDetIds_
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:102
float getQTresult(void) const
get test result i.e. prob value
Definition: QReport.h:20
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
MonitorElement * DEADDisk[10]
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
void RPCDeadChannelTest::getMonitorElements ( std::vector< MonitorElement * > &  meVector,
std::vector< RPCDetId > &  detIdVector,
std::string &  clientHistoName 
)
virtual

Implements RPCClient.

Definition at line 33 of file RPCDeadChannelTest.cc.

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

33  {
34 
35  for (unsigned int i = 0 ; i<meVector.size(); i++){
36 
37  std::string meName = meVector[i]->getName();
38 
39  if(meName.find(clientHistoName) != std::string::npos){
40  myOccupancyMe_.push_back(meVector[i]);
41  myDetIds_.push_back(detIdVector[i]);
42  }
43  }
44 }
int i
Definition: DBlmapReader.cc:9
std::vector< MonitorElement * > myOccupancyMe_
std::vector< RPCDetId > myDetIds_
void RPCDeadChannelTest::myBooker ( DQMStore::IBooker ibooker)
virtual

Implements RPCClient.

Definition at line 111 of file RPCDeadChannelTest.cc.

References DQMStore::IBooker::book2D(), DEADDisk, DEADWheel, globalFolder_, i, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), MessageLogger_cff::limit, numberOfDisks_, numberOfRings_, hltrates_dqm_sourceclient-live_cfg::offset, MonitorElement::setBinContent(), DQMStore::IBooker::setCurrentFolder(), useRollInfo_, x, and y.

111  {
112 
114 
115  std::stringstream histoName;
116 
117  rpcdqm::utils rpcUtils;
118 
119  int limit = numberOfDisks_;
120  if(numberOfDisks_ < 2) limit = 2;
121 
122  for (int i = -1 * limit; i<= limit;i++ ){//loop on wheels and disks
123  if (i>-3 && i<3){//wheels
124  histoName.str("");
125  histoName<<"DeadChannelFraction_Roll_vs_Sector_Wheel"<<i;
126  DEADWheel[i+2] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
127 
128  for (int x = 1; x<=12; x++){
129  for(int y=1; y<=21; y++){
130  DEADWheel[i+2]->setBinContent(x,y,-1);
131  }
132  }
133 
134  rpcUtils.labelXAxisSector( DEADWheel[i+2]);
135  rpcUtils.labelYAxisRoll( DEADWheel[i+2], 0, i, useRollInfo_);
136  }//end wheels
137 
138  if (i == 0 || i > numberOfDisks_ || i< (-1 * numberOfDisks_)){continue;}
139 
140  int offset = numberOfDisks_;
141  if (i>0) {offset --;} //used to skip case equale to zero
142 
143  histoName.str("");
144  histoName<<"DeadChannelFraction_Ring_vs_Segment_Disk"<<i;
145  DEADDisk[i+offset] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str(),36, 0.5, 36.5, 3*numberOfRings_, 0.5,3*numberOfRings_+ 0.5);
146 
147  rpcUtils.labelXAxisSegment(DEADDisk[i+offset]);
148  rpcUtils.labelYAxisRing(DEADDisk[i+offset], numberOfRings_ ,useRollInfo_);
149 
150  }//end loop on wheels and disks
151 
152 
153 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * DEADWheel[5]
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:250
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:268
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:295
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:236
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * DEADDisk[10]

Member Data Documentation

MonitorElement* RPCDeadChannelTest::DEADDisk[10]
private

Definition at line 36 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), and myBooker().

MonitorElement* RPCDeadChannelTest::DEADWheel[5]
private

Definition at line 35 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), and myBooker().

std::string RPCDeadChannelTest::globalFolder_
private

Definition at line 28 of file RPCDeadChannelTest.h.

Referenced by beginJob(), and myBooker().

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

Definition at line 30 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), and getMonitorElements().

std::vector<MonitorElement *> RPCDeadChannelTest::myOccupancyMe_
private

Definition at line 29 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), and getMonitorElements().

int RPCDeadChannelTest::numberOfDisks_
private

Definition at line 33 of file RPCDeadChannelTest.h.

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

int RPCDeadChannelTest::numberOfRings_
private

Definition at line 34 of file RPCDeadChannelTest.h.

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

int RPCDeadChannelTest::prescaleFactor_
private

Definition at line 27 of file RPCDeadChannelTest.h.

Referenced by RPCDeadChannelTest().

bool RPCDeadChannelTest::useRollInfo_
private

Definition at line 31 of file RPCDeadChannelTest.h.

Referenced by myBooker(), and RPCDeadChannelTest().