Skip to content

Commit 49df272

Browse files
committed
Removing shift in input parameters now that conifer bug is resolved, adding class version and checksum
1 parent 2e21915 commit 49df272

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

DataFormats/L1Trigger/src/classes_def.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@
335335
<class name="edm::Wrapper<l1t::VertexWordCollection>"/>
336336
<class name="edm::Ref<l1t::VertexWordCollection>" />
337337

338-
<class name="l1t::DisplacedTrackVertex">
338+
<class name="l1t::DisplacedTrackVertex" ClassVersion="11">
339+
<version ClassVersion="11" checksum="698293252"/>
339340
</class>
340341
<class name="std::vector<l1t::DisplacedTrackVertex>"/>
341342
<class name="edm::Wrapper<std::vector<l1t::DisplacedTrackVertex> >"/>

L1Trigger/L1TTrackMatch/plugins/DisplacedVertexProducer.cc

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,13 @@ void DisplacedVertexProducer::produce(edm::StreamID, edm::Event& iEvent, const e
319319
vertex.p_mag,
320320
isReal);
321321

322+
//Rescaling input features so they all fall within [-20,20]. This reduces bits needed in emulation by 2. See this presentation for more information: https://indico.cern.ch/event/1476881/contributions/6219913/attachments/2964052/5214060/GTT%20Displaced%20Vertexing%20November%208%202024.pdf
323+
float ptRescaling = 0.25;
324+
float deltaZRescaling = 0.125;
322325
if (runEmulation_) {
323326
std::vector<ap_fixed<13, 8, AP_RND_CONV, AP_SAT>> Transformed_features = {
324-
selectedTracksWithTruth[i].first.pt * 0.25,
325-
selectedTracksWithTruth[j].first.pt * 0.25,
327+
selectedTracksWithTruth[i].first.pt * ptRescaling,
328+
selectedTracksWithTruth[j].first.pt * ptRescaling,
326329
selectedTracksWithTruth[i].first.eta,
327330
selectedTracksWithTruth[j].first.eta,
328331
selectedTracksWithTruth[i].first.phi,
@@ -331,23 +334,23 @@ void DisplacedVertexProducer::produce(edm::StreamID, edm::Event& iEvent, const e
331334
selectedTracksWithTruth[j].first.d0,
332335
selectedTracksWithTruth[i].first.z0,
333336
selectedTracksWithTruth[j].first.z0,
334-
selectedTracksWithTruth[i].first.chi2rz + 0.07,
335-
selectedTracksWithTruth[j].first.chi2rz + 0.07,
336-
selectedTracksWithTruth[i].first.bendchi2 + 0.07,
337-
selectedTracksWithTruth[j].first.bendchi2 + 0.07,
338-
selectedTracksWithTruth[i].first.MVA1 + 0.07,
339-
selectedTracksWithTruth[j].first.MVA1 + 0.07,
337+
selectedTracksWithTruth[i].first.chi2rz,
338+
selectedTracksWithTruth[j].first.chi2rz,
339+
selectedTracksWithTruth[i].first.bendchi2,
340+
selectedTracksWithTruth[j].first.bendchi2,
341+
selectedTracksWithTruth[i].first.MVA1,
342+
selectedTracksWithTruth[j].first.MVA1,
340343
vertex.d_T,
341344
vertex.R_T,
342345
vertex.cos_T,
343-
vertex.delta_z * 0.125};
346+
vertex.delta_z * deltaZRescaling};
344347
conifer::BDT<ap_fixed<13, 8, AP_RND_CONV, AP_SAT>, ap_fixed<13, 8, AP_RND_CONV, AP_SAT>> bdt(
345348
this->model_.fullPath());
346349
std::vector<ap_fixed<13, 8, AP_RND_CONV, AP_SAT>> output = bdt.decision_function(Transformed_features);
347350
outputVertex.setScore(output.at(0).to_float());
348351
} else {
349-
std::vector<float> Transformed_features = {float(selectedTracksWithTruth[i].first.pt * 0.25),
350-
float(selectedTracksWithTruth[j].first.pt * 0.25),
352+
std::vector<float> Transformed_features = {float(selectedTracksWithTruth[i].first.pt * ptRescaling),
353+
float(selectedTracksWithTruth[j].first.pt * ptRescaling),
351354
selectedTracksWithTruth[i].first.eta,
352355
selectedTracksWithTruth[j].first.eta,
353356
selectedTracksWithTruth[i].first.phi,
@@ -356,16 +359,16 @@ void DisplacedVertexProducer::produce(edm::StreamID, edm::Event& iEvent, const e
356359
selectedTracksWithTruth[j].first.d0,
357360
selectedTracksWithTruth[i].first.z0,
358361
selectedTracksWithTruth[j].first.z0,
359-
float(selectedTracksWithTruth[i].first.chi2rz + 0.07),
360-
float(selectedTracksWithTruth[j].first.chi2rz + 0.07),
361-
float(selectedTracksWithTruth[i].first.bendchi2 + 0.07),
362-
float(selectedTracksWithTruth[j].first.bendchi2 + 0.07),
363-
float(selectedTracksWithTruth[i].first.MVA1 + 0.07),
364-
float(selectedTracksWithTruth[j].first.MVA1 + 0.07),
362+
float(selectedTracksWithTruth[i].first.chi2rz),
363+
float(selectedTracksWithTruth[j].first.chi2rz),
364+
float(selectedTracksWithTruth[i].first.bendchi2),
365+
float(selectedTracksWithTruth[j].first.bendchi2),
366+
float(selectedTracksWithTruth[i].first.MVA1),
367+
float(selectedTracksWithTruth[j].first.MVA1),
365368
vertex.d_T,
366369
vertex.R_T,
367370
vertex.cos_T,
368-
float(vertex.delta_z * 0.125)};
371+
float(vertex.delta_z * deltaZRescaling)};
369372
conifer::BDT<float, float> bdt(this->model_.fullPath());
370373
std::vector<float> output = bdt.decision_function(Transformed_features);
371374
outputVertex.setScore(output.at(0));

0 commit comments

Comments
 (0)