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 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::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  combinedmodules_ = settings.combined();
27 
28  extended_ = settings.extended();
29 
30  rinvmax_ = settings.rinvmax();
31 
32  rmaxdisk_ = settings.rmaxdisk();
33  zlength_ = settings.zlength();
34 
35  for (int i = 0; i < N_LAYER; i++) {
36  rmean_[i] = settings.rmean(i);
37  }
38 
39  for (int i = 0; i < N_DISK; i++) {
40  zmean_[i] = settings.zmean(i);
41  }
42 
43  dphisectorHG_ = settings.dphisectorHG();
44 
45  for (int layerdisk = 0; layerdisk < N_LAYER + N_DISK; layerdisk++) {
46  NRegions_[layerdisk] = settings.nallstubs(layerdisk);
47  NVMME_[layerdisk] = settings.nvmme(layerdisk);
48  }
49 
50  for (unsigned int iseed = 0; iseed < N_SEED_PROMPT; iseed++) {
51  NVMTE_[iseed] = std::pair<unsigned int, unsigned int>(settings.nvmte(0, iseed), settings.nvmte(1, iseed));
52  NTC_[iseed] = settings.NTC(iseed);
53  }
54 
55  initGeom();
56 
57  buildTE();
58 
59  buildTC();
60 
62 
64 
65  if (settings_.writeConfig()) {
66  static std::once_flag runOnce; // Only one thread should call this.
67  std::call_once(runOnce, &TrackletConfigBuilder::writeDTCphirange, this);
68  }
69 }
constexpr int N_DISK
Definition: Settings.h:26
unsigned int NTC(int seed) const
Definition: Settings.h:162
bool combined() const
Definition: Settings.h:270
double dphisectorHG() const
Definition: Settings.h:320
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]
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:327

Member Function Documentation

◆ buildProjections()

void TrackletConfigBuilder::buildProjections ( )
private

Definition at line 363 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().

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

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

Referenced by TrackletConfigBuilder().

309  {
310  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
311  unsigned int nTC = NTC_[iSeed];
312  std::vector<std::pair<unsigned int, unsigned int> >& TEs = TE_[iSeed];
313  std::vector<std::vector<unsigned int> >& TCs = TC_[iSeed];
314 
315  //Very naive method to group TEs in TC
316 
317  double invnTC = nTC * (1.0 / TEs.size());
318 
319  for (unsigned int iTE = 0; iTE < TEs.size(); iTE++) {
320  int iTC = invnTC * iTE;
321  assert(iTC < (int)nTC);
322  if (iTC >= (int)TCs.size()) {
323  std::vector<unsigned int> tmp;
324  tmp.push_back(iTE);
325  TCs.push_back(tmp);
326  } else {
327  TCs[iTC].push_back(iTE);
328  }
329  }
330  }
331 }
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 293 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().

293  {
294  for (unsigned int iseed = 0; iseed < N_SEED_PROMPT; iseed++) {
295  for (unsigned int i1 = 0; i1 < VMStubsTE_[iseed].first.size(); i1++) {
296  for (unsigned int i2 = 0; i2 < VMStubsTE_[iseed].second.size(); i2++) {
297  if (validTEPair(iseed, i1, i2)) {
298  std::pair<unsigned int, unsigned int> tmp(i1, i2);
299  // Contains pairs of indices of all valid VM pairs in seeding layers
300  TE_[iseed].push_back(tmp);
301  }
302  }
303  }
304  }
305 }
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 595 of file TrackletConfigBuilder.cc.

References LayerName().

Referenced by writeSPDMemories().

595  {
596  return "FT_" + LayerName(l1) + LayerName(l2) + LayerName(l3);
597 }
static std::string LayerName(unsigned int ilayer)

◆ initGeom()

void TrackletConfigBuilder::initGeom ( )
private

Definition at line 195 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().

195  {
196  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
197  double dphi = dphisectorHG_ / NRegions_[ilayer];
198  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
199  std::vector<std::pair<unsigned int, unsigned int> > emptyVec;
200  projections_[ilayer].push_back(emptyVec);
201  // FIX: sector doesn't have hourglass shape
202  double phimin = dphi * iReg;
203  double phimax = phimin + dphi;
204  std::pair<double, double> tmp(phimin, phimax);
205  allStubs_[ilayer].push_back(tmp);
206  double dphiVM = dphi / NVMME_[ilayer];
207  for (unsigned int iVM = 0; iVM < NVMME_[ilayer]; iVM++) {
208  double phivmmin = phimin + iVM * dphiVM;
209  double phivmmax = phivmmin + dphiVM;
210  std::pair<double, double> tmp(phivmmin, phivmmax);
211  VMStubsME_[ilayer].push_back(tmp);
212  }
213  }
214  }
215  for (unsigned int iseed = 0; iseed < N_SEED_PROMPT; iseed++) {
216  unsigned int l1 = seedLayers(iseed).first;
217  unsigned int l2 = seedLayers(iseed).second;
218  unsigned int nVM1 = NVMTE_[iseed].first;
219  unsigned int nVM2 = NVMTE_[iseed].second;
220  double dphiVM = dphisectorHG_ / (nVM1 * NRegions_[l1]);
221  for (unsigned int iVM = 0; iVM < nVM1 * NRegions_[l1]; iVM++) {
222  double phivmmin = iVM * dphiVM;
223  double phivmmax = phivmmin + dphiVM;
224  std::pair<double, double> tmp(phivmmin, phivmmax);
225  VMStubsTE_[iseed].first.push_back(tmp);
226  }
227  dphiVM = dphisectorHG_ / (nVM2 * NRegions_[l2]);
228  for (unsigned int iVM = 0; iVM < nVM2 * NRegions_[l2]; iVM++) {
229  double phivmmin = iVM * dphiVM;
230  double phivmmax = phivmmin + dphiVM;
231  std::pair<double, double> tmp(phivmmin, phivmmax);
232  VMStubsTE_[iseed].second.push_back(tmp);
233  }
234  }
235 }
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 462 of file TrackletConfigBuilder.cc.

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

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

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

◆ iSeedStr()

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

Definition at line 440 of file TrackletConfigBuilder.cc.

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

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

440  {
441  static std::string name[8] = {"L1L2", "L2L3", "L3L4", "L5L6", "D1D2", "D3D4", "L1D1", "L2D1"};
442 
443  assert(iSeed < 8);
444  return name[iSeed];
445 }
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 447 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().

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

◆ phi()

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

Definition at line 425 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().

