CMS 3D CMS Logo

L1TrackQuality.h
Go to the documentation of this file.
1 /*
2 Track Quality Header file
3 C.Brown 28/07/20
4 */
5 
6 #ifndef L1Trigger_TrackTrigger_interface_L1TrackQuality_h
7 #define L1Trigger_TrackTrigger_interface_L1TrackQuality_h
8 
9 #include <iostream>
10 #include <set>
11 #include <vector>
12 #include <memory>
13 #include <string>
14 
24 #include <memory>
25 
26 #include "conifer.h"
27 #include "ap_fixed.h"
28 
30 public:
31  // Enum class used for determining prediction behaviour in setL1TrackQuality
32  enum class QualityAlgorithm { Cut, GBDT, GBDT_cpp, NN, None };
33 
34  //Default Constructor
36 
37  L1TrackQuality(const edm::ParameterSet& qualityParams);
38 
39  //Default Destructor
40  ~L1TrackQuality() = default;
41 
42  // Controls the conversion between TTTrack features and ML model training features
43  std::vector<float> featureTransform(TTTrack<Ref_Phase2TrackerDigi_>& aTrack,
44  std::vector<std::string> const& featureNames);
45 
46  // Passed by reference a track without MVA filled, method fills the track's MVA field
48  // Function to run the BDT in isolation allowing a feature vector in the ap_fixed datatype to be passed
49  // and a single output to be returned which is then used to fill the bits in the Track Word for situations
50  // where a TTTrack datatype is unavailable to be passed to the track quality
51  float runEmulatedTQ(std::vector<ap_fixed<10, 5>> inputFeatures);
52  // To set private member data
53  void setCutParameters(std::string const& AlgorithmString,
54  float maxZ0,
55  float maxEta,
56  float chi2dofMax,
57  float bendchi2Max,
58  float minPt,
59  int nStubmin);
60 
61  void setONNXModel(std::string const& AlgorithmString,
64  std::vector<std::string> const& featureNames);
65 
66  void setBonusFeatures(std::vector<float> bonusFeatures);
67 
68 private:
69  // Private Member Data
73  std::vector<std::string> featureNames_;
74  float maxZ0_;
75  float maxEta_;
76  float chi2dofMax_;
77  float bendchi2Max_;
78  float minPt_;
80  bool useHPH_;
81  std::vector<float> bonusFeatures_;
82  std::unique_ptr<cms::Ort::ONNXRuntime> runTime_;
83 };
84 #endif
void setL1TrackQuality(TTTrack< Ref_Phase2TrackerDigi_ > &aTrack)
void setCutParameters(std::string const &AlgorithmString, float maxZ0, float maxEta, float chi2dofMax, float bendchi2Max, float minPt, int nStubmin)
minPt
Definition: PV_cfg.py:223
void setONNXModel(std::string const &AlgorithmString, edm::FileInPath const &ONNXmodel, std::string const &ONNXInputName, std::vector< std::string > const &featureNames)
QualityAlgorithm qualityAlgorithm_
float runEmulatedTQ(std::vector< ap_fixed< 10, 5 >> inputFeatures)
std::vector< float > featureTransform(TTTrack< Ref_Phase2TrackerDigi_ > &aTrack, std::vector< std::string > const &featureNames)
Class to store the L1 Track Trigger tracks.
Definition: TTTrack.h:29
std::vector< float > bonusFeatures_
std::unique_ptr< cms::Ort::ONNXRuntime > runTime_
std::vector< std::string > featureNames_
edm::FileInPath ONNXmodel_
std::string ONNXInputName_
void setBonusFeatures(std::vector< float > bonusFeatures)
~L1TrackQuality()=default