Skip to content

Commit

Permalink
Added phi region for other seed stub.
Browse files Browse the repository at this point in the history
  • Loading branch information
aehart committed Dec 6, 2023
1 parent 5dc28b5 commit 8ab54c7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
9 changes: 7 additions & 2 deletions TrackletAlgorithm/TrackBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ static const unsigned short kNBitsITC = FullMatchBase<BARREL>::kFMITCSize;
static const unsigned short kNBitsTrackletID = kNBitsTCID + kNBits_MemAddr;

typedef ap_uint<kNBitsTCID> TCIDType;
typedef ap_uint<kNBitsITC> ITCType;
typedef ap_uint<kNBits_MemAddr> IndexType;
typedef ap_uint<kNBitsTrackletID> TrackletIDType;

Expand Down Expand Up @@ -143,10 +144,14 @@ void TrackBuilder(
// Initialize a TrackFit object using the tracklet parameters associated
// with the minimum tracklet ID.
const TCIDType &TCID = (min_id != kInvalidTrackletID) ? (min_id >> kNBits_MemAddr) : TrackletIDType(TPAROffset);
TrackFit<NBarrelStubs, NDiskStubs> track(typename TrackFit<NBarrelStubs, NDiskStubs>::TFSEEDTYPE(TCID >> kNBitsITC));
const ITCType &iTC = TCID.range(kNBitsITC - 1, 0);
const typename TrackFit<NBarrelStubs, NDiskStubs>::TFPHIREGION phiRegionOuter = iTC / (Seed == TF::L1L2 ? 3 : 1);
const IndexType &trackletIndex = (min_id != kInvalidTrackletID) ? (min_id & TrackletIDType(0x7F)) : TrackletIDType(0);
const auto &tpar = trackletParameters[TCID - TPAROffset].read_mem(bx, trackletIndex);
track.setPhiRegion(tpar.getPhiRegion());

TrackFit<NBarrelStubs, NDiskStubs> track(typename TrackFit<NBarrelStubs, NDiskStubs>::TFSEEDTYPE(TCID >> kNBitsITC));
track.setPhiRegionInner(tpar.getPhiRegion());
track.setPhiRegionOuter(phiRegionOuter);
track.setStubIndexInner(tpar.getStubIndexInner());
track.setStubIndexOuter(tpar.getStubIndexOuter());
track.setRinv(tpar.getRinv());
Expand Down
26 changes: 18 additions & 8 deletions TrackletAlgorithm/TrackFitMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TrackFitBase
kTFZResidSize = 9,
kTFRResidSize = 7,
// Bit size for track and stub words
kTrackWordSize = kTFValidSize + kTFSeedTypeSize + kTFPhiRegionSize + 2 * kNBits_MemAddr + kTFRinvSize + kTFPhi0Size + kTFZ0Size + kTFTSize + kTFHitMapSize,
kTrackWordSize = kTFValidSize + kTFSeedTypeSize + 2 * kTFPhiRegionSize + 2 * kNBits_MemAddr + kTFRinvSize + kTFPhi0Size + kTFZ0Size + kTFTSize + kTFHitMapSize,
kBarrelStubSize = kTFValidSize + kTFTrackIndexSize + kTFStubIndexSize + kTFBarrelStubRSize + kTFPhiResidSize + kTFZResidSize,
kDiskStubSize = kTFValidSize + kTFTrackIndexSize + kTFStubIndexSize + kTFDiskStubRSize + kTFPhiResidSize + kTFRResidSize,
// Bit size for full TrackFitMemory
Expand Down Expand Up @@ -116,9 +116,11 @@ class TrackFit : public TrackFitBits<NBarrelStubs, NDiskStubs>
kTFStubIndexOuterMSB = kTFStubIndexOuterLSB + kNBits_MemAddr - 1,
kTFStubIndexInnerLSB = kTFStubIndexOuterMSB + 1,
kTFStubIndexInnerMSB = kTFStubIndexInnerLSB + kNBits_MemAddr - 1,
kTFPhiRegionLSB = kTFStubIndexInnerMSB + 1,
kTFPhiRegionMSB = kTFPhiRegionLSB + TrackFitBase<NBarrelStubs, NDiskStubs>::kTFPhiRegionSize - 1,
kTFSeedTypeLSB = kTFPhiRegionMSB + 1,
kTFPhiRegionOuterLSB = kTFStubIndexInnerMSB + 1,
kTFPhiRegionOuterMSB = kTFPhiRegionOuterLSB + TrackFitBase<NBarrelStubs, NDiskStubs>::kTFPhiRegionSize - 1,
kTFPhiRegionInnerLSB = kTFPhiRegionOuterMSB + 1,
kTFPhiRegionInnerMSB = kTFPhiRegionInnerLSB + TrackFitBase<NBarrelStubs, NDiskStubs>::kTFPhiRegionSize - 1,
kTFSeedTypeLSB = kTFPhiRegionInnerMSB + 1,
kTFSeedTypeMSB = kTFSeedTypeLSB + TrackFitBase<NBarrelStubs, NDiskStubs>::kTFSeedTypeSize - 1,
kTFTrackValidLSB = kTFSeedTypeMSB + 1,
kTFTrackValidMSB = kTFTrackValidLSB + TrackFitBase<NBarrelStubs, NDiskStubs>::kTFValidSize - 1
Expand Down Expand Up @@ -182,8 +184,12 @@ class TrackFit : public TrackFitBits<NBarrelStubs, NDiskStubs>
return data_.range(kTFSeedTypeMSB,kTFSeedTypeLSB);
}

TFPHIREGION getPhiRegion() const {
return data_.range(kTFPhiRegionMSB,kTFPhiRegionLSB);
TFPHIREGION getPhiRegionInner() const {
return data_.range(kTFPhiRegionInnerMSB,kTFPhiRegionInnerLSB);
}

TFPHIREGION getPhiRegionOuter() const {
return data_.range(kTFPhiRegionOuterMSB,kTFPhiRegionOuterLSB);
}

TFSEEDSTUBINDEX getStubIndexInner() const {
Expand Down Expand Up @@ -302,8 +308,12 @@ class TrackFit : public TrackFitBits<NBarrelStubs, NDiskStubs>
data_.range(kTFSeedTypeMSB,kTFSeedTypeLSB) = seedtype;
}

void setPhiRegion(const TFPHIREGION phiRegion) {
data_.range(kTFPhiRegionMSB,kTFPhiRegionLSB) = phiRegion;
void setPhiRegionInner(const TFPHIREGION phiRegion) {
data_.range(kTFPhiRegionInnerMSB,kTFPhiRegionInnerLSB) = phiRegion;
}

void setPhiRegionOuter(const TFPHIREGION phiRegion) {
data_.range(kTFPhiRegionOuterMSB,kTFPhiRegionOuterLSB) = phiRegion;
}

void setStubIndexInner(const TFSEEDSTUBINDEX seedStubIndex) {
Expand Down

0 comments on commit 8ab54c7

Please sign in to comment.