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 analyze (const edm::Event &, const edm::EventSetup &)
 Analyze. More...
 
void beginJob (DQMStore *, std::string)
 BeginJob. More...
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 Begin Lumi block. More...
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 
void clientOperation (edm::EventSetup const &c)
 
void endJob ()
 Endjob. More...
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 End Lumi Block. More...
 
void endRun (const edm::Run &, const edm::EventSetup &)
 
void getMonitorElements (std::vector< MonitorElement * > &, std::vector< RPCDetId > &)
 
 RPCDeadChannelTest (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~RPCDeadChannelTest ()
 Destructor. More...
 
- Public Member Functions inherited from RPCClient
virtual ~RPCClient (void)
 

Private Attributes

DQMStoredbe_
 
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 16 of file RPCDeadChannelTest.cc.

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

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

Destructor.

Definition at line 27 of file RPCDeadChannelTest.cc.

References dbe_.

27 {dbe_ = 0;}

Member Function Documentation

void RPCDeadChannelTest::analyze ( const edm::Event iEvent,
const edm::EventSetup c 
)
virtual

Analyze.

Implements RPCClient.

Definition at line 70 of file RPCDeadChannelTest.cc.

70 {}
void RPCDeadChannelTest::beginJob ( DQMStore dbe,
std::string  workingFolder 
)
virtual

BeginJob.

Implements RPCClient.

Definition at line 29 of file RPCDeadChannelTest.cc.

References dbe_, and globalFolder_.

29  {
30  edm::LogVerbatim ("rpcdeadchanneltest") << "[RPCDeadChannelTest]: Begin Job";
31  globalFolder_ = workingFolder;
32  dbe_=dbe;
33 }
void RPCDeadChannelTest::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
virtual

Begin Lumi block.

Implements RPCClient.

Definition at line 68 of file RPCDeadChannelTest.cc.

68 {}
void RPCDeadChannelTest::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Implements RPCClient.

Definition at line 139 of file RPCDeadChannelTest.cc.

References DQMStore::book2D(), dbe_, DEADDisk, DEADWheel, DQMStore::get(), MonitorElement::getName(), globalFolder_, i, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), MessageLogger_cff::limit, numberOfDisks_, numberOfRings_, evf::evtn::offset(), DQMStore::removeElement(), DQMStore::setCurrentFolder(), useRollInfo_, x, and detailsBasic3DVector::y.

139  {
140 
141  MonitorElement* me;
143 
144  std::stringstream histoName;
145 
146  rpcdqm::utils rpcUtils;
147 
148  int limit = numberOfDisks_;
149  if(numberOfDisks_ < 2) limit = 2;
150 
151  for (int i = -1 * limit; i<= limit;i++ ){//loop on wheels and disks
152  if (i>-3 && i<3){//wheels
153  histoName.str("");
154  histoName<<"DeadChannelFraction_Roll_vs_Sector_Wheel"<<i;
155  me = 0;
156  me = dbe_->get(globalFolder_ +"/"+ histoName.str());
157  if (0!=me ) {
158  dbe_->removeElement(me->getName());
159  }
160  DEADWheel[i+2] = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
161 
162  for (int x = 1; x<=12; x++)
163  for(int y=1; y<=21; y++)
164  DEADWheel[i+2]->setBinContent(x,y,-1);
165 
166  rpcUtils.labelXAxisSector( DEADWheel[i+2]);
167  rpcUtils.labelYAxisRoll( DEADWheel[i+2], 0, i, useRollInfo_);
168  }//end wheels
169 
170  if (i == 0 || i > numberOfDisks_ || i< (-1 * numberOfDisks_))continue;
171 
172  int offset = numberOfDisks_;
173  if (i>0) offset --; //used to skip case equale to zero
174 
175  histoName.str("");
176  histoName<<"DeadChannelFraction_Ring_vs_Segment_Disk"<<i;
177  me = 0;
178  me = dbe_->get(globalFolder_ +"/"+ histoName.str());
179  if (0!=me ) {
180  dbe_->removeElement(me->getName());
181  }
182 
183  DEADDisk[i+offset] = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str(),36, 0.5, 36.5, 3*numberOfRings_, 0.5,3*numberOfRings_+ 0.5);
184 
185  rpcUtils.labelXAxisSegment(DEADDisk[i+offset]);
186  rpcUtils.labelYAxisRing(DEADDisk[i+offset], numberOfRings_ ,useRollInfo_);
187 
188 
189  }//end loop on wheels and disks
190 
191 
192 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
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 removeElement(const std::string &name)
Definition: DQMStore.cc:2986
unsigned int offset(bool)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1679
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:236
Definition: DDAxes.h:10
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1056
MonitorElement * DEADDisk[10]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:639
void RPCDeadChannelTest::clientOperation ( edm::EventSetup const &  c)
virtual

Implements RPCClient.

Definition at line 74 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.

