CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
trklet::TrackletConfigBuilder Class Reference

#include <TrackletConfigBuilder.h>

Classes

struct  DTCinfo
 

Public Member Functions

std::string iRegStr (unsigned int iReg, unsigned int iSeed) const
 
std::string iSeedStr (unsigned int iSeed) const
 
std::string iTCStr (unsigned int iTC) const
 
std::string PRName (unsigned int ilayer, unsigned int ireg) const
 
std::string TCName (unsigned int iSeed, unsigned int iTC) const
 
std::string TPROJName (unsigned int iSeed, unsigned int iTC, unsigned int ilayer, unsigned int ireg) const
 
 TrackletConfigBuilder (const Settings &settings, const tt::Setup *setup=nullptr)
 
void writeAll (std::ostream &wires, std::ostream &memories, std::ostream &modules)
 

Static Public Member Functions

static std::string LayerName (unsigned int ilayer)
 
static std::string numStr (unsigned int i)
 

Private Member Functions

void buildProjections ()
 
void buildTC ()
 
void buildTE ()
 
std::string FTName (unsigned int l1, unsigned int l2, unsigned int l3) const
 
void initGeom ()
 
double phi (double r1, double phi1, double r2, double phi2, double r)
 
double rinv (double r1, double phi1, double r2, double phi2)
 
std::pair< unsigned int, unsigned int > seedLayers (unsigned int iSeed)
 
std::pair< double, double > seedPhiRange (double rproj, unsigned int iSeed, unsigned int iTC)
 
std::pair< double, double > seedRadii (unsigned int iseed)
 
void setDTCphirange (const tt::Setup *setup=nullptr)
 
std::string SPDName (unsigned int l1, unsigned int ireg1, unsigned int ivm1, unsigned int l2, unsigned int ireg2, unsigned int ivm2, unsigned int l3, unsigned int ireg3, unsigned int ivm3, unsigned int iseed) const
 
std::string SPName (unsigned int l1, unsigned int ireg1, unsigned int ivm1, unsigned int l2, unsigned int ireg2, unsigned int ivm2, unsigned int iseed) const
 
std::string STName (unsigned int l1, unsigned int ireg1, unsigned int l2, unsigned int ireg2, unsigned int l3, unsigned int ireg3, unsigned int iseed, unsigned int count) const
 
std::string TCDName (unsigned int l1, unsigned int l2, unsigned int l3, unsigned int itc) const
 
std::string TEDName (unsigned int l1, unsigned int ireg1, unsigned int ivm1, unsigned int l2, unsigned int ireg2, unsigned int ivm2, unsigned int iseed) const
 
std::string TEName (unsigned int l1, unsigned int ireg1, unsigned int ivm1, unsigned int l2, unsigned int ireg2, unsigned int ivm2, unsigned int iseed) const
 
std::string TParName (unsigned int l1, unsigned int l2, unsigned int l3, unsigned int itc) const
 
std::string TPROJName (unsigned int l1, unsigned int l2, unsigned int l3, unsigned int itc, unsigned int projlay, unsigned int projreg) const
 
std::string TREName (unsigned int l1, unsigned int ireg1, unsigned int l2, unsigned int ireg2, unsigned int iseed, unsigned int count) const
 
bool validTEPair (unsigned int iseed, unsigned int iTE1, unsigned int iTE2)
 
void writeAPMemories (std::ostream &os, std::ostream &memories, std::ostream &modules)
 
void writeASMemories (std::ostream &os, std::ostream &memories, std::ostream &modules)
 
void writeCMMemories (std::ostream &os, std::ostream &memories, std::ostream &modules)
 
void writeCTMemories (std::ostream &os, std::ostream &memories, std::ostream &modules)
 
void writeFMMemories (std::ostream &os, std::ostream &memories, std::ostream &modules)
 
void writeILMemories (std::ostream &os, std::ostream &memories, std::ostream &modules)
 
void writeProjectionMemories (std::ostream &os, std::ostream &memories, std::ostream &modules)
 
void writeSPDMemories (std::ostream &os, std::ostream &memories, std::ostream &modules)
 
void writeSPMemories (std::ostream &os, std::ostream &memories, std::ostream &modules)
 
void writeTFMemories (std::ostream &os, std::ostream &memories, std::ostream &modules)
 
void writeTPARMemories (std::ostream &os, std::ostream &memories, std::ostream &modules)
 
void writeVMPROJMemories (std::ostream &os, std::ostream &memories, std::ostream &modules)
 
void writeVMSMemories (std::ostream &os, std::ostream &memories, std::ostream &modules)
 

Private Attributes

std::vector< std::pair< double, double > > allStubs_ [N_LAYER+N_DISK]
 
bool combinedmodules_
 
double dphisectorHG_
 
bool duplicateMPs_
 
bool extended_
 
int matchport_ [N_SEED_PROMPT][N_LAYER+N_DISK]
 
unsigned int NRegions_ [N_LAYER+N_DISK]
 
unsigned int NSector_
 
unsigned int NTC_ [N_SEED_PROMPT]
 
unsigned int NVMME_ [N_LAYER+N_DISK]
 
std::pair< unsigned int, unsigned int > NVMTE_ [N_SEED_PROMPT]
 
std::vector< std::vector< std::pair< unsigned int, unsigned int > > > projections_ [N_LAYER+N_DISK]
 
double rcrit_
 
double rinvmax_
 
double rmaxdisk_
 
double rmean_ [N_LAYER]
 
const Settingssettings_
 
std::vector< std::vector< unsigned int > > TC_ [N_SEED_PROMPT]
 
std::vector< std::pair< unsigned int, unsigned int > > TE_ [N_SEED_PROMPT]
 
std::list< DTCinfovecDTCinfo_
 
std::vector< std::pair< double, double > > VMStubsME_ [N_LAYER+N_DISK]
 
std::pair< std::vector< std::pair< double, double > >, std::vector< std::pair< double, double > > > VMStubsTE_ [N_SEED_PROMPT]
 
double zlength_
 
double zmean_ [N_DISK]
 

Detailed Description

Definition at line 25 of file TrackletConfigBuilder.h.

Constructor & Destructor Documentation

◆ TrackletConfigBuilder()

TrackletConfigBuilder::TrackletConfigBuilder ( const Settings settings,
const tt::Setup setup = nullptr 
)

Definition at line 22 of file TrackletConfigBuilder.cc.

References buildProjections(), buildTC(), buildTE(), trklet::Settings::combined(), combinedmodules_, trklet::Settings::dphisectorHG(), dphisectorHG_, trklet::Settings::duplicateMPs(), duplicateMPs_, trklet::Settings::extended(), extended_, mps_fire::i, initGeom(), iseed, trklet::N_DISK, trklet::N_LAYER, trklet::N_SECTOR, trklet::N_SEED_PROMPT, trklet::Settings::nallstubs(), NRegions_, NSector_, trklet::Settings::NTC(), NTC_, trklet::Settings::nvmme(), NVMME_, trklet::Settings::nvmte(), NVMTE_, trklet::Settings::rcrit(), rcrit_, trklet::Settings::rinvmax(), rinvmax_, trklet::Settings::rmaxdisk(), rmaxdisk_, trklet::Settings::rmean(), rmean_, setDTCphirange(), settings_, singleTopDQM_cfi::setup, trklet::Settings::writeConfig(), trklet::Settings::zlength(), zlength_, trklet::Settings::zmean(), and zmean_.

22  : settings_(settings) {
24  rcrit_ = settings.rcrit();
25 
26  duplicateMPs_ = settings.duplicateMPs();
27  combinedmodules_ = settings.combined();
28 
29  extended_ = settings.extended();
30 
31  rinvmax_ = settings.rinvmax();
32 
33  rmaxdisk_ = settings.rmaxdisk();
34  zlength_ = settings.zlength();
35 
36  for (int i = 0; i < N_LAYER; i++) {
37  rmean_[i] = settings.rmean(i);
38  }
39 
40  for (int i = 0; i < N_DISK; i++) {
41  zmean_[i] = settings.zmean(i);
42  }
43 
44  dphisectorHG_ = settings.dphisectorHG();
45 
46  for (int layerdisk = 0; layerdisk < N_LAYER + N_DISK; layerdisk++) {
47  NRegions_[layerdisk] = settings.nallstubs(layerdisk);
48  NVMME_[layerdisk] = settings.nvmme(layerdisk);
49  }
50 
51  for (unsigned int iseed = 0; iseed < N_SEED_PROMPT; iseed++) {
52  NVMTE_[iseed] = std::pair<unsigned int, unsigned int>(settings.nvmte(0, iseed), settings.nvmte(1, iseed));
53  NTC_[iseed] = settings.NTC(iseed);
54  }
55 
56  initGeom();
57 
58  buildTE();
59 
60  buildTC();
61 
63 
65 
66  if (settings_.writeConfig()) {
67  static std::once_flag runOnce; // Only one thread should call this.
68  std::call_once(runOnce, &TrackletConfigBuilder::writeDTCphirange, this);
69  }
70 }
constexpr int N_DISK
Definition: Settings.h:26
unsigned int NTC(int seed) const
Definition: Settings.h:162
bool combined() const
Definition: Settings.h:277
double dphisectorHG() const
Definition: Settings.h:327
double zlength() const
Definition: Settings.h:133
double rinvmax() const
Definition: Settings.h:226
void setDTCphirange(const tt::Setup *setup=nullptr)
unsigned int NTC_[N_SEED_PROMPT]
bool duplicateMPs() const
Definition: Settings.h:270
double rmean(unsigned int iLayer) const
Definition: Settings.h:173
double zmean(unsigned int iDisk) const
Definition: Settings.h:176
unsigned int nvmte(unsigned int inner, unsigned int iSeed) const
Definition: Settings.h:110
unsigned int nallstubs(unsigned int layerdisk) const
Definition: Settings.h:116
constexpr unsigned int N_SECTOR
Definition: Settings.h:23
unsigned int NVMME_[N_LAYER+N_DISK]
int iseed
Definition: AMPTWrapper.h:134
double rmaxdisk() const
Definition: Settings.h:134
unsigned int NRegions_[N_LAYER+N_DISK]
bool writeConfig() const
Definition: Settings.h:202
bool extended() const
Definition: Settings.h:268
unsigned int nvmme(unsigned int layerdisk) const
Definition: Settings.h:113
constexpr unsigned int N_SEED_PROMPT
Definition: Settings.h:29
std::pair< unsigned int, unsigned int > NVMTE_[N_SEED_PROMPT]
constexpr int N_LAYER
Definition: Settings.h:25
double rcrit() const
Definition: Settings.h:334

Member Function Documentation

◆ buildProjections()

void TrackletConfigBuilder::buildProjections ( )
private

Definition at line 364 of file TrackletConfigBuilder.cc.

References allStubs_, combinedmodules_, iseed, matchport_, trklet::N_DISK, trklet::N_LAYER, trklet::N_SEED_PROMPT, NRegions_, projections_, rmaxdisk_, rmean_, seedPhiRange(), TC_, createJobs::tmp, and TPROJName().

Referenced by TrackletConfigBuilder().

