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... ";
40 edm::LogInfo(
"L1TDTTFClient")<<
"[L1TDTTFClient]: Begin Job";
67 sprintf(hname,
"dttf_02_nTracks");
68 sprintf(mename,
"DTTF Tracks by Wheel");
73 sprintf(hname,
"dttf_03_tracks_occupancy_summary");
74 sprintf(mename,
"DTTF Tracks Occupancy");
82 sprintf(hname,
"dttf_05_bx_occupancy");
83 sprintf(mename,
"DTTF Tracks BX Distribution by Wheel");
89 sprintf(hname,
"dttf_06_bx");
90 sprintf(mename,
"DTTF Tracks BX w.r.t. Tracks with BX=0");
95 sprintf(hname,
"dttf_07_quality");
96 sprintf(mename,
"DTTF Tracks Quality distribution");
101 sprintf(hname,
"dttf_08_quality_occupancy");
102 sprintf(mename,
"DTTF Tracks Quality distribution by Wheel");
109 sprintf(hname,
"dttf_09_highQuality_Tracks");
110 sprintf(mename,
"Fraction of DTTF Tracks with Quality>3");
117 sprintf(hname,
"dttf_10_phi_vs_etaCoarse");
118 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy (coarse #eta only, packed values)");
125 sprintf(hname,
"dttf_11_phi_vs_etaFine");
126 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy (fine #eta only, packed values)");
133 sprintf(hname,
"dttf_12_phi_vs_eta");
134 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy");
141 sprintf(hname,
"dttf_13_eta_fine_fraction");
142 sprintf(mename,
"Fraction of DTTF Tracks with Fine #eta Assignment");
150 sprintf(hname,
"dttf_14_eta");
151 sprintf(mename,
"DTTF Tracks #eta distribution (Packed values)");
156 sprintf(hname,
"dttf_15_phi");
157 sprintf(mename,
"DTTF Tracks Phi distribution (Packed values)");
162 sprintf(hname,
"dttf_16_pt");
163 sprintf(mename,
"DTTF Tracks p_{T} distribution (Packed values)");
167 sprintf(hname,
"dttf_17_charge");
168 sprintf(mename,
"DTTF Tracks Charge distribution");
175 sprintf(hname,
"dttf_18_2ndTrack_occupancy_summary");
176 sprintf(mename,
"DTTF 2nd Tracks occupancy w.r.t. Tracks with BX=0");
186 sprintf(hname,
"dttf_gmt_fract_matching" );
187 sprintf(mename,
"Fraction of DTTF tracks matching with GMT tracks" );
199 sprintf(hname,
"dttf_01_tracks_occupancy_test_summary");
200 sprintf(mename,
"DTTF Tracks Occupancy");
212 sprintf(hname,
"dttf_01_nTracks_2ndTrack");
213 sprintf(mename,
"DTTF 2nd Tracks per Wheel distribution");
218 sprintf(hname,
"dttf_02_occupancy_summary_2ndTrack");
219 sprintf(mename,
"DTTF 2nd Tracks distribution by Sector and Wheel");
225 sprintf(hname,
"dttf_03_bx_occupancy_2ndTrack");
226 sprintf(mename,
"DTTF 2nd Tracks BX Distribution by Wheel");
232 sprintf(hname,
"dttf_04_bx_2ndTrack");
233 sprintf(mename,
"Fraction of DTTF Tracks BX w.r.t. Tracks with BX=0");
238 sprintf(hname,
"dttf_05_quality_2ndTrack");
239 sprintf(mename,
"DTTF 2nd Tracks Quality distribution");
245 sprintf(hname,
"dttf_06_quality_occupancy_2ndTrack");
246 sprintf(mename,
"DTTF 2nd Tracks Quality distribution by Wheel");
254 sprintf(hname,
"dttf_07_highQuality_Tracks_2ndTrack");
255 sprintf(mename,
"Fraction of DTTF 2nd Tracks with Quality>3");
262 sprintf(hname,
"dttf_08_phi_vs_eta_2ndTrack");
263 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy for 2nd Tracks");
270 sprintf(hname,
"dttf_09_eta_2ndTrack");
271 sprintf(mename,
"DTTF 2nd Tracks #eta distribution (Packed values)");
276 sprintf(hname,
"dttf_10_phi_2ndTrack");
277 sprintf(mename,
"DTTF 2nd Tracks Phi distribution (Packed values)");
282 sprintf(hname,
"dttf_11_pt_2ndTrack");
283 sprintf(mename,
"DTTF 2nd Tracks p_{T} distribution (Packed values)");
288 sprintf(hname,
"dttf_12_charge_2ndTrack");
289 sprintf(mename,
"DTTF 2nd Tracks Charge distribution");
294 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
298 sprintf( hname,
"dttf_02_nTracks_wh%s",
wheel_[wh].c_str() );
299 sprintf( mename,
"Wheel %s - Number of Tracks",
wheel_[wh].c_str() );
304 sprintf(hname,
"dttf_03_bx_occupancy_wh%s",
wheel_[wh].c_str() );
305 sprintf(mename,
"Wheel %s - DTTF Tracks BX distribution by Sector",
312 sprintf(hname,
"dttf_04_bx_wh%s",
wheel_[wh].c_str());
313 sprintf(mename,
"Wheel %s - DTTF Tracks BX w.r.t. Tracks with BX=0",
wheel_[wh].c_str());
318 sprintf(hname,
"dttf_05_quality_wh%s",
wheel_[wh].c_str() );
319 sprintf(mename,
"Wheel %s - Tracks Quality Distribution",
wheel_[wh].c_str() );
325 sprintf(hname,
"dttf_06_quality_summary_wh%s",
wheel_[wh].c_str() );
326 sprintf(mename,
"Wheel %s - Tracks Quality Distribution by Sector",
334 sprintf(hname,
"dttf_09_etaFine_fraction_wh%s",
wheel_[wh].c_str() );
335 sprintf(mename,
"Wheel %s - Fraction of DTTF Tracks with fine #eta assignment",
342 sprintf(hname,
"dttf_10_eta_wh%s",
wheel_[wh].c_str() );
343 sprintf(mename,
"Wheel %s - DTTF Tracks #eta distribution (Packed values)",
349 sprintf(hname,
"dttf_11_phi_wh%s",
wheel_[wh].c_str() );
350 sprintf(mename,
"Wheel %s - DTTF Tracks Phi distribution (Packed values)",
356 sprintf(hname,
"dttf_12_pt_wh%s",
wheel_[wh].c_str() );
357 sprintf(mename,
"Wheel %s - DTTF Tracks p_{T} distribution (Packed values)",
363 sprintf(hname,
"dttf_13_charge_wh%s",
wheel_[wh].c_str() );
364 sprintf(mename,
"Wheel %s - DTTF Tracks Charge distribution",
373 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
377 sprintf( hname,
"dttf_01_nTracks_wh%s_2ndTrack",
wheel_[wh].c_str() );
378 sprintf( mename,
"Wheel %s - DTTF Number of 2nd Tracks with BX=0",
385 sprintf(hname,
"dttf_02_bx_occupancy_wh%s_2ndTrack",
wheel_[wh].c_str() );
386 sprintf(mename,
"Wheel %s - DTTF 2nd Tracks BX distribution by Sector",
393 sprintf(hname,
"dttf_03_bx_wh%s_2ndTrack",
wheel_[wh].c_str());
394 sprintf(mename,
"Wheel %s - 2nd Tracks BX Distribution",
wheel_[wh].c_str());
422 sprintf( hname,
"%s/dttf_04_tracks_occupancy_by_lumi",
426 if ( ! occupancy_r_ ) {
430 edm::LogInfo(
"L1TDTTFClient::beginLuminosityBlock:RESET") <<
"Reseting plots by lumi!";
431 occupancy_r_->Reset();
468 if ( physEntries > 0 ) {
469 double physScale = 1 / physEntries;
492 if ( entries2ndTrack > 0 ) {
500 "%s/2ND_TRACK_ONLY/dttf_05_quality_summary_wh%s_2ndTrack" );
505 double scale2nd = 1 / entries2ndTrack;
537 int wheelSumBx2nd[4];
540 memset( wheelSumBx, 0, 4 *
sizeof(
int) );
541 memset( wheelSumBx2nd, 0, 4 *
sizeof(
int) );
561 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
570 double wheelEtaAll = 0;
571 double wheelEtaFine = 0;
572 memset( wheelBx, 0, 4 *
sizeof(
int) );
573 memset( wheelBx2nd, 0, 4 *
sizeof(
int) );
576 memset( qualities, 0, 8 *
sizeof(
int) );
583 "%s/dttf_07_phi_vs_etaFine_wh%s",
584 "%s/dttf_08_phi_vs_etaCoarse_wh%s", wh );
587 "%s/2ND_TRACK_ONLY/dttf_06_phi_vs_eta_wh%s_2ndTrack",
594 for (
unsigned int sector = 1; sector < 13; ++sector ) {
599 sprintf( hname,
"%s/BX_BySector/dttf_bx_wh%s_se%d",
602 TH1F * bxsector =
getTH1F(igetter,hname);
604 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
608 for (
unsigned int bx = 1; bx < 4 ; ++bx ) {
610 int bxval = bxsector->GetBinContent( bx );
621 wheelBx[bx] += bxval;
630 sprintf( hname,
"%s/BX_BySector/2ND_TRACK_ONLY/dttf_bx_2ndTrack_wh%s_se%d",
633 TH1F * bxsector2nd =
getTH1F(igetter,hname);
634 if ( ! bxsector2nd ) {
635 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
639 for (
unsigned int bx = 1; bx < 4 ; ++bx ) {
640 int bxval = bxsector2nd->GetBinContent( bx );
647 wheelBx2nd[bx] += bxval;
655 sprintf( hname,
"%s/Charge/dttf_charge_wh%s_se%d",
659 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
669 sprintf( hname,
"%s/PT/dttf_pt_wh%s_se%d",
673 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
684 sprintf( hname,
"%s/Phi/dttf_phi_wh%s_se%d",
688 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
700 double denHighQual = 0;
701 sprintf( hname,
"%s/Quality/dttf_qual_wh%s_se%d",
705 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
712 for (
unsigned int qual = 1; qual < 4 ; ++qual ) {
713 double bincontent = tmp->GetBinContent( qual );
714 qualities[qual] += bincontent;
715 denHighQual += bincontent;
719 for (
unsigned int qual = 4; qual < 8 ; ++qual ) {
720 double bincontent = tmp->GetBinContent( qual );
721 qualities[qual] += bincontent;
723 denHighQual += bincontent;
724 highQual += bincontent;
728 if ( denHighQual > 0 ) highQual /= denHighQual;
735 sprintf( hname,
"%s/Eta/dttf_eta_wh%s_se%d",
739 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
750 sprintf( hname,
"%s/EtaFineFraction/dttf_etaFine_fraction_wh%s_se%d",
754 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
757 double fine = tmp->GetBinContent( 1 );
758 double coarse = tmp->GetBinContent( 2 );
759 double tot = fine + coarse;
761 wheelEtaFine += fine;
772 if ( wheelEtaAll > 0 ) {
785 for (
unsigned int bx = 1; bx < 4; ++bx ) {
789 wheelSumBx[bx] += wheelBx[bx];
793 wheelSumBx2nd[bx] += wheelBx2nd[bx];
801 for (
unsigned int qual = 1; qual < 8 ; ++qual ) {
824 double scale = wheelBx[2];
830 scale = wheelBx2nd[2];
849 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_07_eta_wh%s_2ndTrack",
854 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
863 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_08_phi_wh%s_2ndTrack",
867 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
877 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_09_pt_wh%s_2ndTrack",
881 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
890 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_10_charge_wh%s_2ndTrack",
894 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
903 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_04_quality_wh%s_2ndTrack",
907 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
910 for (
unsigned int qual = 1; qual < 8; ++qual ) {
911 double binqual = tmp->GetBinContent( qual );
923 for (
unsigned int bx = 1; bx < 4; ++bx ) {
931 double scale = wheelSumBx[2];
937 scale = wheelSumBx2nd[2];
952 sprintf( hname,
"%s/dttf_tracks_with_gmt_match",
gmtpath_.c_str() );
953 TH2F * gmt_match =
getTH2F(igetter,hname);
955 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
962 sprintf( hname,
"%s/dttf_tracks_without_gmt_match",
gmtpath_.c_str() );
963 TH2F * gmt_missed =
getTH2F(igetter,hname);
964 if ( ! gmt_missed ) {
965 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
971 sprintf( hname,
"%s/dttf_missing_tracks_in_gmt",
gmtpath_.c_str() );
972 TH2F * gmt_ghost =
getTH2F(igetter,hname);
974 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
979 int match = gmt_match->Integral();
980 int missed = gmt_missed->Integral();
981 int ghost = gmt_ghost->Integral();
982 float tot = match + missed + ghost;
984 double val = ghost/tot;
1001 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get ME "
1017 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get ME "
1040 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
1041 sprintf( hname, path.c_str(),
wheelpath_[wh].c_str(),
wheel_[wh].c_str() );
1049 for (
unsigned int sec = 1; sec < 13 ; ++sec ) {
1050 double denHighQual = occupancySummary->GetBinContent( wh+1, sec );
1052 if ( denHighQual > 0 ) {
1053 for (
unsigned int qual = 4; qual < 8 ; ++qual ) {
1054 val += quality->GetBinContent( qual, sec );
1074 sprintf( hname, path_fine.c_str(),
1077 TH2F * phi_vs_eta_fine =
getTH2F(igetter, hname);
1078 if ( ! phi_vs_eta_fine ) {
1083 sprintf( hname, path_coarse.c_str(),
1085 TH2F * phi_vs_eta_coarse =
getTH2F(igetter,hname);
1086 if ( ! phi_vs_eta_coarse ) {
1091 if ( ! phi_vs_eta_fine || ! phi_vs_eta_coarse ) {
1095 for (
unsigned int phi = 1;
phi < 145 ; ++
phi ) {
1099 case 0 : start = 0; nbins = 18;
break;
1100 case 1 : start = 8; nbins = 20;
break;
1101 case 2 : start = 22; nbins = 10;
break;
1102 case 3 : start = 22; nbins = 20;
break;
1103 case 4 : start = 36; nbins = 20;
break;
1104 case 5 : start = 46; nbins = 18;
break;
1105 default : start = 0; nbins = 0;
break;
1111 double valfine = phi_vs_eta_fine->GetBinContent(
eta,
phi )
1114 double valcoarse = phi_vs_eta_coarse->GetBinContent(
eta,
phi )
1156 sprintf( hname, path.c_str(),
1159 TH2F * phi_vs_eta =
getTH2F(igetter, hname);
1160 if ( ! phi_vs_eta ) {
1161 edm::LogError(
"L1TDTTFClient::buildPhiEtaPlotO:ME") <<
"Failed to get TH1D "
1165 for (
unsigned int phi = 1;
phi < 145 ; ++
phi ) {
1169 case 0 : start = 0; nbins = 18;
break;
1170 case 1 : start = 8; nbins = 20;
break;
1171 case 2 : start = 22; nbins = 10;
break;
1172 case 3 : start = 22; nbins = 20;
break;
1173 case 4 : start = 36; nbins = 20;
break;
1174 case 5 : start = 46; nbins = 18;
break;
1175 default : start = 0; nbins = 0;
break;
1180 double val = phi_vs_eta->GetBinContent(
eta,
phi )
1185 double underflow = phi_vs_eta->GetBinContent( 0,
phi )
1189 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