CMS 3D CMS Logo

EcalCosmicsHists.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: EcalCosmicsHists
4 // Class: EcalCosmicsHists
5 //
20 
26 
29 
37 
38 #include <vector>
39 #include "TLine.h"
40 
41 using namespace cms;
42 using namespace edm;
43 using namespace std;
44 
45 //
46 // constants, enums and typedefs
47 //
48 
49 //
50 // static data member definitions
51 //
52 
53 //
54 // constructors and destructor
55 //
57  : ecalRawDataColl_(iConfig.getParameter<edm::InputTag>("ecalRawDataColl")),
58  ecalRecHitCollectionEB_(iConfig.getParameter<edm::InputTag>("ecalRecHitCollectionEB")),
59  ecalRecHitCollectionEE_(iConfig.getParameter<edm::InputTag>("ecalRecHitCollectionEE")),
60  barrelClusterCollection_(iConfig.getParameter<edm::InputTag>("barrelClusterCollection")),
61  endcapClusterCollection_(iConfig.getParameter<edm::InputTag>("endcapClusterCollection")),
62  l1GTReadoutRecTag_(iConfig.getUntrackedParameter<std::string>("L1GlobalReadoutRecord", "gtDigis")),
63  l1GMTReadoutRecTag_(iConfig.getUntrackedParameter<std::string>("L1GlobalMuonReadoutRecord", "gtDigis")),
64  runNum_(-1),
65  histRangeMax_(iConfig.getUntrackedParameter<double>("histogramMaxRange", 1.8)),
66  histRangeMin_(iConfig.getUntrackedParameter<double>("histogramMinRange", 0.0)),
67  minTimingAmpEB_(iConfig.getUntrackedParameter<double>("MinTimingAmpEB", 0.100)),
68  minTimingAmpEE_(iConfig.getUntrackedParameter<double>("MinTimingAmpEE", 0.100)),
69  minRecHitAmpEB_(iConfig.getUntrackedParameter<double>("MinRecHitAmpEB", 0.027)),
70  minRecHitAmpEE_(iConfig.getUntrackedParameter<double>("MinRecHitAmpEE", 0.18)),
71  minHighEnergy_(iConfig.getUntrackedParameter<double>("MinHighEnergy", 2.0)),
72  fileName_(iConfig.getUntrackedParameter<std::string>("fileName", std::string("ecalCosmicHists"))),
73  runInFileName_(iConfig.getUntrackedParameter<bool>("runInFileName", true)),
74  startTime_(iConfig.getUntrackedParameter<double>("TimeStampStart", 1215107133.)),
75  runTimeLength_(iConfig.getUntrackedParameter<double>("TimeStampLength", 3.)),
76  numTimingBins_(iConfig.getUntrackedParameter<int>("TimeStampBins", 1800)) {
77  naiveEvtNum_ = 0;
78  cosmicCounter_ = 0;
79  cosmicCounterEB_ = 0;
83 
84  // TrackAssociator parameters
85  edm::ParameterSet trkParameters = iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters");
87  trackParameters_.loadParameters(trkParameters, iC);
89 
90  string title1 = "Seed Energy for All Feds; Seed Energy (GeV)";
91  string name1 = "SeedEnergyAllFEDs";
92  int numBins = 200; //(int)round(histRangeMax_-histRangeMin_)+1;
93  allFedsHist_ = new TH1F(name1.c_str(), title1.c_str(), numBins, histRangeMin_, histRangeMax_);
94 
95  fedMap_ = new EcalFedMap();
96 }
97 
99 
100 //
101 // member functions
102 //
103 
104 // ------------ method called to for each event ------------
106  bool hasEndcapClusters = true;
107  int ievt = iEvent.id().event();
108 
111 
112  naiveEvtNum_++;
113 
114  //LogDebug("EcalCosmicsHists")<< " My Event: " << naiveEvtNum_ << " " << iEvent.id().run() << " " << iEvent.id().event() << " " << iEvent.time().value();
115  //LogDebug("EcalCosmicsHists")<< "Timestamp: " << iEvent.id().run() << " " << iEvent.id().event() << " " << iEvent.time().value();
116 
117  // check DB payload
119  iSetup.get<EcalADCToGeVConstantRcd>().get(pAgc);
120  const EcalADCToGeVConstant* agc = pAgc.product();
121  if (naiveEvtNum_ <= 1) {
122  LogWarning("EcalCosmicsHists") << "Global EB ADC->GeV scale: " << agc->getEBValue() << " GeV/ADC count";
123  LogWarning("EcalCosmicsHists") << "Global EE ADC->GeV scale: " << agc->getEEValue() << " GeV/ADC count";
124  }
125  //float adcEBconst = agc->getEBValue();
126  //float adcEEconst = agc->getEEValue();
127 
128  //
129 
130  //===================TIMESTAMP INFORMTION=================================
131  // Code added to get the time in seconds
132  unsigned int timeStampLow = (0xFFFFFFFF & iEvent.time().value());
133  unsigned int timeStampHigh = (iEvent.time().value() >> 32);
134  double rawEventTime = (double)(timeStampHigh) + ((double)(timeStampLow) / 1000000.);
135  double eventTime = rawEventTime - startTime_; //Notice the subtraction of the "starttime"
136  //std::cout << "Event Time " << eventTime << " High " <<timeStampHigh<< " low"<<timeStampLow <<" value " <<iEvent.time().value() << std::endl;
137  //========================================================================
138 
139  iEvent.getByLabel(barrelClusterCollection_, bscHandle);
140  if (!(bscHandle.isValid())) {
141  LogWarning("EcalCosmicsHists") << barrelClusterCollection_ << " not available";
142  return;
143  }
144  LogDebug("EcalCosmicsHists") << "event " << ievt;
145 
146  iEvent.getByLabel(endcapClusterCollection_, escHandle);
147  if (!(escHandle.isValid())) {
148  LogWarning("EcalCosmicsHists") << endcapClusterCollection_ << " not available";
149  hasEndcapClusters = false;
150  //return;
151  }
152 
154  iEvent.getByLabel(ecalRecHitCollectionEB_, hits);
155  if (!(hits.isValid())) {
156  LogWarning("EcalCosmicsHists") << ecalRecHitCollectionEB_ << " not available";
157  return;
158  }
160  iEvent.getByLabel(ecalRecHitCollectionEE_, hitsEE);
161  if (!(hitsEE.isValid())) {
162  LogWarning("EcalCosmicsHists") << ecalRecHitCollectionEE_ << " not available";
163  return;
164  }
165 
167  iEvent.getByLabel(ecalRawDataColl_, DCCHeaders);
168  if (!DCCHeaders.isValid())
169  LogWarning("EcalCosmicsHists") << "DCC headers not available";
170 
171  //make the bx histos right here
172  //TODO: Right now we are filling histos for errors...
173  int orbit = -100;
174  int bx = -100;
175  int runType = -100;
176 
177  for (EcalRawDataCollection::const_iterator headerItr = DCCHeaders->begin(); headerItr != DCCHeaders->end();
178  ++headerItr) {
179  headerItr->getEventSettings();
180  int myorbit = headerItr->getOrbit();
181  int mybx = headerItr->getBX();
182  int myRunType = headerItr->getRunType();
183  int FEDid = headerItr->fedId();
184  TH2F* dccRuntypeHist = FEDsAndDCCRuntypeVsBxHists_[FEDid];
185  if (dccRuntypeHist == nullptr) {
186  initHists(FEDid);
187  dccRuntypeHist = FEDsAndDCCRuntypeVsBxHists_[FEDid];
188  }
189  dccRuntypeHist->Fill(mybx, myRunType);
190 
191  if (bx == -100) {
192  bx = mybx;
193  } else if (bx != mybx) {
194  LogWarning("EcalCosmicsHists") << "This header has a conflicting bx OTHERS were " << bx << " here " << mybx;
195  dccBXErrorByFEDHist_->Fill(headerItr->fedId());
196  if (bx != -100) {
197  dccErrorVsBxHist_->Fill(bx, 0);
198  }
199  }
200 
201  if (runType == -100) {
202  runType = myRunType;
203  } else if (runType != myRunType) {
204  LogWarning("EcalCosmicsHists") << "This header has a conflicting runType OTHERS were " << bx << " here " << mybx;
205  dccRuntypeErrorByFEDHist_->Fill(headerItr->fedId());
206  if (bx != -100)
207  dccErrorVsBxHist_->Fill(bx, 2);
208  }
209 
210  if (orbit == -100) {
211  orbit = myorbit;
212  } else if (orbit != myorbit) {
213  LogWarning("EcalCosmicsHists") << "This header has a conflicting orbit; OTHERS were " << orbit << " here "
214  << myorbit;
215  dccOrbitErrorByFEDHist_->Fill(headerItr->fedId());
216  if (bx != -100)
217  dccErrorVsBxHist_->Fill(bx, 1);
218  }
219  }
220  dccEventVsBxHist_->Fill(bx, runType);
221  dccRuntypeHist_->Fill(runType);
222 
223  std::vector<bool> l1Triggers = determineTriggers(iEvent, iSetup);
224  bool isEcalL1 = l1Triggers[4];
225  bool isHCALL1 = l1Triggers[3];
226  bool isRPCL1 = l1Triggers[2];
227  bool isCSCL1 = l1Triggers[1];
228  bool isDTL1 = l1Triggers[0];
229 
230  if (runNum_ == -1) {
231  runNum_ = iEvent.id().run();
232  }
233 
234  int numberOfCosmics = 0;
235  int numberOfCosmicsEB = 0;
236  int numberOfCosmicsEEP = 0;
237  int numberOfCosmicsEEM = 0;
238  int numberOfCosmicsTop = 0;
239  int numberOfCosmicsBottom = 0;
240  int numberOfHighEClusters = 0;
241  //int eventnum = iEvent.id().event();
242  std::vector<EBDetId> seeds;
243 
244  //++++++++++++++++++BEGIN LOOP OVER EB SUPERCLUSTERS+++++++++++++++++++++++++//
245 
246  const reco::SuperClusterCollection* clusterCollection_p = bscHandle.product();
247  for (reco::SuperClusterCollection::const_iterator clus = clusterCollection_p->begin();
248  clus != clusterCollection_p->end();
249  ++clus) {
250  double energy = clus->energy();
251  double phi = clus->phi();
252  double eta = clus->eta();
253  double time = -1000.0;
254  double ampli = 0.;
255  double secondMin = 0.;
256  double secondTime = -1000.;
257  int numXtalsinCluster = 0;
258 
259  EBDetId maxDet;
260  EBDetId secDet;
261 
262  numberofBCinSC_->Fill(clus->clustersSize());
263  numberofBCinSCphi_->Fill(phi, clus->clustersSize());
264 
265  for (reco::CaloCluster_iterator bclus = (clus->clustersBegin()); bclus != (clus->clustersEnd()); ++bclus) {
266  double cphi = (*bclus)->phi();
267  double ceta = (*bclus)->eta();
268  TrueBCOccupancy_->Fill(cphi, ceta);
269  TrueBCOccupancyCoarse_->Fill(cphi, ceta);
270  }
271 
272  std::vector<std::pair<DetId, float> > clusterDetIds = clus->hitsAndFractions(); //get these from the cluster
273  for (std::vector<std::pair<DetId, float> >::const_iterator detitr = clusterDetIds.begin();
274  detitr != clusterDetIds.end();
275  ++detitr) {
276  //Here I use the "find" on a digi collection... I have been warned...
277  if ((*detitr).first.det() != DetId::Ecal) {
278  std::cout << " det is " << (*detitr).first.det() << std::endl;
279  continue;
280  }
281  if ((*detitr).first.subdetId() != EcalBarrel) {
282  std::cout << " subdet is " << (*detitr).first.subdetId() << std::endl;
283  continue;
284  }
285  EcalRecHitCollection::const_iterator thishit = hits->find((*detitr).first);
286  if (thishit == hits->end())
287  continue;
288  //The checking above should no longer be needed...... as only those in the cluster would already have rechits..
289 
290  EcalRecHit myhit = (*thishit);
291 
292  double thisamp = myhit.energy();
293  if (thisamp > minRecHitAmpEB_) {
294  numXtalsinCluster++;
295  }
296  if (thisamp > secondMin) {
297  secondMin = thisamp;
298  secondTime = myhit.time();
299  secDet = (EBDetId)(*detitr).first;
300  }
301  if (secondMin > ampli) {
302  std::swap(ampli, secondMin);
303  std::swap(time, secondTime);
304  std::swap(maxDet, secDet);
305  }
306  }
307 
308  double fullnumXtalsinCluster = clusterDetIds.size();
309 
310  float E2 = ampli + secondMin;
312  int FEDid = 600 + elecId.dccId();
313 
314  numberOfCosmics++;
315  numberOfCosmicsEB++;
316 
317  //Set some more values
318  seeds.push_back(maxDet);
319  int ieta = maxDet.ieta();
320  int iphi = maxDet.iphi();
321  int ietaSM = maxDet.ietaSM();
322  int iphiSM = maxDet.iphiSM();
323 
324  int LM = ecalElectronicsMap_->getLMNumber(maxDet); //FIX ME
325 
326  // top and bottom clusters
327  if (iphi > 0 && iphi < 180) {
328  numberOfCosmicsTop++;
329  } else {
330  numberOfCosmicsBottom++;
331  }
332 
333  // fill the proper hist
334  TH1F* uRecHist = FEDsAndHists_[FEDid];
335  TH1F* E2uRecHist = FEDsAndE2Hists_[FEDid];
336  TH1F* energyuRecHist = FEDsAndenergyHists_[FEDid];
337  TH1F* timingHist = FEDsAndTimingHists_[FEDid];
338  TH1F* freqHist = FEDsAndFrequencyHists_[FEDid];
339  TH1F* iphiProfileHist = FEDsAndiPhiProfileHists_[FEDid];
340  TH1F* ietaProfileHist = FEDsAndiEtaProfileHists_[FEDid];
341  TH2F* timingHistVsFreq = FEDsAndTimingVsFreqHists_[FEDid];
342  TH2F* timingHistVsAmp = FEDsAndTimingVsAmpHists_[FEDid];
343  TH2F* E2vsE1uRecHist = FEDsAndE2vsE1Hists_[FEDid];
344  TH2F* energyvsE1uRecHist = FEDsAndenergyvsE1Hists_[FEDid];
345  TH2F* occupHist = FEDsAndOccupancyHists_[FEDid];
346  TH2F* timingHistVsPhi = FEDsAndTimingVsPhiHists_[FEDid];
347  TH2F* timingHistVsModule = FEDsAndTimingVsModuleHists_[FEDid];
348 
349  if (uRecHist == nullptr) {
350  initHists(FEDid);
351  uRecHist = FEDsAndHists_[FEDid];
352  E2uRecHist = FEDsAndE2Hists_[FEDid];
353  energyuRecHist = FEDsAndenergyHists_[FEDid];
354  timingHist = FEDsAndTimingHists_[FEDid];
355  freqHist = FEDsAndFrequencyHists_[FEDid];
356  timingHistVsFreq = FEDsAndTimingVsFreqHists_[FEDid];
357  timingHistVsAmp = FEDsAndTimingVsAmpHists_[FEDid];
358  iphiProfileHist = FEDsAndiPhiProfileHists_[FEDid];
359  ietaProfileHist = FEDsAndiEtaProfileHists_[FEDid];
360  E2vsE1uRecHist = FEDsAndE2vsE1Hists_[FEDid];
361  energyvsE1uRecHist = FEDsAndenergyvsE1Hists_[FEDid];
362  occupHist = FEDsAndOccupancyHists_[FEDid];
363  timingHistVsPhi = FEDsAndTimingVsPhiHists_[FEDid];
364  timingHistVsModule = FEDsAndTimingVsModuleHists_[FEDid];
365  }
366 
367  uRecHist->Fill(ampli);
368  E2uRecHist->Fill(E2);
369  E2vsE1uRecHist->Fill(ampli, E2);
370  energyuRecHist->Fill(energy);
371  energyvsE1uRecHist->Fill(ampli, energy);
372  allFedsHist_->Fill(ampli);
373  allFedsE2Hist_->Fill(E2);
374  allFedsenergyHist_->Fill(energy);
375  allFedsenergyHighHist_->Fill(energy);
376  allFedsE2vsE1Hist_->Fill(ampli, E2);
377  allFedsenergyvsE1Hist_->Fill(ampli, energy);
378  freqHist->Fill(naiveEvtNum_);
379  iphiProfileHist->Fill(iphi);
380  ietaProfileHist->Fill(ieta);
381 
383  allFedsiPhiProfileHist_->Fill(iphi);
384  allFedsiEtaProfileHist_->Fill(ieta);
385  allOccupancy_->Fill(iphi, ieta);
386  TrueOccupancy_->Fill(phi, eta);
387  allOccupancyCoarse_->Fill(iphi, ieta);
388  TrueOccupancyCoarse_->Fill(phi, eta);
389  allFedsNumXtalsInClusterHist_->Fill(numXtalsinCluster);
390  NumXtalsInClusterHist_->Fill(fullnumXtalsinCluster);
391  numxtalsVsEnergy_->Fill(energy, numXtalsinCluster);
392  numxtalsVsHighEnergy_->Fill(energy, numXtalsinCluster);
393 
394  //Fill the hists for the time stamp information
395  allFedsFreqTimeVsPhiHist_->Fill(iphi, eventTime);
396  allFedsFreqTimeVsPhiTTHist_->Fill(iphi, eventTime);
397  allFedsFreqTimeVsEtaHist_->Fill(eventTime, ieta);
398  allFedsFreqTimeVsEtaTTHist_->Fill(eventTime, ieta);
399  //end time stamp hists
400 
401  occupHist->Fill(ietaSM, iphiSM);
402  if (fullnumXtalsinCluster == 1) {
403  allOccupancySingleXtal_->Fill(iphi, ieta);
404  energySingleXtalHist_->Fill(energy);
405  }
406 
407  // Exclusive trigger plots
408 
409  if (isEcalL1 && !isDTL1 && !isRPCL1 && !isCSCL1 && !isHCALL1) {
410  allOccupancyExclusiveECAL_->Fill(iphi, ieta);
411  allOccupancyCoarseExclusiveECAL_->Fill(iphi, ieta);
412  if (ampli > minTimingAmpEB_) {
413  allFedsTimingHistECAL_->Fill(time);
414  allFedsTimingPhiEtaHistECAL_->Fill(iphi, ieta, time);
415  allFedsTimingTTHistECAL_->Fill(iphi, ieta, time);
416  allFedsTimingLMHistECAL_->Fill(LM, time);
417  }
418  triggerExclusiveHist_->Fill(0);
419  }
420 
421  if (!isEcalL1 && !isDTL1 && !isRPCL1 && !isCSCL1 && isHCALL1) {
422  allOccupancyExclusiveHCAL_->Fill(iphi, ieta);
423  allOccupancyCoarseExclusiveHCAL_->Fill(iphi, ieta);
424  if (ampli > minTimingAmpEB_) {
425  allFedsTimingHistHCAL_->Fill(time);
426  allFedsTimingPhiEtaHistHCAL_->Fill(iphi, ieta, time);
427  allFedsTimingTTHistHCAL_->Fill(iphi, ieta, time);
428  allFedsTimingLMHistHCAL_->Fill(LM, time);
429  }
430  triggerExclusiveHist_->Fill(1);
431  }
432 
433  if (!isEcalL1 && isDTL1 && !isRPCL1 && !isCSCL1 && !isHCALL1) {
434  allOccupancyExclusiveDT_->Fill(iphi, ieta);
435  allOccupancyCoarseExclusiveDT_->Fill(iphi, ieta);
436  if (ampli > minTimingAmpEB_) {
437  allFedsTimingHistDT_->Fill(time);
438  allFedsTimingPhiEtaHistDT_->Fill(iphi, ieta, time);
439  allFedsTimingTTHistDT_->Fill(iphi, ieta, time);
440  allFedsTimingLMHistDT_->Fill(LM, time);
441  }
442  triggerExclusiveHist_->Fill(2);
443  }
444 
445  if (!isEcalL1 && !isDTL1 && isRPCL1 && !isCSCL1 && !isHCALL1) {
446  allOccupancyExclusiveRPC_->Fill(iphi, ieta);
447  allOccupancyCoarseExclusiveRPC_->Fill(iphi, ieta);
448  if (ampli > minTimingAmpEB_) {
449  allFedsTimingHistRPC_->Fill(time);
450  allFedsTimingPhiEtaHistRPC_->Fill(iphi, ieta, time);
451  allFedsTimingTTHistRPC_->Fill(iphi, ieta, time);
452  allFedsTimingLMHistRPC_->Fill(LM, time);
453  }
454  triggerExclusiveHist_->Fill(3);
455  }
456 
457  if (!isEcalL1 && !isDTL1 && !isRPCL1 && isCSCL1 && !isHCALL1) {
458  allOccupancyExclusiveCSC_->Fill(iphi, ieta);
459  allOccupancyCoarseExclusiveCSC_->Fill(iphi, ieta);
460  if (ampli > minTimingAmpEB_) {
461  allFedsTimingHistCSC_->Fill(time);
462  allFedsTimingPhiEtaHistCSC_->Fill(iphi, ieta, time);
463  allFedsTimingTTHistCSC_->Fill(iphi, ieta, time);
464  allFedsTimingLMHistCSC_->Fill(LM, time);
465  }
466  triggerExclusiveHist_->Fill(4);
467  }
468 
469  // Inclusive trigger plots
470 
471  if (isEcalL1) {
472  triggerHist_->Fill(0);
473  allOccupancyECAL_->Fill(iphi, ieta);
474  allOccupancyCoarseECAL_->Fill(iphi, ieta);
475  }
476  if (isHCALL1) {
477  triggerHist_->Fill(1);
478  allOccupancyHCAL_->Fill(iphi, ieta);
479  allOccupancyCoarseHCAL_->Fill(iphi, ieta);
480  }
481  if (isDTL1) {
482  triggerHist_->Fill(2);
483  allOccupancyDT_->Fill(iphi, ieta);
484  allOccupancyCoarseDT_->Fill(iphi, ieta);
485  }
486  if (isRPCL1) {
487  triggerHist_->Fill(3);
488  allOccupancyRPC_->Fill(iphi, ieta);
489  allOccupancyCoarseRPC_->Fill(iphi, ieta);
490  }
491  if (isCSCL1) {
492  triggerHist_->Fill(4);
493  allOccupancyCSC_->Fill(iphi, ieta);
494  allOccupancyCoarseCSC_->Fill(iphi, ieta);
495  }
496 
497  // Fill histo for Ecal+muon coincidence
498  if (isEcalL1 && (isCSCL1 || isRPCL1 || isDTL1) && !isHCALL1)
499  allFedsTimingHistEcalMuon_->Fill(time);
500 
501  if (ampli > minTimingAmpEB_) {
502  timingHist->Fill(time);
503  timingHistVsFreq->Fill(time, naiveEvtNum_);
504  timingHistVsAmp->Fill(time, ampli);
505  allFedsTimingHist_->Fill(time);
506  allFedsTimingVsAmpHist_->Fill(time, ampli);
508  timingHistVsPhi->Fill(time, iphiSM);
509  timingHistVsModule->Fill(time, ietaSM);
510  allFedsTimingPhiHist_->Fill(iphi, time);
511  allFedsTimingPhiEtaHist_->Fill(iphi, ieta, time);
512  allFedsTimingTTHist_->Fill(iphi, ieta, time);
513  allFedsTimingLMHist_->Fill(LM, time);
514  if (FEDid >= 610 && FEDid <= 627)
515  allFedsTimingPhiEbmHist_->Fill(iphi, time);
516  if (FEDid >= 628 && FEDid <= 645)
517  allFedsTimingPhiEbpHist_->Fill(iphi, time);
518 
519  if (FEDid >= 610 && FEDid <= 627)
520  allFedsTimingEbmHist_->Fill(time);
521  if (FEDid >= 628 && FEDid <= 645)
522  allFedsTimingEbpHist_->Fill(time);
523  if (FEDid >= 613 && FEDid <= 616)
524  allFedsTimingEbmTopHist_->Fill(time);
525  if (FEDid >= 631 && FEDid <= 634)
526  allFedsTimingEbpTopHist_->Fill(time);
527  if (FEDid >= 622 && FEDid <= 625)
528  allFedsTimingEbmBottomHist_->Fill(time);
529  if (FEDid >= 640 && FEDid <= 643)
530  allFedsTimingEbpBottomHist_->Fill(time);
531  }
532 
533  // *** High Energy Clusters Analysis ** //
534 
535  if (energy > minHighEnergy_) {
536  LogInfo("EcalCosmicsHists") << "High energy event " << iEvent.id().run() << " : " << iEvent.id().event() << " "
537  << naiveEvtNum_ << " : " << energy << " " << numXtalsinCluster << " : " << iphi << " "
538  << ieta << " : " << isEcalL1 << isHCALL1 << isDTL1 << isRPCL1 << isCSCL1;
539 
540  numberOfHighEClusters++;
541  allOccupancyHighEnergy_->Fill(iphi, ieta);
542  allOccupancyHighEnergyCoarse_->Fill(iphi, ieta);
543  allFedsOccupancyHighEnergyHist_->Fill(iphi, ieta, energy);
544  allFedsenergyOnlyHighHist_->Fill(energy);
545 
546  HighEnergy_2GeV_occuCoarse->Fill(iphi, ieta);
547  HighEnergy_2GeV_occu3D->Fill(iphi, ieta, energy);
548 
549  HighEnergy_NumXtal->Fill(fullnumXtalsinCluster);
550  HighEnergy_NumXtalFedId->Fill(FEDid, fullnumXtalsinCluster);
551  HighEnergy_NumXtaliphi->Fill(iphi, fullnumXtalsinCluster);
552  HighEnergy_energy3D->Fill(iphi, ieta, energy);
553  HighEnergy_energyNumXtal->Fill(fullnumXtalsinCluster, energy);
554 
555  if (energy > 100.0) {
556  LogInfo("EcalCosmicsHists") << "Very high energy event " << iEvent.id().run() << " : " << iEvent.id().event()
557  << " " << naiveEvtNum_ << " : " << energy << " " << numXtalsinCluster << " : "
558  << iphi << " " << ieta << " : " << isEcalL1 << isHCALL1 << isDTL1 << isRPCL1
559  << isCSCL1;
560 
561  HighEnergy_100GeV_occuCoarse->Fill(iphi, ieta);
562  HighEnergy_100GeV_occu3D->Fill(iphi, ieta, energy);
563  }
564  }
565 
566  // *** end of High Energy Clusters analysis *** //
567 
568  } //++++++++++++++++++END LOOP OVER EB SUPERCLUSTERS+++++++++++++++++++++++//
569 
570  //+++++++++++++++++++LOOP OVER ENDCAP EE CLUSTERS++++++++++++++++++++//
571 
572  if (hasEndcapClusters) {
573  clusterCollection_p = escHandle.product();
574  for (reco::SuperClusterCollection::const_iterator clus = clusterCollection_p->begin();
575  clus != clusterCollection_p->end();
576  ++clus) {
577  double energy = clus->energy();
578  //double phi = clus->phi();
579  //double eta = clus->eta();
580  double time = -1000.0;
581  double ampli = 0.;
582  double secondMin = 0.;
583  double secondTime = -1000.;
584  int clusSize = clus->clustersSize();
585  int numXtalsinCluster = 0;
586 
587  EEDetId maxDet;
588  EEDetId secDet;
589  //LogInfo("EcalCosmicsHists") << "Here is what we initialized the maxDet to: " << maxDet;
590 
591  // for (reco::basicCluster_iterator bclus = (clus->clustersBegin()); bclus != (clus->clustersEnd()); ++bclus) {
592  // //double cphi = (*bclus)->phi();
593  // //double ceta = (*bclus)->eta();
594  // //TODO: extend histos to EE
595  // //TrueBCOccupancy_->Fill(cphi,ceta);
596  // //TrueBCOccupancyCoarse_->Fill(cphi,ceta);
597  // }
598 
599  std::vector<std::pair<DetId, float> > clusterDetIds = clus->hitsAndFractions(); //get these from the cluster
600  for (std::vector<std::pair<DetId, float> >::const_iterator detitr = clusterDetIds.begin();
601  detitr != clusterDetIds.end();
602  ++detitr) {
603  //LogInfo("EcalCosmicsHists") << " Here is the DetId inside the cluster: " << (EEDetId)(*detitr);
604  //Here I use the "find" on a digi collection... I have been warned...
605 
606  if ((*detitr).first.det() != DetId::Ecal) {
607  LogError("EcalCosmicsHists") << " det is " << (*detitr).first.det();
608  continue;
609  }
610  if ((*detitr).first.subdetId() != EcalEndcap) {
611  LogError("EcalCosmicsHists") << " subdet is " << (*detitr).first.subdetId();
612  continue;
613  }
614 
615  EcalRecHitCollection::const_iterator thishit = hitsEE->find((*detitr).first);
616 
617  if (thishit == hitsEE->end()) {
618  LogInfo("EcalCosmicsHists") << " WARNING: EEDetId not found in the RecHit collection!";
619  continue;
620  }
621  // The checking above should no longer be needed......
622  // as only those in the cluster would already have rechits..
623 
624  EcalRecHit myhit = (*thishit);
625 
626  //LogInfo("EcalCosmicsHists") << " Found hit for DetId: " << (EEDetId)(*detitr);
627  double thisamp = myhit.energy();
628  if (thisamp > minRecHitAmpEE_) {
629  numXtalsinCluster++;
630  }
631  if (thisamp > secondMin) {
632  secondMin = thisamp;
633  secondTime = myhit.time();
634  secDet = (EEDetId)(*detitr).first;
635  }
636  if (secondMin > ampli) {
637  std::swap(ampli, secondMin);
638  std::swap(time, secondTime);
639  std::swap(maxDet, secDet);
640  }
641 
642  //LogInfo("EcalCosmicsHists") << "maxDetId is now: " << (EEDetId)(maxDet);
643  }
644 
645  double fullnumXtalsinCluster = clusterDetIds.size();
646 
647  float E2 = ampli + secondMin;
648 
650  //int FEDid = 600+elecId.dccId();
651 
652  //Set some more values
653  //TODO: need to fix the seeds vector to be DetId or have another one for EE
654  //seeds.push_back(maxDet);
655 
656  int ix = maxDet.ix();
657  int iy = maxDet.iy();
658  int iz = maxDet.zside();
659 
660  // LogWarning("EcalCosmicsHists") << "EE cluster (x,y,z) : ( "
661  // << ix << " , " << iy << " , " << iz
662  // << " ) " << std::endl;
663 
664  if (!EEDetId::validDetId(ix, iy, iz)) {
665  LogWarning("EcalCosmicsHists") << "INVALID EE DetId !!!" << endl;
666  return;
667  }
668 
669  numberOfCosmics++;
670  if (iz < 0) {
671  numberOfCosmicsEEM++;
672  } else {
673  numberOfCosmicsEEP++;
674  }
675 
676  //int LM = ecalElectronicsMap_->getLMNumber(maxDet) ;//FIX ME
677 
678  //TODO: extend histos to EE
679  //TH1F* uRecHist = FEDsAndHists_[FEDid];
680  //TH1F* E2uRecHist = FEDsAndE2Hists_[FEDid];
681  //TH1F* energyuRecHist = FEDsAndenergyHists_[FEDid];
682  //TH1F* timingHist = FEDsAndTimingHists_[FEDid];
683  //TH1F* freqHist = FEDsAndFrequencyHists_[FEDid];
684  //TH1F* iphiProfileHist = FEDsAndiPhiProfileHists_[FEDid];
685  //TH1F* ietaProfileHist = FEDsAndiEtaProfileHists_[FEDid];
686  //TH2F* timingHistVsFreq = FEDsAndTimingVsFreqHists_[FEDid];
687  //TH2F* timingHistVsAmp = FEDsAndTimingVsAmpHists_[FEDid];
688  //TH2F* E2vsE1uRecHist = FEDsAndE2vsE1Hists_[FEDid];
689  //TH2F* energyvsE1uRecHist = FEDsAndenergyvsE1Hists_[FEDid];
690  //TH1F* numXtalInClusterHist = FEDsAndNumXtalsInClusterHists_[FEDid];
691  //TH2F* occupHist = FEDsAndOccupancyHists_[FEDid];
692  //TH2F* timingHistVsPhi = FEDsAndTimingVsPhiHists_[FEDid];
693  //TH2F* timingHistVsModule = FEDsAndTimingVsModuleHists_[FEDid];
694  //if(uRecHist==0)
695  //{
696  // initHists(FEDid);
697  // uRecHist = FEDsAndHists_[FEDid];
698  // E2uRecHist = FEDsAndE2Hists_[FEDid];
699  // energyuRecHist = FEDsAndenergyHists_[FEDid];
700  // timingHist = FEDsAndTimingHists_[FEDid];
701  // freqHist = FEDsAndFrequencyHists_[FEDid];
702  // timingHistVsFreq = FEDsAndTimingVsFreqHists_[FEDid];
703  // timingHistVsAmp = FEDsAndTimingVsAmpHists_[FEDid];
704  // iphiProfileHist = FEDsAndiPhiProfileHists_[FEDid];
705  // ietaProfileHist = FEDsAndiEtaProfileHists_[FEDid];
706  // E2vsE1uRecHist = FEDsAndE2vsE1Hists_[FEDid];
707  // energyvsE1uRecHist = FEDsAndenergyvsE1Hists_[FEDid];
708  // numXtalInClusterHist = FEDsAndNumXtalsInClusterHists_[FEDid];
709  // occupHist = FEDsAndOccupancyHists_[FEDid];
710  // timingHistVsPhi = FEDsAndTimingVsPhiHists_[FEDid];
711  // timingHistVsModule = FEDsAndTimingVsModuleHists_[FEDid];
712  //}
713  //uRecHist->Fill(ampli);
714  //E2uRecHist->Fill(E2);
715  //E2vsE1uRecHist->Fill(ampli,E2);
716  //energyuRecHist->Fill(energy);
717  //energyvsE1uRecHist->Fill(ampli,energy);
718  //allFedsHist_->Fill(ampli);
719 
720  if (iz < 0) {
721  EEM_FedsSeedEnergyHist_->Fill(ampli);
722  EEM_FedsenergyHist_->Fill(energy);
723  EEM_FedsenergyHighHist_->Fill(energy);
724  EEM_FedsE2Hist_->Fill(E2);
725  EEM_FedsE2vsE1Hist_->Fill(ampli, E2);
726  EEM_FedsenergyvsE1Hist_->Fill(ampli, energy);
727  EEM_AllOccupancyCoarse_->Fill(ix - 0.5, iy - 0.5);
728  EEM_AllOccupancy_->Fill(ix - 0.5, iy - 0.5);
729 
730  EEM_FedsNumXtalsInClusterHist_->Fill(numXtalsinCluster);
731  EEM_NumXtalsInClusterHist_->Fill(fullnumXtalsinCluster);
732  EEM_numxtalsVsEnergy_->Fill(energy, numXtalsinCluster);
733  EEM_numxtalsVsHighEnergy_->Fill(energy, numXtalsinCluster);
734  EEM_numberofBCinSC_->Fill(clusSize);
735 
736  if (fullnumXtalsinCluster == 1) {
737  EEM_OccupancySingleXtal_->Fill(ix - 0.5, iy - 0.5);
738  EEM_energySingleXtalHist_->Fill(energy);
739  }
740 
741  if (ampli > minTimingAmpEE_) {
742  EEM_FedsTimingHist_->Fill(time);
743  EEM_FedsTimingVsAmpHist_->Fill(time, ampli);
744  EEM_FedsTimingTTHist_->Fill(ix - 0.5, iy - 0.5, time);
745  }
746 
747  // Exclusive trigger plots
748 
749  if (isEcalL1 && !isDTL1 && !isRPCL1 && !isCSCL1 && !isHCALL1) {
750  EEM_OccupancyExclusiveECAL_->Fill(ix - 0.5, iy - 0.5);
751  EEM_OccupancyCoarseExclusiveECAL_->Fill(ix - 0.5, iy - 0.5);
752  if (ampli > minTimingAmpEE_) {
753  EEM_FedsTimingHistECAL_->Fill(time);
754  EEM_FedsTimingTTHistECAL_->Fill(ix - 0.5, iy - 0.5, time);
755  }
756  EEM_triggerExclusiveHist_->Fill(0);
757  }
758 
759  if (!isEcalL1 && !isDTL1 && !isRPCL1 && !isCSCL1 && isHCALL1) {
760  EEM_OccupancyExclusiveHCAL_->Fill(ix - 0.5, iy - 0.5);
761  EEM_OccupancyCoarseExclusiveHCAL_->Fill(ix - 0.5, iy - 0.5);
762  if (ampli > minTimingAmpEE_) {
763  EEM_FedsTimingHistHCAL_->Fill(time);
764  EEM_FedsTimingTTHistHCAL_->Fill(ix - 0.5, iy - 0.5, time);
765  }
766  EEM_triggerExclusiveHist_->Fill(1);
767  }
768 
769  if (!isEcalL1 && isDTL1 && !isRPCL1 && !isCSCL1 && !isHCALL1) {
770  EEM_OccupancyExclusiveDT_->Fill(ix - 0.5, iy - 0.5);
771  EEM_OccupancyCoarseExclusiveDT_->Fill(ix - 0.5, iy - 0.5);
772  if (ampli > minTimingAmpEE_) {
773  EEM_FedsTimingHistDT_->Fill(time);
774  EEM_FedsTimingTTHistDT_->Fill(ix - 0.5, iy - 0.5, time);
775  }
776  EEM_triggerExclusiveHist_->Fill(2);
777  }
778 
779  if (!isEcalL1 && !isDTL1 && isRPCL1 && !isCSCL1 && !isHCALL1) {
780  EEM_OccupancyExclusiveRPC_->Fill(ix - 0.5, iy - 0.5);
781  EEM_OccupancyCoarseExclusiveRPC_->Fill(ix - 0.5, iy - 0.5);
782  if (ampli > minTimingAmpEE_) {
783  EEM_FedsTimingHistRPC_->Fill(time);
784  EEM_FedsTimingTTHistRPC_->Fill(ix - 0.5, iy - 0.5, time);
785  }
786  EEM_triggerExclusiveHist_->Fill(3);
787  }
788 
789  if (!isEcalL1 && !isDTL1 && !isRPCL1 && isCSCL1 && !isHCALL1) {
790  EEM_OccupancyExclusiveCSC_->Fill(ix - 0.5, iy - 0.5);
791  EEM_OccupancyCoarseExclusiveCSC_->Fill(ix - 0.5, iy - 0.5);
792  if (ampli > minTimingAmpEE_) {
793  EEM_FedsTimingHistCSC_->Fill(time);
794  EEM_FedsTimingTTHistCSC_->Fill(ix - 0.5, iy - 0.5, time);
795  }
796  EEM_triggerExclusiveHist_->Fill(4);
797  }
798 
799  // Inclusive trigger plots
800 
801  if (isEcalL1) {
802  EEM_triggerHist_->Fill(0);
803  EEM_OccupancyECAL_->Fill(ix - 0.5, iy - 0.5);
804  EEM_OccupancyCoarseECAL_->Fill(ix - 0.5, iy - 0.5);
805  }
806  if (isHCALL1) {
807  EEM_triggerHist_->Fill(1);
808  EEM_OccupancyHCAL_->Fill(ix - 0.5, iy - 0.5);
809  EEM_OccupancyCoarseHCAL_->Fill(ix - 0.5, iy - 0.5);
810  }
811  if (isDTL1) {
812  EEM_triggerHist_->Fill(2);
813  EEM_OccupancyDT_->Fill(ix - 0.5, iy - 0.5);
814  EEM_OccupancyCoarseDT_->Fill(ix - 0.5, iy - 0.5);
815  }
816  if (isRPCL1) {
817  EEM_triggerHist_->Fill(3);
818  EEM_OccupancyRPC_->Fill(ix - 0.5, iy - 0.5);
819  EEM_OccupancyCoarseRPC_->Fill(ix - 0.5, iy - 0.5);
820  }
821  if (isCSCL1) {
822  EEM_triggerHist_->Fill(4);
823  EEM_OccupancyCSC_->Fill(ix - 0.5, iy - 0.5);
824  EEM_OccupancyCoarseCSC_->Fill(ix - 0.5, iy - 0.5);
825  }
826 
827  } else {
828  EEP_FedsSeedEnergyHist_->Fill(ampli);
829  EEP_FedsenergyHist_->Fill(energy);
830  EEP_FedsenergyHighHist_->Fill(energy);
831  EEP_FedsE2Hist_->Fill(E2);
832  EEP_FedsE2vsE1Hist_->Fill(ampli, E2);
833  EEP_FedsenergyvsE1Hist_->Fill(ampli, energy);
834  EEP_AllOccupancyCoarse_->Fill(ix - 0.5, iy - 0.5);
835  EEP_AllOccupancy_->Fill(ix - 0.5, iy - 0.5);
836 
837  EEP_FedsNumXtalsInClusterHist_->Fill(numXtalsinCluster);
838  EEP_NumXtalsInClusterHist_->Fill(fullnumXtalsinCluster);
839  EEP_numxtalsVsEnergy_->Fill(energy, numXtalsinCluster);
840  EEP_numxtalsVsHighEnergy_->Fill(energy, numXtalsinCluster);
841  EEP_numberofBCinSC_->Fill(clusSize);
842 
843  if (fullnumXtalsinCluster == 1) {
844  EEP_OccupancySingleXtal_->Fill(ix - 0.5, iy - 0.5);
845  EEP_energySingleXtalHist_->Fill(energy);
846  }
847 
848  if (ampli > minTimingAmpEE_) {
849  EEP_FedsTimingHist_->Fill(time);
850  EEP_FedsTimingVsAmpHist_->Fill(time, ampli);
851  EEP_FedsTimingTTHist_->Fill(ix - 0.5, iy - 0.5, time);
852  }
853 
854  // Exclusive trigger plots
855 
856  if (isEcalL1 && !isDTL1 && !isRPCL1 && !isCSCL1 && !isHCALL1) {
857  EEP_OccupancyExclusiveECAL_->Fill(ix - 0.5, iy - 0.5);
858  EEP_OccupancyCoarseExclusiveECAL_->Fill(ix - 0.5, iy - 0.5);
859  if (ampli > minTimingAmpEE_) {
860  EEP_FedsTimingHistECAL_->Fill(time);
861  EEP_FedsTimingTTHistECAL_->Fill(ix - 0.5, iy - 0.5, time);
862  }
863  EEP_triggerExclusiveHist_->Fill(0);
864  }
865 
866  if (!isEcalL1 && !isDTL1 && !isRPCL1 && !isCSCL1 && isHCALL1) {
867  EEP_OccupancyExclusiveHCAL_->Fill(ix - 0.5, iy - 0.5);
868  EEP_OccupancyCoarseExclusiveHCAL_->Fill(ix - 0.5, iy - 0.5);
869  if (ampli > minTimingAmpEE_) {
870  EEP_FedsTimingHistHCAL_->Fill(time);
871  EEP_FedsTimingTTHistHCAL_->Fill(ix - 0.5, iy - 0.5, time);
872  }
873  EEP_triggerExclusiveHist_->Fill(1);
874  }
875 
876  if (!isEcalL1 && isDTL1 && !isRPCL1 && !isCSCL1 && !isHCALL1) {
877  EEP_OccupancyExclusiveDT_->Fill(ix - 0.5, iy - 0.5);
878  EEP_OccupancyCoarseExclusiveDT_->Fill(ix - 0.5, iy - 0.5);
879  if (ampli > minTimingAmpEE_) {
880  EEP_FedsTimingHistDT_->Fill(time);
881  EEP_FedsTimingTTHistDT_->Fill(ix - 0.5, iy - 0.5, time);
882  }
883  EEP_triggerExclusiveHist_->Fill(2);
884  }
885 
886  if (!isEcalL1 && !isDTL1 && isRPCL1 && !isCSCL1 && !isHCALL1) {
887  EEP_OccupancyExclusiveRPC_->Fill(ix - 0.5, iy - 0.5);
888  EEP_OccupancyCoarseExclusiveRPC_->Fill(ix - 0.5, iy - 0.5);
889  if (ampli > minTimingAmpEE_) {
890  EEP_FedsTimingHistRPC_->Fill(time);
891  EEP_FedsTimingTTHistRPC_->Fill(ix - 0.5, iy - 0.5, time);
892  }
893  EEP_triggerExclusiveHist_->Fill(3);
894  }
895 
896  if (!isEcalL1 && !isDTL1 && !isRPCL1 && isCSCL1 && !isHCALL1) {
897  EEP_OccupancyExclusiveCSC_->Fill(ix - 0.5, iy - 0.5);
898  EEP_OccupancyCoarseExclusiveCSC_->Fill(ix - 0.5, iy - 0.5);
899  if (ampli > minTimingAmpEE_) {
900  EEP_FedsTimingHistCSC_->Fill(time);
901  EEP_FedsTimingTTHistCSC_->Fill(ix - 0.5, iy - 0.5, time);
902  }
903  EEP_triggerExclusiveHist_->Fill(4);
904  }
905 
906  // Inclusive trigger plots
907 
908  if (isEcalL1) {
909  EEP_triggerHist_->Fill(0);
910  EEP_OccupancyECAL_->Fill(ix - 0.5, iy - 0.5);
911  EEP_OccupancyCoarseECAL_->Fill(ix - 0.5, iy - 0.5);
912  }
913  if (isHCALL1) {
914  EEP_triggerHist_->Fill(1);
915  EEP_OccupancyHCAL_->Fill(ix - 0.5, iy - 0.5);
916  EEP_OccupancyCoarseHCAL_->Fill(ix - 0.5, iy - 0.5);
917  }
918  if (isDTL1) {
919  EEP_triggerHist_->Fill(2);
920  EEP_OccupancyDT_->Fill(ix - 0.5, iy - 0.5);
921  EEP_OccupancyCoarseDT_->Fill(ix - 0.5, iy - 0.5);
922  }
923  if (isRPCL1) {
924  EEP_triggerHist_->Fill(3);
925  EEP_OccupancyRPC_->Fill(ix - 0.5, iy - 0.5);
926  EEP_OccupancyCoarseRPC_->Fill(ix - 0.5, iy - 0.5);
927  }
928  if (isCSCL1) {
929  EEP_triggerHist_->Fill(4);
930  EEP_OccupancyCSC_->Fill(ix - 0.5, iy - 0.5);
931  EEP_OccupancyCoarseCSC_->Fill(ix - 0.5, iy - 0.5);
932  }
933  }
934 
935  // *** High Energy Clusters Analysis ** //
936 
937  if (energy > minHighEnergy_) {
938  LogInfo("EcalCosmicsHists") << "High energy event in EE " << iEvent.id().run() << " : " << iEvent.id().event()
939  << " " << naiveEvtNum_ << " : " << energy << " " << numXtalsinCluster << " : " << ix
940  << " " << iy << " : " << isEcalL1 << isHCALL1 << isDTL1 << isRPCL1 << isCSCL1;
941 
942  // numberOfHighEClusters++;
943  // allOccupancyHighEnergy_->Fill(iphi, ieta);
944  // allOccupancyHighEnergyCoarse_->Fill(iphi, ieta);
945  // allFedsOccupancyHighEnergyHist_->Fill(iphi,ieta,energy);
946  if (iz < 0) {
947  EEM_FedsenergyOnlyHighHist_->Fill(energy);
948  EEM_OccupancyHighEnergy_->Fill(ix - 0.5, iy - 0.5);
949  EEM_OccupancyHighEnergyCoarse_->Fill(ix - 0.5, iy - 0.5);
950  } else {
951  EEP_FedsenergyOnlyHighHist_->Fill(energy);
952  }
953  // HighEnergy_2GeV_occuCoarse->Fill(iphi,ieta);
954  // HighEnergy_2GeV_occu3D->Fill(iphi,ieta,energy);
955 
956  // HighEnergy_NumXtal->Fill(fullnumXtalsinCluster);
957  // HighEnergy_NumXtalFedId->Fill(FEDid,fullnumXtalsinCluster);
958  // HighEnergy_NumXtaliphi->Fill(iphi,fullnumXtalsinCluster);
959  // HighEnergy_energy3D->Fill(iphi,ieta,energy);
960  // HighEnergy_energyNumXtal->Fill(fullnumXtalsinCluster,energy);
961 
962  if (energy > 100.0) {
963  LogInfo("EcalCosmicsHists") << "Very high energy event in EE " << iEvent.id().run() << " : "
964  << iEvent.id().event() << " " << naiveEvtNum_ << " : " << energy << " "
965  << numXtalsinCluster << " : " << ix << " " << iy << " : " << isEcalL1 << isHCALL1
966  << isDTL1 << isRPCL1 << isCSCL1;
967  // HighEnergy_100GeV_occuCoarse->Fill(iphi,ieta);
968  // HighEnergy_100GeV_occu3D->Fill(iphi,ieta,energy);
969  }
970  }
971 
972  // *** end of High Energy Clusters analysis *** //
973 
974  } //++++++++++++++++++END LOOP OVER EE SUPERCLUSTERS+++++++++++++++++++++++++++++++++++
975  }
976 
977  HighEnergy_numClusHighEn->Fill(numberOfHighEClusters);
978  HighEnergy_ratioClusters->Fill((double(numberOfHighEClusters)) / (double(numberOfCosmics)));
979 
980  numberofCosmicsHist_->Fill(numberOfCosmics);
981  EEP_numberofCosmicsHist_->Fill(numberOfCosmicsEEP);
982  EEM_numberofCosmicsHist_->Fill(numberOfCosmicsEEM);
983  numberofCosmicsHistEB_->Fill(numberOfCosmicsEB);
984 
985  if (numberOfCosmics > 0) {
986  cosmicCounter_++;
988  allFedsFreqTimeHist_->Fill(eventTime);
989  //This line will work in 21X!!
990  //std::cout << " Orbit " << iEvent.orbitNumber() << " BX " << iEvent.bunchCrossing()<< std::endl;
991  //std::cout << " BX " << iEvent.experimentType() << std::endl;
992  }
993 
994  if (numberOfCosmicsEB > 0)
996  if (numberOfCosmicsEEP > 0)
998  if (numberOfCosmicsEEM > 0)
1000 
1001  if (numberOfCosmicsTop && numberOfCosmicsBottom) {
1003  numberofCosmicsTopBottomHist_->Fill(numberOfCosmicsTop + numberOfCosmicsBottom);
1004  }
1005 
1006  // *** TrackAssociator *** //
1007 
1008  // get reco tracks
1010  iEvent.getByLabel("cosmicMuons", recoTracks);
1011 
1012  if (recoTracks.isValid()) {
1013  // LogWarning("EcalCosmicsHists") << "... Valid TrackAssociator recoTracks !!! " << recoTracks.product()->size();
1014  std::map<int, std::vector<DetId> > trackDetIdMap;
1015  int tracks = 0;
1016  for (reco::TrackCollection::const_iterator recoTrack = recoTracks->begin(); recoTrack != recoTracks->end();
1017  ++recoTrack) {
1018  if (fabs(recoTrack->d0()) > 70 || fabs(recoTrack->dz()) > 70)
1019  continue;
1020  if (recoTrack->numberOfValidHits() < 20)
1021  continue;
1022 
1023  //if (recoTrack->pt() < 2) continue; // skip low Pt tracks
1024 
1025  TrackDetMatchInfo info = trackAssociator_.associate(iEvent, iSetup, *recoTrack, trackParameters_);
1026 
1027  // edm::LogVerbatim("TrackAssociator") << "\n-------------------------------------------------------\n Track (pt,eta,phi): " <<
1028  // recoTrack->pt() << " , " << recoTrack->eta() << " , " << recoTrack->phi() ;
1029  // edm::LogVerbatim("TrackAssociator") << "Ecal energy in crossed crystals based on RecHits: " <<
1030  // info.crossedEnergy(TrackDetMatchInfo::EcalRecHits);
1031  // edm::LogVerbatim("TrackAssociator") << "Ecal energy in 3x3 crystals based on RecHits: " <<
1032  // info.nXnEnergy(TrackDetMatchInfo::EcalRecHits, 1);
1033  // edm::LogVerbatim("TrackAssociator") << "Hcal energy in crossed towers based on RecHits: " <<
1034  // info.crossedEnergy(TrackDetMatchInfo::HcalRecHits);
1035  // edm::LogVerbatim("TrackAssociator") << "Hcal energy in 3x3 towers based on RecHits: " <<
1036  // info.nXnEnergy(TrackDetMatchInfo::HcalRecHits, 1);
1037  // edm::LogVerbatim("TrackAssociator") << "Number of muon segment matches: " << info.numberOfSegments();
1038 
1039  // std::cout << "\n-------------------------------------------------------\n Track (pt,eta,phi): " <<
1040  // recoTrack->pt() << " , " << recoTrack->eta() << " , " << recoTrack->phi() << std::endl;
1041  // std::cout << "Ecal energy in crossed crystals based on RecHits: " <<
1042  // info.crossedEnergy(TrackDetMatchInfo::EcalRecHits) << std::endl;
1043  // std::cout << "Ecal energy in 3x3 crystals based on RecHits: " <<
1044  // info.nXnEnergy(TrackDetMatchInfo::EcalRecHits, 1) << std::endl;
1045  // std::cout << "Hcal energy in crossed towers based on RecHits: " <<
1046  // info.crossedEnergy(TrackDetMatchInfo::HcalRecHits) << std::endl;
1047  // std::cout << "Hcal energy in 3x3 towers based on RecHits: " <<
1048  // info.nXnEnergy(TrackDetMatchInfo::HcalRecHits, 1) << std::endl;
1049 
1050  for (unsigned int i = 0; i < info.crossedEcalIds.size(); i++) {
1051  // only checks for barrel
1052  if (info.crossedEcalIds[i].det() == DetId::Ecal && info.crossedEcalIds[i].subdetId() == 1) {
1053  EBDetId ebDetId(info.crossedEcalIds[i]);
1054  trackAssoc_muonsEcal_->Fill(ebDetId.iphi(), ebDetId.ieta());
1055  //std::cout << "Crossed iphi: " << ebDetId.iphi()
1056  // << " ieta: " << ebDetId.ieta() << " : nCross " << info.crossedEcalIds.size() << std::endl;
1057 
1058  EcalRecHitCollection::const_iterator thishit = hits->find(ebDetId);
1059  if (thishit == hits->end())
1060  continue;
1061 
1062  //EcalRecHit myhit = (*thishit);
1063  //double thisamp = myhit.energy();
1064  //std::cout << " Crossed energy: " << thisamp << " : nCross " << info.crossedEcalIds.size() << std::endl;
1065  }
1066  }
1067 
1068  //edm::LogVerbatim("TrackAssociator") << " crossedEcalIds size: " << info.crossedEcalIds.size()
1069  // << " crossedEcalRecHits size: " << info.crossedEcalRecHits.size();
1070  numberofCrossedEcalIdsHist_->Fill(info.crossedEcalIds.size());
1071  tracks++;
1072  if (!info.crossedEcalIds.empty())
1073  trackDetIdMap.insert(std::pair<int, std::vector<DetId> >(tracks, info.crossedEcalIds));
1074  }
1075 
1076  // Now to match recoTracks with cosmic clusters
1077 
1078  int numAssocTracks = 0;
1079  int numAssocClusters = 0;
1080  edm::LogVerbatim("TrackAssociator") << "Matching cosmic clusters to tracks...";
1081  int numSeeds = seeds.size();
1082  int numTracks = trackDetIdMap.size();
1083  while (!seeds.empty() && !trackDetIdMap.empty()) {
1084  double bestDr = 1000;
1085  double bestDPhi = 1000;
1086  double bestDEta = 1000;
1087  double bestEtaTrack = 1000;
1088  double bestEtaSeed = 1000;
1089  double bestPhiTrack = 1000;
1090  double bestPhiSeed = 1000;
1091  EBDetId bestTrackDet;
1092  EBDetId bestSeed;
1093  int bestTrack = -1;
1094  std::map<EBDetId, EBDetId> trackDetIdToSeedMap;
1095 
1096  //edm::LogVerbatim("TrackAssociator") << "NumTracks:" << trackDetIdMap.size() << " numClusters:" << seeds.size();
1097 
1098  for (std::vector<EBDetId>::const_iterator seedItr = seeds.begin(); seedItr != seeds.end(); ++seedItr) {
1099  for (std::map<int, std::vector<DetId> >::const_iterator mapItr = trackDetIdMap.begin();
1100  mapItr != trackDetIdMap.end();
1101  ++mapItr) {
1102  for (unsigned int i = 0; i < mapItr->second.size(); i++) {
1103  // only checks for barrel
1104  if (mapItr->second[i].det() == DetId::Ecal && mapItr->second[i].subdetId() == 1) {
1105  EBDetId ebDet = (mapItr->second[i]);
1106  double seedEta = seedItr->ieta();
1107  double deta = ebDet.ieta() - seedEta;
1108  if (seedEta * ebDet.ieta() < 0)
1109  deta > 0 ? (deta = deta - 1.) : (deta = deta + 1.);
1110  double dR;
1111  double dphi = ebDet.iphi() - seedItr->iphi();
1112  if (abs(dphi) > 180)
1113  dphi > 0 ? (dphi = 360 - dphi) : (dphi = -360 - dphi);
1114  dR = sqrt(deta * deta + dphi * dphi);
1115  if (dR < bestDr) {
1116  bestDr = dR;
1117  bestDPhi = dphi;
1118  bestDEta = deta;
1119  bestTrackDet = mapItr->second[i];
1120  bestTrack = mapItr->first;
1121  bestSeed = (*seedItr);
1122  bestEtaTrack = ebDet.ieta();
1123  bestEtaSeed = seedEta;
1124  bestPhiTrack = ebDet.iphi();
1125  bestPhiSeed = seedItr->iphi();
1126  }
1127  }
1128  }
1129  }
1130  }
1131  if (bestDr < 1000) {
1132  //edm::LogVerbatim("TrackAssociator") << "Best deltaR from matched DetId's to cluster:" << bestDr;
1133  deltaRHist_->Fill(bestDr);
1134  deltaPhiHist_->Fill(bestDPhi);
1135  deltaEtaHist_->Fill(bestDEta);
1136  deltaEtaDeltaPhiHist_->Fill(bestDEta, bestDPhi);
1137  seedTrackEtaHist_->Fill(bestEtaSeed, bestEtaTrack);
1138  seedTrackPhiHist_->Fill(bestPhiSeed, bestPhiTrack);
1139  seeds.erase(find(seeds.begin(), seeds.end(), bestSeed));
1140  trackDetIdMap.erase(trackDetIdMap.find(bestTrack));
1141  trackDetIdToSeedMap[bestTrackDet] = bestSeed;
1142  numAssocTracks++;
1143  numAssocClusters++;
1144 
1145  // for high energy analysis
1146  if (bestDPhi < 1.5 && bestDEta < 1.8) {
1147  //edm::LogVerbatim("TrackAssociator") << "Best seed ieta and iphi: ("
1148  // << bestSeed.ieta() << ", " << bestSeed.iphi() << ") ";
1149  //check if the bestSeed is a High Energy one
1150  EcalRecHitCollection::const_iterator Ecalhit = hits->find(bestSeed);
1151  if (Ecalhit == hits->end()) {
1152  continue;
1153  }
1154  double EcalhitEnergy = Ecalhit->energy();
1155  //edm::LogVerbatim("TrackAssociator") << "Best seed energy: " << EcalhitEnergy ;
1156  HighEnergy_bestSeed->Fill(EcalhitEnergy);
1157  HighEnergy_bestSeedOccupancy->Fill(bestSeed.iphi(), bestSeed.ieta());
1158  }
1159  } else {
1160  edm::LogVerbatim("TrackAssociator") << "could not match cluster seed to track." << bestDr;
1161  break; // no match found
1162  }
1163  }
1164  if (numSeeds > 0 && numTracks > 0) {
1165  ratioAssocClustersHist_->AddBinContent(1, numAssocClusters);
1166  ratioAssocClustersHist_->AddBinContent(2, numSeeds);
1167  }
1168  if (numTracks > 0) {
1169  ratioAssocTracksHist_->AddBinContent(1, numAssocTracks);
1170  ratioAssocTracksHist_->AddBinContent(2, numTracks);
1171  numberofCosmicsWTrackHist_->Fill(numSeeds);
1172  }
1173  } else {
1174  // LogWarning("EcalCosmicsHists") << "!!! No TrackAssociator recoTracks !!!";
1175  }
1176 
1177  // Study on Tracks for High Energy events
1178  edm::Handle<reco::TrackCollection> recoTracksBarrel;
1179  iEvent.getByLabel("cosmicMuonsBarrelOnly", recoTracksBarrel);
1180  if (!recoTracksBarrel.isValid()) {
1181  //edm::LogWarning("EcalCosmicsHists") << "RecoTracksBarrel not valid!! " ;
1182  } else {
1183  //edm::LogWarning("EcalCosmicsHists") << "Number of barrel reco tracks found in the event: " << recoTracksBarrel->size() ;
1184  HighEnergy_numRecoTrackBarrel->Fill(recoTracksBarrel->size());
1185  for (reco::TrackCollection::const_iterator recoTrack = recoTracksBarrel->begin();
1186  recoTrack != recoTracksBarrel->end();
1187  ++recoTrack) {
1188  //edm::LogWarning("EcalCosmicsHists") << "Track (pt,eta,phi): " << recoTrack->pt() << " , " << recoTrack->eta() << " , " << recoTrack->phi() ;
1189  //edm::LogWarning("EcalCosmicsHists") << "Track innermost hit: " << recoTrack->innerPosition().phi() ;
1190  }
1191 
1192  for (reco::SuperClusterCollection::const_iterator clus = clusterCollection_p->begin();
1193  clus != clusterCollection_p->end();
1194  ++clus) {
1195  double energy = clus->energy();
1196  double phi = clus->phi();
1197  double eta = clus->eta();
1198 
1199  if (recoTracksBarrel->empty())
1200  HighEnergy_0tracks_occu3D->Fill(phi, eta, energy);
1201  if (recoTracksBarrel->size() == 1)
1202  HighEnergy_1tracks_occu3D->Fill(phi, eta, energy);
1203  if (recoTracksBarrel->size() == 2)
1204  HighEnergy_2tracks_occu3D->Fill(phi, eta, energy);
1205 
1206  std::vector<std::pair<DetId, float> > clusterDetIds = clus->hitsAndFractions(); //get these from the cluster
1207  for (std::vector<std::pair<DetId, float> >::const_iterator detitr = clusterDetIds.begin();
1208  detitr != clusterDetIds.end();
1209  ++detitr) {
1210  if ((*detitr).first.det() != DetId::Ecal) {
1211  continue;
1212  }
1213  if ((*detitr).first.subdetId() != EcalBarrel) {
1214  continue;
1215  }
1216  EcalRecHitCollection::const_iterator thishit = hits->find((*detitr).first);
1217  if (thishit == hits->end()) {
1218  continue;
1219  }
1220 
1221  double rechitenergy = thishit->energy();
1222  int ieta = ((EBDetId)(*detitr).first).ieta();
1223  int iphi = ((EBDetId)(*detitr).first).iphi();
1224  if (rechitenergy > minRecHitAmpEB_) {
1225  if (recoTracksBarrel->empty())
1226  HighEnergy_0tracks_occu3DXtal->Fill(iphi, ieta, rechitenergy);
1227  if (recoTracksBarrel->size() == 1)
1228  HighEnergy_1tracks_occu3DXtal->Fill(iphi, ieta, rechitenergy);
1229  if (recoTracksBarrel->size() == 2)
1230  HighEnergy_2tracks_occu3DXtal->Fill(iphi, ieta, rechitenergy);
1231 
1232  if (rechitenergy > 10)
1233  edm::LogWarning("EcalCosmicsHists") << "!!!!! Crystal with energy " << rechitenergy << " at (ieta,iphi) ("
1234  << ieta << " ," << iphi << "); Id: " << (*detitr).first.det();
1235  }
1236  }
1237  }
1238 
1239  // look at angle between 2 recoTracks
1240  if (recoTracksBarrel->size() == 2) {
1241  reco::TrackCollection::const_iterator Track1 = recoTracksBarrel->begin();
1242  reco::TrackCollection::const_iterator Track2 = (recoTracksBarrel->begin()) + 1;
1243  float angle = (acos(sin(Track1->theta()) * cos(Track1->phi()) * sin(Track2->theta()) * cos(Track2->phi()) +
1244  sin(Track1->theta()) * sin(Track1->phi()) * sin(Track2->theta()) * sin(Track2->phi()) +
1245  cos(Track1->theta()) * cos(Track2->theta()))) /
1246  0.017453292519943;
1247  //edm::LogWarning("EcalCosmicsHists") << "Tracks angle: " << angle;
1248  HighEnergy_TracksAngle->Fill(angle);
1249  if ((Track1->innerPosition().phi()) > 0 && (Track2->innerPosition().phi()) < 0) {
1250  //edm::LogWarning("EcalCosmicsHists") << "Top-bottom tracks";
1251  HighEnergy_TracksAngleTopBottom->Fill(angle);
1252  }
1253  }
1254  }
1255 
1256  // *** end of TrackAssociator code *** //
1257 
1258  // *** HCAL RecHits code *** //
1259 
1260  //hcal rechits
1262  iEvent.getByLabel("hbhereco", hbhe);
1263 
1265  iEvent.getByLabel("hfreco", hfrh);
1266 
1268  iEvent.getByLabel("horeco", horh);
1269 
1270  if (hbhe.isValid()) {
1271  // LogInfo("EcalCosmicHists") << "event " << ievt << " HBHE RecHits collection size " << hbhe->size();
1272  const HBHERecHitCollection hbheHit = *(hbhe.product());
1273  for (HBHERecHitCollection::const_iterator hhit = hbheHit.begin(); hhit != hbheHit.end(); hhit++) {
1274  // if (hhit->energy() > 0.6){
1275  hcalEnergy_HBHE_->Fill(hhit->energy());
1276  // }
1277  }
1278  } else {
1279  // LogWarning("EcalCosmicHists") << " HBHE RecHits **NOT** VALID!! " << endl;
1280  }
1281 
1282  if (hfrh.isValid()) {
1283  // LogInfo("EcalCosmicHists") << "event " << ievt << " HF RecHits collection size " << hfrh->size();
1284  const HFRecHitCollection hfHit = *(hfrh.product());
1285  for (HFRecHitCollection::const_iterator hhit = hfHit.begin(); hhit != hfHit.end(); hhit++) {
1286  hcalEnergy_HF_->Fill(hhit->energy());
1287  }
1288  } else {
1289  // LogWarning("EcalCosmicHists") << " HF RecHits **NOT** VALID!! " << endl;
1290  }
1291 
1292  if (horh.isValid()) {
1293  // LogInfo("EcalCosmicHists") << "event " << ievt << " HO RecHits collection size " << horh->size();
1294  const HORecHitCollection hoHit = *(horh.product());
1295  for (HORecHitCollection::const_iterator hhit = hoHit.begin(); hhit != hoHit.end(); hhit++) {
1296  // if (hhit->energy() > 0.6){
1297  hcalEnergy_HO_->Fill(hhit->energy());
1298  // }
1299  }
1300  } else {
1301  // LogWarning("EcalCosmicHists") << " HO RecHits **NOT** VALID!! " << endl;
1302  }
1303 
1304  // *** end of HCAL code *** //
1305 }
1306 
1307 std::vector<bool> EcalCosmicsHists::determineTriggers(const edm::Event& iEvent, const edm::EventSetup& eventSetup) {
1308  std::vector<bool> l1Triggers; //DT,CSC,RPC,HCAL,ECAL
1309  //0 , 1 , 2 , 3 , 4
1310  for (int i = 0; i < 5; i++)
1311  l1Triggers.push_back(false);
1312 
1313  // get the GMTReadoutCollection
1314  Handle<L1MuGMTReadoutCollection> gmtrc_handle;
1315  iEvent.getByLabel(l1GMTReadoutRecTag_, gmtrc_handle);
1316  L1MuGMTReadoutCollection const* gmtrc = gmtrc_handle.product();
1317  if (!(gmtrc_handle.isValid())) {
1318  LogWarning("EcalCosmicsHists") << "l1MuGMTReadoutCollection"
1319  << " not available";
1320  return l1Triggers;
1321  }
1322  // get hold of L1GlobalReadoutRecord
1324  iEvent.getByLabel(l1GTReadoutRecTag_, L1GTRR);
1325 
1326  //Ecal
1328  eventSetup.get<L1GtTriggerMenuRcd>().get(menuRcd);
1329  const L1GtTriggerMenu* menu = menuRcd.product();
1331  iEvent.getByLabel(edm::InputTag("gtDigis"), gtRecord);
1332  // Get dWord after masking disabled bits
1333  const DecisionWord dWord = gtRecord->decisionWord();
1334 
1335  bool l1SingleEG1 = menu->gtAlgorithmResult("L1_SingleEG1", dWord);
1336  bool l1SingleEG5 = menu->gtAlgorithmResult("L1_SingleEG5", dWord);
1337  bool l1SingleEG8 = menu->gtAlgorithmResult("L1_SingleEG8", dWord);
1338  bool l1SingleEG10 = menu->gtAlgorithmResult("L1_SingleEG10", dWord);
1339  bool l1SingleEG12 = menu->gtAlgorithmResult("L1_SingleEG12", dWord);
1340  bool l1SingleEG15 = menu->gtAlgorithmResult("L1_SingleEG15", dWord);
1341  bool l1SingleEG20 = menu->gtAlgorithmResult("L1_SingleEG20", dWord);
1342  bool l1SingleEG25 = menu->gtAlgorithmResult("L1_SingleEG25", dWord);
1343  bool l1DoubleNoIsoEGBTBtight = menu->gtAlgorithmResult("L1_DoubleNoIsoEG_BTB_tight", dWord);
1344  bool l1DoubleNoIsoEGBTBloose = menu->gtAlgorithmResult("L1_DoubleNoIsoEG_BTB_loose ", dWord);
1345  bool l1DoubleNoIsoEGTopBottom = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottom", dWord);
1346  bool l1DoubleNoIsoEGTopBottomCen = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottomCen", dWord);
1347  bool l1DoubleNoIsoEGTopBottomCen2 = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottomCen2", dWord);
1348  bool l1DoubleNoIsoEGTopBottomCenVert = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottomCenVert", dWord);
1349 
1350  l1Triggers[4] = l1SingleEG1 || l1SingleEG5 || l1SingleEG8 || l1SingleEG10 || l1SingleEG12 || l1SingleEG15 ||
1351  l1SingleEG20 || l1SingleEG25 || l1DoubleNoIsoEGBTBtight || l1DoubleNoIsoEGBTBloose ||
1352  l1DoubleNoIsoEGTopBottom || l1DoubleNoIsoEGTopBottomCen || l1DoubleNoIsoEGTopBottomCen2 ||
1353  l1DoubleNoIsoEGTopBottomCenVert;
1354 
1355  std::vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords();
1356  std::vector<L1MuGMTReadoutRecord>::const_iterator igmtrr;
1357  for (igmtrr = gmt_records.begin(); igmtrr != gmt_records.end(); igmtrr++) {
1358  std::vector<L1MuRegionalCand>::const_iterator iter1;
1359  std::vector<L1MuRegionalCand> rmc;
1360 
1361  //DT triggers
1362  int idt = 0;
1363  rmc = igmtrr->getDTBXCands();
1364  for (iter1 = rmc.begin(); iter1 != rmc.end(); iter1++) {
1365  if (!(*iter1).empty()) {
1366  idt++;
1367  }
1368  }
1369  //if(idt>0) std::cout << "Found " << idt << " valid DT candidates in bx wrt. L1A = "
1370  // << igmtrr->getBxInEvent() << std::endl;
1371  if (igmtrr->getBxInEvent() == 0 && idt > 0)
1372  l1Triggers[0] = true;
1373 
1374  //RPC triggers
1375  int irpcb = 0;
1376  rmc = igmtrr->getBrlRPCCands();
1377  for (iter1 = rmc.begin(); iter1 != rmc.end(); iter1++) {
1378  if (!(*iter1).empty()) {
1379  irpcb++;
1380  }
1381  }
1382  //if(irpcb>0) std::cout << "Found " << irpcb << " valid RPC candidates in bx wrt. L1A = "
1383  // << igmtrr->getBxInEvent() << std::endl;
1384  if (igmtrr->getBxInEvent() == 0 && irpcb > 0)
1385  l1Triggers[2] = true;
1386 
1387  //CSC Triggers
1388  int icsc = 0;
1389  rmc = igmtrr->getCSCCands();
1390  for (iter1 = rmc.begin(); iter1 != rmc.end(); iter1++) {
1391  if (!(*iter1).empty()) {
1392  icsc++;
1393  }
1394  }
1395  //if(icsc>0) std::cout << "Found " << icsc << " valid CSC candidates in bx wrt. L1A = "
1396  // << igmtrr->getBxInEvent() << std::endl;
1397  if (igmtrr->getBxInEvent() == 0 && icsc > 0)
1398  l1Triggers[1] = true;
1399  }
1400 
1401  L1GlobalTriggerReadoutRecord const* gtrr = L1GTRR.product();
1402 
1403  for (int ibx = -1; ibx <= 1; ibx++) {
1404  bool hcal_top = false;
1405  bool hcal_bot = false;
1406  const L1GtPsbWord psb = gtrr->gtPsbWord(0xbb0d, ibx);
1407  std::vector<int> valid_phi;
1408  if ((psb.aData(4) & 0x3f) >= 1) {
1409  valid_phi.push_back((psb.aData(4) >> 10) & 0x1f);
1410  }
1411  if ((psb.bData(4) & 0x3f) >= 1) {
1412  valid_phi.push_back((psb.bData(4) >> 10) & 0x1f);
1413  }
1414  if ((psb.aData(5) & 0x3f) >= 1) {
1415  valid_phi.push_back((psb.aData(5) >> 10) & 0x1f);
1416  }
1417  if ((psb.bData(5) & 0x3f) >= 1) {
1418  valid_phi.push_back((psb.bData(5) >> 10) & 0x1f);
1419  }
1420  std::vector<int>::const_iterator iphi;
1421  for (iphi = valid_phi.begin(); iphi != valid_phi.end(); iphi++) {
1422  //std::cout << "Found HCAL mip with phi=" << *iphi << " in bx wrt. L1A = " << ibx << std::endl;
1423  if (*iphi < 9)
1424  hcal_top = true;
1425  if (*iphi > 8)
1426  hcal_bot = true;
1427  }
1428  if (ibx == 0 && hcal_top && hcal_bot)
1429  l1Triggers[3] = true;
1430  }
1431 
1432  edm::LogInfo("EcalCosmicsHists") << "**** Trigger SourceSource ****";
1433  if (l1Triggers[0])
1434  edm::LogInfo("EcalCosmicsHists") << "DT";
1435  if (l1Triggers[2])
1436  edm::LogInfo("EcalCosmicsHists") << "RPC";
1437  if (l1Triggers[1])
1438  edm::LogInfo("EcalCosmicsHists") << "CSC";
1439  if (l1Triggers[3])
1440  edm::LogInfo("EcalCosmicsHists") << "HCAL";
1441  if (l1Triggers[4])
1442  edm::LogInfo("EcalCosmicsHists") << "ECAL";
1443  edm::LogInfo("EcalCosmicsHists") << "************************";
1444 
1445  return l1Triggers;
1446 }
1447 
1448 // insert the hist map into the map keyed by FED number
1450  using namespace std;
1451 
1452  string FEDid = intToString(FED);
1453  string title1 = "Energy of Seed Crystal ";
1454  title1.append(fedMap_->getSliceFromFed(FED));
1455  title1.append(";Seed Energy (GeV);Number of Cosmics");
1456  string name1 = "SeedEnergyFED";
1457  name1.append(intToString(FED));
1458  int numBins = 200; //(int)round(histRangeMax_-histRangeMin_)+1;
1459  TH1F* hist = new TH1F(name1.c_str(), title1.c_str(), numBins, histRangeMin_, histRangeMax_);
1460  FEDsAndHists_[FED] = hist;
1461  FEDsAndHists_[FED]->SetDirectory(nullptr);
1462 
1463  TH1F* E2hist = new TH1F(Form("E2_FED_%d", FED), Form("E2_FED_%d", FED), numBins, histRangeMin_, histRangeMax_);
1464  FEDsAndE2Hists_[FED] = E2hist;
1465  FEDsAndE2Hists_[FED]->SetDirectory(nullptr);
1466 
1467  TH1F* energyhist =
1468  new TH1F(Form("Energy_FED_%d", FED), Form("Energy_FED_%d", FED), numBins, histRangeMin_, histRangeMax_);
1469  FEDsAndenergyHists_[FED] = energyhist;
1470  FEDsAndenergyHists_[FED]->SetDirectory(nullptr);
1471 
1472  TH2F* E2vsE1hist = new TH2F(Form("E2vsE1_FED_%d", FED),
1473  Form("E2vsE1_FED_%d", FED),
1474  numBins,
1475  histRangeMin_,
1476  histRangeMax_,
1477  numBins,
1478  histRangeMin_,
1479  histRangeMax_);
1480  FEDsAndE2vsE1Hists_[FED] = E2vsE1hist;
1481  FEDsAndE2vsE1Hists_[FED]->SetDirectory(nullptr);
1482 
1483  TH2F* energyvsE1hist = new TH2F(Form("EnergyvsE1_FED_%d", FED),
1484  Form("EnergyvsE1_FED_%d", FED),
1485  numBins,
1486  histRangeMin_,
1487  histRangeMax_,
1488  numBins,
1489  histRangeMin_,
1490  histRangeMax_);
1491  FEDsAndenergyvsE1Hists_[FED] = energyvsE1hist;
1492  FEDsAndenergyvsE1Hists_[FED]->SetDirectory(nullptr);
1493 
1494  title1 = "Time for ";
1495  title1.append(fedMap_->getSliceFromFed(FED));
1496  title1.append(";Relative Time (1 clock = 25ns);Events");
1497  name1 = "TimeFED";
1498  name1.append(intToString(FED));
1499  TH1F* timingHist = new TH1F(name1.c_str(), title1.c_str(), 78, -7, 7);
1500  FEDsAndTimingHists_[FED] = timingHist;
1501  FEDsAndTimingHists_[FED]->SetDirectory(nullptr);
1502 
1503  TH1F* freqHist =
1504  new TH1F(Form("Frequency_FED_%d", FED), Form("Frequency for FED %d;Event Number", FED), 100, 0., 100000);
1505  FEDsAndFrequencyHists_[FED] = freqHist;
1506  FEDsAndFrequencyHists_[FED]->SetDirectory(nullptr);
1507 
1508  TH1F* iphiProfileHist =
1509  new TH1F(Form("iPhi_Profile_FED_%d", FED), Form("iPhi Profile for FED %d", FED), 360, 1., 361);
1510  FEDsAndiPhiProfileHists_[FED] = iphiProfileHist;
1511  FEDsAndiPhiProfileHists_[FED]->SetDirectory(nullptr);
1512 
1513  TH1F* ietaProfileHist =
1514  new TH1F(Form("iEta_Profile_FED_%d", FED), Form("iEta Profile for FED %d", FED), 172, -86, 86);
1515  FEDsAndiEtaProfileHists_[FED] = ietaProfileHist;
1516  FEDsAndiEtaProfileHists_[FED]->SetDirectory(nullptr);
1517 
1518  TH2F* timingHistVsFreq =
1519  new TH2F(Form("timeVsFreqFED_%d", FED), Form("time Vs Freq FED %d", FED), 78, -7, 7, 100, 0., 100000);
1520  FEDsAndTimingVsFreqHists_[FED] = timingHistVsFreq;
1521  FEDsAndTimingVsFreqHists_[FED]->SetDirectory(nullptr);
1522 
1523  TH2F* timingHistVsAmp = new TH2F(
1524  Form("timeVsAmpFED_%d", FED), Form("time Vs Amp FED %d", FED), 78, -7, 7, numBins, histRangeMin_, histRangeMax_);
1525  FEDsAndTimingVsAmpHists_[FED] = timingHistVsAmp;
1526  FEDsAndTimingVsAmpHists_[FED]->SetDirectory(nullptr);
1527 
1528  TH1F* numXtalInClusterHist = new TH1F(Form("NumXtalsInCluster_FED_%d", FED),
1529  Form("Num active Xtals In Cluster for FED %d;Num Active Xtals", FED),
1530  25,
1531  0,
1532  25);
1533  FEDsAndNumXtalsInClusterHists_[FED] = numXtalInClusterHist;
1534  FEDsAndNumXtalsInClusterHists_[FED]->SetDirectory(nullptr);
1535 
1536  TH2F* OccupHist = new TH2F(Form("occupFED_%d", FED), Form("Occupancy FED %d;i#eta;i#phi", FED), 85, 1, 86, 20, 1, 21);
1537  FEDsAndOccupancyHists_[FED] = OccupHist;
1538  FEDsAndOccupancyHists_[FED]->SetDirectory(nullptr);
1539 
1540  TH2F* timingHistVsPhi = new TH2F(Form("timeVsPhiFED_%d", FED),
1541  Form("time Vs Phi FED %d;Relative Time (1 clock = 25ns);i#phi", FED),
1542  78,
1543  -7,
1544  7,
1545  20,
1546  1,
1547  21);
1548  FEDsAndTimingVsPhiHists_[FED] = timingHistVsPhi;
1549  FEDsAndTimingVsPhiHists_[FED]->SetDirectory(nullptr);
1550 
1551  TH2F* timingHistVsModule = new TH2F(Form("timeVsModuleFED_%d", FED),
1552  Form("time Vs Module FED %d;Relative Time (1 clock = 25ns);i#eta", FED),
1553  78,
1554  -7,
1555  7,
1556  4,
1557  1,
1558  86);
1559  FEDsAndTimingVsModuleHists_[FED] = timingHistVsModule;
1560  FEDsAndTimingVsModuleHists_[FED]->SetDirectory(nullptr);
1561 
1562  TH2F* dccRuntypeVsBxFED =
1563  new TH2F(Form("DCCRuntypeVsBxFED_%d", FED), Form("DCC Runtype vs. BX FED %d", FED), 3600, 0, 3600, 24, 0, 24);
1564  FEDsAndDCCRuntypeVsBxHists_[FED] = dccRuntypeVsBxFED;
1565  FEDsAndDCCRuntypeVsBxHists_[FED]->SetDirectory(nullptr);
1566 }
1567 
1568 // ------------ method called once each job just before starting event loop ------------
1569 void EcalCosmicsHists::beginRun(edm::Run const&, edm::EventSetup const& eventSetup) {
1571  eventSetup.get<EcalMappingRcd>().get(handle);
1572  ecalElectronicsMap_ = handle.product();
1573 
1574  //Here I will init some of the specific histograms
1575  int numBins = 200; //(int)round(histRangeMax_-histRangeMin_)+1;
1576 
1577  //=============Special Bins for TT and Modules borders=============================
1578  double ttEtaBins[36] = {-85, -80, -75, -70, -65, -60, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0,
1579  1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86};
1580  double modEtaBins[10] = {-85, -65, -45, -25, 0, 1, 26, 46, 66, 86};
1581  double ttPhiBins[73];
1582  double modPhiBins[19];
1583  double timingBins[79];
1584  double highEBins[11];
1585  for (int i = 0; i < 79; ++i) {
1586  timingBins[i] = -7. + double(i) * 14. / 78.;
1587  if (i < 73) {
1588  ttPhiBins[i] = 1 + 5 * i;
1589  if (i < 19) {
1590  modPhiBins[i] = 1 + 20 * i;
1591  if (i < 11) {
1592  highEBins[i] = 10. + double(i) * 20.;
1593  }
1594  }
1595  }
1596  }
1597  //=============END Special Bins for TT and Modules borders===========================
1598 
1599  //====================Frequency for Event timing information=========================
1600  double timingEndInSeconds = runTimeLength_ * 3600.;
1601  double timingBinWidth = timingEndInSeconds / double(numTimingBins_);
1602  //====================END Frequency for Event timing information=====================
1603 
1605  new TH1F("energy_AllClusters", "energy_AllClusters;Cluster Energy (GeV)", numBins, histRangeMin_, histRangeMax_);
1607  new TH1F("energyHigh_AllClusters", "energyHigh_AllClusters;Cluster Energy (GeV)", numBins, histRangeMin_, 200.0);
1608  allFedsenergyOnlyHighHist_ = new TH1F("energyHigh_HighEnergyClusters",
1609  "energy of High Energy Clusters;Cluster Energy (GeV)",
1610  numBins,
1611  histRangeMin_,
1612  200.0);
1613  allFedsE2Hist_ = new TH1F(
1614  "E2_AllClusters", "E2_AllClusters;Seed+highest neighbor energy (GeV)", numBins, histRangeMin_, histRangeMax_);
1615  allFedsE2vsE1Hist_ = new TH2F("E2vsE1_AllClusters",
1616  "E2vsE1_AllClusters;Seed Energy (GeV);Seed+highest neighbor energy (GeV)",
1617  numBins,
1618  histRangeMin_,
1619  histRangeMax_,
1620  numBins,
1621  histRangeMin_,
1622  histRangeMax_);
1623  allFedsenergyvsE1Hist_ = new TH2F("energyvsE1_AllClusters",
1624  "energyvsE1_AllClusters;Seed Energy (GeV);Energy(GeV)",
1625  numBins,
1626  histRangeMin_,
1627  histRangeMax_,
1628  numBins,
1629  histRangeMin_,
1630  histRangeMax_);
1631  allFedsTimingHist_ = new TH1F("timeForAllFeds", "timeForAllFeds;Relative Time (1 clock = 25ns)", 78, -7, 7);
1632  allFedsTimingVsFreqHist_ = new TH2F("timeVsFreqAllEvent",
1633  "time Vs Freq All events;Relative Time (1 clock = 25ns);Event Number",
1634  78,
1635  -7,
1636  7,
1637  2000,
1638  0.,
1639  200000);
1640  allFedsTimingVsAmpHist_ = new TH2F("timeVsAmpAllEvents",
1641  "time Vs Amp All Events;Relative Time (1 clock = 25ns);Amplitude (GeV)",
1642  78,
1643  -7,
1644  7,
1645  numBins,
1646  histRangeMin_,
1647  histRangeMax_);
1648  allFedsFrequencyHist_ = new TH1F("FrequencyAllEvent", "Frequency for All events;Event Number", 2000, 0., 200000);
1649 
1650  //--------Special Hists for times stamp info----------------------------------------------
1651  allFedsFreqTimeHist_ = new TH1F("FrequencyAllEventsInTime",
1652  Form("Time of Cosmic Events; Time (s);Passing Event rate/%5g s", timingBinWidth),
1654  0.,
1655  timingEndInSeconds);
1657  new TH2F("FrequencyAllEventsInTimeVsPhi",
1658  Form("Time of Cosmic Events vs iPhi; iPhi;Time (s)/%5g s", timingBinWidth * 360.),
1659  360,
1660  1.,
1661  361.,
1662  numTimingBins_ / 360,
1663  0.,
1664  timingEndInSeconds);
1666  new TH2F("FrequencyAllEventsInTimeVsTTPhi",
1667  Form("Time of Cosmic Events vs iPhi (TT bins); iPhi;Time (s)/%5g s", timingBinWidth * 72.),
1668  72,
1669  1.,
1670  361.,
1671  numTimingBins_ / 72,
1672  0.,
1673  timingEndInSeconds);
1675  new TH2F("FrequencyAllEventsInTimeVsEta",
1676  Form("Time of Cosmic Events vs iEta; Time (s)/%5g s; iEta", timingBinWidth * 172.),
1677  numTimingBins_ / 172,
1678  0.,
1679  timingEndInSeconds,
1680  172,
1681  -86.,
1682  86.);
1684  new TH2F("FrequencyAllEventsInTimeVsTTEta",
1685  Form("Time of Cosmic Events vs Eta (TT bins);Time (s)/%5g s; iEta", timingBinWidth * 35.),
1686  numTimingBins_ / 35,
1687  0.,
1688  timingEndInSeconds,
1689  35,
1690  ttEtaBins);
1691  //--------END Special Hists for times stamp info------------------------------------------
1692 
1693  allFedsiPhiProfileHist_ = new TH1F("iPhiProfileAllEvents", "iPhi Profile all events;i#phi", 360, 1., 361.);
1694  allFedsiEtaProfileHist_ = new TH1F("iEtaProfileAllEvents", "iEta Profile all events;i#eta", 172, -86, 86);
1695 
1696  allOccupancy_ = new TH2F("OccupancyAllEvents", "Occupancy all events;i#phi;i#eta", 360, 1., 361., 172, -86, 86);
1697  TrueOccupancy_ =
1698  new TH2F("TrueOccupancyAllEvents", "True Occupancy all events;#phi;#eta", 360, -3.14159, 3.14159, 172, -1.5, 1.5);
1700  new TH2F("OccupancyAllEventsCoarse", "Occupancy all events Coarse;i#phi;i#eta", 360 / 5, 1, 361., 35, ttEtaBins);
1701  TrueOccupancyCoarse_ = new TH2F("TrueOccupancyAllEventsCoarse",
1702  "True Occupancy all events Coarse;#phi;#eta",
1703  360 / 5,
1704  -3.14159,
1705  3.14159,
1706  34,
1707  -1.5,
1708  1.5);
1709 
1710  // single xtal cluster occupancy
1712  new TH2F("OccupancySingleXtal", "Occupancy single xtal clusters;i#phi;i#eta", 360, 1., 361., 172, -86, 86);
1713  energySingleXtalHist_ = new TH1F(
1714  "energy_SingleXtalClusters", "Energy single xtal clusters;Cluster Energy (GeV)", numBins, histRangeMin_, 200.0);
1715 
1716  allFedsTimingPhiHist_ = new TH2F("timePhiAllFEDs",
1717  "time vs Phi for all FEDs (TT binning);i#phi;Relative Time (1 clock = 25ns)",
1718  72,
1719  1,
1720  361,
1721  78,
1722  -7,
1723  7);
1724  allFedsTimingPhiEbpHist_ = new TH2F("timePhiEBP",
1725  "time vs Phi for FEDs in EB+ (TT binning) ;i#phi;Relative Time (1 clock = 25ns)",
1726  72,
1727  1,
1728  361,
1729  78,
1730  -7,
1731  7);
1732  allFedsTimingPhiEbmHist_ = new TH2F("timePhiEBM",
1733  "time vs Phi for FEDs in EB- (TT binning);i#phi;Relative Time (1 clock = 25ns)",
1734  72,
1735  1,
1736  361,
1737  78,
1738  -7,
1739  7);
1741  new TH3F("timePhiEtaAllFEDs",
1742  "(Phi,Eta,time) for all FEDs (SM,M binning);i#phi;i#eta;Relative Time (1 clock = 25ns)",
1743  18,
1744  modPhiBins,
1745  9,
1746  modEtaBins,
1747  78,
1748  timingBins);
1750  new TH3F("timeTTAllFEDs",
1751  "(Phi,Eta,time) for all FEDs (SM,TT binning);i#phi;i#eta;Relative Time (1 clock = 25ns)",
1752  72,
1753  ttPhiBins,
1754  35,
1755  ttEtaBins,
1756  78,
1757  timingBins);
1758  allFedsTimingLMHist_ = new TH2F(
1759  "timeLMAllFEDs", "(LM,time) for all FEDs (SM,LM binning);LM;Relative Time (1 clock = 25ns)", 92, 1, 92, 78, -7, 7);
1760 
1761  allFedsTimingEbpHist_ = new TH1F("timeEBP", "time for FEDs in EB+;Relative Time (1 clock = 25ns)", 78, -7, 7);
1762  allFedsTimingEbmHist_ = new TH1F("timeEBM", "time for FEDs in EB-;Relative Time (1 clock = 25ns)", 78, -7, 7);
1764  new TH1F("timeEBPTop", "time for FEDs in EB+ Top;Relative Time (1 clock = 25ns)", 78, -7, 7);
1766  new TH1F("timeEBMTop", "time for FEDs in EB- Top;Relative Time (1 clock = 25ns)", 78, -7, 7);
1768  new TH1F("timeEBPBottom", "time for FEDs in EB+ Bottom;Relative Time (1 clock = 25ns)", 78, -7, 7);
1770  new TH1F("timeEBMBottom", "time for FEDs in EB- Bottom;Relative Time (1 clock = 25ns)", 78, -7, 7);
1771 
1773  new TH1F("numberofCosmicsPerEvent", "Number of cosmics per event;Number of Cosmics", 30, 0, 30);
1775  new TH1F("numberofCosmicsPerEvent_EB", "Number of cosmics per event EB;Number of Cosmics", 30, 0, 30);
1776 
1778  new TH1F("numberofCosmicsWTrackPerEvent", "Number of cosmics with track per event", 30, 0, 30);
1779  numberofCosmicsTopBottomHist_ = new TH1F(
1780  "numberofCosmicsTopBottomPerEvent", "Number of top bottom cosmics per event;Number of Cosmics", 30, 0, 30);
1781  numberofGoodEvtFreq_ = new TH1F("frequencyOfGoodEvents",
1782  "Number of events with cosmic vs Event;Event Number;Number of Good Events/100 Events",
1783  2000,
1784  0,
1785  200000);
1786 
1787  numberofCrossedEcalIdsHist_ = new TH1F("numberofCrossedEcalCosmicsPerEvent",
1788  "Number of crossed ECAL cosmics per event;Number of Crossed Cosmics",
1789  10,
1790  0,
1791  10);
1792 
1793  allOccupancyExclusiveECAL_ = new TH2F("OccupancyAllEvents_ExclusiveECAL",
1794  "Occupancy all events Exclusive ECAL ;i#phi;i#eta",
1795  360,
1796  1.,
1797  361.,
1798  172,
1799  -86,
1800  86);
1801  allOccupancyCoarseExclusiveECAL_ = new TH2F("OccupancyAllEventsCoarse_ExclusiveECAL",
1802  "Occupancy all events Coarse Exclusive ECAL;i#phi;i#eta",
1803  360 / 5,
1804  ttPhiBins,
1805  35,
1806  ttEtaBins);
1808  new TH2F("OccupancyAllEvents_ECAL", "Occupancy all events ECAL;i#phi;i#eta", 360, 1., 361., 172, -86, 86);
1809  allOccupancyCoarseECAL_ = new TH2F("OccupancyAllEventsCoarse_ECAL",
1810  "Occupancy all events Coarse ECAL;i#phi;i#eta",
1811  360 / 5,
1812  ttPhiBins,
1813  35,
1814  ttEtaBins);
1816  new TH1F("timeForAllFeds_ECAL", "timeForAllFeds ECAL;Relative Time (1 clock = 25ns)", 78, -7, 7);
1818  new TH3F("timePhiEtaAllFEDs_ECAL",
1819  "ECAL (Phi,Eta,time) for all FEDs (SM,M binning);i#phi;i#eta;Relative Time (1 clock = 25ns)",
1820  18,
1821  modPhiBins,
1822  9,
1823  modEtaBins,
1824  78,
1825  timingBins);
1827  new TH3F("timeTTAllFEDs_ECAL",
1828  "ECAL (Phi,Eta,time) for all FEDs (SM,TT binning);i#phi;i#eta;Relative Time (1 clock = 25ns)",
1829  72,
1830  ttPhiBins,
1831  35,
1832  ttEtaBins,
1833  78,
1834  timingBins);
1835  allFedsTimingLMHistECAL_ = new TH2F("timeLMAllFEDs_ECAL",
1836  "ECAL (LM,time) for all FEDs (SM,LM binning);LM;Relative Time (1 clock = 25ns)",
1837  92,
1838  1,
1839  92,
1840  78,
1841  -7,
1842  7);
1843 
1844  allOccupancyExclusiveDT_ = new TH2F(
1845  "OccupancyAllEvents_ExclusiveDT", "Occupancy all events Exclusive DT;i#phi;i#eta", 360, 1., 361., 172, -86, 86);
1846  allOccupancyCoarseExclusiveDT_ = new TH2F("OccupancyAllEventsCoarse_ExclusiveDT",
1847  "Occupancy all events Coarse Exclusive DT;i#phi;i#eta",
1848  360 / 5,
1849  1,
1850  361.,
1851  35,
1852  ttEtaBins);
1853  allOccupancyDT_ =
1854  new TH2F("OccupancyAllEvents_DT", "Occupancy all events DT;i#phi;i#eta", 360, 1., 361., 172, -86, 86);
1855  allOccupancyCoarseDT_ = new TH2F(
1856  "OccupancyAllEventsCoarse_DT", "Occupancy all events Coarse DT;i#phi;i#eta", 360 / 5, 1, 361., 35, ttEtaBins);
1857  allFedsTimingHistDT_ = new TH1F("timeForAllFeds_DT", "timeForAllFeds DT;Relative Time (1 clock = 25ns)", 78, -7, 7);
1859  new TH3F("timePhiEtaAllFEDs_DT",
1860  "DT (Phi,Eta,time) for all FEDs (SM,M binning);i#phi;i#eta;Relative Time (1 clock = 25ns)",
1861  18,
1862  modPhiBins,
1863  9,
1864  modEtaBins,
1865  78,
1866  timingBins);
1868  new TH3F("timeTTAllFEDs_DT",
1869  "DT (Phi,Eta,time) for all FEDs (SM,TT binning);i#phi;i#eta;Relative Time (1 clock = 25ns)",
1870  72,
1871  ttPhiBins,
1872  35,
1873  ttEtaBins,
1874  78,
1875  timingBins);
1876  allFedsTimingLMHistDT_ = new TH2F("timeLMAllFEDs_DT",
1877  "DT (LM,time) for all FEDs (SM,LM binning);LM;Relative Time (1 clock = 25ns)",
1878  92,
1879  1,
1880  92,
1881  78,
1882  -7,
1883  7);
1884 
1885  allOccupancyExclusiveRPC_ = new TH2F(
1886  "OccupancyAllEvents_ExclusiveRPC", "Occupancy all events Exclusive RPC;i#phi;i#eta", 360, 1., 361., 172, -86, 86);
1887  allOccupancyCoarseExclusiveRPC_ = new TH2F("OccupancyAllEventsCoarse_ExclusiveRPC",
1888  "Occupancy all events Coarse Exclusive RPC;i#phi;i#eta",
1889  360 / 5,
1890  1,
1891  361.,
1892  35,
1893  ttEtaBins);
1895  new TH2F("OccupancyAllEvents_RPC", "Occupancy all events RPC;i#phi;i#eta", 360, 1., 361., 172, -86, 86);
1896  allOccupancyCoarseRPC_ = new TH2F(
1897  "OccupancyAllEventsCoarse_RPC", "Occupancy all events Coarse RPC;i#phi;i#eta", 360 / 5, 1, 361., 35, ttEtaBins);
1899  new TH1F("timeForAllFeds_RPC", "timeForAllFeds RPC;Relative Time (1 clock = 25ns)", 78, -7, 7);
1901  new TH3F("timePhiEtaAllFEDs_RPC",
1902  "RPC (Phi,Eta,time) for all FEDs (SM,M binning);i#phi;i#eta;Relative Time (1 clock = 25ns)",
1903  18,
1904  modPhiBins,
1905  9,
1906  modEtaBins,
1907  78,
1908  timingBins);
1910  new TH3F("timeTTAllFEDs_RPC",
1911  "RPC (Phi,Eta,time) for all FEDs (SM,TT binning);i#phi;i#eta;Relative Time (1 clock = 25ns)",
1912  72,
1913  ttPhiBins,
1914  35,
1915  ttEtaBins,
1916  78,
1917  timingBins);
1918  allFedsTimingLMHistRPC_ = new TH2F("timeLMAllFEDs_RPC",
1919  "RPC (LM,time) for all FEDs (SM,LM binning);LM;Relative Time (1 clock = 25ns)",
1920  92,
1921  1,
1922  92,
1923  78,
1924  -7,
1925  7);
1926 
1927  allOccupancyExclusiveCSC_ = new TH2F(
1928  "OccupancyAllEvents_ExclusiveCSC", "Occupancy all events Exclusive CSC;i#phi;i#eta", 360, 1., 361., 172, -86, 86);
1929  allOccupancyCoarseExclusiveCSC_ = new TH2F("OccupancyAllEventsCoarse_ExclusiveCSC",
1930  "Occupancy all events Coarse Exclusive CSC;i#phi;i#eta",
1931  360 / 5,
1932  1,
1933  361.,
1934  35,
1935  ttEtaBins);
1937  new TH2F("OccupancyAllEvents_CSC", "Occupancy all events CSC;i#phi;i#eta", 360, 1., 361., 172, -86, 86);
1938  allOccupancyCoarseCSC_ = new TH2F(
1939  "OccupancyAllEventsCoarse_CSC", "Occupancy all events Coarse CSC;i#phi;i#eta", 360 / 5, 1, 361., 35, ttEtaBins);
1941  new TH1F("timeForAllFeds_CSC", "timeForAllFeds CSC;Relative Time (1 clock = 25ns)", 78, -7, 7);
1943  new TH3F("timePhiEtaAllFEDs_CSC",
1944  "CSC (Phi,Eta,time) for all FEDs (SM,M binning);i#phi;i#eta;Relative Time (1 clock = 25ns)",
1945  18,
1946  modPhiBins,
1947  9,
1948  modEtaBins,
1949  78,
1950  timingBins);
1952  new TH3F("timeTTAllFEDs_CSC",
1953  "CSC (Phi,Eta,time) for all FEDs (SM,TT binning);i#phi;i#eta;Relative Time (1 clock = 25ns)",
1954  72,
1955  ttPhiBins,
1956  35,
1957  ttEtaBins,
1958  78,
1959  timingBins);
1960  allFedsTimingLMHistCSC_ = new TH2F("timeLMAllFEDs_CSC",
1961  "CSC (LM,time) for all FEDs (SM,LM binning);LM;Relative Time (1 clock = 25ns)",
1962  92,
1963  1,
1964  62,
1965  78,
1966  -7,
1967  7);
1968 
1969  allOccupancyExclusiveHCAL_ = new TH2F("OccupancyAllEvents_ExclusiveHCAL",
1970  "Occupancy all events Exclusive HCAL;i#phi;i#eta",
1971  360,
1972  1.,
1973  361.,
1974  172,
1975  -86,
1976  86);
1977  allOccupancyCoarseExclusiveHCAL_ = new TH2F("OccupancyAllEventsCoarse_ExclusiveHCAL",
1978  "Occupancy all events Coarse Exclusive HCAL;i#phi;i#eta",
1979  360 / 5,
1980  1,
1981  361.,
1982  35,
1983  ttEtaBins);
1985  new TH2F("OccupancyAllEvents_HCAL", "Occupancy all events HCAL;i#phi;i#eta", 360, 1., 361., 172, -86, 86);
1986  allOccupancyCoarseHCAL_ = new TH2F(
1987  "OccupancyAllEventsCoarse_HCAL", "Occupancy all events Coarse HCAL;i#phi;i#eta", 360 / 5, 1, 361., 35, ttEtaBins);
1989  new TH1F("timeForAllFeds_HCAL", "timeForAllFeds HCAL;Relative Time (1 clock = 25ns)", 78, -7, 7);
1991  new TH3F("timePhiEtaAllFEDs_HCAL",
1992  "HCAL (Phi,Eta,time) for all FEDs (SM,M binning);i#phi;i#eta;Relative Time (1 clock = 25ns)",
1993  18,
1994  modPhiBins,
1995  9,
1996  modEtaBins,
1997  78,
1998  timingBins);
2000  new TH3F("timeTTAllFEDs_HCAL",
2001  "HCAL (Phi,Eta,time) for all FEDs (SM,TT binning);i#phi;i#eta;Relative Time (1 clock = 25ns)",
2002  72,
2003  ttPhiBins,
2004  35,
2005  ttEtaBins,
2006  78,
2007  timingBins);
2008  allFedsTimingLMHistHCAL_ = new TH2F("timeLMAllFEDs_HCAL",
2009  "HCAL (LM,time) for all FEDs (SM,LM binning);LM;Relative Time (1 clock = 25ns)",
2010  92,
2011  1,
2012  92,
2013  78,
2014  -7,
2015  7);
2016 
2017  TrueBCOccupancy_ = new TH2F(
2018  "BCTrueOccupancyAllEvents", "True SB Occupancy all events;#phi;#eta", 360, -3.14159, 3.14159, 172, -1.5, 1.5);
2019  TrueBCOccupancyCoarse_ = new TH2F("BCTrueOccupancyAllEventsCoarse",
2020  "True BC Occupancy all events Coarse;#phi;#eta",
2021  360 / 5,
2022  -3.14159,
2023  3.14159,
2024  34,
2025  -1.5,
2026  1.5);
2027 
2028  numberofBCinSC_ =
2029  new TH1F("numberofBCinSC", "Number of Basic Clusters in Super Cluster;Num Basic Clusters", 20, 0, 20); //SC
2030  numberofBCinSCphi_ = new TH2F("numberofBCinSCphi",
2031  "Number of Basic Clusters in Super Cluster;phi;Num Basic Clusters",
2032  360 / 5,
2033  -3.14159,
2034  3.14159,
2035  20,
2036  0,
2037  20); //SC
2038 
2040  new TH1F("timeForAllFeds_EcalMuon", "timeForAllFeds Ecal+Muon;Relative Time (1 clock = 25ns)", 78, -7, 7);
2041 
2042  triggerHist_ = new TH1F("triggerHist", "Trigger Number", 5, 0, 5);
2043  triggerHist_->GetXaxis()->SetBinLabel(1, "ECAL");
2044  triggerHist_->GetXaxis()->SetBinLabel(2, "HCAL");
2045  triggerHist_->GetXaxis()->SetBinLabel(3, "DT");
2046  triggerHist_->GetXaxis()->SetBinLabel(4, "RPC");
2047  triggerHist_->GetXaxis()->SetBinLabel(5, "CSC");
2048 
2049  triggerExclusiveHist_ = new TH1F("triggerExclusiveHist", "Trigger Number (Mutually Exclusive)", 5, 0, 5);
2050  triggerExclusiveHist_->GetXaxis()->SetBinLabel(1, "ECAL");
2051  triggerExclusiveHist_->GetXaxis()->SetBinLabel(2, "HCAL");
2052  triggerExclusiveHist_->GetXaxis()->SetBinLabel(3, "DT");
2053  triggerExclusiveHist_->GetXaxis()->SetBinLabel(4, "RPC");
2054  triggerExclusiveHist_->GetXaxis()->SetBinLabel(5, "CSC");
2055 
2056  runNumberHist_ = new TH1F("runNumberHist", "Run Number", 1, 0, 1);
2057 
2058  deltaRHist_ = new TH1F("deltaRHist", "deltaR", 500, -0.5, 499.5);
2059  deltaEtaHist_ = new TH1F("deltaIEtaHist", "deltaIEta", 170, -85.5, 84.5);
2060  deltaPhiHist_ = new TH1F("deltaIPhiHist", "deltaIPhi", 720, -360.5, 359.5);
2061  ratioAssocTracksHist_ = new TH1F("ratioAssocTracks", "num assoc. tracks/tracks through Ecal", 11, 0, 1.1);
2062  ratioAssocClustersHist_ = new TH1F("ratioAssocClusters", "num assoc. clusters/total clusters", 11, 0, 1.1);
2063  trackAssoc_muonsEcal_ = new TH2F(
2064  "trackAssoc_muonsEcal", "Map of muon hits in Ecal", 360, 1., 361., 172, -86, 86); //360, 0 , 360, 170,-85 ,85);
2066  new TH2F("deltaEtaDeltaPhi", "Delta ieta vs. delta iphi", 170, -85.5, 84.5, 720, -360.5, 359.5);
2067  seedTrackEtaHist_ = new TH2F("seedTrackEta", "track ieta vs. seed ieta", 170, -85.5, 84.5, 170, -85.5, 84.5);
2068  seedTrackPhiHist_ = new TH2F("seedTrackPhi", "track iphi vs. seed iphi", 720, -360.5, 359.5, 720, -360.5, 359.5);
2069 
2070  dccEventVsBxHist_ = new TH2F("dccEventVsBx", "DCC Runtype vs. bunch crossing", 3600, 0, 3600, 24, 0, 24);
2071  dccBXErrorByFEDHist_ = new TH1F("dccBXErrorByFED", "Incorrect BX number by FED", 54, 601, 655);
2072  dccOrbitErrorByFEDHist_ = new TH1F("dccOrbitErrorByFED", "Incorrect orbit number by FED", 54, 601, 655);
2073  dccRuntypeErrorByFEDHist_ = new TH1F("dccRuntypeErrorByFED", "Incorrect DCC Runtype by FED", 54, 601, 655);
2074  dccRuntypeHist_ = new TH1F("dccRuntype", "DCC Runtype frequency", 24, 0, 24);
2075  dccErrorVsBxHist_ = new TH2F("dccErrorVsBX", "DCC Errors vs. BX", 3600, 0, 3600, 3, 0, 3);
2076 
2077  hcalEnergy_HBHE_ = new TH1F("hcalEnergy_HBHE", "RecHit Energy HBHE", 440, -10, 100);
2078  hcalEnergy_HF_ = new TH1F("hcalEnergy_HF", "RecHit Energy HF", 440, -10, 100);
2079  hcalEnergy_HO_ = new TH1F("hcalEnergy_HO", "RecHit Energy HO", 440, -10, 100);
2080  hcalHEHBecalEB_ =
2081  new TH2F("hcalHEHBecalEB", "HCAL HBHE RecHit energy vs ECAL EB energy", numBins, histRangeMin_, 300.0, 40, -5, 5);
2082 
2083  NumXtalsInClusterHist_ = new TH1F("NumXtalsInClusterAllHist", "Number of Xtals in Cluster;NumXtals", 150, 0, 150);
2084  numxtalsVsEnergy_ = new TH2F("NumXtalsVsEnergy",
2085  "Number of Xtals in Cluster vs Energy;Energy (GeV);Number of Xtals in Cluster",
2086  numBins,
2087  histRangeMin_,
2088  histRangeMax_,
2089  150,
2090  0,
2091  150);
2092  numxtalsVsHighEnergy_ = new TH2F("NumXtalsVsHighEnergy",
2093  "Number of Xtals in Cluster vs Energy;Energy (GeV);Number of Xtals in Cluster",
2094  numBins,
2095  histRangeMin_,
2096  200.,
2097  150,
2098  0,
2099  150);
2100 
2101  // high energy analysis
2103  new TH2F("OccupancyHighEnergyEvents", "Occupancy high energy events;i#phi;i#eta", 360, 1., 361., 172, -86, 86);
2104  allOccupancyHighEnergyCoarse_ = new TH2F("OccupancyHighEnergyEventsCoarse",
2105  "Occupancy high energy events Coarse;i#phi;i#eta",
2106  72,
2107  ttPhiBins,
2108  35,
2109  ttEtaBins);
2110  allFedsOccupancyHighEnergyHist_ = new TH3F("OccupancyHighEnergyEvents3D",
2111  "(Phi,Eta,energy) for all high energy events;i#phi;i#eta;energy (GeV)",
2112  18,
2113  modPhiBins,
2114  9,
2115  modEtaBins,
2116  10,
2117  highEBins);
2119  new TH1F("NumActiveXtalsInClusterAllHist", "Number of active Xtals in Cluster;NumXtals", 100, 0, 100);
2120 
2121  HighEnergy_NumXtal = new TH1F("HighEnergy_NumXtal", "Num crystals in high E clusters;num crystals", 150, 0, 150);
2122  HighEnergy_NumXtalFedId = new TH2F(
2123  "HighEnergy_NumXtalFedId", "Num crystals in cluster vs FedId;FedId;num crystals", 36, 610., 645., 150, 0, 150);
2124  HighEnergy_NumXtaliphi = new TH2F(
2125  "HighEnergy_NumXtaliphi", "Num crystals in cluster vs iphi;i#phi;num crystals", 360, 1., 361., 150, 0, 150);
2126  HighEnergy_energy3D = new TH3F("HighEnergy_energy3D",
2127  "(Phi,Eta,energy) for all high energy events;i#phi;i#eta;energy (GeV)",
2128  72,
2129  ttPhiBins,
2130  35,
2131  ttEtaBins,
2132  10,
2133  highEBins);
2134 
2135  HighEnergy_energyNumXtal = new TH2F("HighEnergy_energyNumXtal",
2136  "Energy in cluster vs Num crystals in cluster;num crystals;energy",
2137  150,
2138  0,
2139  150,
2140  200,
2141  0.,
2142  200.);
2143 
2144  HighEnergy_bestSeed = new TH1F("HighEnergy_bestSeedEnergy", "BestSeed Energy from TrackAss", 200, 0., 200.);
2145  HighEnergy_bestSeedOccupancy = new TH2F(
2146  "HighEnergy_bestSeedOccupancy", "Occupancy HighEn events from TrackAss;i#phi;i#eta", 360, 1., 361., 172, -86, 86);
2147 
2148  HighEnergy_numClusHighEn = new TH1F("HighEnergy_numClusHighEn", "Num High Energy Clusters", 7, 0, 7);
2150  new TH1F("HighEnergy_ratioClusters", "Num High Energy Clusters/Num tot Clusters", 100, 0., 1.1);
2151 
2152  HighEnergy_numRecoTrackBarrel = new TH1F("HighEnergy_numRecoTracksBarrel", "Num BarrelRecoTracks", 10, 0, 10);
2153  HighEnergy_TracksAngle = new TH1F("HighEnergy_TracksAngle", "Angle between tracks", 720, 0., 180.);
2155  new TH1F("HighEnergy_TopBottomTracksAngle", "Angle between top-bottom tracks", 720, 0., 180.);
2156 
2157  HighEnergy_2GeV_occuCoarse = new TH2F("HighEnergy_occu2GeV_Coarse",
2158  "Occupancy high energy events with more than 2 GeV;i#phi;i#eta",
2159  72,
2160  ttPhiBins,
2161  35,
2162  ttEtaBins);
2163  HighEnergy_2GeV_occu3D = new TH3F("HighEnergy_2GeV_energy3D",
2164  "(iphi,ieta,energy) for all high energy events w > 10 GeV;i#phi;i#eta;energy (GeV)",
2165  72,
2166  ttPhiBins,
2167  35,
2168  ttEtaBins,
2169  10,
2170  highEBins);
2171  HighEnergy_100GeV_occuCoarse = new TH2F("HighEnergy_occu100GeV_Coarse",
2172  "Occupancy high energy events with more than 100 GeV;i#phi;i#eta",
2173  72,
2174  ttPhiBins,
2175  35,
2176  ttEtaBins);
2178  new TH3F("HighEnergy_100GeV_energy3D",
2179  "(iphi,ieta,energy) for all high energy events more than 100 GeV;i#phi;i#eta;energy (GeV)",
2180  72,
2181  ttPhiBins,
2182  35,
2183  ttEtaBins,
2184  10,
2185  highEBins);
2186  HighEnergy_0tracks_occu3D = new TH3F("HighEnergy_0Tracks_energy3D",
2187  "(iphi,ieta,energy) for all events with 0 tracks;i#phi;i#eta;energy (GeV)",
2188  72,
2189  ttPhiBins,
2190  35,
2191  ttEtaBins,
2192  10,
2193  highEBins);
2194  HighEnergy_1tracks_occu3D = new TH3F("HighEnergy_1Tracks_energy3D",
2195  "(iphi,ieta,energy) for all events with 1 tracks;i#phi;i#eta;energy (GeV)",
2196  72,
2197  ttPhiBins,
2198  35,
2199  ttEtaBins,
2200  10,
2201  highEBins);
2202  HighEnergy_2tracks_occu3D = new TH3F("HighEnergy_2Tracks_energy3D",
2203  "(iphi,ieta,energy) for all events with 2 tracks;i#phi;i#eta;energy (GeV)",
2204  72,
2205  ttPhiBins,
2206  35,
2207  ttEtaBins,
2208  10,
2209  highEBins);
2210  HighEnergy_0tracks_occu3DXtal = new TH3F("HighEnergy_0Tracks_energy3DXtal",
2211  "(iphi,ieta,energy) for all events with 0 tracks;i#phi;i#eta;energy (GeV)",
2212  360,
2213  1.,
2214  361.,
2215  172,
2216  -86,
2217  86,
2218  200,
2219  0.,
2220  200.);
2221  HighEnergy_1tracks_occu3DXtal = new TH3F("HighEnergy_1Tracks_energy3DXtal",
2222  "(iphi,ieta,energy) for all events with 1 tracks;i#phi;i#eta;energy (GeV)",
2223  360,
2224  1.,
2225  361.,
2226  172,
2227  -86,
2228  86,
2229  200,
2230  0.,
2231  200.);
2232  HighEnergy_2tracks_occu3DXtal = new TH3F("HighEnergy_2Tracks_energy3DXtal",
2233  "(iphi,ieta,energy) for all events with 2 tracks;i#phi;i#eta;energy (GeV)",
2234  360,
2235  1.,
2236  361.,
2237  172,
2238  -86,
2239  86,
2240  200,
2241  0.,
2242  200.);
2243 
2244  //EE histograms
2245 
2246  // EE-
2248  new TH1F("SeedEnergyAllFEDs", "Seed Energy for EEM Feds; Seed Energy (GeV)", 200, histRangeMin_, 10.0);
2249 
2251  new TH2F("OccupancyAllEventsCoarse", "Occupancy all events Coarse EEM;ix;iy", 20, 0, 100, 20, 0, 100);
2252  EEM_AllOccupancy_ = new TH2F("OccupancyAllEvents", "Occupancy all events EEM;ix;iy", 100, 0, 100, 100, 0, 100);
2254  new TH1F("energy_AllClusters", "energy_AllClusters_EEM;Cluster Energy (GeV)", numBins, histRangeMin_, 10.0);
2255  EEM_FedsenergyHighHist_ = new TH1F(
2256  "energyHigh_AllClusters", "energyHigh_AllClusters in EEM;Cluster Energy (GeV)", numBins, histRangeMin_, 200.0);
2257  EEM_FedsenergyOnlyHighHist_ = new TH1F("energyHigh_HighEnergyClusters",
2258  "energy of High Energy Clusters in EEM;Cluster Energy (GeV)",
2259  numBins,
2260  histRangeMin_,
2261  200.0);
2262  EEM_FedsE2Hist_ =
2263  new TH1F("E2_AllClusters", "E2_AllClusters_EEM;Seed+highest neighbor energy (GeV)", numBins, histRangeMin_, 10.0);
2264  EEM_FedsE2vsE1Hist_ = new TH2F("E2vsE1_AllClusters",
2265  "E2vsE1_AllClusters_EEM;Seed Energy (GeV);Seed+highest neighbor energy (GeV)",
2266  numBins,
2267  histRangeMin_,
2268  10.0,
2269  numBins,
2270  histRangeMin_,
2271  10.0);
2272  EEM_FedsenergyvsE1Hist_ = new TH2F("energyvsE1_AllClusters",
2273  "energyvsE1_AllClusters_EEM;Seed Energy (GeV);Energy(GeV)",
2274  numBins,
2275  histRangeMin_,
2276  10.0,
2277  numBins,
2278  histRangeMin_,
2279  10.0);
2280  EEM_FedsTimingHist_ = new TH1F("timeForAllFeds", "timeForAllFeds_EEM;Relative Time (1 clock = 25ns)", 78, -7, 7);
2282  new TH1F("numberofCosmicsPerEvent", "Number of cosmics per event EEM;Number of Cosmics", 30, 0, 30);
2283 
2284  EEM_FedsTimingVsAmpHist_ = new TH2F("timeVsAmpAllEvents",
2285  "time Vs Amp All Events EEM;Relative Time (1 clock = 25ns);Amplitude (GeV)",
2286  78,
2287  -7,
2288  7,
2289  numBins,
2290  histRangeMin_,
2291  10.0);
2292  EEM_FedsTimingTTHist_ = new TH3F("timeTTAllFEDs",
2293  "(ix,iy,time) for all FEDs (SM,TT binning) EEM;ix;iy;Relative Time (1 clock = 25ns)",
2294  20,
2295  0,
2296  100,
2297  20,
2298  0,
2299  100,
2300  78,
2301  -7,
2302  7);
2303 
2305  new TH2F("OccupancySingleXtal", "Occupancy single xtal clusters EEM;ix;iy", 100, 0, 100, 100, 0, 100);
2306  EEM_energySingleXtalHist_ = new TH1F("energy_SingleXtalClusters",
2307  "Energy single xtal clusters EEM;Cluster Energy (GeV)",
2308  numBins,
2309  histRangeMin_,
2310  200.0);
2311 
2312  EEM_OccupancyExclusiveECAL_ = new TH2F(
2313  "OccupancyAllEvents_ExclusiveECAL", "Occupancy all events Exclusive ECAL EEM;ix;iy", 100, 0, 100, 100, 0, 100);
2314  EEM_OccupancyCoarseExclusiveECAL_ = new TH2F("OccupancyAllEventsCoarse_ExclusiveECAL",
2315  "Occupancy all events Coarse Exclusive ECAL EEM;ix;iy",
2316  20,
2317  0,
2318  100,
2319  20,
2320  0,
2321  100);
2323  new TH2F("OccupancyAllEvents_ECAL", "Occupancy all events ECAL EEM;ix;iy", 100, 0, 100, 100, 0, 100);
2325  new TH2F("OccupancyAllEventsCoarse_ECAL", "Occupancy all events Coarse ECAL EEM;ix;iy", 20, 0, 100, 20, 0, 100);
2327  new TH1F("timeForAllFeds_ECAL", "timeForAllFeds ECAL EEM;Relative Time (1 clock = 25ns)", 78, -7, 7);
2329  new TH3F("timeTTAllFEDs_ECAL",
2330  "(ix,iy,time) for all FEDs (SM,TT binning) ECAL EEM;ix;iy;Relative Time (1 clock = 25ns)",
2331  20,
2332  0,
2333  100,
2334  20,
2335  0,
2336  100,
2337  78,
2338  -7,
2339  7);
2340 
2341  EEM_OccupancyExclusiveDT_ = new TH2F(
2342  "OccupancyAllEvents_ExclusiveDT", "Occupancy all events Exclusive DT EEM;ix;iy", 100, 0, 100, 100, 0, 100);
2343  EEM_OccupancyCoarseExclusiveDT_ = new TH2F("OccupancyAllEventsCoarse_ExclusiveDT",
2344  "Occupancy all events Coarse Exclusive DT EEM;ix;iy",
2345  20,
2346  0,
2347  100,
2348  20,
2349  0,
2350  100);
2351  EEM_OccupancyDT_ = new TH2F("OccupancyAllEvents_DT", "Occupancy all events DT EEM;ix;iy", 100, 0, 100, 100, 0, 100);
2353  new TH2F("OccupancyAllEventsCoarse_DT", "Occupancy all events Coarse DT EEM;ix;iy", 20, 0, 100, 20, 0, 100);
2355  new TH1F("timeForAllFeds_DT", "timeForAllFeds DT EEM;Relative Time (1 clock = 25ns)", 78, -7, 7);
2357  new TH3F("timeTTAllFEDs_DT",
2358  "(ix,iy,time) for all FEDs (SM,TT binning) DT EEM;ix;iy;Relative Time (1 clock = 25ns)",
2359  20,
2360  0,
2361  100,
2362  20,
2363  0,
2364  100,
2365  78,
2366  -7,
2367  7);
2368 
2369  EEM_OccupancyExclusiveRPC_ = new TH2F(
2370  "OccupancyAllEvents_ExclusiveRPC", "Occupancy all events Exclusive RPC EEM;ix;iy", 100, 0, 100, 100, 0, 100);
2371  EEM_OccupancyCoarseExclusiveRPC_ = new TH2F("OccupancyAllEventsCoarse_ExclusiveRPC",
2372  "Occupancy all events Coarse Exclusive RPC EEM;ix;iy",
2373  20,
2374  0,
2375  100,
2376  20,
2377  0,
2378  100);
2380  new TH2F("OccupancyAllEvents_RPC", "Occupancy all events RPC EEM;ix;iy", 100, 0, 100, 100, 0, 100);
2382  new TH2F("OccupancyAllEventsCoarse_RPC", "Occupancy all events Coarse RPC EEM;ix;iy", 20, 0, 100, 20, 0, 100);
2384  new TH1F("timeForAllFeds_RPC", "timeForAllFeds RPC EEM;Relative Time (1 clock = 25ns)", 78, -7, 7);
2386  new TH3F("timeTTAllFEDs_RPC",
2387  "(ix,iy,time) for all FEDs (SM,TT binning) RPC EEM;ix;iy;Relative Time (1 clock = 25ns)",
2388  20,
2389  0,
2390  100,
2391  20,
2392  0,
2393  100,
2394  78,
2395  -7,
2396  7);
2397 
2398  EEM_OccupancyExclusiveCSC_ = new TH2F(
2399  "OccupancyAllEvents_ExclusiveCSC", "Occupancy all events Exclusive CSC EEM;ix;iy", 100, 0, 100, 100, 0, 100);
2400  EEM_OccupancyCoarseExclusiveCSC_ = new TH2F("OccupancyAllEventsCoarse_ExclusiveCSC",
2401  "Occupancy all events Coarse Exclusive CSC EEM;ix;iy",
2402  20,
2403  0,
2404  100,
2405  20,
2406  0,
2407  100);
2409  new TH2F("OccupancyAllEvents_CSC", "Occupancy all events CSC EEM;ix;iy", 100, 0, 100, 100, 0, 100);
2411  new TH2F("OccupancyAllEventsCoarse_CSC", "Occupancy all events Coarse CSC EEM;ix;iy", 20, 0, 100, 20, 0, 100);
2413  new TH1F("timeForAllFeds_CSC", "timeForAllFeds CSC EEM;Relative Time (1 clock = 25ns)", 78, -7, 7);
2415  new TH3F("timeTTAllFEDs_CSC",
2416  "(ix,iy,time) for all FEDs (SM,TT binning) CSC EEM;ix;iy;Relative Time (1 clock = 25ns)",
2417  20,
2418  0,
2419  100,
2420  20,
2421  0,
2422  100,
2423  78,
2424  -7,
2425  7);
2426 
2427  EEM_OccupancyExclusiveHCAL_ = new TH2F(
2428  "OccupancyAllEvents_ExclusiveHCAL", "Occupancy all events Exclusive HCAL EEM;ix;iy", 100, 0, 100, 100, 0, 100);
2429  EEM_OccupancyCoarseExclusiveHCAL_ = new TH2F("OccupancyAllEventsCoarse_ExclusiveHCAL",
2430  "Occupancy all events Coarse Exclusive HCAL EEM;ix;iy",
2431  20,
2432  0,
2433  100,
2434  20,
2435  0,
2436  100);
2438  new TH2F("OccupancyAllEvents_HCAL", "Occupancy all events HCAL EEM;ix;iy", 100, 0, 100, 100, 0, 100);
2440  new TH2F("OccupancyAllEventsCoarse_HCAL", "Occupancy all events Coarse HCAL EEM;ix;iy", 20, 0, 100, 20, 0, 100);
2442  new TH1F("timeForAllFeds_HCAL", "timeForAllFeds HCAL EEM;Relative Time (1 clock = 25ns)", 78, -7, 7);
2444  new TH3F("timeTTAllFEDs_HCAL",
2445  "(ix,iy,time) for all FEDs (SM,TT binning) HCAL EEM;ix;iy;Relative Time (1 clock = 25ns)",
2446  20,
2447  0,
2448  100,
2449  20,
2450  0,
2451  100,
2452  78,
2453  -7,
2454  7);
2455 
2457  new TH1F("numberofBCinSC", "Number of Basic Clusters in Super Cluster EEM;Num Basic Clusters", 20, 0, 20);
2458 
2459  EEM_triggerHist_ = new TH1F("triggerHist", "Trigger Number EEM", 5, 0, 5);
2460  EEM_triggerHist_->GetXaxis()->SetBinLabel(1, "ECAL");
2461  EEM_triggerHist_->GetXaxis()->SetBinLabel(2, "HCAL");
2462  EEM_triggerHist_->GetXaxis()->SetBinLabel(3, "DT");
2463  EEM_triggerHist_->GetXaxis()->SetBinLabel(4, "RPC");
2464  EEM_triggerHist_->GetXaxis()->SetBinLabel(5, "CSC");
2465 
2466  EEM_triggerExclusiveHist_ = new TH1F("triggerExclusiveHist", "Trigger Number (Mutually Exclusive) EEM", 5, 0, 5);
2467  triggerExclusiveHist_->GetXaxis()->SetBinLabel(1, "ECAL");
2468  EEM_triggerExclusiveHist_->GetXaxis()->SetBinLabel(2, "HCAL");
2469  EEM_triggerExclusiveHist_->GetXaxis()->SetBinLabel(3, "DT");
2470  EEM_triggerExclusiveHist_->GetXaxis()->SetBinLabel(4, "RPC");
2471  EEM_triggerExclusiveHist_->GetXaxis()->SetBinLabel(5, "CSC");
2472 
2474  new TH1F("NumXtalsInClusterAllHist", "Number of Xtals in Cluster EEM;NumXtals", 150, 0, 150);
2475  EEM_numxtalsVsEnergy_ = new TH2F("NumXtalsVsEnergy",
2476  "Number of Xtals in Cluster vs Energy EEM;Energy (GeV);Number of Xtals in Cluster",
2477  numBins,
2478  histRangeMin_,
2479  10.0,
2480  150,
2481  0,
2482  150);
2484  new TH2F("NumXtalsVsHighEnergy",
2485  "Number of Xtals in Cluster vs Energy EEM;Energy (GeV);Number of Xtals in Cluster",
2486  numBins,
2487  histRangeMin_,
2488  200.,
2489  150,
2490  0,
2491  150);
2492 
2494  new TH2F("OccupancyHighEnergyEvents", "Occupancy high energy events EEM;ix;iy", 100, 0, 100, 100, 0, 100);
2495  EEM_OccupancyHighEnergyCoarse_ = new TH2F(
2496  "OccupancyHighEnergyEventsCoarse", "Occupancy high energy events Coarse EEM;ix;iy", 20, 0, 100, 20, 0, 100);
2497 
2499  new TH1F("NumActiveXtalsInClusterAllHist", "Number of active Xtals in Cluster EEM;NumXtals", 100, 0, 100);
2500 
2501  // EE+
2503  new TH1F("SeedEnergyAllFEDs", "Seed Energy for EEP Feds; Seed Energy (GeV)", 200, histRangeMin_, 10.0);
2504 
2506  new TH2F("OccupancyAllEventsCoarse", "Occupancy all events Coarse EEP;ix;iy", 20, 0, 100, 20, 0, 100);
2507  EEP_AllOccupancy_ = new TH2F("OccupancyAllEvents", "Occupancy all events EEP;ix;iy", 100, 0, 100, 100, 0, 100);
2509  new TH1F("energy_AllClusters", "energy_AllClusters_EEP;Cluster Energy (GeV)", numBins, histRangeMin_, 10.0);
2510  EEP_FedsenergyHighHist_ = new TH1F(
2511  "energyHigh_AllClusters", "energyHigh_AllClusters in EEP;Cluster Energy (GeV)", numBins, histRangeMin_, 200.0);
2512  EEP_FedsenergyOnlyHighHist_ = new TH1F("energyHigh_HighEnergyClusters",
2513  "energy of High Energy Clusters in EEP;Cluster Energy (GeV)",
2514  numBins,
2515  histRangeMin_,
2516  200.0);
2517  EEP_FedsE2Hist_ =
2518  new TH1F("E2_AllClusters", "E2_AllClusters_EEP;Seed+highest neighbor energy (GeV)", numBins, histRangeMin_, 10.0);
2519  EEP_FedsE2vsE1Hist_ = new TH2F("E2vsE1_AllClusters",
2520  "E2vsE1_AllClusters_EEP;Seed Energy (GeV);Seed+highest neighbor energy (GeV)",
2521  numBins,
2522  histRangeMin_,
2523  10.0,
2524  numBins,
2525  histRangeMin_,
2526  10.0);
2527  EEP_FedsenergyvsE1Hist_ = new TH2F("energyvsE1_AllClusters",
2528  "energyvsE1_AllClusters_EEP;Seed Energy (GeV);Energy(GeV)",
2529  numBins,
2530  histRangeMin_,
2531  10.0,
2532  numBins,
2533  histRangeMin_,
2534  10.0);
2535  EEP_FedsTimingHist_ = new TH1F("timeForAllFeds", "timeForAllFeds_EEP;Relative Time (1 clock = 25ns)", 78, -7, 7);
2537  new TH1F("numberofCosmicsPerEvent", "Number of cosmics per event EEP;Number of Cosmics", 30, 0, 30);
2538 
2539  EEP_FedsTimingVsAmpHist_ = new TH2F("timeVsAmpAllEvents",
2540  "time Vs Amp All Events EEP;Relative Time (1 clock = 25ns);Amplitude (GeV)",
2541  78,
2542  -7,
2543  7,
2544  numBins,
2545  histRangeMin_,
2546  10.0);
2547  EEP_FedsTimingTTHist_ = new TH3F("timeTTAllFEDs",
2548  "(ix,iy,time) for all FEDs (SM,TT binning) EEP;ix;iy;Relative Time (1 clock = 25ns)",
2549  20,
2550  0,
2551  100,
2552  20,
2553  0,
2554  100,
2555  78,
2556  -7,
2557  7);
2558 
2560  new TH2F("OccupancySingleXtal", "Occupancy single xtal clusters EEP;ix;iy", 100, 0, 100, 100, 0, 100);
2561  EEP_energySingleXtalHist_ = new TH1F("energy_SingleXtalClusters",
2562  "Energy single xtal clusters EEP;Cluster Energy (GeV)",
2563  numBins,
2564  histRangeMin_,
2565  200.0);
2566 
2567  EEP_OccupancyExclusiveECAL_ = new TH2F(
2568  "OccupancyAllEvents_ExclusiveECAL", "Occupancy all events Exclusive ECAL EEP;ix;iy", 100, 0, 100, 100, 0, 100);
2569  EEP_OccupancyCoarseExclusiveECAL_ = new TH2F("OccupancyAllEventsCoarse_ExclusiveECAL",
2570  "Occupancy all events Coarse Exclusive ECAL EEP;ix;iy",
2571  20,
2572  0,
2573  100,
2574  20,
2575  0,
2576  100);
2578  new TH2F("OccupancyAllEvents_ECAL", "Occupancy all events ECAL EEP;ix;iy", 100, 0, 100, 100, 0, 100);
2580  new TH2F("OccupancyAllEventsCoarse_ECAL", "Occupancy all events Coarse ECAL EEP;ix;iy", 20, 0, 100, 20, 0, 100);
2582  new TH1F("timeForAllFeds_ECAL", "timeForAllFeds ECAL EEP;Relative Time (1 clock = 25ns)", 78, -7, 7);
2584  new TH3F("timeTTAllFEDs_ECAL",
2585  "(ix,iy,time) for all FEDs (SM,TT binning) ECAL EEP;ix;iy;Relative Time (1 clock = 25ns)",
2586  20,
2587  0,
2588  100,
2589  20,
2590  0,
2591  100,
2592  78,
2593  -7,
2594  7);
2595 
2596  EEP_OccupancyExclusiveDT_ = new TH2F(
2597  "OccupancyAllEvents_ExclusiveDT", "Occupancy all events Exclusive DT EEP;ix;iy", 100, 0, 100, 100, 0, 100);
2598  EEP_OccupancyCoarseExclusiveDT_ = new TH2F("OccupancyAllEventsCoarse_ExclusiveDT",
2599  "Occupancy all events Coarse Exclusive DT EEP;ix;iy",
2600  20,
2601  0,
2602  100,
2603  20,
2604  0,
2605  100);
2606  EEP_OccupancyDT_ = new TH2F("OccupancyAllEvents_DT", "Occupancy all events DT EEP;ix;iy", 100, 0, 100, 100, 0, 100);
2608  new TH2F("OccupancyAllEventsCoarse_DT", "Occupancy all events Coarse DT EEP;ix;iy", 20, 0, 100, 20, 0, 100);
2610  new TH1F("timeForAllFeds_DT", "timeForAllFeds DT EEP;Relative Time (1 clock = 25ns)", 78, -7, 7);
2612  new TH3F("timeTTAllFEDs_DT",
2613  "(ix,iy,time) for all FEDs (SM,TT binning) DT EEP;ix;iy;Relative Time (1 clock = 25ns)",
2614  20,
2615  0,
2616  100,
2617  20,
2618  0,
2619  100,
2620  78,
2621  -7,
2622  7);
2623 
2624  EEP_OccupancyExclusiveRPC_ = new TH2F(
2625  "OccupancyAllEvents_ExclusiveRPC", "Occupancy all events Exclusive RPC EEP;ix;iy", 100, 0, 100, 100, 0, 100);
2626  EEP_OccupancyCoarseExclusiveRPC_ = new TH2F("OccupancyAllEventsCoarse_ExclusiveRPC",
2627  "Occupancy all events Coarse Exclusive RPC EEP;ix;iy",
2628  20,
2629  0,
2630  100,
2631  20,
2632  0,
2633  100);
2635  new TH2F("OccupancyAllEvents_RPC", "Occupancy all events RPC EEP;ix;iy", 100, 0, 100, 100, 0, 100);
2637  new TH2F("OccupancyAllEventsCoarse_RPC", "Occupancy all events Coarse RPC EEP;ix;iy", 20, 0, 100, 20, 0, 100);
2639  new TH1F("timeForAllFeds_RPC", "timeForAllFeds RPC EEP;Relative Time (1 clock = 25ns)", 78, -7, 7);
2641  new TH3F("timeTTAllFEDs_RPC",
2642  "(ix,iy,time) for all FEDs (SM,TT binning) RPC EEP;ix;iy;Relative Time (1 clock = 25ns)",
2643  20,
2644  0,
2645  100,
2646  20,
2647  0,
2648  100,
2649  78,
2650  -7,
2651  7);
2652 
2653  EEP_OccupancyExclusiveCSC_ = new TH2F(
2654  "OccupancyAllEvents_ExclusiveCSC", "Occupancy all events Exclusive CSC EEP;ix;iy", 100, 0, 100, 100, 0, 100);
2655  EEP_OccupancyCoarseExclusiveCSC_ = new TH2F("OccupancyAllEventsCoarse_ExclusiveCSC",
2656  "Occupancy all events Coarse Exclusive CSC EEP;ix;iy",
2657  20,
2658  0,
2659  100,
2660  20,
2661  0,
2662  100);
2664  new TH2F("OccupancyAllEvents_CSC", "Occupancy all events CSC EEP;ix;iy", 100, 0, 100, 100, 0, 100);
2666  new TH2F("OccupancyAllEventsCoarse_CSC", "Occupancy all events Coarse CSC EEP;ix;iy", 20, 0, 100, 20, 0, 100);
2668  new TH1F("timeForAllFeds_CSC", "timeForAllFeds CSC EEP;Relative Time (1 clock = 25ns)", 78, -7, 7);
2670  new TH3F("timeTTAllFEDs_CSC",
2671  "(ix,iy,time) for all FEDs (SM,TT binning) CSC EEP;ix;iy;Relative Time (1 clock = 25ns)",
2672  20,
2673  0,
2674  100,
2675  20,
2676  0,
2677  100,
2678  78,
2679  -7,
2680  7);
2681 
2682  EEP_OccupancyExclusiveHCAL_ = new TH2F(
2683  "OccupancyAllEvents_ExclusiveHCAL", "Occupancy all events Exclusive HCAL EEP;ix;iy", 100, 0, 100, 100, 0, 100);
2684  EEP_OccupancyCoarseExclusiveHCAL_ = new TH2F("OccupancyAllEventsCoarse_ExclusiveHCAL",
2685  "Occupancy all events Coarse Exclusive HCAL EEP;ix;iy",
2686  20,
2687  0,
2688  100,
2689  20,
2690  0,
2691  100);
2693  new TH2F("OccupancyAllEvents_HCAL", "Occupancy all events HCAL EEP;ix;iy", 100, 0, 100, 100, 0, 100);
2695  new TH2F("OccupancyAllEventsCoarse_HCAL", "Occupancy all events Coarse HCAL EEP;ix;iy", 20, 0, 100, 20, 0, 100);
2697  new TH1F("timeForAllFeds_HCAL", "timeForAllFeds HCAL EEP;Relative Time (1 clock = 25ns)", 78, -7, 7);
2699  new TH3F("timeTTAllFEDs_HCAL",
2700  "(ix,iy,time) for all FEDs (SM,TT binning) HCAL EEP;ix;iy;Relative Time (1 clock = 25ns)",
2701  20,
2702  0,
2703  100,
2704  20,
2705  0,
2706  100,
2707  78,
2708  -7,
2709  7);
2710 
2712  new TH1F("numberofBCinSC", "Number of Basic Clusters in Super Cluster EEP;Num Basic Clusters", 20, 0, 20);
2713 
2714  EEP_triggerHist_ = new TH1F("triggerHist", "Trigger Number EEP", 5, 0, 5);
2715  EEP_triggerHist_->GetXaxis()->SetBinLabel(1, "ECAL");
2716  EEP_triggerHist_->GetXaxis()->SetBinLabel(2, "HCAL");
2717  EEP_triggerHist_->GetXaxis()->SetBinLabel(3, "DT");
2718  EEP_triggerHist_->GetXaxis()->SetBinLabel(4, "RPC");
2719  EEP_triggerHist_->GetXaxis()->SetBinLabel(5, "CSC");
2720 
2721  EEP_triggerExclusiveHist_ = new TH1F("triggerExclusiveHist", "Trigger Number (Mutually Exclusive) EEP", 5, 0, 5);
2722  EEP_triggerExclusiveHist_->GetXaxis()->SetBinLabel(1, "ECAL");
2723  EEP_triggerExclusiveHist_->GetXaxis()->SetBinLabel(2, "HCAL");
2724  EEP_triggerExclusiveHist_->GetXaxis()->SetBinLabel(3, "DT");
2725  EEP_triggerExclusiveHist_->GetXaxis()->SetBinLabel(4, "RPC");
2726  EEP_triggerExclusiveHist_->GetXaxis()->SetBinLabel(5, "CSC");
2727 
2729  new TH1F("NumXtalsInClusterAllHist", "Number of Xtals in Cluster EEP;NumXtals", 150, 0, 150);
2730  EEP_numxtalsVsEnergy_ = new TH2F("NumXtalsVsEnergy",
2731  "Number of Xtals in Cluster vs Energy EEP;Energy (GeV);Number of Xtals in Cluster",
2732  numBins,
2733  histRangeMin_,
2734  10.0,
2735  150,
2736  0,
2737  150);
2739  new TH2F("NumXtalsVsHighEnergy",
2740  "Number of Xtals in Cluster vs Energy EEP;Energy (GeV);Number of Xtals in Cluster",
2741  numBins,
2742  histRangeMin_,
2743  200.,
2744  150,
2745  0,
2746  150);
2747 
2749  new TH2F("OccupancyHighEnergyEvents", "Occupancy high energy events EEP;ix;iy", 100, 0, 100, 100, 0, 100);
2750  EEP_OccupancyHighEnergyCoarse_ = new TH2F(
2751  "OccupancyHighEnergyEventsCoarse", "Occupancy high energy events Coarse EEP;ix;iy", 20, 0, 100, 20, 0, 100);
2752 
2754  new TH1F("NumActiveXtalsInClusterAllHist", "Number of active Xtals in Cluster EEP;NumXtals", 100, 0, 100);
2755 }
2756 
2757 // ------------ method called once each job just after ending the event loop ------------
2759  using namespace std;
2760  if (runInFileName_) {
2761  fileName_ += "-" + intToString(runNum_) + ".graph.root";
2762  } else {
2763  fileName_ += ".root";
2764  }
2765 
2766  TFile root_file_(fileName_.c_str(), "RECREATE");
2767 
2768  for (map<int, TH1F*>::const_iterator itr = FEDsAndHists_.begin(); itr != FEDsAndHists_.end(); ++itr) {
2769  string dir = fedMap_->getSliceFromFed(itr->first);
2770  TDirectory* FEDdir = gDirectory->mkdir(dir.c_str());
2771  FEDdir->cd();
2772 
2773  TH1F* hist = itr->second;
2774  if (hist != nullptr)
2775  hist->Write();
2776  else {
2777  cerr << "EcalCosmicsHists: Error: This shouldn't happen!" << endl;
2778  }
2779  // Write out timing hist
2780  hist = FEDsAndTimingHists_[itr->first];
2781  if (hist != nullptr)
2782  hist->Write();
2783  else {
2784  cerr << "EcalCosmicsHists: Error: This shouldn't happen!" << endl;
2785  }
2786 
2787  hist = FEDsAndFrequencyHists_[itr->first];
2788  hist->Write();
2789 
2790  hist = FEDsAndiPhiProfileHists_[itr->first];
2791  hist->Write();
2792 
2793  hist = FEDsAndiEtaProfileHists_[itr->first];
2794  hist->Write();
2795 
2796  hist = FEDsAndE2Hists_[itr->first];
2797  hist->Write();
2798 
2799  hist = FEDsAndenergyHists_[itr->first];
2800  hist->Write();
2801 
2802  hist = FEDsAndNumXtalsInClusterHists_[itr->first];
2803  hist->Write();
2804 
2805  TH2F* hist2 = FEDsAndTimingVsAmpHists_[itr->first];
2806  hist2->Write();
2807 
2808  hist2 = FEDsAndTimingVsFreqHists_[itr->first];
2809  hist2->Write();
2810 
2811  hist2 = FEDsAndE2vsE1Hists_[itr->first];
2812  hist2->Write();
2813 
2814  hist2 = FEDsAndenergyvsE1Hists_[itr->first];
2815  hist2->Write();
2816 
2817  hist2 = FEDsAndOccupancyHists_[itr->first];
2818  hist2->Write();
2819 
2820  hist2 = FEDsAndTimingVsPhiHists_[itr->first];
2821  hist2->Write();
2822 
2823  hist2 = FEDsAndTimingVsModuleHists_[itr->first];
2824  hist2->Write();
2825 
2826  //2d hist
2827  map<int, TH2F*>::const_iterator itr2d;
2828  itr2d = FEDsAndDCCRuntypeVsBxHists_.find(itr->first);
2829  if (itr2d != FEDsAndDCCRuntypeVsBxHists_.end()) {
2830  TH2F* hist2 = itr2d->second;
2831  hist2->GetYaxis()->SetBinLabel(1, "COSMIC");
2832  hist2->GetYaxis()->SetBinLabel(2, "BEAMH4");
2833  hist2->GetYaxis()->SetBinLabel(3, "BEAMH2");
2834  hist2->GetYaxis()->SetBinLabel(4, "MTCC");
2835  hist2->GetYaxis()->SetBinLabel(5, "LASER_STD");
2836  hist2->GetYaxis()->SetBinLabel(6, "LASER_POWER_SCAN");
2837  hist2->GetYaxis()->SetBinLabel(7, "LASER_DELAY_SCAN");
2838  hist2->GetYaxis()->SetBinLabel(8, "TESTPULSE_SCAN_MEM");
2839  hist2->GetYaxis()->SetBinLabel(9, "TESTPULSE_MGPA");
2840  hist2->GetYaxis()->SetBinLabel(10, "PEDESTAL_STD");
2841  hist2->GetYaxis()->SetBinLabel(11, "PEDESTAL_OFFSET_SCAN");
2842  hist2->GetYaxis()->SetBinLabel(12, "PEDESTAL_25NS_SCAN");
2843  hist2->GetYaxis()->SetBinLabel(13, "LED_STD");
2844  hist2->GetYaxis()->SetBinLabel(14, "PHYSICS_GLOBAL");
2845  hist2->GetYaxis()->SetBinLabel(15, "COSMICS_GLOBAL");
2846  hist2->GetYaxis()->SetBinLabel(16, "HALO_GLOBAL");
2847  hist2->GetYaxis()->SetBinLabel(17, "LASER_GAP");
2848  hist2->GetYaxis()->SetBinLabel(18, "TESTPULSE_GAP");
2849  hist2->GetYaxis()->SetBinLabel(19, "PEDESTAL_GAP");
2850  hist2->GetYaxis()->SetBinLabel(20, "LED_GAP");
2851  hist2->GetYaxis()->SetBinLabel(21, "PHYSICS_LOCAL");
2852  hist2->GetYaxis()->SetBinLabel(22, "COSMICS_LOCAL");
2853  hist2->GetYaxis()->SetBinLabel(23, "HALO_LOCAL");
2854  hist2->GetYaxis()->SetBinLabel(24, "CALIB_LOCAL");
2855  hist2->Write();
2856  }
2857 
2858  root_file_.cd();
2859  }
2860  allFedsHist_->Write();
2861  allFedsE2Hist_->Write();
2862  allFedsenergyHist_->Write();
2863  allFedsenergyHighHist_->Write();
2864  allFedsenergyOnlyHighHist_->Write();
2865  allFedsE2vsE1Hist_->Write();
2866  allFedsenergyvsE1Hist_->Write();
2867  allFedsTimingHist_->Write();
2868  allFedsTimingVsAmpHist_->Write();
2869  allFedsFrequencyHist_->Write();
2870  allFedsTimingVsFreqHist_->Write();
2871  allFedsiEtaProfileHist_->Write();
2872  allFedsiPhiProfileHist_->Write();
2873  allOccupancy_->Write();
2874  TrueOccupancy_->Write();
2875  allOccupancyCoarse_->Write();
2876  TrueOccupancyCoarse_->Write();
2877  allOccupancyHighEnergy_->Write();
2879  allOccupancySingleXtal_->Write();
2880  energySingleXtalHist_->Write();
2882  allFedsTimingPhiHist_->Write();
2883  allFedsTimingPhiEbpHist_->Write();
2884  allFedsTimingPhiEbmHist_->Write();
2885  allFedsTimingEbpHist_->Write();
2886  allFedsTimingEbmHist_->Write();
2887  allFedsTimingEbpTopHist_->Write();
2888  allFedsTimingEbmTopHist_->Write();
2889  allFedsTimingEbpBottomHist_->Write();
2890  allFedsTimingEbmBottomHist_->Write();
2891  allFedsTimingPhiEtaHist_->Write();
2892  allFedsTimingTTHist_->Write();
2893  allFedsTimingLMHist_->Write();
2895 
2896  numberofBCinSC_->Write(); //SC
2897  numberofBCinSCphi_->Write(); //SC
2898  TrueBCOccupancyCoarse_->Write(); //BC
2899  TrueBCOccupancy_->Write(); //BC
2900 
2901  numxtalsVsEnergy_->Write();
2902  numxtalsVsHighEnergy_->Write();
2903 
2904  allOccupancyExclusiveECAL_->Write();
2906  allOccupancyECAL_->Write();
2907  allOccupancyCoarseECAL_->Write();
2909  allFedsTimingHistECAL_->Write();
2910  allFedsTimingTTHistECAL_->Write();
2911  allFedsTimingLMHistECAL_->Write();
2912 
2913  allOccupancyExclusiveHCAL_->Write();
2915  allOccupancyHCAL_->Write();
2916  allOccupancyCoarseHCAL_->Write();
2918  allFedsTimingHistHCAL_->Write();
2919  allFedsTimingTTHistHCAL_->Write();
2920  allFedsTimingLMHistHCAL_->Write();
2921 
2922  allOccupancyExclusiveDT_->Write();
2924  allOccupancyDT_->Write();
2925  allOccupancyCoarseDT_->Write();
2926  allFedsTimingPhiEtaHistDT_->Write();
2927  allFedsTimingHistDT_->Write();
2928  allFedsTimingTTHistDT_->Write();
2929  allFedsTimingLMHistDT_->Write();
2930 
2931  allOccupancyExclusiveRPC_->Write();
2933  allOccupancyRPC_->Write();
2934  allOccupancyCoarseRPC_->Write();
2935  allFedsTimingPhiEtaHistRPC_->Write();
2936  allFedsTimingHistRPC_->Write();
2937  allFedsTimingTTHistRPC_->Write();
2938  allFedsTimingLMHistRPC_->Write();
2939 
2940  allOccupancyExclusiveCSC_->Write();
2942  allOccupancyCSC_->Write();
2943  allOccupancyCoarseCSC_->Write();
2944  allFedsTimingPhiEtaHistCSC_->Write();
2945  allFedsTimingHistCSC_->Write();
2946  allFedsTimingTTHistCSC_->Write();
2947  allFedsTimingLMHistCSC_->Write();
2948 
2949  allFedsTimingHistEcalMuon_->Write();
2950 
2951  //EE
2952  TDirectory* EEMinusDir = gDirectory->mkdir("EEMinus");
2953  EEMinusDir->cd();
2954  EEM_FedsSeedEnergyHist_->Write();
2955  EEM_AllOccupancyCoarse_->Write();
2956  EEM_AllOccupancy_->Write();
2957  EEM_FedsenergyHist_->Write();
2958  EEM_FedsenergyHighHist_->Write();
2959  EEM_FedsenergyOnlyHighHist_->Write();
2960  EEM_FedsE2Hist_->Write();
2961  EEM_FedsE2vsE1Hist_->Write();
2962  EEM_FedsenergyvsE1Hist_->Write();
2963  EEM_FedsTimingHist_->Write();
2964  EEM_numberofCosmicsHist_->Write();
2965  EEM_FedsTimingVsAmpHist_->Write();
2966  EEM_FedsTimingTTHist_->Write();
2967  EEM_OccupancySingleXtal_->Write();
2968  EEM_energySingleXtalHist_->Write();
2969  EEM_OccupancyExclusiveECAL_->Write();
2971  EEM_OccupancyECAL_->Write();
2972  EEM_OccupancyCoarseECAL_->Write();
2973  EEM_FedsTimingHistECAL_->Write();
2974  EEM_FedsTimingTTHistECAL_->Write();
2975  EEM_OccupancyExclusiveDT_->Write();
2977  EEM_OccupancyDT_->Write();
2978  EEM_OccupancyCoarseDT_->Write();
2979  EEM_FedsTimingHistDT_->Write();
2980  EEM_FedsTimingTTHistDT_->Write();
2981  EEM_OccupancyExclusiveRPC_->Write();
2983  EEM_OccupancyRPC_->Write();
2984  EEM_OccupancyCoarseRPC_->Write();
2985  EEM_FedsTimingHistRPC_->Write();
2986  EEM_FedsTimingTTHistRPC_->Write();
2987  EEM_OccupancyExclusiveCSC_->Write();
2989  EEM_OccupancyCSC_->Write();
2990  EEM_OccupancyCoarseCSC_->Write();
2991  EEM_FedsTimingHistCSC_->Write();
2992  EEM_FedsTimingTTHistCSC_->Write();
2993  EEM_OccupancyExclusiveHCAL_->Write();
2995  EEM_OccupancyHCAL_->Write();
2996  EEM_OccupancyCoarseHCAL_->Write();
2997  EEM_FedsTimingHistHCAL_->Write();
2998  EEM_FedsTimingTTHistHCAL_->Write();
2999  EEM_numberofBCinSC_->Write();
3000  EEM_triggerHist_->Write();
3001  EEM_triggerExclusiveHist_->Write();
3002  EEM_NumXtalsInClusterHist_->Write();
3003  EEM_numxtalsVsEnergy_->Write();
3004  EEM_numxtalsVsHighEnergy_->Write();
3005  EEM_OccupancyHighEnergy_->Write();
3008  root_file_.cd();
3009 
3010  TDirectory* EEPlusDir = gDirectory->mkdir("EEPlus");
3011  EEPlusDir->cd();
3012  EEP_FedsSeedEnergyHist_->Write();
3013  EEP_AllOccupancyCoarse_->Write();
3014  EEP_AllOccupancy_->Write();
3015  EEP_FedsenergyHist_->Write();
3016  EEP_FedsenergyHighHist_->Write();
3017  EEP_FedsenergyOnlyHighHist_->Write();
3018  EEP_FedsE2Hist_->Write();
3019  EEP_FedsE2vsE1Hist_->Write();
3020  EEP_FedsenergyvsE1Hist_->Write();
3021  EEP_FedsTimingHist_->Write();
3022  EEP_numberofCosmicsHist_->Write();
3023  EEP_FedsTimingVsAmpHist_->Write();
3024  EEP_FedsTimingTTHist_->Write();
3025  EEP_OccupancySingleXtal_->Write();
3026  EEP_energySingleXtalHist_->Write();
3027  EEP_OccupancyExclusiveECAL_->Write();
3029  EEP_OccupancyECAL_->Write();
3030  EEP_OccupancyCoarseECAL_->Write();
3031  EEP_FedsTimingHistECAL_->Write();
3032  EEP_FedsTimingTTHistECAL_->Write();
3033  EEP_OccupancyExclusiveDT_->Write();
3035  EEP_OccupancyDT_->Write();
3036  EEP_OccupancyCoarseDT_->Write();
3037  EEP_FedsTimingHistDT_->Write();
3038  EEP_FedsTimingTTHistDT_->Write();
3039  EEP_OccupancyExclusiveRPC_->Write();
3041  EEP_OccupancyRPC_->Write();
3042  EEP_OccupancyCoarseRPC_->Write();
3043  EEP_FedsTimingHistRPC_->Write();
3044  EEP_FedsTimingTTHistRPC_->Write();
3045  EEP_OccupancyExclusiveCSC_->Write();
3047  EEP_OccupancyCSC_->Write();
3048  EEP_OccupancyCoarseCSC_->Write();
3049  EEP_FedsTimingHistCSC_->Write();
3050  EEP_FedsTimingTTHistCSC_->Write();
3051  EEP_OccupancyExclusiveHCAL_->Write();
3053  EEP_OccupancyHCAL_->Write();
3054  EEP_OccupancyCoarseHCAL_->Write();
3055  EEP_FedsTimingHistHCAL_->Write();
3056  EEP_FedsTimingTTHistHCAL_->Write();
3057  EEP_numberofBCinSC_->Write();
3058  EEP_triggerHist_->Write();
3059  EEP_triggerExclusiveHist_->Write();
3060  EEP_NumXtalsInClusterHist_->Write();
3061  EEP_numxtalsVsEnergy_->Write();
3062  EEP_numxtalsVsHighEnergy_->Write();
3063  EEP_OccupancyHighEnergy_->Write();
3066  root_file_.cd();
3067 
3068  triggerHist_->Write();
3069  triggerExclusiveHist_->Write();
3070 
3071  NumXtalsInClusterHist_->Write();
3072 
3073  numberofCosmicsHist_->Write();
3074  numberofCosmicsHistEB_->Write();
3075 
3076  numberofCosmicsWTrackHist_->Write();
3078  numberofGoodEvtFreq_->Write();
3079  numberofCrossedEcalIdsHist_->Write();
3080 
3081  runNumberHist_->SetBinContent(1, runNum_);
3082  runNumberHist_->Write();
3083 
3084  deltaRHist_->Write();
3085  deltaEtaHist_->Write();
3086  deltaPhiHist_->Write();
3087  ratioAssocClustersHist_->Write();
3088  ratioAssocTracksHist_->Write();
3089  deltaEtaDeltaPhiHist_->Write();
3090  seedTrackPhiHist_->Write();
3091  seedTrackEtaHist_->Write();
3092  dccEventVsBxHist_->Write();
3093  dccOrbitErrorByFEDHist_->Write();
3094  dccBXErrorByFEDHist_->Write();
3095  dccRuntypeErrorByFEDHist_->Write();
3096  dccErrorVsBxHist_->Write();
3097  dccRuntypeHist_->Write();
3098 
3099  trackAssoc_muonsEcal_->Write();
3100 
3101  hcalEnergy_HBHE_->Write();
3102  hcalEnergy_HF_->Write();
3103  hcalEnergy_HO_->Write();
3104  hcalHEHBecalEB_->Write();
3105 
3106  TDirectory* highEnergyDir = gDirectory->mkdir("HighEnergy");
3107  highEnergyDir->cd();
3108  HighEnergy_NumXtal->Write();
3109  HighEnergy_NumXtalFedId->Write();
3110  HighEnergy_NumXtaliphi->Write();
3111  HighEnergy_energy3D->Write();
3112  HighEnergy_energyNumXtal->Write();
3113  HighEnergy_bestSeed->Write();
3115  HighEnergy_numClusHighEn->Write();
3116  HighEnergy_ratioClusters->Write();
3118  HighEnergy_TracksAngle->Write();
3120  HighEnergy_2GeV_occuCoarse->Write();
3121  HighEnergy_2GeV_occu3D->Write();
3123  HighEnergy_100GeV_occu3D->Write();
3124  HighEnergy_0tracks_occu3D->Write();
3125  HighEnergy_1tracks_occu3D->Write();
3126  HighEnergy_2tracks_occu3D->Write();
3130 
3131  root_file_.cd();
3132 
3133  TDirectory* TimeStampdir = gDirectory->mkdir("EventTiming");
3134  TimeStampdir->cd();
3135  allFedsFreqTimeHist_->Write();
3136  allFedsFreqTimeVsPhiHist_->Write();
3137  allFedsFreqTimeVsPhiTTHist_->Write();
3138  allFedsFreqTimeVsEtaHist_->Write();
3139  allFedsFreqTimeVsEtaTTHist_->Write();
3140 
3141  root_file_.cd();
3142 
3143  root_file_.Close();
3144 
3145  LogWarning("EcalCosmicsHists") << "---> Number of cosmic events: " << cosmicCounter_ << " in " << naiveEvtNum_
3146  << " events.";
3147  LogWarning("EcalCosmicsHists") << "---> Number of EB cosmic events: " << cosmicCounterEB_ << " in " << naiveEvtNum_
3148  << " events.";
3149  LogWarning("EcalCosmicsHists") << "---> Number of EE- cosmic events: " << cosmicCounterEEM_ << " in " << naiveEvtNum_
3150  << " events.";
3151  LogWarning("EcalCosmicsHists") << "---> Number of EE+ cosmic events: " << cosmicCounterEEP_ << " in " << naiveEvtNum_
3152  << " events.";
3153 
3154  // LogWarning("EcalCosmicsHists") << "---> Number of top+bottom cosmic events: " << cosmicCounterTopBottom_ << " in " << cosmicCounter_ << " cosmics in " << naiveEvtNum_ << " events.";
3155 }
3156 
3158  using namespace std;
3159  ostringstream myStream;
3160  myStream << num << flush;
3161  return (myStream.str()); //returns the string form of the stringstream object
3162 }
TH3F * EEM_FedsTimingTTHistECAL_
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
TH2F * allFedsTimingLMHistECAL_
TH2F * allOccupancyExclusiveECAL_
TH3F * allFedsTimingTTHistRPC_
TH3F * HighEnergy_0tracks_occu3D
T getParameter(std::string const &) const
const cms_uint16_t bData(int iB) const
get/set B_DATA_CH_IB
Definition: L1GtPsbWord.cc:323
EventNumber_t event() const
Definition: EventID.h:41
TH2F * allOccupancyCoarseExclusiveCSC_
TH2F * EEM_OccupancySingleXtal_
std::string intToString(int num)
std::map< int, TH1F * > FEDsAndNumXtalsInClusterHists_
TH3F * allFedsTimingTTHistCSC_
std::map< int, TH2F * > FEDsAndTimingVsAmpHists_
TH2F * EEP_FedsenergyvsE1Hist_
TH2F * allOccupancyExclusiveHCAL_
TH2F * HighEnergy_bestSeedOccupancy
static const TGPicture * info(bool iBackgroundIsBlack)
TH2F * allOccupancyCoarseExclusiveECAL_
TH3F * allFedsTimingPhiEtaHistCSC_
std::map< int, TH2F * > FEDsAndE2vsE1Hists_
int ix() const
Definition: EEDetId.h:77
TH1F * EEM_FedsenergyHighHist_
TH2F * EEM_numxtalsVsHighEnergy_
TH1F * allFedsiPhiProfileHist_
TH1F * EEM_numberofCosmicsHist_
TH3F * EEM_FedsTimingTTHistCSC_
TH1F * EEP_FedsenergyHighHist_
TH2F * allOccupancyExclusiveRPC_
TH1F * allFedsiEtaProfileHist_
EcalFedMap * fedMap_
TH3F * allFedsTimingPhiEtaHistECAL_
edm::InputTag ecalRawDataColl_
TH2F * allOccupancyCoarseExclusiveHCAL_
EcalCosmicsHists(const edm::ParameterSet &)
TH2F * EEP_OccupancyExclusiveHCAL_
TH1F * EEP_energySingleXtalHist_
TH1F * allFedsTimingEbpTopHist_
TH2F * EEM_OccupancyExclusiveDT_
void endJob() override
std::map< int, TH2F * > FEDsAndTimingVsPhiHists_
TH2F * allFedsTimingLMHistHCAL_
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
TH2F * allFedsTimingVsFreqHist_
TH1F * EEM_energySingleXtalHist_
std::vector< DetId > crossedEcalIds
TH2F * EEP_numxtalsVsHighEnergy_
TH2F * EEM_FedsTimingVsAmpHist_
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
TH1F * EEP_FedsSeedEnergyHist_
void useDefaultPropagator()
use the default propagator
TH1F * allFedsTimingEbpBottomHist_
std::map< int, TH1F * > FEDsAndE2Hists_
std::vector< T >::const_iterator const_iterator
TH3F * allFedsTimingPhiEtaHistDT_
TH2F * EEP_OccupancyCoarseECAL_
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
TH1F * numberofCosmicsWTrackHist_
TH3F * EEP_FedsTimingTTHistRPC_
TH2F * allFedsFreqTimeVsPhiHist_
TH2F * HighEnergy_2GeV_occuCoarse
float time() const
Definition: EcalRecHit.h:70
TH1F * dccRuntypeErrorByFEDHist_
std::map< int, TH2F * > FEDsAndTimingVsModuleHists_
TH3F * allFedsTimingPhiEtaHistRPC_
TH3F * HighEnergy_1tracks_occu3DXtal
void analyze(edm::Event const &, edm::EventSetup const &) override
TH3F * allFedsTimingPhiEtaHistHCAL_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
TH3F * EEM_FedsTimingTTHistDT_
~EcalCosmicsHists() override
TH2F * EEM_OccupancyExclusiveECAL_
TH2F * EEM_OccupancyCoarseHCAL_
int iphiSM() const
get the crystal iphi (1-20)
Definition: EBDetId.h:73
TH3F * EEM_FedsTimingTTHistRPC_
TH3F * HighEnergy_2tracks_occu3D
TH2F * HighEnergy_100GeV_occuCoarse
TH2F * allOccupancyCoarseExclusiveDT_
TH2F * EEP_OccupancyExclusiveCSC_
TH2F * allOccupancyHighEnergy_
edm::InputTag endcapClusterCollection_
TH2F * EEP_OccupancyExclusiveDT_
std::map< int, TH2F * > FEDsAndDCCRuntypeVsBxHists_
std::string getSliceFromFed(int)
Definition: EcalFedMap.cc:86
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
TH2F * EEM_OccupancyCoarseExclusiveCSC_
TH2F * HighEnergy_NumXtalFedId
TH3F * allFedsTimingTTHistECAL_
TH1F * allFedsTimingEbmTopHist_
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
std::vector< bool > determineTriggers(const edm::Event &, const edm::EventSetup &eventSetup)
TH2F * allFedsFreqTimeVsEtaTTHist_
int iEvent
Definition: GenABIO.cc:224
TH2F * EEM_OccupancyExclusiveRPC_
TH2F * EEM_OccupancyHighEnergy_
TH1F * EEP_FedsTimingHistHCAL_
TH2F * allFedsTimingPhiEbmHist_
const cms_uint16_t aData(int iA) const
get/set A_DATA_CH_IA
Definition: L1GtPsbWord.cc:228
TH2F * EEM_OccupancyCoarseECAL_
std::map< int, TH1F * > FEDsAndiPhiProfileHists_
TH2F * EEM_OccupancyCoarseExclusiveRPC_
std::map< int, TH1F * > FEDsAndFrequencyHists_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
TH1F * EEP_numberofCosmicsHist_
TH2F * EEP_OccupancyHighEnergyCoarse_
std::vector< bool > DecisionWord
typedefs
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
TH1F * EEP_FedsNumXtalsInClusterHist_
TH3F * EEP_FedsTimingTTHistHCAL_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
T sqrt(T t)
Definition: SSEVec.h:18
TH3F * HighEnergy_1tracks_occu3D
TH1F * allFedsenergyOnlyHighHist_
std::map< int, TH1F * > FEDsAndenergyHists_
TH1F * EEP_triggerExclusiveHist_
TH2F * EEP_OccupancyCoarseExclusiveECAL_
const bool gtAlgorithmResult(const std::string &algName, const std::vector< bool > &decWord) const
TH1F * EEM_FedsSeedEnergyHist_
TH3F * HighEnergy_100GeV_occu3D
std::map< int, TH2F * > FEDsAndenergyvsE1Hists_
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
TH3F * EEP_FedsTimingTTHistECAL_
TH2F * HighEnergy_energyNumXtal
TH3F * allFedsTimingTTHistHCAL_
TH1F * HighEnergy_ratioClusters
TH2F * EEM_OccupancyExclusiveCSC_
int zside() const
Definition: EEDetId.h:71
TH2F * EEP_OccupancyCoarseExclusiveHCAL_
std::string fileName_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TH2F * EEM_OccupancyCoarseRPC_
TH2F * EEP_AllOccupancyCoarse_
TH2F * EEP_OccupancyCoarseCSC_
const EcalElectronicsMapping * ecalElectronicsMap_
TrackDetectorAssociator trackAssociator_
TH1F * numberofCosmicsTopBottomHist_
TH2F * EEP_OccupancySingleXtal_
float energy() const
Definition: EcalRecHit.h:68
TH2F * EEM_OccupancyCoarseExclusiveECAL_
int iy() const
Definition: EEDetId.h:83
TH1F * allFedsTimingHistEcalMuon_
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
TH2F * EEP_OccupancyExclusiveECAL_
const L1GtPsbWord gtPsbWord(cms_uint16_t boardIdValue, int bxInEventValue) const
get / set PSB word (record) in the GT readout record
TrackAssociatorParameters trackParameters_
TH1F * EEM_triggerExclusiveHist_
TH1F * EEM_FedsTimingHistHCAL_
bool isValid() const
Definition: HandleBase.h:74
TH1F * HighEnergy_TracksAngleTopBottom
std::map< int, TH2F * > FEDsAndOccupancyHists_
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
TH1F * EEP_FedsTimingHistECAL_
TH2F * allFedsTimingPhiEbpHist_
const DecisionWord & decisionWord(int bxInEventValue) const
TH2F * allOccupancyExclusiveDT_
TH2F * EEM_OccupancyCoarseExclusiveHCAL_
TH2F * allOccupancySingleXtal_
TH2F * EEP_OccupancyCoarseExclusiveCSC_
TH2F * allFedsTimingVsAmpHist_
Namespace of DDCMS conversion namespace.
TH3F * allFedsTimingPhiEtaHist_
const_iterator end() const
TH1F * ratioAssocClustersHist_
edm::InputTag l1GMTReadoutRecTag_
TH2F * EEM_FedsenergyvsE1Hist_
TH2F * EEM_OccupancyCoarseCSC_
TH2F * allOccupancyExclusiveCSC_
TH1F * HighEnergy_numClusHighEn
TH2F * allFedsFreqTimeVsEtaHist_
T const * product() const
Definition: Handle.h:74
TH2F * EEP_OccupancyExclusiveRPC_
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
void beginRun(edm::Run const &, edm::EventSetup const &) override
TH1F * EEM_FedsTimingHistECAL_
TH2F * allFedsTimingLMHistRPC_
int ietaSM() const
get the crystal ieta in the SM convention (1-85)
Definition: EBDetId.h:71
edm::EventID id() const
Definition: EventBase.h:59
iterator find(key_type k)
TH1F * dccOrbitErrorByFEDHist_
TH1F * numberofCrossedEcalIdsHist_
HLT enums.
TH2F * allFedsTimingLMHistCSC_
TH3F * EEM_FedsTimingTTHistHCAL_
TH2F * allOccupancyCoarseECAL_
TH2F * EEP_OccupancyCoarseHCAL_
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
TH1F * EEM_FedsenergyOnlyHighHist_
T get() const
Definition: EventSetup.h:71
TH1F * EEP_NumXtalsInClusterHist_
TH1F * allFedsNumXtalsInClusterHist_
TH2F * EEM_OccupancyExclusiveHCAL_
TH2F * allOccupancyCoarseExclusiveRPC_
TH2F * EEP_OccupancyCoarseExclusiveRPC_
std::map< int, TH1F * > FEDsAndiEtaProfileHists_
TH2F * EEM_OccupancyCoarseExclusiveDT_
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
std::map< int, TH1F * > FEDsAndTimingHists_
TH2F * EEP_OccupancyCoarseRPC_
TH3F * HighEnergy_2tracks_occu3DXtal
TH1F * EEM_NumXtalsInClusterHist_
TH2F * allOccupancyHighEnergyCoarse_
TH2F * EEP_OccupancyHighEnergy_
TH3F * allFedsOccupancyHighEnergyHist_
TH2F * EEM_AllOccupancyCoarse_
dbl *** dir
Definition: mlp_gen.cc:35
TH3F * EEP_FedsTimingTTHistCSC_
TH3F * EEP_FedsTimingTTHistDT_
TH2F * EEP_FedsTimingVsAmpHist_
TH1F * EEM_FedsNumXtalsInClusterHist_
TH2F * allFedsFreqTimeVsPhiTTHist_
edm::InputTag l1GTReadoutRecTag_
edm::InputTag barrelClusterCollection_
int getLMNumber(const DetId &id) const
T const * product() const
Definition: ESHandle.h:86
TH2F * EEM_OccupancyHighEnergyCoarse_
TimeValue_t value() const
Definition: Timestamp.h:56
edm::Timestamp time() const
Definition: EventBase.h:60
TH1F * allFedsTimingEbmBottomHist_
TH1F * EEP_FedsenergyOnlyHighHist_
std::map< int, TH1F * > FEDsAndHists_
std::map< int, TH2F * > FEDsAndTimingVsFreqHists_
const_iterator begin() const
Definition: Run.h:45
edm::InputTag ecalRecHitCollectionEB_
TH1F * HighEnergy_numRecoTrackBarrel
TH2F * EEP_OccupancyCoarseExclusiveDT_
TH3F * HighEnergy_0tracks_occu3DXtal
TH2F * allOccupancyCoarseHCAL_
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
edm::InputTag ecalRecHitCollectionEE_