16 if (AlgorithmString ==
"Cut") {
21 (
float)qualityParams.
getParameter<
double>(
"bendchi2Max"),
30 qualityParams.
getParameter<std::vector<std::string>>(
"featureNames"));
43 std::vector<float> transformedFeatures;
46 std::map<std::string, float> feature_map;
52 int nbits = floor(log2(tmp_trk_hitpattern)) + 1;
54 int tmp_trk_nlaymiss_interior = 0;
56 for (
int i = 0;
i < nbits;
i++) {
57 lay_i = ((1 <<
i) & tmp_trk_hitpattern) >>
i;
62 tmp_trk_nlaymiss_interior++;
73 int tmp_trk_nstub = stubRefs.size();
76 float tmp_trk_z0 = aTrack.
z0();
77 float tmp_trk_phi = aTrack.
phi();
78 float tmp_trk_eta = aTrack.
eta();
82 feature_map[
"nstub"] =
float(tmp_trk_nstub);
83 feature_map[
"z0"] = tmp_trk_z0;
84 feature_map[
"phi"] = tmp_trk_phi;
85 feature_map[
"eta"] = tmp_trk_eta;
86 feature_map[
"nlaymiss_interior"] =
float(tmp_trk_nlaymiss_interior);
87 feature_map[
"bendchi2_bin"] = tmp_trk_bendchi2_bin;
88 feature_map[
"chi2rphi_bin"] = tmp_trk_chi2rphi_bin;
89 feature_map[
"chi2rz_bin"] = tmp_trk_chi2rz_bin;
94 transformedFeatures.push_back(feature_map[feature]);
96 return transformedFeatures;
104 float trk_z0 = aTrack.
z0();
108 int nStubs = stubRefs.size();
110 float classification = 0.0;
114 classification = 1.0;
122 std::vector<std::string> ortinput_names;
123 std::vector<std::string> ortoutput_names;
132 ortoutput_names =
runTime_->getOutputNames();
136 ortinput.push_back(Transformed_features);
141 ortoutputs =
runTime_->run(ortinput_names, ortinput, {}, ortoutput_names, batch_size);
180 if (AlgorithmString ==
"NN") {
182 }
else if (AlgorithmString ==
"GBDT") {
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)
void setCutParameters(std::string const &AlgorithmString, float maxZ0, float maxEta, float chi2dofMax, float bendchi2Max, float minPt, int nStubmin)
unsigned int getChi2RPhiBits() const
double phi() const
Track phi.
unsigned int hitPattern() const
Hit Pattern.
GlobalVector momentum() const
Track momentum.
std::vector< std::vector< float > > FloatArrays
void setONNXModel(std::string const &AlgorithmString, edm::FileInPath const &ONNXmodel, std::string const &ONNXInputName, std::vector< std::string > const &featureNames)
void settrkMVA1(double atrkMVA1)
QualityAlgorithm qualityAlgorithm_
Abs< T >::type abs(const T &t)
Class to store the L1 Track Trigger stubs.
std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > getStubRefs() const
Track components.
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::unique_ptr< cms::Ort::ONNXRuntime > runTime_
double stubPtConsistency() const
StubPtConsistency.
std::vector< std::string > featureNames_
unsigned int getBendChi2Bits() const
edm::FileInPath ONNXmodel_
double z0() const
Track z0.
std::string ONNXInputName_
void setBonusFeatures(std::vector< float > bonusFeatures)