364  {
365  set<string> emptyProjStandard = {
366  "TPROJ_L1L2H_L3PHIB", "TPROJ_L1L2E_L3PHIC", "TPROJ_L1L2K_L3PHIC", "TPROJ_L1L2H_L3PHID", "TPROJ_L1L2F_L5PHIA",
367  "TPROJ_L1L2G_L5PHID", "TPROJ_L1L2A_L6PHIA", "TPROJ_L1L2J_L6PHIB", "TPROJ_L1L2C_L6PHIC", "TPROJ_L1L2L_L6PHID",
368  "TPROJ_L3L4D_D1PHIB", "TPROJ_L2L3A_D1PHIC", "TPROJ_L3L4A_D1PHIC", "TPROJ_L1L2G_D2PHIA", "TPROJ_L1D1D_D2PHIA",
369  "TPROJ_L1D1E_D2PHIA", "TPROJ_L1L2J_D2PHIB", "TPROJ_L3L4D_D2PHIB", "TPROJ_L1D1A_D2PHIB", "TPROJ_L1D1F_D2PHIB",
370  "TPROJ_L1D1G_D2PHIB", "TPROJ_L1L2C_D2PHIC", "TPROJ_L2L3A_D2PHIC", "TPROJ_L3L4A_D2PHIC", "TPROJ_L1D1B_D2PHIC",
371  "TPROJ_L1D1C_D2PHIC", "TPROJ_L1D1H_D2PHIC", "TPROJ_L2D1A_D2PHIC", "TPROJ_L1L2F_D2PHID", "TPROJ_L1D1D_D2PHID",
372  "TPROJ_L1D1E_D2PHID", "TPROJ_L1L2G_D3PHIA", "TPROJ_L1D1D_D3PHIA", "TPROJ_L1D1E_D3PHIA", "TPROJ_L1L2J_D3PHIB",
373  "TPROJ_L1D1A_D3PHIB", "TPROJ_L1D1F_D3PHIB", "TPROJ_L1D1G_D3PHIB", "TPROJ_L1L2C_D3PHIC", "TPROJ_L2L3A_D3PHIC",
374  "TPROJ_L1D1B_D3PHIC", "TPROJ_L1D1C_D3PHIC", "TPROJ_L1D1H_D3PHIC", "TPROJ_L2D1A_D3PHIC", "TPROJ_L1L2F_D3PHID",
375  "TPROJ_L1D1D_D3PHID", "TPROJ_L1D1E_D3PHID", "TPROJ_L1L2G_D4PHIA", "TPROJ_L1D1D_D4PHIA", "TPROJ_L1D1E_D4PHIA",
376  "TPROJ_L1L2J_D4PHIB", "TPROJ_L1D1G_D4PHIB", "TPROJ_L1L2C_D4PHIC", "TPROJ_L2L3A_D4PHIC", "TPROJ_L1D1B_D4PHIC",
377  "TPROJ_L2D1A_D4PHIC", "TPROJ_L1L2F_D4PHID", "TPROJ_L1D1D_D4PHID", "TPROJ_L1D1E_D5PHIA", "TPROJ_L1D1G_D5PHIB",
378  "TPROJ_L1D1B_D5PHIC", "TPROJ_L1D1D_D5PHID"};
379 
380  set<string> emptyProjCombined = {
381  "TPROJ_L1L2J_L6PHIB", "TPROJ_L1L2C_L6PHIC", "TPROJ_L1L2G_D1PHIA", "TPROJ_L1L2J_D1PHIB", "TPROJ_L2L3D_D1PHIB",
382  "TPROJ_L3L4D_D1PHIB", "TPROJ_L1L2C_D1PHIC", "TPROJ_L2L3A_D1PHIC", "TPROJ_L3L4A_D1PHIC", "TPROJ_L1L2F_D1PHID",
383  "TPROJ_L1L2G_D2PHIA", "TPROJ_L1D1E_D2PHIA", "TPROJ_L1L2J_D2PHIB", "TPROJ_L2L3D_D2PHIB", "TPROJ_L3L4D_D2PHIB",
384  "TPROJ_L1D1G_D2PHIB", "TPROJ_L1L2C_D2PHIC", "TPROJ_L2L3A_D2PHIC", "TPROJ_L3L4A_D2PHIC", "TPROJ_L1D1B_D2PHIC",
385  "TPROJ_L2D1A_D2PHIC", "TPROJ_L1L2F_D2PHID", "TPROJ_L1D1D_D2PHID", "TPROJ_L1L2G_D3PHIA", "TPROJ_L1D1E_D3PHIA",
386  "TPROJ_L1L2J_D3PHIB", "TPROJ_L2L3D_D3PHIB", "TPROJ_L1D1G_D3PHIB", "TPROJ_L1L2C_D3PHIC", "TPROJ_L2L3A_D3PHIC",
387  "TPROJ_L1D1B_D3PHIC", "TPROJ_L2D1A_D3PHIC", "TPROJ_L1L2F_D3PHID", "TPROJ_L1D1D_D3PHID", "TPROJ_L1L2G_D4PHIA",
388  "TPROJ_L1D1E_D4PHIA", "TPROJ_L1L2J_D4PHIB", "TPROJ_L2L3D_D4PHIB", "TPROJ_L1D1G_D4PHIB", "TPROJ_L1L2C_D4PHIC",
389  "TPROJ_L2L3A_D4PHIC", "TPROJ_L1D1B_D4PHIC", "TPROJ_L2D1A_D4PHIC", "TPROJ_L1L2F_D4PHID", "TPROJ_L1D1D_D4PHID",
390  "TPROJ_L1D1E_D5PHIA", "TPROJ_L1D1G_D5PHIB", "TPROJ_L1D1B_D5PHIC", "TPROJ_L1D1D_D5PHID"};
391 
392  for (unsigned int iseed = 0; iseed < N_SEED_PROMPT; iseed++) {
393  std::vector<std::vector<unsigned int> >& TCs = TC_[iseed];
394 
395  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
396  if (matchport_[iseed][ilayer] == -1)
397  continue;
398  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
399  for (unsigned int iTC = 0; iTC < TCs.size(); iTC++) {
400  double rproj = rmaxdisk_;
401  if (ilayer < 6)
402  rproj = rmean_[ilayer];
403  std::pair<double, double> phiRange = seedPhiRange(rproj, iseed, iTC);
404  if (phiRange.first < allStubs_[ilayer][iReg].second && phiRange.second > allStubs_[ilayer][iReg].first) {
405  std::pair<unsigned int, unsigned int> tmp(iseed, iTC); //seedindex and TC
406  string projName = TPROJName(iseed, iTC, ilayer, iReg);
407  if (combinedmodules_) {
408  if (emptyProjCombined.find(projName) == emptyProjCombined.end()) {
409  projections_[ilayer][iReg].push_back(tmp);
410  }
411  } else {
412  if (emptyProjStandard.find(projName) == emptyProjStandard.end()) {
413  projections_[ilayer][iReg].push_back(tmp);
414  }
415  }
416  }
417  }
418  }
419  }
420  }
421 }
std::vector< std::vector< std::pair< unsigned int, unsigned int > > > projections_[N_LAYER+N_DISK]
constexpr int N_DISK
Definition: Settings.h:26
std::vector< std::vector< unsigned int > > TC_[N_SEED_PROMPT]
int iseed
Definition: AMPTWrapper.h:134
unsigned int NRegions_[N_LAYER+N_DISK]
std::vector< std::pair< double, double > > allStubs_[N_LAYER+N_DISK]
int matchport_[N_SEED_PROMPT][N_LAYER+N_DISK]
std::string TPROJName(unsigned int iSeed, unsigned int iTC, unsigned int ilayer, unsigned int ireg) const
std::pair< double, double > seedPhiRange(double rproj, unsigned int iSeed, unsigned int iTC)
tmp
align.sh
Definition: createJobs.py:716
constexpr unsigned int N_SEED_PROMPT
Definition: Settings.h:29
constexpr int N_LAYER
Definition: Settings.h:25

◆ buildTC()

void TrackletConfigBuilder::buildTC ( )
private

Definition at line 310 of file TrackletConfigBuilder.cc.

References cms::cuda::assert(), trklet::N_SEED_PROMPT, NTC_, TC_, TE_, and createJobs::tmp.

Referenced by TrackletConfigBuilder().

310  {
311  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
312  unsigned int nTC = NTC_[iSeed];
313  std::vector<std::pair<unsigned int, unsigned int> >& TEs = TE_[iSeed];
314  std::vector<std::vector<unsigned int> >& TCs = TC_[iSeed];
315 
316  //Very naive method to group TEs in TC
317 
318  double invnTC = nTC * (1.0 / TEs.size());
319 
320  for (unsigned int iTE = 0; iTE < TEs.size(); iTE++) {
321  int iTC = invnTC * iTE;
322  assert(iTC < (int)nTC);
323  if (iTC >= (int)TCs.size()) {
324  std::vector<unsigned int> tmp;
325  tmp.push_back(iTE);
326  TCs.push_back(tmp);
327  } else {
328  TCs[iTC].push_back(iTE);
329  }
330  }
331  }
332 }
std::vector< std::pair< unsigned int, unsigned int > > TE_[N_SEED_PROMPT]
assert(be >=bs)
unsigned int NTC_[N_SEED_PROMPT]
std::vector< std::vector< unsigned int > > TC_[N_SEED_PROMPT]
tmp
align.sh
Definition: createJobs.py:716
constexpr unsigned int N_SEED_PROMPT
Definition: Settings.h:29

◆ buildTE()

void TrackletConfigBuilder::buildTE ( )
private

Definition at line 294 of file TrackletConfigBuilder.cc.

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, iseed, trklet::N_SEED_PROMPT, TE_, createJobs::tmp, validTEPair(), and VMStubsTE_.

Referenced by TrackletConfigBuilder().

294  {
295  for (unsigned int iseed = 0; iseed < N_SEED_PROMPT; iseed++) {
296  for (unsigned int i1 = 0; i1 < VMStubsTE_[iseed].first.size(); i1++) {
297  for (unsigned int i2 = 0; i2 < VMStubsTE_[iseed].second.size(); i2++) {
298  if (validTEPair(iseed, i1, i2)) {
299  std::pair<unsigned int, unsigned int> tmp(i1, i2);
300  // Contains pairs of indices of all valid VM pairs in seeding layers
301  TE_[iseed].push_back(tmp);
302  }
303  }
304  }
305  }
306 }
std::vector< std::pair< unsigned int, unsigned int > > TE_[N_SEED_PROMPT]
std::pair< std::vector< std::pair< double, double > >, std::vector< std::pair< double, double > > > VMStubsTE_[N_SEED_PROMPT]
int iseed
Definition: AMPTWrapper.h:134
bool validTEPair(unsigned int iseed, unsigned int iTE1, unsigned int iTE2)
tmp
align.sh
Definition: createJobs.py:716
constexpr unsigned int N_SEED_PROMPT
Definition: Settings.h:29

◆ FTName()

std::string TrackletConfigBuilder::FTName ( unsigned int  l1,
unsigned int  l2,
unsigned int  l3 
) const
private

Definition at line 636 of file TrackletConfigBuilder.cc.

References LayerName().

Referenced by writeSPDMemories().

636  {
637  return "FT_" + LayerName(l1) + LayerName(l2) + LayerName(l3);
638 }
static std::string LayerName(unsigned int ilayer)

◆ initGeom()

void TrackletConfigBuilder::initGeom ( )
private

Definition at line 196 of file TrackletConfigBuilder.cc.

References allStubs_, dphisectorHG_, iseed, trklet::N_DISK, trklet::N_LAYER, trklet::N_SEED_PROMPT, NRegions_, NVMME_, NVMTE_, phimax, phimin, projections_, seedLayers(), createJobs::tmp, VMStubsME_, and VMStubsTE_.

Referenced by TrackletConfigBuilder().

196  {
197  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
198  double dphi = dphisectorHG_ / NRegions_[ilayer];
199  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
200  std::vector<std::pair<unsigned int, unsigned int> > emptyVec;
201  projections_[ilayer].push_back(emptyVec);
202  // FIX: sector doesn't have hourglass shape
203  double phimin = dphi * iReg;
204  double phimax = phimin + dphi;
205  std::pair<double, double> tmp(phimin, phimax);
206  allStubs_[ilayer].push_back(tmp);
207  double dphiVM = dphi / NVMME_[ilayer];
208  for (unsigned int iVM = 0; iVM < NVMME_[ilayer]; iVM++) {
209  double phivmmin = phimin + iVM * dphiVM;
210  double phivmmax = phivmmin + dphiVM;
211  std::pair<double, double> tmp(phivmmin, phivmmax);
212  VMStubsME_[ilayer].push_back(tmp);
213  }
214  }
215  }
216  for (unsigned int iseed = 0; iseed < N_SEED_PROMPT; iseed++) {
217  unsigned int l1 = seedLayers(iseed).first;
218  unsigned int l2 = seedLayers(iseed).second;
219  unsigned int nVM1 = NVMTE_[iseed].first;
220  unsigned int nVM2 = NVMTE_[iseed].second;
221  double dphiVM = dphisectorHG_ / (nVM1 * NRegions_[l1]);
222  for (unsigned int iVM = 0; iVM < nVM1 * NRegions_[l1]; iVM++) {
223  double phivmmin = iVM * dphiVM;
224  double phivmmax = phivmmin + dphiVM;
225  std::pair<double, double> tmp(phivmmin, phivmmax);
226  VMStubsTE_[iseed].first.push_back(tmp);
227  }
228  dphiVM = dphisectorHG_ / (nVM2 * NRegions_[l2]);
229  for (unsigned int iVM = 0; iVM < nVM2 * NRegions_[l2]; iVM++) {
230  double phivmmin = iVM * dphiVM;
231  double phivmmax = phivmmin + dphiVM;
232  std::pair<double, double> tmp(phivmmin, phivmmax);
233  VMStubsTE_[iseed].second.push_back(tmp);
234  }
235  }
236 }
std::vector< std::vector< std::pair< unsigned int, unsigned int > > > projections_[N_LAYER+N_DISK]
constexpr int N_DISK
Definition: Settings.h:26
std::vector< std::pair< double, double > > VMStubsME_[N_LAYER+N_DISK]
std::pair< std::vector< std::pair< double, double > >, std::vector< std::pair< double, double > > > VMStubsTE_[N_SEED_PROMPT]
unsigned int NVMME_[N_LAYER+N_DISK]
int iseed
Definition: AMPTWrapper.h:134
unsigned int NRegions_[N_LAYER+N_DISK]
std::vector< std::pair< double, double > > allStubs_[N_LAYER+N_DISK]
std::pair< unsigned int, unsigned int > seedLayers(unsigned int iSeed)
tmp
align.sh
Definition: createJobs.py:716
constexpr unsigned int N_SEED_PROMPT
Definition: Settings.h:29
std::pair< unsigned int, unsigned int > NVMTE_[N_SEED_PROMPT]
constexpr int N_LAYER
Definition: Settings.h:25

◆ iRegStr()

std::string TrackletConfigBuilder::iRegStr ( unsigned int  iReg,
unsigned int  iSeed 
) const

Definition at line 463 of file TrackletConfigBuilder.cc.

References cms::cuda::assert(), trklet::L1D1, trklet::L2D1, trklet::L2L3, mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SPDName(), SPName(), STName(), TEDName(), TEName(), TREName(), and writeVMSMemories().

463  {
464  static std::string name[8] = {"A", "B", "C", "D", "E", "F", "G", "H"};
465 
466  static std::string nameOverlap[8] = {"X", "Y", "Z", "W", "Q", "R", "S", "T"};
467 
468  static std::string nameL2L3[4] = {"I", "J", "K", "L"};
469 
470  if (iSeed == Seed::L2L3) {
471  assert(iReg < 4);
472  return nameL2L3[iReg];
473  }
474  if (iSeed == Seed::L1D1 || iSeed == Seed::L2D1) {
475  assert(iReg < 8);
476  return nameOverlap[iReg];
477  }
478  assert(iReg < 8);
479  return name[iReg];
480 }
assert(be >=bs)

◆ iSeedStr()

std::string TrackletConfigBuilder::iSeedStr ( unsigned int  iSeed) const

Definition at line 441 of file TrackletConfigBuilder.cc.

References cms::cuda::assert(), mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by TCName(), TPROJName(), writeASMemories(), writeCTMemories(), writeFMMemories(), writeTFMemories(), and writeTPARMemories().

