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++;
81 int tmp_trk_nstub = stubRefs.size();
84 float tmp_trk_z0 = aTrack.
z0();
85 float tmp_trk_phi = aTrack.
phi();
86 float tmp_trk_eta = aTrack.
eta();
90 feature_map[
"nstub"] =
float(tmp_trk_nstub);
91 feature_map[
"z0"] = tmp_trk_z0;
92 feature_map[
"phi"] = tmp_trk_phi;
93 feature_map[
"eta"] = tmp_trk_eta;
94 feature_map[
"nlaymiss_interior"] =
float(tmp_trk_nlaymiss_interior);
95 feature_map[
"bendchi2_bin"] = tmp_trk_bendchi2_bin;
96 feature_map[
"chi2rphi_bin"] = tmp_trk_chi2rphi_bin;
97 feature_map[
"chi2rz_bin"] = tmp_trk_chi2rz_bin;
102 transformedFeatures.push_back(feature_map[feature]);
104 return transformedFeatures;
112 float trk_z0 = aTrack.
z0();
114 float trk_chi2 = aTrack.
chi2();
116 int nStubs = stubRefs.size();
118 float classification = 0.0;
122 classification = 1.0;
130 std::vector<std::string> ortinput_names;
131 std::vector<std::string> ortoutput_names;
140 ortoutput_names =
runTime_->getOutputNames();
144 ortinput.push_back(Transformed_features);
149 ortoutputs =
runTime_->run(ortinput_names, ortinput, {}, ortoutput_names, batch_size);
188 if (AlgorithmString ==
"NN") {
190 }
else if (AlgorithmString ==
"GBDT") {
T getParameter(std::string const &) const
double eta() const
Track eta.
std::string fullPath() const
const hph::Setup * setupHPH_
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_
void beginRun(const hph::Setup *setup)
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::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_