CMS 3D CMS Logo

EcalDisplaysByEvent.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: EcalDisplaysByEvent
4 // Class: EcalDisplaysByEvent
5 //
13 //
14 // Original Author: Seth COOPER
15 // Created: Th Aug 28 5:46:22 CEST 2007
16 //
17 //
18 
21 #include "TLatex.h"
22 #include "TLine.h"
23 #include "TProfile2D.h"
24 #include <utility>
25 #include <string>
26 #include <vector>
27 using namespace edm;
28 using namespace std;
29 
30 //
31 // constants, enums and typedefs
32 //
33 
34 //
35 // static data member definitions
36 //
37 float EcalDisplaysByEvent::gainRatio[3] = {1., 2., 12.};
39 
40 //
41 // constructors and destructor
42 //
44  : EBRecHitCollection_(iConfig.getParameter<edm::InputTag>("EcalRecHitCollectionEB")),
45  EERecHitCollection_(iConfig.getParameter<edm::InputTag>("EcalRecHitCollectionEE")),
46  EBDigis_(iConfig.getParameter<edm::InputTag>("EBDigiCollection")),
47  EEDigis_(iConfig.getParameter<edm::InputTag>("EEDigiCollection")),
48  headerProducer_(iConfig.getParameter<edm::InputTag>("headerProducer")),
49  runNum_(-1),
50  side_(iConfig.getUntrackedParameter<int>("side", 3)),
51  threshold_(iConfig.getUntrackedParameter<double>("amplitudeThreshold", 0.5)),
52  minTimingAmp_(iConfig.getUntrackedParameter<double>("minimumTimingAmplitude", 0.100)),
53  makeDigiGraphs_(iConfig.getUntrackedParameter<bool>("makeDigiGraphs", false)),
54  makeTimingHistos_(iConfig.getUntrackedParameter<bool>("makeTimingHistos", true)),
55  makeEnergyHistos_(iConfig.getUntrackedParameter<bool>("makeEnergyHistos", true)),
56  makeOccupancyHistos_(iConfig.getUntrackedParameter<bool>("makeOccupancyHistos", true)),
57  histRangeMin_(iConfig.getUntrackedParameter<double>("histogramMinRange", 0.0)),
58  histRangeMax_(iConfig.getUntrackedParameter<double>("histogramMaxRange", 1.8)),
59  minTimingEnergyEB_(iConfig.getUntrackedParameter<double>("minTimingEnergyEB", 0.0)),
60  minTimingEnergyEE_(iConfig.getUntrackedParameter<double>("minTimingEnergyEE", 0.0)) {
61  vector<int> listDefaults;
62  listDefaults.push_back(-1);
63 
64  maskedChannels_ = iConfig.getUntrackedParameter<vector<int> >("maskedChannels", listDefaults);
65  maskedFEDs_ = iConfig.getUntrackedParameter<vector<int> >("maskedFEDs", listDefaults);
66  seedCrys_ = iConfig.getUntrackedParameter<vector<int> >("seedCrys", listDefaults);
67 
68  vector<string> defaultMaskedEBs;
69  defaultMaskedEBs.push_back("none");
70  maskedEBs_ = iConfig.getUntrackedParameter<vector<string> >("maskedEBs", defaultMaskedEBs);
71 
72  fedMap_ = new EcalFedMap();
73 
74  string title1 = "Jitter for all FEDs all events";
75  string name1 = "JitterAllFEDsAllEvents";
76  allFedsTimingHist_ = fileService->make<TH1F>(name1.c_str(), title1.c_str(), 150, -7, 7);
77 
78  // load up the maskedFED list with the proper FEDids
79  if (maskedFEDs_[0] == -1) {
80  //if "actual" EB id given, then convert to FEDid and put in listFEDs_
81  if (maskedEBs_[0] != "none") {
82  maskedFEDs_.clear();
83  for (vector<string>::const_iterator ebItr = maskedEBs_.begin(); ebItr != maskedEBs_.end(); ++ebItr) {
84  maskedFEDs_.push_back(fedMap_->getFedFromSlice(*ebItr));
85  }
86  }
87  }
88 
89  for (int i = 0; i < 10; i++)
90  abscissa[i] = i;
91 
92  naiveEvtNum_ = 0;
93 
95 }
96 
98 
99 //
100 // member functions
101 //
102 
103 // ------------ method called once each job just before starting event loop ------------
106  c.get<EcalMappingRcd>().get(handle);
107  ecalElectronicsMap_ = handle.product();
108 }
109 
110 // ------------ method called to for each event ------------
112  // get the headers
113  // (one header for each supermodule)
115  iEvent.getByLabel(headerProducer_, DCCHeaders);
116 
117  for (EcalRawDataCollection::const_iterator headerItr = DCCHeaders->begin(); headerItr != DCCHeaders->end();
118  ++headerItr) {
119  FEDsAndDCCHeaders_[headerItr->id() + 600] = *headerItr;
120  }
121 
122  int ievt = iEvent.id().event();
123  naiveEvtNum_++;
124 
125  if (runNum_ == -1) {
126  runNum_ = iEvent.id().run();
127  canvasNames_ = fileService->make<TTree>("canvasNames", "Names of written canvases");
128  names = new std::vector<string>();
129  canvasNames_->Branch("names", "vector<string>", &names);
130 
131  histoCanvasNames_ = fileService->make<TTree>("histoCanvasNames", "Names of written canvases with histos");
132  histoCanvasNamesVector = new std::vector<string>();
133  histoCanvasNames_->Branch("histoCanvasNamesVector", "vector<string>", &histoCanvasNamesVector);
134  }
135 
136  //We only want the 3x3's for this event...
137  listEBChannels.clear();
138  listEEChannels.clear();
139 
140  //Get hits, digis, caloTopology from event/eventSetup
143  ESHandle<CaloTopology> caloTopo;
144  iSetup.get<CaloTopologyRecord>().get(caloTopo);
145  iEvent.getByLabel(EBRecHitCollection_, EBhits);
146  iEvent.getByLabel(EERecHitCollection_, EEhits);
149 
150  // Initialize histos for this event
152 
153  bool hasEBdigis = false;
154  bool hasEEdigis = false;
155  if (!EBdigisHandle->empty())
156  hasEBdigis = true;
157  if (!EEdigisHandle->empty())
158  hasEEdigis = true;
159 
160  // Produce the digi graphs
161  if (makeDigiGraphs_) {
162  if (hasEBdigis) //if event has digis, it should have hits
163  selectHits(EBhits, ievt, caloTopo);
164  if (hasEEdigis)
165  selectHits(EEhits, ievt, caloTopo);
166  }
167 
168  // Produce the histos
169  if (hasEBdigis) {
171  makeHistos(EBhits);
172  }
173  if (hasEEdigis) {
175  makeHistos(EEhits);
176  }
177 
178  if (hasEBdigis || hasEEdigis)
179  drawHistos();
180 
182 }
183 
185  for (EcalRecHitCollection::const_iterator hitItr = hits->begin(); hitItr != hits->end(); ++hitItr) {
186  EcalRecHit hit = (*hitItr);
187  DetId det = hit.id();
189  int FEDid = 600 + elecId.dccId();
190  bool isBarrel = true;
191  if (FEDid < 610 || FEDid > 645)
192  isBarrel = false;
193  int cryIndex = isBarrel ? ((EBDetId)det).hashedIndex() : getEEIndex(elecId);
194  int ic = isBarrel ? ((EBDetId)det).ic() : getEEIndex(elecId);
195 
196  float ampli = hit.energy();
197 
198  vector<int>::iterator result;
199  result = find(maskedFEDs_.begin(), maskedFEDs_.end(), FEDid);
200  if (result != maskedFEDs_.end()) {
201  //LogWarning("EcalDisplaysByEvent") << "skipping uncalRecHit for FED " << FEDid << " ; amplitude " << ampli;
202  continue;
203  }
204  result = find(maskedChannels_.begin(), maskedChannels_.end(), cryIndex);
205  if (result != maskedChannels_.end()) {
206  //LogWarning("EcalDisplaysByEvent") << "skipping uncalRecHit for channel: " << cryIndex << " in fed: " << FEDid << " with amplitude " << ampli ;
207  continue;
208  }
209  bool cryIsInList = false;
210  result = find(seedCrys_.begin(), seedCrys_.end(), cryIndex);
211  if (result != seedCrys_.end())
212  cryIsInList = true;
213 
214  // Either we must have a user-requested cry (in which case there is no amplitude selection)
215  // Or we pick all crys that pass the amplitude cut (in which case there is no fixed crystal selection)
216  if (cryIsInList || (seedCrys_.empty() && ampli > threshold_)) {
217  // We have a winner!
218  crysAndAmplitudesMap_[cryIndex] = ampli;
219  string name = "Digis_Event" + intToString(naiveEvtNum_) + "_ic" + intToString(ic) + "_FED" + intToString(FEDid);
220  string title = "Digis";
221  string seed = "ic" + intToString(ic) + "_FED" + intToString(FEDid);
222  int freq = 1;
223  pair<map<string, int>::iterator, bool> pair = seedFrequencyMap_.insert(make_pair(seed, freq));
224  if (!pair.second) {
225  ++(pair.first->second);
226  }
227 
228  //TODO: move this also to TFileService
229  TCanvas can(name.c_str(), title.c_str(), 200, 50, 900, 900);
230  can.Divide(side_, side_);
231  TGraph* myGraph;
232 
234  //Now put each graph in one by one
235  for (int j = side_ / 2; j >= -side_ / 2; --j) {
236  for (int i = -side_ / 2; i <= side_ / 2; ++i) {
237  cursor.home();
238  cursor.offsetBy(i, j);
239  can.cd(i + 1 + side_ / 2 + side_ * (1 - j));
240  myGraph = selectDigi(*cursor, ievt);
241  myGraph->Draw("A*");
242  }
243  }
244  can.Write();
245  names->push_back(name);
246  }
247  }
248 }
249 
250 TGraph* EcalDisplaysByEvent::selectDigi(DetId thisDet, int ievt) {
251  int emptyY[10];
252  for (int i = 0; i < 10; i++)
253  emptyY[i] = 0;
254  TGraph* emptyGraph = fileService->make<TGraph>(10, abscissa, emptyY);
255  emptyGraph->SetTitle("NOT ECAL");
256 
257  //If the DetId is not from Ecal, return
258  if (thisDet.det() != DetId::Ecal)
259  return emptyGraph;
260 
261  emptyGraph->SetTitle("NO DIGIS");
262  //find digi we need -- can't get find() to work; need DataFrame(DetId det) to work?
264  int FEDid = 600 + elecId.dccId();
265  bool isBarrel = true;
266  if (FEDid < 610 || FEDid > 645)
267  isBarrel = false;
268  int cryIndex = isBarrel ? ((EBDetId)thisDet).hashedIndex() : getEEIndex(elecId);
269  int ic = isBarrel ? ((EBDetId)thisDet).ic() : cryIndex;
270 
271  string sliceName = fedMap_->getSliceFromFed(FEDid);
272  EcalDataFrame df;
273  if (isBarrel) {
275  while (digiItr != EBdigisHandle->end() && ((*digiItr).id() != (EBDetId)thisDet)) {
276  ++digiItr;
277  }
278  if (digiItr == EBdigisHandle->end()) {
279  //LogWarning("EcalDisplaysByEvent") << "Cannot find digi for ic:" << ic
280  // << " FED:" << FEDid << " evt:" << naiveEvtNum_;
281  return emptyGraph;
282  } else
283  df = *digiItr;
284  } else {
286  while (digiItr != EEdigisHandle->end() && ((*digiItr).id() != (EEDetId)thisDet)) {
287  ++digiItr;
288  }
289  if (digiItr == EEdigisHandle->end()) {
290  //LogWarning("EcalDisplaysByEvent") << "Cannot find digi for ic:" << ic
291  // << " FED:" << FEDid << " evt:" << naiveEvtNum_;
292  return emptyGraph;
293  } else
294  df = *digiItr;
295  }
296 
297  int gainId = FEDsAndDCCHeaders_[FEDid].getMgpaGain();
298  int gainHuman;
299  if (gainId == 1)
300  gainHuman = 12;
301  else if (gainId == 2)
302  gainHuman = 6;
303  else if (gainId == 3)
304  gainHuman = 1;
305  else
306  gainHuman = -1;
307 
308  double pedestal = 200;
309 
310  emptyGraph->SetTitle("FIRST TWO SAMPLES NOT GAIN12");
311  if (df.sample(0).gainId() != 1 || df.sample(1).gainId() != 1)
312  return emptyGraph; //goes to the next digi
313  else {
314  ordinate[0] = df.sample(0).adc();
315  ordinate[1] = df.sample(1).adc();
316  pedestal = (double)(ordinate[0] + ordinate[1]) / (double)2;
317  }
318 
319  for (int i = 0; i < df.size(); ++i) {
320  if (df.sample(i).gainId() != 0)
321  ordinate[i] = (int)(pedestal + (df.sample(i).adc() - pedestal) * gainRatio[df.sample(i).gainId() - 1]);
322  else
323  ordinate[i] = 49152; //Saturation of gain1
324  }
325 
326  TGraph* oneGraph = fileService->make<TGraph>(10, abscissa, ordinate);
327  string name = "Graph_ev" + intToString(naiveEvtNum_) + "_ic" + intToString(ic) + "_FED" + intToString(FEDid);
328  string gainString = (gainId == 1) ? "Free" : intToString(gainHuman);
329  string title = "Event" + intToString(naiveEvtNum_) + "_lv1a" + intToString(ievt) + "_ic" + intToString(ic) + "_" +
330  sliceName + "_gain" + gainString;
331 
332  float energy = 0;
333  map<int, float>::const_iterator itr;
334  itr = crysAndAmplitudesMap_.find(cryIndex);
335  if (itr != crysAndAmplitudesMap_.end()) {
336  //edm::LogWarning("EcalDisplaysByEvent")<< "itr->second(ampli)="<< itr->second;
337  energy = (float)itr->second;
338  }
339  //else
340  //edm::LogWarning("EcalDisplaysByEvent") << "cry " << ic << "not found in ampMap";
341 
342  title += "_Energy" + floatToString(round(energy * 1000));
343 
344  oneGraph->SetTitle(title.c_str());
345  oneGraph->SetName(name.c_str());
346  oneGraph->GetXaxis()->SetTitle("sample");
347  oneGraph->GetYaxis()->SetTitle("ADC");
348  return oneGraph;
349 }
350 
352  int FEDid = 600 + elecId.dccId();
353  return 10000 * FEDid + 100 * elecId.towerId() + 5 * (elecId.stripId() - 1) + elecId.xtalId();
354 }
355 
357  const EBDigiCollection* ebDigis = ebDigiHandle.product();
358  for (EBDigiCollection::const_iterator digiItr = ebDigis->begin(); digiItr != ebDigis->end(); ++digiItr) {
359  EBDetId digiId = digiItr->id();
360  int ieta = digiId.ieta();
361  int iphi = digiId.iphi();
362  digiOccupancyEBAll_->Fill(iphi, ieta);
363  digiOccupancyEBcoarseAll_->Fill(iphi, ieta);
364  if (makeOccupancyHistos_) {
365  digiOccupancyEB_->Fill(iphi, ieta);
366  digiOccupancyEBcoarse_->Fill(iphi, ieta);
367  }
368  }
369 }
370 
372  const EEDigiCollection* eeDigis = eeDigiHandle.product();
373  for (EEDigiCollection::const_iterator digiItr = eeDigis->begin(); digiItr != eeDigis->end(); ++digiItr) {
374  DetId det = digiItr->id();
376  size_t FEDid = 600 + elecId.dccId();
377  bool isEEM = false;
378  if (FEDid < 610)
379  isEEM = true;
380  EEDetId digiId = digiItr->id();
381  int ieta = digiId.iy();
382  int iphi = digiId.ix();
383  if (isEEM) {
384  digiOccupancyEEMAll_->Fill(iphi, ieta);
385  digiOccupancyEEMcoarseAll_->Fill(iphi, ieta);
386  if (makeOccupancyHistos_) {
387  digiOccupancyEEMcoarse_->Fill(iphi, ieta);
388  digiOccupancyEEM_->Fill(iphi, ieta);
389  }
390  } else {
391  digiOccupancyEEPAll_->Fill(iphi, ieta);
392  digiOccupancyEEPcoarseAll_->Fill(iphi, ieta);
393  if (makeOccupancyHistos_) {
394  digiOccupancyEEP_->Fill(iphi, ieta);
395  digiOccupancyEEPcoarse_->Fill(iphi, ieta);
396  }
397  }
398  }
399 }
400 
402  for (EcalRecHitCollection::const_iterator hitItr = hits->begin(); hitItr != hits->end(); ++hitItr) {
403  EcalRecHit hit = (*hitItr);
404  DetId det = hit.id();
406  int FEDid = 600 + elecId.dccId();
407  bool isBarrel = true;
408  bool isEEM = false;
409  if (FEDid < 610 || FEDid > 645) {
410  isBarrel = false;
411  if (FEDid < 610)
412  isEEM = true;
413  }
414  int iphi = isBarrel ? ((EBDetId)det).iphi() : ((EEDetId)det).ix();
415  int ieta = isBarrel ? ((EBDetId)det).ieta() : ((EEDetId)det).iy();
416  float energy = hit.energy();
417  float time = hit.time();
418 
419  // Fill energy histos
420  if (makeEnergyHistos_) {
421  if (isBarrel) {
422  energyEB_->Fill(energy);
423  energyMapEB_->Fill(iphi, ieta, energy);
424  energyMapEBcoarse_->Fill(iphi, ieta, energy);
425  } else if (isEEM) {
426  energyEEM_->Fill(energy);
427  energyMapEEM_->Fill(iphi, ieta, energy);
428  energyMapEEMcoarse_->Fill(iphi, ieta, energy);
429  } else {
430  energyEEP_->Fill(energy);
431  energyMapEEP_->Fill(iphi, ieta, energy);
432  energyMapEEPcoarse_->Fill(iphi, ieta, energy);
433  }
434  }
435  // Fill occupancy histos
436  if (makeOccupancyHistos_) {
437  if (isBarrel) {
438  recHitOccupancyEB_->Fill(iphi, ieta);
439  recHitOccupancyEBcoarse_->Fill(iphi, ieta);
440  } else if (isEEM) {
441  recHitOccupancyEEM_->Fill(iphi, ieta);
442  recHitOccupancyEEMcoarse_->Fill(iphi, ieta);
443  } else {
444  recHitOccupancyEEP_->Fill(iphi, ieta);
445  recHitOccupancyEEPcoarse_->Fill(iphi, ieta);
446  }
447  }
448 
449  // Fill timing histos
450  if (makeTimingHistos_) {
451  if (isBarrel) {
452  timingEB_->Fill(time);
453  if (energy > minTimingEnergyEB_) {
454  timingMapEB_->Fill(iphi, ieta, time);
455  //timingMapEBCoarse_->Fill(iphi,ieta,time);
456  }
457  } else if (isEEM) {
458  timingEEM_->Fill(time);
459  if (energy > minTimingEnergyEE_) {
460  timingMapEEM_->Fill(iphi, ieta, time);
461  //timingMapEEMCoarse_->Fill(iphi,ieta,time);
462  }
463  } else {
464  timingEEP_->Fill(time);
465  if (energy > minTimingEnergyEE_) {
466  timingMapEEP_->Fill(iphi, ieta, time);
467  //timingMapEEPCoarse_->Fill(iphi,ieta,time);
468  }
469  }
470  }
471 
472  //All events
473  if (isBarrel) {
474  energyEBAll_->Fill(energy);
475  energyMapEBAll_->Fill(iphi, ieta, energy);
476  energyMapEBcoarseAll_->Fill(iphi, ieta, energy);
477  recHitOccupancyEBAll_->Fill(iphi, ieta);
478  recHitOccupancyEBcoarseAll_->Fill(iphi, ieta);
479  timingEBAll_->Fill(time);
480  if (energy > minTimingEnergyEB_) {
481  timingMapEBAll_->Fill(iphi, ieta, time);
482  timingMapEBCoarseAll_->Fill(iphi, ieta, time);
483  }
484  } else if (isEEM) {
485  energyEEMAll_->Fill(energy);
486  energyMapEEMAll_->Fill(iphi, ieta, energy);
487  energyMapEEMcoarseAll_->Fill(iphi, ieta, energy);
488  recHitOccupancyEEMAll_->Fill(iphi, ieta);
489  recHitOccupancyEEMcoarseAll_->Fill(iphi, ieta);
490  timingEEMAll_->Fill(time);
491  if (energy > minTimingEnergyEE_) {
492  timingMapEEMAll_->Fill(iphi, ieta, time);
493  timingMapEEMCoarseAll_->Fill(iphi, ieta, time);
494  }
495  } else {
496  energyEEPAll_->Fill(energy);
497  energyMapEEPAll_->Fill(iphi, ieta, energy);
498  energyMapEEPcoarseAll_->Fill(iphi, ieta, energy);
499  recHitOccupancyEEPAll_->Fill(iphi, ieta);
500  recHitOccupancyEEPcoarseAll_->Fill(iphi, ieta);
501  timingEEPAll_->Fill(time);
502  if (energy > minTimingEnergyEE_) {
503  timingMapEEPAll_->Fill(iphi, ieta, time);
504  timingMapEEPCoarseAll_->Fill(iphi, ieta, time);
505  }
506  }
507  // Fill FED-by-FED timing histos (all events)
508  TH1F* timingHist = FEDsAndTimingHists_[FEDid];
509  if (timingHist == nullptr) {
510  initHists(FEDid);
511  timingHist = FEDsAndTimingHists_[FEDid];
512  }
513  if (energy > minTimingAmp_) {
514  timingHist->Fill(hit.time());
515  allFedsTimingHist_->Fill(hit.time());
516  }
517  }
518 }
519 
520 // ------------ method called once each job just after ending the event loop ------------
522  //All-event canvases
534  drawCanvas(
536 
537  if (runNum_ != -1) {
538  canvasNames_->Fill();
539  histoCanvasNames_->Fill();
540  }
541 
542  string frequencies = "";
543  for (std::map<std::string, int>::const_iterator itr = seedFrequencyMap_.begin(); itr != seedFrequencyMap_.end();
544  ++itr) {
545  if (itr->second > 1) {
546  frequencies += itr->first;
547  frequencies += " Frequency: ";
548  frequencies += intToString(itr->second);
549  frequencies += "\n";
550  }
551  }
552  LogWarning("EcalDisplaysByEvent") << "Found seeds with frequency > 1: "
553  << "\n\n"
554  << frequencies;
555 
556  std::string channels;
557  for (std::vector<int>::const_iterator itr = maskedChannels_.begin(); itr != maskedChannels_.end(); ++itr) {
558  channels += intToString(*itr);
559  channels += ",";
560  }
561 
562  std::string feds;
563  for (std::vector<int>::const_iterator itr = maskedFEDs_.begin(); itr != maskedFEDs_.end(); ++itr) {
564  feds += intToString(*itr);
565  feds += ",";
566  }
567 
568  LogWarning("EcalDisplaysByEvent") << "Masked channels are: " << channels;
569  LogWarning("EcalDisplaysByEvent") << "Masked FEDs are: " << feds << " and that is all!";
570 }
571 
573  using namespace std;
574  ostringstream myStream;
575  myStream << num << flush;
576  return (myStream.str()); //returns the string form of the stringstream object
577 }
578 
580  using namespace std;
581  ostringstream myStream;
582  myStream << num << flush;
583  return (myStream.str()); //returns the string form of the stringstream object
584 }
585 
586 // insert the hist map into the map keyed by FED number
588  using namespace std;
589 
590  string title1 = "Jitter for ";
591  title1.append(fedMap_->getSliceFromFed(FED));
592  string name1 = "JitterFED";
593  name1.append(intToString(FED));
594  TH1F* timingHist = fileService->make<TH1F>(name1.c_str(), title1.c_str(), 150, -7, 7);
595  FEDsAndTimingHists_[FED] = timingHist;
596 }
597 
599  string lastPart = intToString(naiveEvtNum_) + "_LV1a" + intToString(ievt);
600  if (makeTimingHistos_) {
601  string canvasTitle = "Timing_Event" + lastPart;
602  timingEB_ = new TH1F("timeForAllFedsEB", "timeForAllFeds;Relative Time (1 clock = 25ns)", 78, -7, 7);
603  timingEEM_ = new TH1F("timeForAllFedsEEM", "timeForAllFeds_EEM;Relative Time (1 clock = 25ns)", 78, -7, 7);
604  timingEEP_ = new TH1F("timeForAllFedsEEP", "timeForAllFeds_EEP;Relative Time (1 clock = 25ns)", 78, -7, 7);
605  timingCanvas_ = new TCanvas(canvasTitle.c_str(), canvasTitle.c_str(), 300, 60, 500, 200);
606  timingMapEB_ = init3DEcalHist("TimingMap", EB_FINE);
607  timingMapEEM_ = init3DEcalHist("TimingMap", EEM_FINE);
608  timingMapEEP_ = init3DEcalHist("TimingMap", EEP_FINE);
609  timingMapCanvas_ = init2DEcalCanvas("TimingMap_Event" + lastPart);
610  //timingMapEBCoarse_ = init3DEcalHist("TimingMap", EB_COARSE);
613  //timingMapCoarseCanvas_ = init2DEcalCanvas("TimingMapCoarse_Event"+lastPart);
614  }
615  if (makeEnergyHistos_) {
616  energyEB_ = new TH1F("energyEB", "Energy for EB Feds (GeV)", 200, histRangeMin_, histRangeMax_);
617  energyEEM_ = new TH1F("energyEEM", "Energy for EEM Feds (GeV)", 200, histRangeMin_, 10.0);
618  energyEEP_ = new TH1F("energyEEP", "Energy for EEP Feds (GeV)", 200, histRangeMin_, 10.0);
619  string canvasTitle = "Energy_Event" + lastPart;
620  energyCanvas_ = new TCanvas(canvasTitle.c_str(), canvasTitle.c_str(), 300, 60, 500, 200);
621 
622  // Energy map hists
623  energyMapEB_ = init2DEcalHist("EnergyMap", EB_FINE);
626  energyMapEEM_ = init2DEcalHist("EnergyMap", EEM_FINE);
628  energyMapEEP_ = init2DEcalHist("EnergyMap", EEP_FINE);
629  energyMapCanvas_ = init2DEcalCanvas("EnergyMap_Event" + lastPart);
630  energyMapCoarseCanvas_ = init2DEcalCanvas("EnergyMapCoarse_Event" + lastPart);
631  }
632  if (makeOccupancyHistos_) {
633  // RecHit Occupancy
634  recHitOccupancyEB_ = init2DEcalHist("RecHitOccupancy", EB_FINE);
635  recHitOccupancyEBcoarse_ = init2DEcalHist("RecHitOccupancy", EB_COARSE);
637  recHitOccupancyEEM_ = init2DEcalHist("RecHitOccupancy", EEM_FINE);
639  recHitOccupancyEEP_ = init2DEcalHist("RecHitOccupancy", EEP_FINE);
640  recHitOccupancyCanvas_ = init2DEcalCanvas("RecHitOccupancy_Event" + lastPart);
641  recHitOccupancyCoarseCanvas_ = init2DEcalCanvas("RecHitOccupancyCoarse_Event" + lastPart);
642 
643  //DigiOccupancy
644  digiOccupancyEB_ = init2DEcalHist("DigiOccupancy", EB_FINE);
645  digiOccupancyEBcoarse_ = init2DEcalHist("DigiOccupancy", EB_COARSE);
647  digiOccupancyEEM_ = init2DEcalHist("DigiOccupancy", EEM_FINE);
649  digiOccupancyEEP_ = init2DEcalHist("DigiOccupancy", EEP_FINE);
650  digiOccupancyCanvas_ = init2DEcalCanvas("DigiOccupancy_Event" + lastPart);
651  digiOccupancyCoarseCanvas_ = init2DEcalCanvas("DigiOccupancyCoarse_Event" + lastPart);
652  }
653 }
654 
656  delete timingEB_;
657  delete timingEEM_;
658  delete timingEEP_;
659  delete timingMapEB_;
660  delete timingMapEEM_;
661  delete timingMapEEP_;
662  delete timingCanvas_;
663  delete timingMapCanvas_;
664  delete energyEB_;
665  delete energyEEM_;
666  delete energyEEP_;
667  delete energyMapEB_;
668  delete energyMapEEM_;
669  delete energyMapEEP_;
670  delete energyMapEBcoarse_;
671  delete energyMapEEMcoarse_;
672  delete energyMapEEPcoarse_;
673  delete energyCanvas_;
674  delete energyMapCanvas_;
675  delete energyMapCoarseCanvas_;
676  delete recHitOccupancyEB_;
677  delete recHitOccupancyEEP_;
678  delete recHitOccupancyEEM_;
682  delete digiOccupancyEB_;
683  delete digiOccupancyEEM_;
684  delete digiOccupancyEEP_;
685  delete digiOccupancyEBcoarse_;
688  delete recHitOccupancyCanvas_;
690  delete digiOccupancyCanvas_;
692 }
693 
695  string canvasTitle = "Timing_AllEvents";
696  timingEBAll_ = new TH1F("timeForAllFedsEBAll", "timeForAllFeds;Relative Time (1 clock = 25ns)", 78, -7, 7);
697  timingEEMAll_ = new TH1F("timeForAllFedsEEMAll", "timeForAllFeds_EEM;Relative Time (1 clock = 25ns)", 78, -7, 7);
698  timingEEPAll_ = new TH1F("timeForAllFedsEEPAll", "timeForAllFeds_EEP;Relative Time (1 clock = 25ns)", 78, -7, 7);
699  timingCanvasAll_ = new TCanvas(canvasTitle.c_str(), canvasTitle.c_str(), 300, 60, 500, 200);
700  timingMapEBAll_ = init3DEcalHist("TimingMapA", EB_FINE);
701  timingMapEEMAll_ = init3DEcalHist("TimingMapA", EEM_FINE);
702  timingMapEEPAll_ = init3DEcalHist("TimingMapA", EEP_FINE);
703  timingMapCanvasAll_ = init2DEcalCanvas("TimingMap_AllEvents");
707  //timingMapCoarseCanvasAll_ = init2DEcalCanvas("TimingMapCoarse_AllEvents");
708  energyEBAll_ = new TH1F("energyEBAllEvents", "Energy for EB Feds (GeV)", 200, histRangeMin_, histRangeMax_);
709  energyEEMAll_ = new TH1F("energyEEMAllEvents", "Energy for EEM Feds (GeV)", 200, histRangeMin_, 10.0);
710  energyEEPAll_ = new TH1F("energyEEPAllEvents", "Energy for EEP Feds (GeV)", 200, histRangeMin_, 10.0);
711  canvasTitle = "Energy_AllEvents";
712  energyCanvasAll_ = new TCanvas(canvasTitle.c_str(), canvasTitle.c_str(), 300, 60, 500, 200);
713 
714  // Energy map hists
715  energyMapEBAll_ = init2DEcalHist("EnergyMapA", EB_FINE);
718  energyMapEEMAll_ = init2DEcalHist("EnergyMapA", EEM_FINE);
720  energyMapEEPAll_ = init2DEcalHist("EnergyMapA", EEP_FINE);
721  energyMapCanvasAll_ = init2DEcalCanvas("EnergyMap_AllEvents");
722  energyMapCoarseCanvasAll_ = init2DEcalCanvas("EnergyMapCoarse_AllEvents");
723  // RecHit Occupancy
724  recHitOccupancyEBAll_ = init2DEcalHist("RecHitOccupancyA", EB_FINE);
727  recHitOccupancyEEMAll_ = init2DEcalHist("RecHitOccupancyA", EEM_FINE);
729  recHitOccupancyEEPAll_ = init2DEcalHist("RecHitOccupancyA", EEP_FINE);
730  recHitOccupancyCanvasAll_ = init2DEcalCanvas("RecHitOccupancy_AllEvents");
731  recHitOccupancyCoarseCanvasAll_ = init2DEcalCanvas("RecHitOccupancyCoarse_AllEvents");
732 
733  //DigiOccupancy
734  digiOccupancyEBAll_ = init2DEcalHist("DigiOccupancyA", EB_FINE);
737  digiOccupancyEEMAll_ = init2DEcalHist("DigiOccupancyA", EEM_FINE);
739  digiOccupancyEEPAll_ = init2DEcalHist("DigiOccupancyA", EEP_FINE);
740  digiOccupancyCanvasAll_ = init2DEcalCanvas("DigiOccupancy_AllEvents");
741  digiOccupancyCoarseCanvasAll_ = init2DEcalCanvas("DigiOccupancyCoarse_AllEvents");
742 }
743 
744 TH3F* EcalDisplaysByEvent::init3DEcalHist(std::string histTypeName, int subDet) {
745  TH3F* hist;
746  bool isBarrel = (subDet == EB_FINE || subDet == EB_COARSE) ? true : false;
747  bool isCoarse = (subDet == EB_COARSE || subDet == EEM_COARSE || subDet == EEP_COARSE) ? true : false;
748  bool isEEM = (subDet == EEM_FINE || subDet == EEM_COARSE) ? true : false;
749  std::string histName = histTypeName;
750  std::string histTitle = histTypeName;
751  double ttEtaBins[36] = {-85, -80, -75, -70, -65, -60, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0,
752  1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86};
753  double modEtaBins[10] = {-85, -65, -45, -25, 0, 1, 26, 46, 66, 86};
754  double ttPhiBins[73];
755  double modPhiBins[19];
756  double timingBins[79];
757  for (int i = 0; i < 79; ++i) {
758  timingBins[i] = 6 - 7. + double(i) * 14. / 78.;
759  if (i < 73) {
760  ttPhiBins[i] = 1 + 5 * i;
761  if (i < 19) {
762  modPhiBins[i] = 1 + 20 * i;
763  }
764  }
765  }
766 
767  if (isBarrel) {
768  histName = histName + "EB";
769  histTitle = histTitle + " EB";
770  if (isCoarse) {
771  histName = histName + "Coarse";
772  histTitle = histTitle + " by Module Nominal value = 6;iphi;ieta ";
773  hist = new TH3F(histName.c_str(), histTitle.c_str(), 18, modPhiBins, 9, modEtaBins, 78, timingBins);
774  } else {
775  histTitle = histTitle + " by TT Nominal value = 6;iphi;ieta";
776  hist = new TH3F(histName.c_str(), histTitle.c_str(), 360 / 5, ttPhiBins, 35, ttEtaBins, 78, timingBins);
777  }
778  } else {
779  double ttXBins[21];
780  double ttYBins[21];
781  for (int i = 0; i != 21; ++i) {
782  ttXBins[i] = 1 + 5 * i;
783  ttYBins[i] = 1 + 5 * i;
784  }
785  if (isEEM) {
786  histName = histName + "EEM";
787  histTitle = histTitle + " EEM";
788  } else {
789  histName = histName + "EEP";
790  histTitle = histTitle + " EEP";
791  }
792  if (isCoarse) {
793  histName = histName + "Coarse";
794  histTitle = histTitle + " by Module Nominal value = 6;ix;iy";
795  hist = new TH3F(histName.c_str(), histTitle.c_str(), 20, ttXBins, 20, ttYBins, 78, timingBins);
796  } else {
797  histTitle = histTitle + " by TT Nominal value = 6;ix;iy";
798  hist = new TH3F(histName.c_str(), histTitle.c_str(), 20, ttXBins, 20, ttYBins, 78, timingBins);
799  }
800  }
801  return hist;
802 }
803 
804 TH2F* EcalDisplaysByEvent::init2DEcalHist(std::string histTypeName, int subDet) {
805  TH2F* hist;
806  bool isBarrel = (subDet == EB_FINE || subDet == EB_COARSE) ? true : false;
807  bool isCoarse = (subDet == EB_COARSE || subDet == EEM_COARSE || subDet == EEP_COARSE) ? true : false;
808  bool isEEM = (subDet == EEM_FINE || subDet == EEM_COARSE) ? true : false;
809  std::string histName = histTypeName;
810  std::string histTitle = histTypeName;
811  if (isBarrel) {
812  histName = histName + "EB";
813  histTitle = histTitle + " EB";
814  if (isCoarse) {
815  histName = histName + "Coarse";
816  histTitle = histTitle + " Coarse;iphi;ieta";
817  double ttEtaBins[36] = {-85, -80, -75, -70, -65, -60, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0,
818  1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86};
819  hist = new TH2F(histName.c_str(), histTitle.c_str(), 360 / 5, 1, 361., 35, ttEtaBins);
820  } else {
821  histTitle = histTitle + ";iphi;ieta";
822  hist = new TH2F(histName.c_str(), histTitle.c_str(), 360, 1, 361., 172, -86, 86);
823  }
824  } else {
825  if (isEEM) {
826  histName = histName + "EEM";
827  histTitle = histTitle + " EEM";
828  } else {
829  histName = histName + "EEP";
830  histTitle = histTitle + " EEP";
831  }
832  if (isCoarse) {
833  histName = histName + "Coarse";
834  histTitle = histTitle + " Coarse;ix;iy";
835  hist = new TH2F(histName.c_str(), histTitle.c_str(), 20, 1, 101, 20, 1, 101);
836  } else {
837  histTitle = histTitle + ";ix;iy";
838  hist = new TH2F(histName.c_str(), histTitle.c_str(), 100, 1, 101, 100, 1, 101);
839  }
840  }
841  return hist;
842 }
843 
845  TCanvas* canvas = new TCanvas(canvasTitle.c_str(), canvasTitle.c_str(), 300, 60, 500, 200);
846  return canvas;
847 }
848 
850  if (makeTimingHistos_) {
851  // Put the timing canvas together
853  // drawCanvas(timingMapCoarseCanvas_,timingMapEEMCoarse_,timingMapEBCoarse_,timingMapEEPCoarse_);
855  }
856  if (makeEnergyHistos_) {
857  // Put the energy canvas together
859  // Put the energy map canvas together
862  }
863  if (makeOccupancyHistos_) {
864  // Put the occupancy canvas together
866  drawCanvas(
868  // And the same for the digis
871  }
872 }
873 
874 void EcalDisplaysByEvent::drawCanvas(TCanvas* canvas, TH1F* hist1, TH1F* hist2, TH1F* hist3) {
875  canvas->Divide(1, 2);
876  canvas->cd(1)->Divide(2, 1);
877  canvas->cd(1)->cd(1);
878  hist1->Draw();
879  canvas->cd(2);
880  hist2->Draw();
881  canvas->cd(1)->cd(2);
882  hist3->Draw();
883  histoCanvasNamesVector->push_back(canvas->GetName());
884  canvas->SetCanvasSize(500, 500);
885  canvas->SetFixedAspectRatio(true);
886  canvas->Write();
887 }
888 
889 void EcalDisplaysByEvent::drawCanvas(TCanvas* canvas, TH2F* hist1, TH2F* hist2, TH2F* hist3) {
890  canvas->Divide(1, 2);
891  canvas->cd(1)->Divide(2, 1);
892  // EEM
893  canvas->cd(1)->cd(1);
894  hist1->Draw("colz");
895  drawEELines();
896  // EB
897  canvas->cd(2);
898  hist2->Draw("colz");
899  hist2->GetXaxis()->SetNdivisions(-18);
900  hist2->GetYaxis()->SetNdivisions(2);
901  canvas->GetPad(2)->SetGridx(1);
902  canvas->GetPad(2)->SetGridy(1);
903  // EEP
904  canvas->cd(1)->cd(2);
905  hist3->Draw("colz");
906  drawEELines();
907  histoCanvasNamesVector->push_back(canvas->GetName());
908  canvas->SetCanvasSize(500, 500);
909  canvas->SetFixedAspectRatio(true);
910  canvas->Write();
911 }
912 
913 void EcalDisplaysByEvent::drawCanvas(TCanvas* canvas, TH3F* hist1, TH3F* hist2, TH3F* hist3) {
914  if (canvas == timingMapCoarseCanvas_) {
915  canvas->cd();
916  TProfile2D* profile2 = (TProfile2D*)hist2->Project3DProfile("yx");
917  profile2->Draw("colz");
918  drawTimingErrors(profile2);
919  } else {
920  canvas->Divide(1, 2);
921  canvas->cd(1)->Divide(2, 1);
922  // EEM
923  canvas->cd(1)->cd(1);
924  TProfile2D* profile1 = (TProfile2D*)hist1->Project3DProfile("yx");
925  profile1->Draw("colz");
926  drawEELines();
927  // EB
928  canvas->cd(2);
929  TProfile2D* profile2 = (TProfile2D*)hist2->Project3DProfile("yx");
930  profile2->Draw("colz");
931  profile2->GetXaxis()->SetNdivisions(-18);
932  profile2->GetYaxis()->SetNdivisions(2);
933  canvas->GetPad(2)->SetGridx(1);
934  canvas->GetPad(2)->SetGridy(1);
935  // EEP
936  canvas->cd(1)->cd(2);
937  TProfile2D* profile3 = (TProfile2D*)hist3->Project3DProfile("yx");
938  profile3->Draw("colz");
939  drawEELines();
940  }
941  histoCanvasNamesVector->push_back(canvas->GetName());
942  canvas->SetCanvasSize(500, 500);
943  canvas->SetFixedAspectRatio(true);
944  canvas->Write();
945 }
946 
948  int nxb = profile->GetNbinsX();
949  int nyb = profile->GetNbinsY();
950  char tempErr[200];
951  for (int i = 0; i != nxb; ++i) {
952  for (int j = 0; j != nyb; ++j) {
953  int xb = i + 1;
954  int yb = j + 1;
955  // std::cout << "xb: " << xb << "\tyb: " << yb << std::endl;
956  double xcorr = profile->GetBinCenter(xb);
957  double ycorr = profile->GetBinCenter(yb);
958  sprintf(tempErr, "%0.2f", profile->GetBinError(xb, yb));
959  int nBin = profile->GetBin(xb, yb, 0);
960  int nBinEntries = (int)profile->GetBinEntries(nBin);
961  if (nBinEntries != 0) {
962  TLatex* tex = new TLatex(xcorr, ycorr, tempErr);
963  tex->SetTextAlign(23);
964  tex->SetTextSize(42);
965  tex->SetTextSize(0.025);
966  tex->SetLineWidth(2);
967  tex->Draw();
968  delete tex;
969  }
970  sprintf(tempErr, "%i", nBinEntries);
971  if (nBinEntries != 0) {
972  TLatex* tex = new TLatex(xcorr, ycorr, tempErr);
973  tex->SetTextAlign(21);
974  tex->SetTextFont(42);
975  tex->SetTextSize(0.025);
976  tex->SetLineWidth(2);
977  tex->Draw();
978  delete tex;
979  }
980  }
981  }
982 }
983 
985  int ixSectorsEE[202] = {
986  61, 61, 60, 60, 59, 59, 58, 58, 57, 57, 55, 55, 45, 45, 43, 43, 42, 42, 41, 41, 40, 40, 39, 39, 40, 40,
987  41, 41, 42, 42, 43, 43, 45, 45, 55, 55, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 0, 100, 100, 97, 97, 95,
988  95, 92, 92, 87, 87, 85, 85, 80, 80, 75, 75, 65, 65, 60, 60, 40, 40, 35, 35, 25, 25, 20, 20, 15, 15, 13,
989  13, 8, 8, 5, 5, 3, 3, 0, 0, 3, 3, 5, 5, 8, 8, 13, 13, 15, 15, 20, 20, 25, 25, 35, 35, 40,
990  40, 60, 60, 65, 65, 75, 75, 80, 80, 85, 85, 87, 87, 92, 92, 95, 95, 97, 97, 100, 100, 0, 61, 65, 65, 70,
991  70, 80, 80, 90, 90, 92, 0, 61, 65, 65, 90, 90, 97, 0, 57, 60, 60, 65, 65, 70, 70, 75, 75, 80, 80, 0,
992  50, 50, 0, 43, 40, 40, 35, 35, 30, 30, 25, 25, 20, 20, 0, 39, 35, 35, 10, 10, 3, 0, 39, 35, 35, 30,
993  30, 20, 20, 10, 10, 8, 0, 45, 45, 40, 40, 35, 35, 0, 55, 55, 60, 60, 65, 65};
994 
995  int iySectorsEE[202] = {50, 55, 55, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 60, 60, 59, 59, 58, 58, 57, 57, 55, 55,
996  45, 45, 43, 43, 42, 42, 41, 41, 40, 40, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 45, 45, 50,
997  0, 50, 60, 60, 65, 65, 75, 75, 80, 80, 85, 85, 87, 87, 92, 92, 95, 95, 97, 97, 100, 100, 97,
998  97, 95, 95, 92, 92, 87, 87, 85, 85, 80, 80, 75, 75, 65, 65, 60, 60, 40, 40, 35, 35, 25, 25,
999  20, 20, 15, 15, 13, 13, 8, 8, 5, 5, 3, 3, 0, 0, 3, 3, 5, 5, 8, 8, 13, 13, 15,
1000  15, 20, 20, 25, 25, 35, 35, 40, 40, 50, 0, 45, 45, 40, 40, 35, 35, 30, 30, 25, 25, 0, 50,
1001  50, 55, 55, 60, 60, 0, 60, 60, 65, 65, 70, 70, 75, 75, 85, 85, 87, 0, 61, 100, 0, 60, 60,
1002  65, 65, 70, 70, 75, 75, 85, 85, 87, 0, 50, 50, 55, 55, 60, 60, 0, 45, 45, 40, 40, 35, 35,
1003  30, 30, 25, 25, 0, 39, 30, 30, 15, 15, 5, 0, 39, 30, 30, 15, 15, 5};
1004 
1005  for (int i = 0; i < 202; i++) {
1006  ixSectorsEE[i] += 1;
1007  iySectorsEE[i] += 1;
1008  // std::cout << i << " " << ixSectorsEE[i] << " " << iySectorsEE[i] << std::endl;
1009  }
1010 
1011  TLine l;
1012  l.SetLineWidth(1);
1013  for (int i = 0; i < 201; i = i + 1) {
1014  if ((ixSectorsEE[i] != 1 || iySectorsEE[i] != 1) && (ixSectorsEE[i + 1] != 1 || iySectorsEE[i + 1] != 1)) {
1015  l.DrawLine(ixSectorsEE[i], iySectorsEE[i], ixSectorsEE[i + 1], iySectorsEE[i + 1]);
1016  }
1017  }
1018 }
RunNumber_t run() const
Definition: EventID.h:39
std::vector< std::string > maskedEBs_
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
std::set< EBDetId > listEBChannels
edm::Handle< EEDigiCollection > EEdigisHandle
int ix() const
Definition: EEDetId.h:77
int xtalId() const
get the channel id
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
int stripId() const
get the tower id
TH2F * init2DEcalHist(std::string histTypeName, int subDet)
std::vector< int > maskedChannels_
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
std::vector< std::string > * names
const EcalElectronicsMapping * ecalElectronicsMap_
int getEEIndex(EcalElectronicsId elecId)
bool isBarrel(GeomDetEnumerators::SubDetector m)
edm::InputTag headerProducer_
std::vector< T >::const_iterator const_iterator
void analyze(edm::Event const &, edm::EventSetup const &) override
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:29
std::map< int, EcalDCCHeaderBlock > FEDsAndDCCHeaders_
void drawTimingErrors(TProfile2D *profile)
int towerId() const
get the tower id
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
float time() const
Definition: EcalRecHit.h:70
const_iterator begin() const
TCanvas * digiOccupancyCoarseCanvasAll_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
int gainId() const
get the gainId (2 bits)
std::set< EEDetId > listEEChannels
int size() const
Definition: EcalDataFrame.h:26
void drawCanvas(TCanvas *canvas, TH1F *hist1, TH1F *hist2, TH1F *hist3)
std::string getSliceFromFed(int)
Definition: EcalFedMap.cc:86
std::vector< std::string > * histoCanvasNamesVector
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
T offsetBy(int deltaX, int deltaY) const
Free movement of arbitray steps.
Definition: CaloNavigator.h:80
int iEvent
Definition: GenABIO.cc:224
std::vector< int > maskedFEDs_
tex
Definition: cuy.py:774
TCanvas * recHitOccupancyCoarseCanvasAll_
float energy() const
Definition: EcalRecHit.h:68
std::map< int, TH1F * > FEDsAndTimingHists_
int iy() const
Definition: EEDetId.h:83
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
static edm::Service< TFileService > fileService
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
const_iterator end() const
std::string intToString(int num)
void home() const
move the navigator back to the starting point
Definition: DetId.h:18
static float gainRatio[3]
void makeHistos(edm::Handle< EBDigiCollection > ebDigis)
void selectHits(edm::Handle< EcalRecHitCollection > hits, int ievt, edm::ESHandle< CaloTopology > caloTopo)
edm::Handle< EBDigiCollection > EBdigisHandle
DetId id() const
get the id
Definition: EcalRecHit.h:77
T const * product() const
Definition: Handle.h:74
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:20
const_iterator end() const
std::map< std::string, int > seedFrequencyMap_
void initEvtByEvtHists(int naiveEvtNum_, int ievt)
TCanvas * digiOccupancyCoarseCanvas_
std::vector< int > seedCrys_
edm::InputTag EERecHitCollection_
std::string floatToString(float num)
edm::EventID id() const
Definition: EventBase.h:59
constexpr int gainId(sample_type sample)
get the gainId (2 bits)
HLT enums.
T get() const
Definition: EventSetup.h:71
def canvas(sub, attr)
Definition: svgfig.py:482
edm::InputTag EBRecHitCollection_
TGraph * selectDigi(DetId det, int ievt)
TH3F * init3DEcalHist(std::string histTypeName, int dubDet)
TCanvas * init2DEcalCanvas(std::string canvasName)
void beginRun(edm::Run const &, edm::EventSetup const &) override
TCanvas * recHitOccupancyCoarseCanvas_
T const * product() const
Definition: ESHandle.h:86
EcalDisplaysByEvent(const edm::ParameterSet &)
const_iterator begin() const
Definition: Run.h:45
std::map< int, float > crysAndAmplitudesMap_
int adc() const
get the ADC sample (12 bits)
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39