@@ -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