CMS 3D CMS Logo

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

#include <RPCNoisyStripTest.h>

Inheritance diagram for RPCNoisyStripTest:
RPCClient

Public Member Functions

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

Protected Member Functions

void fillGlobalME (RPCDetId &, MonitorElement *)
 

Private Attributes

MonitorElementDEVDDisk [10]
 
MonitorElementDEVDWheel [5]
 
std::string globalFolder_
 
std::vector< RPCDetIdmyDetIds_
 
std::vector< MonitorElement * > myOccupancyMe_
 
MonitorElementNOISEDDisk [10]
 
MonitorElementNOISEDisk [10]
 
MonitorElementNOISEDWheel [5]
 
MonitorElementNOISEWheel [5]
 
int numberOfDisks_
 
int numberOfRings_
 
int prescaleFactor_
 
bool testMode_
 
bool useRollInfo_
 

Detailed Description

Definition at line 10 of file RPCNoisyStripTest.h.

Constructor & Destructor Documentation

RPCNoisyStripTest::RPCNoisyStripTest ( const edm::ParameterSet ps)

Definition at line 15 of file RPCNoisyStripTest.cc.

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

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

Definition at line 26 of file RPCNoisyStripTest.cc.

26 {}

Member Function Documentation

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

Implements RPCClient.

Definition at line 28 of file RPCNoisyStripTest.cc.

References globalFolder_.

28  {
29  edm::LogVerbatim ("rpcnoisetest") << "[RPCNoisyStripTest]: Begin job ";
30  globalFolder_ = workingFolder;
31 }
std::string globalFolder_
void RPCNoisyStripTest::clientOperation ( )
virtual

Implements RPCClient.

Definition at line 34 of file RPCNoisyStripTest.cc.

References fillGlobalME(), i, myDetIds_, and myOccupancyMe_.

34  {
35 
36  edm::LogVerbatim ("rpcnoisetest") <<"[RPCNoisyStripTest]: Client Operation";
37 
38  //Loop on MEs
39  for (unsigned int i = 0 ; i<myOccupancyMe_.size();i++){
41  }//End loop on MEs
42 
43 }
int i
Definition: DBlmapReader.cc:9
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myOccupancyMe_
void fillGlobalME(RPCDetId &, MonitorElement *)
void RPCNoisyStripTest::fillGlobalME ( RPCDetId detId,
MonitorElement myMe 
)
protected

Definition at line 121 of file RPCNoisyStripTest.cc.

References rpcdqm::utils::detId2RollNr(), DEVDDisk, DEVDWheel, MonitorElement::Fill(), HcalObjRepresent::Fill(), MonitorElement::getBinContent(), i, sistrip::NOISE, NOISEDDisk, NOISEDisk, NOISEDWheel, NOISEWheel, NULL, numberOfDisks_, numberOfRings_, RPCDetId::region(), RPCDetId::ring(), RPCDetId::roll(), RPCDetId::sector(), RPCGeomServ::segment(), MonitorElement::setBinContent(), RPCDetId::station(), testMode_, and cuy::yBin.

Referenced by clientOperation().

