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 *)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual 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 &, 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_
 

Detailed Description

Definition at line 20 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(), globalFolder_, numberOfDisks_, numberOfRings_, and prescaleFactor_.

15  {
16  edm::LogVerbatim ("rpcnoisetest") << "[RPCNoisyStripTest]: Constructor";
17 
18  globalFolder_ = ps.getUntrackedParameter<std::string>("RPCGlobalFolder", "RPC/RecHits/SummaryHistograms");
19  prescaleFactor_ = ps.getUntrackedParameter<int>("DiagnosticPrescale", 1);
20  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 3);
21  numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
22 
23 }
T getUntrackedParameter(std::string const &, T const &) const
std::string globalFolder_
RPCNoisyStripTest::~RPCNoisyStripTest ( )
virtual

Definition at line 25 of file RPCNoisyStripTest.cc.

References dbe_.

25 {dbe_=0;}

Member Function Documentation

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

Implements RPCClient.

Definition at line 143 of file RPCNoisyStripTest.cc.

143 {}
void RPCNoisyStripTest::beginJob ( DQMStore dbe)
virtual

Implements RPCClient.

Definition at line 27 of file RPCNoisyStripTest.cc.

References dbe_.

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

Implements RPCClient.

Definition at line 141 of file RPCNoisyStripTest.cc.

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

Implements RPCClient.

Definition at line 176 of file RPCNoisyStripTest.cc.

176 {}
void RPCNoisyStripTest::clientOperation ( edm::EventSetup const &  c)
virtual

Implements RPCClient.

Definition at line 147 of file RPCNoisyStripTest.cc.

References DEVDDisk, DEVDWheel, fillGlobalME(), i, MessageLogger_cff::limit, myDetIds_, myOccupancyMe_, NOISEDDisk, NOISEDWheel, numberOfDisks_, and MonitorElement::Reset().

147  {
148 
149 
150  edm::LogVerbatim ("rpcnoisetest") <<"[RPCNoisyStripTest]: Client Operation";
151 
152  //Clear Distributions
153  int limit = numberOfDisks_ * 2;
154  if(numberOfDisks_<2) limit = 5;
155 
156  for(int i =0 ; i<limit; i++){
157 
158  if(i < numberOfDisks_ * 2){
159  DEVDDisk[i]->Reset();
160  NOISEDDisk[i]->Reset();
161  }
162  if(i<5){
163  DEVDWheel[i]->Reset();
164  NOISEDWheel[i]->Reset();
165  }
166  }
167 
168  //Loop on MEs
169  for (unsigned int i = 0 ; i<myOccupancyMe_.size();i++){
170  this->fillGlobalME(myDetIds_[i],myOccupancyMe_[i], iSetup);
171  }//End loop on MEs
172 }
int i
Definition: DBlmapReader.cc:9
void fillGlobalME(RPCDetId &, MonitorElement *, edm::EventSetup const &)
MonitorElement * NOISEDDisk[10]
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myOccupancyMe_
MonitorElement * NOISEDWheel[5]
MonitorElement * DEVDWheel[5]
MonitorElement * DEVDDisk[10]
void Reset(void)
reset ME (ie. contents, errors, etc)
void RPCNoisyStripTest::endJob ( void  )
virtual

Implements RPCClient.

Definition at line 178 of file RPCNoisyStripTest.cc.

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

Implements RPCClient.

Definition at line 145 of file RPCNoisyStripTest.cc.

145 {}
void RPCNoisyStripTest::endRun ( const edm::Run r,
const edm::EventSetup iSetup,
std::vector< MonitorElement * >  meVector,
std::vector< RPCDetId detIdVector 
)
virtual

Implements RPCClient.

Definition at line 33 of file RPCNoisyStripTest.cc.

