|
|
Go to the documentation of this file.
17 TrackletCalculator::TrackletCalculator(
string name,
Settings const& settings,
Globals* globals,
unsigned int iSector)
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");
82 outputProj = dynamic_cast<TrackletProjectionsMemory*>(
memory);
83 assert(outputProj !=
nullptr);
91 if (
output ==
"trackpar") {
92 auto*
tmp = dynamic_cast<TrackletParametersMemory*>(
memory);
98 if (
output.substr(0, 7) ==
"projout") {
100 auto*
tmp = dynamic_cast<TrackletProjectionsMemory*>(
memory);
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") {
134 auto*
tmp = dynamic_cast<AllStubsMemory*>(
memory);
139 if (
input ==
"outerallstubin") {
140 auto*
tmp = dynamic_cast<AllStubsMemory*>(
memory);
145 if (
input.substr(0, 8) ==
"stubpair") {
146 auto*
tmp = dynamic_cast<StubPairsMemory*>(
memory);
151 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find intput : " <<
input;
155 unsigned int countall = 0;
156 unsigned int countsel = 0;
163 for (
unsigned int i = 0;
i < stubpair->nStubPairs();
i++) {
165 const Stub* innerFPGAStub = stubpair->getVMStub1(
i).stub();
168 const Stub* outerFPGAStub = stubpair->getVMStub2(
i).stub();
176 if (outerFPGAStub->
isDisk()) {
188 if (outerFPGAStub->
isDisk()) {
193 }
else if (innerFPGAStub->
isDisk()) {
199 throw cms::Exception(
"LogicError") << __FILE__ <<
" " << __LINE__ <<
" invalid seeding";
291 writeDesign(
v,
"TC_L1L2");
308 writeDesign(
v,
"TC_L2L3");
325 writeDesign(
v,
"TC_L3L4");
342 writeDesign(
v,
"TC_L5L6");
356 writeDesign(
v,
"TC_F1F2");
369 writeDesign(
v,
"TC_B1B2");
384 writeDesign(
v,
"TC_F3F4");
397 writeDesign(
v,
"TC_B3B4");
413 writeDesign(
v,
"TC_L1F1");
427 writeDesign(
v,
"TC_L1B1");
443 writeDesign(
v,
"TC_L2F1");
457 writeDesign(
v,
"TC_L2B1");
bool writeInvTable() const
VarAdjustK der_phiD_final
unsigned int ntrackletmax() const
IMATH_TrackletCalculator * ITC_L2L3()
static const std::string input
bool writeVerilog() const
void addOutputProjection(TrackletProjectionsMemory *&outputProj, MemoryBase *memory)
TrackletParametersMemory * trackletpars_
std::vector< AllStubsMemory * > outerallstubs_
static void hls_print(const std::vector< VarBase * > &v, std::ofstream &fs)
Log< level::Warning, true > LogPrint
bool barrelSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
Settings const & settings_
IMATH_TrackletCalculatorDisk * ITC_B1B2()
static struct trklet::VarBase::Verilog verilog
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojlayers_
IMATH_TrackletCalculatorOverlap * ITC_L1F1()
IMATH_TrackletCalculatorOverlap * ITC_L2B1()
void writeInvTable(void(*writeLUT)(const VarInv &, const std::string &))
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
IMATH_TrackletCalculatorDisk * ITC_F3F4()
VarAdjustK der_phiL_final
VarAdjustK der_phiD_final
void initLayerDisksandISeed(unsigned int &layerdisk1, unsigned int &layerdisk2, unsigned int &iSeed)
bool diskSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
static void verilog_print(const std::vector< VarBase * > &v, std::ofstream &fs)
IMATH_TrackletCalculator * ITC_L1L2()
bool writeHLSInvTable() const
bool overlapSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojdisks_
void writeFirmwareDesign(void(*writeDesign)(const std::vector< VarBase * > &, const std::string &))
IMATH_TrackletCalculatorDisk * ITC_F1F2()
VarAdjustK der_phiL_final
IMATH_TrackletCalculator * ITC_L5L6()
static struct trklet::VarBase::HLS hls
IMATH_TrackletCalculatorDisk * ITC_B3B4()
bool writeMonitorData(std::string module) const
unsigned int nTracklets() const
bool usephicritapprox() const
IMATH_TrackletCalculatorOverlap * ITC_L1B1()
std::ofstream & ofstream(std::string fname)
std::string const & tablePath() const
Log< level::Info, true > LogVerbatim
std::string const & getName() const
unsigned int nallstubs(unsigned int layerdisk) const
bool debugTracklet() const
IMATH_TrackletCalculator * ITC_L3L4()
TEMPL(T2) struct Divides void
unsigned int maxStep(std::string module) const
void addOutput(MemoryBase *memory, std::string output) override
IMATH_TrackletCalculatorOverlap * ITC_L2F1()
std::vector< AllStubsMemory * > innerallstubs_
Abs< T >::type abs(const T &t)
VarAdjustK der_phiL_final
void addInput(MemoryBase *memory, std::string input) override
std::vector< StubPairsMemory * > stubpairs_
VarAdjustK der_phiD_final