183 temp.emplace_back(std::make_shared<TrackKFOut>());
184 temp_collection.push_back(
temp);
186 outTrackStreams.push_back(temp_collection);
192 for (
int iLink = 0; iLink <
numWorkers_; iLink++) {
195 temp.emplace_back(std::make_shared<TrackKFOut>());
196 temp_collection.push_back(
temp);
198 inTrackStreams.push_back(temp_collection);
204 float tempTQMVAPreSig = 0.0;
206 std::vector<ap_fixed<10, 5>> trackQuality_inputs = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
208 for (
int iLink = 0; iLink < (
int)streamsTracks.size(); iLink++) {
209 for (
int iTrack = 0; iTrack < (
int)streamsTracks[iLink].
size(); iTrack++) {
210 const auto&
track = streamsTracks[iLink].at(iTrack);
220 double temp_tanL = inTrack.cotGlobal();
224 double tempchi2rphi = 0;
225 double tempchi2rz = 0;
228 int temp_ninterior = 0;
232 const auto& stub = streamsStubs[
setup_->
numLayers() * iLink + iStub].at(iTrack);
235 if (!stub.first.isNonnull()) {
245 double phiSquared =
pow(inStub.phi(), 2);
246 double zSquared =
pow(inStub.z(), 2);
253 double tempRphi = phiSquared * tempv0;
254 double tempRz = zSquared * tempv1;
256 tempchi2rphi += tempRphi;
257 tempchi2rz += tempRz;
263 TTBV extraMVA(0, TTTrack_TrackWord::TrackBitWidths::kMVAOtherSize,
false);
264 TTBV bendChi2(0, TTTrack_TrackWord::TrackBitWidths::kBendChi2Size,
false);
266 TTTrack_TrackWord::TrackBitWidths::kChi2RPhiSize,
269 TTTrack_TrackWord::TrackBitWidths::kChi2RZSize,
271 TTBV d0(0, TTTrack_TrackWord::TrackBitWidths::kD0Size,
false);
273 temp_z0,
dataFormats_->
base(Variable::zT, Process::kf), TTTrack_TrackWord::TrackBitWidths::kZ0Size,
true);
276 TTTrack_TrackWord::TrackBitWidths::kTanlSize,
280 TTTrack_TrackWord::TrackBitWidths::kPhiSize,
282 TTBV invR(-inTrack.inv2R(),
284 TTTrack_TrackWord::TrackBitWidths::kRinvSize + 1,
286 invR.
resize(TTTrack_TrackWord::TrackBitWidths::kRinvSize);
289 trackQuality_inputs = {
302 TTTrack_TrackWord::TrackBitWidths::kMVAQualitySize,
325 (std::make_shared<TrackKFOut>(temp_track));
330 int buffered_tracks[] = {0, 0};
335 if ((inTrackStreams[iRegion][iWorker][iTrack]->sortKey() == iLink) &&
336 (inTrackStreams[iRegion][iWorker][iTrack]->dataValid() ==
true)) {
337 outTrackStreams[iRegion][iLink][buffered_tracks[iLink]] = inTrackStreams[iRegion][iWorker][iTrack];
338 buffered_tracks[iLink] = buffered_tracks[iLink] + 1;
348 for (
int iTrack = 0; iTrack < (
int)outTrackStreams[iRegion][iLink].
size(); iTrack++) {
349 sortedPartialTracks[2 * iRegion + iLink].push_back(
350 outTrackStreams[iRegion][iLink][iTrack]->PartialTrack1());
351 sortedPartialTracks[2 * iRegion + iLink].push_back(
352 outTrackStreams[iRegion][iLink][iTrack]->PartialTrack2());
353 sortedPartialTracks[2 * iRegion + iLink].push_back(
354 outTrackStreams[iRegion][iLink][iTrack]->PartialTrack3());
355 outputStreamsTracks[2 * iRegion + iLink].emplace_back(outTrackStreams[iRegion][iLink][iTrack]->
track());
362 for (
int iLink = 0; iLink < (
int)outputStreamsTracks.size(); iLink++) {
364 int numLinkTracks = (
int)outputStreamsTracks[iLink].
size();
365 if (numLinkTracks == 0)
367 if ((numLinkTracks % 2 != 0)) {
368 sortedPartialTracks[iLink].push_back(nullBitTrack);
369 outputStreamsTracks[iLink].emplace_back(
370 outputStreamsTracks[iLink][numLinkTracks++]);
372 for (
int iTrack = 0; iTrack < (
int)(sortedPartialTracks[iLink].
size()); iTrack++) {
376 for (
auto&
it : ttTrackRefMap) {
377 if (
it.second == outputStreamsTracks[iLink][(
int)(iTrack - 1) / 3].
first)
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<< TTTrack_TrackWord::TrackBitWidths::kMVAQualitySize > getTqMVAPreSigBins()
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 int kTrackWordSize
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)