441  {
442  static std::string name[8] = {"L1L2", "L2L3", "L3L4", "L5L6", "D1D2", "D3D4", "L1D1", "L2D1"};
443 
444  assert(iSeed < 8);
445  return name[iSeed];
446 }
assert(be >=bs)

◆ iTCStr()

std::string TrackletConfigBuilder::iTCStr ( unsigned int  iTC) const

◆ LayerName()

std::string TrackletConfigBuilder::LayerName ( unsigned int  ilayer)
static

◆ numStr()

std::string TrackletConfigBuilder::numStr ( unsigned int  i)
static

Definition at line 448 of file TrackletConfigBuilder.cc.

References cms::cuda::assert(), mps_fire::i, EgammaValidation_cff::num, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by LayerName(), SPDName(), SPName(), STName(), TEDName(), TEName(), and TREName().

448  {
449  static std::string num[32] = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11",
450  "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
451  "23", "24", "25", "26", "27", "28", "29", "30", "31", "32"};
452  assert(i < 32);
453  return num[i];
454 }
assert(be >=bs)

◆ phi()

double TrackletConfigBuilder::phi ( double  r1,
double  phi1,
double  r2,
double  phi2,
double  r 
)
private

Definition at line 426 of file TrackletConfigBuilder.cc.

References funct::abs(), diffTwoXMLs::r2, rinv(), and rinvmax_.

Referenced by Particle.Particle::__str__(), datamodel.Object::DeltaR(), datamodel.Object::p4(), ntupleDataFormat.Track::phiPull(), and seedPhiRange().

426  {
427  double rhoinv = rinv(r1, phi1, r2, phi2);
428  if (std::abs(rhoinv) > rinvmax_) {
429  rhoinv = rinvmax_ * rhoinv / std::abs(rhoinv);
430  }
431  return phi1 + asin(0.5 * r * rhoinv) - asin(0.5 * r1 * rhoinv);
432 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double rinv(double r1, double phi1, double r2, double phi2)

◆ PRName()

std::string TrackletConfigBuilder::PRName ( unsigned int  ilayer,
unsigned int  ireg 
) const

Definition at line 501 of file TrackletConfigBuilder.cc.

References combinedmodules_, iTCStr(), and LayerName().

Referenced by writeProjectionMemories().

501  {
502  if (combinedmodules_) {
503  return "MP_" + LayerName(ilayer) + "PHI" + iTCStr(ireg);
504  } else {
505  return "PR_" + LayerName(ilayer) + "PHI" + iTCStr(ireg);
506  }
507 }
static std::string LayerName(unsigned int ilayer)
std::string iTCStr(unsigned int iTC) const

◆ rinv()

double TrackletConfigBuilder::rinv ( double  r1,
double  phi1,
double  r2,
double  phi2 
)
private

Definition at line 436 of file TrackletConfigBuilder.cc.

References funct::cos(), diffTwoXMLs::r2, funct::sin(), and mathSSE::sqrt().

Referenced by phi(), and validTEPair().

436  {
437  double deltaphi = phi1 - phi2;
438  return 2 * sin(deltaphi) / sqrt(r2 * r2 + r1 * r1 - 2 * r1 * r2 * cos(deltaphi));
439 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T sqrt(T t)
Definition: SSEVec.h:23
Cos< T >::type cos(const T &t)
Definition: Cos.h:22

◆ seedLayers()

std::pair< unsigned int, unsigned int > TrackletConfigBuilder::seedLayers ( unsigned int  iSeed)
private

Definition at line 190 of file TrackletConfigBuilder.cc.

References trklet::Settings::seedlayers(), and settings_.

Referenced by initGeom(), seedRadii(), writeASMemories(), writeSPMemories(), and writeVMSMemories().

190  {
191  return std::pair<unsigned int, unsigned int>(settings_.seedlayers(0, iSeed), settings_.seedlayers(1, iSeed));
192 }
unsigned int seedlayers(int inner, int seed) const
Definition: Settings.h:154

◆ seedPhiRange()

std::pair< double, double > TrackletConfigBuilder::seedPhiRange ( double  rproj,
unsigned int  iSeed,
unsigned int  iTC 
)
private

Definition at line 336 of file TrackletConfigBuilder.cc.

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, phi(), phimax, phimin, seedRadii(), TC_, TE_, and VMStubsTE_.

Referenced by buildProjections().

336  {
337  std::vector<std::vector<unsigned int> >& TCs = TC_[iSeed];
338 
339  std::pair<double, double> seedradii = seedRadii(iSeed);
340 
341  double phimin = 999.0;
342  double phimax = -999.0;
343  for (unsigned int iTE = 0; iTE < TCs[iTC].size(); iTE++) {
344  unsigned int theTE = TCs[iTC][iTE];
345  unsigned int l1TE = TE_[iSeed][theTE].first;
346  unsigned int l2TE = TE_[iSeed][theTE].second;
347  double phi1[2] = {VMStubsTE_[iSeed].first[l1TE].first, VMStubsTE_[iSeed].first[l1TE].second};
348  double phi2[2] = {VMStubsTE_[iSeed].second[l2TE].first, VMStubsTE_[iSeed].second[l2TE].second};
349  for (unsigned int i1 = 0; i1 < 2; i1++) {
350  for (unsigned int i2 = 0; i2 < 2; i2++) {
351  double aphi = phi(seedradii.first, phi1[i1], seedradii.second, phi2[i2], rproj);
352  if (aphi < phimin)
353  phimin = aphi;
354  if (aphi > phimax)
355  phimax = aphi;
356  }
357  }
358  }
359  return std::pair<double, double>(phimin, phimax);
360 }
std::vector< std::pair< unsigned int, unsigned int > > TE_[N_SEED_PROMPT]
std::vector< std::vector< unsigned int > > TC_[N_SEED_PROMPT]
std::pair< std::vector< std::pair< double, double > >, std::vector< std::pair< double, double > > > VMStubsTE_[N_SEED_PROMPT]
std::pair< double, double > seedRadii(unsigned int iseed)
double phi(double r1, double phi1, double r2, double phi2, double r)

◆ seedRadii()

std::pair< double, double > TrackletConfigBuilder::seedRadii ( unsigned int  iseed)
private

Definition at line 240 of file TrackletConfigBuilder.cc.

References iseed, diffTwoXMLs::r2, rmean_, seedLayers(), zlength_, and zmean_.

Referenced by seedPhiRange(), and validTEPair().

240  {
241  std::pair<unsigned int, unsigned int> seedlayers = seedLayers(iseed);
242 
243  unsigned int l1 = seedlayers.first;
244  unsigned int l2 = seedlayers.second;
245 
246  double r1, r2;
247 
248  if (iseed < 4) { //barrel seeding
249  r1 = rmean_[l1];
250  r2 = rmean_[l2];
251  } else if (iseed < 6) { //disk seeding
252  r1 = rmean_[0] + 40.0; //FIX: Somewhat of a hack - but allows finding all the regions
253  //when projecting to L1
254  r2 = r1 * zmean_[l2 - 6] / zmean_[l1 - 6];
255  } else { //overlap seeding
256  r1 = rmean_[l1];
257  r2 = r1 * zmean_[l2 - 6] / zlength_;
258  }
259 
260  return std::pair<double, double>(r1, r2);
261 }
int iseed
Definition: AMPTWrapper.h:134
std::pair< unsigned int, unsigned int > seedLayers(unsigned int iSeed)

◆ setDTCphirange()

void TrackletConfigBuilder::setDTCphirange ( const tt::Setup setup = nullptr)
private

Definition at line 168 of file TrackletConfigBuilder.cc.

References cms::cuda::assert(), alignmentValidation::fname, info(), mps_splice::line, and vecDTCinfo_.

Referenced by TrackletConfigBuilder().

168  {
169  // This file previously written by writeDTCphirange().
170  const string fname = "../data/dtcphirange.txt";
171  if (vecDTCinfo_.empty()) { // Only run once per thread.
172  std::ifstream str_dtc;
173  str_dtc.open(fname);
174  assert(str_dtc.good());
175  string line;
176  while (ifstream, getline(line)) {
177  std::istringstream iss(line);
178  DTCinfo info;
179  iss >> info.name >> info.layer >> info.phimin >> info.phimax;
180  vecDTCinfo_.push_back(info);
181  }
182  str_dtc.close();
183  }
184 }
static const TGPicture * info(bool iBackgroundIsBlack)
assert(be >=bs)
string fname
main script

◆ SPDName()

std::string TrackletConfigBuilder::SPDName ( unsigned int  l1,
unsigned int  ireg1,
unsigned int  ivm1,
unsigned int  l2,
unsigned int  ireg2,
unsigned int  ivm2,
unsigned int  l3,
unsigned int  ireg3,
unsigned int  ivm3,
unsigned int  iseed 
) const
private

Definition at line 582 of file TrackletConfigBuilder.cc.

References iRegStr(), iseed, LayerName(), and numStr().

Referenced by writeSPDMemories().

591  {
592  return "SPD_" + LayerName(l1) + "PHI" + iRegStr(ireg1, iseed) + numStr(ivm1) + "_" + LayerName(l2) + "PHI" +
593  iRegStr(ireg2, iseed) + numStr(ivm2) + "_" + LayerName(l3) + "PHI" + iRegStr(ireg3, iseed) + numStr(ivm3);
594 }
static std::string numStr(unsigned int i)
static std::string LayerName(unsigned int ilayer)
std::string iRegStr(unsigned int iReg, unsigned int iSeed) const
int iseed
Definition: AMPTWrapper.h:134

◆ SPName()

std::string TrackletConfigBuilder::SPName ( unsigned int  l1,
unsigned int  ireg1,
unsigned int  ivm1,
unsigned int  l2,
unsigned int  ireg2,
unsigned int  ivm2,
unsigned int  iseed 
) const
private

Definition at line 571 of file TrackletConfigBuilder.cc.

References iRegStr(), iseed, LayerName(), and numStr().

Referenced by writeSPMemories().

577  {
578  return "SP_" + LayerName(l1) + "PHI" + iRegStr(ireg1, iseed) + numStr(ivm1) + "_" + LayerName(l2) + "PHI" +
579  iRegStr(ireg2, iseed) + numStr(ivm2);
580 }
static std::string numStr(unsigned int i)
static std::string LayerName(unsigned int ilayer)
std::string iRegStr(unsigned int iReg, unsigned int iSeed) const
int iseed
Definition: AMPTWrapper.h:134

◆ STName()

std::string TrackletConfigBuilder::STName ( unsigned int  l1,
unsigned int  ireg1,
unsigned int  l2,
unsigned int  ireg2,
unsigned int  l3,
unsigned int  ireg3,
unsigned int  iseed,
unsigned int  count 
) const
private

Definition at line 649 of file TrackletConfigBuilder.cc.

References submitPVResolutionJobs::count, iRegStr(), iseed, LayerName(), and numStr().

Referenced by writeSPDMemories().

656  {
657  return "ST_" + LayerName(l1) + iRegStr(ireg1, iseed) + LayerName(l2) + iRegStr(ireg2, iseed) + "_" + LayerName(l3) +
658  iRegStr(ireg3, iseed) + "_" + numStr(count);
659 }
static std::string numStr(unsigned int i)
static std::string LayerName(unsigned int ilayer)
std::string iRegStr(unsigned int iReg, unsigned int iSeed) const
int iseed
Definition: AMPTWrapper.h:134

◆ TCDName()

std::string TrackletConfigBuilder::TCDName ( unsigned int  l1,
unsigned int  l2,
unsigned int  l3,
unsigned int  itc 
) const
private

Definition at line 622 of file TrackletConfigBuilder.cc.

References iTCStr(), and LayerName().

Referenced by writeSPDMemories().

622  {
623  return "TCD_" + LayerName(l1) + LayerName(l2) + LayerName(l3) + iTCStr(itc);
624 }
static std::string LayerName(unsigned int ilayer)
std::string iTCStr(unsigned int iTC) const

◆ TCName()

std::string TrackletConfigBuilder::TCName ( unsigned int  iSeed,
unsigned int  iTC 
) const

Definition at line 482 of file TrackletConfigBuilder.cc.

References combinedmodules_, iSeedStr(), and iTCStr().

Referenced by writeProjectionMemories(), and writeSPMemories().

482  {
483  if (combinedmodules_) {
484  return "TP_" + iSeedStr(iSeed) + iTCStr(iTC);
485  } else {
486  return "TC_" + iSeedStr(iSeed) + iTCStr(iTC);
487  }
488 }
std::string iSeedStr(unsigned int iSeed) const
std::string iTCStr(unsigned int iTC) const

◆ TEDName()

std::string TrackletConfigBuilder::TEDName ( unsigned int  l1,
unsigned int  ireg1,
unsigned int  ivm1,
unsigned int  l2,
unsigned int  ireg2,
unsigned int  ivm2,
unsigned int  iseed 
) const
private

Definition at line 607 of file TrackletConfigBuilder.cc.

References iRegStr(), iseed, LayerName(), and numStr().

Referenced by writeSPDMemories().

613  {
614  return "TED_" + LayerName(l1) + "PHI" + iRegStr(ireg1, iseed) + numStr(ivm1) + "_" + LayerName(l2) + "PHI" +
615  iRegStr(ireg2, iseed) + numStr(ivm2);
616 }
static std::string numStr(unsigned int i)
static std::string LayerName(unsigned int ilayer)
std::string iRegStr(unsigned int iReg, unsigned int iSeed) const
int iseed
Definition: AMPTWrapper.h:134

◆ TEName()

std::string TrackletConfigBuilder::TEName ( unsigned int  l1,
unsigned int  ireg1,
unsigned int  ivm1,
unsigned int  l2,
unsigned int  ireg2,
unsigned int  ivm2,
unsigned int  iseed 
) const
private

Definition at line 596 of file TrackletConfigBuilder.cc.

References iRegStr(), iseed, LayerName(), and numStr().

Referenced by writeSPMemories().

602  {
603  return "TE_" + LayerName(l1) + "PHI" + iRegStr(ireg1, iseed) + numStr(ivm1) + "_" + LayerName(l2) + "PHI" +
604  iRegStr(ireg2, iseed) + numStr(ivm2);
605 }
static std::string numStr(unsigned int i)
static std::string LayerName(unsigned int ilayer)
std::string iRegStr(unsigned int iReg, unsigned int iSeed) const
int iseed
Definition: AMPTWrapper.h:134

◆ TParName()

std::string TrackletConfigBuilder::TParName ( unsigned int  l1,
unsigned int  l2,
unsigned int  l3,
unsigned int  itc 
) const
private

Definition at line 618 of file TrackletConfigBuilder.cc.

References iTCStr(), and LayerName().

Referenced by writeSPDMemories().

618  {
619  return "TPAR_" + LayerName(l1) + LayerName(l2) + LayerName(l3) + iTCStr(itc);
620 }
static std::string LayerName(unsigned int ilayer)
std::string iTCStr(unsigned int iTC) const

◆ TPROJName() [1/2]

std::string TrackletConfigBuilder::TPROJName ( unsigned int  iSeed,
unsigned int  iTC,
unsigned int  ilayer,
unsigned int  ireg 
) const

Definition at line 494 of file TrackletConfigBuilder.cc.

References iSeedStr(), iTCStr(), and LayerName().

Referenced by buildProjections(), writeProjectionMemories(), and writeSPDMemories().

497  {
498  return "TPROJ_" + iSeedStr(iSeed) + iTCStr(iTC) + "_" + LayerName(ilayer) + "PHI" + iTCStr(ireg);
499 }
static std::string LayerName(unsigned int ilayer)
std::string iSeedStr(unsigned int iSeed) const
std::string iTCStr(unsigned int iTC) const

◆ TPROJName() [2/2]

std::string TrackletConfigBuilder::TPROJName ( unsigned int  l1,
unsigned int  l2,
unsigned int  l3,
unsigned int  itc,
unsigned int  projlay,
unsigned int  projreg 
) const
private

Definition at line 626 of file TrackletConfigBuilder.cc.

References iTCStr(), and LayerName().

631  {
632  return "TPROJ_" + LayerName(l1) + LayerName(l2) + LayerName(l3) + iTCStr(itc) + "_" + LayerName(projlayer) + "PHI" +
633  iTCStr(projreg);
634 }
static std::string LayerName(unsigned int ilayer)
std::string iTCStr(unsigned int iTC) const

◆ TREName()

std::string TrackletConfigBuilder::TREName ( unsigned int  l1,
unsigned int  ireg1,
unsigned int  l2,
unsigned int  ireg2,
unsigned int  iseed,
unsigned int  count 
) const
private

Definition at line 640 of file TrackletConfigBuilder.cc.

References submitPVResolutionJobs::count, iRegStr(), iseed, LayerName(), and numStr().

Referenced by writeSPDMemories().

645  {
646  return "TRE_" + LayerName(l1) + iRegStr(ireg1, iseed) + LayerName(l2) + iRegStr(ireg2, iseed) + "_" + numStr(count);
647 }
static std::string numStr(unsigned int i)
static std::string LayerName(unsigned int ilayer)
std::string iRegStr(unsigned int iReg, unsigned int iSeed) const
int iseed
Definition: AMPTWrapper.h:134

◆ validTEPair()

bool TrackletConfigBuilder::validTEPair ( unsigned int  iseed,
unsigned int  iTE1,
unsigned int  iTE2 
)
private

Definition at line 265 of file TrackletConfigBuilder.cc.

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, iseed, rinv(), rinvmax_, seedRadii(), and VMStubsTE_.

Referenced by buildTE().

265  {
266  double rinvmin = 999.9;
267  double rinvmax = -999.9;
268 
269  double phi1[2] = {VMStubsTE_[iseed].first[iTE1].first, VMStubsTE_[iseed].first[iTE1].second};
270  double phi2[2] = {VMStubsTE_[iseed].second[iTE2].first, VMStubsTE_[iseed].second[iTE2].second};
271 
272  std::pair<double, double> seedradii = seedRadii(iseed);
273 
274  for (unsigned int i1 = 0; i1 < 2; i1++) {
275  for (unsigned int i2 = 0; i2 < 2; i2++) {
276  double arinv = rinv(seedradii.first, phi1[i1], seedradii.second, phi2[i2]);
277  if (arinv < rinvmin)
278  rinvmin = arinv;
279  if (arinv > rinvmax)
280  rinvmax = arinv;
281  }
282  }
283 
284  if (rinvmin > rinvmax_)
285  return false;
286  if (rinvmax < -rinvmax_)
287  return false;
288 
289  return true;
290 }
std::pair< std::vector< std::pair< double, double > >, std::vector< std::pair< double, double > > > VMStubsTE_[N_SEED_PROMPT]
double rinv(double r1, double phi1, double r2, double phi2)
int iseed
Definition: AMPTWrapper.h:134
std::pair< double, double > seedRadii(unsigned int iseed)

◆ writeAll()

void TrackletConfigBuilder::writeAll ( std::ostream &  wires,
std::ostream &  memories,
std::ostream &  modules 
)

Definition at line 1481 of file TrackletConfigBuilder.cc.

References DigiDM_cff::wires, writeAPMemories(), writeASMemories(), writeCMMemories(), writeCTMemories(), writeFMMemories(), writeILMemories(), writeProjectionMemories(), writeSPDMemories(), writeSPMemories(), writeTFMemories(), writeTPARMemories(), writeVMPROJMemories(), and writeVMSMemories().

1481  {
1482  writeILMemories(wires, memories, modules);
1483  writeASMemories(wires, memories, modules);
1484  writeVMSMemories(wires, memories, modules);
1485  writeSPMemories(wires, memories, modules);
1486  writeSPDMemories(wires, memories, modules);
1488  writeTPARMemories(wires, memories, modules);
1489  writeVMPROJMemories(wires, memories, modules);
1490  writeAPMemories(wires, memories, modules);
1491  writeCMMemories(wires, memories, modules);
1492  writeFMMemories(wires, memories, modules);
1493  writeTFMemories(wires, memories, modules);
1494  writeCTMemories(wires, memories, modules);
1495 }
void writeProjectionMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
void writeASMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
void writeILMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
void writeFMMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
void writeTPARMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
void writeSPMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
void writeCMMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
void writeVMPROJMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
void writeTFMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
void writeCTMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
void writeAPMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
void writeSPDMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
void writeVMSMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)

◆ writeAPMemories()

void TrackletConfigBuilder::writeAPMemories ( std::ostream &  os,
std::ostream &  memories,
std::ostream &  modules 
)
private

Definition at line 835 of file TrackletConfigBuilder.cc.

References combinedmodules_, iTCStr(), LayerName(), trklet::N_DISK, trklet::N_LAYER, NRegions_, and l1tGTMenu_BTagSeeds_cff::os.

Referenced by writeAll().

835  {
836  // The AllProjection memories (e.g. AP_L2PHIA) contain the intercept point of the projection to
837  // a layer. Each is written by one PR module of similar name (e.g. PR_L2PHIA), and read by
838  // a MC (e.g. MC_L2PHIA).
839 
840  if (combinedmodules_)
841  return;
842 
843  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
844  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
845  memories << "AllProj: AP_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << " [56]" << std::endl;
846  modules << "ProjectionRouter: PR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
847 
848  os << "AP_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << " input=> PR_" << LayerName(ilayer) << "PHI"
849  << iTCStr(iReg) << ".allprojout output=> MC_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allprojin"
850  << std::endl;
851  }
852  }
853 }
constexpr int N_DISK
Definition: Settings.h:26
static std::string LayerName(unsigned int ilayer)
std::string iTCStr(unsigned int iTC) const
unsigned int NRegions_[N_LAYER+N_DISK]
constexpr int N_LAYER
Definition: Settings.h:25

