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