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 Types | Private Member Functions | Private Attributes | Static Private Attributes
RPCChamberQuality Class Reference

#include <RPCChamberQuality.h>

Inheritance diagram for RPCChamberQuality:
edm::EDAnalyzer

Public Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &c)
 
void beginJob ()
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 
 RPCChamberQuality (const edm::ParameterSet &ps)
 
virtual ~RPCChamberQuality ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Types

enum  chamberQualityState {
  GoodState = 1, OffState =2, NoisyStripState = 3, NoisyRollState = 4,
  PartiallyDeadState =5, DeadState =6, BadShapeState =7
}
 

Private Member Functions

void fillMonitorElements ()
 
void performeClientOperation (std::string, int, MonitorElement *)
 

Private Attributes

DQMStoredbe_
 
bool enableDQMClients_
 
bool init_
 
int lumiCounter_
 
int minEvents
 
int numberOfDisks_
 
int numLumBlock_
 
bool offlineDQM_
 
std::string prefixDir_
 
int prescaleFactor_
 
MonitorElementRpcEvents
 
std::string summaryDir_
 
bool useRollInfo_
 

Static Private Attributes

static const std::string regions_ [3] = {"EndcapNegative","Barrel","EndcapPositive"}
 
static const std::string xLabels_ [7] = {"Good", "OFF", "Nois.St","Nois.Ch","Part.Dead","Dead","Bad.Shape"}
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 13 of file RPCChamberQuality.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

RPCChamberQuality::RPCChamberQuality ( const edm::ParameterSet ps)

Definition at line 13 of file RPCChamberQuality.cc.

References enableDQMClients_, edm::ParameterSet::getUntrackedParameter(), minEvents, numberOfDisks_, offlineDQM_, prefixDir_, prescaleFactor_, summaryDir_, and useRollInfo_.

13  {
14  edm::LogVerbatim ("rpceventsummary") << "[RPCChamberQuality]: Constructor";
15 
16  prescaleFactor_ = ps.getUntrackedParameter<int>("PrescaleFactor", 5);
17 
18  std::string subsystemFolder = ps.getUntrackedParameter<std::string>("RPCFolder", "RPC");
19  std::string recHitTypeFolder = ps.getUntrackedParameter<std::string>("RecHitTypeFolder", "AllHits");
20  std::string summaryFolder = ps.getUntrackedParameter<std::string>("SummaryFolder", "SummaryHistograms");
21 
22  summaryDir_ = subsystemFolder +"/"+ recHitTypeFolder +"/"+ summaryFolder ;
23  prefixDir_ = subsystemFolder +"/"+ recHitTypeFolder ;
24 
25  enableDQMClients_ = ps.getUntrackedParameter<bool> ("EnableRPCDqmClient",true);
26 
27  minEvents = ps.getUntrackedParameter<int>("MinimumRPCEvents", 10000);
28  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 3);
29  useRollInfo_ = ps.getUntrackedParameter<bool> ("UseRollInfo",false);
30  offlineDQM_ = ps.getUntrackedParameter<bool> ("OfflineDQM",true);
31 }
T getUntrackedParameter(std::string const &, T const &) const
std::string summaryDir_
std::string prefixDir_
RPCChamberQuality::~RPCChamberQuality ( )
virtual

Definition at line 33 of file RPCChamberQuality.cc.

References dbe_, and enableDQMClients_.

33  {
34  edm::LogVerbatim ("rpceventsummary") << "[RPCChamberQuality]: Destructor ";
35  if(! enableDQMClients_ ) return;
36  dbe_=0;
37 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 129 of file RPCChamberQuality.cc.

129 {}
void RPCChamberQuality::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 39 of file RPCChamberQuality.cc.

References dbe_, enableDQMClients_, and cppFunctionSkipper::operator.

39  {
40  edm::LogVerbatim ("rpceventsummary") << "[RPCChamberQuality]: Begin job ";
41  if(! enableDQMClients_ ) return;
43 }
void RPCChamberQuality::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 127 of file RPCChamberQuality.cc.

127 {}
void RPCChamberQuality::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 45 of file RPCChamberQuality.cc.

References DQMStore::book1D(), DQMStore::book2D(), dbe_, enableDQMClients_, DQMStore::get(), MonitorElement::getName(), init_, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), lumiCounter_, numberOfDisks_, prescaleFactor_, alignCSCRings::r, regions_, DQMStore::removeElement(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), summaryDir_, useRollInfo_, w(), x, and xLabels_.

