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 
23 #include <memory>
24 
25 #include "conifer.h"
26 #include "ap_fixed.h"
27 
29 public:
30  //Default Constructor
32 
33  L1TrackQuality(const edm::ParameterSet& qualityParams);
34 
35  //Default Destructor
36  ~L1TrackQuality() = default;
37 
38  // Controls the conversion between TTTrack features and ML model training features
39  std::vector<float> featureTransform(TTTrack<Ref_Phase2TrackerDigi_>& aTrack,
40  std::vector<std::string> const& featureNames);
41 
42  // Passed by reference a track without MVA filled, method fills the track's MVA field
44  // Function to run the BDT in isolation allowing a feature vector in the ap_fixed datatype to be passed
45  // and a single output to be returned which is then used to fill the bits in the Track Word for situations
46  // where a TTTrack datatype is unavailable to be passed to the track quality
47  float runEmulatedTQ(std::vector<ap_fixed<10, 5>> inputFeatures);
48 
49  void setModel(edm::FileInPath const& model, std::vector<std::string> const& featureNames);
50 
51  void setBonusFeatures(std::vector<float> bonusFeatures);
52 
53  // TQ MVA bin conversions
54  static constexpr double invSigmoid(double value) { return -log(1. / value - 1.); }
55  static constexpr std::array<double, 1 << TTTrack_TrackWord::TrackBitWidths::kMVAQualitySize> getTqMVAPreSigBins() {
56  return {{-16.,
64  }
65 
66 private:
67  // Private Member Data
69  std::vector<std::string> featureNames_;
70  bool useHPH_;
71  std::vector<float> bonusFeatures_;
72 };
73 #endif
static constexpr std::array< double, 1<< TTTrack_TrackWord::TrackBitWidths::kMVAQualitySize > getTqMVAPreSigBins()
void setL1TrackQuality(TTTrack< Ref_Phase2TrackerDigi_ > &aTrack)
static constexpr double invSigmoid(double value)
edm::FileInPath model_
static constexpr std::array< double, 1<< TrackBitWidths::kMVAQualitySize > tqMVABins
Definition: value.py:1
float runEmulatedTQ(std::vector< ap_fixed< 10, 5 >> inputFeatures)
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.
Definition: TTTrack.h:29
std::vector< float > bonusFeatures_
std::vector< std::string > featureNames_
void setBonusFeatures(std::vector< float > bonusFeatures)
~L1TrackQuality()=default