121  {
122 
123  std::stringstream meName;
124 
126  MonitorElement * DEVD=NULL;
127  MonitorElement * NOISED=NULL;
128 
129  if (detId.region()==0) { //BARREL
130  NOISE = NOISEWheel[detId.ring()+2];
131  if(testMode_) {
132  DEVD = DEVDWheel[detId.ring()+2];
133  NOISED= NOISEDWheel[detId.ring()+2];
134  }
135  }else if(detId.region()<0 && (-detId.station() + numberOfDisks_) >= 0 ){//ENDCAP-
136  NOISE = NOISEDisk[ -detId.station() + numberOfDisks_];
137  if(testMode_) {
138  DEVD = DEVDDisk[ -detId.station() + numberOfDisks_];
139  NOISED= NOISEDDisk[-detId.station() + numberOfDisks_];
140  }
141  }else if((-detId.station() + numberOfDisks_)>= 0 ){//ENDCAP +
142  NOISE = NOISEDisk[detId.station() + numberOfDisks_-1];
143  if(testMode_) {
144  DEVD = DEVDDisk[detId.station() + numberOfDisks_-1];
145  NOISED= NOISEDDisk[detId.station() + numberOfDisks_-1];
146  }
147  }
148 
149 
150  int entries = (int) myMe -> getEntries();
151  int bins = (int) myMe ->getNbinsX();
152 
153  std::vector<float> myvector;
154 
155  // count alive strips and alive strip values put in the vector
156  for(int xbin =1 ; xbin <= bins ; xbin++) {
157  float binContent = myMe->getBinContent(xbin);
158  if (binContent > 0) myvector.push_back(binContent);
159  }
160 
161 
162  int noisyStrips=0;
163  // calculate mean on YAxis and check diff between bins and mean
164  if (myvector.size()>0) {
165  float ymean = entries/myvector.size(); //mean on Yaxis
166  for(unsigned int i=0; i<myvector.size(); i++) {
167  float deviation = myvector[i]/ymean;
168  if(deviation > 3.5) noisyStrips++;
169  if(deviation > 5) deviation = 5; //overflow
170  if(DEVD) DEVD-> Fill(deviation);
171  }
172 
173 
174  int xBin,yBin;
175  if(detId.region()==0){//Barrel
176  xBin= detId.sector();
177  rpcdqm::utils rollNumber;
178  yBin = rollNumber.detId2RollNr(detId);
179  }else{//Endcap
180  //get segment number
181  RPCGeomServ RPCServ(detId);
182  xBin = RPCServ.segment();
183  (numberOfRings_ == 3 ? yBin= detId.ring()*3-detId.roll()+1 : yBin= (detId.ring()-1)*3-detId.roll()+1);
184  }
185 
186  if(NOISE) NOISE->setBinContent(xBin,yBin,noisyStrips);
187  if(NOISED) NOISED ->Fill(noisyStrips);
188 
189  }
190 
191 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
tuple yBin
Definition: cuy.py:891
#define NULL
Definition: scimark2.h:8
MonitorElement * NOISEDDisk[10]
void Fill(long long x)
int roll() const
Definition: RPCDetId.h:120
MonitorElement * NOISEDWheel[5]
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int ring() const
Definition: RPCDetId.h:72
MonitorElement * DEVDWheel[5]
int detId2RollNr(const RPCDetId &_id)
Definition: utils.h:18
MonitorElement * NOISEDisk[10]
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:102
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * DEVDDisk[10]
MonitorElement * NOISEWheel[5]
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
void RPCNoisyStripTest::getMonitorElements ( std::vector< MonitorElement * > &  meVector,
std::vector< RPCDetId > &  detIdVector,
std::string &  clientHistoName 
)
virtual

Implements RPCClient.

Definition at line 105 of file RPCNoisyStripTest.cc.

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

105  {
106 
107  //Get NumberOfDigi ME for each roll
108  for (unsigned int i = 0 ; i<meVector.size(); i++){
109 
110  std::string meName = meVector[i]->getName();
111 
112  if(meName.find(clientHistoName) != std::string::npos){
113 
114  myOccupancyMe_.push_back(meVector[i]);
115  myDetIds_.push_back(detIdVector[i]);
116  }
117  }
118 
119 }
int i
Definition: DBlmapReader.cc:9
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myOccupancyMe_
void RPCNoisyStripTest::myBooker ( DQMStore::IBooker ibooker)
virtual

Implements RPCClient.

Definition at line 45 of file RPCNoisyStripTest.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), ztail::d, DEVDDisk, DEVDWheel, globalFolder_, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), NOISEDDisk, NOISEDisk, NOISEDWheel, NOISEWheel, numberOfDisks_, numberOfRings_, hltrates_dqm_sourceclient-live_cfg::offset, DQMStore::IBooker::setCurrentFolder(), testMode_, useRollInfo_, and w.