425  {
426  double rhoinv = rinv(r1, phi1, r2, phi2);
427  if (std::abs(rhoinv) > rinvmax_) {
428  rhoinv = rinvmax_ * rhoinv / std::abs(rhoinv);
429  }
430  return phi1 + asin(0.5 * r * rhoinv) - asin(0.5 * r1 * rhoinv);
431 }
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 500 of file TrackletConfigBuilder.cc.

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

Referenced by writeProjectionMemories().

500  {
501  if (combinedmodules_) {
502  return "MP_" + LayerName(ilayer) + "PHI" + iTCStr(ireg);
503  } else {
504  return "PR_" + LayerName(ilayer) + "PHI" + iTCStr(ireg);
505  }
506 }
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 435 of file TrackletConfigBuilder.cc.

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

Referenced by phi(), and validTEPair().

435  {
436  double deltaphi = phi1 - phi2;
437  return 2 * sin(deltaphi) / sqrt(r2 * r2 + r1 * r1 - 2 * r1 * r2 * cos(deltaphi));
438 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T sqrt(T t)
Definition: SSEVec.h:19
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 189 of file TrackletConfigBuilder.cc.

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

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

189  {
190  return std::pair<unsigned int, unsigned int>(settings_.seedlayers(0, iSeed), settings_.seedlayers(1, iSeed));
191 }
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 335 of file TrackletConfigBuilder.cc.

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

Referenced by buildProjections().

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

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

Referenced by seedPhiRange(), and validTEPair().

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

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

Referenced by TrackletConfigBuilder().

167  {
168  // This file previously written by writeDTCphirange().
169  const string fname = "../data/dtcphirange.txt";
170  if (vecDTCinfo_.empty()) { // Only run once per thread.
171  std::ifstream str_dtc;
172  str_dtc.open(fname);
173  assert(str_dtc.good());
174  string line;
175  while (ifstream, getline(line)) {
176  std::istringstream iss(line);
177  DTCinfo info;
178  iss >> info.name >> info.layer >> info.phimin >> info.phimax;
179  vecDTCinfo_.push_back(info);
180  }
181  str_dtc.close();
182  }
183 }
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 541 of file TrackletConfigBuilder.cc.

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

Referenced by writeSPDMemories().

550  {
551  return "SPD_" + LayerName(l1) + "PHI" + iRegStr(ireg1, iseed) + numStr(ivm1) + "_" + LayerName(l2) + "PHI" +
552  iRegStr(ireg2, iseed) + numStr(ivm2) + "_" + LayerName(l3) + "PHI" + iRegStr(ireg3, iseed) + numStr(ivm3);
553 }
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 530 of file TrackletConfigBuilder.cc.

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

Referenced by writeSPMemories().

536  {
537  return "SP_" + LayerName(l1) + "PHI" + iRegStr(ireg1, iseed) + numStr(ivm1) + "_" + LayerName(l2) + "PHI" +
538  iRegStr(ireg2, iseed) + numStr(ivm2);
539 }
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 608 of file TrackletConfigBuilder.cc.

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

Referenced by writeSPDMemories().

615  {
616  return "ST_" + LayerName(l1) + iRegStr(ireg1, iseed) + LayerName(l2) + iRegStr(ireg2, iseed) + "_" + LayerName(l3) +
617  iRegStr(ireg3, iseed) + "_" + numStr(count);
618 }
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 581 of file TrackletConfigBuilder.cc.

References iTCStr(), and LayerName().

Referenced by writeSPDMemories().

581  {
582  return "TCD_" + LayerName(l1) + LayerName(l2) + LayerName(l3) + iTCStr(itc);
583 }
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 481 of file TrackletConfigBuilder.cc.

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

Referenced by writeProjectionMemories(), and writeSPMemories().

481  {
482  if (combinedmodules_) {
483  return "TP_" + iSeedStr(iSeed) + iTCStr(iTC);
484  } else {
485  return "TC_" + iSeedStr(iSeed) + iTCStr(iTC);
486  }
487 }
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 566 of file TrackletConfigBuilder.cc.

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

Referenced by writeSPDMemories().

572  {
573  return "TED_" + LayerName(l1) + "PHI" + iRegStr(ireg1, iseed) + numStr(ivm1) + "_" + LayerName(l2) + "PHI" +
574  iRegStr(ireg2, iseed) + numStr(ivm2);
575 }
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 555 of file TrackletConfigBuilder.cc.

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

Referenced by writeSPMemories().

561  {
562  return "TE_" + LayerName(l1) + "PHI" + iRegStr(ireg1, iseed) + numStr(ivm1) + "_" + LayerName(l2) + "PHI" +
563  iRegStr(ireg2, iseed) + numStr(ivm2);
564 }
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 577 of file TrackletConfigBuilder.cc.

References iTCStr(), and LayerName().

Referenced by writeSPDMemories().

577  {
578  return "TPAR_" + LayerName(l1) + LayerName(l2) + LayerName(l3) + iTCStr(itc);
579 }
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 493 of file TrackletConfigBuilder.cc.

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

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

496  {
497  return "TPROJ_" + iSeedStr(iSeed) + iTCStr(iTC) + "_" + LayerName(ilayer) + "PHI" + iTCStr(ireg);
498 }
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 585 of file TrackletConfigBuilder.cc.

References iTCStr(), and LayerName().

590  {
591  return "TPROJ_" + LayerName(l1) + LayerName(l2) + LayerName(l3) + iTCStr(itc) + "_" + LayerName(projlayer) + "PHI" +
592  iTCStr(projreg);
593 }
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 599 of file TrackletConfigBuilder.cc.

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

Referenced by writeSPDMemories().

604  {
605  return "TRE_" + LayerName(l1) + iRegStr(ireg1, iseed) + LayerName(l2) + iRegStr(ireg2, iseed) + "_" + numStr(count);
606 }
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 264 of file TrackletConfigBuilder.cc.

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

Referenced by buildTE().

264  {
265  double rinvmin = 999.9;
266  double rinvmax = -999.9;
267 
268  double phi1[2] = {VMStubsTE_[iseed].first[iTE1].first, VMStubsTE_[iseed].first[iTE1].second};
269  double phi2[2] = {VMStubsTE_[iseed].second[iTE2].first, VMStubsTE_[iseed].second[iTE2].second};
270 
271  std::pair<double, double> seedradii = seedRadii(iseed);
272 
273  for (unsigned int i1 = 0; i1 < 2; i1++) {
274  for (unsigned int i2 = 0; i2 < 2; i2++) {
275  double arinv = rinv(seedradii.first, phi1[i1], seedradii.second, phi2[i2]);
276  if (arinv < rinvmin)
277  rinvmin = arinv;
278  if (arinv > rinvmax)
279  rinvmax = arinv;
280  }
281  }
282 
283  if (rinvmin > rinvmax_)
284  return false;
285  if (rinvmax < -rinvmax_)
286  return false;
287 
288  return true;
289 }
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 1349 of file TrackletConfigBuilder.cc.

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

1349  {
1350  writeILMemories(wires, memories, modules);
1351  writeASMemories(wires, memories, modules);
1352  writeVMSMemories(wires, memories, modules);
1353  writeSPMemories(wires, memories, modules);
1354  writeSPDMemories(wires, memories, modules);
1356  writeTPARMemories(wires, memories, modules);
1357  writeVMPROJMemories(wires, memories, modules);
1358  writeAPMemories(wires, memories, modules);
1359  writeCMMemories(wires, memories, modules);
1360  writeFMMemories(wires, memories, modules);
1361  writeTFMemories(wires, memories, modules);
1362  writeCTMemories(wires, memories, modules);
1363 }
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 794 of file TrackletConfigBuilder.cc.

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

Referenced by writeAll().

794  {
795  // The AllProjection memories (e.g. AP_L2PHIA) contain the intercept point of the projection to
796  // a layer. Each is written by one PR module of similar name (e.g. PR_L2PHIA), and read by
797  // a MC (e.g. MC_L2PHIA).
798 
799  if (combinedmodules_)
800  return;
801 
802  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
803  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
804  memories << "AllProj: AP_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << " [56]" << std::endl;
805  modules << "ProjectionRouter: PR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
806 
807  os << "AP_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << " input=> PR_" << LayerName(ilayer) << "PHI"
808  << iTCStr(iReg) << ".allprojout output=> MC_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allprojin"
809  << std::endl;
810  }
811  }
812 }
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 901 of file TrackletConfigBuilder.cc.

