17 : l1tdttffolder_(ps.getUntrackedParameter<
std::
string>(
"l1tSourceFolder",
"L1T/L1TDTTF")),
18 dttfSource_(ps.getParameter<
edm::
InputTag>(
"dttfSource")),
19 online_(ps.getUntrackedParameter<
bool>(
"online",
true)),
20 resetafterlumi_(ps.getUntrackedParameter<
int>(
"resetAfterLumi", 3)),
22 occupancy_r_(nullptr) {
31 edm::LogInfo(
"L1TDTTFClient") <<
"[L1TDTTFClient]: Begin Job";
58 sprintf(hname,
"dttf_02_nTracks");
59 sprintf(mename,
"DTTF Tracks by Wheel");
64 sprintf(hname,
"dttf_03_tracks_occupancy_summary");
65 sprintf(mename,
"DTTF Tracks Occupancy");
73 sprintf(hname,
"dttf_05_bx_occupancy");
74 sprintf(mename,
"DTTF Tracks BX Distribution by Wheel");
80 sprintf(hname,
"dttf_06_bx");
81 sprintf(mename,
"DTTF Tracks BX w.r.t. Tracks with BX=0");
86 sprintf(hname,
"dttf_07_quality");
87 sprintf(mename,
"DTTF Tracks Quality distribution");
92 sprintf(hname,
"dttf_08_quality_occupancy");
93 sprintf(mename,
"DTTF Tracks Quality distribution by Wheel");
100 sprintf(hname,
"dttf_09_highQuality_Tracks");
101 sprintf(mename,
"Fraction of DTTF Tracks with Quality>3");
107 sprintf(hname,
"dttf_10_phi_vs_etaCoarse");
108 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy (coarse #eta only, packed values)");
114 sprintf(hname,
"dttf_11_phi_vs_etaFine");
115 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy (fine #eta only, packed values)");
121 sprintf(hname,
"dttf_12_phi_vs_eta");
122 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy");
128 sprintf(hname,
"dttf_13_eta_fine_fraction");
129 sprintf(mename,
"Fraction of DTTF Tracks with Fine #eta Assignment");
137 sprintf(hname,
"dttf_14_eta");
138 sprintf(mename,
"DTTF Tracks #eta distribution (Packed values)");
143 sprintf(hname,
"dttf_15_phi");
144 sprintf(mename,
"DTTF Tracks Phi distribution (Packed values)");
149 sprintf(hname,
"dttf_16_pt");
150 sprintf(mename,
"DTTF Tracks p_{T} distribution (Packed values)");
154 sprintf(hname,
"dttf_17_charge");
155 sprintf(mename,
"DTTF Tracks Charge distribution");
160 sprintf(hname,
"dttf_18_2ndTrack_occupancy_summary");
161 sprintf(mename,
"DTTF 2nd Tracks occupancy w.r.t. Tracks with BX=0");
169 sprintf(hname,
"dttf_gmt_fract_matching");
170 sprintf(mename,
"Fraction of DTTF tracks matching with GMT tracks");
181 sprintf(hname,
"dttf_01_tracks_occupancy_test_summary");
182 sprintf(mename,
"DTTF Tracks Occupancy");
193 sprintf(hname,
"dttf_01_nTracks_2ndTrack");
194 sprintf(mename,
"DTTF 2nd Tracks per Wheel distribution");
199 sprintf(hname,
"dttf_02_occupancy_summary_2ndTrack");
200 sprintf(mename,
"DTTF 2nd Tracks distribution by Sector and Wheel");
205 sprintf(hname,
"dttf_03_bx_occupancy_2ndTrack");
206 sprintf(mename,
"DTTF 2nd Tracks BX Distribution by Wheel");
212 sprintf(hname,
"dttf_04_bx_2ndTrack");
213 sprintf(mename,
"Fraction of DTTF Tracks BX w.r.t. Tracks with BX=0");
218 sprintf(hname,
"dttf_05_quality_2ndTrack");
219 sprintf(mename,
"DTTF 2nd Tracks Quality distribution");
225 sprintf(hname,
"dttf_06_quality_occupancy_2ndTrack");
226 sprintf(mename,
"DTTF 2nd Tracks Quality distribution by Wheel");
233 sprintf(hname,
"dttf_07_highQuality_Tracks_2ndTrack");
234 sprintf(mename,
"Fraction of DTTF 2nd Tracks with Quality>3");
240 sprintf(hname,
"dttf_08_phi_vs_eta_2ndTrack");
241 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy for 2nd Tracks");
247 sprintf(hname,
"dttf_09_eta_2ndTrack");
248 sprintf(mename,
"DTTF 2nd Tracks #eta distribution (Packed values)");
253 sprintf(hname,
"dttf_10_phi_2ndTrack");
254 sprintf(mename,
"DTTF 2nd Tracks Phi distribution (Packed values)");
259 sprintf(hname,
"dttf_11_pt_2ndTrack");
260 sprintf(mename,
"DTTF 2nd Tracks p_{T} distribution (Packed values)");
265 sprintf(hname,
"dttf_12_charge_2ndTrack");
266 sprintf(mename,
"DTTF 2nd Tracks Charge distribution");
270 for (
unsigned int wh = 0; wh < 6; ++wh) {
274 sprintf(hname,
"dttf_02_nTracks_wh%s",
wheel_[wh].c_str());
275 sprintf(mename,
"Wheel %s - Number of Tracks",
wheel_[wh].c_str());
280 sprintf(hname,
"dttf_03_bx_occupancy_wh%s",
wheel_[wh].c_str());
281 sprintf(mename,
"Wheel %s - DTTF Tracks BX distribution by Sector",
wheel_[wh].c_str());
287 sprintf(hname,
"dttf_04_bx_wh%s",
wheel_[wh].c_str());
288 sprintf(mename,
"Wheel %s - DTTF Tracks BX w.r.t. Tracks with BX=0",
wheel_[wh].c_str());
293 sprintf(hname,
"dttf_05_quality_wh%s",
wheel_[wh].c_str());
294 sprintf(mename,
"Wheel %s - Tracks Quality Distribution",
wheel_[wh].c_str());
300 sprintf(hname,
"dttf_06_quality_summary_wh%s",
wheel_[wh].c_str());
301 sprintf(mename,
"Wheel %s - Tracks Quality Distribution by Sector",
wheel_[wh].c_str());
308 sprintf(hname,
"dttf_09_etaFine_fraction_wh%s",
wheel_[wh].c_str());
309 sprintf(mename,
"Wheel %s - Fraction of DTTF Tracks with fine #eta assignment",
wheel_[wh].c_str());
314 sprintf(hname,
"dttf_10_eta_wh%s",
wheel_[wh].c_str());
315 sprintf(mename,
"Wheel %s - DTTF Tracks #eta distribution (Packed values)",
wheel_[wh].c_str());
320 sprintf(hname,
"dttf_11_phi_wh%s",
wheel_[wh].c_str());
321 sprintf(mename,
"Wheel %s - DTTF Tracks Phi distribution (Packed values)",
wheel_[wh].c_str());
326 sprintf(hname,
"dttf_12_pt_wh%s",
wheel_[wh].c_str());
327 sprintf(mename,
"Wheel %s - DTTF Tracks p_{T} distribution (Packed values)",
wheel_[wh].c_str());
332 sprintf(hname,
"dttf_13_charge_wh%s",
wheel_[wh].c_str());
333 sprintf(mename,
"Wheel %s - DTTF Tracks Charge distribution",
wheel_[wh].c_str());
339 for (
unsigned int wh = 0; wh < 6; ++wh) {
343 sprintf(hname,
"dttf_01_nTracks_wh%s_2ndTrack",
wheel_[wh].c_str());
344 sprintf(mename,
"Wheel %s - DTTF Number of 2nd Tracks with BX=0",
wheel_[wh].c_str());
349 sprintf(hname,
"dttf_02_bx_occupancy_wh%s_2ndTrack",
wheel_[wh].c_str());
350 sprintf(mename,
"Wheel %s - DTTF 2nd Tracks BX distribution by Sector",
wheel_[wh].c_str());
356 sprintf(hname,
"dttf_03_bx_wh%s_2ndTrack",
wheel_[wh].c_str());
357 sprintf(mename,
"Wheel %s - 2nd Tracks BX Distribution",
wheel_[wh].c_str());
380 sprintf(hname,
"%s/dttf_04_tracks_occupancy_by_lumi",
inclusivepath_.c_str());
386 edm::LogInfo(
"L1TDTTFClient::beginLuminosityBlock:RESET") <<
"Reseting plots by lumi!";
422 if (physEntries > 0) {
423 double physScale = 1 / physEntries;
444 if (entries2ndTrack > 0) {
456 double scale2nd = 1 / entries2ndTrack;
480 int wheelSumBx2nd[4];
483 memset(wheelSumBx, 0, 4 *
sizeof(
int));
484 memset(wheelSumBx2nd, 0, 4 *
sizeof(
int));
504 for (
unsigned int wh = 0; wh < 6; ++wh) {
512 double wheelEtaAll = 0;
513 double wheelEtaFine = 0;
514 memset(wheelBx, 0, 4 *
sizeof(
int));
515 memset(wheelBx2nd, 0, 4 *
sizeof(
int));
518 memset(qualities, 0, 8 *
sizeof(
int));
527 "%s/dttf_07_phi_vs_etaFine_wh%s",
528 "%s/dttf_08_phi_vs_etaCoarse_wh%s",
536 for (
unsigned int sector = 1; sector < 13; ++sector) {
540 sprintf(hname,
"%s/BX_BySector/dttf_bx_wh%s_se%d",
wheelpath_[wh].c_str(),
wheel_[wh].c_str(), sector);
542 TH1F *bxsector =
getTH1F(igetter, hname);
546 for (
unsigned int bx = 1;
bx < 4; ++
bx) {
547 int bxval = bxsector->GetBinContent(
bx);
558 wheelBx[
bx] += bxval;
567 "%s/BX_BySector/2ND_TRACK_ONLY/dttf_bx_2ndTrack_wh%s_se%d",
572 TH1F *bxsector2nd =
getTH1F(igetter, hname);
576 for (
unsigned int bx = 1;
bx < 4; ++
bx) {
577 int bxval = bxsector2nd->GetBinContent(
bx);
584 wheelBx2nd[
bx] += bxval;
592 sprintf(hname,
"%s/Charge/dttf_charge_wh%s_se%d",
wheelpath_[wh].c_str(),
wheel_[wh].c_str(), sector);
604 sprintf(hname,
"%s/PT/dttf_pt_wh%s_se%d",
wheelpath_[wh].c_str(),
wheel_[wh].c_str(), sector);
616 sprintf(hname,
"%s/Phi/dttf_phi_wh%s_se%d",
wheelpath_[wh].c_str(),
wheel_[wh].c_str(), sector);
629 double denHighQual = 0;
630 sprintf(hname,
"%s/Quality/dttf_qual_wh%s_se%d",
wheelpath_[wh].c_str(),
wheel_[wh].c_str(), sector);
637 for (
unsigned int qual = 1; qual < 4; ++qual) {
638 double bincontent =
tmp->GetBinContent(qual);
639 qualities[qual] += bincontent;
640 denHighQual += bincontent;
644 for (
unsigned int qual = 4; qual < 8; ++qual) {
645 double bincontent =
tmp->GetBinContent(qual);
646 qualities[qual] += bincontent;
648 denHighQual += bincontent;
649 highQual += bincontent;
653 highQual /= denHighQual;
659 sprintf(hname,
"%s/Eta/dttf_eta_wh%s_se%d",
wheelpath_[wh].c_str(),
wheel_[wh].c_str(), sector);
672 "%s/EtaFineFraction/dttf_etaFine_fraction_wh%s_se%d",
680 double fine =
tmp->GetBinContent(1);
681 double coarse =
tmp->GetBinContent(2);
682 double tot = fine + coarse;
684 wheelEtaFine += fine;
694 if (wheelEtaAll > 0) {
707 for (
unsigned int bx = 1;
bx < 4; ++
bx) {
710 wheelSumBx[
bx] += wheelBx[
bx];
714 wheelSumBx2nd[
bx] += wheelBx2nd[
bx];
720 for (
unsigned int qual = 1; qual < 8; ++qual) {
742 double scale = wheelBx[2];
748 scale = wheelBx2nd[2];
763 sprintf(hname,
"%s/2ND_TRACK_ONLY/dttf_07_eta_wh%s_2ndTrack",
wheelpath_[wh].c_str(),
wheel_[wh].c_str());
775 sprintf(hname,
"%s/2ND_TRACK_ONLY/dttf_08_phi_wh%s_2ndTrack",
wheelpath_[wh].c_str(),
wheel_[wh].c_str());
786 sprintf(hname,
"%s/2ND_TRACK_ONLY/dttf_09_pt_wh%s_2ndTrack",
wheelpath_[wh].c_str(),
wheel_[wh].c_str());
797 sprintf(hname,
"%s/2ND_TRACK_ONLY/dttf_10_charge_wh%s_2ndTrack",
wheelpath_[wh].c_str(),
wheel_[wh].c_str());
808 sprintf(hname,
"%s/2ND_TRACK_ONLY/dttf_04_quality_wh%s_2ndTrack",
wheelpath_[wh].c_str(),
wheel_[wh].c_str());
813 for (
unsigned int qual = 1; qual < 8; ++qual) {
814 double binqual =
tmp->GetBinContent(qual);
824 for (
unsigned int bx = 1;
bx < 4; ++
bx) {
832 double scale = wheelSumBx[2];
838 scale = wheelSumBx2nd[2];
848 sprintf(hname,
"%s/dttf_tracks_with_gmt_match",
gmtpath_.c_str());
849 TH2F *gmt_match =
getTH2F(igetter, hname);
855 sprintf(hname,
"%s/dttf_tracks_without_gmt_match",
gmtpath_.c_str());
856 TH2F *gmt_missed =
getTH2F(igetter, hname);
862 sprintf(hname,
"%s/dttf_missing_tracks_in_gmt",
gmtpath_.c_str());
863 TH2F *gmt_ghost =
getTH2F(igetter, hname);
869 int match = gmt_match->Integral();
870 int missed = gmt_missed->Integral();
871 int ghost = gmt_ghost->Integral();
872 float tot =
match + missed + ghost;
874 double val = ghost / tot;
891 return me->getTH1F();
902 return me->getTH2F();
909 TH2F *occupancySummary,
917 for (
unsigned int wh = 0; wh < 6; ++wh) {
924 for (
unsigned int sec = 1;
sec < 13; ++
sec) {
925 double denHighQual = occupancySummary->GetBinContent(wh + 1,
sec);
927 if (denHighQual > 0) {
928 for (
unsigned int qual = 4; qual < 8; ++qual) {
948 sprintf(hname, path_fine.c_str(),
wheelpath_[wh].c_str(),
wheel_[wh].c_str());
950 TH2F *phi_vs_eta_fine =
getTH2F(igetter, hname);
951 if (!phi_vs_eta_fine) {
955 sprintf(hname, path_coarse.c_str(),
wheelpath_[wh].c_str(),
wheel_[wh].c_str());
956 TH2F *phi_vs_eta_coarse =
getTH2F(igetter, hname);
957 if (!phi_vs_eta_coarse) {
961 if (!phi_vs_eta_fine || !phi_vs_eta_coarse) {
965 for (
unsigned int phi = 1;
phi < 145; ++
phi) {
1002 double valfine = phi_vs_eta_fine->GetBinContent(
eta,
phi) + phi_eta_fine_integ->
getBinContent(setbin,
phi);
1004 double valcoarse = phi_vs_eta_coarse->GetBinContent(
eta,
phi) + phi_eta_coarse_integ->
getBinContent(setbin,
phi);
1043 TH2F *phi_vs_eta =
getTH2F(igetter, hname);
1047 for (
unsigned int phi = 1;
phi < 145; ++
phi) {
1087 double underflow = phi_vs_eta->GetBinContent(0,
phi) + phi_eta_integ->
getBinContent(1,
phi);
1175 me->setAxisTitle(
"Wheel", 1);
1176 me->setBinLabel(1,
"N2", 1);
1177 me->setBinLabel(2,
"N1", 1);
1178 me->setBinLabel(3,
"N0", 1);
1179 me->setBinLabel(4,
"P0", 1);
1180 me->setBinLabel(5,
"P1", 1);
1181 me->setBinLabel(6,
"P2", 1);
1187 me->setAxisTitle(
"Quality", axis);
1188 me->setBinLabel(1,
"T34", axis);
1189 me->setBinLabel(2,
"T23/24", axis);
1190 me->setBinLabel(3,
"T12/13/14", axis);
1191 me->setBinLabel(4,
"T234", axis);
1192 me->setBinLabel(5,
"T134", axis);
1193 me->setBinLabel(6,
"T123/124", axis);
1194 me->setBinLabel(7,
"T1234", axis);