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 analyze (const edm::Event &iEvent, const edm::EventSetup &c)
 
void beginJob (DQMStore *, std::string)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 
void clientOperation (edm::EventSetup const &c)
 
void endJob ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
 
void endRun (const edm::Run &, const edm::EventSetup &)
 
void getMonitorElements (std::vector< MonitorElement * > &, std::vector< RPCDetId > &)
 
 RPCNoisyStripTest (const edm::ParameterSet &ps)
 
virtual ~RPCNoisyStripTest ()
 
- Public Member Functions inherited from RPCClient
virtual ~RPCClient (void)
 

Protected Member Functions

void fillGlobalME (RPCDetId &, MonitorElement *, edm::EventSetup const &)
 

Private Attributes

DQMStoredbe_
 
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.

References dbe_.

26 {dbe_=0;}

Member Function Documentation

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

Implements RPCClient.

Definition at line 42 of file RPCNoisyStripTest.cc.

42 {}
void RPCNoisyStripTest::beginJob ( DQMStore dbe,
std::string  workingFolder 
)
virtual

Implements RPCClient.

Definition at line 28 of file RPCNoisyStripTest.cc.

References dbe_, and globalFolder_.

28  {
29  edm::LogVerbatim ("rpcnoisetest") << "[RPCNoisyStripTest]: Begin job ";
30  dbe_ = dbe;
31 
32  globalFolder_ = workingFolder;
33 }
std::string globalFolder_
void RPCNoisyStripTest::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
virtual

Implements RPCClient.

Definition at line 40 of file RPCNoisyStripTest.cc.

40 {}
void RPCNoisyStripTest::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Implements RPCClient.

Definition at line 57 of file RPCNoisyStripTest.cc.

References DQMStore::book1D(), DQMStore::book2D(), dbe_, DEVDDisk, DEVDWheel, DQMStore::get(), MonitorElement::getName(), globalFolder_, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), NOISEDDisk, NOISEDisk, NOISEDWheel, NOISEWheel, numberOfDisks_, numberOfRings_, evf::evtn::offset(), DQMStore::removeElement(), DQMStore::setCurrentFolder(), testMode_, useRollInfo_, and w.

57  {
58 
59 
60  MonitorElement* me;
62 
63  std::stringstream histoName;
64 
65  rpcdqm::utils rpcUtils;
66 
67  for (int w = -2; w<= 2;w++ ){//loop on wheels and disks
68 
69  if(testMode_){
70  histoName.str("");
71  histoName<<"RPCNoisyStrips_Distribution_Wheel"<<w;
72  me =0;
73  me = dbe_->get( globalFolder_ +"/"+ histoName.str());
74  if ( 0!=me ) {
75  dbe_->removeElement(me->getName());
76  }
77  NOISEDWheel[w+2] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 6, -0.5, 5.5);
78 
79 
80  histoName.str("");
81  histoName<<"RPCStripsDeviation_Distribution_Wheel"<<w;
82  me =0;
83  me = dbe_->get( globalFolder_ +"/"+ histoName.str());
84  if ( 0!=me ) {
85  dbe_->removeElement(me->getName());
86  }
87  DEVDWheel[w+2] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 101, -0.01, 10.01);
88  }
89 
90  histoName.str("");
91  histoName<<"RPCNoisyStrips_Roll_vs_Sector_Wheel"<<w;
92  me =0;
93  me = dbe_->get( globalFolder_ +"/"+ histoName.str());
94  if ( 0!=me ) {
95  dbe_->removeElement(me->getName());
96  }
97 
98  NOISEWheel[w+2] = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str() , 12, 0.5, 12.5, 21, 0.5, 21.5);
99  rpcUtils.labelXAxisSector(NOISEWheel[w+2]);
100  rpcUtils.labelYAxisRoll(NOISEWheel[w+2], 0, w, useRollInfo_);
101  }
102 
103 
104 
105  for(int d = -numberOfDisks_; d<=numberOfDisks_; d++ ){//ENDCAP
106 
107  if (d == 0) continue;
108 
109  int offset = numberOfDisks_;
110  if (d>0) offset --;
111 
112  if (testMode_){
113  histoName.str("");
114  histoName<<"RPCNoisyStrips_Distribution_Disk"<<d;
115  me =0;
116  me = dbe_->get( globalFolder_ +"/"+ histoName.str());
117  if ( 0!=me ) {
118  dbe_->removeElement(me->getName());
119  }
120  NOISEDDisk[d+offset] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 6, -0.5, 5.5);
121 
122 
123  histoName.str("");
124  histoName<<"RPCStripsDeviation_Distribution_Disk"<<d;
125  me =0;
126  me = dbe_->get( globalFolder_ +"/"+ histoName.str());
127  if ( 0!=me ) {
128  dbe_->removeElement(me->getName());
129  }
130  DEVDDisk[d+offset] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 101, -0.01, 10.01);
131  }
132 
133  histoName.str("");
134  histoName<<"RPCNoisyStrips_Ring_vs_Segment_Disk"<<d;
135  me =0;
136  me = dbe_->get( globalFolder_ +"/"+ histoName.str());
137  if ( 0!=me ) {
138  dbe_->removeElement(me->getName());
139  }
140 
141  NOISEDisk[d+offset] = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str() , 36, 0.5, 36.5, 3*numberOfRings_, 0.5,3*numberOfRings_+ 0.5);
142  rpcUtils.labelXAxisSegment(NOISEDisk[d+offset]);
143  rpcUtils.labelYAxisRing(NOISEDisk[d+offset], numberOfRings_, useRollInfo_);
144 
145  }
146 
147 }
const std::string & getName(void) const
get name of ME
const double w
Definition: UKUtility.cc:23
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
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_
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:295
MonitorElement * NOISEDWheel[5]
void removeElement(const std::string &name)
Definition: DQMStore.cc:3143
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:1708
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:236
MonitorElement * DEVDWheel[5]
MonitorElement * NOISEDisk[10]
MonitorElement * DEVDDisk[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:1082
MonitorElement * NOISEWheel[5]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
void RPCNoisyStripTest::clientOperation ( edm::EventSetup const &  c)
virtual

Implements RPCClient.

Definition at line 46 of file RPCNoisyStripTest.cc.

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

46  {
47 
48  edm::LogVerbatim ("rpcnoisetest") <<"[RPCNoisyStripTest]: Client Operation";
49 
50  //Loop on MEs
51  for (unsigned int i = 0 ; i<myOccupancyMe_.size();i++){
52  this->fillGlobalME(myDetIds_[i],myOccupancyMe_[i], iSetup);
53  }//End loop on MEs
54 
55 }
int i
Definition: DBlmapReader.cc:9
void fillGlobalME(RPCDetId &, MonitorElement *, edm::EventSetup const &)
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myOccupancyMe_
void RPCNoisyStripTest::endJob ( void  )
virtual

Implements RPCClient.

Definition at line 176 of file RPCNoisyStripTest.cc.

176 {}
void RPCNoisyStripTest::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
)
virtual