References cms::cuda::assert(), combinedmodules_, dqmdumpme::first, SurfaceOrientation::inner, createfilelist::int, iSeedStr(), iTCStr(), LayerName(), SiStripPI::max, SiStripPI::min, trklet::N_DISK, trklet::N_LAYER, trklet::N_SEED_PROMPT, NRegions_, NVMTE_, particleFlowDisplacedVertex_cfi::ratio, edm::second(), seedLayers(), TC_, and TE_.

Referenced by writeAll().

901  {
902  // Each VMR writes AllStub memories (AS) for a single phi region (e.g. PHIC),
903  // merging data from all DTCs related to this phi region. It does so by merging data from
904  // the IL memories written by all IRs for this phi region. The wiring map lists all
905  // IL memories that feed (">") into a single VMR ("VMR_L1PHIC") that writes to the
906  // an AS memory ("AS_L1PHIC").
907  // Multiple copies of each AS memory exist where several modules in chain want to read it.
908 
909  if (combinedmodules_) {
910  //First write AS memories used by MatchProcessor
911  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
912  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
913  memories << "AllStubs: AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
914  << " [42]" << std::endl;
915  if (combinedmodules_) {
916  modules << "VMRouterCM: VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
917  } else {
918  modules << "VMRouter: VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
919  }
920  os << "AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
921  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allstubout output=> MP_"
922  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allstubin" << std::endl;
923  }
924  }
925 
926  //Next write AS memories used by TrackletProcessor
927  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
928  for (int iReg = 0; iReg < (int)NRegions_[ilayer]; iReg++) {
929  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
930  unsigned int l1 = seedLayers(iSeed).first;
931  unsigned int l2 = seedLayers(iSeed).second;
932 
933  if (ilayer != l1 && ilayer != l2)
934  continue;
935 
936  bool inner = ilayer == l1;
937 
938  for (unsigned int iTC = 0; iTC < TC_[iSeed].size(); iTC++) {
939  int nTCReg = TC_[iSeed].size() / NRegions_[l2];
940 
941  int iTCReg = iTC / nTCReg;
942 
943  int jTCReg = iTC % nTCReg;
944 
945  if (ilayer == l2) {
946  if (iTCReg != iReg)
947  continue;
948  }
949 
950  string ext = "";
951 
952  if (ilayer == l1) {
953  int ratio = NRegions_[l1] / NRegions_[l2];
954  int min = iTCReg * ratio - 1 + jTCReg;
955  int max = (iTCReg + 1) * ratio - (nTCReg - jTCReg - 1);
956  if ((int)iReg < min || (int)iReg > max)
957  continue;
958 
959  if (max - min >= 2) {
960  ext = "M";
961  if (iReg == min)
962  ext = "R";
963  if (iReg == max)
964  ext = "L";
965  }
966 
967  if (max - min == 1) {
968  if (nTCReg == 2) {
969  assert(0);
970  if (jTCReg == 0) {
971  if (iReg == min)
972  ext = "R";
973  if (iReg == max)
974  ext = "B";
975  }
976  if (jTCReg == 1) {
977  if (iReg == min)
978  ext = "A";
979  if (iReg == max)
980  ext = "L";
981  }
982  }
983  if (nTCReg == 3) {
984  if (jTCReg == 0) {
985  if (iReg == min)
986  ext = "A";
987  if (iReg == max)
988  ext = "F";
989  }
990  if (jTCReg == 1) {
991  if (iReg == min)
992  ext = "E";
993  if (iReg == max)
994  ext = "D";
995  }
996  if (jTCReg == 2) {
997  if (iReg == min)
998  ext = "C";
999  if (iReg == max)
1000  ext = "B";
1001  }
1002  }
1003  }
1004  assert(!ext.empty());
1005  }
1006 
1007  if (ext.empty()) {
1008  ext = "_" + LayerName(l1) + iTCStr(iTC);
1009  }
1010 
1011  if (iSeed < 4) { //Barrel seeding
1012  ext = "_B" + ext;
1013  } else if (iSeed > 5) {
1014  ext = "_O" + ext;
1015  } else {
1016  ext = "_D" + ext;
1017  }
1018 
1019  if (inner) {
1020  memories << "AllInnerStubs: ";
1021  } else {
1022  memories << "AllStubs: ";
1023  }
1024  memories << "AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ext << " [42]" << std::endl;
1025  os << "AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ext << " input=> VMR_" << LayerName(ilayer)
1026  << "PHI" << iTCStr(iReg) << ".all" << (inner ? "inner" : "") << "stubout output=> TP_" << iSeedStr(iSeed)
1027  << iTCStr(iTC);
1028  if (inner) {
1029  os << ".innerallstubin" << std::endl;
1030  } else {
1031  os << ".outerallstubin" << std::endl;
1032  }
1033  }
1034  }
1035  }
1036  }
1037 
1038  } else {
1039  //First write AS memories used by MatchCalculator
1040  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
1041  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
1042  memories << "AllStubs: AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
1043  << " [42]" << std::endl;
1044  if (combinedmodules_) {
1045  modules << "VMRouterCM: VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
1046  } else {
1047  modules << "VMRouter: VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
1048  }
1049  os << "AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
1050  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allstubout output=> MC_"
1051  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allstubin" << std::endl;
1052  }
1053  }
1054 
1055  //Next write AS memories used by TrackletCalculator
1056  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
1057  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
1058  unsigned int nmem = 1;
1059 
1060  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
1061  unsigned int l1 = seedLayers(iSeed).first;
1062  unsigned int l2 = seedLayers(iSeed).second;
1063 
1064  if (ilayer != l1 && ilayer != l2)
1065  continue;
1066 
1067  for (unsigned int iTC = 0; iTC < TC_[iSeed].size(); iTC++) {
1068  bool used = false;
1069  // Each TC processes data from several TEs.
1070  for (unsigned int iTE = 0; iTE < TC_[iSeed][iTC].size(); iTE++) {
1071  unsigned int theTE = TC_[iSeed][iTC][iTE];
1072 
1073  unsigned int TE1 = TE_[iSeed][theTE].first; // VM in inner/outer layer of this TE.
1074  unsigned int TE2 = TE_[iSeed][theTE].second;
1075 
1076  if (l1 == ilayer && iReg == TE1 / NVMTE_[iSeed].first)
1077  used = true;
1078  if (l2 == ilayer && iReg == TE2 / NVMTE_[iSeed].second)
1079  used = true;
1080  }
1081 
1082  if (used) {
1083  nmem++; // Another copy of memory
1084  memories << "AllStubs: AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n" << nmem << " [42]"
1085  << std::endl;
1086  os << "AS_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n" << nmem << " input=> VMR_"
1087  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".allstubout output=> TC_" << iSeedStr(iSeed)
1088  << iTCStr(iTC);
1089  if (ilayer == l1) {
1090  os << ".innerallstubin" << std::endl;
1091  } else {
1092  os << ".outerallstubin" << std::endl;
1093  }
1094  }
1095  }
1096  }
1097  }
1098  }
1099  }
1100 }
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]
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 814 of file TrackletConfigBuilder.cc.

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

