16 TrackletConfigBuilder::TrackletConfigBuilder(
const Settings& settings) : settings_(settings) {
39 for (
int layerdisk = 0; layerdisk <
N_LAYER +
N_DISK; layerdisk++) {
63 for (
unsigned int ilayer = 0; ilayer <
N_LAYER +
N_DISK; ilayer++) {
65 for (
unsigned int iReg = 0; iReg <
NRegions_[ilayer]; iReg++) {
66 std::vector<std::pair<unsigned int, unsigned int> > emptyVec;
68 double phimin = dphi * iReg;
72 double dphiVM = dphi /
NVMME_[ilayer];
73 for (
unsigned int iVM = 0; iVM <
NVMME_[ilayer]; iVM++) {
74 double phivmmin =
phimin + iVM * dphiVM;
75 double phivmmax = phivmmin + dphiVM;
76 std::pair<double, double>
tmp(phivmmin, phivmmax);
87 for (
unsigned int iVM = 0; iVM < nVM1 *
NRegions_[l1]; iVM++) {
88 double phivmmin = iVM * dphiVM;
89 double phivmmax = phivmmin + dphiVM;
90 std::pair<double, double>
tmp(phivmmin, phivmmax);
94 for (
unsigned int iVM = 0; iVM < nVM2 *
NRegions_[l2]; iVM++) {
95 double phivmmin = iVM * dphiVM;
96 double phivmmax = phivmmin + dphiVM;
97 std::pair<double, double>
tmp(phivmmin, phivmmax);
106 unsigned int l1 = seedlayers.first;
107 unsigned int l2 = seedlayers.second;
114 }
else if (
iseed < 6) {
123 return std::pair<double, double>(
r1,
r2);
127 double rinvmin = 999.9;
128 double rinvmax = -999.9;
135 for (
unsigned int i1 = 0;
i1 < 2;
i1++) {
136 for (
unsigned int i2 = 0;
i2 < 2;
i2++) {
137 double arinv =
rinv(seedradii.first, phi1[
i1], seedradii.second, phi2[
i2]);
158 std::pair<unsigned int, unsigned int>
tmp(
i1,
i2);
167 for (
unsigned int iSeed = 0; iSeed <
N_SEED_PROMPT; iSeed++) {
168 unsigned int nTC =
NTC_[iSeed];
169 std::vector<std::pair<unsigned int, unsigned int> >& TEs =
TE_[iSeed];
170 std::vector<std::vector<unsigned int> >& TCs =
TC_[iSeed];
174 double invnTC = nTC * (1.0 / TEs.size());
176 for (
unsigned int iTE = 0; iTE < TEs.size(); iTE++) {
177 int iTC = invnTC * iTE;
179 if (iTC >= (
int)TCs.size()) {
180 std::vector<unsigned int>
tmp;
184 TCs[iTC].push_back(iTE);
191 std::vector<std::vector<unsigned int> >& TCs =
TC_[iSeed];
193 std::pair<double, double> seedradii =
seedRadii(iSeed);
197 for (
unsigned int iTE = 0; iTE < TCs[iTC].size(); iTE++) {
198 unsigned int theTE = TCs[iTC][iTE];
199 unsigned int l1TE =
TE_[iSeed][theTE].first;
200 unsigned int l2TE =
TE_[iSeed][theTE].second;
203 for (
unsigned int i1 = 0;
i1 < 2;
i1++) {
204 for (
unsigned int i2 = 0;
i2 < 2;
i2++) {
205 double aphi =
phi(seedradii.first, phi1[
i1], seedradii.second, phi2[
i2], rproj);
218 std::vector<std::vector<unsigned int> >& TCs =
TC_[
iseed];
220 for (
unsigned int ilayer = 0; ilayer <
N_LAYER +
N_DISK; ilayer++) {
223 for (
unsigned int iReg = 0; iReg <
NRegions_[ilayer]; iReg++) {
224 for (
unsigned int iTC = 0; iTC < TCs.size(); iTC++) {
229 if (phiRange.first <
allStubs_[ilayer][iReg].second && phiRange.second >
allStubs_[ilayer][iReg].first) {
230 std::pair<unsigned int, unsigned int>
tmp(
iseed, iTC);
240 double rhoinv =
rinv(
r1, phi1,
r2, phi2);
244 return phi1 + asin(0.5 *
r * rhoinv) - asin(0.5 *
r1 * rhoinv);
248 double deltaphi = phi1 - phi2;
253 static std::string name[8] = {
"L1L2",
"L2L3",
"L3L4",
"L5L6",
"D1D2",
"D3D4",
"L1D1",
"L2D1"};
260 static std::string num[32] = {
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
261 "12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"21",
"22",
262 "23",
"24",
"25",
"26",
"27",
"28",
"29",
"30",
"31",
"32"};
268 static std::string name[12] = {
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L"};
277 static std::string nameOverlap[8] = {
"X",
"Y",
"Z",
"W",
"Q",
"R",
"S",
"T"};
279 static std::string nameL2L3[4] = {
"I",
"J",
"K",
"L"};
283 return nameL2L3[iReg];
287 return nameOverlap[iReg];
302 return ilayer < 6 ? (
"L" +
numStr(ilayer)) : (
"D" +
numStr(ilayer - 6));
321 for (
unsigned int ilayer = 0; ilayer <
N_LAYER +
N_DISK; ilayer++) {
322 for (
unsigned int ireg = 0; ireg <
projections_[ilayer].size(); ireg++) {
323 for (
unsigned int imem = 0; imem <
projections_[ilayer][ireg].size(); imem++) {
324 unsigned int iSeed =
projections_[ilayer][ireg][imem].first;
325 unsigned int iTC =
projections_[ilayer][ireg][imem].second;
327 memories <<
"TrackletProjections: " +
TPROJName(iSeed, iTC, ilayer, ireg) +
" [54]" << std::endl;
329 os <<
TPROJName(iSeed, iTC, ilayer, ireg) <<
" input=> " <<
TCName(iSeed, iTC) <<
".projout" 343 unsigned int iseed) {
357 unsigned int iseed) {
368 unsigned int iseed) {
379 unsigned int iseed) {
393 unsigned int l1,
unsigned int l2,
unsigned int l3,
unsigned int itc,
unsigned int projlayer,
unsigned int projreg) {
403 unsigned int l1,
unsigned int ireg1,
unsigned int l2,
unsigned int ireg2,
unsigned int iseed,
unsigned int count) {
414 unsigned int count) {
427 for (
unsigned int iSeed = 0; iSeed <
N_SEED_PROMPT; iSeed++) {
428 for (
unsigned int iTC = 0; iTC <
TC_[iSeed].size(); iTC++) {
429 for (
unsigned int iTE = 0; iTE <
TC_[iSeed][iTC].size(); iTE++) {
430 unsigned int theTE =
TC_[iSeed][iTC][iTE];
432 unsigned int TE1 =
TE_[iSeed][theTE].first;
433 unsigned int TE2 =
TE_[iSeed][theTE].second;
438 memories <<
"StubPairs: " 446 <<
".stubpairout output=> " <<
TCNAme(iSeed, iTC) <<
".stubpairin" << std::endl;
456 vector<string> stubTriplets[
N_SEED];
472 for (
unsigned int ireg1 = 0; ireg1 < nallstub1; ireg1++) {
473 for (
unsigned int ireg2 = 0; ireg2 < nallstub2; ireg2++) {
474 for (
unsigned int ireg3 = 0; ireg3 < nallstub3; ireg3++) {
476 memories <<
"StubTriplets: " <<
STName(layerdisk1, ireg1, layerdisk2, ireg2, layerdisk3, ireg3, iSeed,
count)
477 <<
" [18]" << std::endl;
478 stubTriplets[iSeed].push_back(
STName(layerdisk1, ireg1, layerdisk2, ireg2, layerdisk3, ireg3, iSeed,
count));
483 for (
unsigned int ireg1 = 0; ireg1 < nallstub1; ireg1++) {
484 for (
unsigned int ivm1 = 0; ivm1 < nvm1; ivm1++) {
485 for (
unsigned int ireg2 = 0; ireg2 < nallstub2; ireg2++) {
486 for (
unsigned int ivm2 = 0; ivm2 < nvm2; ivm2++) {
489 modules <<
"TrackletEngineDisplaced: " 490 <<
TEDName(layerdisk1, ireg1, ireg1 * nvm1 + ivm1, layerdisk2, ireg2, ireg2 * nvm2 + ivm2, iSeed)
493 for (
unsigned int ireg3 = 0; ireg3 < nallstub3; ireg3++) {
494 for (
unsigned int ivm3 = 0; ivm3 < nvm3; ivm3++) {
497 memories <<
"StubPairsDisplaced: " 508 <<
" [12]" << std::endl;
510 modules <<
"TripletEngine: " <<
TREName(layerdisk1, ireg1, layerdisk2, ireg2, iSeed,
count)
524 <<
TEDName(layerdisk1, ireg1, ireg1 * nvm1 + ivm1, layerdisk2, ireg2, ireg2 * nvm2 + ivm2, iSeed)
525 <<
".stubpairout output=> " <<
TREName(layerdisk1, ireg1, layerdisk2, ireg2, iSeed,
count)
528 <<
"in" << std::endl;
536 unsigned int nTC = 10;
537 for (
unsigned int itc = 0; itc < nTC; itc++) {
538 for (
int iproj = 0; iproj < 4; iproj++) {
542 for (
unsigned int ireg = 0; ireg < nallstub; ireg++) {
543 memories <<
"TrackletProjections: " <<
TPROJName(layerdisk1, layerdisk2, layerdisk3, itc, ilay - 1, ireg)
544 <<
" [54]" << std::endl;
551 for (
unsigned int ireg = 0; ireg < nallstub; ireg++) {
552 memories <<
"TrackletProjections: " <<
TPROJName(layerdisk1, layerdisk2, layerdisk3, itc, idisk + 5, ireg)
553 <<
" [54]" << std::endl;
555 wires <<
TPROJName(layerdisk1, layerdisk2, layerdisk3, itc, idisk + 5, ireg) <<
" input=> " 556 <<
TCDName(layerdisk1, layerdisk2, layerdisk3, itc) <<
".projout" <<
LayerName(idisk + 1) <<
"PHI" 557 <<
iTCStr(ireg) <<
" output=> " 558 <<
"PR_" <<
LayerName(idisk + 1) <<
"PHI" <<
iTCStr(ireg) <<
".projin" << std::endl;
563 memories <<
"TrackletParameters: " <<
TParName(layerdisk1, layerdisk2, layerdisk3, itc) <<
" [56]" << std::endl;
565 modules <<
"TrackletCalculatorDisplaced: " <<
TCDName(layerdisk1, layerdisk2, layerdisk3, itc) << std::endl;
568 unsigned int nST = stubTriplets[iSeed].size();
569 for (
unsigned int iST = 0; iST < nST; iST++) {
570 unsigned int iTC = (iST * nTC) / nST;
572 string stname = stubTriplets[iSeed][iST];
573 string trename =
"TRE_" + stname.substr(3, 6) +
"_";
574 unsigned int stlen = stname.size();
575 if (stname[stlen - 2] ==
'_')
576 trename += stname.substr(stlen - 1, 1);
577 if (stname[stlen - 3] ==
'_')
578 trename += stname.substr(stlen - 2, 2);
579 wires << stname <<
" input=> " << trename <<
".stubtripout output=> " 580 <<
TCDName(layerdisk1, layerdisk2, layerdisk3, iTC) <<
".stubtriplet" << ((iST * nTC) % nST) <<
"in" 584 modules <<
"FitTrack: " <<
FTName(layerdisk1, layerdisk2, layerdisk3) << std::endl;
592 for (
unsigned int ilayer = 0; ilayer <
N_LAYER +
N_DISK; ilayer++) {
593 for (
unsigned int iReg = 0; iReg <
NRegions_[ilayer]; iReg++) {
594 memories <<
"AllProj: AP_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
" [56]" << std::endl;
598 <<
iTCStr(iReg) <<
".allprojout output=> MC_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
".allprojin" 608 for (
unsigned int ilayer = 0; ilayer <
N_LAYER +
N_DISK; ilayer++) {
609 for (
unsigned int iME = 0; iME <
NVMME_[ilayer] *
NRegions_[ilayer]; iME++) {
610 memories <<
"CandidateMatch: CM_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iME /
NVMME_[ilayer]) << iME + 1
611 <<
" [12]" << std::endl;
615 os <<
"CM_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iME /
NVMME_[ilayer]) << iME + 1 <<
" input=> ME_" 626 for (
unsigned int ilayer = 0; ilayer <
N_LAYER +
N_DISK; ilayer++) {
627 for (
unsigned int iME = 0; iME <
NVMME_[ilayer] *
NRegions_[ilayer]; iME++) {
628 memories <<
"VMProjections: VMPROJ_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iME /
NVMME_[ilayer]) << iME + 1
629 <<
" [13]" << std::endl;
631 os <<
"VMPROJ_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iME /
NVMME_[ilayer]) << iME + 1 <<
" input=> PR_" 634 <<
iTCStr(iME /
NVMME_[ilayer]) << iME + 1 <<
".vmprojin" << std::endl;
641 for (
unsigned int ilayer = 0; ilayer <
N_LAYER +
N_DISK; ilayer++) {
642 for (
unsigned int iReg = 0; iReg <
NRegions_[ilayer]; iReg++) {
644 for (
unsigned int iSeed = 0; iSeed <
N_SEED_PROMPT; iSeed++) {
648 <<
" [36]" << std::endl;
651 <<
".fullmatch" <<
matchport_[iSeed][ilayer] <<
"in" << iReg + 1 << std::endl;
656 for (
unsigned int ilayer = 0; ilayer <
N_LAYER +
N_DISK; ilayer++) {
657 for (
unsigned int iReg = 0; iReg <
NRegions_[ilayer]; iReg++) {
659 for (
unsigned int iSeed = 0; iSeed <
N_SEED_PROMPT; iSeed++) {
663 <<
" [36]" << std::endl;
666 <<
".fullmatch" <<
matchport_[iSeed][ilayer] <<
"in" << iReg + 1 << std::endl;
676 for (
unsigned int ilayer = 0; ilayer <
N_LAYER +
N_DISK; ilayer++) {
677 for (
unsigned int iReg = 0; iReg <
NRegions_[ilayer]; iReg++) {
678 memories <<
"AllStubs: AS_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
"n1" 679 <<
" [42]" << std::endl;
686 <<
" input=> VMR_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
".allstubout output=> MP_" 687 <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
".allstubin" << std::endl;
692 for (
unsigned int ilayer = 0; ilayer <
N_LAYER +
N_DISK; ilayer++) {
693 for (
int iReg = 0; iReg < (
int)
NRegions_[ilayer]; iReg++) {
694 unsigned int nmem = 1;
696 for (
unsigned int iSeed = 0; iSeed <
N_SEED_PROMPT; iSeed++) {
700 if (ilayer != l1 && ilayer != l2)
703 bool inner = ilayer == l1;
705 for (
unsigned int iTC = 0; iTC <
TC_[iSeed].size(); iTC++) {
708 int iTCReg = iTC / nTCReg;
710 int jTCReg = iTC % nTCReg;
721 int min = iTCReg *
ratio - 1 + jTCReg;
722 int max = (iTCReg + 1) *
ratio - (nTCReg - jTCReg - 1);
723 if ((
int)iReg < min || (int)iReg >
max)
780 }
else if (iSeed > 5) {
788 memories <<
"AllInnerStubs: ";
790 memories <<
"AllStubs: ";
792 memories <<
"AS_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
ext <<
" [42]" << std::endl;
794 <<
"PHI" <<
iTCStr(iReg) <<
".all" << (
inner ?
"inner" :
"") <<
"stubout output=> TP_" <<
iSeedStr(iSeed)
797 os <<
".innerallstubin" << std::endl;
799 os <<
".outerallstubin" << std::endl;
807 for (
unsigned int ilayer = 0; ilayer <
N_LAYER +
N_DISK; ilayer++) {
808 for (
unsigned int iReg = 0; iReg <
NRegions_[ilayer]; iReg++) {
809 memories <<
"AllStubs: AS_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
"n1" 810 <<
" [42]" << std::endl;
817 <<
" input=> VMR_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
".allstubout output=> MC_" 818 <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
".allstubin" << std::endl;
823 for (
unsigned int ilayer = 0; ilayer <
N_LAYER +
N_DISK; ilayer++) {
824 for (
unsigned int iReg = 0; iReg <
NRegions_[ilayer]; iReg++) {
825 unsigned int nmem = 1;
827 for (
unsigned int iSeed = 0; iSeed <
N_SEED_PROMPT; iSeed++) {
831 if (ilayer != l1 && ilayer != l2)
834 for (
unsigned int iTC = 0; iTC <
TC_[iSeed].size(); iTC++) {
836 for (
unsigned int iTE = 0; iTE <
TC_[iSeed][iTC].size(); iTE++) {
837 unsigned int theTE =
TC_[iSeed][iTC][iTE];
839 unsigned int TE1 =
TE_[iSeed][theTE].first;
840 unsigned int TE2 =
TE_[iSeed][theTE].second;
842 if (l1 == ilayer && iReg == TE1 /
NVMTE_[iSeed].
first)
850 memories <<
"AllStubs: AS_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
"n" << nmem <<
" [42]" 852 os <<
"AS_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
"n" << nmem <<
" input=> VMR_" 856 os <<
".innerallstubin" << std::endl;
858 os <<
".outerallstubin" << std::endl;
871 for (
unsigned int ilayer = 0; ilayer <
N_LAYER +
N_DISK; ilayer++) {
872 for (
unsigned int iReg = 0; iReg <
NRegions_[ilayer]; iReg++) {
873 memories <<
"VMStubsME: VMSME_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
"n1 [18]" << std::endl;
876 <<
" output=> MP_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
".vmstubin" << std::endl;
881 for (
unsigned int iSeed = 0; iSeed <
N_SEED_PROMPT; iSeed++) {
886 unsigned int ilayer =
seedLayers(iSeed).second;
890 unsigned int nTCReg =
TC_[iSeed].size() /
NRegions_[l2];
892 for (
unsigned int iReg = 0; iReg <
NRegions_[l2]; iReg++) {
893 unsigned int nmem = 0;
899 for (
unsigned iTC = 0; iTC < nTCReg; iTC++) {
901 memories <<
"VMStubsTE: VMSTE_" <<
LayerName(ilayer) <<
"PHI" <<
iRegStr(iReg, iSeed) <<
"n" << nmem
902 <<
" [18]" << std::endl;
903 os <<
"VMSTE_" <<
LayerName(ilayer) <<
"PHI" <<
iRegStr(iReg, iSeed) <<
"n" << nmem <<
" input=> VMR_" 904 <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
".vmstubout_seed_" << iSeed <<
" output=> TP_" 911 for (
unsigned int ilayer = 0; ilayer <
N_LAYER +
N_DISK; ilayer++) {
912 for (
unsigned int iVMME = 0; iVMME <
NVMME_[ilayer] *
NRegions_[ilayer]; iVMME++) {
913 unsigned int iReg = iVMME /
NVMME_[ilayer];
914 memories <<
"VMStubsME: VMSME_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) << iVMME + 1 <<
"n1 [18]" 916 os <<
"VMSME_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) << iVMME + 1 <<
"n1" 917 <<
" input=> VMR_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
".vmstuboutMEPHI" <<
iTCStr(iReg)
918 << iVMME + 1 <<
" output=> ME_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) << iVMME + 1 <<
".vmstubin" 924 for (
unsigned int iSeed = 0; iSeed <
N_SEED_PROMPT; iSeed++) {
925 for (
unsigned int innerouterseed = 0; innerouterseed < 2; innerouterseed++) {
930 unsigned int NVMTE1 =
NVMTE_[iSeed].first;
931 unsigned int NVMTE2 =
NVMTE_[iSeed].second;
933 unsigned int ilayer =
seedLayers(iSeed).first;
934 unsigned int NVMTE =
NVMTE_[iSeed].first;
935 if (innerouterseed == 1) {
937 NVMTE =
NVMTE_[iSeed].second;
940 for (
unsigned int iVMTE = 0; iVMTE < NVMTE *
NRegions_[ilayer]; iVMTE++) {
941 unsigned int iReg = iVMTE / NVMTE;
943 unsigned int nmem = 0;
949 for (
unsigned int iTE = 0; iTE <
TE_[iSeed].size(); iTE++) {
950 unsigned int TE1 =
TE_[iSeed][iTE].first;
951 unsigned int TE2 =
TE_[iSeed][iTE].second;
955 if (innerouterseed == 0 && iVMTE == TE1)
957 if (innerouterseed == 1 && iVMTE == TE2)
963 string inorout =
"I";
964 if (innerouterseed == 1)
968 memories <<
"VMStubsTE: VMSTE_" <<
LayerName(ilayer) <<
"PHI" <<
iRegStr(iReg, iSeed) << iVMTE + 1 <<
"n" 969 << nmem <<
" [18]" << std::endl;
970 os <<
"VMSTE_" <<
LayerName(ilayer) <<
"PHI" <<
iRegStr(iReg, iSeed) << iVMTE + 1 <<
"n" << nmem
971 <<
" input=> VMR_" <<
LayerName(ilayer) <<
"PHI" <<
iTCStr(iReg) <<
".vmstuboutTE" << inorout <<
"PHI" 972 <<
iRegStr(iReg, iSeed) << iVMTE + 1 <<
" output=> TE_" <<
LayerName(l1) <<
"PHI" 974 <<
iRegStr(TE2 / NVMTE2, iSeed) << TE2 + 1;
975 if (innerouterseed == 0) {
976 os <<
".innervmstubin" << std::endl;
978 os <<
".outervmstubin" << std::endl;
989 for (
unsigned int iSeed = 0; iSeed <
N_SEED_PROMPT; iSeed++) {
990 for (
unsigned int iTP = 0; iTP <
TC_[iSeed].size(); iTP++) {
991 memories <<
"TrackletParameters: TPAR_" <<
iSeedStr(iSeed) <<
iTCStr(iTP) <<
" [56]" << std::endl;
994 <<
".trackpar output=> FT_" <<
iSeedStr(iSeed) <<
".tparin" << std::endl;
998 for (
unsigned int iSeed = 0; iSeed <
N_SEED_PROMPT; iSeed++) {
999 for (
unsigned int iTC = 0; iTC <
TC_[iSeed].size(); iTC++) {
1000 memories <<
"TrackletParameters: TPAR_" <<
iSeedStr(iSeed) <<
iTCStr(iTC) <<
" [56]" << std::endl;
1003 <<
".trackpar output=> FT_" <<
iSeedStr(iSeed) <<
".tparin" << std::endl;
1010 for (
unsigned int iSeed = 0; iSeed <
N_SEED_PROMPT; iSeed++) {
1011 memories <<
"TrackFit: TF_" <<
iSeedStr(iSeed) <<
" [126]" << std::endl;
1013 os <<
"TF_" <<
iSeedStr(iSeed) <<
" input=> FT_" <<
iSeedStr(iSeed) <<
".trackout output=> PD.trackin" << std::endl;
1018 modules <<
"PurgeDuplicate: PD" << std::endl;
1020 for (
unsigned int iSeed = 0; iSeed <
N_SEED_PROMPT; iSeed++) {
1021 memories <<
"CleanTrack: CT_" <<
iSeedStr(iSeed) <<
" [126]" << std::endl;
1022 os <<
"CT_" <<
iSeedStr(iSeed) <<
" input=> PD.trackout output=>" << std::endl;
1029 unsigned int layerdisk[52];
1033 dtcname[0] =
"PS10G_1";
1037 dtcname[1] =
"PS10G_1";
1041 dtcname[2] =
"PS10G_1";
1045 dtcname[3] =
"PS10G_1";
1049 dtcname[4] =
"PS10G_2";
1053 dtcname[5] =
"PS10G_2";
1057 dtcname[6] =
"PS10G_2";
1061 dtcname[7] =
"PS10G_3";
1065 dtcname[8] =
"PS10G_3";
1069 dtcname[9] =
"PS10G_4";
1073 dtcname[10] =
"PS10G_4";
1077 dtcname[11] =
"PS10G_4";
1081 dtcname[12] =
"PS_1";
1085 dtcname[13] =
"PS_1";
1089 dtcname[14] =
"PS_2";
1093 dtcname[15] =
"PS_2";
1097 dtcname[16] =
"2S_1";
1101 dtcname[17] =
"2S_1";
1105 dtcname[18] =
"2S_2";
1109 dtcname[19] =
"2S_3";
1113 dtcname[20] =
"2S_4";
1117 dtcname[21] =
"2S_4";
1121 dtcname[22] =
"2S_5";
1125 dtcname[23] =
"2S_5";
1129 dtcname[24] =
"2S_6";
1133 dtcname[25] =
"2S_6";
1137 dtcname[26] =
"negPS10G_1";
1141 dtcname[27] =
"negPS10G_1";
1145 dtcname[28] =
"negPS10G_1";
1149 dtcname[29] =
"negPS10G_1";
1153 dtcname[30] =
"negPS10G_2";
1157 dtcname[31] =
"negPS10G_2";
1161 dtcname[32] =
"negPS10G_2";
1165 dtcname[33] =
"negPS10G_3";
1169 dtcname[34] =
"negPS10G_3";
1173 dtcname[35] =
"negPS10G_4";
1177 dtcname[36] =
"negPS10G_4";
1181 dtcname[37] =
"negPS10G_4";
1185 dtcname[38] =
"negPS_1";
1189 dtcname[39] =
"negPS_1";
1193 dtcname[40] =
"negPS_2";
1197 dtcname[41] =
"negPS_2";
1201 dtcname[42] =
"neg2S_1";
1205 dtcname[43] =
"neg2S_1";
1209 dtcname[44] =
"neg2S_2";
1213 dtcname[45] =
"neg2S_3";
1217 dtcname[46] =
"neg2S_4";
1221 dtcname[47] =
"neg2S_4";
1225 dtcname[48] =
"neg2S_5";
1229 dtcname[49] =
"neg2S_5";
1233 dtcname[50] =
"neg2S_6";
1237 dtcname[51] =
"neg2S_6";
1245 for (
unsigned int i = 0;
i < 52;
i++) {
1246 if (olddtc != dtcname[
i]) {
1247 modules <<
"InputRouter: IR_" << dtcname[
i] <<
"_A" << std::endl;
1248 modules <<
"InputRouter: IR_" << dtcname[
i] <<
"_B" << std::endl;
1249 memories <<
"DTCLink: DL_" << dtcname[
i] <<
"_A [36]" << std::endl;
1250 memories <<
"DTCLink: DL_" << dtcname[
i] <<
"_B [36]" << std::endl;
1251 os <<
"DL_" << dtcname[
i] <<
"_A" 1252 <<
" input=> output=> IR_" << dtcname[
i] <<
"_A.stubin" << std::endl;
1253 os <<
"DL_" << dtcname[
i] <<
"_B" 1254 <<
" input=> output=> IR_" << dtcname[
i] <<
"_B.stubin" << std::endl;
1256 olddtc = dtcname[
i];
1259 for (
unsigned int i = 0;
i < 52;
i++) {
1260 double phimintmp =
phimin[
i] + dphi;
1261 double phimaxtmp =
phimax[
i] + dphi;
1263 for (
unsigned int iReg = 0; iReg <
NRegions_[layerdisk[
i]]; iReg++) {
1268 memories <<
"InputLink: IL_" <<
LayerName(layerdisk[
i]) <<
"PHI" <<
iTCStr(iReg) <<
"_" << dtcname[
i] <<
"_A" 1269 <<
" [36]" << std::endl;
1270 os <<
"IL_" <<
LayerName(layerdisk[
i]) <<
"PHI" <<
iTCStr(iReg) <<
"_" << dtcname[
i] <<
"_A" 1271 <<
" input=> IR_" << dtcname[
i] <<
"_A.stubout output=> VMR_" <<
LayerName(layerdisk[
i]) <<
"PHI" 1272 <<
iTCStr(iReg) <<
".stubin" << std::endl;
1276 memories <<
"InputLink: IL_" <<
LayerName(layerdisk[
i]) <<
"PHI" <<
iTCStr(iReg) <<
"_" << dtcname[
i] <<
"_B" 1277 <<
" [36]" << std::endl;
1278 os <<
"IL_" <<
LayerName(layerdisk[
i]) <<
"PHI" <<
iTCStr(iReg) <<
"_" << dtcname[
i] <<
"_B" 1279 <<
" input=> IR_" << dtcname[
i] <<
"_B.stubout output=> VMR_" <<
LayerName(layerdisk[
i]) <<
"PHI" 1280 <<
iTCStr(iReg) <<
".stubin" << std::endl;
void writeProjectionMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
std::vector< std::vector< std::pair< unsigned int, unsigned int > > > projections_[N_LAYER+N_DISK]
std::string SPName(unsigned int l1, unsigned int ireg1, unsigned int ivm1, unsigned int l2, unsigned int ireg2, unsigned int ivm2, unsigned int iseed)
std::string iTCStr(unsigned int iTC)
unsigned int NTC(int seed) const
unsigned int seedlayers(int inner, int seed) const
static std::string numStr(unsigned int i)
std::string TParName(unsigned int l1, unsigned int l2, unsigned int l3, unsigned int itc)
constexpr unsigned int N_SEED
std::string TEDName(unsigned int l1, unsigned int ireg1, unsigned int ivm1, unsigned int l2, unsigned int ireg2, unsigned int ivm2, unsigned int iseed)
void writeAll(std::ostream &wires, std::ostream &memories, std::ostream &modules)
double dphisectorHG() const
Sin< T >::type sin(const T &t)
static std::string LayerName(unsigned int ilayer)
void writeASMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
std::string TEName(unsigned int l1, unsigned int ireg1, unsigned int ivm1, unsigned int l2, unsigned int ireg2, unsigned int ivm2, unsigned int iseed)
void writeILMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
void writeFMMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
std::vector< std::pair< double, double > > VMStubsME_[N_LAYER+N_DISK]
std::vector< std::pair< unsigned int, unsigned int > > TE_[N_SEED_PROMPT]
std::string TPROJName(unsigned int iSeed, unsigned int iTC, unsigned int ilayer, unsigned int ireg)
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)
std::string TCName(unsigned int iSeed, unsigned int iTC)
std::string TREName(unsigned int l1, unsigned int ireg1, unsigned int l2, unsigned int ireg2, unsigned int iseed, unsigned int count)
U second(std::pair< T, U > const &p)
unsigned int projlayers(unsigned int iSeed, unsigned int i) const
unsigned int NTC_[N_SEED_PROMPT]
double rmean(unsigned int iLayer) const
void writeTPARMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
std::string PRName(unsigned int ilayer, unsigned int ireg)
Cos< T >::type cos(const T &t)
std::vector< std::vector< unsigned int > > TC_[N_SEED_PROMPT]
Abs< T >::type abs(const T &t)
unsigned int projdisks(unsigned int iSeed, unsigned int i) const
const Settings & settings_
void writeSPMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
double zmean(unsigned int iDisk) const
std::pair< std::vector< std::pair< double, double > >, std::vector< std::pair< double, double > > > VMStubsTE_[N_SEED_PROMPT]
unsigned int nvmte(unsigned int inner, unsigned int iSeed) const
unsigned int nallstubs(unsigned int layerdisk) const
constexpr unsigned int N_SECTOR
unsigned int NVMME_[N_LAYER+N_DISK]
double rinv(double r1, double phi1, double r2, double phi2)
std::pair< double, double > seedRadii(unsigned int iseed)
void writeCMMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
unsigned int NRegions_[N_LAYER+N_DISK]
bool validTEPair(unsigned int iseed, unsigned int iTE1, unsigned int iTE2)
void writeVMPROJMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
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)
void writeTFMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
std::string TCDName(unsigned int l1, unsigned int l2, unsigned int l3, unsigned int itc)
unsigned int nvmme(unsigned int layerdisk) const
std::string iRegStr(unsigned int iReg, unsigned int iSeed)
std::string FTName(unsigned int l1, unsigned int l2, unsigned int l3)
std::vector< std::pair< double, double > > allStubs_[N_LAYER+N_DISK]
void writeCTMemories(std::ostream &os, std::ostream &memories, std::ostream &modules)
std::pair< unsigned int, unsigned int > seedLayers(unsigned int iSeed)
int matchport_[N_SEED_PROMPT][N_LAYER+N_DISK]
std::string TCNAme(unsigned int iseed, unsigned int iTC)
std::pair< double, double > seedPhiRange(double rproj, unsigned int iSeed, unsigned int iTC)
std::string iSeedStr(unsigned int iSeed)
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)
double phi(double r1, double phi1, double r2, double phi2, double r)
constexpr unsigned int N_SEED_PROMPT
std::pair< unsigned int, unsigned int > NVMTE_[N_SEED_PROMPT]