45  {
46  edm::LogVerbatim ("rpceventsummary") << "[RPCChamberQuality]: Begin run";
47  if(! enableDQMClients_ ) return;
48 
49  init_ = false;
51 
52  MonitorElement* me;
54 
55  std::stringstream histoName;
56 
57  rpcdqm::utils rpcUtils;
58 
59  for (int r = 0 ; r < 3; r++){
60 
61  histoName.str("");
62  histoName<<"RPCChamberQuality_"<<regions_[r];
63  me = dbe_->get(summaryDir_+"/"+ histoName.str());
64  if (0!=me) dbe_->removeElement(me->getName());
65  me = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 7, 0.5, 7.5);
66 
67  for (int x = 1; x <8 ; x++) me->setBinLabel(x, xLabels_[x-1]);
68  }
69 
70 
71  histoName.str("");
72  histoName<<"RPC_System_Quality_Overview";
73  me = dbe_->get(summaryDir_+"/"+ histoName.str());
74  if (0!=me) dbe_->removeElement(me->getName());
75  me = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str(), 7, 0.5, 7.5, 3, 0.5, 3.5);
76  me->setBinLabel(1, "E+", 2);
77  me->setBinLabel(2, "B", 2);
78  me->setBinLabel(3, "E-", 2);
79 
80  for (int x = 1; x <8 ; x++) me->setBinLabel(x, xLabels_[x-1]);
81 
82  for(int w=-2; w<3;w++){//Loop on wheels
83 
84  histoName.str("");
85  histoName<<"RPCChamberQuality_Roll_vs_Sector_Wheel"<<w;
86  me = dbe_->get(summaryDir_+"/"+ histoName.str());
87  if (0!=me) dbe_->removeElement(me->getName());
88  me = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
89 
90  rpcUtils.labelXAxisSector( me);
91  rpcUtils.labelYAxisRoll(me, 0, w, useRollInfo_ );
92 
93  histoName.str("");
94  histoName<<"RPCChamberQuality_Distribution_Wheel"<<w;
95  me=0;
96  me = dbe_->get(summaryDir_+"/"+ histoName.str());
97  if (0!=me ) dbe_->removeElement(me->getName());
98  me = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 7, 0.5, 7.5);
99 
100  for (int x = 1; x <8; x++) me->setBinLabel(x, xLabels_[x-1]);
101  }//end loop on wheels
102 
103  for(int d= -numberOfDisks_; d<= numberOfDisks_ ; d++) { // Loop on disk
104  if(d==0) continue;
105  histoName.str("");
106  histoName<<"RPCChamberQuality_Ring_vs_Segment_Disk"<<d; // 2D histo for RPC Qtest
107  me = 0;
108  me = dbe_->get(summaryDir_+"/"+ histoName.str());
109  if (0!=me) {
110  dbe_->removeElement(me->getName());
111  }
112  me = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str(), 36, 0.5, 36.5, 6, 0.5, 6.5);
113  rpcUtils.labelXAxisSegment(me);
114  rpcUtils.labelYAxisRing(me, 2, useRollInfo_ );
115 
116  histoName.str("");
117  histoName<<"RPCChamberQuality_Distribution_Disk"<<d;
118  me=0;
119  me = dbe_->get(summaryDir_+"/"+ histoName.str());
120  if (0!=me ) dbe_->removeElement(me->getName());
121  me = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 7, 0.5, 7.5);
122 
123  for (int x = 1; x <8 ; x++) me->setBinLabel(x, xLabels_[x-1]);
124  }
125 }
const std::string & getName(void) const
get name of ME
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:251
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:269
static const std::string xLabels_[7]
std::string summaryDir_
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:296
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:236
static const std::string regions_[3]
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:845
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
T w() const
void RPCChamberQuality::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 202 of file RPCChamberQuality.cc.