Referenced by writeAll().

814  {
815  // The CandidateMatch memory (e.g. CM_L1PHIA1) are each written by ME module of similar name
816  // (e.g. ME_L1PHIA1) and contain indices of matching (tracklet projections,stubs) in the specified
817  // VM region.
818  // All CM memories in a given phi region (e.g. L1PHIA) are read by a MC module (e.g. MC_L1PHIA) that
819  // does more precise matching.
820 
821  if (combinedmodules_)
822  return;
823 
824  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
825  for (unsigned int iME = 0; iME < NVMME_[ilayer] * NRegions_[ilayer]; iME++) {
826  memories << "CandidateMatch: CM_" << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << iME + 1
827  << " [12]" << std::endl;
828  modules << "MatchEngine: ME_" << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << iME + 1
829  << std::endl;
830 
831  os << "CM_" << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << iME + 1 << " input=> ME_"
832  << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << iME + 1 << ".matchout output=> MC_"
833  << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << ".matchin" << std::endl;
834  }
835  }
836 }
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 1262 of file TrackletConfigBuilder.cc.

References iSeedStr(), and trklet::N_SEED_PROMPT.

Referenced by writeAll().

1262  {
1263  modules << "PurgeDuplicate: PD" << std::endl;
1264 
1265  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
1266  memories << "CleanTrack: CT_" << iSeedStr(iSeed) << " [126]" << std::endl;
1267  os << "CT_" << iSeedStr(iSeed) << " input=> PD.trackout output=>" << std::endl;
1268  }
1269 }
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 861 of file TrackletConfigBuilder.cc.

References combinedmodules_, iSeedStr(), iTCStr(), LayerName(), matchport_, trklet::N_DISK, trklet::N_LAYER, trklet::N_SEED_PROMPT, and NRegions_.

Referenced by writeAll().

861  {
862  // All FullMatch (e.g. FM_L2L3_L1PHIA) memories corresponding to a matches between stubs & tracklets
863  // in a given region (e.g. L1PHIA) from all seeding layers, are written by a MC module (e.g. MC_L1PHIA).
864  //
865  // All FullMatch memories corresponding to a given seed pair are read by the TrackBuilder (e.g. FT_L1L2),
866  // which checks if the track has stubs in enough layers.
867 
868  if (combinedmodules_) {
869  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
870  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
871  modules << "MatchProcessor: MP_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
872  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
873  if (matchport_[iSeed][ilayer] == -1)
874  continue;
875  memories << "FullMatch: FM_" << iSeedStr(iSeed) << "_" << LayerName(ilayer) << "PHI" << iTCStr(iReg)
876  << " [36]" << std::endl;
877  os << "FM_" << iSeedStr(iSeed) << "_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << " input=> MP_"
878  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".matchout1 output=> FT_" << iSeedStr(iSeed)
879  << ".fullmatch" << matchport_[iSeed][ilayer] << "in" << iReg + 1 << std::endl;
880  }
881  }
882  }
883  } else {
884  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
885  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
886  modules << "MatchCalculator: MC_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << std::endl;
887  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
888  if (matchport_[iSeed][ilayer] == -1)
889  continue;
890  memories << "FullMatch: FM_" << iSeedStr(iSeed) << "_" << LayerName(ilayer) << "PHI" << iTCStr(iReg)
891  << " [36]" << std::endl;
892  os << "FM_" << iSeedStr(iSeed) << "_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << " input=> MC_"
893  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".matchout1 output=> FT_" << iSeedStr(iSeed)
894  << ".fullmatch" << matchport_[iSeed][ilayer] << "in" << iReg + 1 << std::endl;
895  }
896  }
897  }
898  }
899 }
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]
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 1271 of file TrackletConfigBuilder.cc.

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

Referenced by writeAll().

