File indexing completed on 2024-09-07 04:37:07
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef L1Trigger_TrackTrigger_interface_HitPatternHelper_h
0023 #define L1Trigger_TrackTrigger_interface_HitPatternHelper_h
0024
0025 #include "FWCore/Framework/interface/data_default_record_trait.h"
0026 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0027 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0028 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
0029 #include "Geometry/CommonTopologies/interface/PixelGeomDetUnit.h"
0030 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0031 #include "L1Trigger/TrackFindingTracklet/interface/HitPatternHelperRcd.h"
0032 #include "L1Trigger/TrackTrigger/interface/Setup.h"
0033 #include "L1Trigger/TrackerTFP/interface/DataFormats.h"
0034 #include "L1Trigger/TrackerTFP/interface/LayerEncoding.h"
0035
0036 #include <bitset>
0037 #include <iostream>
0038 #include <vector>
0039 #include <utility>
0040 #include <map>
0041
0042 namespace hph {
0043
0044
0045 class Setup {
0046 public:
0047 Setup(const edm::ParameterSet& iConfig,
0048 const tt::Setup& setupTT,
0049 const trackerTFP::DataFormats& dataFormats,
0050 const trackerTFP::LayerEncoding& layerEncoding);
0051 ~Setup() {}
0052
0053 bool hphDebug() const { return hphDebug_; }
0054 bool useNewKF() const { return useNewKF_; }
0055 double chosenRofZ() const { return chosenRofZ_; }
0056 std::vector<double> etaRegions() const { return etaRegions_; }
0057 std::map<int, std::map<int, std::vector<int>>> layermap() const { return layermap_; }
0058 int nKalmanLayers() const { return nKalmanLayers_; }
0059 int etaRegion(double z0, double cot, bool useNewKF) const;
0060 int digiCot(double cot, int binEta) const;
0061 int digiZT(double z0, double cot, int binEta) const;
0062 const std::vector<int>& layerEncoding(int binEta, int binZT, int binCot) const {
0063 return layerEncoding_.layerEncoding(binEta, binZT, binCot);
0064 }
0065 const std::map<int, const tt::SensorModule*>& layerEncodingMap(int binEta, int binZT, int binCot) const {
0066 return layerEncoding_.layerEncodingMap(binEta, binZT, binCot);
0067 }
0068
0069 private:
0070 edm::ParameterSet iConfig_;
0071 edm::ParameterSet oldKFPSet_;
0072 const tt::Setup setupTT_;
0073 const trackerTFP::DataFormats dataFormats_;
0074 const trackerTFP::DataFormat dfcot_;
0075 const trackerTFP::DataFormat dfzT_;
0076 const trackerTFP::LayerEncoding layerEncoding_;
0077 bool hphDebug_;
0078 bool useNewKF_;
0079 double chosenRofZNewKF_;
0080 std::vector<double> etaRegionsNewKF_;
0081 double chosenRofZ_;
0082 std::vector<double> etaRegions_;
0083 std::map<int, std::map<int, std::vector<int>>> layermap_;
0084 int nEtaRegions_;
0085 int nKalmanLayers_;
0086 };
0087
0088
0089 class HitPatternHelper {
0090 public:
0091 HitPatternHelper(const Setup* setup, int hitpattern, double cot, double z0);
0092 ~HitPatternHelper() {}
0093
0094 int etaSector() { return etaSector_; }
0095 int numExpLayer() { return numExpLayer_; }
0096 int numMissingPS() {
0097 return numMissingPS_;
0098 }
0099
0100
0101 int numMissing2S() {
0102 return numMissing2S_;
0103 }
0104 int numPS() { return numPS_; }
0105 int num2S() { return num2S_; }
0106 int numMissingInterior1() {
0107 return numMissingInterior1_;
0108 }
0109 int numMissingInterior2() {
0110 return numMissingInterior2_;
0111 }
0112 std::vector<int> binary() { return binary_; }
0113 std::vector<float> bonusFeatures() { return bonusFeatures_; }
0114
0115 int reducedId(
0116 int layerId);
0117 int findLayer(int layerId);
0118
0119 private:
0120 const Setup* setup_;
0121 bool hphDebug_;
0122 bool useNewKF_;
0123 std::vector<double> etaRegions_;
0124 std::map<int, std::map<int, std::vector<int>>> layermap_;
0125 int nKalmanLayers_;
0126 int etaBin_;
0127 int cotBin_;
0128 int zTBin_;
0129 std::vector<int> layerEncoding_;
0130 std::map<int, const tt::SensorModule*> layerEncodingMap_;
0131 int numExpLayer_;
0132 int hitpattern_;
0133 int etaSector_;
0134 int numMissingLayer_;
0135 int numMissingPS_;
0136 int numMissing2S_;
0137 int numPS_;
0138 int num2S_;
0139 int numMissingInterior1_;
0140 int numMissingInterior2_;
0141 std::vector<int> binary_;
0142 std::vector<float> bonusFeatures_;
0143 };
0144
0145 }
0146
0147 EVENTSETUP_DATA_DEFAULT_RECORD(hph::Setup, hph::SetupRcd);
0148
0149 #endif