23 #include "TProfile2D.h"
44 : EBRecHitCollection_(iConfig.getParameter<
edm::
InputTag>(
"EcalRecHitCollectionEB")),
45 EERecHitCollection_(iConfig.getParameter<
edm::
InputTag>(
"EcalRecHitCollectionEE")),
46 EBDigis_(iConfig.getParameter<
edm::
InputTag>(
"EBDigiCollection")),
47 EEDigis_(iConfig.getParameter<
edm::
InputTag>(
"EEDigiCollection")),
48 headerProducer_(iConfig.getParameter<
edm::
InputTag>(
"headerProducer")),
50 side_(iConfig.getUntrackedParameter<
int>(
"side", 3)),
51 threshold_(iConfig.getUntrackedParameter<double>(
"amplitudeThreshold", 0.5)),
52 minTimingAmp_(iConfig.getUntrackedParameter<double>(
"minimumTimingAmplitude", 0.100)),
53 makeDigiGraphs_(iConfig.getUntrackedParameter<
bool>(
"makeDigiGraphs",
false)),
54 makeTimingHistos_(iConfig.getUntrackedParameter<
bool>(
"makeTimingHistos",
true)),
55 makeEnergyHistos_(iConfig.getUntrackedParameter<
bool>(
"makeEnergyHistos",
true)),
56 makeOccupancyHistos_(iConfig.getUntrackedParameter<
bool>(
"makeOccupancyHistos",
true)),
57 histRangeMin_(iConfig.getUntrackedParameter<double>(
"histogramMinRange", 0.0)),
58 histRangeMax_(iConfig.getUntrackedParameter<double>(
"histogramMaxRange", 1.8)),
59 minTimingEnergyEB_(iConfig.getUntrackedParameter<double>(
"minTimingEnergyEB", 0.0)),
60 minTimingEnergyEE_(iConfig.getUntrackedParameter<double>(
"minTimingEnergyEE", 0.0)) {
61 vector<int> listDefaults;
62 listDefaults.push_back(-1);
68 vector<string> defaultMaskedEBs;
69 defaultMaskedEBs.push_back(
"none");
74 string title1 =
"Jitter for all FEDs all events";
75 string name1 =
"JitterAllFEDsAllEvents";
83 for (vector<string>::const_iterator ebItr =
maskedEBs_.begin(); ebItr !=
maskedEBs_.end(); ++ebItr) {
89 for (
int i = 0;
i < 10;
i++)
122 int ievt =
iEvent.id().event();
128 names =
new std::vector<string>();
153 bool hasEBdigis =
false;
154 bool hasEEdigis =
false;
178 if (hasEBdigis || hasEEdigis)
189 int FEDid = 600 + elecId.
dccId();
191 if (FEDid < 610 || FEDid > 645)
196 float ampli =
hit.energy();
198 vector<int>::iterator
result;
209 bool cryIsInList =
false;
220 string title =
"Digis";
225 ++(pair.first->second);
229 TCanvas
can(
name.c_str(),
title.c_str(), 200, 50, 900, 900);
252 for (
int i = 0;
i < 10;
i++)
255 emptyGraph->SetTitle(
"NOT ECAL");
261 emptyGraph->SetTitle(
"NO DIGIS");
264 int FEDid = 600 + elecId.
dccId();
266 if (FEDid < 610 || FEDid > 645)
310 emptyGraph->SetTitle(
"FIRST TWO SAMPLES NOT GAIN12");
311 if (
df.sample(0).gainId() != 1 ||
df.sample(1).gainId() != 1)
319 for (
int i = 0;
i <
df.size(); ++
i) {
320 if (
df.sample(
i).gainId() != 0)
330 sliceName +
"_gain" + gainString;
333 map<int, float>::const_iterator
itr;
344 oneGraph->SetTitle(
title.c_str());
345 oneGraph->SetName(
name.c_str());
346 oneGraph->GetXaxis()->SetTitle(
"sample");
347 oneGraph->GetYaxis()->SetTitle(
"ADC");
352 int FEDid = 600 + elecId.
dccId();
359 EBDetId digiId = digiItr->id();
374 DetId det = digiItr->id();
376 size_t FEDid = 600 + elecId.
dccId();
380 EEDetId digiId = digiItr->id();
406 int FEDid = 600 + elecId.
dccId();
409 if (FEDid < 610 || FEDid > 645) {
509 if (timingHist ==
nullptr) {
514 timingHist->Fill(
hit.time());
542 string frequencies =
"";
545 if (
itr->second > 1) {
546 frequencies +=
itr->first;
547 frequencies +=
" Frequency: ";
552 LogWarning(
"EcalDisplaysByEvent") <<
"Found seeds with frequency > 1: "
569 LogWarning(
"EcalDisplaysByEvent") <<
"Masked FEDs are: " <<
feds <<
" and that is all!";
574 ostringstream myStream;
575 myStream <<
num << flush;
576 return (myStream.str());
581 ostringstream myStream;
582 myStream <<
num << flush;
583 return (myStream.str());
590 string title1 =
"Jitter for ";
592 string name1 =
"JitterFED";
594 TH1F* timingHist =
fileService->
make<TH1F>(name1.c_str(), title1.c_str(), 150, -7, 7);
601 string canvasTitle =
"Timing_Event" + lastPart;
602 timingEB_ =
new TH1F(
"timeForAllFedsEB",
"timeForAllFeds;Relative Time (1 clock = 25ns)", 78, -7, 7);
603 timingEEM_ =
new TH1F(
"timeForAllFedsEEM",
"timeForAllFeds_EEM;Relative Time (1 clock = 25ns)", 78, -7, 7);
604 timingEEP_ =
new TH1F(
"timeForAllFedsEEP",
"timeForAllFeds_EEP;Relative Time (1 clock = 25ns)", 78, -7, 7);
605 timingCanvas_ =
new TCanvas(canvasTitle.c_str(), canvasTitle.c_str(), 300, 60, 500, 200);
619 string canvasTitle =
"Energy_Event" + lastPart;
620 energyCanvas_ =
new TCanvas(canvasTitle.c_str(), canvasTitle.c_str(), 300, 60, 500, 200);
695 string canvasTitle =
"Timing_AllEvents";
696 timingEBAll_ =
new TH1F(
"timeForAllFedsEBAll",
"timeForAllFeds;Relative Time (1 clock = 25ns)", 78, -7, 7);
697 timingEEMAll_ =
new TH1F(
"timeForAllFedsEEMAll",
"timeForAllFeds_EEM;Relative Time (1 clock = 25ns)", 78, -7, 7);
698 timingEEPAll_ =
new TH1F(
"timeForAllFedsEEPAll",
"timeForAllFeds_EEP;Relative Time (1 clock = 25ns)", 78, -7, 7);
699 timingCanvasAll_ =
new TCanvas(canvasTitle.c_str(), canvasTitle.c_str(), 300, 60, 500, 200);
711 canvasTitle =
"Energy_AllEvents";
712 energyCanvasAll_ =
new TCanvas(canvasTitle.c_str(), canvasTitle.c_str(), 300, 60, 500, 200);
751 double ttEtaBins[36] = {-85, -80, -75, -70, -65, -60, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0,
752 1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86};
753 double modEtaBins[10] = {-85, -65, -45, -25, 0, 1, 26, 46, 66, 86};
754 double ttPhiBins[73];
755 double modPhiBins[19];
756 double timingBins[79];
757 for (
int i = 0;
i < 79; ++
i) {
758 timingBins[
i] = 6 - 7. + double(
i) * 14. / 78.;
760 ttPhiBins[
i] = 1 + 5 *
i;
762 modPhiBins[
i] = 1 + 20 *
i;
768 histName = histName +
"EB";
771 histName = histName +
"Coarse";
773 hist =
new TH3F(histName.c_str(),
histTitle.c_str(), 18, modPhiBins, 9, modEtaBins, 78, timingBins);
776 hist =
new TH3F(histName.c_str(),
histTitle.c_str(), 360 / 5, ttPhiBins, 35, ttEtaBins, 78, timingBins);
781 for (
int i = 0;
i != 21; ++
i) {
782 ttXBins[
i] = 1 + 5 *
i;
783 ttYBins[
i] = 1 + 5 *
i;
786 histName = histName +
"EEM";
789 histName = histName +
"EEP";
793 histName = histName +
"Coarse";
795 hist =
new TH3F(histName.c_str(),
histTitle.c_str(), 20, ttXBins, 20, ttYBins, 78, timingBins);
798 hist =
new TH3F(histName.c_str(),
histTitle.c_str(), 20, ttXBins, 20, ttYBins, 78, timingBins);
812 histName = histName +
"EB";
815 histName = histName +
"Coarse";
817 double ttEtaBins[36] = {-85, -80, -75, -70, -65, -60, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0,
818 1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86};
819 hist =
new TH2F(histName.c_str(),
histTitle.c_str(), 360 / 5, 1, 361., 35, ttEtaBins);
822 hist =
new TH2F(histName.c_str(),
histTitle.c_str(), 360, 1, 361., 172, -86, 86);
826 histName = histName +
"EEM";
829 histName = histName +
"EEP";
833 histName = histName +
"Coarse";
835 hist =
new TH2F(histName.c_str(),
histTitle.c_str(), 20, 1, 101, 20, 1, 101);
838 hist =
new TH2F(histName.c_str(),
histTitle.c_str(), 100, 1, 101, 100, 1, 101);
845 TCanvas*
canvas =
new TCanvas(canvasTitle.c_str(), canvasTitle.c_str(), 300, 60, 500, 200);
876 canvas->cd(1)->Divide(2, 1);
884 canvas->SetCanvasSize(500, 500);
885 canvas->SetFixedAspectRatio(
true);
891 canvas->cd(1)->Divide(2, 1);
899 hist2->GetXaxis()->SetNdivisions(-18);
900 hist2->GetYaxis()->SetNdivisions(2);
901 canvas->GetPad(2)->SetGridx(1);
902 canvas->GetPad(2)->SetGridy(1);
908 canvas->SetCanvasSize(500, 500);
909 canvas->SetFixedAspectRatio(
true);
916 TProfile2D* profile2 = (TProfile2D*)hist2->Project3DProfile(
"yx");
917 profile2->Draw(
"colz");
921 canvas->cd(1)->Divide(2, 1);
924 TProfile2D* profile1 = (TProfile2D*)hist1->Project3DProfile(
"yx");
925 profile1->Draw(
"colz");
929 TProfile2D* profile2 = (TProfile2D*)hist2->Project3DProfile(
"yx");
930 profile2->Draw(
"colz");
931 profile2->GetXaxis()->SetNdivisions(-18);
932 profile2->GetYaxis()->SetNdivisions(2);
933 canvas->GetPad(2)->SetGridx(1);
934 canvas->GetPad(2)->SetGridy(1);
937 TProfile2D* profile3 = (TProfile2D*)hist3->Project3DProfile(
"yx");
938 profile3->Draw(
"colz");
942 canvas->SetCanvasSize(500, 500);
943 canvas->SetFixedAspectRatio(
true);
948 int nxb =
profile->GetNbinsX();
949 int nyb =
profile->GetNbinsY();
951 for (
int i = 0;
i != nxb; ++
i) {
952 for (
int j = 0;
j != nyb; ++
j) {
956 double xcorr =
profile->GetBinCenter(xb);
957 double ycorr =
profile->GetBinCenter(yb);
958 sprintf(tempErr,
"%0.2f",
profile->GetBinError(xb, yb));
961 if (nBinEntries != 0) {
962 TLatex*
tex =
new TLatex(xcorr, ycorr, tempErr);
963 tex->SetTextAlign(23);
964 tex->SetTextSize(42);
965 tex->SetTextSize(0.025);
966 tex->SetLineWidth(2);
970 sprintf(tempErr,
"%i", nBinEntries);
971 if (nBinEntries != 0) {
972 TLatex*
tex =
new TLatex(xcorr, ycorr, tempErr);
973 tex->SetTextAlign(21);
974 tex->SetTextFont(42);
975 tex->SetTextSize(0.025);
976 tex->SetLineWidth(2);
985 int ixSectorsEE[202] = {
986 61, 61, 60, 60, 59, 59, 58, 58, 57, 57, 55, 55, 45, 45, 43, 43, 42, 42, 41, 41, 40, 40, 39, 39, 40, 40,
987 41, 41, 42, 42, 43, 43, 45, 45, 55, 55, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 0, 100, 100, 97, 97, 95,
988 95, 92, 92, 87, 87, 85, 85, 80, 80, 75, 75, 65, 65, 60, 60, 40, 40, 35, 35, 25, 25, 20, 20, 15, 15, 13,
989 13, 8, 8, 5, 5, 3, 3, 0, 0, 3, 3, 5, 5, 8, 8, 13, 13, 15, 15, 20, 20, 25, 25, 35, 35, 40,
990 40, 60, 60, 65, 65, 75, 75, 80, 80, 85, 85, 87, 87, 92, 92, 95, 95, 97, 97, 100, 100, 0, 61, 65, 65, 70,
991 70, 80, 80, 90, 90, 92, 0, 61, 65, 65, 90, 90, 97, 0, 57, 60, 60, 65, 65, 70, 70, 75, 75, 80, 80, 0,
992 50, 50, 0, 43, 40, 40, 35, 35, 30, 30, 25, 25, 20, 20, 0, 39, 35, 35, 10, 10, 3, 0, 39, 35, 35, 30,
993 30, 20, 20, 10, 10, 8, 0, 45, 45, 40, 40, 35, 35, 0, 55, 55, 60, 60, 65, 65};
995 int iySectorsEE[202] = {50, 55, 55, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 60, 60, 59, 59, 58, 58, 57, 57, 55, 55,
996 45, 45, 43, 43, 42, 42, 41, 41, 40, 40, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 45, 45, 50,
997 0, 50, 60, 60, 65, 65, 75, 75, 80, 80, 85, 85, 87, 87, 92, 92, 95, 95, 97, 97, 100, 100, 97,
998 97, 95, 95, 92, 92, 87, 87, 85, 85, 80, 80, 75, 75, 65, 65, 60, 60, 40, 40, 35, 35, 25, 25,
999 20, 20, 15, 15, 13, 13, 8, 8, 5, 5, 3, 3, 0, 0, 3, 3, 5, 5, 8, 8, 13, 13, 15,
1000 15, 20, 20, 25, 25, 35, 35, 40, 40, 50, 0, 45, 45, 40, 40, 35, 35, 30, 30, 25, 25, 0, 50,
1001 50, 55, 55, 60, 60, 0, 60, 60, 65, 65, 70, 70, 75, 75, 85, 85, 87, 0, 61, 100, 0, 60, 60,
1002 65, 65, 70, 70, 75, 75, 85, 85, 87, 0, 50, 50, 55, 55, 60, 60, 0, 45, 45, 40, 40, 35, 35,
1003 30, 30, 25, 25, 0, 39, 30, 30, 15, 15, 5, 0, 39, 30, 30, 15, 15, 5};
1005 for (
int i = 0;
i < 202;
i++) {
1006 ixSectorsEE[
i] += 1;
1007 iySectorsEE[
i] += 1;
1013 for (
int i = 0;
i < 201;
i =
i + 1) {
1014 if ((ixSectorsEE[
i] != 1 || iySectorsEE[
i] != 1) && (ixSectorsEE[
i + 1] != 1 || iySectorsEE[
i + 1] != 1)) {
1015 l.DrawLine(ixSectorsEE[
i], iySectorsEE[
i], ixSectorsEE[
i + 1], iySectorsEE[
i + 1]);