◆ writeASMemories()

void TrackletConfigBuilder::writeASMemories ( std::ostream &  os,
std::ostream &  memories,
std::ostream &  modules 
)
private

Definition at line 978 of file TrackletConfigBuilder.cc.

References cms::cuda::assert(), combinedmodules_, duplicateMPs_, dqmdumpme::first, SurfaceOrientation::inner, createfilelist::int, iSeedStr(), iTCStr(), LayerName(), trklet::Settings::layersDisksDuplicatedEqualProjBalance(), trklet::Settings::layersDisksDuplicatedWeightedProjBalance(), WZElectronSkims53X_cff::max, SiStripPI::min, trklet::N_DISK, trklet::N_LAYER, trklet::N_SEED_PROMPT, NRegions_, NVMTE_, l1tGTMenu_BTagSeeds_cff::os, edm::second(), seedLayers(), settings_, TC_, and TE_.

Referenced by writeAll().

978  {
979  // Each VMR writes AllStub memories (AS) for a single phi region (e.g. PHIC),
980  // merging data from all DTCs related to this phi region. It does so by merging data from
981  // the IL memories written by all IRs for this phi region. The wiring map lists all
982  // IL memories that feed (">") into a single VMR ("VMR_L1PHIC") that writes to the
983  // an AS memory ("AS_L1PHIC").
984  // Multiple copies of each AS memory exist where several modules in chain want to read it.
985 
986  if (combinedmodules_) {
987  //First write AS memories used by MatchProcessor
988  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
989  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
990  if (duplicateMPs_) {
993  (iReg == 1 || iReg == 2)) {
994  memories << "AllStubs: AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
995  << " [42]" << std::endl;
996  memories << "AllStubs: AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n2"
997  << " [42]" << std::endl;
998  if (combinedmodules_) {
999  modules << "VMRouterCM: VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
1000  } else {
1001  modules << "VMRouter: VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
1002  }
1003  os << "AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
1004  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allstubout output=> MP_"
1005  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allstubin" << std::endl;
1006  os << "AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n2"
1007  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allstubout output=> MP_"
1008  << LayerName(ilayer) << "PHI" << iTCStr(iReg) + "_E"
1009  << ".allstubin" << std::endl;
1010  } else {
1011  memories << "AllStubs: AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
1012  << " [42]" << std::endl;
1013  if (combinedmodules_) {
1014  modules << "VMRouterCM: VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
1015  } else {
1016  modules << "VMRouter: VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
1017  }
1018  os << "AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
1019  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allstubout output=> MP_"
1020  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allstubin" << std::endl;
1021  }
1022  } else { // non duplicate MPs configuration
1023  memories << "AllStubs: AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
1024  << " [42]" << std::endl;
1025  if (combinedmodules_) {
1026  modules << "VMRouterCM: VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
1027  } else {
1028  modules << "VMRouter: VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
1029  }
1030  os << "AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
1031  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allstubout output=> MP_"
1032  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allstubin" << std::endl;
1033  }
1034  }
1035  }
1036 
1037  //Next write AS memories used by TrackletProcessor
1038  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
1039  for (int iReg = 0; iReg < (int)NRegions_[ilayer]; iReg++) {
1040  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
1041  unsigned int l1 = seedLayers(iSeed).first;
1042  unsigned int l2 = seedLayers(iSeed).second;
1043 
1044  if (ilayer != l1 && ilayer != l2)
1045  continue;
1046 
1047  bool inner = ilayer == l1;
1048 
1049  for (unsigned int iTC = 0; iTC < TC_[iSeed].size(); iTC++) {
1050  int nTCReg = TC_[iSeed].size() / NRegions_[l2];
1051 
1052  int iTCReg = iTC / nTCReg;
1053 
1054  int jTCReg = iTC % nTCReg;
1055 
1056  if (ilayer == l2) {
1057  if (iTCReg != iReg)
1058  continue;
1059  }
1060 
1061  string ext = "";
1062 
1063  if (ilayer == l1) {
1064  int ratio = NRegions_[l1] / NRegions_[l2];
1065  int min = iTCReg * ratio - 1 + jTCReg;
1066  int max = (iTCReg + 1) * ratio - (nTCReg - jTCReg - 1);
1067  if ((int)iReg < min || (int)iReg > max)
1068  continue;
1069 
1070  if (max - min >= 2) {
1071  ext = "M";
1072  if (iReg == min)
1073  ext = "R";
1074  if (iReg == max)
1075  ext = "L";
1076  }
1077 
1078  if (max - min == 1) {
1079  if (nTCReg == 2) {
1080  assert(0);
1081  if (jTCReg == 0) {
1082  if (iReg == min)
1083  ext = "R";
1084  if (iReg == max)
1085  ext = "B";
1086  }
1087  if (jTCReg == 1) {
1088  if (iReg == min)
1089  ext = "A";
1090  if (iReg == max)
1091  ext = "L";
1092  }
1093  }
1094  if (nTCReg == 3) {
1095  if (jTCReg == 0) {
1096  if (iReg == min)
1097  ext = "A";
1098  if (iReg == max)
1099  ext = "F";
1100  }
1101  if (jTCReg == 1) {
1102  if (iReg == min)
1103  ext = "E";
1104  if (iReg == max)
1105  ext = "D";
1106  }
1107  if (jTCReg == 2) {
1108  if (iReg == min)
1109  ext = "C";
1110  if (iReg == max)
1111  ext = "B";
1112  }
1113  }
1114  }
1115  assert(!ext.empty());
1116  }
1117 
1118  if (ext.empty()) {
1119  ext = "_" + LayerName(l1) + iTCStr(iTC);
1120  }
1121 
1122  if (iSeed < 4) { //Barrel seeding
1123  ext = "_B" + ext;
1124  } else if (iSeed > 5) {
1125  ext = "_O" + ext;
1126  } else {
1127  ext = "_D" + ext;
1128  }
1129 
1130  if (inner) {
1131  memories << "AllInnerStubs: ";
1132  } else {
1133  memories << "AllStubs: ";
1134  }
1135  memories << "AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ext << " [42]" << std::endl;
1136  os << "AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ext << " input=> VMR_" << LayerName(ilayer)
1137  << "PHI" << iTCStr(iReg) << ".all" << (inner ? "inner" : "") << "stubout output=> TP_" << iSeedStr(iSeed)
1138  << iTCStr(iTC);
1139  if (inner) {
1140  os << ".innerallstubin" << std::endl;
1141  } else {
1142  os << ".outerallstubin" << std::endl;
1143  }
1144  }
1145  }
1146  }
1147  }
1148 
1149  } else {
1150  //First write AS memories used by MatchCalculator
1151  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
1152  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
1153  memories << "AllStubs: AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
1154  << " [42]" << std::endl;
1155  if (combinedmodules_) {
1156  modules << "VMRouterCM: VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
1157  } else {
1158  modules << "VMRouter: VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
1159  }
1160  os << "AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
1161  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allstubout output=> MC_"
1162  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allstubin" << std::endl;
1163  }
1164  }
1165 
1166  //Next write AS memories used by TrackletCalculator
1167  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
1168  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
1169  unsigned int nmem = 1;
1170 
1171  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
1172  unsigned int l1 = seedLayers(iSeed).first;
1173  unsigned int l2 = seedLayers(iSeed).second;
1174 
1175  if (ilayer != l1 && ilayer != l2)
1176  continue;
1177 
1178  for (unsigned int iTC = 0; iTC < TC_[iSeed].size(); iTC++) {
1179  bool used = false;
1180  // Each TC processes data from several TEs.
1181  for (unsigned int iTE = 0; iTE < TC_[iSeed][iTC].size(); iTE++) {
1182  unsigned int theTE = TC_[iSeed][iTC][iTE];
1183 
1184  unsigned int TE1 = TE_[iSeed][theTE].first; // VM in inner/outer layer of this TE.
1185  unsigned int TE2 = TE_[iSeed][theTE].second;
1186 
1187  if (l1 == ilayer && iReg == TE1 / NVMTE_[iSeed].first)
1188  used = true;
1189  if (l2 == ilayer && iReg == TE2 / NVMTE_[iSeed].second)
1190  used = true;
1191  }
1192 
1193  if (used) {
1194  nmem++; // Another copy of memory
1195  memories << "AllStubs: AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n" << nmem << " [42]"
1196  << std::endl;
1197  os << "AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n" << nmem << " input=> VMR_"
1198  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allstubout output=> TC_" << iSeedStr(iSeed)
1199  << iTCStr(iTC);
1200  if (ilayer == l1) {
1201  os << ".innerallstubin" << std::endl;
1202  } else {
1203  os << ".outerallstubin" << std::endl;
1204  }
1205  }
1206  }
1207  }
1208  }
1209  }
1210  }
1211 }
constexpr int N_DISK
Definition: Settings.h:26
static std::string LayerName(unsigned int ilayer)
std::vector< std::pair< unsigned int, unsigned int > > TE_[N_SEED_PROMPT]
assert(be >=bs)
U second(std::pair< T, U > const &p)
std::string iSeedStr(unsigned int iSeed) const
std::string iTCStr(unsigned int iTC) const
std::vector< std::vector< unsigned int > > TC_[N_SEED_PROMPT]
unsigned int NRegions_[N_LAYER+N_DISK]
const std::array< bool, N_LAYER+N_DISK > & layersDisksDuplicatedWeightedProjBalance() const
Definition: Settings.h:274
const std::array< bool, N_LAYER+N_DISK > & layersDisksDuplicatedEqualProjBalance() const
Definition: Settings.h:271
std::pair< unsigned int, unsigned int > seedLayers(unsigned int iSeed)
Definition: memstream.h:15
constexpr unsigned int N_SEED_PROMPT
Definition: Settings.h:29
std::pair< unsigned int, unsigned int > NVMTE_[N_SEED_PROMPT]
constexpr int N_LAYER
Definition: Settings.h:25

