File indexing completed on 2024-04-06 12:21:47
0001 #ifndef L1Trigger_TrackFindingTMTT_DigitalStub_h
0002 #define L1Trigger_TrackFindingTMTT_DigitalStub_h
0003
0004 #include "FWCore/Utilities/interface/Exception.h"
0005 #include <cmath>
0006 #include <string>
0007
0008
0009
0010 namespace tmtt {
0011
0012 class Settings;
0013
0014 class DigitalStub {
0015 public:
0016
0017
0018 DigitalStub(const Settings* settings, double r, double phi, double z, unsigned int iPhiSec);
0019
0020
0021
0022
0023 DigitalStub(const Settings* settings,
0024 double phi_orig,
0025 double r_orig,
0026 double z_orig,
0027 unsigned int mbin_min_orig,
0028 unsigned int mbin_max_orig,
0029 double bend_orig,
0030 unsigned int iPhiSec);
0031
0032
0033
0034 bool changePhiSec(unsigned int iPhiSec);
0035
0036
0037 double r_orig() const { return r_orig_; }
0038 double rt_orig() const { return rt_orig_; }
0039 double phi_orig() const { return phi_orig_; }
0040 double phiS_orig() const { return phiS_orig_; }
0041 double phiN_orig() const { return phiN_orig_; }
0042 double z_orig() const { return z_orig_; }
0043 unsigned int mbin_min_orig() const { return mbin_min_orig_; }
0044 unsigned int mbin_max_orig() const { return mbin_max_orig_; }
0045 double bend_orig() const { return bend_orig_; }
0046
0047
0048
0049 int iDigi_PhiN() const { return iDigi_PhiN_; }
0050 int iDigi_Bend() const { return iDigi_Bend_; }
0051 int iDigi_PhiS() const { return iDigi_PhiS_; }
0052 int mbin_min() const { return mbin_min_; }
0053 int mbin_max() const { return mbin_max_; }
0054 int iDigi_Rt() const { return iDigi_Rt_; }
0055 unsigned int iDigi_R() const { return iDigi_R_; }
0056 int iDigi_Z() const { return iDigi_Z_; }
0057
0058
0059
0060 double phiN() const { return phiN_; }
0061 double phi_GP() const { return phi_GP_; }
0062 double bend() const { return bend_; }
0063 double phiS() const { return phiS_; }
0064 double phi_HT_TF() const { return phi_HT_TF_; }
0065 double rt_GP_HT() const { return rt_GP_HT_; }
0066 double r_GP_HT() const { return r_GP_HT_; }
0067 double r_SF_TF() const { return r_SF_TF_; }
0068 double rt_SF_TF() const { return rt_SF_TF_; }
0069 double z() const { return z_; }
0070
0071
0072
0073 unsigned int iNonant(unsigned int iPhiSec) const { return floor(iPhiSec * numPhiNonants_ / numPhiSectors_); }
0074
0075 private:
0076
0077 void setCfgParams(const Settings* settings);
0078
0079
0080 void digitize(unsigned int iPhiSec);
0081
0082
0083 void undigitize(unsigned int iPhiSec);
0084
0085
0086 void checkInRange() const;
0087
0088
0089 void checkAccuracy() const;
0090
0091 private:
0092
0093
0094
0095 int iFirmwareType_;
0096 unsigned int phiSectorBits_;
0097 unsigned int phiSBits_;
0098 double phiSRange_;
0099 unsigned int rtBits_;
0100 double rtRange_;
0101 unsigned int zBits_;
0102 double zRange_;
0103 unsigned int phiNBits_;
0104 double phiNRange_;
0105 unsigned int bendBits_;
0106 double bendRange_;
0107
0108
0109 double phiSMult_;
0110 double rtMult_;
0111 double zMult_;
0112 double phiNMult_;
0113 double bendMult_;
0114
0115
0116 unsigned int numPhiSectors_;
0117 unsigned int numPhiNonants_;
0118
0119 double phiSectorWidth_;
0120 double phiNonantWidth_;
0121
0122 double phiCentreSec0_;
0123
0124 double phiSectorCentre_;
0125 double phiNonantCentre_;
0126
0127 double chosenRofPhi_;
0128
0129 unsigned int nbinsPt_;
0130
0131 int min_array_mbin_;
0132
0133
0134 unsigned int iPhiSec_done_;
0135
0136
0137 double r_orig_;
0138 double rt_orig_;
0139 double phi_orig_;
0140 double phiS_orig_;
0141 double phiN_orig_;
0142 double z_orig_;
0143 unsigned int mbin_min_orig_;
0144 unsigned int mbin_max_orig_;
0145 double bend_orig_;
0146
0147
0148
0149 int iDigi_PhiN_;
0150 int iDigi_Bend_;
0151 int iDigi_PhiS_;
0152 int mbin_min_;
0153 int mbin_max_;
0154 int iDigi_Rt_;
0155 unsigned int iDigi_R_;
0156 int iDigi_Z_;
0157
0158
0159 double phiN_;
0160 double phi_GP_;
0161 double bend_;
0162 double phiS_;
0163 double phi_HT_TF_;
0164 double rt_GP_HT_;
0165 double r_GP_HT_;
0166 double r_SF_TF_;
0167 double rt_SF_TF_;
0168 double z_;
0169 };
0170
0171 }
0172 #endif