|
|
Go to the documentation of this file.
18 phimatchcuttable_(settings),
19 zmatchcuttable_(settings),
20 rphicutPStable_(settings),
21 rphicut2Stable_(settings),
22 rcutPStable_(settings),
23 rcut2Stable_(settings),
25 rinvbendlut_(settings),
95 if (
output.find(
"matchout") != std::string::npos) {
96 auto*
tmp = dynamic_cast<FullMatchMemory*>(
memory);
104 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" could not find output: " <<
output;
112 if (
input ==
"allstubin") {
113 auto*
tmp = dynamic_cast<AllStubsMemory*>(
memory);
118 if (
input ==
"vmstubin") {
119 auto*
tmp = dynamic_cast<VMStubsMEMemory*>(
memory);
124 if (
input ==
"projin") {
125 auto*
tmp = dynamic_cast<TrackletProjectionsMemory*>(
memory);
130 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" could not find input: " <<
input;
157 unsigned int countme = 0;
158 unsigned int countall = 0;
159 unsigned int countsel = 0;
160 unsigned int countinputproj = 0;
162 unsigned int iprojmem = 0;
167 unsigned int iproj = 0;
172 countinputproj += inputproj->nTracklets();
203 bool projdone =
false;
208 unsigned int iMEbest = 0;
214 if (tcid < bestTCID) {
221 std::pair<Tracklet*, const Stub*> candmatch =
matchengines_[iMEbest].read();
223 const Stub* fpgastub = candmatch.second;
224 Tracklet* tracklet = candmatch.first;
226 if (oldTracklet !=
nullptr) {
231 oldTracklet = tracklet;
247 bool addedProjection =
false;
279 print && (iME == 0));
280 addedProjection =
true;
295 tmpProj__ = tmpProj_;
302 if (!projBuffNearFull) {
314 int overlapbits =
nvmbits_ + nextrabits;
316 unsigned int extrabits = fpgaphi.
bits(fpgaphi.
nbits() - overlapbits, nextrabits);
318 unsigned int ivmPlus =
iphi;
326 unsigned int ivmMinus =
iphi;
327 if (extrabits == 0 &&
iphi != 0) {
346 int phiderindex = (
proj->proj(
layerdisk_).fpgaphiprojder().value() >>
350 int signindex =
proj->proj(
layerdisk_).fpgarzprojder().value() < 0;
360 unsigned int slot =
proj->proj(
layerdisk_).fpgarzbin1projvm().value();
363 unsigned int projfinephi =
367 bool isPSseed =
proj->PSseed();
375 bool usefirstMinus = stubmem->
nStubsBin(ivmMinus *
nbins + slot) != 0;
377 bool usefirstPlus = ivmPlus != ivmMinus && stubmem->
nStubsBin(ivmPlus *
nbins + slot) != 0;
378 bool usesecondPlus = ivmPlus != ivmMinus && (
second && (stubmem->
nStubsBin(ivmPlus *
nbins + slot + 1) != 0));
380 good_ = usefirstPlus || usesecondPlus || usefirstMinus || usesecondMinus;
408 projdone =
true && !good_ && !good__;
421 <<
" " << countme <<
" " << countinputproj << endl;
437 int ir = fpgastub->
r().
value();
438 int iphi =
proj.fpgaphiproj().value();
442 int iz =
proj.fpgarzproj().value();
446 int ideltaz = fpgastub->
z().
value() - iz;
451 double phi = stub->
phi();
452 double r = stub->
r();
453 double z = stub->
z();
472 double dz = z - (
proj.rzproj() +
dr *
proj.rzprojder());
476 double dzapprox = z - (
proj.rzprojapprox() +
dr *
proj.rzprojderapprox());
478 int seedindex = tracklet->
getISeed();
500 <<
layerdisk_ + 1 <<
" " << seedindex <<
" " <<
pt <<
" "
519 throw cms::Exception(
"LogicError") <<
"WARNING dphi and/or dphiapprox too large : " << dphi <<
" " << dphiapprox
549 assert(stub->
z() * tracklet->
t() > 0.0);
551 int sign = (tracklet->
t() > 0.0) ? 1 : -1;
557 int iz = fpgastub->
z().
value();
561 int iphi =
proj.fpgaphiproj().value();
566 int ir =
proj.fpgarzproj().value();
572 int irstub = fpgastub->
r().
value();
590 ideltaphi += iphialphacor;
595 double phi = stub->
phi();
596 double z = stub->
z();
597 double r = stub->
r();
619 double phiproj =
proj.phiproj() +
dz *
proj.phiprojder();
620 double rproj =
proj.rzproj() +
dz *
proj.rzprojder();
623 double dr = stub->
r() - rproj;
624 double drapprox = stub->
r() - (
proj.rzprojapprox() +
dz *
proj.rzprojderapprox());
630 double drphi = dphi * stub->
r();
631 double drphiapprox = dphiapprox * stub->
r();
643 int seedindex = tracklet->
getISeed();
666 bool imatch = (
std::abs(ideltaphi * irstub) < idrphicut) && (
std::abs(ideltar) < idrcut);
690 drphiapprox / stub->
r(),
void execute(unsigned int iSector, double phimin)
bool stubtruthmatch(const L1TStub *stub)
static const std::string input
TrackletLUT phimatchcuttable_
int lookup(unsigned int index) const
double krprojshiftdisk() const
void initProjectionBend(double k_phider, unsigned int idisk, unsigned int nrbits, unsigned int nphiderbits)
std::vector< VMStubsMEMemory * > vmstubs_
const FPGAWord & phi() const
int ialphafactouter_[N_DSS_MOD *2]
Log< level::Warning, true > LogPrint
unsigned int nbitsallstubs(unsigned int layerdisk) const
U second(std::pair< T, U > const &p)
double rmean(unsigned int iLayer) const
Settings const & settings_
double phiapprox(double phimin, double) const
double kphiderdisk() const
double rDSSinner(unsigned int iBin) const
double half2SmoduleWidth() const
unsigned int projfinephi() const
void addInput(MemoryBase *memory, std::string input) override
const FPGAWord & r() const
double rDSSouter(unsigned int iBin) const
unsigned int iphi() const
std::vector< FullMatchMemory * > fullmatches_
Projection & proj(int layerdisk)
constexpr unsigned int NFINEPHIBITS
const FPGAWord & z() const
std::string const & getName() const
double dphisectorHG() const
unsigned int bits(unsigned int lsb, unsigned int nbit) const
unsigned int isPSmodule() const
unsigned int projrinv() const
Log< level::Error, true > LogProblem
bool use(unsigned int nextrzbin, unsigned int nextiphibin) const
unsigned int nbitsvmme(unsigned int layerdisk) const
CircularBuffer< ProjectionTemp > inputProjBuffer_
std::vector< TrackletProjectionsMemory * > inputprojs_
double zmean(unsigned int iDisk) const
VarAdjustK der_phiD_final
TrackletLUT rphicutPStable_
void initLayerDisk(unsigned int pos, int &layer, int &disk)
int ialphafactinner_[N_DSS_MOD *2]
constexpr unsigned int N_DSS_MOD
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
IMATH_TrackletCalculator * ITC_L1L2()
Tracklet * getTracklet(unsigned int i)
unsigned int nzbitsstub(unsigned int layerdisk) const
unsigned int nvmme(unsigned int layerdisk) const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
unsigned int nMatchEngines_
unsigned int slot() const
unsigned int nphibitsstub(unsigned int layerdisk) const
void addMatch(unsigned int layerdisk, int ideltaphi, int ideltarz, double dphi, double drz, double dphiapprox, double drzapprox, int stubid, const trklet::Stub *stubptr)
unsigned int nTracklets() const
unsigned int getISeed(const std::string &name)
constexpr unsigned int N_BITSMEMADDRESS
bool writeMonitorData(std::string module) const
TrackletLUT zmatchcuttable_
static unsigned const int shift
std::ofstream & ofstream(std::string fname)
bool matchCalculator(Tracklet *tracklet, const Stub *fpgastub, bool print, unsigned int istep)
Log< level::Info, true > LogVerbatim
AllStubsMemory * allstubs_
void initmatchcut(unsigned int layerdisk, MatchType type, unsigned int region)
TrackletLUT rphicut2Stable_
std::string const & getName() const
const FPGAWord & stubindex() const
unsigned int nallstubs(unsigned int layerdisk) const
bool debugTracklet() const
void initBendMatch(unsigned int layerdisk)
void addOutput(MemoryBase *memory, std::string output) override
unsigned int maxStep(std::string module) const
constexpr unsigned int N_RZBITS
const FPGAWord & alpha() const
Abs< T >::type abs(const T &t)
unsigned int nStubsBin(unsigned int bin) const
std::vector< MatchEngineUnit > matchengines_
constexpr unsigned int NRINVBITS
constexpr T reduceRange(T x)