◆ writeCMMemories()

void TrackletConfigBuilder::writeCMMemories ( std::ostream &  os,
std::ostream &  memories,
std::ostream &  modules 
)
private

Definition at line 855 of file TrackletConfigBuilder.cc.

References combinedmodules_, iTCStr(), LayerName(), trklet::N_DISK, trklet::N_LAYER, NRegions_, NVMME_, and l1tGTMenu_BTagSeeds_cff::os.

Referenced by writeAll().

855  {
856  // The CandidateMatch memory (e.g. CM_L1PHIA1) are each written by ME module of similar name
857  // (e.g. ME_L1PHIA1) and contain indices of matching (tracklet projections,stubs) in the specified
858  // VM region.
859  // All CM memories in a given phi region (e.g. L1PHIA) are read by a MC module (e.g. MC_L1PHIA) that
860  // does more precise matching.
861 
862  if (combinedmodules_)
863  return;
864 
865  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
866  for (unsigned int iME = 0; iME < NVMME_[ilayer] * NRegions_[ilayer]; iME++) {
867  memories << "CandidateMatch: CM_" << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << iME + 1
868  << " [12]" << std::endl;
869  modules << "MatchEngine: ME_" << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << iME + 1
870  << std::endl;
871 
872  os << "CM_" << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << iME + 1 << " input=> ME_"
873  << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << iME + 1 << ".matchout output=> MC_"
874  << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << ".matchin" << std::endl;
875  }
876  }
877 }
constexpr int N_DISK
Definition: Settings.h:26
static std::string LayerName(unsigned int ilayer)
std::string iTCStr(unsigned int iTC) const
unsigned int NVMME_[N_LAYER+N_DISK]
unsigned int NRegions_[N_LAYER+N_DISK]
constexpr int N_LAYER
Definition: Settings.h:25

◆ writeCTMemories()

void TrackletConfigBuilder::writeCTMemories ( std::ostream &  os,
std::ostream &  memories,
std::ostream &  modules 
)
private

Definition at line 1394 of file TrackletConfigBuilder.cc.

References iSeedStr(), trklet::N_SEED_PROMPT, and l1tGTMenu_BTagSeeds_cff::os.

Referenced by writeAll().

1394  {
1395  modules << "PurgeDuplicate: PD" << std::endl;
1396 
1397  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
1398  memories << "CleanTrack: CT_" << iSeedStr(iSeed) << " [126]" << std::endl;
1399  os << "CT_" << iSeedStr(iSeed) << " input=> PD.trackout output=>" << std::endl;
1400  }
1401 }
std::string iSeedStr(unsigned int iSeed) const
constexpr unsigned int N_SEED_PROMPT
Definition: Settings.h:29

◆ writeFMMemories()

void TrackletConfigBuilder::writeFMMemories ( std::ostream &  os,
std::ostream &  memories,
std::ostream &  modules 
)
private

Definition at line 902 of file TrackletConfigBuilder.cc.

References combinedmodules_, duplicateMPs_, iSeedStr(), iTCStr(), LayerName(), trklet::Settings::layersDisksDuplicatedEqualProjBalance(), trklet::Settings::layersDisksDuplicatedWeightedProjBalance(), matchport_, trklet::N_DISK, trklet::N_LAYER, trklet::N_SEED_PROMPT, NRegions_, l1tGTMenu_BTagSeeds_cff::os, and settings_.

Referenced by writeAll().

902  {
903  // All FullMatch (e.g. FM_L2L3_L1PHIA) memories corresponding to a matches between stubs & tracklets
904  // in a given region (e.g. L1PHIA) from all seeding layers, are written by a MC module (e.g. MC_L1PHIA).
905  //
906  // All FullMatch memories corresponding to a given seed pair are read by the TrackBuilder (e.g. FT_L1L2),
907  // which checks if the track has stubs in enough layers.
908 
909  if (combinedmodules_) {
910  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
911  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
912  if (duplicateMPs_) {
915  (iReg == 1 || iReg == 2)) { // regions with worst truncation
916  modules << "MatchProcessor: MP_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
917  modules << "MatchProcessor: MP_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) + "_E" << std::endl;
918  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
919  if (matchport_[iSeed][ilayer] == -1)
920  continue;
921  memories << "FullMatch: FM_" << iSeedStr(iSeed) << "_" << LayerName(ilayer) << "PHI" << iTCStr(iReg)
922  << " [36]" << std::endl;
923  memories << "FullMatch: FM_" << iSeedStr(iSeed) << "_" << LayerName(ilayer) << "PHI"
924  << iTCStr(iReg) + "_E"
925  << " [36]" << std::endl;
926  os << "FM_" << iSeedStr(iSeed) << "_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << " input=> MP_"
927  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".matchout1 output=> FT_" << iSeedStr(iSeed)
928  << ".fullmatch" << matchport_[iSeed][ilayer] << "in" << iReg + 1 << std::endl;
929  os << "FM_" << iSeedStr(iSeed) << "_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) + "_E"
930  << " input=> MP_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) + "_E"
931  << ".matchout1 output=> FT_" << iSeedStr(iSeed) << ".fullmatch" << matchport_[iSeed][ilayer] << "in"
932  << iReg + 1 << std::endl;
933  }
934  } else {
935  modules << "MatchProcessor: MP_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
936  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
937  if (matchport_[iSeed][ilayer] == -1)
938  continue;
939  memories << "FullMatch: FM_" << iSeedStr(iSeed) << "_" << LayerName(ilayer) << "PHI" << iTCStr(iReg)
940  << " [36]" << std::endl;
941  os << "FM_" << iSeedStr(iSeed) << "_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << " input=> MP_"
942  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".matchout1 output=> FT_" << iSeedStr(iSeed)
943  << ".fullmatch" << matchport_[iSeed][ilayer] << "in" << iReg + 1 << std::endl;
944  }
945  }
946  } else { // non-duplicate MPs configuration
947  modules << "MatchProcessor: MP_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
948  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
949  if (matchport_[iSeed][ilayer] == -1)
950  continue;
951  memories << "FullMatch: FM_" << iSeedStr(iSeed) << "_" << LayerName(ilayer) << "PHI" << iTCStr(iReg)
952  << " [36]" << std::endl;
953  os << "FM_" << iSeedStr(iSeed) << "_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << " input=> MP_"
954  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".matchout1 output=> FT_" << iSeedStr(iSeed)
955  << ".fullmatch" << matchport_[iSeed][ilayer] << "in" << iReg + 1 << std::endl;
956  }
957  }
958  }
959  }
960  } else {
961  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
962  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
963  modules << "MatchCalculator: MC_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
964  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
965  if (matchport_[iSeed][ilayer] == -1)
966  continue;
967  memories << "FullMatch: FM_" << iSeedStr(iSeed) << "_" << LayerName(ilayer) << "PHI" << iTCStr(iReg)
968  << " [36]" << std::endl;
969  os << "FM_" << iSeedStr(iSeed) << "_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << " input=> MC_"
970  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".matchout1 output=> FT_" << iSeedStr(iSeed)
971  << ".fullmatch" << matchport_[iSeed][ilayer] << "in" << iReg + 1 << std::endl;
972  }
973  }
974  }
975  }
976 }
constexpr int N_DISK
Definition: Settings.h:26
static std::string LayerName(unsigned int ilayer)
std::string iSeedStr(unsigned int iSeed) const
std::string iTCStr(unsigned int iTC) const
unsigned int NRegions_[N_LAYER+N_DISK]
const std::array< bool, N_LAYER+N_DISK > & layersDisksDuplicatedWeightedProjBalance() const
Definition: Settings.h:274
const std::array< bool, N_LAYER+N_DISK > & layersDisksDuplicatedEqualProjBalance() const
Definition: Settings.h:271
int matchport_[N_SEED_PROMPT][N_LAYER+N_DISK]
constexpr unsigned int N_SEED_PROMPT
Definition: Settings.h:29
constexpr int N_LAYER
Definition: Settings.h:25

◆ writeILMemories()

void TrackletConfigBuilder::writeILMemories ( std::ostream &  os,
std::ostream &  memories,
std::ostream &  modules 
)
private

Definition at line 1403 of file TrackletConfigBuilder.cc.

References allStubs_, dqmdumpme::first, info(), iTCStr(), LayerName(), M_PI, trklet::N_SECTOR, NRegions_, l1tGTMenu_BTagSeeds_cff::os, edm::second(), and vecDTCinfo_.

Referenced by writeAll().