References enableDQMClients_, fillMonitorElements(), init_, lumiCounter_, offlineDQM_, and prescaleFactor_.

202  {
203 
204  if(!enableDQMClients_ ) return;
205 
206  if(offlineDQM_) return;
207 
208  if(!init_ ) {
209  this->fillMonitorElements();
210  return;
211  }
212 
213  lumiCounter_++;
214 
215  if (lumiCounter_%prescaleFactor_ != 0) return;
216 
217  this->fillMonitorElements();
218 
219 
220 }
void RPCChamberQuality::endRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 131 of file RPCChamberQuality.cc.

References enableDQMClients_, and fillMonitorElements().

131  {
132  edm::LogVerbatim ("rpceventsummary") <<"[RPCChamberQuality]: End Job, performing DQM client operation";
133  if(! enableDQMClients_ ) return;
134  this->fillMonitorElements();
135 
136 }
void RPCChamberQuality::fillMonitorElements ( )
private

Definition at line 138 of file RPCChamberQuality.cc.

References dbe_, python.tagInventory::entries, DQMStore::get(), MonitorElement::getBinContent(), MonitorElement::getEntries(), i, init_, minEvents, NULL, performeClientOperation(), prefixDir_, alignCSCRings::r, regions_, MonitorElement::Reset(), RpcEvents, MonitorElement::setBinContent(), edmLumisInFiles::summary, summaryDir_, and x.

Referenced by endLuminosityBlock(), and endRun().

