CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StripValidationPlots.cc
Go to the documentation of this file.
1 // system include files
2 #include <memory>
3 
4 // user include files
7 
10 
12 
14 
23 
26 
27 #include "TH1F.h"
28 #include "TFile.h"
29 #include "TCanvas.h"
30 #include "TH1.h"
31 #include "TH2F.h"
32 #include "TH1D.h"
33 #include "TProfile.h"
34 #include "TStyle.h"
35 #include "TTree.h"
36 
37 #include <sstream>
38 #include <iostream>
39 #include <vector>
40 
41 //
42 // class decleration
43 //
44 
46  public:
47  explicit StripValidationPlots(const edm::ParameterSet&);
49 
50 
51  private:
52  virtual void beginJob() ;
53  virtual void analyze(const edm::Event&, const edm::EventSetup&);
54  virtual void endJob() ;
55 
56  std::ostringstream oss;
57 
59 
61  TProfile* tmp_prof;
62 
63  // Histograms
64  std::vector<TH2F*> distanceVsStripNumber;
65  std::vector<TProfile*> pfxDistanceVsStripNumber;
66  std::vector<TH1F*> projXDistanceVsStripNumber;
67  std::vector<TH1F*> projYDistanceVsStripNumber;
68 
69  std::vector<TH2F*> occupancyVsStripNumber;
70  std::vector<TProfile*> pfxOccupancyVsStripNumber;
71  std::vector<TH1F*> projYOccupancyVsStripNumber;
72  std::vector<TH2F*> occupancyHotStripsVsStripNumber;
73  std::vector<TProfile*> pfxOccupancyHotStripsVsStripNumber;
76  std::vector<TProfile*> pfxOccupancyGoodStripsVsStripNumber;
78 
79  std::vector<TH2F*> poissonProbVsStripNumber;
80  std::vector<TProfile*> pfxPoissonProbVsStripNumber;
81  std::vector<TH1F*> projYPoissonProbVsStripNumber;
83  std::vector<TProfile*> pfxPoissonProbHotStripsVsStripNumber;
86  std::vector<TProfile*> pfxPoissonProbGoodStripsVsStripNumber;
88 
89  std::vector<TH2F*> nHitsVsStripNumber;
90  std::vector<TProfile*> pfxNHitsVsStripNumber;
91  std::vector<TH1F*> projXNHitsVsStripNumber;
92  std::vector<TH1F*> projYNHitsVsStripNumber;
93  std::vector<TH2F*> nHitsHotStripsVsStripNumber;
94  std::vector<TProfile*> pfxNHitsHotStripsVsStripNumber;
97  std::vector<TH2F*> nHitsGoodStripsVsStripNumber;
98  std::vector<TProfile*> pfxNHitsGoodStripsVsStripNumber;
101 
102  std::vector<std::string> subDetName;
103 
104  std::string infilename;
105  std::string outfilename;
106 
107  TFile* infile;
108  TTree* intree;
109 
110  // Declaration of leaf types
111  Int_t DetRawId;
112  Int_t SubDetId;
113  Int_t Layer_Ring;
114  Int_t Disc;
115  Int_t IsBack;
119  Int_t IsStereo;
122  Int_t StripNumber;
123  Int_t APVChannel;
127  Int_t IsHot;
130  Double_t StripOccupancy;
131  Int_t StripHits;
132  Double_t PoissonProb;
133 
134 
138  Int_t firstEntry;
139  std::vector<unsigned int> vHotStripsInModule;
140  unsigned int distance;
141  unsigned int distanceR, distanceL;
142  unsigned int nReadStrips[768][5];
143 
144  // ----------member data ---------------------------
145 };
146 
147 //
148 // constants, enums and typedefs
149 //
150 
151 //
152 // static data member definitions
153 //
154 
155 //
156 // constructors and destructor
157 //
158 StripValidationPlots::StripValidationPlots(const edm::ParameterSet& iConfig) : infilename(iConfig.getUntrackedParameter<std::string>("inputFilename","in.root")),
159  outfilename(iConfig.getUntrackedParameter<std::string>("outputFilename","out.root"))
160 
161 {
162  //now do what ever initialization is needed
163 
164 }
165 
166 
168 {
169 
170  // do anything here that needs to be done at desctruction time
171  // (e.g. close files, deallocate resources etc.)
172 
173 }
174 
175 
176 //
177 // member functions
178 //
179 
180 // ------------ method called to for each event ------------
181 void
183 {
184 
185 }
186 
187 
188 // ------------ method called once each job just before starting event loop ------------
189 void
191 {
192  oss.str("");
193  oss << 1; //runNumber
194 
196  dqmStore_->setCurrentFolder("ChannelStatusPlots");
197 
198  for (int i=0; i<768; i++)
199  {
200  for (int j=0; j<5; j++)
201  nReadStrips[i][j]=0;
202  }
203 
204  // Initialize histograms
205  subDetName.push_back(""); subDetName.push_back("TIB"); subDetName.push_back("TID"); subDetName.push_back("TOB"); subDetName.push_back("TEC");
206  std::string histoName;
207  std::string histoTitle;
208  for(unsigned int i = 0; i < subDetName.size(); i++)
209  {
210  histoName = "distanceVsStripNumber" + subDetName[i];
211  histoTitle = "Distance between hot strips vs. strip number";
212  if(i!=0)
213  histoTitle += " in " + subDetName[i];
214  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 999, 0.5, 999.5);
215  distanceVsStripNumber.push_back(tmp->getTH2F());
216 
217  histoName = "pfxDistanceVsStripNumber" + subDetName[i];
218  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
219  tmp = dqmStore_->bookProfile(histoName.c_str(), tmp_prof);
221  pfxDistanceVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
222  pfxDistanceVsStripNumber[i]->GetYaxis()->SetTitle("Distance");
223 
224  histoName = "projXDistanceVsStripNumber" + subDetName[i];
225  histoTitle = "Number of hot strips vs. strip number";
226  if(i!=0)
227  histoTitle += " in " + subDetName[i];
228  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
229  projXDistanceVsStripNumber.push_back(tmp->getTH1F());
230  projXDistanceVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
231  projXDistanceVsStripNumber[i]->GetYaxis()->SetTitle("N_{hot}");
232 
233  histoName = "projYDistanceVsStripNumber" + subDetName[i];
234  histoTitle = "Distribution of distance between hot strips";
235  if(i!=0)
236  histoTitle += " in " + subDetName[i];
237  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 999, 0.5, 999.5);
238  projYDistanceVsStripNumber.push_back(tmp->getTH1F());
239  projYDistanceVsStripNumber[i]->GetXaxis()->SetTitle("Distance");
240  projYDistanceVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
241 
242  //
243  histoName = "occupancyVsStripNumber" + subDetName[i];
244  histoTitle = "Occupancy of strips vs. strip number";
245  if(i!=0)
246  histoTitle += " in " + subDetName[i];
247  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 1000, -8.,0.);
248  occupancyVsStripNumber.push_back(tmp->getTH2F());
249 
250  histoName = "pfxOccupancyVsStripNumber" + subDetName[i];
251  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
252  tmp = dqmStore_->bookProfile(histoName.c_str(), tmp_prof);
254  pfxOccupancyVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
255  pfxOccupancyVsStripNumber[i]->GetYaxis()->SetTitle("log_{10}(Occupancy)");
256 
257  histoName = "projYOccupancyVsStripNumber" + subDetName[i];
258  histoTitle = "Distribution of strip occupancy";
259  if(i!=0)
260  histoTitle += " in " + subDetName[i];
261  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 1000, -8., 0.);
263  projYOccupancyVsStripNumber[i]->GetXaxis()->SetTitle("log_{10}(Occupancy)");
264  projYOccupancyVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
265 
266  //
267  histoName = "occupancyHotStripsVsStripNumber" + subDetName[i];
268  histoTitle = "Occupancy of hot strips vs. strip number";
269  if(i!=0)
270  histoTitle += " in " + subDetName[i];
271  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 1000, -8., 0.);
273 
274  histoName = "pfxOccupancyHotStripsVsStripNumber" + subDetName[i];
275  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
276  tmp = dqmStore_->bookProfile(histoName.c_str(), tmp_prof);
278  pfxOccupancyHotStripsVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
279  pfxOccupancyHotStripsVsStripNumber[i]->GetYaxis()->SetTitle("log_{10}(Occupancy)");
280 
281  histoName = "projYOccupancyHotStripsVsStripNumber" + subDetName[i];
282  histoTitle = "Distribution of hot strip occupancy";
283  if(i!=0)
284  histoTitle += " in " + subDetName[i];
285  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 1000, -8., 0.);
287  projYOccupancyHotStripsVsStripNumber[i]->GetXaxis()->SetTitle("log_{10}(Occupancy)");
288  projYOccupancyHotStripsVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
289 
290  //
291  histoName = "occupancyGoodStripsVsStripNumber" + subDetName[i];
292  histoTitle = "Occupancy of good strips vs. strip number";
293  if(i!=0)
294  histoTitle += " in " + subDetName[i];
295  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 1000, -8., 0.);
297 
298  histoName = "pfxOccupancyGoodStripsVsStripNumber" + subDetName[i];
299  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
300  tmp = dqmStore_->bookProfile(histoName.c_str(), tmp_prof);
302  pfxOccupancyGoodStripsVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
303  pfxOccupancyGoodStripsVsStripNumber[i]->GetYaxis()->SetTitle("log_{10}(Occupancy)");
304 
305  histoName = "projYOccupancyGoodStripsVsStripNumber" + subDetName[i];
306  histoTitle = "Distribution of good strip occupancy";
307  if(i!=0)
308  histoTitle += " in " + subDetName[i];
309  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 1000, -8., 0.);
311  projYOccupancyGoodStripsVsStripNumber[i]->GetXaxis()->SetTitle("log_{10}(Occupancy)");
312  projYOccupancyGoodStripsVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
313 
314  //
315  histoName = "poissonProbVsStripNumber" + subDetName[i];
316  histoTitle = "Poisson probability of strips vs. strip number";
317  if(i!=0)
318  histoTitle += " in " + subDetName[i];
319  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 1000, -18., 0.);
320  poissonProbVsStripNumber.push_back(tmp->getTH2F());
321 
322  histoName = "pfxPoissonProbVsStripNumber" + subDetName[i];
323  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
324  tmp = dqmStore_->bookProfile(histoName.c_str(), tmp_prof);
326  pfxPoissonProbVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
327  pfxPoissonProbVsStripNumber[i]->GetYaxis()->SetTitle("log_{10}(Probability)");
328 
329  histoName = "projYPoissonProbVsStripNumber" + subDetName[i];
330  histoTitle = "Distribution of strip Poisson probability";
331  if(i!=0)
332  histoTitle += " in " + subDetName[i];
333  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 1000, -18., 0.);
335  projYPoissonProbVsStripNumber[i]->GetXaxis()->SetTitle("log_{10}(Probability)");
336  projYPoissonProbVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
337 
338  //
339  histoName = "poissonProbHotStripsVsStripNumber" + subDetName[i];
340  histoTitle = "Poisson probability of hot strips vs. strip number";
341  if(i!=0)
342  histoTitle += " in " + subDetName[i];
343  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 1000, -18., 0.);
345 
346  histoName = "pfxPoissonProbHotStripsVsStripNumber" + subDetName[i];
347  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
348  tmp = dqmStore_->bookProfile(histoName.c_str(), tmp_prof);
350  pfxPoissonProbHotStripsVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
351  pfxPoissonProbHotStripsVsStripNumber[i]->GetYaxis()->SetTitle("log_{10}(Probability)");
352 
353  histoName = "projYPoissonProbHotStripsVsStripNumber" + subDetName[i];
354  histoTitle = "Distribution of hot strip Poisson probability";
355  if(i!=0)
356  histoTitle += " in " + subDetName[i];
357  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 1000, -18., 0.);
359  projYPoissonProbHotStripsVsStripNumber[i]->GetXaxis()->SetTitle("log_{10}(Probability)");
360  projYPoissonProbHotStripsVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
361 
362  //
363  histoName = "poissonProbGoodStripsVsStripNumber" + subDetName[i];
364  histoTitle = "Poisson probability of good strips vs. strip number";
365  if(i!=0)
366  histoTitle += " in " + subDetName[i];
367  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 1000, -18., 0.);
369 
370  histoName = "pfxPoissonProbGoodStripsVsStripNumber" + subDetName[i];
371  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
372  tmp = dqmStore_->bookProfile(histoName.c_str(), tmp_prof);
374  pfxPoissonProbGoodStripsVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
375  pfxPoissonProbGoodStripsVsStripNumber[i]->GetYaxis()->SetTitle("log_{10}(Probability)");
376 
377  histoName = "projYPoissonProbGoodStripsVsStripNumber" + subDetName[i];
378  histoTitle = "Distribution of good strip Poisson probability";
379  if(i!=0)
380  histoTitle += " in " + subDetName[i];
381  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 1000, -18., 0.);
383  projYPoissonProbGoodStripsVsStripNumber[i]->GetXaxis()->SetTitle("log_{10}(Probability)");
384  projYPoissonProbGoodStripsVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
385 
386  //
387  histoName = "nHitsVsStripNumber" + subDetName[i];
388  histoTitle = "NHits in strips vs. strip number";
389  if(i!=0)
390  histoTitle += " in " + subDetName[i];
391  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 10000, -0.5, 9999.5);
392  nHitsVsStripNumber.push_back(tmp->getTH2F());
393 
394  histoName = "pfxNHitsVsStripNumber" + subDetName[i];
395  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
396  tmp = dqmStore_->bookProfile(histoName.c_str(), tmp_prof);
397  pfxNHitsVsStripNumber.push_back(tmp->getTProfile());
398 
399  histoName = "projXNHitsVsStripNumber" + subDetName[i];
400  histoTitle = "Cumulative nHits in strips vs. strip number";
401  if(i!=0)
402  histoTitle += " in " + subDetName[i];
403  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
404  projXNHitsVsStripNumber.push_back(tmp->getTH1F());
405 
406  histoName = "projYNHitsVsStripNumber" + subDetName[i];
407  histoTitle = "Distribution of nHits for all strips";
408  if(i!=0)
409  histoTitle += " in " + subDetName[i];
410  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 10000, -0.5, 9999.5);
411  projYNHitsVsStripNumber.push_back(tmp->getTH1F());
412  projYNHitsVsStripNumber[i]->GetXaxis()->SetTitle("N_{hits}");
413  projYNHitsVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
414 
415  //
416  histoName = "nHitsHotStripsVsStripNumber" + subDetName[i];
417  histoTitle = "NHits in hot strips vs. strip number";
418  if(i!=0)
419  histoTitle += " in " + subDetName[i];
420  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 10000, -0.5, 9999.5);
422 
423  histoName = "pfxNHitsHotStripsVsStripNumber" + subDetName[i];
424  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
425  tmp = dqmStore_->bookProfile(histoName.c_str(), tmp_prof);
427 
428  histoName = "projXNHitsHotStripsVsStripNumber" + subDetName[i];
429  histoTitle = "Cumulative nHits in hot strips vs. strip number";
430  if(i!=0)
431  histoTitle += " in " + subDetName[i];
432  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
434 
435  histoName = "projYNHitsHotStripsVsStripNumber" + subDetName[i];
436  histoTitle = "Distribution of nHits for hot strips";
437  if(i!=0)
438  histoTitle += " in " + subDetName[i];
439  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 10000, -0.5, 9999.5);
441  projYNHitsHotStripsVsStripNumber[i]->GetXaxis()->SetTitle("N_{hits}");
442  projYNHitsHotStripsVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
443 
444  //
445  histoName = "nHitsGoodStripsVsStripNumber" + subDetName[i];
446  histoTitle = "NHits in good strips vs. strip number";
447  if(i!=0)
448  histoTitle += " in " + subDetName[i];
449  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 10000, -0.5, 9999.5);
451 
452  histoName = "pfxNHitsGoodStripsVsStripNumber" + subDetName[i];
453  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
454  tmp = dqmStore_->bookProfile(histoName.c_str(), tmp_prof);
456 
457  histoName = "projXNHitsGoodStripsVsStripNumber" + subDetName[i];
458  histoTitle = "Cumulative nHits in good strips vs. strip number";
459  if(i!=0)
460  histoTitle += " in " + subDetName[i];
461  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
463 
464  histoName = "projYNHitsGoodStripsVsStripNumber" + subDetName[i];
465  histoTitle = "Distribution of nHits for good strips";
466  if(i!=0)
467  histoTitle += " in " + subDetName[i];
468  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 10000, -0.5, 9999.5);
470  projYNHitsGoodStripsVsStripNumber[i]->GetXaxis()->SetTitle("N_{hits}");
471  projYNHitsGoodStripsVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
472  }
473 
474 }
475 
476 // ------------ method called once each job just after ending the event loop ------------
477 void
479 
480  infile = new TFile(infilename.c_str(),"READ");
481  intree = (TTree*)infile->Get("stripOccupancy");
482 
483  intree->SetBranchAddress("DetRawId", &DetRawId);
484  intree->SetBranchAddress("SubDetId", &SubDetId);
485  intree->SetBranchAddress("Layer_Ring", &Layer_Ring);
486  intree->SetBranchAddress("Disc", &Disc);
487  intree->SetBranchAddress("IsBack", &IsBack);
488  intree->SetBranchAddress("IsExternalString", &IsExternalString);
489  intree->SetBranchAddress("IsZMinusSide", &IsZMinusSide);
490  intree->SetBranchAddress("RodStringPetal", &RodStringPetal);
491  intree->SetBranchAddress("IsStereo", &IsStereo);
492  intree->SetBranchAddress("ModulePosition", &ModulePosition);
493  intree->SetBranchAddress("NumberOfStrips", &NumberOfStrips);
494  intree->SetBranchAddress("StripNumber", &StripNumber);
495  intree->SetBranchAddress("APVChannel", &APVChannel);
496  intree->SetBranchAddress("StripGlobalPositionX", &StripGlobalPositionX);
497  intree->SetBranchAddress("StripGlobalPositionY", &StripGlobalPositionY);
498  intree->SetBranchAddress("StripGlobalPositionZ", &StripGlobalPositionZ);
499  intree->SetBranchAddress("IsHot", &IsHot);
500  intree->SetBranchAddress("HotStripsPerAPV", &HotStripsPerAPV);
501  intree->SetBranchAddress("HotStripsPerModule", &HotStripsPerModule);
502  intree->SetBranchAddress("StripOccupancy", &StripOccupancy);
503  intree->SetBranchAddress("StripHits", &StripHits);
504  intree->SetBranchAddress("PoissonProb", &PoissonProb);
505 
506  for (int i=0; i<intree->GetEntries(); /* */)
507  {
508  intree->GetEntry(i);
509 
511  firstEntry = i;
514  vHotStripsInModule.clear();
515 
516  for(int j = firstEntry; j < firstEntry + savedNStrips; j++)
517  {
518  intree->GetEntry(j);
519 
520  if(DetRawId != savedDetRawId)
521  {
522  std::cout << "ERROR! DetRawId changed but I expected to be on the same module!\n";
523  return;
524  }
525 
526  double logStripOccupancy = log10(StripOccupancy);
527  double logPoissonProb = log10(fabs(PoissonProb));
528 
529  (nReadStrips[StripNumber-1][0])++;
530  (nReadStrips[StripNumber-1][SubDetId-2])++;
531  //std::cout << "StripNumber = " << StripNumber << ", SubDetId = " << SubDetId << ", nReadStripsAll = " << nReadStrips[StripNumber-1][0] << ", nReadStripsSubDet = " << nReadStrips[StripNumber-1][SubDetId-2] << std::endl;
532  occupancyVsStripNumber[0]->Fill(StripNumber,logStripOccupancy);
533  occupancyVsStripNumber[SubDetId-2]->Fill(StripNumber,logStripOccupancy);
534  poissonProbVsStripNumber[0]->Fill(StripNumber,logPoissonProb);
535  poissonProbVsStripNumber[SubDetId-2]->Fill(StripNumber,logPoissonProb);
538 
539  if(IsHot)
540  {
541  vHotStripsInModule.push_back(StripNumber);
542  // std::cout << "detId = " << DetRawId << ", StripN = " << StripNumber << ", StripOccupancy = " << StripOccupancy << " PoissonProb = " << PoissonProb << std::endl ;
543  occupancyHotStripsVsStripNumber[0]->Fill(StripNumber,logStripOccupancy);
544  occupancyHotStripsVsStripNumber[SubDetId-2]->Fill(StripNumber,logStripOccupancy);
545  poissonProbHotStripsVsStripNumber[0]->Fill(StripNumber,logPoissonProb);
546  poissonProbHotStripsVsStripNumber[SubDetId-2]->Fill(StripNumber,logPoissonProb);
549  }
550  else
551  {
552  occupancyGoodStripsVsStripNumber[0]->Fill(StripNumber,logStripOccupancy);
553  occupancyGoodStripsVsStripNumber[SubDetId-2]->Fill(StripNumber,logStripOccupancy);
554  poissonProbGoodStripsVsStripNumber[0]->Fill(StripNumber,logPoissonProb);
558  }
559  }
560 
561  if(vHotStripsInModule.size()==1)
562  {
563  distance = 999;
566  }
567  else if(vHotStripsInModule.size()>1)
568  {
569  for(unsigned int iVec = 0; iVec != vHotStripsInModule.size(); iVec++)
570  {
571  if(iVec==0)
573  else if(iVec==vHotStripsInModule.size()-1)
574  {
575  distance = vHotStripsInModule[vHotStripsInModule.size()-1] - vHotStripsInModule[vHotStripsInModule.size() -2];
576  }
577  else if(vHotStripsInModule.size()>2)
578  {
579  distanceR = vHotStripsInModule[iVec + 1] - vHotStripsInModule[iVec];
580  distanceL = vHotStripsInModule[iVec] - vHotStripsInModule[iVec - 1];
582  }
583  else
584  {
585  std::cout << "ERROR! distance is never computed!!!\n";
586  }
587  // std::cout << "detId = " << savedDetRawId << ", StripN = " << vHotStripsInModule[iVec] << ", distance = " << distance << std::endl;
588  distanceVsStripNumber[0]->Fill(vHotStripsInModule[iVec], distance);
589  distanceVsStripNumber[savedSubDetId-2]->Fill(vHotStripsInModule[iVec], distance);
590  }
591  }
592 
593  i+=savedNStrips;
594 
595  }
596 
597 
598  std::string histoName;
599  std::string histoTitle;
600 
601  for(unsigned int i = 0; i < subDetName.size(); i++)
602  {
603  projYDistanceVsStripNumber[i]->Add((TH1F*)distanceVsStripNumber[i]->ProjectionY());
604  pfxDistanceVsStripNumber[i]->Add(distanceVsStripNumber[i]->ProfileX(pfxDistanceVsStripNumber[i]->GetName(),1,998));
605  projYNHitsVsStripNumber[i]->Add(nHitsVsStripNumber[i]->ProjectionY());
608  projYOccupancyVsStripNumber[i]->Add(occupancyVsStripNumber[i]->ProjectionY());
611  pfxOccupancyVsStripNumber[i]->Add(occupancyVsStripNumber[i]->ProfileX(pfxOccupancyVsStripNumber[i]->GetName(),-8.,0.));
620  projXDistanceVsStripNumber[i]->Add(distanceVsStripNumber[i]->ProjectionX(projXDistanceVsStripNumber[i]->GetName(),1,998));
621 
622  }
623 
624  dqmStore_->cd();
625  dqmStore_->save(outfilename.c_str(),"ChannelStatusPlots");
626 
627 }
628 
629 //define this as a plug-in
std::vector< TH2F * > occupancyVsStripNumber
unsigned int nReadStrips[768][5]
int i
Definition: DBlmapReader.cc:9
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< TProfile * > pfxNHitsVsStripNumber
std::vector< TH1F * > projXNHitsGoodStripsVsStripNumber
std::vector< TH2F * > poissonProbGoodStripsVsStripNumber
std::vector< TH2F * > poissonProbVsStripNumber
std::vector< TH2F * > nHitsHotStripsVsStripNumber
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
std::vector< TH1F * > projYPoissonProbHotStripsVsStripNumber
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< TH2F * > distanceVsStripNumber
std::vector< TProfile * > pfxNHitsGoodStripsVsStripNumber
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2113
std::vector< TProfile * > pfxPoissonProbVsStripNumber
std::vector< TH2F * > nHitsVsStripNumber
std::vector< TProfile * > pfxPoissonProbGoodStripsVsStripNumber
std::vector< TH1F * > projYNHitsVsStripNumber
std::vector< TH2F * > nHitsGoodStripsVsStripNumber
std::vector< TH1F * > projXNHitsHotStripsVsStripNumber
std::vector< TH2F * > poissonProbHotStripsVsStripNumber
std::vector< TH1F * > projYNHitsHotStripsVsStripNumber
int iEvent
Definition: GenABIO.cc:243
std::vector< TH2F * > occupancyHotStripsVsStripNumber
std::vector< TH1F * > projXDistanceVsStripNumber
std::vector< TH1F * > projYPoissonProbGoodStripsVsStripNumber
std::vector< TH1F * > projYOccupancyVsStripNumber
int j
Definition: DBlmapReader.cc:9
std::vector< TH1F * > projYNHitsGoodStripsVsStripNumber
std::vector< TH1F * > projYPoissonProbVsStripNumber
std::vector< TH1F * > projXNHitsVsStripNumber
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1031
std::vector< TProfile * > pfxNHitsHotStripsVsStripNumber
std::vector< std::string > subDetName
std::vector< TProfile * > pfxOccupancyHotStripsVsStripNumber
std::vector< TProfile * > pfxPoissonProbHotStripsVsStripNumber
std::vector< TProfile * > pfxDistanceVsStripNumber
std::vector< TProfile * > pfxOccupancyVsStripNumber
StripValidationPlots(const edm::ParameterSet &)
std::vector< TProfile * > pfxOccupancyGoodStripsVsStripNumber
TH1F * getTH1F(void) const
TProfile * getTProfile(void) const
std::ostringstream oss
std::vector< unsigned int > vHotStripsInModule
tuple cout
Definition: gather_cfg.py:121
std::vector< TH1F * > projYDistanceVsStripNumber
TH2F * getTH2F(void) const
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
std::vector< TH1F * > projYOccupancyGoodStripsVsStripNumber
std::vector< TH2F * > occupancyGoodStripsVsStripNumber
std::vector< TH1F * > projYOccupancyHotStripsVsStripNumber
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429