30 phimatchcuttable_(settings),
31 zmatchcuttable_(settings),
32 rphicutPStable_(settings),
33 rphicut2Stable_(settings),
34 rcutPStable_(settings),
35 rcut2Stable_(settings),
36 alphainner_(settings),
37 alphaouter_(settings),
40 diskRadius_(settings),
42 rinvbendlut_(settings),
129 if (
output.find(
"matchout") != std::string::npos) {
138 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" could not find output: " <<
output;
146 if (
input ==
"allstubin") {
152 if (
input ==
"vmstubin") {
158 if (
input ==
"projin") {
164 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" could not find input: " <<
input;
192 unsigned int countme = 0;
193 unsigned int countall = 0;
194 unsigned int countsel = 0;
195 unsigned int countinputproj = 0;
197 unsigned int iprojmem = 0;
202 unsigned int iproj = 0;
207 countinputproj += inputproj->nTracklets();
237 bool projdone =
false;
248 unsigned int iMEbest = 0;
254 if (tcid < bestTCID) {
263 std::pair<Tracklet*, const Stub*> candmatch =
matchengines_[iMEbest].read();
265 const Stub* fpgastub = candmatch.second;
266 Tracklet* tracklet = candmatch.first;
269 if (oldTracklet !=
nullptr) {
274 oldTracklet = tracklet;
290 bool addedProjection =
false;
323 addedProjection =
true;
339 tmpProj__ = tmpProj_;
345 if (!projBuffNearFull) {
357 int overlapbits =
nvmbits_ + nextrabits;
359 unsigned int extrabits = fpgaphi.
bits(fpgaphi.
nbits() - overlapbits - nextrabits, nextrabits);
361 unsigned int ivmPlus =
iphi;
369 unsigned int ivmMinus =
iphi;
370 if (extrabits == 0 &&
iphi != 0) {
394 int signindex =
proj->proj(
layerdisk_).fpgarzprojder().value() < 0;
404 unsigned int projfinephi =
426 projfinerz =
word >> 4;
429 bool isPSseed =
proj->PSseed();
439 bool usefirstPlus = ivmPlus != ivmMinus && (stubmem->
nStubsBin(ivmPlus *
nbins +
slot) != 0);
442 good_ = usefirstPlus || usesecondPlus || usefirstMinus || usesecondMinus;
469 projdone =
true && !good_ && !good__;
483 <<
" " << countme <<
" " << countinputproj << endl;
499 int ir = fpgastub->
r().
value();
500 int iphi =
proj.fpgaphiproj().value();
504 int iz =
proj.fpgarzproj().value();
508 int ideltaz = fpgastub->
z().
value() - iz;
513 double phi = stub->
phi();
514 double r = stub->
r();
515 double z = stub->
z();
534 double dz = z - (
proj.rzproj() + dr *
proj.rzprojder());
538 double dzapprox = z - (
proj.rzprojapprox() + dr *
proj.rzprojderapprox());
540 int seedindex = tracklet->
getISeed();
575 <<
layerdisk_ + 1 <<
" " << seedindex <<
" " <<
pt <<
" " 594 throw cms::Exception(
"LogicError") <<
"WARNING dphi and/or dphiapprox too large : " << dphi <<
" " << dphiapprox
640 assert(stub->
z() * tracklet->
t() > 0.0);
642 int sign = (tracklet->
t() > 0.0) ? 1 : -1;
648 int iz = fpgastub->
z().
value();
652 int iphi =
proj.fpgaphiproj().value();
657 int ir =
proj.fpgarzproj().value();
663 int irstub = fpgastub->
r().
value();
677 int ideltar = (irstub >> diff_bits) - ir;
682 ideltaphi += iphialphacor;
687 double phi = stub->
phi();
688 double z = stub->
z();
689 double r = stub->
r();
711 double phiproj =
proj.phiproj() +
dz *
proj.phiprojder();
712 double rproj =
proj.rzproj() +
dz *
proj.rzprojder();
713 double deltar = r - rproj;
715 double dr = stub->
r() - rproj;
716 double drapprox = stub->
r() - (
proj.rzprojapprox() +
dz *
proj.rzprojderapprox());
722 double drphi = dphi * stub->
r();
723 double drphiapprox = dphiapprox * stub->
r();
735 int seedindex = tracklet->
getISeed();
809 drphiapprox / stub->
r(),
Log< level::Info, true > LogVerbatim
void initBendMatch(unsigned int layerdisk)
constexpr unsigned int N_RZBITS
unsigned int maxStep(std::string module) const
const FPGAWord & r() const
const Residual & resid(unsigned int layerdisk)
unsigned int projrinv() const
double kphiderdisk() const
void initmatchcut(unsigned int layerdisk, MatchType type, unsigned int region)
double rDSSinner(unsigned int iBin) const
constexpr T reduceRange(T x)
void addInput(MemoryBase *memory, std::string input) override
double phiapprox(double phimin, double) const
std::vector< MatchEngineUnit > matchengines_
constexpr unsigned int NRINVBITS
const FPGAWord & z() const
void initProjectionBend(double k_phider, unsigned int idisk, unsigned int nrbits, unsigned int nphiderbits)
double dphisectorHG() const
unsigned int projfinephi() const
Projection & proj(int layerdisk)
Settings const & settings_
TrackletLUT phimatchcuttable_
int lookup(unsigned int index) const
std::vector< TrackletProjectionsMemory * > inputprojs_
constexpr unsigned int N_DSS_MOD
static std::string const input
unsigned int isPSmodule() const
void addMatch(unsigned int layerdisk, int ideltaphi, int ideltarz, double dphi, double drz, double dphiapprox, double drzapprox, int stubid, const trklet::Stub *stubptr)
U second(std::pair< T, U > const &p)
unsigned int nbitsallstubs(unsigned int layerdisk) const
double half2SmoduleWidth() const
unsigned int nzbitsstub(unsigned int layerdisk) const
unsigned int nphibitsstub(unsigned int layerdisk) const
double rmean(unsigned int iLayer) const
double rDSSouter(unsigned int iBin) const
bool use(unsigned int nextrzbin, unsigned int nextiphibin) const
std::vector< FullMatchMemory * > fullmatches_
VarAdjustK der_phiD_final
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Abs< T >::type abs(const T &t)
Tracklet * getTracklet(unsigned int i)
IMATH_TrackletCalculator * ITC_L1L2()
bool doMultipleMatches() const
std::string const & getName() const
unsigned int nbitsvmme(unsigned int layerdisk) const
CircularBuffer< ProjectionTemp > inputProjBuffer_
bool writeMonitorData(std::string module) const
Log< level::Warning, true > LogPrint
double zmean(unsigned int iDisk) const
void initLayerDisk(unsigned int pos, int &layer, int &disk)
const FPGAWord & stubindex() const
TrackletLUT rphicutPStable_
unsigned int nallstubs(unsigned int layerdisk) const
bool debugTracklet() const
bool matchCalculator(Tracklet *tracklet, const Stub *fpgastub, bool print, unsigned int istep)
unsigned int iphi() const
TrackletLUT rphicut2Stable_
unsigned int nTracklets() const
unsigned int slot() const
int ialphafactinner_[N_DSS_MOD *2]
bool stubtruthmatch(const L1TStub *stub)
void addOutput(MemoryBase *memory, std::string output) override
constexpr unsigned int NFINEPHIBITS
unsigned int getISeed(const std::string &name)
unsigned int nvmme(unsigned int layerdisk) const
const FPGAWord & alpha() const
bool match(unsigned int layerdisk)
void execute(unsigned int iSector, double phimin)
unsigned int nMatchEngines_
std::ofstream & ofstream(std::string fname)
static unsigned int const shift
int best_ideltaphi_barrel
double krprojshiftdisk() const
const FPGAWord & phi() const
std::vector< VMStubsMEMemory * > vmstubs_
void initProjectionDiskRadius(int nrbits)
unsigned int nStubsBin(unsigned int bin) const
unsigned int bits(unsigned int lsb, unsigned int nbit) const
std::string const & getName() const
AllStubsMemory * allstubs_
TrackletLUT zmatchcuttable_
int ialphafactouter_[N_DSS_MOD *2]
constexpr unsigned int N_BITSMEMADDRESS
Log< level::Error, true > LogProblem