1271  {
1272  // Each Input Router (IR) reads stubs from one DTC (e.g. PS10G_1) & sends them
1273  // to 4-8 InputLink (IL) memories (labelled PHIA-PHIH), each corresponding to a small
1274  // phi region of a nonant, for each tracklet layer (L1-L6 or D1-D5) that the DTC
1275  // reads. The InputLink memories have names such as IL_L1PHIC_PS10G_1 to reflect this.
1276 
1277  string olddtc = "";
1278  for (const DTCinfo& info : vecDTCinfo_) {
1279  string dtcname = info.name;
1280  if (olddtc != dtcname) {
1281  // Write one entry per DTC, with each DTC connected to one IR.
1282  modules << "InputRouter: IR_" << dtcname << "_A" << std::endl;
1283  modules << "InputRouter: IR_" << dtcname << "_B" << std::endl;
1284  memories << "DTCLink: DL_" << dtcname << "_A [36]" << std::endl;
1285  memories << "DTCLink: DL_" << dtcname << "_B [36]" << std::endl;
1286  os << "DL_" << dtcname << "_A"
1287  << " input=> output=> IR_" << dtcname << "_A.stubin" << std::endl;
1288  os << "DL_" << dtcname << "_B"
1289  << " input=> output=> IR_" << dtcname << "_B.stubin" << std::endl;
1290  }
1291  olddtc = dtcname;
1292  }
1293 
1294  for (const DTCinfo& info : vecDTCinfo_) {
1295  string dtcname = info.name;
1296  int layerdisk = info.layer;
1297 
1298  for (unsigned int iReg = 0; iReg < NRegions_[layerdisk]; iReg++) {
1299  //--- Ian Tomalin's proposed bug fix
1300  double phiminDTC_A = info.phimin - M_PI / N_SECTOR; // Phi range of each DTC.
1301  double phimaxDTC_A = info.phimax - M_PI / N_SECTOR;
1302  double phiminDTC_B = info.phimin + M_PI / N_SECTOR; // Phi range of each DTC.
1303  double phimaxDTC_B = info.phimax + M_PI / N_SECTOR;
1304  if (allStubs_[layerdisk][iReg].second > phiminDTC_A && allStubs_[layerdisk][iReg].first < phimaxDTC_A) {
1305  memories << "InputLink: IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_A"
1306  << " [36]" << std::endl;
1307  os << "IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_A"
1308  << " input=> IR_" << dtcname << "_A.stubout output=> VMR_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg)
1309  << ".stubin" << std::endl;
1310  }
1311  if (allStubs_[layerdisk][iReg].second > phiminDTC_B && allStubs_[layerdisk][iReg].first < phimaxDTC_B) {
1312  memories << "InputLink: IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_B"
1313  << " [36]" << std::endl;
1314  os << "IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_B"
1315  << " input=> IR_" << dtcname << "_B.stubout output=> VMR_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg)
1316  << ".stubin" << std::endl;
1317  }
1318  //--- Original (buggy) code
1319  /*
1320  double phiminDTC = info.phimin; // Phi range of each DTC.
1321  double phimaxDTC = info.phimax;
1322 
1323  if (allStubs_[layerdisk][iReg].first > phimaxDTC && allStubs_[layerdisk][iReg].second < phiminDTC)
1324  continue;
1325 
1326  // Phi region range must be entirely contained in this DTC to keep this connection.
1327  if (allStubs_[layerdisk][iReg].second < phimaxDTC) {
1328  memories << "InputLink: IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_A"
1329  << " [36]" << std::endl;
1330  os << "IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_A"
1331  << " input=> IR_" << dtcname << "_A.stubout output=> VMR_" << LayerName(layerdisk) << "PHI"
1332  << iTCStr(iReg) << ".stubin" << std::endl;
1333  }
1334 
1335  if (allStubs_[layerdisk][iReg].first > phiminDTC) {
1336  memories << "InputLink: IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_B"
1337  << " [36]" << std::endl;
1338  os << "IL_" << LayerName(layerdisk) << "PHI" << iTCStr(iReg) << "_" << dtcname << "_B"
1339  << " input=> IR_" << dtcname << "_B.stubout output=> VMR_" << LayerName(layerdisk) << "PHI"
1340  << iTCStr(iReg) << ".stubin" << std::endl;
1341  }
1342 */
1343  }
1344  }
1345 }
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 508 of file TrackletConfigBuilder.cc.

References iTCStr(), LayerName(), trklet::N_DISK, trklet::N_LAYER, PRName(), projections_, TCName(), and TPROJName().

Referenced by writeAll().

508  {
509  // Each TC (e.g. TC_L1L2D) writes a projection memory (TPROJ) for each layer the seed projects to,
510  // with name indicating the TC and which layer & phi region it projects to (e.g. TPROJ_L1L2D_L3PHIA).
511  //
512  // Each PR (e.g. PR_L3PHIA) reads all TPROJ memories for the given layer & phi region.
513 
514  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
515  for (unsigned int ireg = 0; ireg < projections_[ilayer].size(); ireg++) {
516  for (unsigned int imem = 0; imem < projections_[ilayer][ireg].size(); imem++) {
517  unsigned int iSeed = projections_[ilayer][ireg][imem].first;
518  unsigned int iTC = projections_[ilayer][ireg][imem].second;
519 
520  memories << "TrackletProjections: " + TPROJName(iSeed, iTC, ilayer, ireg) + " [54]" << std::endl;
521 
522  os << TPROJName(iSeed, iTC, ilayer, ireg) << " input=> " << TCName(iSeed, iTC) << ".projout"
523  << LayerName(ilayer) << "PHI" << iTCStr(ireg) << " output=> " << PRName(ilayer, ireg) << ".projin"
524  << std::endl;
525  }
526  }
527  }
528 }
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
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 655 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().

