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.";
47 void (*writeLUT)(
const VarInv&,
const string&) =
nullptr;
49 writeLUT = [](
const VarInv&
x,
const string& basename) ->
void {
50 ofstream
fs(basename +
".tab");
54 writeLUT = [](
const VarInv&
x,
const string& basename) ->
void {
55 ofstream
fs(basename +
".tab");
65 void (*writeDesign)(
const vector<VarBase*>&,
const string&) =
nullptr;
67 writeDesign = [](
const vector<VarBase*>&
v,
const string& basename) ->
void {
68 ofstream
fs(basename +
".v");
72 writeDesign = [](
const vector<VarBase*>&
v,
const string& basename) ->
void {
73 ofstream
fs(basename +
".cpp");
83 assert(outputProj !=
nullptr);
91 if (
output ==
"trackpar") {
98 if (
output.substr(0, 7) ==
"projout") {
103 unsigned int layerdisk =
output[8] -
'1';
104 unsigned int phiregion =
output[12] -
'A';
125 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find output : " <<
output;
133 if (
input ==
"innerallstubin") {
139 if (
input ==
"outerallstubin") {
145 if (
input.substr(0, 8) ==
"stubpair") {
151 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find intput : " <<
input;
155 unsigned int countall = 0;
156 unsigned int countsel = 0;
171 for (
unsigned int i = 0;
i < stubpair->nStubPairs();
i++) {
173 const Stub* innerFPGAStub = stubpair->getVMStub1(
i).stub();
176 const Stub* outerFPGAStub = stubpair->getVMStub2(
i).stub();
207 throw cms::Exception(
"LogicError") << __FILE__ <<
" " << __LINE__ <<
" invalid seeding";
299 writeDesign(
v,
"TC_L1L2");
316 writeDesign(
v,
"TC_L2L3");
333 writeDesign(
v,
"TC_L3L4");
350 writeDesign(
v,
"TC_L5L6");
364 writeDesign(
v,
"TC_F1F2");
377 writeDesign(
v,
"TC_B1B2");
392 writeDesign(
v,
"TC_F3F4");
405 writeDesign(
v,
"TC_B3B4");
421 writeDesign(
v,
"TC_L1F1");
435 writeDesign(
v,
"TC_L1B1");
451 writeDesign(
v,
"TC_L2F1");
465 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)