CMS 3D CMS Logo

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 
21 
22 #include "TH1F.h"
23 #include "TFile.h"
24 #include "TCanvas.h"
25 #include "TH1.h"
26 #include "TH2F.h"
27 #include "TH1D.h"
28 #include "TProfile.h"
29 #include "TStyle.h"
30 #include "TTree.h"
31 
32 #include <sstream>
33 #include <iostream>
34 #include <vector>
35 
36 //
37 // class decleration
38 //
39 
41 public:
44 
45  explicit StripValidationPlots(const edm::ParameterSet&);
46  ~StripValidationPlots() override;
47 
48 private:
49  void beginJob() override;
50  void analyze(const edm::Event&, const edm::EventSetup&) override;
51  void endJob() override;
52 
53  std::ostringstream oss;
54 
56 
58  TProfile* tmp_prof;
59 
60  // Histograms
61  std::vector<TH2F*> distanceVsStripNumber;
62  std::vector<TProfile*> pfxDistanceVsStripNumber;
63  std::vector<TH1F*> projXDistanceVsStripNumber;
64  std::vector<TH1F*> projYDistanceVsStripNumber;
65 
66  std::vector<TH2F*> occupancyVsStripNumber;
67  std::vector<TProfile*> pfxOccupancyVsStripNumber;
68  std::vector<TH1F*> projYOccupancyVsStripNumber;
69  std::vector<TH2F*> occupancyHotStripsVsStripNumber;
70  std::vector<TProfile*> pfxOccupancyHotStripsVsStripNumber;
73  std::vector<TProfile*> pfxOccupancyGoodStripsVsStripNumber;
75 
76  std::vector<TH2F*> poissonProbVsStripNumber;
77  std::vector<TProfile*> pfxPoissonProbVsStripNumber;
78  std::vector<TH1F*> projYPoissonProbVsStripNumber;
80  std::vector<TProfile*> pfxPoissonProbHotStripsVsStripNumber;
83  std::vector<TProfile*> pfxPoissonProbGoodStripsVsStripNumber;
85 
86  std::vector<TH2F*> nHitsVsStripNumber;
87  std::vector<TProfile*> pfxNHitsVsStripNumber;
88  std::vector<TH1F*> projXNHitsVsStripNumber;
89  std::vector<TH1F*> projYNHitsVsStripNumber;
90  std::vector<TH2F*> nHitsHotStripsVsStripNumber;
91  std::vector<TProfile*> pfxNHitsHotStripsVsStripNumber;
94  std::vector<TH2F*> nHitsGoodStripsVsStripNumber;
95  std::vector<TProfile*> pfxNHitsGoodStripsVsStripNumber;
98 
99  std::vector<std::string> subDetName;
100 
103 
104  TFile* infile;
105  TTree* intree;
106 
107  // Declaration of leaf types
108  Int_t DetRawId;
109  Int_t SubDetId;
110  Int_t Layer_Ring;
111  Int_t Disc;
112  Int_t IsBack;
116  Int_t IsStereo;
119  Int_t StripNumber;
120  Int_t APVChannel;
124  Int_t IsHot;
127  Double_t StripOccupancy;
128  Int_t StripHits;
129  Double_t PoissonProb;
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 //
155  : infilename(iConfig.getUntrackedParameter<std::string>("inputFilename", "in.root")),
156  outfilename(iConfig.getUntrackedParameter<std::string>("outputFilename", "out.root"))
157 
158 {
159  //now do what ever initialization is needed
160 }
161 
163  // do anything here that needs to be done at desctruction time
164  // (e.g. close files, deallocate resources etc.)
165 }
166 
167 //
168 // member functions
169 //
170 
171 // ------------ method called to for each event ------------
173 
174 // ------------ method called once each job just before starting event loop ------------
176  oss.str("");
177  oss << 1; //runNumber
178 
179  dqmStore_ = edm::Service<DQMStore>().operator->();
180  dqmStore_->setCurrentFolder("ChannelStatusPlots");
181 
182  for (int i = 0; i < 768; i++) {
183  for (int j = 0; j < 5; j++)
184  nReadStrips[i][j] = 0;
185  }
186 
187  // Initialize histograms
188  subDetName.push_back("");
189  subDetName.push_back("TIB");
190  subDetName.push_back("TID");
191  subDetName.push_back("TOB");
192  subDetName.push_back("TEC");
194  std::string histoTitle;
195  for (unsigned int i = 0; i < subDetName.size(); i++) {
196  histoName = "distanceVsStripNumber" + subDetName[i];
197  histoTitle = "Distance between hot strips vs. strip number";
198  if (i != 0)
199  histoTitle += " in " + subDetName[i];
200  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 999, 0.5, 999.5);
201  distanceVsStripNumber.push_back(tmp->getTH2F());
202 
203  histoName = "pfxDistanceVsStripNumber" + subDetName[i];
204  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
207  pfxDistanceVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
208  pfxDistanceVsStripNumber[i]->GetYaxis()->SetTitle("Distance");
209 
210  histoName = "projXDistanceVsStripNumber" + subDetName[i];
211  histoTitle = "Number of hot strips vs. strip number";
212  if (i != 0)
213  histoTitle += " in " + subDetName[i];
214  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
215  projXDistanceVsStripNumber.push_back(tmp->getTH1F());
216  projXDistanceVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
217  projXDistanceVsStripNumber[i]->GetYaxis()->SetTitle("N_{hot}");
218 
219  histoName = "projYDistanceVsStripNumber" + subDetName[i];
220  histoTitle = "Distribution of distance between hot strips";
221  if (i != 0)
222  histoTitle += " in " + subDetName[i];
223  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 999, 0.5, 999.5);
224  projYDistanceVsStripNumber.push_back(tmp->getTH1F());
225  projYDistanceVsStripNumber[i]->GetXaxis()->SetTitle("Distance");
226  projYDistanceVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
227 
228  //
229  histoName = "occupancyVsStripNumber" + subDetName[i];
230  histoTitle = "Occupancy of strips vs. strip number";
231  if (i != 0)
232  histoTitle += " in " + subDetName[i];
233  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 1000, -8., 0.);
234  occupancyVsStripNumber.push_back(tmp->getTH2F());
235 
236  histoName = "pfxOccupancyVsStripNumber" + subDetName[i];
237  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
240  pfxOccupancyVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
241  pfxOccupancyVsStripNumber[i]->GetYaxis()->SetTitle("log_{10}(Occupancy)");
242 
243  histoName = "projYOccupancyVsStripNumber" + subDetName[i];
244  histoTitle = "Distribution of strip occupancy";
245  if (i != 0)
246  histoTitle += " in " + subDetName[i];
247  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 1000, -8., 0.);
249  projYOccupancyVsStripNumber[i]->GetXaxis()->SetTitle("log_{10}(Occupancy)");
250  projYOccupancyVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
251 
252  //
253  histoName = "occupancyHotStripsVsStripNumber" + subDetName[i];
254  histoTitle = "Occupancy of hot strips vs. strip number";
255  if (i != 0)
256  histoTitle += " in " + subDetName[i];
257  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 1000, -8., 0.);
259 
260  histoName = "pfxOccupancyHotStripsVsStripNumber" + subDetName[i];
261  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
264  pfxOccupancyHotStripsVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
265  pfxOccupancyHotStripsVsStripNumber[i]->GetYaxis()->SetTitle("log_{10}(Occupancy)");
266 
267  histoName = "projYOccupancyHotStripsVsStripNumber" + subDetName[i];
268  histoTitle = "Distribution of hot strip occupancy";
269  if (i != 0)
270  histoTitle += " in " + subDetName[i];
271  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 1000, -8., 0.);
273  projYOccupancyHotStripsVsStripNumber[i]->GetXaxis()->SetTitle("log_{10}(Occupancy)");
274  projYOccupancyHotStripsVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
275 
276  //
277  histoName = "occupancyGoodStripsVsStripNumber" + subDetName[i];
278  histoTitle = "Occupancy of good strips vs. strip number";
279  if (i != 0)
280  histoTitle += " in " + subDetName[i];
281  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 1000, -8., 0.);
283 
284  histoName = "pfxOccupancyGoodStripsVsStripNumber" + subDetName[i];
285  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
288  pfxOccupancyGoodStripsVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
289  pfxOccupancyGoodStripsVsStripNumber[i]->GetYaxis()->SetTitle("log_{10}(Occupancy)");
290 
291  histoName = "projYOccupancyGoodStripsVsStripNumber" + subDetName[i];
292  histoTitle = "Distribution of good strip occupancy";
293  if (i != 0)
294  histoTitle += " in " + subDetName[i];
295  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 1000, -8., 0.);
297  projYOccupancyGoodStripsVsStripNumber[i]->GetXaxis()->SetTitle("log_{10}(Occupancy)");
298  projYOccupancyGoodStripsVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
299 
300  //
301  histoName = "poissonProbVsStripNumber" + subDetName[i];
302  histoTitle = "Poisson probability of strips vs. strip number";
303  if (i != 0)
304  histoTitle += " in " + subDetName[i];
305  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 1000, -18., 0.);
306  poissonProbVsStripNumber.push_back(tmp->getTH2F());
307 
308  histoName = "pfxPoissonProbVsStripNumber" + subDetName[i];
309  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
312  pfxPoissonProbVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
313  pfxPoissonProbVsStripNumber[i]->GetYaxis()->SetTitle("log_{10}(Probability)");
314 
315  histoName = "projYPoissonProbVsStripNumber" + subDetName[i];
316  histoTitle = "Distribution of strip Poisson probability";
317  if (i != 0)
318  histoTitle += " in " + subDetName[i];
319  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 1000, -18., 0.);
321  projYPoissonProbVsStripNumber[i]->GetXaxis()->SetTitle("log_{10}(Probability)");
322  projYPoissonProbVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
323 
324  //
325  histoName = "poissonProbHotStripsVsStripNumber" + subDetName[i];
326  histoTitle = "Poisson probability of hot strips vs. strip number";
327  if (i != 0)
328  histoTitle += " in " + subDetName[i];
329  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 1000, -18., 0.);
331 
332  histoName = "pfxPoissonProbHotStripsVsStripNumber" + subDetName[i];
333  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
336  pfxPoissonProbHotStripsVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
337  pfxPoissonProbHotStripsVsStripNumber[i]->GetYaxis()->SetTitle("log_{10}(Probability)");
338 
339  histoName = "projYPoissonProbHotStripsVsStripNumber" + subDetName[i];
340  histoTitle = "Distribution of hot strip Poisson probability";
341  if (i != 0)
342  histoTitle += " in " + subDetName[i];
343  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 1000, -18., 0.);
345  projYPoissonProbHotStripsVsStripNumber[i]->GetXaxis()->SetTitle("log_{10}(Probability)");
346  projYPoissonProbHotStripsVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
347 
348  //
349  histoName = "poissonProbGoodStripsVsStripNumber" + subDetName[i];
350  histoTitle = "Poisson probability of good strips vs. strip number";
351  if (i != 0)
352  histoTitle += " in " + subDetName[i];
353  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 1000, -18., 0.);
355 
356  histoName = "pfxPoissonProbGoodStripsVsStripNumber" + subDetName[i];
357  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
360  pfxPoissonProbGoodStripsVsStripNumber[i]->GetXaxis()->SetTitle("Strip");
361  pfxPoissonProbGoodStripsVsStripNumber[i]->GetYaxis()->SetTitle("log_{10}(Probability)");
362 
363  histoName = "projYPoissonProbGoodStripsVsStripNumber" + subDetName[i];
364  histoTitle = "Distribution of good strip Poisson probability";
365  if (i != 0)
366  histoTitle += " in " + subDetName[i];
367  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 1000, -18., 0.);
369  projYPoissonProbGoodStripsVsStripNumber[i]->GetXaxis()->SetTitle("log_{10}(Probability)");
370  projYPoissonProbGoodStripsVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
371 
372  //
373  histoName = "nHitsVsStripNumber" + subDetName[i];
374  histoTitle = "NHits in strips vs. strip number";
375  if (i != 0)
376  histoTitle += " in " + subDetName[i];
377  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 10000, -0.5, 9999.5);
378  nHitsVsStripNumber.push_back(tmp->getTH2F());
379 
380  histoName = "pfxNHitsVsStripNumber" + subDetName[i];
381  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
383  pfxNHitsVsStripNumber.push_back(tmp->getTProfile());
384 
385  histoName = "projXNHitsVsStripNumber" + subDetName[i];
386  histoTitle = "Cumulative nHits in strips vs. strip number";
387  if (i != 0)
388  histoTitle += " in " + subDetName[i];
389  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
390  projXNHitsVsStripNumber.push_back(tmp->getTH1F());
391 
392  histoName = "projYNHitsVsStripNumber" + subDetName[i];
393  histoTitle = "Distribution of nHits for all strips";
394  if (i != 0)
395  histoTitle += " in " + subDetName[i];
396  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 10000, -0.5, 9999.5);
397  projYNHitsVsStripNumber.push_back(tmp->getTH1F());
398  projYNHitsVsStripNumber[i]->GetXaxis()->SetTitle("N_{hits}");
399  projYNHitsVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
400 
401  //
402  histoName = "nHitsHotStripsVsStripNumber" + subDetName[i];
403  histoTitle = "NHits in hot strips vs. strip number";
404  if (i != 0)
405  histoTitle += " in " + subDetName[i];
406  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 10000, -0.5, 9999.5);
408 
409  histoName = "pfxNHitsHotStripsVsStripNumber" + subDetName[i];
410  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
413 
414  histoName = "projXNHitsHotStripsVsStripNumber" + subDetName[i];
415  histoTitle = "Cumulative nHits in hot strips vs. strip number";
416  if (i != 0)
417  histoTitle += " in " + subDetName[i];
418  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
420 
421  histoName = "projYNHitsHotStripsVsStripNumber" + subDetName[i];
422  histoTitle = "Distribution of nHits for hot strips";
423  if (i != 0)
424  histoTitle += " in " + subDetName[i];
425  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 10000, -0.5, 9999.5);
427  projYNHitsHotStripsVsStripNumber[i]->GetXaxis()->SetTitle("N_{hits}");
428  projYNHitsHotStripsVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
429 
430  //
431  histoName = "nHitsGoodStripsVsStripNumber" + subDetName[i];
432  histoTitle = "NHits in good strips vs. strip number";
433  if (i != 0)
434  histoTitle += " in " + subDetName[i];
435  tmp = dqmStore_->book2D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5, 10000, -0.5, 9999.5);
437 
438  histoName = "pfxNHitsGoodStripsVsStripNumber" + subDetName[i];
439  tmp_prof = new TProfile(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
442 
443  histoName = "projXNHitsGoodStripsVsStripNumber" + subDetName[i];
444  histoTitle = "Cumulative nHits in good strips vs. strip number";
445  if (i != 0)
446  histoTitle += " in " + subDetName[i];
447  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 768, 0.5, 768.5);
449 
450  histoName = "projYNHitsGoodStripsVsStripNumber" + subDetName[i];
451  histoTitle = "Distribution of nHits for good strips";
452  if (i != 0)
453  histoTitle += " in " + subDetName[i];
454  tmp = dqmStore_->book1D(histoName.c_str(), histoTitle.c_str(), 10000, -0.5, 9999.5);
456  projYNHitsGoodStripsVsStripNumber[i]->GetXaxis()->SetTitle("N_{hits}");
457  projYNHitsGoodStripsVsStripNumber[i]->GetYaxis()->SetTitle("N_{strips}");
458  }
459 }
460 
461 // ------------ method called once each job just after ending the event loop ------------
463  infile = new TFile(infilename.c_str(), "READ");
464  intree = (TTree*)infile->Get("stripOccupancy");
465 
466  intree->SetBranchAddress("DetRawId", &DetRawId);
467  intree->SetBranchAddress("SubDetId", &SubDetId);
468  intree->SetBranchAddress("Layer_Ring", &Layer_Ring);
469  intree->SetBranchAddress("Disc", &Disc);
470  intree->SetBranchAddress("IsBack", &IsBack);
471  intree->SetBranchAddress("IsExternalString", &IsExternalString);
472  intree->SetBranchAddress("IsZMinusSide", &IsZMinusSide);
473  intree->SetBranchAddress("RodStringPetal", &RodStringPetal);
474  intree->SetBranchAddress("IsStereo", &IsStereo);
475  intree->SetBranchAddress("ModulePosition", &ModulePosition);
476  intree->SetBranchAddress("NumberOfStrips", &NumberOfStrips);
477  intree->SetBranchAddress("StripNumber", &StripNumber);
478  intree->SetBranchAddress("APVChannel", &APVChannel);
479  intree->SetBranchAddress("StripGlobalPositionX", &StripGlobalPositionX);
480  intree->SetBranchAddress("StripGlobalPositionY", &StripGlobalPositionY);
481  intree->SetBranchAddress("StripGlobalPositionZ", &StripGlobalPositionZ);
482  intree->SetBranchAddress("IsHot", &IsHot);
483  intree->SetBranchAddress("HotStripsPerAPV", &HotStripsPerAPV);
484  intree->SetBranchAddress("HotStripsPerModule", &HotStripsPerModule);
485  intree->SetBranchAddress("StripOccupancy", &StripOccupancy);
486  intree->SetBranchAddress("StripHits", &StripHits);
487  intree->SetBranchAddress("PoissonProb", &PoissonProb);
488 
489  for (int i = 0; i < intree->GetEntries(); /* */) {
490  intree->GetEntry(i);
491 
493  firstEntry = i;
496  vHotStripsInModule.clear();
497 
498  for (int j = firstEntry; j < firstEntry + savedNStrips; j++) {
499  intree->GetEntry(j);
500 
501  if (DetRawId != savedDetRawId) {
502  std::cout << "ERROR! DetRawId changed but I expected to be on the same module!\n";
503  return;
504  }
505 
506  double logStripOccupancy = log10(StripOccupancy);
507  double logPoissonProb = log10(fabs(PoissonProb));
508 
509  (nReadStrips[StripNumber - 1][0])++;
510  (nReadStrips[StripNumber - 1][SubDetId - 2])++;
511  //std::cout << "StripNumber = " << StripNumber << ", SubDetId = " << SubDetId << ", nReadStripsAll = " << nReadStrips[StripNumber-1][0] << ", nReadStripsSubDet = " << nReadStrips[StripNumber-1][SubDetId-2] << std::endl;
512  occupancyVsStripNumber[0]->Fill(StripNumber, logStripOccupancy);
513  occupancyVsStripNumber[SubDetId - 2]->Fill(StripNumber, logStripOccupancy);
514  poissonProbVsStripNumber[0]->Fill(StripNumber, logPoissonProb);
515  poissonProbVsStripNumber[SubDetId - 2]->Fill(StripNumber, logPoissonProb);
518 
519  if (IsHot) {
520  vHotStripsInModule.push_back(StripNumber);
521  // std::cout << "detId = " << DetRawId << ", StripN = " << StripNumber << ", StripOccupancy = " << StripOccupancy << " PoissonProb = " << PoissonProb << std::endl ;
522  occupancyHotStripsVsStripNumber[0]->Fill(StripNumber, logStripOccupancy);
523  occupancyHotStripsVsStripNumber[SubDetId - 2]->Fill(StripNumber, logStripOccupancy);
524  poissonProbHotStripsVsStripNumber[0]->Fill(StripNumber, logPoissonProb);
525  poissonProbHotStripsVsStripNumber[SubDetId - 2]->Fill(StripNumber, logPoissonProb);
528  } else {
529  occupancyGoodStripsVsStripNumber[0]->Fill(StripNumber, logStripOccupancy);
530  occupancyGoodStripsVsStripNumber[SubDetId - 2]->Fill(StripNumber, logStripOccupancy);
531  poissonProbGoodStripsVsStripNumber[0]->Fill(StripNumber, logPoissonProb);
532  poissonProbGoodStripsVsStripNumber[SubDetId - 2]->Fill(StripNumber, logPoissonProb);
535  }
536  }
537 
538  if (vHotStripsInModule.size() == 1) {
539  distance = 999;
542  } else if (vHotStripsInModule.size() > 1) {
543  for (unsigned int iVec = 0; iVec != vHotStripsInModule.size(); iVec++) {
544  if (iVec == 0)
546  else if (iVec == vHotStripsInModule.size() - 1) {
547  distance =
549  } else if (vHotStripsInModule.size() > 2) {
550  distanceR = vHotStripsInModule[iVec + 1] - vHotStripsInModule[iVec];
551  distanceL = vHotStripsInModule[iVec] - vHotStripsInModule[iVec - 1];
553  } else {
554  std::cout << "ERROR! distance is never computed!!!\n";
555  }
556  // std::cout << "detId = " << savedDetRawId << ", StripN = " << vHotStripsInModule[iVec] << ", distance = " << distance << std::endl;
559  }
560  }
561 
562  i += savedNStrips;
563  }
564 
566  std::string histoTitle;
567 
568  for (unsigned int i = 0; i < subDetName.size(); i++) {
569  projYDistanceVsStripNumber[i]->Add((TH1F*)distanceVsStripNumber[i]->ProjectionY());
571  distanceVsStripNumber[i]->ProfileX(pfxDistanceVsStripNumber[i]->GetName(), 1, 998));
572  projYNHitsVsStripNumber[i]->Add(nHitsVsStripNumber[i]->ProjectionY());
575  projYOccupancyVsStripNumber[i]->Add(occupancyVsStripNumber[i]->ProjectionY());
579  occupancyVsStripNumber[i]->ProfileX(pfxOccupancyVsStripNumber[i]->GetName(), -8., 0.));
583  occupancyHotStripsVsStripNumber[i]->ProfileX(pfxOccupancyHotStripsVsStripNumber[i]->GetName(), -8., 0.));
588  poissonProbVsStripNumber[i]->ProfileX(pfxPoissonProbVsStripNumber[i]->GetName(), -18., 0.));
594  distanceVsStripNumber[i]->ProjectionX(projXDistanceVsStripNumber[i]->GetName(), 1, 998));
595  }
596 
597  dqmStore_->cd();
598  dqmStore_->save(outfilename, "ChannelStatusPlots");
599 }
600 
601 //define this as a plug-in
StripValidationPlots::projYOccupancyHotStripsVsStripNumber
std::vector< TH1F * > projYOccupancyHotStripsVsStripNumber
Definition: StripValidationPlots.cc:71
mps_fire.i
i
Definition: mps_fire.py:428
StripValidationPlots::IsBack
Int_t IsBack
Definition: StripValidationPlots.cc:112
StripValidationPlots::pfxNHitsGoodStripsVsStripNumber
std::vector< TProfile * > pfxNHitsGoodStripsVsStripNumber
Definition: StripValidationPlots.cc:95
StripValidationPlots::projYDistanceVsStripNumber
std::vector< TH1F * > projYDistanceVsStripNumber
Definition: StripValidationPlots.cc:64
StripValidationPlots::StripGlobalPositionY
Float_t StripGlobalPositionY
Definition: StripValidationPlots.cc:122
StripValidationPlots::MonitorElement
dqm::legacy::MonitorElement MonitorElement
Definition: StripValidationPlots.cc:43
StripValidationPlots::NumberOfStrips
Int_t NumberOfStrips
Definition: StripValidationPlots.cc:118
StripValidationPlots::StripGlobalPositionZ
Float_t StripGlobalPositionZ
Definition: StripValidationPlots.cc:123
StripValidationPlots::StripHits
Int_t StripHits
Definition: StripValidationPlots.cc:128
gather_cfg.cout
cout
Definition: gather_cfg.py:144
StripValidationPlots::HotStripsPerAPV
Int_t HotStripsPerAPV
Definition: StripValidationPlots.cc:125
StripValidationPlots::pfxOccupancyGoodStripsVsStripNumber
std::vector< TProfile * > pfxOccupancyGoodStripsVsStripNumber
Definition: StripValidationPlots.cc:73
StripValidationPlots::nHitsHotStripsVsStripNumber
std::vector< TH2F * > nHitsHotStripsVsStripNumber
Definition: StripValidationPlots.cc:90
StripValidationPlots::endJob
void endJob() override
Definition: StripValidationPlots.cc:462
StripValidationPlots::PoissonProb
Double_t PoissonProb
Definition: StripValidationPlots.cc:129
DQMStore.h
StripValidationPlots::SubDetId
Int_t SubDetId
Definition: StripValidationPlots.cc:109
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
StripValidationPlots::HotStripsPerModule
Int_t HotStripsPerModule
Definition: StripValidationPlots.cc:126
EDAnalyzer.h
StripValidationPlots::beginJob
void beginJob() override
Definition: StripValidationPlots.cc:175
StripValidationPlots::projYPoissonProbVsStripNumber
std::vector< TH1F * > projYPoissonProbVsStripNumber
Definition: StripValidationPlots.cc:78
StripValidationPlots::pfxPoissonProbVsStripNumber
std::vector< TProfile * > pfxPoissonProbVsStripNumber
Definition: StripValidationPlots.cc:77
StripValidationPlots::occupancyGoodStripsVsStripNumber
std::vector< TH2F * > occupancyGoodStripsVsStripNumber
Definition: StripValidationPlots.cc:72
StripValidationPlots::projYPoissonProbHotStripsVsStripNumber
std::vector< TH1F * > projYPoissonProbHotStripsVsStripNumber
Definition: StripValidationPlots.cc:81
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:479
StripValidationPlots::projYOccupancyVsStripNumber
std::vector< TH1F * > projYOccupancyVsStripNumber
Definition: StripValidationPlots.cc:68
StripValidationPlots::nReadStrips
unsigned int nReadStrips[768][5]
Definition: StripValidationPlots.cc:138
StripValidationPlots::projXDistanceVsStripNumber
std::vector< TH1F * > projXDistanceVsStripNumber
Definition: StripValidationPlots.cc:63
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
StripValidationPlots::pfxDistanceVsStripNumber
std::vector< TProfile * > pfxDistanceVsStripNumber
Definition: StripValidationPlots.cc:62
StripValidationPlots::occupancyHotStripsVsStripNumber
std::vector< TH2F * > occupancyHotStripsVsStripNumber
Definition: StripValidationPlots.cc:69
StripValidationPlots::distanceR
unsigned int distanceR
Definition: StripValidationPlots.cc:137
StripValidationPlots::pfxNHitsHotStripsVsStripNumber
std::vector< TProfile * > pfxNHitsHotStripsVsStripNumber
Definition: StripValidationPlots.cc:91
MakerMacros.h
StripValidationPlots::APVChannel
Int_t APVChannel
Definition: StripValidationPlots.cc:120
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
dqm::legacy::DQMStore
Definition: DQMStore.h:727
StripValidationPlots::savedNStrips
Int_t savedNStrips
Definition: StripValidationPlots.cc:132
StripValidationPlots::pfxOccupancyHotStripsVsStripNumber
std::vector< TProfile * > pfxOccupancyHotStripsVsStripNumber
Definition: StripValidationPlots.cc:70
StripValidationPlots::infilename
std::string infilename
Definition: StripValidationPlots.cc:101
SiStripCommissioningSource_FromRAW_cfg.outfilename
outfilename
Definition: SiStripCommissioningSource_FromRAW_cfg.py:122
StripValidationPlots::projYNHitsHotStripsVsStripNumber
std::vector< TH1F * > projYNHitsHotStripsVsStripNumber
Definition: StripValidationPlots.cc:93
Service.h
StripValidationPlots::poissonProbGoodStripsVsStripNumber
std::vector< TH2F * > poissonProbGoodStripsVsStripNumber
Definition: StripValidationPlots.cc:82
StripValidationPlots::projYOccupancyGoodStripsVsStripNumber
std::vector< TH1F * > projYOccupancyGoodStripsVsStripNumber
Definition: StripValidationPlots.cc:74
dqm::implementation::IBooker::bookProfile
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:322
StripValidationPlots::nHitsGoodStripsVsStripNumber
std::vector< TH2F * > nHitsGoodStripsVsStripNumber
Definition: StripValidationPlots.cc:94
StripValidationPlots::IsZMinusSide
Int_t IsZMinusSide
Definition: StripValidationPlots.cc:114
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
StripValidationPlots::tmp
MonitorElement * tmp
Definition: StripValidationPlots.cc:57
dqm::legacy::MonitorElement::getTProfile
virtual TProfile * getTProfile() const
Definition: MonitorElement.h:507
dqm::implementation::DQMStore::save
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
Definition: DQMStore.cc:761
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
StripValidationPlots::poissonProbHotStripsVsStripNumber
std::vector< TH2F * > poissonProbHotStripsVsStripNumber
Definition: StripValidationPlots.cc:79
StripValidationPlots::projYNHitsVsStripNumber
std::vector< TH1F * > projYNHitsVsStripNumber
Definition: StripValidationPlots.cc:89
StripValidationPlots::IsExternalString
Int_t IsExternalString
Definition: StripValidationPlots.cc:113
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
StripValidationPlots::tmp_prof
TProfile * tmp_prof
Definition: StripValidationPlots.cc:58
StripValidationPlots::projYPoissonProbGoodStripsVsStripNumber
std::vector< TH1F * > projYPoissonProbGoodStripsVsStripNumber
Definition: StripValidationPlots.cc:84
StripValidationPlots::savedSubDetId
Int_t savedSubDetId
Definition: StripValidationPlots.cc:133
edm::Service
Definition: Service.h:30
iEvent
int iEvent
Definition: GenABIO.cc:224
StripValidationPlots::pfxPoissonProbHotStripsVsStripNumber
std::vector< TProfile * > pfxPoissonProbHotStripsVsStripNumber
Definition: StripValidationPlots.cc:80
StripValidationPlots::StripOccupancy
Double_t StripOccupancy
Definition: StripValidationPlots.cc:127
StripValidationPlots::poissonProbVsStripNumber
std::vector< TH2F * > poissonProbVsStripNumber
Definition: StripValidationPlots.cc:76
edm::EventSetup
Definition: EventSetup.h:58
DetSetVector.h
StripValidationPlots::dqmStore_
DQMStore * dqmStore_
Definition: StripValidationPlots.cc:55
StripValidationPlots::~StripValidationPlots
~StripValidationPlots() override
Definition: StripValidationPlots.cc:162
StripValidationPlots::StripNumber
Int_t StripNumber
Definition: StripValidationPlots.cc:119
StripValidationPlots::distance
unsigned int distance
Definition: StripValidationPlots.cc:136
StripValidationPlots::nHitsVsStripNumber
std::vector< TH2F * > nHitsVsStripNumber
Definition: StripValidationPlots.cc:86
StripValidationPlots::Disc
Int_t Disc
Definition: StripValidationPlots.cc:111
StripValidationPlots::infile
TFile * infile
Definition: StripValidationPlots.cc:104
StripValidationPlots::StripGlobalPositionX
Float_t StripGlobalPositionX
Definition: StripValidationPlots.cc:121
StripValidationPlots::savedDetRawId
Int_t savedDetRawId
Definition: StripValidationPlots.cc:131
StripValidationPlots::DQMStore
dqm::legacy::DQMStore DQMStore
Definition: StripValidationPlots.cc:42
StripValidationPlots::pfxNHitsVsStripNumber
std::vector< TProfile * > pfxNHitsVsStripNumber
Definition: StripValidationPlots.cc:87
StripValidationPlots::projYNHitsGoodStripsVsStripNumber
std::vector< TH1F * > projYNHitsGoodStripsVsStripNumber
Definition: StripValidationPlots.cc:97
std
Definition: JetResolutionObject.h:76
StripValidationPlots
Definition: StripValidationPlots.cc:40
StripValidationPlots::outfilename
std::string outfilename
Definition: StripValidationPlots.cc:102
StripValidationPlots::intree
TTree * intree
Definition: StripValidationPlots.cc:105
Frameworkfwd.h
StripValidationPlots::IsHot
Int_t IsHot
Definition: StripValidationPlots.cc:124
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
StripValidationPlots::vHotStripsInModule
std::vector< unsigned int > vHotStripsInModule
Definition: StripValidationPlots.cc:135
StripValidationPlots::ModulePosition
Int_t ModulePosition
Definition: StripValidationPlots.cc:117
StripValidationPlots::oss
std::ostringstream oss
Definition: StripValidationPlots.cc:53
StripValidationPlots::projXNHitsVsStripNumber
std::vector< TH1F * > projXNHitsVsStripNumber
Definition: StripValidationPlots.cc:88
StripValidationPlots::Layer_Ring
Int_t Layer_Ring
Definition: StripValidationPlots.cc:110
StripValidationPlots::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: StripValidationPlots.cc:172
HltBtagPostValidation_cff.histoName
histoName
Definition: HltBtagPostValidation_cff.py:17
StripValidationPlots::IsStereo
Int_t IsStereo
Definition: StripValidationPlots.cc:116
StripValidationPlots::subDetName
std::vector< std::string > subDetName
Definition: StripValidationPlots.cc:99
StripValidationPlots::firstEntry
Int_t firstEntry
Definition: StripValidationPlots.cc:134
StripValidationPlots::distanceVsStripNumber
std::vector< TH2F * > distanceVsStripNumber
Definition: StripValidationPlots.cc:61
StripValidationPlots::pfxOccupancyVsStripNumber
std::vector< TProfile * > pfxOccupancyVsStripNumber
Definition: StripValidationPlots.cc:67
StripValidationPlots::distanceL
unsigned int distanceL
Definition: StripValidationPlots.cc:137
ParameterSet.h
StripValidationPlots::projXNHitsGoodStripsVsStripNumber
std::vector< TH1F * > projXNHitsGoodStripsVsStripNumber
Definition: StripValidationPlots.cc:96
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SiStripClusterCollection.h
edm::Event
Definition: Event.h:73
StripValidationPlots::RodStringPetal
Int_t RodStringPetal
Definition: StripValidationPlots.cc:115
SiStripCommissioningSource_FromEDM_cfg.infilename
infilename
Definition: SiStripCommissioningSource_FromEDM_cfg.py:64
StripSubdetector.h
DetSetVectorNew.h
StripValidationPlots::DetRawId
Int_t DetRawId
Definition: StripValidationPlots.cc:108
StripValidationPlots::projXNHitsHotStripsVsStripNumber
std::vector< TH1F * > projXNHitsHotStripsVsStripNumber
Definition: StripValidationPlots.cc:92
StripValidationPlots::pfxPoissonProbGoodStripsVsStripNumber
std::vector< TProfile * > pfxPoissonProbGoodStripsVsStripNumber
Definition: StripValidationPlots.cc:83
StripValidationPlots::occupancyVsStripNumber
std::vector< TH2F * > occupancyVsStripNumber
Definition: StripValidationPlots.cc:66
dqm::implementation::DQMStore::cd
void cd() override
Definition: DQMStore.h:564
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
StripValidationPlots::StripValidationPlots
StripValidationPlots(const edm::ParameterSet &)
Definition: StripValidationPlots.cc:154
dqm::legacy::MonitorElement::getTH2F
virtual TH2F * getTH2F() const
Definition: MonitorElement.h:491