655  {
656  // Similar to writeSPMemories, but for displaced (=extended) tracking,
657  // with seeds based on triplets of layers.
658 
659  if (!extended_)
660  return;
661 
662  vector<string> stubTriplets[N_SEED];
663 
664  for (unsigned int iSeed = N_SEED_PROMPT; iSeed < N_SEED; iSeed++) {
665  int layerdisk1 = settings_.seedlayers(0, iSeed);
666  int layerdisk2 = settings_.seedlayers(1, iSeed);
667  int layerdisk3 = settings_.seedlayers(2, iSeed);
668 
669  unsigned int nallstub1 = settings_.nallstubs(layerdisk1);
670  unsigned int nallstub2 = settings_.nallstubs(layerdisk2);
671  unsigned int nallstub3 = settings_.nallstubs(layerdisk3);
672 
673  unsigned int nvm1 = settings_.nvmte(0, iSeed);
674  unsigned int nvm2 = settings_.nvmte(1, iSeed);
675  unsigned int nvm3 = settings_.nvmte(2, iSeed);
676 
677  int count = 0;
678  for (unsigned int ireg1 = 0; ireg1 < nallstub1; ireg1++) {
679  for (unsigned int ireg2 = 0; ireg2 < nallstub2; ireg2++) {
680  for (unsigned int ireg3 = 0; ireg3 < nallstub3; ireg3++) {
681  count++;
682  memories << "StubTriplets: " << STName(layerdisk1, ireg1, layerdisk2, ireg2, layerdisk3, ireg3, iSeed, count)
683  << " [18]" << std::endl;
684  stubTriplets[iSeed].push_back(STName(layerdisk1, ireg1, layerdisk2, ireg2, layerdisk3, ireg3, iSeed, count));
685  }
686  }
687  }
688 
689  for (unsigned int ireg1 = 0; ireg1 < nallstub1; ireg1++) {
690  for (unsigned int ivm1 = 0; ivm1 < nvm1; ivm1++) {
691  for (unsigned int ireg2 = 0; ireg2 < nallstub2; ireg2++) {
692  for (unsigned int ivm2 = 0; ivm2 < nvm2; ivm2++) {
693  int count = 0;
694 
695  modules << "TrackletEngineDisplaced: "
696  << TEDName(layerdisk1, ireg1, ireg1 * nvm1 + ivm1, layerdisk2, ireg2, ireg2 * nvm2 + ivm2, iSeed)
697  << std::endl;
698 
699  for (unsigned int ireg3 = 0; ireg3 < nallstub3; ireg3++) {
700  for (unsigned int ivm3 = 0; ivm3 < nvm3; ivm3++) {
701  count++;
702 
703  memories << "StubPairsDisplaced: "
704  << SPDName(layerdisk1,
705  ireg1,
706  ireg1 * nvm1 + ivm1,
707  layerdisk2,
708  ireg2,
709  ireg2 * nvm2 + ivm2,
710  layerdisk3,
711  ireg3,
712  ireg3 * nvm3 + ivm3,
713  iSeed)
714  << " [12]" << std::endl;
715 
716  modules << "TripletEngine: " << TREName(layerdisk1, ireg1, layerdisk2, ireg2, iSeed, count)
717  << std::endl;
718 
719  wires << SPDName(layerdisk1,
720  ireg1,
721  ireg1 * nvm1 + ivm1,
722  layerdisk2,
723  ireg2,
724  ireg2 * nvm2 + ivm2,
725  layerdisk3,
726  ireg3,
727  ireg3 * nvm3 + ivm3,
728  iSeed)
729  << " input=> "
730  << TEDName(layerdisk1, ireg1, ireg1 * nvm1 + ivm1, layerdisk2, ireg2, ireg2 * nvm2 + ivm2, iSeed)
731  << ".stubpairout output=> " << TREName(layerdisk1, ireg1, layerdisk2, ireg2, iSeed, count)
732  << ".stubpair"
733  << "1"
734  << "in" << std::endl;
735  }
736  }
737  }
738  }
739  }
740  }
741 
742  unsigned int nTC = 10;
743  for (unsigned int itc = 0; itc < nTC; itc++) {
744  for (int iproj = 0; iproj < 4; iproj++) {
745  int ilay = settings_.projlayers(iSeed, iproj);
746  if (ilay > 0) {
747  unsigned int nallstub = settings_.nallstubs(ilay - 1);
748  for (unsigned int ireg = 0; ireg < nallstub; ireg++) {
749  memories << "TrackletProjections: " << TPROJName(layerdisk1, layerdisk2, layerdisk3, itc, ilay - 1, ireg)
750  << " [54]" << std::endl;
751  }
752  }
753 
754  int idisk = settings_.projdisks(iSeed, iproj);
755  if (idisk > 0) {
756  unsigned int nallstub = settings_.nallstubs(idisk + 5);
757  for (unsigned int ireg = 0; ireg < nallstub; ireg++) {
758  memories << "TrackletProjections: " << TPROJName(layerdisk1, layerdisk2, layerdisk3, itc, idisk + 5, ireg)
759  << " [54]" << std::endl;
760 
761  wires << TPROJName(layerdisk1, layerdisk2, layerdisk3, itc, idisk + 5, ireg) << " input=> "
762  << TCDName(layerdisk1, layerdisk2, layerdisk3, itc) << ".projout" << LayerName(idisk + 1) << "PHI"
763  << iTCStr(ireg) << " output=> "
764  << "PR_" << LayerName(idisk + 1) << "PHI" << iTCStr(ireg) << ".projin" << std::endl;
765  }
766  }
767  }
768 
769  memories << "TrackletParameters: " << TParName(layerdisk1, layerdisk2, layerdisk3, itc) << " [56]" << std::endl;
770 
771  modules << "TrackletCalculatorDisplaced: " << TCDName(layerdisk1, layerdisk2, layerdisk3, itc) << std::endl;
772  }
773 
774  unsigned int nST = stubTriplets[iSeed].size();
775  for (unsigned int iST = 0; iST < nST; iST++) {
776  unsigned int iTC = (iST * nTC) / nST;
777  assert(iTC < nTC);
778  string stname = stubTriplets[iSeed][iST];
779  string trename = "TRE_" + stname.substr(3, 6) + "_";
780  unsigned int stlen = stname.size();
781  if (stname[stlen - 2] == '_')
782  trename += stname.substr(stlen - 1, 1);
783  if (stname[stlen - 3] == '_')
784  trename += stname.substr(stlen - 2, 2);
785  wires << stname << " input=> " << trename << ".stubtripout output=> "
786  << TCDName(layerdisk1, layerdisk2, layerdisk3, iTC) << ".stubtriplet" << ((iST * nTC) % nST) << "in"
787  << std::endl;
788  }
789 
790  modules << "FitTrack: " << FTName(layerdisk1, layerdisk2, layerdisk3) << std::endl;
791  }
792 }
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 620 of file TrackletConfigBuilder.cc.

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

Referenced by writeAll().