1403  {
1404  // Each Input Router (IR) reads stubs from one DTC (e.g. PS10G_1) & sends them
1405  // to 4-8 InputLink (IL) memories (labelled PHIA-PHIH), each corresponding to a small
1406  // phi region of a nonant, for each tracklet layer (L1-L6 or D1-D5) that the DTC
1407  // reads. The InputLink memories have names such as IL_L1PHIC_PS10G_1 to reflect this.
1408 
1409  string olddtc = "";
1410  for (const DTCinfo& info : vecDTCinfo_) {
1411  string dtcname = info.name;
1412  if (olddtc != dtcname) {
1413  // Write one entry per DTC, with each DTC connected to one IR.
1414  modules << "InputRouter: IR_" << dtcname << "_A" << std::endl;
1415  modules << "InputRouter: IR_" << dtcname << "_B" << std::endl;
1416  memories << "DTCLink: DL_" << dtcname << "_A [36]" << std::endl;
1417  memories << "DTCLink: DL_" << dtcname << "_B [36]" << std::endl;
1418  os << "DL_" << dtcname << "_A"
1419  << " input=> output=> IR_" << dtcname << "_A.stubin" << std::endl;
1420  os << "DL_" << dtcname << "_B"
1421  << " input=> output=> IR_" << dtcname << "_B.stubin" << std::endl;
1422  }
1423  olddtc = dtcname;
1424  }
1425 
1426  for (const DTCinfo& info : vecDTCinfo_) {
1427  string dtcname = info.name;
1428  int layerdisk = info.layer;
1429 
1430  for (unsigned int iReg = 0; iReg < NRegions_[layerdisk]; iReg++) {
1431  //--- Ian Tomalin's proposed bug fix
1432  double phiminDTC_A = info.phimin - M_PI / N_SECTOR; // Phi range of each DTC.
1433  double phimaxDTC_A = info.phimax - M_PI / N_SECTOR;
1434  double phiminDTC_B = info.phimin + M_PI / N_SECTOR; // Phi range of each DTC.
1435  double phimaxDTC_B = info.phimax + M_PI / N_SECTOR;
1436  if (allStubs_[layerdisk][iReg].second > phiminDTC_A && allStubs_[layerdisk][iReg].first < phimaxDTC_A) {
1437  memories << "InputLink: IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_A"
1438  << " [36]" << std::endl;
1439  os << "IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_A"
1440  << " input=> IR_" << dtcname << "_A.stubout output=> VMR_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg)
1441  << ".stubin" << std::endl;
1442  }
1443  if (allStubs_[layerdisk][iReg].second > phiminDTC_B && allStubs_[layerdisk][iReg].first < phimaxDTC_B) {
1444  memories << "InputLink: IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_B"
1445  << " [36]" << std::endl;
1446  os << "IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_B"
1447  << " input=> IR_" << dtcname << "_B.stubout output=> VMR_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg)
1448  << ".stubin" << std::endl;
1449  }
1450  //--- Original (buggy) code
1451  /*
1452  double phiminDTC = info.phimin; // Phi range of each DTC.
1453  double phimaxDTC = info.phimax;
1454 
1455  if (allStubs_[layerdisk][iReg].first > phimaxDTC && allStubs_[layerdisk][iReg].second < phiminDTC)
1456  continue;
1457 
1458  // Phi region range must be entirely contained in this DTC to keep this connection.
1459  if (allStubs_[layerdisk][iReg].second < phimaxDTC) {
1460  memories << "InputLink: IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_A"
1461  << " [36]" << std::endl;
1462  os << "IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_A"
1463  << " input=> IR_" << dtcname << "_A.stubout output=> VMR_" << LayerName(layerdisk) << "PHI"
1464  << iTCStr(iReg) << ".stubin" << std::endl;
1465  }
1466 
1467  if (allStubs_[layerdisk][iReg].first > phiminDTC) {
1468  memories << "InputLink: IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_B"
1469  << " [36]" << std::endl;
1470  os << "IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_B"
1471  << " input=> IR_" << dtcname << "_B.stubout output=> VMR_" << LayerName(layerdisk) << "PHI"
1472  << iTCStr(iReg) << ".stubin" << std::endl;
1473  }
1474 */
1475  }
1476  }
1477 }
static const TGPicture * info(bool iBackgroundIsBlack)
static std::string LayerName(unsigned int ilayer)
U second(std::pair< T, U > const &p)
std::string iTCStr(unsigned int iTC) const
#define M_PI
constexpr unsigned int N_SECTOR
Definition: Settings.h:23
unsigned int NRegions_[N_LAYER+N_DISK]
std::vector< std::pair< double, double > > allStubs_[N_LAYER+N_DISK]

◆ writeProjectionMemories()

void TrackletConfigBuilder::writeProjectionMemories ( std::ostream &  os,
std::ostream &  memories,
std::ostream &  modules 
)
private

Definition at line 509 of file TrackletConfigBuilder.cc.

References combinedmodules_, duplicateMPs_, iTCStr(), LayerName(), trklet::Settings::layersDisksDuplicatedEqualProjBalance(), trklet::Settings::layersDisksDuplicatedWeightedProjBalance(), trklet::N_DISK, trklet::N_LAYER, l1tGTMenu_BTagSeeds_cff::os, PRName(), projections_, settings_, TCName(), and TPROJName().

Referenced by writeAll().

509  {
510  // Each TC (e.g. TC_L1L2D) writes a projection memory (TPROJ) for each layer the seed projects to,
511  // with name indicating the TC and which layer & phi region it projects to (e.g. TPROJ_L1L2D_L3PHIA).
512  //
513  // Each PR (e.g. PR_L3PHIA) reads all TPROJ memories for the given layer & phi region.
514 
515  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
516  for (unsigned int ireg = 0; ireg < projections_[ilayer].size(); ireg++) {
517  for (unsigned int imem = 0; imem < projections_[ilayer][ireg].size(); imem++) {
518  unsigned int iSeed = projections_[ilayer][ireg][imem].first;
519  unsigned int iTC = projections_[ilayer][ireg][imem].second;
520  if (combinedmodules_) {
521  if (duplicateMPs_) {
522  if ((settings_.layersDisksDuplicatedEqualProjBalance()[ilayer]) && (ireg == 1 || ireg == 2)) {
523  memories << "TrackletProjections: " + TPROJName(iSeed, iTC, ilayer, ireg) + " [54]" << std::endl;
524  if (imem < projections_[ilayer][ireg].size() / 2) {
525  os << TPROJName(iSeed, iTC, ilayer, ireg) << " input=> " << TCName(iSeed, iTC) << ".projout"
526  << LayerName(ilayer) << "PHI" << iTCStr(ireg) << " output=> " << PRName(ilayer, ireg) << ".projin"
527  << std::endl;
528  } else {
529  os << TPROJName(iSeed, iTC, ilayer, ireg) << " input=> " << TCName(iSeed, iTC) << ".projout"
530  << LayerName(ilayer) << "PHI" << iTCStr(ireg) << " output=> " << PRName(ilayer, ireg) + "_E"
531  << ".projin" // duplicate MPs denoted by extra _E
532  << std::endl;
533  }
534  } else if ((settings_.layersDisksDuplicatedWeightedProjBalance()[ilayer]) && (ireg == 1 || ireg == 2)) {
535  memories << "TrackletProjections: " + TPROJName(iSeed, iTC, ilayer, ireg) + " [54]" << std::endl;
536  if (imem < 4 ||
537  imem >
538  9) { // FIXME need to replace magic numbers, corresponds to allowing MP1 4 L1L2 TCs, 3 L5L6 TCs, MP2 3 L1L2 3 L3L4 TCs
539  os << TPROJName(iSeed, iTC, ilayer, ireg) << " input=> " << TCName(iSeed, iTC) << ".projout"
540  << LayerName(ilayer) << "PHI" << iTCStr(ireg) << " output=> " << PRName(ilayer, ireg) << ".projin"
541  << std::endl;
542  } else {
543  os << TPROJName(iSeed, iTC, ilayer, ireg) << " input=> " << TCName(iSeed, iTC) << ".projout"
544  << LayerName(ilayer) << "PHI" << iTCStr(ireg) << " output=> " << PRName(ilayer, ireg) + "_E"
545  << ".projin" // duplicate MPs
546  << std::endl;
547  }
548  } else {
549  memories << "TrackletProjections: " + TPROJName(iSeed, iTC, ilayer, ireg) + " [54]" << std::endl;
550  os << TPROJName(iSeed, iTC, ilayer, ireg) << " input=> " << TCName(iSeed, iTC) << ".projout"
551  << LayerName(ilayer) << "PHI" << iTCStr(ireg) << " output=> " << PRName(ilayer, ireg) << ".projin"
552  << std::endl;
553  }
554  } else { // non-duplicate MPs configuration
555  memories << "TrackletProjections: " + TPROJName(iSeed, iTC, ilayer, ireg) + " [54]" << std::endl;
556  os << TPROJName(iSeed, iTC, ilayer, ireg) << " input=> " << TCName(iSeed, iTC) << ".projout"
557  << LayerName(ilayer) << "PHI" << iTCStr(ireg) << " output=> " << PRName(ilayer, ireg) << ".projin"
558  << std::endl;
559  }
560  } else { // non-combined modules
561  memories << "TrackletProjections: " + TPROJName(iSeed, iTC, ilayer, ireg) + " [54]" << std::endl;
562  os << TPROJName(iSeed, iTC, ilayer, ireg) << " input=> " << TCName(iSeed, iTC) << ".projout"
563  << LayerName(ilayer) << "PHI" << iTCStr(ireg) << " output=> " << PRName(ilayer, ireg) << ".projin"
564  << std::endl;
565  }
566  }
567  }
568  }
569 }
size
Write out results.
std::vector< std::vector< std::pair< unsigned int, unsigned int > > > projections_[N_LAYER+N_DISK]
constexpr int N_DISK
Definition: Settings.h:26
static std::string LayerName(unsigned int ilayer)
std::string PRName(unsigned int ilayer, unsigned int ireg) const
std::string iTCStr(unsigned int iTC) const
std::string TCName(unsigned int iSeed, unsigned int iTC) const
const std::array< bool, N_LAYER+N_DISK > & layersDisksDuplicatedWeightedProjBalance() const
Definition: Settings.h:274
const std::array< bool, N_LAYER+N_DISK > & layersDisksDuplicatedEqualProjBalance() const
Definition: Settings.h:271
std::string TPROJName(unsigned int iSeed, unsigned int iTC, unsigned int ilayer, unsigned int ireg) const
constexpr int N_LAYER
Definition: Settings.h:25

◆ writeSPDMemories()

void TrackletConfigBuilder::writeSPDMemories ( std::ostream &  os,
std::ostream &  memories,
std::ostream &  modules 
)
private

Definition at line 696 of file TrackletConfigBuilder.cc.

References cms::cuda::assert(), submitPVResolutionJobs::count, extended_, FTName(), iTCStr(), LayerName(), trklet::N_SEED, trklet::N_SEED_PROMPT, trklet::Settings::nallstubs(), trklet::Settings::nvmte(), trklet::Settings::projdisks(), trklet::Settings::projlayers(), trklet::Settings::seedlayers(), settings_, SPDName(), STName(), TCDName(), TEDName(), TParName(), TPROJName(), TREName(), and DigiDM_cff::wires.

Referenced by writeAll().

