File indexing completed on 2024-04-06 12:21:48
0001 #ifndef L1Trigger_TrackFindingTMTT_L1track2D_h
0002 #define L1Trigger_TrackFindingTMTT_L1track2D_h
0003
0004 #include "FWCore/Utilities/interface/Exception.h"
0005 #include "L1Trigger/TrackFindingTMTT/interface/L1trackBase.h"
0006 #include "L1Trigger/TrackFindingTMTT/interface/Settings.h"
0007 #include "L1Trigger/TrackFindingTMTT/interface/Utility.h"
0008 #include "L1Trigger/TrackFindingTMTT/interface/TP.h"
0009 #include "L1Trigger/TrackFindingTMTT/interface/Stub.h"
0010
0011 #include <vector>
0012 #include <utility>
0013
0014
0015
0016
0017
0018 namespace tmtt {
0019
0020 class L1track2D : public L1trackBase {
0021 public:
0022
0023 L1track2D(const Settings* settings,
0024 const std::vector<Stub*>& stubs,
0025 std::pair<unsigned int, unsigned int> cellLocationHT,
0026 std::pair<float, float> helix2D,
0027 unsigned int iPhiSec,
0028 unsigned int iEtaReg,
0029 unsigned int optoLinkID,
0030 bool mergedHTcell)
0031 : L1trackBase(),
0032 settings_(settings),
0033 stubs_(stubs),
0034 stubsConst_(stubs_.begin(), stubs_.end()),
0035 cellLocationHT_(cellLocationHT),
0036 helix2D_(helix2D),
0037 estValid_(false),
0038 estZ0_(0.),
0039 estTanLambda_(0.),
0040 iPhiSec_(iPhiSec),
0041 iEtaReg_(iEtaReg),
0042 optoLinkID_(optoLinkID),
0043 mergedHTcell_(mergedHTcell) {
0044 nLayers_ = Utility::countLayers(settings, stubs_);
0045 matchedTP_ = Utility::matchingTP(settings,
0046 stubs_,
0047 nMatchedLayers_,
0048 matchedStubs_);
0049 }
0050
0051 ~L1track2D() override = default;
0052
0053
0054
0055
0056 const std::vector<const Stub*>& stubsConst() const override { return stubsConst_; }
0057 const std::vector<Stub*>& stubs() const override { return stubs_; }
0058
0059 unsigned int numStubs() const override { return stubs_.size(); }
0060
0061 unsigned int numLayers() const override { return nLayers_; }
0062
0063 std::pair<unsigned int, unsigned int> cellLocationHT() const override { return cellLocationHT_; }
0064
0065
0066 std::pair<float, float> helix2D() const { return helix2D_; }
0067
0068
0069
0070 float qOverPt() const override { return helix2D_.first; }
0071 float phi0() const override { return helix2D_.second; }
0072
0073
0074
0075
0076
0077 void setTrkEstZ0andTanLam(float estZ0, float estTanLambda) {
0078 estZ0_ = estZ0;
0079 estTanLambda_ = estTanLambda;
0080 estValid_ = true;
0081 }
0082
0083 bool trkEstZ0andTanLam(float& estZ0, float& estTanLambda) const {
0084 estZ0 = estZ0_;
0085 estTanLambda = estTanLambda_;
0086 return estValid_;
0087 }
0088
0089
0090 unsigned int iPhiSec() const override { return iPhiSec_; }
0091 unsigned int iEtaReg() const override { return iEtaReg_; }
0092
0093
0094 unsigned int optoLinkID() const override { return optoLinkID_; }
0095 void setOptoLinkID(unsigned int linkID) { optoLinkID_ = linkID; }
0096
0097
0098 bool mergedHTcell() const { return mergedHTcell_; }
0099
0100
0101
0102
0103 const TP* matchedTP() const override { return matchedTP_; }
0104
0105 const std::vector<const Stub*>& matchedStubs() const override { return matchedStubs_; }
0106
0107 unsigned int numMatchedStubs() const override { return matchedStubs_.size(); }
0108
0109 unsigned int numMatchedLayers() const override { return nMatchedLayers_; }
0110
0111 private:
0112
0113 const Settings* settings_;
0114
0115
0116 std::vector<Stub*> stubs_;
0117 std::vector<const Stub*> stubsConst_;
0118 unsigned int nLayers_;
0119 std::pair<unsigned int, unsigned int> cellLocationHT_;
0120 std::pair<float, float> helix2D_;
0121
0122
0123 bool estValid_;
0124 float estZ0_;
0125 float estTanLambda_;
0126
0127 unsigned int iPhiSec_;
0128 unsigned int iEtaReg_;
0129 unsigned int optoLinkID_;
0130
0131 bool mergedHTcell_;
0132
0133
0134 const TP* matchedTP_;
0135 std::vector<const Stub*> matchedStubs_;
0136 unsigned int nMatchedLayers_;
0137 };
0138
0139 }
0140
0141 #endif