Skip to content

Commit

Permalink
Add z0 resolution to performance printout (#264)
Browse files Browse the repository at this point in the history
* Add z0 resolution to performance printout

* code format
  • Loading branch information
tomalin committed Apr 8, 2024
1 parent f5861db commit 25e545a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions L1Trigger/TrackFindingTracklet/test/L1TrackNtuplePlot.C
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ void L1TrackNtuplePlot(TString type,

SetPlotStyle();

cout.setf(ios::fixed);
cout.precision(2);

// ----------------------------------------------------------------------------------------------------------------
// define input options

Expand Down Expand Up @@ -1021,7 +1024,6 @@ void L1TrackNtuplePlot(TString type,
// ----------------------------------------------------------------------------------------------------------------

int nevt = tree->GetEntries();
cout << "number of events = " << nevt << endl;

// ----------------------------------------------------------------------------------------------------------------
// event loop
Expand Down Expand Up @@ -3633,11 +3635,19 @@ void L1TrackNtuplePlot(TString type,
c.SaveAs(DIR + type + "_trk_pt.pdf");
}

// Sample z0 resolution at a couple of rapidity points.
float etaSample1 = h2_resVsEta_z0_68->GetXaxis()->GetBinCenter(1);
float etaSample2 = h2_resVsEta_z0_68->GetXaxis()->GetBinCenter(0.8 * nETARANGE);
float z0ResSample1 = h2_resVsEta_z0_68->GetBinContent(1);
float z0ResSample2 = h2_resVsEta_z0_68->GetBinContent(0.8 * nETARANGE);

fout->Close();

// ---------------------------------------------------------------------------------------------------------
//some printouts

cout << "number of events = " << nevt << endl;

float k = (float)n_match_eta1p0;
float N = (float)n_all_eta1p0;
if (std::abs(N) > 0)
Expand Down Expand Up @@ -3691,7 +3701,11 @@ void L1TrackNtuplePlot(TString type,
cout << "# tracks/event (no pt cut)= " << (float)ntrk / nevt << endl;
cout << "# tracks/event (pt > " << std::max(TP_minPt, 2.0f) << ") = " << (float)ntrk_pt2 / nevt << endl;
cout << "# tracks/event (pt > 3.0) = " << (float)ntrk_pt3 / nevt << endl;
cout << "# tracks/event (pt > 10.0) = " << (float)ntrk_pt10 / nevt << endl;
cout << "# tracks/event (pt > 10.0) = " << (float)ntrk_pt10 / nevt << endl << endl;

// z0 resolution
cout << "z0 resolution = " << z0ResSample1 << "cm at |eta| = " << etaSample1 << endl;
cout << "z0 resolution = " << z0ResSample2 << "cm at |eta| = " << etaSample2 << endl;
}

void SetPlotStyle() {
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/TrackFindingTracklet/test/makeHists.csh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ echo "MVA track quality Histograms written to MVA_plots/"
# Run track performance plotting macro
set plotMacro = $CMSSW_BASE/src/L1Trigger/TrackFindingTracklet/test/L1TrackNtuplePlot.C
if (-e TrkPlots) rm -r TrkPlots
\root -b -q ${plotMacro}'("'${inputFileStem}'","'${dirName}'")' | tail -n 19 >! results.out
\root -b -q ${plotMacro}'("'${inputFileStem}'","'${dirName}'")' | tail -n 24 >! results.out
cat results.out
echo "Tracking performance summary written to results.out"
echo "Track performance histograms written to TrkPlots/"
Expand Down

0 comments on commit 25e545a

Please sign in to comment.