45  {
46 
47 
49 
50  std::stringstream histoName;
51 
52  rpcdqm::utils rpcUtils;
53 
54  for (int w = -2; w<= 2;w++ ){//loop on wheels and disks
55 
56  if(testMode_){
57  histoName.str("");
58  histoName<<"RPCNoisyStrips_Distribution_Wheel"<<w;
59  NOISEDWheel[w+2] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 6, -0.5, 5.5);
60 
61 
62  histoName.str("");
63  histoName<<"RPCStripsDeviation_Distribution_Wheel"<<w;
64  DEVDWheel[w+2] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 101, -0.01, 10.01);
65  }
66 
67  histoName.str("");
68  histoName<<"RPCNoisyStrips_Roll_vs_Sector_Wheel"<<w;
69  NOISEWheel[w+2] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str() , 12, 0.5, 12.5, 21, 0.5, 21.5);
70  rpcUtils.labelXAxisSector(NOISEWheel[w+2]);
71  rpcUtils.labelYAxisRoll(NOISEWheel[w+2], 0, w, useRollInfo_);
72  }
73 
74 
75 
76  for(int d = -numberOfDisks_; d<=numberOfDisks_; d++ ){//ENDCAP
77 
78  if (d == 0) continue;
79 
80  int offset = numberOfDisks_;
81  if (d>0) offset --;
82 
83  if (testMode_){
84  histoName.str("");
85  histoName<<"RPCNoisyStrips_Distribution_Disk"<<d;
86  NOISEDDisk[d+offset] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 6, -0.5, 5.5);
87 
88 
89  histoName.str("");
90  histoName<<"RPCStripsDeviation_Distribution_Disk"<<d;
91  DEVDDisk[d+offset] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 101, -0.01, 10.01);
92  }
93 
94  histoName.str("");
95  histoName<<"RPCNoisyStrips_Ring_vs_Segment_Disk"<<d;
96  NOISEDisk[d+offset] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str() , 36, 0.5, 36.5, 3*numberOfRings_, 0.5,3*numberOfRings_+ 0.5);
97  rpcUtils.labelXAxisSegment(NOISEDisk[d+offset]);
99 
100  }
101 
102 }
const double w
Definition: UKUtility.cc:23
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:250
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:268
MonitorElement * NOISEDDisk[10]
std::string globalFolder_
tuple d
Definition: ztail.py:151
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:295
MonitorElement * NOISEDWheel[5]
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:236
MonitorElement * DEVDWheel[5]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * NOISEDisk[10]
MonitorElement * DEVDDisk[10]
MonitorElement * NOISEWheel[5]

Member Data Documentation

MonitorElement* RPCNoisyStripTest::DEVDDisk[10]
private

Definition at line 43 of file RPCNoisyStripTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCNoisyStripTest::DEVDWheel[5]
private

Definition at line 39 of file RPCNoisyStripTest.h.

Referenced by fillGlobalME(), and myBooker().

std::string RPCNoisyStripTest::globalFolder_
private

Definition at line 29 of file RPCNoisyStripTest.h.

Referenced by beginJob(), and myBooker().

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

Definition at line 35 of file RPCNoisyStripTest.h.

Referenced by clientOperation(), and getMonitorElements().

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

Definition at line 34 of file RPCNoisyStripTest.h.

Referenced by clientOperation(), and getMonitorElements().

MonitorElement* RPCNoisyStripTest::NOISEDDisk[10]
private

Definition at line 42 of file RPCNoisyStripTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCNoisyStripTest::NOISEDisk[10]
private

Definition at line 41 of file RPCNoisyStripTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCNoisyStripTest::NOISEDWheel[5]
private

Definition at line 38 of file RPCNoisyStripTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCNoisyStripTest::NOISEWheel[5]
private

Definition at line 37 of file RPCNoisyStripTest.h.

Referenced by fillGlobalME(), and myBooker().

int RPCNoisyStripTest::numberOfDisks_
private

Definition at line 44 of file RPCNoisyStripTest.h.

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

int RPCNoisyStripTest::numberOfRings_
private

Definition at line 30 of file RPCNoisyStripTest.h.

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

int RPCNoisyStripTest::prescaleFactor_
private

Definition at line 31 of file RPCNoisyStripTest.h.

Referenced by RPCNoisyStripTest().

bool RPCNoisyStripTest::testMode_
private

Definition at line 32 of file RPCNoisyStripTest.h.

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

bool RPCNoisyStripTest::useRollInfo_
private

Definition at line 36 of file RPCNoisyStripTest.h.

Referenced by myBooker(), and RPCNoisyStripTest().