74  {
75 
76  edm::LogVerbatim ("rpcdeadchanneltest") <<"[RPCDeadChannelTest]:Client Operation";
77 
78 
79  MonitorElement * DEAD = NULL;
80 
81 
82  //Loop on chambers
83  for (unsigned int i = 0 ; i<myOccupancyMe_.size();i++){
84 
85  RPCDetId & detId = myDetIds_[i];
87 
88  if (! myMe ) continue;
89 
90  const QReport * theOccupancyQReport = myMe->getQReport("DeadChannel_0");
91 
92  float deadFraction = 0.0 ;
93 
94  if(theOccupancyQReport) {
95 
96  float qtresult = theOccupancyQReport->getQTresult();
97  // std::vector<dqm::me_util::Channel> badChannels = theOccupancyQReport->getBadChannels();
98  deadFraction = 1.0 - qtresult;
99 
100  }else{
101  int xBins = myMe->getNbinsX();
102  float emptyBins = 0.0;
103  for(int x = 1 ; x<= xBins ; x++){if(myMe->getBinContent(x) == 0 ) {emptyBins++;}}
104  if (xBins != 0){ deadFraction = emptyBins/xBins;}
105  }
106 
107  if (detId.region()==0) DEAD = DEADWheel[detId.ring() + 2] ;
108  else{
109  if(-detId.station()+ numberOfDisks_ >= 0 ){
110 
111  if(detId.region()<0){
112  DEAD = DEADDisk[-detId.station() + numberOfDisks_];
113  }else{
114  DEAD = DEADDisk[detId.station() + numberOfDisks_-1];
115  }
116  }
117  }
118 
119  if (DEAD){
120  int xBin,yBin;
121  if(detId.region()==0){//Barrel
122  xBin= detId.sector();
123  rpcdqm::utils rollNumber;
124  yBin = rollNumber.detId2RollNr(detId);
125  }else{//Endcap
126  //get segment number
127  RPCGeomServ RPCServ(detId);
128  xBin = RPCServ.segment();
129  (numberOfRings_ == 3 ? yBin= detId.ring()*3-detId.roll()+1 : yBin= (detId.ring()-1)*3-detId.roll()+1);
130  }
131  DEAD->setBinContent(xBin,yBin, deadFraction );
132 
133  }
134 
135  }//End loop on rolls in given chambers
136 
137 }
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
Definition: DDAxes.h:10
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::endJob ( void  )
virtual

Endjob.

Implements RPCClient.

Definition at line 194 of file RPCDeadChannelTest.cc.

194 {}
void RPCDeadChannelTest::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  iSetup 
)
virtual

End Lumi Block.

Implements RPCClient.

Definition at line 72 of file RPCDeadChannelTest.cc.

72 {}
void RPCDeadChannelTest::endRun ( const edm::Run r,
const edm::EventSetup iSetup 
)
virtual

Implements RPCClient.

Definition at line 35 of file RPCDeadChannelTest.cc.

35  {
36 
37  edm::LogVerbatim ("rpcdeadchanneltest") << "[RPCDeadChannelTest]: End run";
38 
39 }
void RPCDeadChannelTest::getMonitorElements ( std::vector< MonitorElement * > &  meVector,
std::vector< RPCDetId > &  detIdVector 
)
virtual

Implements RPCClient.

Definition at line 42 of file RPCDeadChannelTest.cc.

References i, myDetIds_, myOccupancyMe_, and rpcdqm::OCCUPANCY.

42  {
43 
44  //Get Occupancy ME for each roll
45 
46  for (unsigned int i = 0 ; i<meVector.size(); i++){
47 
48  bool flag= false;
49 
50  DQMNet::TagList tagList;
51  tagList = meVector[i]->getTags();
52  DQMNet::TagList::iterator tagItr = tagList.begin();
53 
54  while (tagItr != tagList.end() && !flag ) {
55  if((*tagItr) == rpcdqm::OCCUPANCY)
56  flag= true;
57 
58  tagItr++;
59  }
60 
61  if(flag){
62  myOccupancyMe_.push_back(meVector[i]);
63  myDetIds_.push_back(detIdVector[i]);
64  }
65  }
66 }
int i
Definition: DBlmapReader.cc:9
std::vector< MonitorElement * > myOccupancyMe_
std::vector< uint32_t > TagList
Definition: DQMNet.h:83
std::vector< RPCDetId > myDetIds_

Member Data Documentation

DQMStore* RPCDeadChannelTest::dbe_
private

Definition at line 56 of file RPCDeadChannelTest.h.

Referenced by beginJob(), beginRun(), and ~RPCDeadChannelTest().

MonitorElement* RPCDeadChannelTest::DEADDisk[10]
private

Definition at line 62 of file RPCDeadChannelTest.h.

Referenced by beginRun(), and clientOperation().

MonitorElement* RPCDeadChannelTest::DEADWheel[5]
private

Definition at line 61 of file RPCDeadChannelTest.h.

Referenced by beginRun(), and clientOperation().

std::string RPCDeadChannelTest::globalFolder_
private

Definition at line 52 of file RPCDeadChannelTest.h.

Referenced by beginJob(), and beginRun().

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

Definition at line 54 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), and getMonitorElements().

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

Definition at line 53 of file RPCDeadChannelTest.h.

Referenced by clientOperation(), and getMonitorElements().

int RPCDeadChannelTest::numberOfDisks_
private

Definition at line 59 of file RPCDeadChannelTest.h.

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

int RPCDeadChannelTest::numberOfRings_
private

Definition at line 60 of file RPCDeadChannelTest.h.

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

int RPCDeadChannelTest::prescaleFactor_
private

Definition at line 51 of file RPCDeadChannelTest.h.

Referenced by RPCDeadChannelTest().

bool RPCDeadChannelTest::useRollInfo_
private

Definition at line 55 of file RPCDeadChannelTest.h.

Referenced by beginRun(), and RPCDeadChannelTest().