696  {
697  // Similar to writeSPMemories, but for displaced (=extended) tracking,
698  // with seeds based on triplets of layers.
699 
700  if (!extended_)
701  return;
702 
703  vector<string> stubTriplets[N_SEED];
704 
705  for (unsigned int iSeed = N_SEED_PROMPT; iSeed < N_SEED; iSeed++) {
706  int layerdisk1 = settings_.seedlayers(0, iSeed);
707  int layerdisk2 = settings_.seedlayers(1, iSeed);
708  int layerdisk3 = settings_.seedlayers(2, iSeed);
709 
710  unsigned int nallstub1 = settings_.nallstubs(layerdisk1);
711  unsigned int nallstub2 = settings_.nallstubs(layerdisk2);
712  unsigned int nallstub3 = settings_.nallstubs(layerdisk3);
713 
714  unsigned int nvm1 = settings_.nvmte(0, iSeed);
715  unsigned int nvm2 = settings_.nvmte(1, iSeed);
716  unsigned int nvm3 = settings_.nvmte(2, iSeed);
717 
718  int count = 0;
719  for (unsigned int ireg1 = 0; ireg1 < nallstub1; ireg1++) {
720  for (unsigned int ireg2 = 0; ireg2 < nallstub2; ireg2++) {
721  for (unsigned int ireg3 = 0; ireg3 < nallstub3; ireg3++) {
722  count++;
723  memories << "StubTriplets: " << STName(layerdisk1, ireg1, layerdisk2, ireg2, layerdisk3, ireg3, iSeed, count)
724  << " [18]" << std::endl;
725  stubTriplets[iSeed].push_back(STName(layerdisk1, ireg1, layerdisk2, ireg2, layerdisk3, ireg3, iSeed, count));
726  }
727  }
728  }
729 
730  for (unsigned int ireg1 = 0; ireg1 < nallstub1; ireg1++) {
731  for (unsigned int ivm1 = 0; ivm1 < nvm1; ivm1++) {
732  for (unsigned int ireg2 = 0; ireg2 < nallstub2; ireg2++) {
733  for (unsigned int ivm2 = 0; ivm2 < nvm2; ivm2++) {
734  int count = 0;
735 
736  modules << "TrackletEngineDisplaced: "
737  << TEDName(layerdisk1, ireg1, ireg1 * nvm1 + ivm1, layerdisk2, ireg2, ireg2 * nvm2 + ivm2, iSeed)
738  << std::endl;
739 
740  for (unsigned int ireg3 = 0; ireg3 < nallstub3; ireg3++) {
741  for (unsigned int ivm3 = 0; ivm3 < nvm3; ivm3++) {
742  count++;
743 
744  memories << "StubPairsDisplaced: "
745  << SPDName(layerdisk1,
746  ireg1,
747  ireg1 * nvm1 + ivm1,
748  layerdisk2,
749  ireg2,
750  ireg2 * nvm2 + ivm2,
751  layerdisk3,
752  ireg3,
753  ireg3 * nvm3 + ivm3,
754  iSeed)
755  << " [12]" << std::endl;
756 
757  modules << "TripletEngine: " << TREName(layerdisk1, ireg1, layerdisk2, ireg2, iSeed, count)
758  << std::endl;
759 
760  wires << SPDName(layerdisk1,
761  ireg1,
762  ireg1 * nvm1 + ivm1,
763  layerdisk2,
764  ireg2,
765  ireg2 * nvm2 + ivm2,
766  layerdisk3,
767  ireg3,
768  ireg3 * nvm3 + ivm3,
769  iSeed)
770  << " input=> "
771  << TEDName(layerdisk1, ireg1, ireg1 * nvm1 + ivm1, layerdisk2, ireg2, ireg2 * nvm2 + ivm2, iSeed)
772  << ".stubpairout output=> " << TREName(layerdisk1, ireg1, layerdisk2, ireg2, iSeed, count)
773  << ".stubpair"
774  << "1"
775  << "in" << std::endl;
776  }
777  }
778  }
779  }
780  }
781  }
782 
783  unsigned int nTC = 10;
784  for (unsigned int itc = 0; itc < nTC; itc++) {
785  for (int iproj = 0; iproj < 4; iproj++) {
786  int ilay = settings_.projlayers(iSeed, iproj);
787  if (ilay > 0) {
788  unsigned int nallstub = settings_.nallstubs(ilay - 1);
789  for (unsigned int ireg = 0; ireg < nallstub; ireg++) {
790  memories << "TrackletProjections: " << TPROJName(layerdisk1, layerdisk2, layerdisk3, itc, ilay - 1, ireg)
791  << " [54]" << std::endl;
792  }
793  }
794 
795  int idisk = settings_.projdisks(iSeed, iproj);
796  if (idisk > 0) {
797  unsigned int nallstub = settings_.nallstubs(idisk + 5);
798  for (unsigned int ireg = 0; ireg < nallstub; ireg++) {
799  memories << "TrackletProjections: " << TPROJName(layerdisk1, layerdisk2, layerdisk3, itc, idisk + 5, ireg)
800  << " [54]" << std::endl;
801 
802  wires << TPROJName(layerdisk1, layerdisk2, layerdisk3, itc, idisk + 5, ireg) << " input=> "
803  << TCDName(layerdisk1, layerdisk2, layerdisk3, itc) << ".projout" << LayerName(idisk + 1) << "PHI"
804  << iTCStr(ireg) << " output=> "
805  << "PR_" << LayerName(idisk + 1) << "PHI" << iTCStr(ireg) << ".projin" << std::endl;
806  }
807  }
808  }
809 
810  memories << "TrackletParameters: " << TParName(layerdisk1, layerdisk2, layerdisk3, itc) << " [56]" << std::endl;
811 
812  modules << "TrackletCalculatorDisplaced: " << TCDName(layerdisk1, layerdisk2, layerdisk3, itc) << std::endl;
813  }
814 
815  unsigned int nST = stubTriplets[iSeed].size();
816  for (unsigned int iST = 0; iST < nST; iST++) {
817  unsigned int iTC = (iST * nTC) / nST;
818  assert(iTC < nTC);
819  string stname = stubTriplets[iSeed][iST];
820  string trename = "TRE_" + stname.substr(3, 6) + "_";
821  unsigned int stlen = stname.size();
822  if (stname[stlen - 2] == '_')
823  trename += stname.substr(stlen - 1, 1);
824  if (stname[stlen - 3] == '_')
825  trename += stname.substr(stlen - 2, 2);
826  wires << stname << " input=> " << trename << ".stubtripout output=> "
827  << TCDName(layerdisk1, layerdisk2, layerdisk3, iTC) << ".stubtriplet" << ((iST * nTC) % nST) << "in"
828  << std::endl;
829  }
830 
831  modules << "FitTrack: " << FTName(layerdisk1, layerdisk2, layerdisk3) << std::endl;
832  }
833 }
unsigned int seedlayers(int inner, int seed) const
Definition: Settings.h:154
constexpr unsigned int N_SEED
Definition: Settings.h:28
static std::string LayerName(unsigned int ilayer)
std::string TREName(unsigned int l1, unsigned int ireg1, unsigned int l2, unsigned int ireg2, unsigned int iseed, unsigned int count) const
assert(be >=bs)
std::string FTName(unsigned int l1, unsigned int l2, unsigned int l3) const
std::string TEDName(unsigned int l1, unsigned int ireg1, unsigned int ivm1, unsigned int l2, unsigned int ireg2, unsigned int ivm2, unsigned int iseed) const
unsigned int projlayers(unsigned int iSeed, unsigned int i) const
Definition: Settings.h:164
std::string iTCStr(unsigned int iTC) const
unsigned int projdisks(unsigned int iSeed, unsigned int i) const
Definition: Settings.h:165
unsigned int nvmte(unsigned int inner, unsigned int iSeed) const
Definition: Settings.h:110
std::string STName(unsigned int l1, unsigned int ireg1, unsigned int l2, unsigned int ireg2, unsigned int l3, unsigned int ireg3, unsigned int iseed, unsigned int count) const
unsigned int nallstubs(unsigned int layerdisk) const
Definition: Settings.h:116
std::string TCDName(unsigned int l1, unsigned int l2, unsigned int l3, unsigned int itc) const
std::string TPROJName(unsigned int iSeed, unsigned int iTC, unsigned int ilayer, unsigned int ireg) const
std::string SPDName(unsigned int l1, unsigned int ireg1, unsigned int ivm1, unsigned int l2, unsigned int ireg2, unsigned int ivm2, unsigned int l3, unsigned int ireg3, unsigned int ivm3, unsigned int iseed) const
std::string TParName(unsigned int l1, unsigned int l2, unsigned int l3, unsigned int itc) const
constexpr unsigned int N_SEED_PROMPT
Definition: Settings.h:29

◆ writeSPMemories()

void TrackletConfigBuilder::writeSPMemories ( std::ostream &  os,
std::ostream &  memories,
std::ostream &  modules 
)
private

Definition at line 661 of file TrackletConfigBuilder.cc.

References combinedmodules_, dqmdumpme::first, trklet::N_SEED_PROMPT, NVMTE_, l1tGTMenu_BTagSeeds_cff::os, edm::second(), seedLayers(), SPName(), TC_, TCName(), TE_, and TEName().

Referenced by writeAll().

661  {
662  // Each TE reads one VM in two seed layers, finds stub pairs & writes to a StubPair ("SP") memory.
663  //
664  // Each TC reads several StubPair (SP) memories, each containing a pair of VMs of two seeding layers.
665  // Several TC are created for each layer pair, and the SP distributed between them.
666  // If TC name is TC_L1L2C, "C" indicates this is the 3rd TC in L1L2.
667 
668  if (combinedmodules_)
669  return;
670 
671  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
672  for (unsigned int iTC = 0; iTC < TC_[iSeed].size(); iTC++) {
673  for (unsigned int iTE = 0; iTE < TC_[iSeed][iTC].size(); iTE++) {
674  unsigned int theTE = TC_[iSeed][iTC][iTE];
675 
676  unsigned int TE1 = TE_[iSeed][theTE].first;
677  unsigned int TE2 = TE_[iSeed][theTE].second;
678 
679  unsigned int l1 = seedLayers(iSeed).first;
680  unsigned int l2 = seedLayers(iSeed).second;
681 
682  memories << "StubPairs: "
683  << SPName(l1, TE1 / NVMTE_[iSeed].first, TE1, l2, TE2 / NVMTE_[iSeed].second, TE2, iSeed) << " [12]"
684  << std::endl;
685  modules << "TrackletEngine: "
686  << TEName(l1, TE1 / NVMTE_[iSeed].first, TE1, l2, TE2 / NVMTE_[iSeed].second, TE2, iSeed) << std::endl;
687 
688  os << SPName(l1, TE1 / NVMTE_[iSeed].first, TE1, l2, TE2 / NVMTE_[iSeed].second, TE2, iSeed) << " input=> "
689  << TEName(l1, TE1 / NVMTE_[iSeed].first, TE1, l2, TE2 / NVMTE_[iSeed].second, TE2, iSeed)
690  << ".stubpairout output=> " << TCName(iSeed, iTC) << ".stubpairin" << std::endl;
691  }
692  }
693  }
694 }
std::vector< std::pair< unsigned int, unsigned int > > TE_[N_SEED_PROMPT]
U second(std::pair< T, U > const &p)
std::string TCName(unsigned int iSeed, unsigned int iTC) const
std::vector< std::vector< unsigned int > > TC_[N_SEED_PROMPT]
std::pair< unsigned int, unsigned int > seedLayers(unsigned int iSeed)
std::string TEName(unsigned int l1, unsigned int ireg1, unsigned int ivm1, unsigned int l2, unsigned int ireg2, unsigned int ivm2, unsigned int iseed) const
constexpr unsigned int N_SEED_PROMPT
Definition: Settings.h:29
std::string SPName(unsigned int l1, unsigned int ireg1, unsigned int ivm1, unsigned int l2, unsigned int ireg2, unsigned int ivm2, unsigned int iseed) const
std::pair< unsigned int, unsigned int > NVMTE_[N_SEED_PROMPT]

◆ writeTFMemories()

void TrackletConfigBuilder::writeTFMemories ( std::ostream &  os,
std::ostream &  memories,
std::ostream &  modules 
)
private

Definition at line 1386 of file TrackletConfigBuilder.cc.

References iSeedStr(), trklet::N_SEED_PROMPT, and l1tGTMenu_BTagSeeds_cff::os.

Referenced by writeAll().

1386  {
1387  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
1388  memories << "TrackFit: TF_" << iSeedStr(iSeed) << " [126]" << std::endl;
1389  modules << "FitTrack: FT_" << iSeedStr(iSeed) << std::endl;
1390  os << "TF_" << iSeedStr(iSeed) << " input=> FT_" << iSeedStr(iSeed) << ".trackout output=> PD.trackin" << std::endl;
1391  }
1392 }
std::string iSeedStr(unsigned int iSeed) const
constexpr unsigned int N_SEED_PROMPT
Definition: Settings.h:29

◆ writeTPARMemories()

void TrackletConfigBuilder::writeTPARMemories ( std::ostream &  os,
std::ostream &  memories,
std::ostream &  modules 
)
private

Definition at line 1361 of file TrackletConfigBuilder.cc.

References combinedmodules_, iSeedStr(), iTCStr(), trklet::N_SEED_PROMPT, l1tGTMenu_BTagSeeds_cff::os, and TC_.

Referenced by writeAll().

1361  {
1362  // Each TC module (e.g. TC_L1L2A) stores helix params in a single TPAR memory of similar name
1363  // (e.g. TPAR_L1L2A). The TPAR is subsequently read by the TrackBuilder (FT).
1364 
1365  if (combinedmodules_) {
1366  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
1367  for (unsigned int iTP = 0; iTP < TC_[iSeed].size(); iTP++) {
1368  memories << "TrackletParameters: TPAR_" << iSeedStr(iSeed) << iTCStr(iTP) << " [56]" << std::endl;
1369  modules << "TrackletProcessor: TP_" << iSeedStr(iSeed) << iTCStr(iTP) << std::endl;
1370  os << "TPAR_" << iSeedStr(iSeed) << iTCStr(iTP) << " input=> TP_" << iSeedStr(iSeed) << iTCStr(iTP)
1371  << ".trackpar output=> FT_" << iSeedStr(iSeed) << ".tparin" << std::endl;
1372  }
1373  }
1374  } else {
1375  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
1376  for (unsigned int iTC = 0; iTC < TC_[iSeed].size(); iTC++) {
1377  memories << "TrackletParameters: TPAR_" << iSeedStr(iSeed) << iTCStr(iTC) << " [56]" << std::endl;
1378  modules << "TrackletCalculator: TC_" << iSeedStr(iSeed) << iTCStr(iTC) << std::endl;
1379  os << "TPAR_" << iSeedStr(iSeed) << iTCStr(iTC) << " input=> TC_" << iSeedStr(iSeed) << iTCStr(iTC)
1380  << ".trackpar output=> FT_" << iSeedStr(iSeed) << ".tparin" << std::endl;
1381  }
1382  }
1383  }
1384 }
std::string iSeedStr(unsigned int iSeed) const
std::string iTCStr(unsigned int iTC) const
std::vector< std::vector< unsigned int > > TC_[N_SEED_PROMPT]
constexpr unsigned int N_SEED_PROMPT
Definition: Settings.h:29

◆ writeVMPROJMemories()

void TrackletConfigBuilder::writeVMPROJMemories ( std::ostream &  os,
std::ostream &  memories,
std::ostream &  modules 
)
private

Definition at line 879 of file TrackletConfigBuilder.cc.

References combinedmodules_, iTCStr(), LayerName(), trklet::N_DISK, trklet::N_LAYER, NRegions_, NVMME_, and l1tGTMenu_BTagSeeds_cff::os.

Referenced by writeAll().

879  {
880  // The VMPROJ memories (e.g. VMPROJ_L2PHIA1) written by a PR module each correspond to projections to
881  // a single VM region in a layer. Each is filled by the PR using all projections (TPROJ) to this VM
882  // from different seeding layers.
883  //
884  // Each VMPROJ memory is read by a ME module, which matches the projection to stubs.
885 
886  if (combinedmodules_)
887  return;
888 
889  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
890  for (unsigned int iME = 0; iME < NVMME_[ilayer] * NRegions_[ilayer]; iME++) {
891  memories << "VMProjections: VMPROJ_" << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << iME + 1
892  << " [13]" << std::endl;
893 
894  os << "VMPROJ_" << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << iME + 1 << " input=> PR_"
895  << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << ".vmprojout"
896  << "PHI" << iTCStr(iME / NVMME_[ilayer]) << iME + 1 << " output=> ME_" << LayerName(ilayer) << "PHI"
897  << iTCStr(iME / NVMME_[ilayer]) << iME + 1 << ".vmprojin" << std::endl;
898  }
899  }
900 }
constexpr int N_DISK
Definition: Settings.h:26
static std::string LayerName(unsigned int ilayer)
std::string iTCStr(unsigned int iTC) const
unsigned int NVMME_[N_LAYER+N_DISK]
unsigned int NRegions_[N_LAYER+N_DISK]
constexpr int N_LAYER
Definition: Settings.h:25

◆ writeVMSMemories()

void TrackletConfigBuilder::writeVMSMemories ( std::ostream &  os,
std::ostream &  memories,
std::ostream &  modules 
)
private

Definition at line 1213 of file TrackletConfigBuilder.cc.

