File indexing completed on 2024-11-15 23:40:43
0001
0002
0003
0004
0005
0006 #ifndef L1Trigger_TrackFindingTracklet_interface_TrackletConfigBuilder_h
0007 #define L1Trigger_TrackFindingTracklet_interface_TrackletConfigBuilder_h
0008
0009 #include "L1Trigger/TrackFindingTracklet/interface/Settings.h"
0010
0011 #include <vector>
0012 #include <list>
0013 #include <utility>
0014 #include <set>
0015 #include <iostream>
0016 #include <fstream>
0017 #include <cstdlib>
0018
0019 namespace tt {
0020 class Setup;
0021 }
0022
0023 namespace trklet {
0024
0025 class TrackletConfigBuilder {
0026 public:
0027
0028 TrackletConfigBuilder(const Settings& settings, const tt::Setup* setup = nullptr);
0029
0030
0031 void writeAll(std::ostream& wires, std::ostream& memories, std::ostream& modules);
0032
0033
0034
0035
0036
0037
0038
0039 std::string iSeedStr(unsigned int iSeed) const;
0040
0041
0042 static std::string numStr(unsigned int i);
0043
0044
0045 std::string iTCStr(unsigned int iTC) const;
0046
0047
0048 std::string iRegStr(unsigned int iReg, unsigned int iSeed) const;
0049
0050
0051 std::string TCName(unsigned int iSeed, unsigned int iTC) const;
0052
0053
0054 static std::string LayerName(unsigned int ilayer);
0055
0056
0057 std::string TPROJName(unsigned int iSeed, unsigned int iTC, unsigned int ilayer, unsigned int ireg) const;
0058
0059
0060 std::string PRName(unsigned int ilayer, unsigned int ireg) const;
0061
0062 private:
0063
0064
0065
0066 void initGeom();
0067
0068
0069
0070
0071 void buildTE();
0072
0073
0074
0075
0076 void buildTC();
0077
0078
0079
0080
0081 void buildProjections();
0082
0083 #ifdef CMSSW_GIT_HASH
0084
0085 void setDTCphirange(const tt::Setup* setup);
0086
0087
0088 void writeDTCphirange() const;
0089 #else
0090
0091 void setDTCphirange(const tt::Setup* setup = nullptr);
0092 #endif
0093
0094
0095
0096
0097 bool validTEPair(unsigned int iseed, unsigned int iTE1, unsigned int iTE2);
0098
0099
0100
0101
0102 std::pair<unsigned int, unsigned int> seedLayers(unsigned int iSeed);
0103
0104
0105
0106
0107 std::pair<double, double> seedRadii(unsigned int iseed);
0108
0109
0110
0111
0112 std::pair<double, double> seedPhiRange(double rproj, unsigned int iSeed, unsigned int iTC);
0113
0114
0115
0116
0117
0118 double phi(double r1, double phi1, double r2, double phi2, double r);
0119
0120
0121
0122
0123 double rinv(double r1, double phi1, double r2, double phi2);
0124
0125
0126 std::string SPName(unsigned int l1,
0127 unsigned int ireg1,
0128 unsigned int ivm1,
0129 unsigned int l2,
0130 unsigned int ireg2,
0131 unsigned int ivm2,
0132 unsigned int iseed) const;
0133
0134
0135 std::string SPDName(unsigned int l1,
0136 unsigned int ireg1,
0137 unsigned int ivm1,
0138 unsigned int l2,
0139 unsigned int ireg2,
0140 unsigned int ivm2,
0141 unsigned int l3,
0142 unsigned int ireg3,
0143 unsigned int ivm3,
0144 unsigned int iseed) const;
0145
0146
0147 std::string STName(unsigned int l1,
0148 unsigned int ireg1,
0149 unsigned int l2,
0150 unsigned int ireg2,
0151 unsigned int l3,
0152 unsigned int ireg3,
0153 unsigned int iseed,
0154 unsigned int count) const;
0155
0156
0157 std::string TEName(unsigned int l1,
0158 unsigned int ireg1,
0159 unsigned int ivm1,
0160 unsigned int l2,
0161 unsigned int ireg2,
0162 unsigned int ivm2,
0163 unsigned int iseed) const;
0164
0165
0166 std::string TREName(unsigned int l1,
0167 unsigned int ireg1,
0168 unsigned int l2,
0169 unsigned int ireg2,
0170 unsigned int iseed,
0171 unsigned int count) const;
0172
0173
0174 std::string TEDName(unsigned int l1,
0175 unsigned int ireg1,
0176 unsigned int ivm1,
0177 unsigned int l2,
0178 unsigned int ireg2,
0179 unsigned int ivm2,
0180 unsigned int iseed) const;
0181
0182
0183 std::string TParName(unsigned int l1, unsigned int l2, unsigned int l3, unsigned int itc) const;
0184
0185
0186 std::string TCDName(unsigned int l1, unsigned int l2, unsigned int l3, unsigned int itc) const;
0187
0188
0189 std::string TPROJName(unsigned int l1,
0190 unsigned int l2,
0191 unsigned int l3,
0192 unsigned int itc,
0193 unsigned int projlay,
0194 unsigned int projreg) const;
0195
0196
0197 std::string FTName(unsigned int l1, unsigned int l2, unsigned int l3) const;
0198
0199
0200
0201
0202 void writeProjectionMemories(std::ostream& os, std::ostream& memories, std::ostream& modules);
0203
0204 void writeSPMemories(std::ostream& os, std::ostream& memories, std::ostream& modules);
0205
0206 void writeSPDMemories(std::ostream& os, std::ostream& memories, std::ostream& modules);
0207
0208 void writeAPMemories(std::ostream& os, std::ostream& memories, std::ostream& modules);
0209
0210 void writeCMMemories(std::ostream& os, std::ostream& memories, std::ostream& modules);
0211
0212 void writeVMPROJMemories(std::ostream& os, std::ostream& memories, std::ostream& modules);
0213
0214 void writeFMMemories(std::ostream& os, std::ostream& memories, std::ostream& modules);
0215
0216 void writeASMemories(std::ostream& os, std::ostream& memories, std::ostream& modules);
0217
0218 void writeVMSMemories(std::ostream& os, std::ostream& memories, std::ostream& modules);
0219
0220 void writeTPARMemories(std::ostream& os, std::ostream& memories, std::ostream& modules);
0221
0222 void writeTFMemories(std::ostream& os, std::ostream& memories, std::ostream& modules);
0223
0224 void writeCTMemories(std::ostream& os, std::ostream& memories, std::ostream& modules);
0225
0226 void writeILMemories(std::ostream& os, std::ostream& memories, std::ostream& modules);
0227
0228
0229
0230
0231
0232 unsigned int NSector_;
0233 double rcrit_;
0234
0235 bool duplicateMPs_;
0236 bool combinedmodules_;
0237
0238 bool extended_;
0239
0240 double rinvmax_;
0241 double rmaxdisk_;
0242 double zlength_;
0243 double rmean_[N_LAYER];
0244 double zmean_[N_DISK];
0245
0246 double dphisectorHG_;
0247
0248 unsigned int NTC_[N_SEED_PROMPT];
0249
0250 unsigned int NRegions_[N_LAYER + N_DISK];
0251 unsigned int NVMME_[N_LAYER + N_DISK];
0252 std::pair<unsigned int, unsigned int> NVMTE_[N_SEED_PROMPT];
0253
0254
0255 std::vector<std::pair<double, double> > allStubs_[N_LAYER + N_DISK];
0256
0257
0258 std::vector<std::pair<double, double> > VMStubsME_[N_LAYER + N_DISK];
0259
0260
0261 std::pair<std::vector<std::pair<double, double> >, std::vector<std::pair<double, double> > >
0262 VMStubsTE_[N_SEED_PROMPT];
0263
0264
0265 std::vector<std::pair<unsigned int, unsigned int> > TE_[N_SEED_PROMPT];
0266
0267
0268 std::vector<std::vector<unsigned int> > TC_[N_SEED_PROMPT];
0269
0270
0271 std::vector<std::vector<std::pair<unsigned int, unsigned int> > > projections_[N_LAYER + N_DISK];
0272
0273
0274
0275 int matchport_[N_SEED_PROMPT][N_LAYER + N_DISK] = {{-1, -1, 1, 2, 3, 4, 4, 3, 2, 1, -1},
0276 {1, -1, -1, 2, 3, -1, 4, 3, 2, 1, -1},
0277 {1, 2, -1, -1, 3, 4, 4, 3, -1, -1, -1},
0278 {1, 2, 3, 4, -1, -1, -1, -1, -1, -1, -1},
0279 {1, 2, -1, -1, -1, -1, -1, -1, 2, 3, 4},
0280 {1, -1, -1, -1, -1, -1, 2, 3, -1, -1, 4},
0281 {-1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4},
0282 {1, -1, -1, -1, -1, -1, -1, 2, 3, 4, -1}};
0283
0284 struct DTCinfo {
0285 std::string name;
0286 int layer;
0287 float phimin;
0288 float phimax;
0289 };
0290 std::list<DTCinfo> vecDTCinfo_;
0291
0292
0293 const Settings& settings_;
0294 };
0295 }
0296 #endif