Skip to content

Commit

Permalink
Fix TQ input variables (#227)
Browse files Browse the repository at this point in the history
* fix tq input variables

* code formating
  • Loading branch information
cgsavard authored and tomalin committed Nov 15, 2023
1 parent 4a3b88d commit 02bc945
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion L1Trigger/TrackTrigger/python/TrackQualityParams_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# git clone https://github.com/cms-data/L1Trigger-TrackTrigger.git L1Trigger/TrackTrigger/data
ONNXInputName = cms.string("feature_input"),
#Vector of strings of training features, in the order that the model was trained with
featureNames = cms.vstring(["eta", "z0", "bendchi2_bin", "nstub",
featureNames = cms.vstring(["tanl", "z0_scaled", "bendchi2_bin", "nstub",
"nlaymiss_interior", "chi2rphi_bin", "chi2rz_bin"]),
# Parameters for cut based classifier, optimized for L1 Track MET
# (Table 3.7 The Phase-2 Upgrade of the CMS Level-1 Trigger http://cds.cern.ch/record/2714892)
Expand Down
4 changes: 4 additions & 0 deletions L1Trigger/TrackTrigger/src/L1TrackQuality.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,23 @@ std::vector<float> L1TrackQuality::featureTransform(TTTrack<Ref_Phase2TrackerDig

// get other variables directly from TTTrack
float tmp_trk_z0 = aTrack.z0();
float tmp_trk_z0_scaled = tmp_trk_z0 / abs(aTrack.minZ0);
float tmp_trk_phi = aTrack.phi();
float tmp_trk_eta = aTrack.eta();
float tmp_trk_tanl = aTrack.tanL();

// -------- fill the feature map ---------

feature_map["nstub"] = float(tmp_trk_nstub);
feature_map["z0"] = tmp_trk_z0;
feature_map["z0_scaled"] = tmp_trk_z0_scaled;
feature_map["phi"] = tmp_trk_phi;
feature_map["eta"] = tmp_trk_eta;
feature_map["nlaymiss_interior"] = float(tmp_trk_nlaymiss_interior);
feature_map["bendchi2_bin"] = tmp_trk_bendchi2_bin;
feature_map["chi2rphi_bin"] = tmp_trk_chi2rphi_bin;
feature_map["chi2rz_bin"] = tmp_trk_chi2rz_bin;
feature_map["tanl"] = tmp_trk_tanl;

// fill tensor with track params
transformedFeatures.reserve(featureNames.size());
Expand Down

0 comments on commit 02bc945

Please sign in to comment.