620  {
621  // Each TE reads one VM in two seed layers, finds stub pairs & writes to a StubPair ("SP") memory.
622  //
623  // Each TC reads several StubPair (SP) memories, each containing a pair of VMs of two seeding layers.
624  // Several TC are created for each layer pair, and the SP distributed between them.
625  // If TC name is TC_L1L2C, "C" indicates this is the 3rd TC in L1L2.
626 
627  if (combinedmodules_)
628  return;
629 
630  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
631  for (unsigned int iTC = 0; iTC < TC_[iSeed].size(); iTC++) {
632  for (unsigned int iTE = 0; iTE < TC_[iSeed][iTC].size(); iTE++) {
633  unsigned int theTE = TC_[iSeed][iTC][iTE];
634 
635  unsigned int TE1 = TE_[iSeed][theTE].first;
636  unsigned int TE2 = TE_[iSeed][theTE].second;
637 
638  unsigned int l1 = seedLayers(iSeed).first;
639  unsigned int l2 = seedLayers(iSeed).second;
640 
641  memories << "StubPairs: "
642  << SPName(l1, TE1 / NVMTE_[iSeed].first, TE1, l2, TE2 / NVMTE_[iSeed].second, TE2, iSeed) << " [12]"
643  << std::endl;
644  modules << "TrackletEngine: "
645  << TEName(l1, TE1 / NVMTE_[iSeed].first, TE1, l2, TE2 / NVMTE_[iSeed].second, TE2, iSeed) << std::endl;
646 
647  os << SPName(l1, TE1 / NVMTE_[iSeed].first, TE1, l2, TE2 / NVMTE_[iSeed].second, TE2, iSeed) << " input=> "
648  << TEName(l1, TE1 / NVMTE_[iSeed].first, TE1, l2, TE2 / NVMTE_[iSeed].second, TE2, iSeed)
649  << ".stubpairout output=> " << TCName(iSeed, iTC) << ".stubpairin" << std::endl;
650  }
651  }
652  }
653 }
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 1254 of file TrackletConfigBuilder.cc.

References iSeedStr(), and trklet::N_SEED_PROMPT.

Referenced by writeAll().

1254  {
1255  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
1256  memories << "TrackFit: TF_" << iSeedStr(iSeed) << " [126]" << std::endl;
1257  modules << "FitTrack: FT_" << iSeedStr(iSeed) << std::endl;
1258  os << "TF_" << iSeedStr(iSeed) << " input=> FT_" << iSeedStr(iSeed) << ".trackout output=> PD.trackin" << std::endl;
1259  }
1260 }
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 1229 of file TrackletConfigBuilder.cc.

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

Referenced by writeAll().

1229  {
1230  // Each TC module (e.g. TC_L1L2A) stores helix params in a single TPAR memory of similar name
1231  // (e.g. TPAR_L1L2A). The TPAR is subsequently read by the TrackBuilder (FT).
1232 
1233  if (combinedmodules_) {
1234  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
1235  for (unsigned int iTP = 0; iTP < TC_[iSeed].size(); iTP++) {
1236  memories << "TrackletParameters: TPAR_" << iSeedStr(iSeed) << iTCStr(iTP) << " [56]" << std::endl;
1237  modules << "TrackletProcessor: TP_" << iSeedStr(iSeed) << iTCStr(iTP) << std::endl;
1238  os << "TPAR_" << iSeedStr(iSeed) << iTCStr(iTP) << " input=> TP_" << iSeedStr(iSeed) << iTCStr(iTP)
1239  << ".trackpar output=> FT_" << iSeedStr(iSeed) << ".tparin" << std::endl;
1240  }
1241  }
1242  } else {
1243  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
1244  for (unsigned int iTC = 0; iTC < TC_[iSeed].size(); iTC++) {
1245  memories << "TrackletParameters: TPAR_" << iSeedStr(iSeed) << iTCStr(iTC) << " [56]" << std::endl;
1246  modules << "TrackletCalculator: TC_" << iSeedStr(iSeed) << iTCStr(iTC) << std::endl;
1247  os << "TPAR_" << iSeedStr(iSeed) << iTCStr(iTC) << " input=> TC_" << iSeedStr(iSeed) << iTCStr(iTC)
1248  << ".trackpar output=> FT_" << iSeedStr(iSeed) << ".tparin" << std::endl;
1249  }
1250  }
1251  }
1252 }
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 838 of file TrackletConfigBuilder.cc.

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

Referenced by writeAll().

838  {
839  // The VMPROJ memories (e.g. VMPROJ_L2PHIA1) written by a PR module each correspond to projections to
840  // a single VM region in a layer. Each is filled by the PR using all projections (TPROJ) to this VM
841  // from different seeding layers.
842  //
843  // Each VMPROJ memory is read by a ME module, which matches the projection to stubs.
844 
845  if (combinedmodules_)
846  return;
847 
848  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
849  for (unsigned int iME = 0; iME < NVMME_[ilayer] * NRegions_[ilayer]; iME++) {
850  memories << "VMProjections: VMPROJ_" << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << iME + 1
851  << " [13]" << std::endl;
852 
853  os << "VMPROJ_" << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << iME + 1 << " input=> PR_"
854  << LayerName(ilayer) << "PHI" << iTCStr(iME / NVMME_[ilayer]) << ".vmprojout"
855  << "PHI" << iTCStr(iME / NVMME_[ilayer]) << iME + 1 << " output=> ME_" << LayerName(ilayer) << "PHI"
856  << iTCStr(iME / NVMME_[ilayer]) << iME + 1 << ".vmprojin" << std::endl;
857  }
858  }
859 }
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 1102 of file TrackletConfigBuilder.cc.

References combinedmodules_, iRegStr(), iTCStr(), trklet::L2D1, LayerName(), trklet::N_DISK, trklet::N_LAYER, trklet::N_SEED_PROMPT, NRegions_, NVMME_, NVMTE_, seedLayers(), TC_, and TE_.

Referenced by writeAll().

