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 #44574 to Prototype #1240

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
2 changes: 1 addition & 1 deletion L1Trigger/TrackFindingTracklet/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
To run the L1 tracking & create a TTree of tracking performance:
To run the L1 tracking & create a TTree of tracking performance:

cmsRun L1TrackNtupleMaker_cfg.py

Expand Down
12 changes: 6 additions & 6 deletions L1Trigger/TrackFindingTracklet/interface/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -1046,18 +1046,18 @@ namespace trklet {
double stripLength_PS_{0.1467};
double stripLength_2S_{5.0250};

// The DR binning below disabled, as doesn't match latest FW.

//Following values are used for duplicate removal
//Rinv bins were optimised to ensure a similar number of tracks in each bin prior to DR
//Rinv bin edges for 6 bins.
std::vector<double> rinvBins_{-rinvcut(), -0.004968, -0.003828, 0, 0.003828, 0.004968, rinvcut()};
//Phi bin edges for 2 bins.
std::vector<double> phiBins_{0, dphisectorHG() / 2, dphisectorHG()};
//Only one bin currently used.
std::vector<double> rinvBins_{-rinvcut(), rinvcut()};
std::vector<double> phiBins_{0, dphisectorHG()};
//Overlap size for the overlap rinv bins in DR
double rinvOverlapSize_{0.0004};
//Overlap size for the overlap phi bins in DR
double phiOverlapSize_{M_PI / 360};
//The maximum number of tracks that are compared to all the other tracks per rinv bin
int numTracksComparedPerBin_{32};
int numTracksComparedPerBin_{9999};

double sensorSpacing_2S_{0.18};
};
Expand Down
2 changes: 2 additions & 0 deletions L1Trigger/TrackFindingTracklet/interface/Tracklet.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ namespace trklet {

unsigned int PSseed() const { return ((layer() == 1) || (layer() == 2) || (disk() != 0)) ? 1 : 0; }

// Seed type:
// L1L2=0,L2L3=1,L3L4=2,L5L6=3,D1D2=4,D3D4=5,L1D1=6,L2D1=7
unsigned int seedIndex() const { return seedIndex_; }

private:
Expand Down
14 changes: 9 additions & 5 deletions L1Trigger/TrackFindingTracklet/src/PurgeDuplicate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,16 @@ void PurgeDuplicate::execute(std::vector<Track>& outputtracks, unsigned int iSec
// Best Guess: L1L2 > L1D1 > L2L3 > L2D1 > D1D2 > L3L4 > L5L6 > D3D4
// Best Rank: L1L2 > L3L4 > D3D4 > D1D2 > L2L3 > L2D1 > L5L6 > L1D1
// Rank-Informed Guess: L1L2 > L3L4 > L1D1 > L2L3 > L2D1 > D1D2 > L5L6 > D3D4
unsigned int curSeed = aTrack->seedIndex();
std::vector<int> ranks{1, 5, 2, 7, 4, 3, 8, 6};
if (settings_.extended())
seedRank.push_back(9);
else
const unsigned int curSeed = aTrack->seedIndex();
static const std::vector<int> ranks{1, 5, 2, 7, 4, 3, 8, 6};
if (curSeed < ranks.size()) {
seedRank.push_back(ranks[curSeed]);
} else if (settings_.extended()) {
seedRank.push_back(9);
} else {
throw cms::Exception("LogError") << __FILE__ << " " << __LINE__ << " Seed type " << curSeed
<< " not found in list, and settings->extended() not set.";
}

if (stublist.size() != stubidslist.size())
throw cms::Exception("LogicError")
Expand Down
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