References DQMStore::book1D(), DQMStore::book2D(), dbe_, DEVDDisk, DEVDWheel, DQMStore::get(), MonitorElement::getName(), globalFolder_, i, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), MessageLogger_cff::limit, myDetIds_, myOccupancyMe_, NOISEDDisk, NOISEDisk, NOISEDWheel, NOISEWheel, numberOfDisks_, numberOfRings_, rpcdqm::OCCUPANCY, evf::evtn::offset(), DQMStore::removeElement(), and DQMStore::setCurrentFolder().

33  {
34  edm::LogVerbatim ("rpcnoisetest") << "[RPCNoisyStripTest]: End run";
35 
36 
37  MonitorElement* me;
39 
40  std::stringstream histoName;
41 
42  rpcdqm::utils rpcUtils;
43 
44  int limit = numberOfDisks_;
45  if(numberOfDisks_ < 2) limit = 2;
46  for (int w = -1 * limit; w<= limit;w++ ){//loop on wheels and disks
47  if (w>-3 && w<3){//Barrel
48  histoName.str("");
49  histoName<<"RPCNoisyStrips_Distribution_Wheel"<<w;
50  me =0;
51  me = dbe_->get( globalFolder_ +"/"+ histoName.str());
52  if ( 0!=me ) {
53  dbe_->removeElement(me->getName());
54  }
55  NOISEDWheel[w+2] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 6, -0.5, 5.5);
56 
57 
58  histoName.str("");
59  histoName<<"RPCStripsDeviation_Distribution_Wheel"<<w;
60  me =0;
61  me = dbe_->get( globalFolder_ +"/"+ histoName.str());
62  if ( 0!=me ) {
63  dbe_->removeElement(me->getName());
64  }
65  DEVDWheel[w+2] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 101, -0.01, 10.01);
66 
67  histoName.str("");
68  histoName<<"RPCNoisyStrips_Roll_vs_Sector_Wheel"<<w;
69  me =0;
70  me = dbe_->get( globalFolder_ +"/"+ histoName.str());
71  if ( 0!=me ) {
72  dbe_->removeElement(me->getName());
73  }
74 
75  NOISEWheel[w+2] = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str() , 12, 0.5, 12.5, 21, 0.5, 21.5);
76  rpcUtils.labelXAxisSector(NOISEWheel[w+2]);
77  rpcUtils.labelYAxisRoll(NOISEWheel[w+2], 0, w);
78  }
79 
80  if (w == 0 || w > numberOfDisks_ || w< (-1 * numberOfDisks_))continue;//ENDCAP
81 
82  int offset = numberOfDisks_;
83  if (w>0) offset --; //used to skip case equale to zero
84 
85  histoName.str("");
86  histoName<<"RPCNoisyStrips_Distribution_Disk"<<w;
87  me =0;
88  me = dbe_->get( globalFolder_ +"/"+ histoName.str());
89  if ( 0!=me ) {
90  dbe_->removeElement(me->getName());
91  }
92  NOISEDDisk[w+offset] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 6, -0.5, 5.5);
93 
94 
95  histoName.str("");
96  histoName<<"RPCStripsDeviation_Distribution_Disk"<<w;
97  me =0;
98  me = dbe_->get( globalFolder_ +"/"+ histoName.str());
99  if ( 0!=me ) {
100  dbe_->removeElement(me->getName());
101  }
102  DEVDDisk[w+offset] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 101, -0.01, 10.01);
103 
104  histoName.str("");
105  histoName<<"RPCNoisyStrips_Ring_vs_Segment_Disk"<<w;
106  me =0;
107  me = dbe_->get( globalFolder_ +"/"+ histoName.str());
108  if ( 0!=me ) {
109  dbe_->removeElement(me->getName());
110  }
111 
112  NOISEDisk[w+offset] = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str() , 36, 0.5, 36.5, 3*numberOfRings_, 0.5,3*numberOfRings_+ 0.5);
113  rpcUtils.labelXAxisSegment(NOISEDisk[w+offset]);
114  rpcUtils.labelYAxisRing(NOISEDisk[w+offset], numberOfRings_);
115 
116  }//end loop wheel and disks
117 
118  //Get NumberOfDigi ME for each roll
119  for (unsigned int i = 0 ; i<meVector.size(); i++){
120 
121  bool flag= false;
122 
123  DQMNet::TagList tagList;
124  tagList = meVector[i]->getTags();
125  DQMNet::TagList::iterator tagItr = tagList.begin();
126 
127  while (tagItr != tagList.end() && !flag ) {
128  if((*tagItr) == rpcdqm::OCCUPANCY)
129  flag= true;
130 
131  tagItr++;
132  }
133 
134  if(flag){
135  myOccupancyMe_.push_back(meVector[i]);
136  myDetIds_.push_back(detIdVector[i]);
137  }
138  }
139 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
long int flag
Definition: mlp_lapack.h:47
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:221
MonitorElement * NOISEDDisk[10]
std::string globalFolder_
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myOccupancyMe_
MonitorElement * NOISEDWheel[5]
void removeElement(const std::string &name)
Definition: DQMStore.cc:2338
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:1270
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:206
MonitorElement * DEVDWheel[5]
std::vector< uint32_t > TagList
Definition: DQMNet.h:82
MonitorElement * NOISEDisk[10]
void labelYAxisRoll(MonitorElement *myMe, int region, int ring)
Definition: utils.h:239
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:647
MonitorElement * NOISEWheel[5]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
void labelYAxisRing(MonitorElement *myMe, int numberOfRings)
Definition: utils.h:266
void RPCNoisyStripTest::fillGlobalME ( RPCDetId detId,
MonitorElement myMe,
edm::EventSetup const &  iSetup 
)
protected

