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";
71 sprintf(hname,
"dttf_02_nTracks");
72 sprintf(mename,
"DTTF Tracks by Wheel");
77 sprintf(hname,
"dttf_03_tracks_occupancy_summary");
78 sprintf(mename,
"DTTF Tracks Occupancy");
86 sprintf(hname,
"dttf_05_bx_occupancy");
87 sprintf(mename,
"DTTF Tracks BX Distribution by Wheel");
93 sprintf(hname,
"dttf_06_bx");
94 sprintf(mename,
"DTTF Tracks BX w.r.t. Tracks with BX=0");
99 sprintf(hname,
"dttf_07_quality");
100 sprintf(mename,
"DTTF Tracks Quality distribution");
105 sprintf(hname,
"dttf_08_quality_occupancy");
106 sprintf(mename,
"DTTF Tracks Quality distribution by Wheel");
113 sprintf(hname,
"dttf_09_highQuality_Tracks");
114 sprintf(mename,
"Fraction of DTTF Tracks with Quality>3");
121 sprintf(hname,
"dttf_10_phi_vs_etaCoarse");
122 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy (coarse #eta only, packed values)");
129 sprintf(hname,
"dttf_11_phi_vs_etaFine");
130 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy (fine #eta only, packed values)");
137 sprintf(hname,
"dttf_12_phi_vs_eta");
138 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy");
145 sprintf(hname,
"dttf_13_eta_fine_fraction");
146 sprintf(mename,
"Fraction of DTTF Tracks with Fine #eta Assignment");
154 sprintf(hname,
"dttf_14_eta");
155 sprintf(mename,
"DTTF Tracks #eta distribution (Packed values)");
160 sprintf(hname,
"dttf_15_phi");
161 sprintf(mename,
"DTTF Tracks Phi distribution (Packed values)");
166 sprintf(hname,
"dttf_16_pt");
167 sprintf(mename,
"DTTF Tracks p_{T} distribution (Packed values)");
172 sprintf(hname,
"dttf_17_charge");
173 sprintf(mename,
"DTTF Tracks Charge distribution");
180 sprintf(hname,
"dttf_18_2ndTrack_occupancy_summary");
181 sprintf(mename,
"DTTF 2nd Tracks occupancy w.r.t. Tracks with BX=0");
191 sprintf(hname,
"dttf_gmt_fract_matching" );
192 sprintf(mename,
"Fraction of DTTF tracks matching with GMT tracks" );
204 sprintf(hname,
"dttf_01_tracks_occupancy_test_summary");
205 sprintf(mename,
"DTTF Tracks Occupancy");
217 sprintf(hname,
"dttf_01_nTracks_2ndTrack");
218 sprintf(mename,
"DTTF 2nd Tracks per Wheel distribution");
223 sprintf(hname,
"dttf_02_occupancy_summary_2ndTrack");
224 sprintf(mename,
"DTTF 2nd Tracks distribution by Sector and Wheel");
230 sprintf(hname,
"dttf_03_bx_occupancy_2ndTrack");
231 sprintf(mename,
"DTTF 2nd Tracks BX Distribution by Wheel");
237 sprintf(hname,
"dttf_04_bx_2ndTrack");
238 sprintf(mename,
"Fraction of DTTF Tracks BX w.r.t. Tracks with BX=0");
243 sprintf(hname,
"dttf_05_quality_2ndTrack");
244 sprintf(mename,
"DTTF 2nd Tracks Quality distribution");
250 sprintf(hname,
"dttf_06_quality_occupancy_2ndTrack");
251 sprintf(mename,
"DTTF 2nd Tracks Quality distribution by Wheel");
259 sprintf(hname,
"dttf_07_highQuality_Tracks_2ndTrack");
260 sprintf(mename,
"Fraction of DTTF 2nd Tracks with Quality>3");
267 sprintf(hname,
"dttf_08_phi_vs_eta_2ndTrack");
268 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy for 2nd Tracks");
275 sprintf(hname,
"dttf_09_eta_2ndTrack");
276 sprintf(mename,
"DTTF 2nd Tracks #eta distribution (Packed values)");
281 sprintf(hname,
"dttf_10_phi_2ndTrack");
282 sprintf(mename,
"DTTF 2nd Tracks Phi distribution (Packed values)");
287 sprintf(hname,
"dttf_11_pt_2ndTrack");
288 sprintf(mename,
"DTTF 2nd Tracks p_{T} distribution (Packed values)");
293 sprintf(hname,
"dttf_12_charge_2ndTrack");
294 sprintf(mename,
"DTTF 2nd Tracks Charge distribution");
299 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
303 sprintf( hname,
"dttf_02_nTracks_wh%s",
wheel_[wh].c_str() );
304 sprintf( mename,
"Wheel %s - Number of Tracks",
wheel_[wh].c_str() );
309 sprintf(hname,
"dttf_03_bx_occupancy_wh%s",
wheel_[wh].c_str() );
310 sprintf(mename,
"Wheel %s - DTTF Tracks BX distribution by Sector",
317 sprintf(hname,
"dttf_04_bx_wh%s",
wheel_[wh].c_str());
318 sprintf(mename,
"Wheel %s - DTTF Tracks BX w.r.t. Tracks with BX=0",
wheel_[wh].c_str());
323 sprintf(hname,
"dttf_05_quality_wh%s",
wheel_[wh].c_str() );
324 sprintf(mename,
"Wheel %s - Tracks Quality Distribution",
wheel_[wh].c_str() );
330 sprintf(hname,
"dttf_06_quality_summary_wh%s",
wheel_[wh].c_str() );
331 sprintf(mename,
"Wheel %s - Tracks Quality Distribution by Sector",
339 sprintf(hname,
"dttf_09_etaFine_fraction_wh%s",
wheel_[wh].c_str() );
340 sprintf(mename,
"Wheel %s - Fraction of DTTF Tracks with fine #eta assignment",
347 sprintf(hname,
"dttf_10_eta_wh%s",
wheel_[wh].c_str() );
348 sprintf(mename,
"Wheel %s - DTTF Tracks #eta distribution (Packed values)",
354 sprintf(hname,
"dttf_11_phi_wh%s",
wheel_[wh].c_str() );
355 sprintf(mename,
"Wheel %s - DTTF Tracks Phi distribution (Packed values)",
361 sprintf(hname,
"dttf_12_pt_wh%s",
wheel_[wh].c_str() );
362 sprintf(mename,
"Wheel %s - DTTF Tracks p_{T} distribution (Packed values)",
368 sprintf(hname,
"dttf_13_charge_wh%s",
wheel_[wh].c_str() );
369 sprintf(mename,
"Wheel %s - DTTF Tracks Charge distribution",
378 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
382 sprintf( hname,
"dttf_01_nTracks_wh%s_2ndTrack",
wheel_[wh].c_str() );
383 sprintf( mename,
"Wheel %s - DTTF Number of 2nd Tracks with BX=0",
390 sprintf(hname,
"dttf_02_bx_occupancy_wh%s_2ndTrack",
wheel_[wh].c_str() );
391 sprintf(mename,
"Wheel %s - DTTF 2nd Tracks BX distribution by Sector",
398 sprintf(hname,
"dttf_03_bx_wh%s_2ndTrack",
wheel_[wh].c_str());
399 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();
498 if ( physEntries > 0 ) {
499 double physScale = 1 / physEntries;
522 if ( entries2ndTrack > 0 ) {
530 "%s/2ND_TRACK_ONLY/dttf_05_quality_summary_wh%s_2ndTrack" );
535 double scale2nd = 1 / entries2ndTrack;
567 int wheelSumBx2nd[4];
570 memset( wheelSumBx, 0, 4 *
sizeof(
int) );
571 memset( wheelSumBx2nd, 0, 4 *
sizeof(
int) );
591 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
600 double wheelEtaAll = 0;
601 double wheelEtaFine = 0;
602 memset( wheelBx, 0, 4 *
sizeof(
int) );
603 memset( wheelBx2nd, 0, 4 *
sizeof(
int) );
606 memset( qualities, 0, 8 *
sizeof(
int) );
613 "%s/dttf_07_phi_vs_etaFine_wh%s",
614 "%s/dttf_08_phi_vs_etaCoarse_wh%s", wh );
617 "%s/2ND_TRACK_ONLY/dttf_06_phi_vs_eta_wh%s_2ndTrack",
624 for (
unsigned int sector = 1; sector < 13; ++sector ) {
629 sprintf( hname,
"%s/BX_BySector/dttf_bx_wh%s_se%d",
632 TH1F * bxsector =
getTH1F(hname);
634 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
638 for (
unsigned int bx = 1; bx < 4 ; ++bx ) {
640 int bxval = bxsector->GetBinContent( bx );
651 wheelBx[bx] += bxval;
660 sprintf( hname,
"%s/BX_BySector/2ND_TRACK_ONLY/dttf_bx_2ndTrack_wh%s_se%d",
663 TH1F * bxsector2nd =
getTH1F(hname);
664 if ( ! bxsector2nd ) {
665 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
669 for (
unsigned int bx = 1; bx < 4 ; ++bx ) {
670 int bxval = bxsector2nd->GetBinContent( bx );
677 wheelBx2nd[bx] += bxval;
685 sprintf( hname,
"%s/Charge/dttf_charge_wh%s_se%d",
689 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
699 sprintf( hname,
"%s/PT/dttf_pt_wh%s_se%d",
703 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
714 sprintf( hname,
"%s/Phi/dttf_phi_wh%s_se%d",
718 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
730 double denHighQual = 0;
731 sprintf( hname,
"%s/Quality/dttf_qual_wh%s_se%d",
735 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
742 for (
unsigned int qual = 1; qual < 4 ; ++qual ) {
743 double bincontent = tmp->GetBinContent( qual );
744 qualities[qual] += bincontent;
745 denHighQual += bincontent;
749 for (
unsigned int qual = 4; qual < 8 ; ++qual ) {
750 double bincontent = tmp->GetBinContent( qual );
751 qualities[qual] += bincontent;
753 denHighQual += bincontent;
754 highQual += bincontent;
758 if ( denHighQual > 0 ) highQual /= denHighQual;
765 sprintf( hname,
"%s/Eta/dttf_eta_wh%s_se%d",
769 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
780 sprintf( hname,
"%s/EtaFineFraction/dttf_etaFine_fraction_wh%s_se%d",
784 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
787 double fine = tmp->GetBinContent( 1 );
788 double coarse = tmp->GetBinContent( 2 );
789 double tot = fine + coarse;
791 wheelEtaFine += fine;
802 if ( wheelEtaAll > 0 ) {
815 for (
unsigned int bx = 1; bx < 4; ++bx ) {
819 wheelSumBx[bx] += wheelBx[bx];
823 wheelSumBx2nd[bx] += wheelBx2nd[bx];
831 for (
unsigned int qual = 1; qual < 8 ; ++qual ) {
854 double scale = wheelBx[2];
860 scale = wheelBx2nd[2];
879 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_07_eta_wh%s_2ndTrack",
884 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
893 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_08_phi_wh%s_2ndTrack",
897 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
907 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_09_pt_wh%s_2ndTrack",
911 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
920 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_10_charge_wh%s_2ndTrack",
924 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
933 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_04_quality_wh%s_2ndTrack",
937 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
940 for (
unsigned int qual = 1; qual < 8; ++qual ) {
941 double binqual = tmp->GetBinContent( qual );
953 for (
unsigned int bx = 1; bx < 4; ++bx ) {
961 double scale = wheelSumBx[2];
967 scale = wheelSumBx2nd[2];
982 sprintf( hname,
"%s/dttf_tracks_with_gmt_match",
gmtpath_.c_str() );
983 TH2F * gmt_match =
getTH2F(hname);
985 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
992 sprintf( hname,
"%s/dttf_tracks_without_gmt_match",
gmtpath_.c_str() );
993 TH2F * gmt_missed =
getTH2F(hname);
994 if ( ! gmt_missed ) {
995 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
1001 sprintf( hname,
"%s/dttf_missing_tracks_in_gmt",
gmtpath_.c_str() );
1002 TH2F * gmt_ghost =
getTH2F(hname);
1003 if ( ! gmt_ghost ) {
1004 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
1009 int match = gmt_match->Integral();
1010 int missed = gmt_missed->Integral();
1011 int ghost = gmt_ghost->Integral();
1012 float tot = match + missed + ghost;
1014 double val = ghost/tot;
1031 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get ME "
1051 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get ME "
1078 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
1079 sprintf( hname, path.c_str(),
wheelpath_[wh].c_str(),
wheel_[wh].c_str() );
1081 TH2F * quality =
getTH2F(hname);
1087 for (
unsigned int sec = 1; sec < 13 ; ++sec ) {
1088 double denHighQual = occupancySummary->GetBinContent( wh+1, sec );
1090 if ( denHighQual > 0 ) {
1091 for (
unsigned int qual = 4; qual < 8 ; ++qual ) {
1092 val += quality->GetBinContent( qual, sec );
1112 sprintf( hname, path_fine.c_str(),
1115 TH2F * phi_vs_eta_fine =
getTH2F(hname);
1116 if ( ! phi_vs_eta_fine ) {
1121 sprintf( hname, path_coarse.c_str(),
1123 TH2F * phi_vs_eta_coarse =
getTH2F(hname);
1124 if ( ! phi_vs_eta_coarse ) {
1129 if ( ! phi_vs_eta_fine || ! phi_vs_eta_coarse ) {
1133 for (
unsigned int phi = 1;
phi < 145 ; ++
phi ) {
1137 case 0 : start = 0; nbins = 18;
break;
1138 case 1 : start = 8; nbins = 20;
break;
1139 case 2 : start = 22; nbins = 10;
break;
1140 case 3 : start = 22; nbins = 20;
break;
1141 case 4 : start = 36; nbins = 20;
break;
1142 case 5 : start = 46; nbins = 18;
break;
1143 default : start = 0; nbins = 0;
break;
1149 double valfine = phi_vs_eta_fine->GetBinContent(
eta,
phi )
1152 double valcoarse = phi_vs_eta_coarse->GetBinContent(
eta,
phi )
1194 sprintf( hname, path.c_str(),
1197 TH2F * phi_vs_eta =
getTH2F(hname);
1198 if ( ! phi_vs_eta ) {
1199 edm::LogError(
"L1TDTTFClient::buildPhiEtaPlotO:ME") <<
"Failed to get TH1D "
1203 for (
unsigned int phi = 1;
phi < 145 ; ++
phi ) {
1207 case 0 : start = 0; nbins = 18;
break;
1208 case 1 : start = 8; nbins = 20;
break;
1209 case 2 : start = 22; nbins = 10;
break;
1210 case 3 : start = 22; nbins = 20;
break;
1211 case 4 : start = 36; nbins = 20;
break;
1212 case 5 : start = 46; nbins = 18;
break;
1213 default : start = 0; nbins = 0;
break;
1218 double val = phi_vs_eta->GetBinContent(
eta,
phi )
1223 double underflow = phi_vs_eta->GetBinContent( 0,
phi )
1227 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]
TH2F * getTH2F(const char *hname)
MonitorElement * dttf_eta_integ_2ndTrack
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void buildPhiEtaPlotO(MonitorElement *phi_eta_integ, const std::string &path, int wh)
MonitorElement * dttf_quality_integ_2ndTrack
MonitorElement * dttf_eta_wheel[6]
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
DQM Client Diagnostic.
void beginJob(void)
BeginJob.
MonitorElement * dttf_nTracks_integ
MonitorElement * dttf_quality_integ
std::string wheelpath_[6]
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]
MonitorElement * dttf_bx_wheel_summary[6]
MonitorElement * dttf_pt_integ_2ndTrack
MonitorElement * dttf_bx_integ
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
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
MonitorElement * dttf_eta_integ
MonitorElement * dttf_2ndTrack_Summary
MonitorElement * dttf_q_integ_2ndTrack
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
MonitorElement * dttf_bx_wheel_summary_2ndTrack[6]
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
MonitorElement * dttf_bx_summary
MonitorElement * dttf_quality_wheel[6]
TH1F * getTH1F(void) const
TH1F * getTH1F(const char *hname)
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)
void buildHighQualityPlot(TH2F *occupancySummary, MonitorElement *highQual_Summary, const std::string &path)
MonitorElement * dttf_occupancySummary_test
MonitorElement * dttf_fine_fraction_wh[6]
void setQualLabel(MonitorElement *me, int axis)
MonitorElement * dttf_nTracks_wheel[6]
void analyze(const edm::Event &e, const edm::EventSetup &c)
Fake Analyze.
void buildPhiEtaPlotOFC(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)
MonitorElement * dttf_bx_summary_2ndTrack
MonitorElement * dttf_nTracks_integ_2ndTrack
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 * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
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 setCurrentFolder(const std::string &fullpath)
void setWheelLabel(MonitorElement *me)
MonitorElement * dttf_quality_summary_2ndTrack
MonitorElement * dttf_phi_eta_integ_2ndTrack