21 : enableTruncation_(iConfig.getParameter<
bool>(
"EnableTruncation")),
22 useTTStubResiduals_(iConfig.getParameter<
bool>(
"UseTTStubResiduals")),
24 dataFormats_(dataFormats),
25 layerEncoding_(layerEncoding),
26 channelAssignment_(channelAssignment),
29 input_(channelAssignment_->numChannelsTrack()) {
42 baseLzT_ = dataFormats->
base(Variable::zT, Process::kfin);
63 static const double baseCot =
70 const int channelTrack = offsetTrack + channel;
72 const StreamTrack& streamTrack = streamsTrack[channelTrack];
73 input_[channel].reserve(streamTrack.size());
79 if (streamsStub[offsetStub + layer][
frame].
first.isNonnull())
87 const int channelTrack = offsetTrack + channel;
89 const StreamTrack& streamTrack = streamsTrack[channelTrack];
94 input.push_back(
nullptr);
110 input.push_back(
nullptr);
117 const FrameStub& frameStub = streamsStub[offsetStub + layer][
frame];
118 const TTStubRef& ttStubRef = frameStub.first;
128 TTBV hw(frameStub.second);
129 const TTBV hwRZ(hw, widthRZ, 0,
true);
134 double phi =
hwPhi.val(basePhi);
149 const double ttR = r;
151 stubs_.emplace_back(ttStubRef, layerId, ttR, phi, ttZ, psTilt);
153 stubs_.emplace_back(ttStubRef, layerId, r, phi, z, psTilt);
154 stubs.push_back(&
stubs_.back());
158 const vector<TTStubRef>& ttStubRefs = ttTrackRef->getStubRefs();
159 auto sameLayer = [
this, layerId](
const TTStubRef& ttStubRef) {
162 const TTStubRef& ttStubRef = *find_if(ttStubRefs.begin(), ttStubRefs.end(), sameLayer);
173 static constexpr
double phi = 0.;
174 static constexpr
double z = 0.;
189 stubs_.emplace_back(ttStubRef, layerId, ttR, phi, ttZ, psTilt);
191 stubs_.emplace_back(ttStubRef, layerId, r, phi, z, psTilt);
192 stubs.push_back(&
stubs_.back());
206 static constexpr
int usedMSBpitchOverRaddr = 1;
207 static const double baseR =
210 static const double baseRinvR =
213 static const double baseInvR =
216 static constexpr
int usedMSBCotLutaddr = 3;
239 track.valid_ =
false;
262 track.valid_ =
false;
264 track.valid_ =
false;
266 track.valid_ =
false;
268 track.valid_ =
false;
325 track.valid_ =
false;
343 const double sumdz =
track.zT_ + stub->
z_;
346 const double cot =
digi(
abs(dZ *
digi(1. / r, baseInvR) + sumcot), baseCotLut);
347 double lengthZ = length;
350 lengthZ = length *
cot;
375 zT.str() +
cot.str()));
377 auto frameStub = [
this](
Track*
track,
int layer) {
378 auto equal = [layer](
Stub* stub) {
return stub->valid_ && stub->layer_ == layer; };
379 const auto it = find_if(
track->stubs_.begin(),
track->stubs_.end(),
equal);
380 if (it ==
track->stubs_.end() || !(*it)->valid_)
391 auto acc = [invalid](
int& sum,
Track*
track) {
return sum += (invalid(
track) ? 1 : 0); };
394 const int channelTrack = offsetTrack + channel;
398 const int lost = accumulate(
input.begin(),
input.end(), 0, acc);
401 lostStubs[offsetStub + layer].reserve(lost);
407 lostStubs[offsetStub + layer].emplace_back(frameStub(
track, layer));
410 acceptedTracks[channelTrack].reserve(
input.size());
412 accpetedStubs[offsetStub + layer].reserve(
input.size());
415 acceptedTracks[channelTrack].emplace_back(
FrameTrack());
417 accpetedStubs[offsetStub + layer].emplace_back(
FrameStub());
420 acceptedTracks[channelTrack].emplace_back(frameTrack(
track));
422 accpetedStubs[offsetStub + layer].emplace_back(frameStub(
track, layer));
428 double KFin::redigi(
double val,
double baseLow,
double baseHigh,
int widthMultiplier)
const {
429 const double base =
pow(2, 1 - widthMultiplier);
431 return (floor(
val *
transform / baseLow) + .5) * baseHigh;
double hybridDiskZ(int layerId) const
constexpr int32_t ceil(float num)
std::bitset< TTBV::S_ > Frame
double hybridLayerR(int layerId) const
double hybridRangePhi() const
double hybridMaxCot() const
std::vector< StreamTrack > StreamsTrack
double chosenRofZ() const
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
std::pair< TTStubRef, Frame > FrameStub
std::vector< Stub > stubs_
Class to process and provide run-time constants used by Track Trigger emulators.
std::vector< StreamStub > StreamsStub
const std::vector< int > & seedingLayers(int seedType) const
double boundarieEta(int eta) const
int numChannelsTrack() const
void consume(const tt::StreamsTrack &streamsTrack, const tt::StreamsStub &streamsStub)
double digi(double val, double base) const
const ChannelAssignment * channelAssignment_
Class to assign tracklet tracks and stubs to output channel based on their Pt or seed type as well as...
TTBV maybePattern(int binEta, int binZT, int binCot) const
std::vector< FrameTrack > StreamTrack
bool equal(const T &first, const T &second)
int offsetStub(int channelTrack) const
static std::string const input
double tiltedLayerLimitZ(int layer) const
std::pair< TTTrackRef, Frame > FrameTrack
int numSectorsEta() const
double beamWindowZ() const
double tiltUncertaintyR() const
int numSeedingLayers() const
GlobalPoint stubPos(const TTStubRef &ttStubRef) const
double baseSector() const
int layerId(const TTStubRef &ttStubRef) const
std::vector< Track > tracks_
Abs< T >::type abs(const T &t)
const Settings * settings_
double stubR(const TTBV &hw, const TTStubRef &ttStubRef) const
std::vector< std::vector< Track * > > input_
double tiltApproxSlope() const
double hybridRangeR() const
bool isNull() const
Checks for null.
double outerRadius() const
int offsetLayerDisks() const
int offsetLayerId() const
int numProjectionLayers(int seedType) const
double redigi(double val, double baseLow, double baseHigh, int widthMultiplier) const
int widthAddrBRAM18() const
bool psModule(int dtcId) const
double tbInnerRadius() const
double scattering() const
int trackletLayerId(const TTStubRef &ttStubRef) const
Class to encode layer ids for Kalman Filter Layers consitent with rough r-z track parameters are coun...
double deltaPhi(double lhs, double rhs=0.)
double tiltApproxIntercept() const
const int layerIdKF(int binEta, int binZT, int binCot, int layerId) const
bool layerId(int seedType, const TTStubRef &ttStubRef, int &layerId) const
int indexLayerId(const TTStubRef &ttStubRef) const
double baseRegion() const
double sectorCot(int eta) const
const trackerTFP::DataFormats * dataFormats_
void produce(tt::StreamsStub &accpetedStubs, tt::StreamsTrack &acceptedTracks, tt::StreamsStub &lostStubs, tt::StreamsTrack &lostTracks)
bool barrel(const TTStubRef &ttStubRef) const
Power< A, B >::type pow(const A &a, const B &b)
const trackerTFP::LayerEncoding * layerEncoding_