References combinedmodules_, duplicateMPs_, iRegStr(), iTCStr(), trklet::L2D1, LayerName(), trklet::Settings::layersDisksDuplicatedEqualProjBalance(), trklet::Settings::layersDisksDuplicatedWeightedProjBalance(), trklet::N_DISK, trklet::N_LAYER, trklet::N_SEED_PROMPT, NRegions_, NVMME_, NVMTE_, l1tGTMenu_BTagSeeds_cff::os, seedLayers(), settings_, TC_, and TE_.

Referenced by writeAll().

1213  {
1214  // Each VMR writes to Virtual Module memories ("VMS") to be used later by the ME or TE etc.
1215  // Memory VMSTE_L1PHIC9-12 is the memory for small phi region C in L1 for the TE module.
1216  // Numbers 9-12 correspond to the 4 VMs in this phi region.
1217  //
1218  // Each TE reads one VMS memory in each seeding layer.
1219 
1220  if (combinedmodules_) {
1221  //First write VMS memories used by MatchProcessor
1222  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
1223  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
1224  if (duplicateMPs_) {
1227  (iReg == 1 || iReg == 2)) {
1228  memories << "VMStubsME: VMSME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1 [18]" << std::endl;
1229  memories << "VMStubsME: VMSME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n2 [18]" << std::endl;
1230  os << "VMSME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
1231  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".vmstuboutPHI" << iTCStr(iReg)
1232  << " output=> MP_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".vmstubin" << std::endl;
1233  os << "VMSME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n2"
1234  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".vmstuboutPHI" << iTCStr(iReg)
1235  << " output=> MP_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) + "_E"
1236  << ".vmstubin" << std::endl;
1237  } else {
1238  memories << "VMStubsME: VMSME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1 [18]" << std::endl;
1239  os << "VMSME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
1240  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".vmstuboutPHI" << iTCStr(iReg)
1241  << " output=> MP_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".vmstubin" << std::endl;
1242  }
1243  } else { // non duplicate MPs configuration
1244  memories << "VMStubsME: VMSME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1 [18]" << std::endl;
1245  os << "VMSME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
1246  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".vmstuboutPHI" << iTCStr(iReg)
1247  << " output=> MP_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".vmstubin" << std::endl;
1248  }
1249  }
1250  }
1251 
1252  //Next write VMS memories used by TrackletProcessor
1253  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
1254  //FIXME - code could be cleaner
1255  unsigned int l1 = seedLayers(iSeed).first;
1256  unsigned int l2 = seedLayers(iSeed).second;
1257 
1258  unsigned int ilayer = seedLayers(iSeed).second;
1259 
1260  //for(unsigned int iReg=0;iReg<NRegions_[ilayer];iReg++){
1261 
1262  unsigned int nTCReg = TC_[iSeed].size() / NRegions_[l2];
1263 
1264  for (unsigned int iReg = 0; iReg < NRegions_[l2]; iReg++) {
1265  unsigned int nmem = 0;
1266  //Hack since we use same module twice
1267  if (iSeed == Seed::L2D1) {
1268  nmem = 2;
1269  }
1270 
1271  for (unsigned iTC = 0; iTC < nTCReg; iTC++) {
1272  nmem++;
1273  memories << "VMStubsTE: VMSTE_" << LayerName(ilayer) << "PHI" << iRegStr(iReg, iSeed) << "n" << nmem
1274  << " [18]" << std::endl;
1275  os << "VMSTE_" << LayerName(ilayer) << "PHI" << iRegStr(iReg, iSeed) << "n" << nmem << " input=> VMR_"
1276  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".vmstubout_seed_" << iSeed << " output=> TP_"
1277  << LayerName(l1) << LayerName(l2) << iTCStr(iReg * nTCReg + iTC) << ".outervmstubin" << std::endl;
1278  }
1279  }
1280  }
1281 
1282  } else {
1283  //First write VMS memories used by MatchEngine
1284  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
1285  for (unsigned int iVMME = 0; iVMME < NVMME_[ilayer] * NRegions_[ilayer]; iVMME++) {
1286  unsigned int iReg = iVMME / NVMME_[ilayer];
1287  memories << "VMStubsME: VMSME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << iVMME + 1 << "n1 [18]"
1288  << std::endl;
1289  os << "VMSME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << iVMME + 1 << "n1"
1290  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".vmstuboutMEPHI" << iTCStr(iReg)
1291  << iVMME + 1 << " output=> ME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << iVMME + 1 << ".vmstubin"
1292  << std::endl;
1293  }
1294  }
1295 
1296  // Next write VMS memories used by TrackletEngine
1297  // Each TE processes one VM region in inner + outer seeding layers, and needs its own copy of input memories.
1298  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
1299  for (unsigned int innerouterseed = 0; innerouterseed < 2; innerouterseed++) {
1300  //FIXME - code could be cleaner
1301  unsigned int l1 = seedLayers(iSeed).first;
1302  unsigned int l2 = seedLayers(iSeed).second;
1303 
1304  unsigned int NVMTE1 = NVMTE_[iSeed].first;
1305  unsigned int NVMTE2 = NVMTE_[iSeed].second;
1306 
1307  unsigned int ilayer = l1;
1308  unsigned int NVMTE = NVMTE1;
1309  if (innerouterseed == 1) {
1310  ilayer = l2;
1311  NVMTE = NVMTE2;
1312  }
1313 
1314  for (unsigned int iVMTE = 0; iVMTE < NVMTE * NRegions_[ilayer]; iVMTE++) {
1315  unsigned int iReg = iVMTE / NVMTE;
1316 
1317  unsigned int nmem = 0;
1318 
1319  if (iSeed == Seed::L2D1) {
1320  nmem = 4;
1321  }
1322 
1323  for (unsigned int iTE = 0; iTE < TE_[iSeed].size(); iTE++) {
1324  unsigned int TE1 = TE_[iSeed][iTE].first; // VM region in inner/outer layer of this TE
1325  unsigned int TE2 = TE_[iSeed][iTE].second;
1326 
1327  bool used = false;
1328 
1329  if (innerouterseed == 0 && iVMTE == TE1)
1330  used = true;
1331  if (innerouterseed == 1 && iVMTE == TE2)
1332  used = true;
1333 
1334  if (!used)
1335  continue;
1336 
1337  string inorout = "I";
1338  if (innerouterseed == 1)
1339  inorout = "O";
1340 
1341  nmem++; // Add another copy of memory.
1342  memories << "VMStubsTE: VMSTE_" << LayerName(ilayer) << "PHI" << iRegStr(iReg, iSeed) << iVMTE + 1 << "n"
1343  << nmem << " [18]" << std::endl;
1344  os << "VMSTE_" << LayerName(ilayer) << "PHI" << iRegStr(iReg, iSeed) << iVMTE + 1 << "n" << nmem
1345  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".vmstuboutTE" << inorout << "PHI"
1346  << iRegStr(iReg, iSeed) << iVMTE + 1 << " output=> TE_" << LayerName(l1) << "PHI"
1347  << iRegStr(TE1 / NVMTE1, iSeed) << TE1 + 1 << "_" << LayerName(l2) << "PHI"
1348  << iRegStr(TE2 / NVMTE2, iSeed) << TE2 + 1;
1349  if (innerouterseed == 0) {
1350  os << ".innervmstubin" << std::endl;
1351  } else {
1352  os << ".outervmstubin" << std::endl;
1353  }
1354  }
1355  }
1356  }
1357  }
1358  }
1359 }
constexpr int N_DISK
Definition: Settings.h:26
static std::string LayerName(unsigned int ilayer)
std::vector< std::pair< unsigned int, unsigned int > > TE_[N_SEED_PROMPT]
std::string iRegStr(unsigned int iReg, unsigned int iSeed) const
std::string iTCStr(unsigned int iTC) const
std::vector< std::vector< unsigned int > > TC_[N_SEED_PROMPT]
unsigned int NVMME_[N_LAYER+N_DISK]
unsigned int NRegions_[N_LAYER+N_DISK]
const std::array< bool, N_LAYER+N_DISK > & layersDisksDuplicatedWeightedProjBalance() const
Definition: Settings.h:274
const std::array< bool, N_LAYER+N_DISK > & layersDisksDuplicatedEqualProjBalance() const
Definition: Settings.h:271
std::pair< unsigned int, unsigned int > seedLayers(unsigned int iSeed)
constexpr unsigned int N_SEED_PROMPT
Definition: Settings.h:29
std::pair< unsigned int, unsigned int > NVMTE_[N_SEED_PROMPT]
constexpr int N_LAYER
Definition: Settings.h:25

Member Data Documentation

◆ allStubs_

std::vector<std::pair<double, double> > trklet::TrackletConfigBuilder::allStubs_[N_LAYER+N_DISK]
private

Definition at line 255 of file TrackletConfigBuilder.h.

Referenced by buildProjections(), initGeom(), and writeILMemories().

◆ combinedmodules_

bool trklet::TrackletConfigBuilder::combinedmodules_
private

◆ dphisectorHG_

double trklet::TrackletConfigBuilder::dphisectorHG_
private

Definition at line 246 of file TrackletConfigBuilder.h.

Referenced by initGeom(), and TrackletConfigBuilder().

◆ duplicateMPs_

bool trklet::TrackletConfigBuilder::duplicateMPs_
private

◆ extended_

bool trklet::TrackletConfigBuilder::extended_
private

Definition at line 238 of file TrackletConfigBuilder.h.

Referenced by TrackletConfigBuilder(), and writeSPDMemories().

◆ matchport_

int trklet::TrackletConfigBuilder::matchport_[N_SEED_PROMPT][N_LAYER+N_DISK]
private
Initial value:
= {{-1, -1, 1, 2, 3, 4, 4, 3, 2, 1, -1},
{1, -1, -1, 2, 3, -1, 4, 3, 2, 1, -1},
{1, 2, -1, -1, 3, 4, 4, 3, -1, -1, -1},
{1, 2, 3, 4, -1, -1, -1, -1, -1, -1, -1},
{1, 2, -1, -1, -1, -1, -1, -1, 2, 3, 4},
{1, -1, -1, -1, -1, -1, 2, 3, -1, -1, 4},
{-1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4},
{1, -1, -1, -1, -1, -1, -1, 2, 3, 4, -1}}

Definition at line 275 of file TrackletConfigBuilder.h.

Referenced by buildProjections(), and writeFMMemories().

◆ NRegions_

unsigned int trklet::TrackletConfigBuilder::NRegions_[N_LAYER+N_DISK]
private

◆ NSector_

unsigned int trklet::TrackletConfigBuilder::NSector_
private

Definition at line 232 of file TrackletConfigBuilder.h.

Referenced by TrackletConfigBuilder().

◆ NTC_

unsigned int trklet::TrackletConfigBuilder::NTC_[N_SEED_PROMPT]
private

Definition at line 248 of file TrackletConfigBuilder.h.

Referenced by buildTC(), and TrackletConfigBuilder().

◆ NVMME_

unsigned int trklet::TrackletConfigBuilder::NVMME_[N_LAYER+N_DISK]
private

◆ NVMTE_

std::pair<unsigned int, unsigned int> trklet::TrackletConfigBuilder::NVMTE_[N_SEED_PROMPT]
private

◆ projections_

std::vector<std::vector<std::pair<unsigned int, unsigned int> > > trklet::TrackletConfigBuilder::projections_[N_LAYER+N_DISK]
private

Definition at line 271 of file TrackletConfigBuilder.h.

Referenced by buildProjections(), initGeom(), and writeProjectionMemories().

◆ rcrit_

double trklet::TrackletConfigBuilder::rcrit_
private

Definition at line 233 of file TrackletConfigBuilder.h.

Referenced by TrackletConfigBuilder().

◆ rinvmax_

double trklet::TrackletConfigBuilder::rinvmax_
private

Definition at line 240 of file TrackletConfigBuilder.h.

Referenced by phi(), TrackletConfigBuilder(), and validTEPair().

◆ rmaxdisk_

double trklet::TrackletConfigBuilder::rmaxdisk_
private

Definition at line 241 of file TrackletConfigBuilder.h.

Referenced by buildProjections(), and TrackletConfigBuilder().

◆ rmean_

double trklet::TrackletConfigBuilder::rmean_[N_LAYER]
private

Definition at line 243 of file TrackletConfigBuilder.h.

Referenced by buildProjections(), seedRadii(), and TrackletConfigBuilder().

◆ settings_

const Settings& trklet::TrackletConfigBuilder::settings_
private

◆ TC_

std::vector<std::vector<unsigned int> > trklet::TrackletConfigBuilder::TC_[N_SEED_PROMPT]
private

◆ TE_

std::vector<std::pair<unsigned int, unsigned int> > trklet::TrackletConfigBuilder::TE_[N_SEED_PROMPT]
private

◆ vecDTCinfo_

std::list<DTCinfo> trklet::TrackletConfigBuilder::vecDTCinfo_
private

Definition at line 290 of file TrackletConfigBuilder.h.

Referenced by setDTCphirange(), and writeILMemories().

◆ VMStubsME_

std::vector<std::pair<double, double> > trklet::TrackletConfigBuilder::VMStubsME_[N_LAYER+N_DISK]
private

Definition at line 258 of file TrackletConfigBuilder.h.

Referenced by initGeom().

◆ VMStubsTE_

std::pair<std::vector<std::pair<double, double> >, std::vector<std::pair<double, double> > > trklet::TrackletConfigBuilder::VMStubsTE_[N_SEED_PROMPT]
private

Definition at line 262 of file TrackletConfigBuilder.h.

Referenced by buildTE(), initGeom(), seedPhiRange(), and validTEPair().

◆ zlength_

double trklet::TrackletConfigBuilder::zlength_
private

Definition at line 242 of file TrackletConfigBuilder.h.

Referenced by seedRadii(), and TrackletConfigBuilder().

◆ zmean_

double trklet::TrackletConfigBuilder::zmean_[N_DISK]
private

Definition at line 244 of file TrackletConfigBuilder.h.

Referenced by seedRadii(), and TrackletConfigBuilder().