Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add z0 resolution to performance printout #264

Merged
merged 2 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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