Implements RPCClient.

Definition at line 44 of file RPCNoisyStripTest.cc.

44 {}
void RPCNoisyStripTest::endRun ( const edm::Run r,
const edm::EventSetup iSetup 
)
virtual

Implements RPCClient.

Definition at line 35 of file RPCNoisyStripTest.cc.

35  {
36  edm::LogVerbatim ("rpcnoisetest") << "[RPCNoisyStripTest]: End run";
37 }
void RPCNoisyStripTest::fillGlobalME ( RPCDetId detId,
MonitorElement myMe,
edm::EventSetup const &  iSetup 
)
protected

Definition at line 178 of file RPCNoisyStripTest.cc.

References rpcdqm::utils::detId2RollNr(), DEVDDisk, DEVDWheel, python.tagInventory::entries, 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().

178  {
179 
180  // ESHandle<RPCGeometry> rpcgeo;
181 // iSetup.get<MuonGeometryRecord>().get(rpcgeo);
182 
183  std::stringstream meName;
184 
186  MonitorElement * DEVD=NULL;
187  MonitorElement * NOISED=NULL;
188 
189  if (detId.region()==0) { //BARREL
190  NOISE = NOISEWheel[detId.ring()+2];
191  if(testMode_) {
192  DEVD = DEVDWheel[detId.ring()+2];
193  NOISED= NOISEDWheel[detId.ring()+2];
194  }
195  }else if(detId.region()<0 && (-detId.station() + numberOfDisks_) >= 0 ){//ENDCAP-
196  NOISE = NOISEDisk[ -detId.station() + numberOfDisks_];
197  if(testMode_) {
198  DEVD = DEVDDisk[ -detId.station() + numberOfDisks_];
199  NOISED= NOISEDDisk[-detId.station() + numberOfDisks_];
200  }
201  }else if((-detId.station() + numberOfDisks_)>= 0 ){//ENDCAP +
202  NOISE = NOISEDisk[detId.station() + numberOfDisks_-1];
203  if(testMode_) {
204  DEVD = DEVDDisk[detId.station() + numberOfDisks_-1];
205  NOISED= NOISEDDisk[detId.station() + numberOfDisks_-1];
206  }
207  }
208 
209 
210  int entries = (int) myMe -> getEntries();
211  int bins = (int) myMe ->getNbinsX();
212 
213  std::vector<float> myvector;
214 
215  // count alive strips and alive strip values put in the vector
216  for(int xbin =1 ; xbin <= bins ; xbin++) {
217  float binContent = myMe->getBinContent(xbin);
218  if (binContent > 0) myvector.push_back(binContent);
219  }
220 
221 
222  int noisyStrips=0;
223  // calculate mean on YAxis and check diff between bins and mean
224  if (myvector.size()>0) {
225  float ymean = entries/myvector.size(); //mean on Yaxis
226  for(unsigned int i=0; i<myvector.size(); i++) {
227  float deviation = myvector[i]/ymean;
228  if(deviation > 3.5) noisyStrips++;
229  if(deviation > 5) deviation = 5; //overflow
230  if(DEVD) DEVD-> Fill(deviation);
231  }
232 
233 
234  int xBin,yBin;
235  if(detId.region()==0){//Barrel
236  xBin= detId.sector();
237  rpcdqm::utils rollNumber;
238  yBin = rollNumber.detId2RollNr(detId);
239  }else{//Endcap
240  //get segment number
241  RPCGeomServ RPCServ(detId);
242  xBin = RPCServ.segment();
243  (numberOfRings_ == 3 ? yBin= detId.ring()*3-detId.roll()+1 : yBin= (detId.ring()-1)*3-detId.roll()+1);
244  }
245 
246  if(NOISE) NOISE->setBinContent(xBin,yBin,noisyStrips);
247  if(NOISED) NOISED ->Fill(noisyStrips);
248 
249  }
250 
251 }
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 
)
virtual

