19 for (
unsigned int ilayer = 0; ilayer <
N_LAYER; ilayer++) {
20 vector<TrackletProjectionsMemory*>
tmp(settings.
nallstubs(ilayer),
nullptr);
24 for (
unsigned int idisk = 0; idisk <
N_DISK; idisk++) {
38 double phicritFactor =
40 if (
std::abs(phicritFactor - 2.) > 0.25)
42 <<
"TrackletCalculator::TrackletCalculator phicrit approximation may be invalid! Please check.";
50 void (*writeLUT)(
const VarInv&,
const string&) =
nullptr;
52 writeLUT = [](
const VarInv&
x,
const string& basename) ->
void {
53 ofstream
fs(basename +
".tab");
57 writeLUT = [](
const VarInv&
x,
const string& basename) ->
void {
58 ofstream
fs(basename +
".tab");
68 void (*writeDesign)(
const vector<VarBase*>&,
const string&) =
nullptr;
70 writeDesign = [](
const vector<VarBase*>&
v,
const string& basename) ->
void {
71 ofstream
fs(basename +
".v");
75 writeDesign = [](
const vector<VarBase*>&
v,
const string& basename) ->
void {
76 ofstream
fs(basename +
".cpp");
86 assert(outputProj !=
nullptr);
94 if (
output ==
"trackpar") {
101 if (
output.substr(0, 7) ==
"projout") {
106 unsigned int layerdisk =
output[8] -
'1';
107 unsigned int phiregion =
output[12] -
'A';
128 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find output : " <<
output;
136 if (
input ==
"innerallstubin") {
142 if (
input ==
"outerallstubin") {
148 if (
input.substr(0, 8) ==
"stubpair") {
154 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find intput : " <<
input;
158 unsigned int countall = 0;
159 unsigned int countsel = 0;
174 for (
unsigned int i = 0;
i < stubpair->nStubPairs();
i++) {
176 const Stub* innerFPGAStub = stubpair->getVMStub1(
i).stub();
179 const Stub* outerFPGAStub = stubpair->getVMStub2(
i).stub();
210 throw cms::Exception(
"LogicError") << __FILE__ <<
" " << __LINE__ <<
" invalid seeding";
302 writeDesign(
v,
"TC_L1L2");
319 writeDesign(
v,
"TC_L2L3");
336 writeDesign(
v,
"TC_L3L4");
353 writeDesign(
v,
"TC_L5L6");
367 writeDesign(
v,
"TC_F1F2");
380 writeDesign(
v,
"TC_B1B2");
395 writeDesign(
v,
"TC_F3F4");
408 writeDesign(
v,
"TC_B3B4");
424 writeDesign(
v,
"TC_L1F1");
438 writeDesign(
v,
"TC_L1B1");
454 writeDesign(
v,
"TC_L2F1");
468 writeDesign(
v,
"TC_L2B1");
Log< level::Info, true > LogVerbatim
static void verilog_print(const std::vector< VarBase *> &v, std::ofstream &fs)
static void hls_print(const std::vector< VarBase *> &v, std::ofstream &fs)
VarAdjustK der_phiL_final
unsigned int maxStep(std::string module) const
bool diskSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
IMATH_TrackletCalculator * ITC_L2L3()
void initLayerDisksandISeed(unsigned int &layerdisk1, unsigned int &layerdisk2, unsigned int &iSeed)
Settings const & settings_
VarAdjustK der_phiL_final
bool writeVerilog() const
void writeFirmwareDesign(void(*writeDesign)(const std::vector< VarBase *> &, const std::string &))
IMATH_TrackletCalculatorOverlap * ITC_L2B1()
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
unsigned int nTracklets() const
IMATH_TrackletCalculatorDisk * ITC_B1B2()
void addOutput(MemoryBase *memory, std::string output) override
static struct trklet::VarBase::Verilog verilog
std::vector< AllStubsMemory * > innerallstubs_
TEMPL(T2) struct Divides void
static std::string const input
bool overlapSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
IMATH_TrackletCalculatorDisk * ITC_F3F4()
IMATH_TrackletCalculatorOverlap * ITC_L1F1()
void addInput(MemoryBase *memory, std::string input) override
std::string tablePath() const
std::vector< StubPairsMemory * > stubpairs_
VarAdjustK der_phiD_final
VarAdjustK der_phiD_final
Abs< T >::type abs(const T &t)
IMATH_TrackletCalculator * ITC_L1L2()
void addOutputProjection(TrackletProjectionsMemory *&outputProj, MemoryBase *memory)
TrackletParametersMemory * trackletpars_
bool writeMonitorData(std::string module) const
Log< level::Warning, true > LogPrint
unsigned int layerdisk() const
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojdisks_
unsigned int nallstubs(unsigned int layerdisk) const
bool debugTracklet() const
std::vector< AllStubsMemory * > outerallstubs_
static struct trklet::VarBase::HLS hls
IMATH_TrackletCalculatorDisk * ITC_B3B4()
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojlayers_
IMATH_TrackletCalculatorDisk * ITC_F1F2()
VarAdjustK der_phiD_final
void execute(unsigned int iSector, double phimin, double phimax)
IMATH_TrackletCalculator * ITC_L5L6()
IMATH_TrackletCalculator * ITC_L3L4()
bool writeHLSInvTable() const
void writeInvTable(void(*writeLUT)(const VarInv &, const std::string &))
VarAdjustK der_phiL_final
IMATH_TrackletCalculatorOverlap * ITC_L1B1()
IMATH_TrackletCalculatorOverlap * ITC_L2F1()
std::ofstream & ofstream(std::string fname)
unsigned int ntrackletmax() const
bool writeInvTable() const
bool usephicritapprox() const
std::string const & getName() const
bool barrelSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)