1102  {
1103  // Each VMR writes to Virtual Module memories ("VMS") to be used later by the ME or TE etc.
1104  // Memory VMSTE_L1PHIC9-12 is the memory for small phi region C in L1 for the TE module.
1105  // Numbers 9-12 correspond to the 4 VMs in this phi region.
1106  //
1107  // Each TE reads one VMS memory in each seeding layer.
1108 
1109  if (combinedmodules_) {
1110  //First write VMS memories used by MatchProcessor
1111  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
1112  for (unsigned int iReg = 0; iReg < NRegions_[ilayer]; iReg++) {
1113  memories << "VMStubsME: VMSME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1 [18]" << std::endl;
1114  os << "VMSME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << "n1"
1115  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".vmstuboutPHI" << iTCStr(iReg)
1116  << " output=> MP_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".vmstubin" << std::endl;
1117  }
1118  }
1119 
1120  //Next write VMS memories used by TrackletProcessor
1121  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
1122  //FIXME - code could be cleaner
1123  unsigned int l1 = seedLayers(iSeed).first;
1124  unsigned int l2 = seedLayers(iSeed).second;
1125 
1126  unsigned int ilayer = seedLayers(iSeed).second;
1127 
1128  //for(unsigned int iReg=0;iReg<NRegions_[ilayer];iReg++){
1129 
1130  unsigned int nTCReg = TC_[iSeed].size() / NRegions_[l2];
1131 
1132  for (unsigned int iReg = 0; iReg < NRegions_[l2]; iReg++) {
1133  unsigned int nmem = 0;
1134  //Hack since we use same module twice
1135  if (iSeed == Seed::L2D1) {
1136  nmem = 2;
1137  }
1138 
1139  for (unsigned iTC = 0; iTC < nTCReg; iTC++) {
1140  nmem++;
1141  memories << "VMStubsTE: VMSTE_" << LayerName(ilayer) << "PHI" << iRegStr(iReg, iSeed) << "n" << nmem
1142  << " [18]" << std::endl;
1143  os << "VMSTE_" << LayerName(ilayer) << "PHI" << iRegStr(iReg, iSeed) << "n" << nmem << " input=> VMR_"
1144  << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".vmstubout_seed_" << iSeed << " output=> TP_"
1145  << LayerName(l1) << LayerName(l2) << iTCStr(iReg * nTCReg + iTC) << ".outervmstubin" << std::endl;
1146  }
1147  }
1148  }
1149 
1150  } else {
1151  //First write VMS memories used by MatchEngine
1152  for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) {
1153  for (unsigned int iVMME = 0; iVMME < NVMME_[ilayer] * NRegions_[ilayer]; iVMME++) {
1154  unsigned int iReg = iVMME / NVMME_[ilayer];
1155  memories << "VMStubsME: VMSME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << iVMME + 1 << "n1 [18]"
1156  << std::endl;
1157  os << "VMSME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << iVMME + 1 << "n1"
1158  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".vmstuboutMEPHI" << iTCStr(iReg)
1159  << iVMME + 1 << " output=> ME_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << iVMME + 1 << ".vmstubin"
1160  << std::endl;
1161  }
1162  }
1163 
1164  // Next write VMS memories used by TrackletEngine
1165  // Each TE processes one VM region in inner + outer seeding layers, and needs its own copy of input memories.
1166  for (unsigned int iSeed = 0; iSeed < N_SEED_PROMPT; iSeed++) {
1167  for (unsigned int innerouterseed = 0; innerouterseed < 2; innerouterseed++) {
1168  //FIXME - code could be cleaner
1169  unsigned int l1 = seedLayers(iSeed).first;
1170  unsigned int l2 = seedLayers(iSeed).second;
1171 
1172  unsigned int NVMTE1 = NVMTE_[iSeed].first;
1173  unsigned int NVMTE2 = NVMTE_[iSeed].second;
1174 
1175  unsigned int ilayer = l1;
1176  unsigned int NVMTE = NVMTE1;
1177  if (innerouterseed == 1) {
1178  ilayer = l2;
1179  NVMTE = NVMTE2;
1180  }
1181 
1182  for (unsigned int iVMTE = 0; iVMTE < NVMTE * NRegions_[ilayer]; iVMTE++) {
1183  unsigned int iReg = iVMTE / NVMTE;
1184 
1185  unsigned int nmem = 0;
1186 
1187  if (iSeed == Seed::L2D1) {
1188  nmem = 4;
1189  }
1190 
1191  for (unsigned int iTE = 0; iTE < TE_[iSeed].size(); iTE++) {
1192  unsigned int TE1 = TE_[iSeed][iTE].first; // VM region in inner/outer layer of this TE
1193  unsigned int TE2 = TE_[iSeed][iTE].second;
1194 
1195  bool used = false;
1196 
1197  if (innerouterseed == 0 && iVMTE == TE1)
1198  used = true;
1199  if (innerouterseed == 1 && iVMTE == TE2)
1200  used = true;
1201 
1202  if (!used)
1203  continue;
1204 
1205  string inorout = "I";
1206  if (innerouterseed == 1)
1207  inorout = "O";
1208 
1209  nmem++; // Add another copy of memory.
1210  memories << "VMStubsTE: VMSTE_" << LayerName(ilayer) << "PHI" << iRegStr(iReg, iSeed) << iVMTE + 1 << "n"
1211  << nmem << " [18]" << std::endl;
1212  os << "VMSTE_" << LayerName(ilayer) << "PHI" << iRegStr(iReg, iSeed) << iVMTE + 1 << "n" << nmem
1213  << " input=> VMR_" << LayerName(ilayer) << "PHI" << iTCStr(iReg) << ".vmstuboutTE" << inorout << "PHI"
1214  << iRegStr(iReg, iSeed) << iVMTE + 1 << " output=> TE_" << LayerName(l1) << "PHI"
1215  << iRegStr(TE1 / NVMTE1, iSeed) << TE1 + 1 << "_" << LayerName(l2) << "PHI"
1216  << iRegStr(TE2 / NVMTE2, iSeed) << TE2 + 1;
1217  if (innerouterseed == 0) {
1218  os << ".innervmstubin" << std::endl;
1219  } else {
1220  os << ".outervmstubin" << std::endl;
1221  }
1222  }
1223  }
1224  }
1225  }
1226  }
1227 }
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]
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 254 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 245 of file TrackletConfigBuilder.h.

Referenced by initGeom(), and TrackletConfigBuilder().

◆ extended_

bool trklet::TrackletConfigBuilder::extended_
private

Definition at line 237 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 274 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 247 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 270 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 239 of file TrackletConfigBuilder.h.

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

◆ rmaxdisk_

double trklet::TrackletConfigBuilder::rmaxdisk_
private

Definition at line 240 of file TrackletConfigBuilder.h.

Referenced by buildProjections(), and TrackletConfigBuilder().

◆ rmean_

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

Definition at line 242 of file TrackletConfigBuilder.h.

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

◆ settings_

const Settings& trklet::TrackletConfigBuilder::settings_
private

Definition at line 292 of file TrackletConfigBuilder.h.

Referenced by seedLayers(), TrackletConfigBuilder(), and writeSPDMemories().

◆ 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 289 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 257 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 261 of file TrackletConfigBuilder.h.

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

◆ zlength_

double trklet::TrackletConfigBuilder::zlength_
private

Definition at line 241 of file TrackletConfigBuilder.h.

Referenced by seedRadii(), and TrackletConfigBuilder().

◆ zmean_

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

Definition at line 243 of file TrackletConfigBuilder.h.

Referenced by seedRadii(), and TrackletConfigBuilder().