Implements RPCClient.

Definition at line 150 of file RPCNoisyStripTest.cc.

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

150  {
151 
152  //Get NumberOfDigi ME for each roll
153  for (unsigned int i = 0 ; i<meVector.size(); i++){
154 
155  bool flag= false;
156 
157  DQMNet::TagList tagList;
158  tagList = meVector[i]->getTags();
159  DQMNet::TagList::iterator tagItr = tagList.begin();
160 
161  while (tagItr != tagList.end() && !flag ) {
162  if((*tagItr) == rpcdqm::OCCUPANCY)
163  flag= true;
164 
165  tagItr++;
166  }
167 
168  if(flag){
169  myOccupancyMe_.push_back(meVector[i]);
170  myDetIds_.push_back(detIdVector[i]);
171  }
172  }
173 
174 }
int i
Definition: DBlmapReader.cc:9
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myOccupancyMe_
std::vector< uint32_t > TagList
Definition: DQMNet.h:84

Member Data Documentation

DQMStore* RPCNoisyStripTest::dbe_
private

Definition at line 36 of file RPCNoisyStripTest.h.

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

MonitorElement* RPCNoisyStripTest::DEVDDisk[10]
private

Definition at line 47 of file RPCNoisyStripTest.h.

Referenced by beginRun(), and fillGlobalME().

MonitorElement* RPCNoisyStripTest::DEVDWheel[5]
private

Definition at line 43 of file RPCNoisyStripTest.h.

Referenced by beginRun(), and fillGlobalME().

std::string RPCNoisyStripTest::globalFolder_
private

Definition at line 32 of file RPCNoisyStripTest.h.

Referenced by beginJob(), and beginRun().

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

Definition at line 39 of file RPCNoisyStripTest.h.

Referenced by clientOperation(), and getMonitorElements().

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

Definition at line 38 of file RPCNoisyStripTest.h.

Referenced by clientOperation(), and getMonitorElements().

MonitorElement* RPCNoisyStripTest::NOISEDDisk[10]
private

Definition at line 46 of file RPCNoisyStripTest.h.

Referenced by beginRun(), and fillGlobalME().

MonitorElement* RPCNoisyStripTest::NOISEDisk[10]
private

Definition at line 45 of file RPCNoisyStripTest.h.

Referenced by beginRun(), and fillGlobalME().

MonitorElement* RPCNoisyStripTest::NOISEDWheel[5]
private

Definition at line 42 of file RPCNoisyStripTest.h.

Referenced by beginRun(), and fillGlobalME().

MonitorElement* RPCNoisyStripTest::NOISEWheel[5]
private

Definition at line 41 of file RPCNoisyStripTest.h.

Referenced by beginRun(), and fillGlobalME().

int RPCNoisyStripTest::numberOfDisks_
private

Definition at line 48 of file RPCNoisyStripTest.h.

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

int RPCNoisyStripTest::numberOfRings_
private

Definition at line 33 of file RPCNoisyStripTest.h.

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

int RPCNoisyStripTest::prescaleFactor_
private

Definition at line 34 of file RPCNoisyStripTest.h.

Referenced by RPCNoisyStripTest().

bool RPCNoisyStripTest::testMode_
private

Definition at line 35 of file RPCNoisyStripTest.h.

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

bool RPCNoisyStripTest::useRollInfo_
private

Definition at line 40 of file RPCNoisyStripTest.h.

Referenced by beginRun(), and RPCNoisyStripTest().