28 TrackletProcessorDisplaced::TrackletProcessorDisplaced(
string name,
Settings const& settings,
Globals* globals)
49 for (
unsigned int ilayer = 0; ilayer <
N_LAYER; ilayer++) {
54 for (
unsigned int idisk = 0; idisk <
N_DISK; idisk++) {
69 assert(outputProj !=
nullptr);
78 if (
output ==
"trackpar") {
85 if (
output.substr(0, 7) ==
"projout") {
90 constexpr unsigned layerdiskPosInprojout = 8;
93 unsigned int layerdisk =
output[layerdiskPosInprojout] -
'1';
94 unsigned int phiregion =
output[phiPosInprojout] -
'A';
115 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find output : " <<
output;
124 if (
input ==
"thirdallstubin") {
130 if (
input ==
"firstallstubin") {
136 if (
input ==
"secondallstubin") {
142 if (
input ==
"thirdvmstubin") {
148 if (
input ==
"secondvmstubin") {
155 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find input : " <<
input;
159 unsigned int countall = 0;
160 unsigned int countsel = 0;
167 for (
unsigned int midmem = 0; midmem <
middleallstubs_.size(); midmem++) {
176 int indexz = (((1 << (midallstub->
z().
nbits() - 1)) + midallstub->
z().
value()) >>
179 bool negdisk = (midallstub->
disk().
value() < 0);
183 indexr = midallstub->
r().
value();
188 indexr = (((1 << (midallstub->
r().
nbits() - 1)) + midallstub->
r().
value()) >>
203 if (lutval != -1 && lutval2 != -1)
204 lutval += (lutval2 << lutshift);
207 FPGAWord lookupbits(lutval, lutwidth,
true, __LINE__, __FILE__);
219 start += (1 << nbitsrzbin);
227 for (
int ibin =
start; ibin <=
last; ibin++) {
228 for (
unsigned int outmem = 0; outmem <
outervmstubs_.size(); outmem++) {
229 for (
unsigned int j = 0;
j <
outervmstubs_[outmem]->nVMStubsBinned(ibin);
j++) {
239 if (rzbin < rzbinfirst || rzbin - rzbinfirst > rzdiffmax) {
241 edm::LogVerbatim(
"Tracklet") <<
"Outer stub rejected because of wrong r/z bin";
253 int last_ = start_ + next_;
257 <<
"Will look in rz bins for inner stub " << start_ <<
" to " << last_ << endl;
261 for (
int ibin_ = start_; ibin_ <= last_; ibin_++) {
262 for (
unsigned int inmem = 0; inmem <
innervmstubs_.size(); inmem++) {
263 for (
unsigned int k = 0;
k <
innervmstubs_[inmem]->nVMStubsBinned(ibin_);
k++) {
271 const Stub* innerFPGAStub = invmstub.
stub();
272 const Stub* middleFPGAStub = midallstub;
273 const Stub* outerFPGAStub = outvmstub.
stub();
281 <<
"triplet seeding\n" 286 <<
"TrackletCalculatorDisplaced execute " <<
getName() <<
"[" <<
iSector_ <<
"]";
292 accept =
LLLSeeding(innerFPGAStub, innerStub, middleFPGAStub, middleStub, outerFPGAStub, outerStub);
294 accept =
LLDSeeding(innerFPGAStub, innerStub, middleFPGAStub, middleStub, outerFPGAStub, outerStub);
296 accept =
DDLSeeding(innerFPGAStub, innerStub, middleFPGAStub, middleStub, outerFPGAStub, outerStub);
330 globals_->
ofstream(
"trackletprocessordisplaced.txt") <<
getName() <<
" " << countall <<
" " << countsel << endl;
unsigned int vmrlutrbits(unsigned int layerdisk) const
Log< level::Info, true > LogVerbatim
constexpr unsigned int N_RZBITS
std::vector< AllStubsMemory * > middleallstubs_
unsigned int maxStep(std::string module) const
const FPGAWord & r() const
unsigned int nbits() const
std::vector< AllStubsMemory * > innerallstubs_
const FPGAWord & z() const
std::string strbare() const
Settings const & settings_
void initLayerDisksandISeedDisp(unsigned int &layerdisk1, unsigned int &layerdisk2, unsigned int &layerdisk3, unsigned int &iSeed)
int lookup(unsigned int index) const
std::vector< VMStubsTEMemory * > innervmstubs_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
static std::string const input
unsigned int NLONGVMBINS() const
const FPGAWord & disk() const
bool LLDSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *middleFPGAStub, const L1TStub *middleStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
const Stub * stub() const
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojlayers_
void initVMRTable(unsigned int layerdisk, VMRTableType type, int region=-1, bool combined=true)
void execute(unsigned int iSector, double phimin, double phimax)
bool LLLSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *middleFPGAStub, const L1TStub *middleStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
const FPGAWord & vmbits() const
double lutwidthtabextended(unsigned int inner, unsigned int iSeed) const
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojdisks_
bool writeMonitorData(std::string module) const
unsigned int layerdisk() const
constexpr unsigned int NFINERZBITS
unsigned int nallstubs(unsigned int layerdisk) const
bool debugTracklet() const
TrackletLUT innerThirdTable_
bool DDLSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *middleFPGAStub, const L1TStub *middleStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
const std::string & stubword() const
std::ofstream & ofstream(std::string fname)
std::vector< AllStubsMemory * > outerallstubs_
void addOutput(MemoryBase *memory, std::string output) override
unsigned int bits(unsigned int lsb, unsigned int nbit) const
std::vector< VMStubsTEMemory * > outervmstubs_
std::string const & getName() const
void addOutputProjection(TrackletProjectionsMemory *&outputProj, MemoryBase *memory)
TrackletParametersMemory * trackletpars_
void addInput(MemoryBase *memory, std::string input) override
unsigned int vmrlutzbits(unsigned int layerdisk) const