CMS 3D CMS Logo

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