22 : l1tdttffolder_ ( ps.getUntrackedParameter<std::
string> (
"l1tSourceFolder",
"L1T/L1TDTTF") ),
23 dttfSource_( ps.getParameter< edm::InputTag >(
"dttfSource") ),
24 online_( ps.getUntrackedParameter<bool>(
"online",
true) ),
25 resetafterlumi_( ps.getUntrackedParameter<int>(
"resetAfterLumi", 3) ),
26 counterLS_(0), occupancy_r_(0)
34 edm::LogInfo(
"L1TDTTFClient")<<
"[L1TDTTFClient]: ending... ";
42 edm::LogInfo(
"L1TDTTFClient")<<
"[L1TDTTFClient]: Begin Job";
73 sprintf(hname,
"dttf_02_nTracks");
74 sprintf(mename,
"DTTF Tracks by Wheel");
79 sprintf(hname,
"dttf_03_tracks_occupancy_summary");
80 sprintf(mename,
"DTTF Tracks Occupancy");
88 sprintf(hname,
"dttf_05_bx_occupancy");
89 sprintf(mename,
"DTTF Tracks BX Distribution by Wheel");
95 sprintf(hname,
"dttf_06_bx");
96 sprintf(mename,
"DTTF Tracks BX w.r.t. Tracks with BX=0");
101 sprintf(hname,
"dttf_07_quality");
102 sprintf(mename,
"DTTF Tracks Quality distribution");
107 sprintf(hname,
"dttf_08_quality_occupancy");
108 sprintf(mename,
"DTTF Tracks Quality distribution by Wheel");
115 sprintf(hname,
"dttf_09_highQuality_Tracks");
116 sprintf(mename,
"Fraction of DTTF Tracks with Quality>3");
123 sprintf(hname,
"dttf_10_phi_vs_etaCoarse");
124 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy (coarse #eta only, packed values)");
131 sprintf(hname,
"dttf_11_phi_vs_etaFine");
132 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy (fine #eta only, packed values)");
139 sprintf(hname,
"dttf_12_phi_vs_eta");
140 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy");
147 sprintf(hname,
"dttf_13_eta_fine_fraction");
148 sprintf(mename,
"Fraction of DTTF Tracks with Fine #eta Assignment");
156 sprintf(hname,
"dttf_14_eta");
157 sprintf(mename,
"DTTF Tracks #eta distribution (Packed values)");
162 sprintf(hname,
"dttf_15_phi");
163 sprintf(mename,
"DTTF Tracks Phi distribution (Packed values)");
168 sprintf(hname,
"dttf_16_pt");
169 sprintf(mename,
"DTTF Tracks p_{T} distribution (Packed values)");
174 sprintf(hname,
"dttf_17_charge");
175 sprintf(mename,
"DTTF Tracks Charge distribution");
182 sprintf(hname,
"dttf_18_2ndTrack_occupancy_summary");
183 sprintf(mename,
"DTTF 2nd Tracks occupancy w.r.t. Tracks with BX=0");
193 sprintf(hname,
"dttf_gmt_fract_matching" );
194 sprintf(mename,
"Fraction of DTTF tracks matching with GMT tracks" );
206 sprintf(hname,
"dttf_01_tracks_occupancy_test_summary");
207 sprintf(mename,
"DTTF Tracks Occupancy");
219 sprintf(hname,
"dttf_01_nTracks_2ndTrack");
220 sprintf(mename,
"DTTF 2nd Tracks per Wheel distribution");
225 sprintf(hname,
"dttf_02_occupancy_summary_2ndTrack");
226 sprintf(mename,
"DTTF 2nd Tracks distribution by Sector and Wheel");
232 sprintf(hname,
"dttf_03_bx_occupancy_2ndTrack");
233 sprintf(mename,
"DTTF 2nd Tracks BX Distribution by Wheel");
239 sprintf(hname,
"dttf_04_bx_2ndTrack");
240 sprintf(mename,
"Fraction of DTTF Tracks BX w.r.t. Tracks with BX=0");
245 sprintf(hname,
"dttf_05_quality_2ndTrack");
246 sprintf(mename,
"DTTF 2nd Tracks Quality distribution");
252 sprintf(hname,
"dttf_06_quality_occupancy_2ndTrack");
253 sprintf(mename,
"DTTF 2nd Tracks Quality distribution by Wheel");
261 sprintf(hname,
"dttf_07_highQuality_Tracks_2ndTrack");
262 sprintf(mename,
"Fraction of DTTF 2nd Tracks with Quality>3");
269 sprintf(hname,
"dttf_08_phi_vs_eta_2ndTrack");
270 sprintf(mename,
"#eta-#phi DTTF Tracks occupancy for 2nd Tracks");
277 sprintf(hname,
"dttf_09_eta_2ndTrack");
278 sprintf(mename,
"DTTF 2nd Tracks #eta distribution (Packed values)");
283 sprintf(hname,
"dttf_10_phi_2ndTrack");
284 sprintf(mename,
"DTTF 2nd Tracks Phi distribution (Packed values)");
289 sprintf(hname,
"dttf_11_pt_2ndTrack");
290 sprintf(mename,
"DTTF 2nd Tracks p_{T} distribution (Packed values)");
295 sprintf(hname,
"dttf_12_charge_2ndTrack");
296 sprintf(mename,
"DTTF 2nd Tracks Charge distribution");
301 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
305 sprintf( hname,
"dttf_02_nTracks_wh%s",
wheel_[wh].c_str() );
306 sprintf( mename,
"Wheel %s - Number of Tracks",
wheel_[wh].c_str() );
311 sprintf(hname,
"dttf_03_bx_occupancy_wh%s",
wheel_[wh].c_str() );
312 sprintf(mename,
"Wheel %s - DTTF Tracks BX distribution by Sector",
319 sprintf(hname,
"dttf_04_bx_wh%s",
wheel_[wh].c_str());
320 sprintf(mename,
"Wheel %s - DTTF Tracks BX w.r.t. Tracks with BX=0",
wheel_[wh].c_str());
325 sprintf(hname,
"dttf_05_quality_wh%s",
wheel_[wh].c_str() );
326 sprintf(mename,
"Wheel %s - Tracks Quality Distribution",
wheel_[wh].c_str() );
332 sprintf(hname,
"dttf_06_quality_summary_wh%s",
wheel_[wh].c_str() );
333 sprintf(mename,
"Wheel %s - Tracks Quality Distribution by Sector",
341 sprintf(hname,
"dttf_09_etaFine_fraction_wh%s",
wheel_[wh].c_str() );
342 sprintf(mename,
"Wheel %s - Fraction of DTTF Tracks with fine #eta assignment",
349 sprintf(hname,
"dttf_10_eta_wh%s",
wheel_[wh].c_str() );
350 sprintf(mename,
"Wheel %s - DTTF Tracks #eta distribution (Packed values)",
356 sprintf(hname,
"dttf_11_phi_wh%s",
wheel_[wh].c_str() );
357 sprintf(mename,
"Wheel %s - DTTF Tracks Phi distribution (Packed values)",
363 sprintf(hname,
"dttf_12_pt_wh%s",
wheel_[wh].c_str() );
364 sprintf(mename,
"Wheel %s - DTTF Tracks p_{T} distribution (Packed values)",
370 sprintf(hname,
"dttf_13_charge_wh%s",
wheel_[wh].c_str() );
371 sprintf(mename,
"Wheel %s - DTTF Tracks Charge distribution",
380 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
384 sprintf( hname,
"dttf_01_nTracks_wh%s_2ndTrack",
wheel_[wh].c_str() );
385 sprintf( mename,
"Wheel %s - DTTF Number of 2nd Tracks with BX=0",
392 sprintf(hname,
"dttf_02_bx_occupancy_wh%s_2ndTrack",
wheel_[wh].c_str() );
393 sprintf(mename,
"Wheel %s - DTTF 2nd Tracks BX distribution by Sector",
400 sprintf(hname,
"dttf_03_bx_wh%s_2ndTrack",
wheel_[wh].c_str());
401 sprintf(mename,
"Wheel %s - 2nd Tracks BX Distribution",
wheel_[wh].c_str());
426 sprintf( hname,
"%s/dttf_04_tracks_occupancy_by_lumi",
430 if ( ! occupancy_r_ ) {
434 edm::LogInfo(
"L1TDTTFClient::beginLuminosityBlock:RESET") <<
"Reseting plots by lumi!";
435 occupancy_r_->Reset();
500 if ( physEntries > 0 ) {
501 double physScale = 1 / physEntries;
524 if ( entries2ndTrack > 0 ) {
532 "%s/2ND_TRACK_ONLY/dttf_05_quality_summary_wh%s_2ndTrack" );
537 double scale2nd = 1 / entries2ndTrack;
569 int wheelSumBx2nd[4];
572 memset( wheelSumBx, 0, 4 *
sizeof(
int) );
573 memset( wheelSumBx2nd, 0, 4 *
sizeof(
int) );
593 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
602 double wheelEtaAll = 0;
603 double wheelEtaFine = 0;
604 memset( wheelBx, 0, 4 *
sizeof(
int) );
605 memset( wheelBx2nd, 0, 4 *
sizeof(
int) );
608 memset( qualities, 0, 8 *
sizeof(
int) );
615 "%s/dttf_07_phi_vs_etaFine_wh%s",
616 "%s/dttf_08_phi_vs_etaCoarse_wh%s", wh );
619 "%s/2ND_TRACK_ONLY/dttf_06_phi_vs_eta_wh%s_2ndTrack",
626 for (
unsigned int sector = 1; sector < 13; ++sector ) {
631 sprintf( hname,
"%s/BX_BySector/dttf_bx_wh%s_se%d",
634 TH1F * bxsector =
getTH1F(hname);
636 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
640 for (
unsigned int bx = 1; bx < 4 ; ++bx ) {
642 int bxval = bxsector->GetBinContent( bx );
653 wheelBx[bx] += bxval;
662 sprintf( hname,
"%s/BX_BySector/2ND_TRACK_ONLY/dttf_bx_2ndTrack_wh%s_se%d",
665 TH1F * bxsector2nd =
getTH1F(hname);
666 if ( ! bxsector2nd ) {
667 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
671 for (
unsigned int bx = 1; bx < 4 ; ++bx ) {
672 int bxval = bxsector2nd->GetBinContent( bx );
679 wheelBx2nd[bx] += bxval;
687 sprintf( hname,
"%s/Charge/dttf_charge_wh%s_se%d",
691 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
701 sprintf( hname,
"%s/PT/dttf_pt_wh%s_se%d",
705 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
716 sprintf( hname,
"%s/Phi/dttf_phi_wh%s_se%d",
720 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
732 double denHighQual = 0;
733 sprintf( hname,
"%s/Quality/dttf_qual_wh%s_se%d",
737 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
744 for (
unsigned int qual = 1; qual < 4 ; ++qual ) {
745 double bincontent = tmp->GetBinContent( qual );
746 qualities[qual] += bincontent;
747 denHighQual += bincontent;
751 for (
unsigned int qual = 4; qual < 8 ; ++qual ) {
752 double bincontent = tmp->GetBinContent( qual );
753 qualities[qual] += bincontent;
755 denHighQual += bincontent;
756 highQual += bincontent;
760 if ( denHighQual > 0 ) highQual /= denHighQual;
767 sprintf( hname,
"%s/Eta/dttf_eta_wh%s_se%d",
771 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
782 sprintf( hname,
"%s/EtaFineFraction/dttf_etaFine_fraction_wh%s_se%d",
786 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
789 double fine = tmp->GetBinContent( 1 );
790 double coarse = tmp->GetBinContent( 2 );
791 double tot = fine + coarse;
793 wheelEtaFine += fine;
804 if ( wheelEtaAll > 0 ) {
817 for (
unsigned int bx = 1; bx < 4; ++bx ) {
821 wheelSumBx[bx] += wheelBx[bx];
825 wheelSumBx2nd[bx] += wheelBx2nd[bx];
833 for (
unsigned int qual = 1; qual < 8 ; ++qual ) {
856 double scale = wheelBx[2];
862 scale = wheelBx2nd[2];
881 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_07_eta_wh%s_2ndTrack",
886 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
895 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_08_phi_wh%s_2ndTrack",
899 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
909 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_09_pt_wh%s_2ndTrack",
913 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
922 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_10_charge_wh%s_2ndTrack",
926 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
935 sprintf( hname,
"%s/2ND_TRACK_ONLY/dttf_04_quality_wh%s_2ndTrack",
939 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
942 for (
unsigned int qual = 1; qual < 8; ++qual ) {
943 double binqual = tmp->GetBinContent( qual );
955 for (
unsigned int bx = 1; bx < 4; ++bx ) {
963 double scale = wheelSumBx[2];
969 scale = wheelSumBx2nd[2];
984 sprintf( hname,
"%s/dttf_tracks_with_gmt_match",
gmtpath_.c_str() );
985 TH2F * gmt_match =
getTH2F(hname);
987 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
994 sprintf( hname,
"%s/dttf_tracks_without_gmt_match",
gmtpath_.c_str() );
995 TH2F * gmt_missed =
getTH2F(hname);
996 if ( ! gmt_missed ) {
997 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
1003 sprintf( hname,
"%s/dttf_missing_tracks_in_gmt",
gmtpath_.c_str() );
1004 TH2F * gmt_ghost =
getTH2F(hname);
1005 if ( ! gmt_ghost ) {
1006 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get TH1D "
1011 int match = gmt_match->Integral();
1012 int missed = gmt_missed->Integral();
1013 int ghost = gmt_ghost->Integral();
1014 float tot = match + missed + ghost;
1016 double val = ghost/tot;
1033 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get ME "
1053 edm::LogError(
"L1TDTTFClient::makeSummary:ME") <<
"Failed to get ME "
1080 for (
unsigned int wh = 0; wh < 6 ; ++wh ) {
1081 sprintf( hname, path.c_str(),
wheelpath_[wh].c_str(),
wheel_[wh].c_str() );
1083 TH2F * quality =
getTH2F(hname);
1089 for (
unsigned int sec = 1; sec < 13 ; ++sec ) {
1090 double denHighQual = occupancySummary->GetBinContent( wh+1, sec );
1092 if ( denHighQual > 0 ) {
1093 for (
unsigned int qual = 4; qual < 8 ; ++qual ) {
1094 val += quality->GetBinContent( qual, sec );
1114 sprintf( hname, path_fine.c_str(),
1117 TH2F * phi_vs_eta_fine =
getTH2F(hname);
1118 if ( ! phi_vs_eta_fine ) {
1123 sprintf( hname, path_coarse.c_str(),
1125 TH2F * phi_vs_eta_coarse =
getTH2F(hname);
1126 if ( ! phi_vs_eta_coarse ) {
1131 if ( ! phi_vs_eta_fine || ! phi_vs_eta_coarse ) {
1135 for (
unsigned int phi = 1;
phi < 145 ; ++
phi ) {
1139 case 0 : start = 0; nbins = 18;
break;
1140 case 1 : start = 8; nbins = 20;
break;
1141 case 2 : start = 22; nbins = 10;
break;
1142 case 3 : start = 22; nbins = 20;
break;
1143 case 4 : start = 36; nbins = 20;
break;
1144 case 5 : start = 46; nbins = 18;
break;
1145 default : start = 0; nbins = 0;
break;
1151 double valfine = phi_vs_eta_fine->GetBinContent(
eta,
phi )
1154 double valcoarse = phi_vs_eta_coarse->GetBinContent(
eta,
phi )
1196 sprintf( hname, path.c_str(),
1199 TH2F * phi_vs_eta =
getTH2F(hname);
1200 if ( ! phi_vs_eta ) {
1201 edm::LogError(
"L1TDTTFClient::buildPhiEtaPlotO:ME") <<
"Failed to get TH1D "
1205 for (
unsigned int phi = 1;
phi < 145 ; ++
phi ) {
1209 case 0 : start = 0; nbins = 18;
break;
1210 case 1 : start = 8; nbins = 20;
break;
1211 case 2 : start = 22; nbins = 10;
break;
1212 case 3 : start = 22; nbins = 20;
break;
1213 case 4 : start = 36; nbins = 20;
break;
1214 case 5 : start = 46; nbins = 18;
break;
1215 default : start = 0; nbins = 0;
break;
1220 double val = phi_vs_eta->GetBinContent(
eta,
phi )
1225 double underflow = phi_vs_eta->GetBinContent( 0,
phi )
1229 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
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