182 temp.emplace_back(std::make_shared<TrackKFOut>());
183 temp_collection.push_back(
temp);
185 outTrackStreams.push_back(temp_collection);
191 for (
int iLink = 0; iLink <
numWorkers_; iLink++) {
194 temp.emplace_back(std::make_shared<TrackKFOut>());
195 temp_collection.push_back(
temp);
197 inTrackStreams.push_back(temp_collection);
203 float tempTQMVA = 0.0;
205 std::vector<ap_fixed<10, 5>> trackQuality_inputs = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
207 for (
int iLink = 0; iLink < (
int)streamsTracks.size(); iLink++) {
208 for (
int iTrack = 0; iTrack < (
int)streamsTracks[iLink].
size(); iTrack++) {
209 const auto&
track = streamsTracks[iLink].at(iTrack);
219 double temp_tanL = inTrack.cotGlobal();
223 double tempchi2rphi = 0;
224 double tempchi2rz = 0;
227 int temp_ninterior = 0;
231 const auto& stub = streamsStubs[
setup_->
numLayers() * iLink + iStub].at(iTrack);
234 if (!stub.first.isNonnull()) {
244 double phiSquared =
pow(inStub.phi(), 2);
245 double zSquared =
pow(inStub.z(), 2);
252 double tempRphi = phiSquared * tempv0;
253 double tempRz = zSquared * tempv1;
255 tempchi2rphi += tempRphi;
256 tempchi2rz += tempRz;
262 TTBV extraMVA(0, TTTrack_TrackWord::TrackBitWidths::kMVAOtherSize,
false);
263 TTBV bendChi2(0, TTTrack_TrackWord::TrackBitWidths::kBendChi2Size,
false);
265 TTTrack_TrackWord::TrackBitWidths::kChi2RPhiSize,
268 TTTrack_TrackWord::TrackBitWidths::kChi2RZSize,
270 TTBV d0(0, TTTrack_TrackWord::TrackBitWidths::kD0Size,
false);
272 temp_z0,
dataFormats_->
base(Variable::zT, Process::kf), TTTrack_TrackWord::TrackBitWidths::kZ0Size,
true);
275 TTTrack_TrackWord::TrackBitWidths::kTanlSize,
279 TTTrack_TrackWord::TrackBitWidths::kPhiSize,
281 TTBV invR(-inTrack.inv2R(),
283 TTTrack_TrackWord::TrackBitWidths::kRinvSize + 1,
285 invR.
resize(TTTrack_TrackWord::TrackBitWidths::kRinvSize);
288 trackQuality_inputs = {
301 TTBV tqMVA(
digitise(
tqBins_, tempTQMVA, 1.0), TTTrack_TrackWord::TrackBitWidths::kMVAQualitySize,
false);
323 (std::make_shared<TrackKFOut>(temp_track));
328 int buffered_tracks[] = {0, 0};
334 if ((inTrackStreams[iRegion][iWorker][iTrack]->sortKey() == iLink) &&
335 (inTrackStreams[iRegion][iWorker][iTrack]->dataValid() ==
true)) {
336 outTrackStreams[iRegion][iLink][buffered_tracks[iLink]] = inTrackStreams[iRegion][iWorker][iTrack];
337 buffered_tracks[iLink] = buffered_tracks[iLink] + 1;
347 for (
int iTrack = 0; iTrack < (
int)outTrackStreams[iRegion][iLink].
size(); iTrack++) {
348 sortedPartialTracks[2 * iRegion + iLink].push_back(
349 outTrackStreams[iRegion][iLink][iTrack]->PartialTrack1());
350 sortedPartialTracks[2 * iRegion + iLink].push_back(
351 outTrackStreams[iRegion][iLink][iTrack]->PartialTrack2());
352 sortedPartialTracks[2 * iRegion + iLink].push_back(
353 outTrackStreams[iRegion][iLink][iTrack]->PartialTrack3());
354 outputStreamsTracks[2 * iRegion + iLink].emplace_back(outTrackStreams[iRegion][iLink][iTrack]->
track());
361 for (
int iLink = 0; iLink < (
int)outputStreamsTracks.size(); iLink++) {
363 int numLinkTracks = (
int)outputStreamsTracks[iLink].
size();
364 if (numLinkTracks == 0)
366 if ((numLinkTracks % 2 != 0)) {
367 sortedPartialTracks[iLink].push_back(nullBitTrack);
368 outputStreamsTracks[iLink].emplace_back(
369 outputStreamsTracks[iLink][numLinkTracks++]);
371 for (
int iTrack = 0; iTrack < (
int)(sortedPartialTracks[iLink].
size()); iTrack++) {
375 for (
auto&
it : ttTrackRefMap) {
376 if (
it.second == outputStreamsTracks[iLink][(
int)(iTrack - 1) / 3].
first)
379 if ((
int)iTrack / 3 <=
381 accepted[iLink].emplace_back(
382 std::make_pair(trackRef,
387 lost[iLink].emplace_back(
388 std::make_pair(trackRef,
EDPutTokenT< StreamsTrack > edPutTokenAccepted_
std::vector< std::vector< std::vector< std::shared_ptr< TrackKFOut > > > > TrackKFOutSAPtrCollectionss
static constexpr std::array< double, 1<< TrackBitWidths::kChi2RPhiSize > chi2RPhiBins
std::vector< StreamTrack > StreamsTrack
std::map< TTTrackRef, TTTrackRef > TTTrackRefMap
int kfoutchi2rzConv() const
double chosenRofZ() const
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
vector< double > dPhiBins_
std::vector< StreamStub > StreamsStub
int tfpNumChannel() const
T const * product() const
std::vector< std::vector< std::shared_ptr< TrackKFOut > > > TrackKFOutSAPtrCollections
int partialTrackWordBits_
std::unique_ptr< L1TrackQuality > trackQualityModel_
int numSectorsEta() const
static constexpr double ap_fixed_rescale
int kfoutchi2rphiConv() const
EDGetTokenT< StreamsStub > edGetTokenStubs_
double baseSector() const
const unsigned int kValidSize
EDPutTokenT< StreamsTrack > edPutTokenLost_
bool configurationSupported() const
int weightBinFraction() const
double hybridChosenRofPhi() const
std::vector< TrackKFOutSAPtr > TrackKFOutSAPtrCollection
static constexpr float d0
static constexpr std::array< double, 1<< TrackBitWidths::kChi2RZSize > chi2RZBins
EDGetTokenT< TTTrackRefMap > edGetTokenTTTrackRefMap_
const DataFormats * dataFormats_
EDGetTokenT< StreamsTrack > edGetTokenTracks_
Power< A, B >::type pow(const A &a, const B &b)
unsigned int digitise(const T &bins, double value, double factor)