138  {
139 
140  std::stringstream meName;
141 
142  meName.str("");
143  meName<<prefixDir_<<"/RPCEvents";
144  int rpcEvents=minEvents;
145  RpcEvents = dbe_->get(meName.str());
146 
147  if(RpcEvents) rpcEvents= (int)RpcEvents->getBinContent(1);
148 
149  if(rpcEvents >= minEvents){
150 
151  init_ = true;
152 
153  MonitorElement * summary[3];
154 
155  for(int r = 0 ; r < 3 ; r++) {
156  meName.str("");
157  meName<<summaryDir_<<"/RPCChamberQuality_"<<RPCChamberQuality::regions_[r];
158  summary[r] = dbe_ -> get(meName.str());
159 
160  if( summary[r] != 0 ) summary[r]->Reset();
161  }
162 
163  //Barrel
164  for (int wheel=-2; wheel<3; wheel++) { // loop by Wheels
165  meName.str("");
166  meName<<"Roll_vs_Sector_Wheel"<<wheel;
167 
168  this->performeClientOperation(meName.str(), 0 , summary[1]);
169  } // loop by Wheels
170 
171 
172  // Endcap
173  for(int i=-3; i<4; i++) {//loop on Disks
174  if(i==0) continue;
175 
176  meName.str("");
177  meName<<"Ring_vs_Segment_Disk"<<i;
178 
179  if(i<0) this->performeClientOperation(meName.str(), -1 , summary[0]);
180  else this->performeClientOperation(meName.str(), 1 , summary[2]);
181  }//loop on Disks
182 
183  MonitorElement * RpcOverview = NULL;
184  meName.str("");
185  meName<<summaryDir_<<"/RPC_System_Quality_Overview";
186  RpcOverview = dbe_ -> get(meName.str());
187  RpcOverview->Reset();
188 
189  if(RpcOverview) {//Fill Overview ME
190  for(int r = 0 ; r< 3; r++) {
191  if (summary[r] == 0 ) continue;
192  double entries = summary[r]->getEntries();
193  if(entries == 0) continue;
194  for (int x = 1; x <= 7; x++) {
195  RpcOverview->setBinContent(x,r+1,(summary[r]->getBinContent(x)/entries));
196  }
197  }
198  } //loop by LimiBloks
199  }
200 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
#define NULL
Definition: scimark2.h:8
double getEntries(void) const
get # of entries
std::string summaryDir_
void performeClientOperation(std::string, int, MonitorElement *)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
MonitorElement * RpcEvents
static const std::string regions_[3]
std::string prefixDir_
double getBinContent(int binx) const
get content of bin (1-D)
Definition: DDAxes.h:10
void Reset(void)
reset ME (ie. contents, errors, etc)
void RPCChamberQuality::performeClientOperation ( std::string  MESufix,
int  region,
MonitorElement quality 
)
private

Definition at line 223 of file RPCChamberQuality.cc.

References BadShapeState, dbe_, DeadState, MonitorElement::Fill(), HcalObjRepresent::Fill(), DQMStore::get(), MonitorElement::getBinContent(), GoodState, VarParsing::mult, NoisyRollState, NoisyStripState, NULL, OffState, PartiallyDeadState, pos, MonitorElement::Reset(), summaryDir_, x, and detailsBasic3DVector::y.

Referenced by fillMonitorElements().

223  {
224 
225 
226  MonitorElement * RCQ=NULL;
227  MonitorElement * RCQD=NULL;
228 
229  MonitorElement * DEAD=NULL;
230  MonitorElement * CLS=NULL;
231  MonitorElement * MULT=NULL;
232  MonitorElement * NoisySt=NULL;
233  MonitorElement * Chip=NULL;
234  MonitorElement * HV=NULL;
236  std::stringstream meName;
237 
238  meName.str("");
239  meName<<summaryDir_<<"/RPCChamberQuality_"<<MESufix;
240  RCQ = dbe_ -> get(meName.str());
241  // if (RCQ) RCQ->Reset();
242 
243 
244  int pos = MESufix.find_last_of("_");
245  meName.str("");
246  meName<<summaryDir_<<"/RPCChamberQuality_Distribution"<<MESufix.substr(pos);
247  RCQD = dbe_ -> get(meName.str());
248  if (RCQD) RCQD->Reset();
249 
250  //get HV Histo
251  meName.str("");
252  meName<<summaryDir_<<"/HVStatus_"<<MESufix;
253  HV = dbe_ -> get(meName.str());
254  //get LV Histo
255  meName.str("");
256  meName<<summaryDir_<<"/LVStatus_"<<MESufix;
257  LV = dbe_ -> get(meName.str());
258  //Dead
259  meName.str("");
260  meName << summaryDir_<<"/DeadChannelFraction_"<<MESufix;
261  DEAD = dbe_->get(meName.str());
262  //ClusterSize
263  meName.str("");
264  meName<<summaryDir_<<"/ClusterSizeIn1Bin_"<<MESufix;
265  CLS = dbe_ -> get(meName.str());
266  //NoisyStrips
267  meName.str("");
268  meName<<summaryDir_<<"/RPCNoisyStrips_"<<MESufix;
269  NoisySt = dbe_ -> get(meName.str());
270  //Multiplicity
271  meName.str("");
272  meName<<summaryDir_<<"/NumberOfDigi_Mean_"<<MESufix;
273  MULT = dbe_ -> get(meName.str());
274  //Asymetry
275  meName.str("");
276  meName<<summaryDir_<<"/AsymmetryLeftRight_"<<MESufix;
277  Chip = dbe_ -> get(meName.str());
278 
279  int xBinMax, yBinMax;
280 
281  if (region != 0) xBinMax = 37;
282  else xBinMax = 13;
283 
284  for(int x=1; x<xBinMax; x++) {
285  if (region != 0 ) {
286  yBinMax = 7;
287  }else {
288  if(x==4) yBinMax=22;
289  else if(x==9 || x==11) yBinMax=16;
290  else yBinMax=18;
291  }
292  for(int y=1; y<yBinMax; y++) {
293  int hv=1;
294  int lv=1;
295  float dead =0;
296  float firstbin= 0;
297  float noisystrips = 0;
298  float mult = 0;
299  float asy = 0;
300  chamberQualityState chamberState = GoodState;
301 
302  if(HV) hv = (int)HV ->getBinContent(x,y);
303  if(LV) lv = (int)LV ->getBinContent(x,y);
304 
305  if( hv!=1 || lv!=1) {
306  chamberState = OffState;
307  }else {
308  if(DEAD) dead= DEAD -> getBinContent(x,y);
309  if(dead>=0.80 ) {
310  chamberState = DeadState;
311  }else if (0.33<=dead && dead<0.80 ){
312  chamberState = PartiallyDeadState;
313  }else {
314  if(CLS ) firstbin = CLS -> getBinContent(x,y);
315  if(firstbin >= 0.88) {
316  chamberState = NoisyStripState;
317  } else {
318  if(NoisySt) noisystrips = NoisySt -> getBinContent(x,y);
319  if (noisystrips > 0){
320  chamberState = NoisyStripState;
321  }else {
322  if(MULT) mult = MULT -> getBinContent(x,y);
323  if(mult>=6) {
324  chamberState = NoisyRollState;
325  }else {
326  if (Chip) asy = Chip->getBinContent(x,y);
327  if(asy>0.35) {
328  chamberState = BadShapeState;
329  }else {
330  chamberState = GoodState;
331  }
332  }
333  }
334  }
335  }
336  }
337  if (RCQ) RCQ -> setBinContent(x,y, chamberState);
338  if (RCQD) RCQD -> Fill(chamberState);
339  if (quality) quality->Fill(chamberState);
340  }
341  }
342  return;
343 }
#define NULL
Definition: scimark2.h:8
std::string summaryDir_
void Fill(long long x)
math::XYZTLorentzVectorD LV
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
double getBinContent(int binx) const
get content of bin (1-D)
Definition: DDAxes.h:10
void Reset(void)
reset ME (ie. contents, errors, etc)

Member Data Documentation

DQMStore* RPCChamberQuality::dbe_
private
bool RPCChamberQuality::enableDQMClients_
private
bool RPCChamberQuality::init_
private

Definition at line 48 of file RPCChamberQuality.h.

Referenced by beginRun(), endLuminosityBlock(), and fillMonitorElements().

int RPCChamberQuality::lumiCounter_
private

Definition at line 34 of file RPCChamberQuality.h.

Referenced by beginRun(), and endLuminosityBlock().

int RPCChamberQuality::minEvents
private

Definition at line 51 of file RPCChamberQuality.h.

Referenced by fillMonitorElements(), and RPCChamberQuality().

int RPCChamberQuality::numberOfDisks_
private

Definition at line 46 of file RPCChamberQuality.h.

Referenced by beginRun(), and RPCChamberQuality().

int RPCChamberQuality::numLumBlock_
private

Definition at line 52 of file RPCChamberQuality.h.

bool RPCChamberQuality::offlineDQM_
private

Definition at line 37 of file RPCChamberQuality.h.

Referenced by endLuminosityBlock(), and RPCChamberQuality().

std::string RPCChamberQuality::prefixDir_
private

Definition at line 41 of file RPCChamberQuality.h.

Referenced by fillMonitorElements(), and RPCChamberQuality().

int RPCChamberQuality::prescaleFactor_
private

Definition at line 45 of file RPCChamberQuality.h.

Referenced by beginRun(), endLuminosityBlock(), and RPCChamberQuality().

const std::string RPCChamberQuality::regions_ = {"EndcapNegative","Barrel","EndcapPositive"}
staticprivate

Definition at line 43 of file RPCChamberQuality.h.

Referenced by beginRun(), and fillMonitorElements().

MonitorElement* RPCChamberQuality::RpcEvents
private

Definition at line 31 of file RPCChamberQuality.h.

Referenced by fillMonitorElements().

std::string RPCChamberQuality::summaryDir_
private
bool RPCChamberQuality::useRollInfo_
private

Definition at line 44 of file RPCChamberQuality.h.

Referenced by beginRun(), and RPCChamberQuality().

const std::string RPCChamberQuality::xLabels_ = {"Good", "OFF", "Nois.St","Nois.Ch","Part.Dead","Dead","Bad.Shape"}
staticprivate

Definition at line 42 of file RPCChamberQuality.h.

Referenced by beginRun().