20 : l1tdttffolder_ ( ps.getUntrackedParameter<std::
string> (
"l1tSourceFolder",
"L1T/L1TDTTF") ),
21 dttfSource_( ps.getParameter< edm::
InputTag >(
"dttfSource") ),
22 online_( ps.getUntrackedParameter<bool>(
"online",
true) ),
23 resetafterlumi_( ps.getUntrackedParameter<int>(
"resetAfterLumi", 3) ),
24 counterLS_(0), occupancy_r_(0)
32 edm::LogInfo(
"L1TDTTFClient")<<
"[L1TDTTFClient]: ending... ";
42 edm::LogInfo(
"L1TDTTFClient")<<
"[L1TDTTFClient]: Begin Job";
69 sprintf(hname,
"dttf_02_nTracks");
70 sprintf(mename,
"DTTF Tracks by Wheel");
75 sprintf(hname,
"dttf_03_tracks_occupancy_summary");
76 sprintf(mename,
"DTTF Tracks Occupancy");
84 sprintf(hname,
"dttf_05_bx_occupancy");
85 sprintf(mename,
"DTTF Tracks BX Distribution by Wheel");
91 sprintf(hname,
"dttf_06_bx");
92 sprintf(mename,
"DTTF Tracks BX w.r.t. Tracks with BX=0");
97 sprintf(hname,
"dttf_07_quality");
98 sprintf(mename,
"DTTF Tracks Quality distribution");
103 sprintf(hname,
"dttf_08_quality_occupancy");
104 sprintf(mename,
"DTTF Tracks Quality distribution by Wheel");
111 sprintf(hname,
"dttf_09_highQuality_Tracks");
112 sprintf(mename,
"Fraction of DTTF Tracks with Quality>3");
119 sprintf(hname,
"dttf_10_phi_vs_etaCoarse");
120 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy (coarse #eta only, packed values)");
127 sprintf(hname,
"dttf_11_phi_vs_etaFine");
128 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy (fine #eta only, packed values)");
135 sprintf(hname,
"dttf_12_phi_vs_eta");
136 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy");
143 sprintf(hname,
"dttf_13_eta_fine_fraction");
144 sprintf(mename,
"Fraction of DTTF Tracks with Fine #eta Assignment");
152 sprintf(hname,
"dttf_14_eta");
153 sprintf(mename,
"DTTF Tracks #eta distribution (Packed values)");
158 sprintf(hname,
"dttf_15_phi");
159 sprintf(mename,
"DTTF Tracks Phi distribution (Packed values)");
164 sprintf(hname,
"dttf_16_pt");
165 sprintf(mename,
"DTTF Tracks p_{T} distribution (Packed values)");
169 sprintf(hname,
"dttf_17_charge");
170 sprintf(mename,
"DTTF Tracks Charge distribution");
177 sprintf(hname,
"dttf_18_2ndTrack_occupancy_summary");
178 sprintf(mename,
"DTTF 2nd Tracks occupancy w.r.t. Tracks with BX=0");
188 sprintf(hname,
"dttf_gmt_fract_matching" );
189 sprintf(mename,
"Fraction of DTTF tracks matching with GMT tracks" );
201 sprintf(hname,
"dttf_01_tracks_occupancy_test_summary");
202 sprintf(mename,
"DTTF Tracks Occupancy");
214 sprintf(hname,
"dttf_01_nTracks_2ndTrack");
215 sprintf(mename,
"DTTF 2nd Tracks per Wheel distribution");
220 sprintf(hname,
"dttf_02_occupancy_summary_2ndTrack");
221 sprintf(mename,
"DTTF 2nd Tracks distribution by Sector and Wheel");
227 sprintf(hname,
"dttf_03_bx_occupancy_2ndTrack");
228 sprintf(mename,
"DTTF 2nd Tracks BX Distribution by Wheel");
234 sprintf(hname,
"dttf_04_bx_2ndTrack");
235 sprintf(mename,
"Fraction of DTTF Tracks BX w.r.t. Tracks with BX=0");
240 sprintf(hname,
"dttf_05_quality_2ndTrack");
241 sprintf(mename,
"DTTF 2nd Tracks Quality distribution");
247 sprintf(hname,
"dttf_06_quality_occupancy_2ndTrack");
248 sprintf(mename,
"DTTF 2nd Tracks Quality distribution by Wheel");
256 sprintf(hname,
"dttf_07_highQuality_Tracks_2ndTrack");
257 sprintf(mename,
"Fraction of DTTF 2nd Tracks with Quality>3");
264 sprintf(hname,
"dttf_08_phi_vs_eta_2ndTrack");
265 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy for 2nd Tracks");
272 sprintf(hname,
"dttf_09_eta_2ndTrack");
273 sprintf(mename,
"DTTF 2nd Tracks #eta distribution (Packed values)");
278 sprintf(hname,
"dttf_10_phi_2ndTrack");
279 sprintf(mename,
"DTTF 2nd Tracks Phi distribution (Packed values)");
284 sprintf(hname,
"dttf_11_pt_2ndTrack");
285 sprintf(mename,
"DTTF 2nd Tracks p_{T} distribution (Packed values)");
290 sprintf(hname,
"dttf_12_charge_2ndTrack");
291 sprintf(mename,
"DTTF 2nd Tracks Charge distribution");
296 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
300 sprintf( hname,
"dttf_02_nTracks_wh%s",
wheel_[wh].c_str() );
301 sprintf( mename,
"Wheel %s - Number of Tracks",
wheel_[wh].c_str() );
306 sprintf(hname,
"dttf_03_bx_occupancy_wh%s",
wheel_[wh].c_str() );
307 sprintf(mename,
"Wheel %s - DTTF Tracks BX distribution by Sector",
314 sprintf(hname,
"dttf_04_bx_wh%s",
wheel_[wh].c_str());
315 sprintf(mename,
"Wheel %s - DTTF Tracks BX w.r.t. Tracks with BX=0",
wheel_[wh].c_str());
320 sprintf(hname,
"dttf_05_quality_wh%s",
wheel_[wh].c_str() );
321 sprintf(mename,
"Wheel %s - Tracks Quality Distribution",
wheel_[wh].c_str() );
327 sprintf(hname,
"dttf_06_quality_summary_wh%s",
wheel_[wh].c_str() );
328 sprintf(mename,
"Wheel %s - Tracks Quality Distribution by Sector",
336 sprintf(hname,
"dttf_09_etaFine_fraction_wh%s",
wheel_[wh].c_str() );
337 sprintf(mename,
"Wheel %s - Fraction of DTTF Tracks with fine #eta assignment",
344 sprintf(hname,
"dttf_10_eta_wh%s",
wheel_[wh].c_str() );
345 sprintf(mename,
"Wheel %s - DTTF Tracks #eta distribution (Packed values)",
351 sprintf(hname,
"dttf_11_phi_wh%s",
wheel_[wh].c_str() );
352 sprintf(mename,
"Wheel %s - DTTF Tracks Phi distribution (Packed values)",
358 sprintf(hname,
"dttf_12_pt_wh%s",
wheel_[wh].c_str() );
359 sprintf(mename,
"Wheel %s - DTTF Tracks p_{T} distribution (Packed values)",
365 sprintf(hname,
"dttf_13_charge_wh%s",
wheel_[wh].c_str() );
366 sprintf(mename,
"Wheel %s - DTTF Tracks Charge distribution",
375 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
379 sprintf( hname,
"dttf_01_nTracks_wh%s_2ndTrack",
wheel_[wh].c_str() );
380 sprintf( mename,
"Wheel %s - DTTF Number of 2nd Tracks with BX=0",
387 sprintf(hname,
"dttf_02_bx_occupancy_wh%s_2ndTrack",
wheel_[wh].c_str() );
388 sprintf(mename,
"Wheel %s - DTTF 2nd Tracks BX distribution by Sector",
395 sprintf(hname,
"dttf_03_bx_wh%s_2ndTrack",
wheel_[wh].c_str());
396 sprintf(mename,
"Wheel %s - 2nd Tracks BX Distribution",
wheel_[wh].c_str());
424 sprintf( hname,
"%s/dttf_04_tracks_occupancy_by_lumi",
428 if ( ! occupancy_r_ ) {
432 edm::LogInfo(
"L1TDTTFClient::beginLuminosityBlock:RESET") <<
"Reseting plots by lumi!";
433 occupancy_r_->Reset();
470 if ( physEntries > 0 ) {
471 double physScale = 1 / physEntries;
494 if ( entries2ndTrack > 0 ) {
502 "%s/2ND_TRACK_ONLY/dttf_05_quality_summary_wh%s_2ndTrack" );
507 double scale2nd = 1 / entries2ndTrack;
539 int wheelSumBx2nd[4];
542 memset( wheelSumBx, 0, 4 *
sizeof(
int) );
543 memset( wheelSumBx2nd, 0, 4 *
sizeof(
int) );
563 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
572 double wheelEtaAll = 0;
573 double wheelEtaFine = 0;
574 memset( wheelBx, 0, 4 *
sizeof(
int) );
575 memset( wheelBx2nd, 0, 4 *
sizeof(
int) );
578 memset( qualities, 0, 8 *
sizeof(
int) );
585 "%s/dttf_07_phi_vs_etaFine_wh%s",
586 "%s/dttf_08_phi_vs_etaCoarse_wh%s", wh );
589 "%s/2ND_TRACK_ONLY/dttf_06_phi_vs_eta_wh%s_2ndTrack",
596 for (
unsigned int sector = 1; sector < 13; ++sector ) {
601 sprintf( hname,
"%s/BX_BySector/dttf_bx_wh%s_se%d",
604 TH1F * bxsector =
getTH1F(igetter,hname);
606 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
610 for (
unsigned int bx = 1; bx < 4 ; ++bx ) {
612 int bxval = bxsector->GetBinContent( bx );
623 wheelBx[bx] += bxval;
632 sprintf( hname,
"%s/BX_BySector/2ND_TRACK_ONLY/dttf_bx_2ndTrack_wh%s_se%d",
635 TH1F * bxsector2nd =
getTH1F(igetter,hname);
636 if ( ! bxsector2nd ) {
637 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
641 for (
unsigned int bx = 1; bx < 4 ; ++bx ) {
642 int bxval = bxsector2nd->GetBinContent( bx );
649 wheelBx2nd[bx] += bxval;
657 sprintf( hname,
"%s/Charge/dttf_charge_wh%s_se%d",
661 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
671 sprintf( hname,
"%s/PT/dttf_pt_wh%s_se%d",
675 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
686 sprintf( hname,
"%s/Phi/dttf_phi_wh%s_se%d",
690 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
702 double denHighQual = 0;
703 sprintf( hname,
"%s/Quality/dttf_qual_wh%s_se%d",
707 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
714 for (
unsigned int qual = 1; qual < 4 ; ++qual ) {
715 double bincontent = tmp->GetBinContent( qual );
716 qualities[qual] += bincontent;
717 denHighQual += bincontent;
721 for (
unsigned int qual = 4; qual < 8 ; ++qual ) {
722 double bincontent = tmp->GetBinContent( qual );
723 qualities[qual] += bincontent;
725 denHighQual += bincontent;
726 highQual += bincontent;
730 if ( denHighQual > 0 ) highQual /= denHighQual;
737 sprintf( hname,
"%s/Eta/dttf_eta_wh%s_se%d",
741 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
752 sprintf( hname,
"%s/EtaFineFraction/dttf_etaFine_fraction_wh%s_se%d",
756 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
759 double fine = tmp->GetBinContent( 1 );
760 double coarse = tmp->GetBinContent( 2 );
761 double tot = fine + coarse;
763 wheelEtaFine += fine;
774 if ( wheelEtaAll > 0 ) {
787 for (
unsigned int bx = 1; bx < 4; ++bx ) {
791 wheelSumBx[bx] += wheelBx[bx];
795 wheelSumBx2nd[bx] += wheelBx2nd[bx];
803 for (
unsigned int qual = 1; qual < 8 ; ++qual ) {
826 double scale = wheelBx[2];
832 scale = wheelBx2nd[2];
851 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_07_eta_wh%s_2ndTrack",
856 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
865 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_08_phi_wh%s_2ndTrack",
869 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
879 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_09_pt_wh%s_2ndTrack",
883 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
892 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_10_charge_wh%s_2ndTrack",
896 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
905 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_04_quality_wh%s_2ndTrack",
909 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
912 for (
unsigned int qual = 1; qual < 8; ++qual ) {
913 double binqual = tmp->GetBinContent( qual );
925 for (
unsigned int bx = 1; bx < 4; ++bx ) {
933 double scale = wheelSumBx[2];
939 scale = wheelSumBx2nd[2];
954 sprintf( hname,
"%s/dttf_tracks_with_gmt_match",
gmtpath_.c_str() );
955 TH2F * gmt_match =
getTH2F(igetter,hname);
957 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
964 sprintf( hname,
"%s/dttf_tracks_without_gmt_match",
gmtpath_.c_str() );
965 TH2F * gmt_missed =
getTH2F(igetter,hname);
966 if ( ! gmt_missed ) {
967 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
973 sprintf( hname,
"%s/dttf_missing_tracks_in_gmt",
gmtpath_.c_str() );
974 TH2F * gmt_ghost =
getTH2F(igetter,hname);
976 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
981 int match = gmt_match->Integral();
982 int missed = gmt_missed->Integral();
983 int ghost = gmt_ghost->Integral();
984 float tot = match + missed + ghost;
986 double val = ghost/tot;
1003 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get ME "
1019 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get ME "
1042 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
1043 sprintf( hname, path.c_str(),
wheelpath_[wh].c_str(),
wheel_[wh].c_str() );
1051 for (
unsigned int sec = 1; sec < 13 ; ++sec ) {
1052 double denHighQual = occupancySummary->GetBinContent( wh+1, sec );
1054 if ( denHighQual > 0 ) {
1055 for (
unsigned int qual = 4; qual < 8 ; ++qual ) {
1056 val += quality->GetBinContent( qual, sec );
1076 sprintf( hname, path_fine.c_str(),
1079 TH2F * phi_vs_eta_fine =
getTH2F(igetter, hname);
1080 if ( ! phi_vs_eta_fine ) {
1085 sprintf( hname, path_coarse.c_str(),
1087 TH2F * phi_vs_eta_coarse =
getTH2F(igetter,hname);
1088 if ( ! phi_vs_eta_coarse ) {
1093 if ( ! phi_vs_eta_fine || ! phi_vs_eta_coarse ) {
1097 for (
unsigned int phi = 1;
phi < 145 ; ++
phi ) {
1101 case 0 : start = 0; nbins = 18;
break;
1102 case 1 : start = 8; nbins = 20;
break;
1103 case 2 : start = 22; nbins = 10;
break;
1104 case 3 : start = 22; nbins = 20;
break;
1105 case 4 : start = 36; nbins = 20;
break;
1106 case 5 : start = 46; nbins = 18;
break;
1107 default : start = 0; nbins = 0;
break;
1113 double valfine = phi_vs_eta_fine->GetBinContent(
eta,
phi )
1116 double valcoarse = phi_vs_eta_coarse->GetBinContent(
eta,
phi )
1158 sprintf( hname, path.c_str(),
1161 TH2F * phi_vs_eta =
getTH2F(igetter, hname);
1162 if ( ! phi_vs_eta ) {
1163 edm::LogError(
"L1TDTTFClient::buildPhiEtaPlotO:ME") <<
"Failed to get TH1D "
1167 for (
unsigned int phi = 1;
phi < 145 ; ++
phi ) {
1171 case 0 : start = 0; nbins = 18;
break;
1172 case 1 : start = 8; nbins = 20;
break;
1173 case 2 : start = 22; nbins = 10;
break;
1174 case 3 : start = 22; nbins = 20;
break;
1175 case 4 : start = 36; nbins = 20;
break;
1176 case 5 : start = 46; nbins = 18;
break;
1177 default : start = 0; nbins = 0;
break;
1182 double val = phi_vs_eta->GetBinContent(
eta,
phi )
1187 double underflow = phi_vs_eta->GetBinContent( 0,
phi )
1191 double overflow = phi_vs_eta->GetBinContent( nbins+1,
phi )
MonitorElement * dttf_bx_integ_2ndTrack
MonitorElement * dttf_gmt_matching
MonitorElement * dttf_occupancySummary
MonitorElement * dttf_quality_summary
void setBinContent(int binx, double content)
set content of bin (1-D)
L1TDTTFClient(const edm::ParameterSet &ps)
Constructor.
tuple start
Check for commandline option errors.
MonitorElement * dttf_q_wheel[6]
MonitorElement * dttf_eta_integ_2ndTrack
MonitorElement * dttf_quality_integ_2ndTrack
MonitorElement * dttf_eta_wheel[6]
void buildSummaries(DQMStore::IGetter &igetter)
MonitorElement * dttf_nTracks_integ
MonitorElement * get(const std::string &path)
MonitorElement * dttf_quality_integ
TH1F * getTH1F(DQMStore::IGetter &igetter, const char *hname)
std::string wheelpath_[6]
void buildPhiEtaPlotO(DQMStore::IGetter &igetter, MonitorElement *phi_eta_integ, const std::string &path, int wh)
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * dttf_bx_wheel_integ_2ndTrack[6]
void buildHighQualityPlot(DQMStore::IGetter &igetter, TH2F *occupancySummary, MonitorElement *highQual_Summary, const std::string &path)
void book(DQMStore::IBooker &ibooker)
MonitorElement * dttf_bx_wheel_summary[6]
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
MonitorElement * dttf_pt_integ_2ndTrack
MonitorElement * dttf_bx_integ
TH2F * getTH2F(DQMStore::IGetter &igetter, const char *hname)
MonitorElement * dttf_phi_eta_fine_integ
MonitorElement * dttf_highQual_Summary_2ndTrack
MonitorElement * dttf_phi_wheel[6]
MonitorElement * dttf_phi_eta_integ
MonitorElement * dttf_quality_summary_wheel[6]
MonitorElement * dttf_pt_integ
tuple path
else: Piece not in the list, fine.
MonitorElement * dttf_phi_eta_coarse_integ
virtual ~L1TDTTFClient()
Destructor.
TH2F * occupancy_r_
counter
MonitorElement * dttf_occupancySummary_2ndTrack
MonitorElement * book1D(Args &&...args)
MonitorElement * dttf_eta_integ
MonitorElement * dttf_2ndTrack_Summary
MonitorElement * dttf_q_integ_2ndTrack
MonitorElement * dttf_bx_wheel_summary_2ndTrack[6]
MonitorElement * dttf_bx_summary
MonitorElement * dttf_quality_wheel[6]
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
void makeSummary(DQMStore::IGetter &igetter)
TH1F * getTH1F(void) const
MonitorElement * dttf_eta_fine_fraction
std::vector< std::vector< double > > tmp
std::string l1tdttffolder_
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * dttf_occupancySummary_test
MonitorElement * dttf_fine_fraction_wh[6]
void setQualLabel(MonitorElement *me, int axis)
MonitorElement * dttf_nTracks_wheel[6]
MonitorElement * dttf_bx_summary_2ndTrack
MonitorElement * dttf_nTracks_integ_2ndTrack
void buildPhiEtaPlotOFC(DQMStore::IGetter &igetter, MonitorElement *phi_eta_fine_integ, MonitorElement *phi_eta_coarse_integ, MonitorElement *phi_eta_integ, const std::string &path_fine, const std::string &path_coarse, int wh)
void setGMTsummary(DQMStore::IGetter &igetter)
MonitorElement * dttf_phi_integ_2ndTrack
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
MonitorElement * dttf_pt_wheel[6]
MonitorElement * dttf_nTracks_wheel_2ndTrack[6]
TH2F * getTH2F(void) const
MonitorElement * dttf_phi_integ
MonitorElement * dttf_highQual_Summary
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
MonitorElement * dttf_q_integ
MonitorElement * dttf_bx_wheel_integ[6]
std::string inclusivepath_
void setWheelLabel(MonitorElement *me)
MonitorElement * dttf_quality_summary_2ndTrack
MonitorElement * dttf_phi_eta_integ_2ndTrack