Definition at line 180 of file RPCNoisyStripTest.cc.

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

Referenced by clientOperation().

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

Member Data Documentation

DQMStore* RPCNoisyStripTest::dbe_
private

Definition at line 45 of file RPCNoisyStripTest.h.

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

MonitorElement* RPCNoisyStripTest::DEVDDisk[10]
private

Definition at line 56 of file RPCNoisyStripTest.h.

Referenced by clientOperation(), endRun(), and fillGlobalME().

MonitorElement* RPCNoisyStripTest::DEVDWheel[5]
private

Definition at line 52 of file RPCNoisyStripTest.h.

Referenced by clientOperation(), endRun(), and fillGlobalME().

std::string RPCNoisyStripTest::globalFolder_
private

Definition at line 41 of file RPCNoisyStripTest.h.

Referenced by endRun(), and RPCNoisyStripTest().

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

Definition at line 48 of file RPCNoisyStripTest.h.

Referenced by clientOperation(), and endRun().

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

Definition at line 47 of file RPCNoisyStripTest.h.

Referenced by clientOperation(), and endRun().

MonitorElement* RPCNoisyStripTest::NOISEDDisk[10]
private

Definition at line 55 of file RPCNoisyStripTest.h.

Referenced by clientOperation(), endRun(), and fillGlobalME().

MonitorElement* RPCNoisyStripTest::NOISEDisk[10]
private

Definition at line 54 of file RPCNoisyStripTest.h.

Referenced by endRun(), and fillGlobalME().

MonitorElement* RPCNoisyStripTest::NOISEDWheel[5]
private

Definition at line 51 of file RPCNoisyStripTest.h.

Referenced by clientOperation(), endRun(), and fillGlobalME().

MonitorElement* RPCNoisyStripTest::NOISEWheel[5]
private

Definition at line 50 of file RPCNoisyStripTest.h.

Referenced by endRun(), and fillGlobalME().

int RPCNoisyStripTest::numberOfDisks_
private

Definition at line 57 of file RPCNoisyStripTest.h.

Referenced by clientOperation(), endRun(), fillGlobalME(), and RPCNoisyStripTest().

int RPCNoisyStripTest::numberOfRings_
private

Definition at line 42 of file RPCNoisyStripTest.h.

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

int RPCNoisyStripTest::prescaleFactor_
private

Definition at line 43 of file RPCNoisyStripTest.h.

Referenced by RPCNoisyStripTest().