15 qualityParams.
getParameter<std::vector<std::string>>(
"featureNames"));
26 std::vector<float> transformedFeatures;
29 std::map<std::string, float> feature_map;
35 int nbits = floor(log2(tmp_trk_hitpattern)) + 1;
37 int tmp_trk_nlaymiss_interior = 0;
39 for (
int i = 0;
i < nbits;
i++) {
40 lay_i = ((1 <<
i) & tmp_trk_hitpattern) >>
i;
45 tmp_trk_nlaymiss_interior++;
56 int tmp_trk_nstub = stubRefs.size();
59 float tmp_trk_z0 = aTrack.
z0();
60 float tmp_trk_z0_scaled = tmp_trk_z0 /
abs(aTrack.
minZ0);
61 float tmp_trk_phi = aTrack.
phi();
62 float tmp_trk_eta = aTrack.
eta();
63 float tmp_trk_tanl = aTrack.
tanL();
67 feature_map[
"nstub"] =
float(tmp_trk_nstub);
68 feature_map[
"z0"] = tmp_trk_z0;
69 feature_map[
"z0_scaled"] = tmp_trk_z0_scaled;
70 feature_map[
"phi"] = tmp_trk_phi;
71 feature_map[
"eta"] = tmp_trk_eta;
72 feature_map[
"nlaymiss_interior"] =
float(tmp_trk_nlaymiss_interior);
73 feature_map[
"bendchi2_bin"] = tmp_trk_bendchi2_bin;
74 feature_map[
"chi2rphi_bin"] = tmp_trk_chi2rphi_bin;
75 feature_map[
"chi2rz_bin"] = tmp_trk_chi2rz_bin;
76 feature_map[
"tanl"] = tmp_trk_tanl;
81 transformedFeatures.push_back(feature_map[feature]);
83 return transformedFeatures;
92 std::vector<float>
output = bdt.decision_function(
inputs);
99 conifer::BDT<ap_fixed<10, 5>, ap_fixed<10, 5>> bdt(this->
model_.
fullPath());
102 std::vector<ap_fixed<10, 5>>
output = bdt.decision_function(inputFeatures);
103 return output.at(0).to_float();
T getParameter(std::string const &) const
double eta() const
Track eta.
std::string fullPath() const
unsigned int getChi2RZBits() const
void setL1TrackQuality(TTTrack< Ref_Phase2TrackerDigi_ > &aTrack)
static constexpr double minZ0
unsigned int getChi2RPhiBits() const
double phi() const
Track phi.
double tanL() const
Track tanL.
unsigned int hitPattern() const
Hit Pattern.
void settrkMVA1(double atrkMVA1)
Abs< T >::type abs(const T &t)
float runEmulatedTQ(std::vector< ap_fixed< 10, 5 >> inputFeatures)
Class to store the L1 Track Trigger stubs.
std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > getStubRefs() const
Track components.
void setModel(edm::FileInPath const &model, std::vector< std::string > const &featureNames)
std::vector< float > featureTransform(TTTrack< Ref_Phase2TrackerDigi_ > &aTrack, std::vector< std::string > const &featureNames)
Class to store the L1 Track Trigger tracks.
std::vector< float > bonusFeatures_
std::vector< std::string > featureNames_
unsigned int getBendChi2Bits() const
double z0() const
Track z0.
void setBonusFeatures(std::vector< float > bonusFeatures)