84 for (
unsigned int i = 0;
i <
bins.size() - 1;
i++) {
93 ProducerKFout::ProducerKFout(
const ParameterSet& iConfig) : iConfig_(iConfig) {
94 const string& labelKF = iConfig.
getParameter<
string>(
"LabelKF");
95 const string& branchStubs = iConfig.
getParameter<
string>(
"BranchAcceptedStubs");
96 const string& branchTracks = iConfig.
getParameter<
string>(
"BranchAcceptedTracks");
97 const string& branchTTTracks = iConfig.
getParameter<
string>(
"BranchAcceptedTTTracks");
98 const string& branchLost = iConfig.
getParameter<
string>(
"BranchLostTracks");
130 float temp_dphi = 0.0;
138 temp_dphi = std::floor(temp_dphi);
170 float tempTQMVAPreSig = 0.0;
172 std::vector<ap_fixed<10, 5>> trackQuality_inputs = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
179 return sum + (
frame.first.isNonnull() ? 1 : 0);
182 for (
int iLink = 0; iLink < (
int)streamsTracks.size(); iLink++) {
183 for (
int iTrack = 0; iTrack < (
int)streamsTracks[iLink].size(); iTrack++) {
184 const auto&
track = streamsTracks[iLink].at(iTrack);
194 double tempchi2rphi = 0;
195 double tempchi2rz = 0;
197 int temp_ninterior = 0;
200 vector<StubKF>
stubs;
203 const auto& stub = streamsStubs[
setup_->
numLayers() * iLink + iStub].at(iTrack);
205 if (stub.first.isNonnull())
208 if (!stub.first.isNonnull()) {
218 double phiSquared =
pow(inStub.
phi(), 2);
219 double zSquared =
pow(inStub.
z(), 2);
226 double tempRphi = phiSquared * tempv0;
227 double tempRz = zSquared * tempv1;
229 tempchi2rphi += tempRphi;
230 tempchi2rz += tempRz;
236 TTBV extraMVA(0, TTTrack_TrackWord::TrackBitWidths::kMVAOtherSize,
false);
237 TTBV bendChi2(0, TTTrack_TrackWord::TrackBitWidths::kBendChi2Size,
false);
239 TTTrack_TrackWord::TrackBitWidths::kChi2RPhiSize,
242 TTTrack_TrackWord::TrackBitWidths::kChi2RZSize,
244 TTBV d0(0, TTTrack_TrackWord::TrackBitWidths::kD0Size,
false);
246 temp_z0,
dataFormats_->
base(Variable::zT, Process::kf), TTTrack_TrackWord::TrackBitWidths::kZ0Size,
true);
249 TTTrack_TrackWord::TrackBitWidths::kTanlSize,
253 TTTrack_TrackWord::TrackBitWidths::kPhiSize,
257 TTTrack_TrackWord::TrackBitWidths::kRinvSize + 1,
259 invR.
resize(TTTrack_TrackWord::TrackBitWidths::kRinvSize);
267 trackQuality_inputs = {
280 TTTrack_TrackWord::TrackBitWidths::kMVAQualitySize,
303 KFoutTracks.push_back(std::make_shared<TrackKFOut>(temp_track));
308 ttTracks.emplace_back(temp_tttrack);
315 struct kfoTrack_info {
320 vector<kfoTrack_info>(0));
321 for (
int i = 0;
i < (
int)KFoutTracks.size();
i++) {
322 auto& kfoTrack = KFoutTracks.at(
i);
323 if (kfoTrack->dataValid()) {
324 sortedPartialTracks[kfoTrack->nonantId() *
setup_->
tfpNumChannel() + kfoTrack->sortKey()].push_back(
325 {kfoTrack->PartialTrack1(),
TTTrackRef(orphanHandleTTTracks,
i)});
326 sortedPartialTracks[kfoTrack->nonantId() *
setup_->
tfpNumChannel() + kfoTrack->sortKey()].push_back(
327 {kfoTrack->PartialTrack2(),
TTTrackRef(orphanHandleTTTracks,
i)});
328 sortedPartialTracks[kfoTrack->nonantId() *
setup_->
tfpNumChannel() + kfoTrack->sortKey()].push_back(
329 {kfoTrack->PartialTrack3(),
TTTrackRef(orphanHandleTTTracks,
i)});
333 kfoTrack_info nullTrack_info;
334 for (
int i = 0;
i < (
int)sortedPartialTracks.size();
i++) {
337 sortedPartialTracks.at(
i).push_back(nullTrack_info);
348 for (
int iLink = 0; iLink < (
int)sortedPartialTracks.size(); iLink++) {
349 for (
int iTrack = 0; iTrack < (
int)sortedPartialTracks[iLink].size(); iTrack += partialFactor) {
351 if (iTrack + 1 == (
int)sortedPartialTracks[iLink].size())
352 sortedPartialTracks[iLink].
push_back({nullPartialBits, nullTrackRef});
356 fillTrackRef = sortedPartialTracks[iLink][iTrack + 1].trackRef;
359 if (iTrack / partialFactor < setup_->numFramesIO())
360 accepted[iLink].emplace_back(
361 std::make_pair(fillTrackRef,
366 lost[iLink].emplace_back(
367 std::make_pair(fillTrackRef,
EDPutTokenT< StreamsTrack > edPutTokenAccepted_
constexpr int32_t ceil(float num)
EDPutTokenT< TTTracks > edPutTokenTTTracks_
static constexpr std::array< double, 1<< TTTrack_TrackWord::TrackBitWidths::kMVAQualitySize > getTqMVAPreSigBins()
static constexpr std::array< double, 1<< TrackBitWidths::kChi2RPhiSize > chi2RPhiBins
T getParameter(std::string const &) const
TTTrack< Ref_Phase2TrackerDigi_ > ttTrack(const std::vector< StubKF > &stubs) const
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
std::vector< StreamTrack > StreamsTrack
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
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_
Class to process and provide run-time constants used by Track Trigger emulators.
std::vector< StreamStub > StreamsStub
int tfpNumChannel() const
T const * product() const
int partialTrackWordBits_
ESGetToken< DataFormats, DataFormatsRcd > esGetTokenDataFormats_
static constexpr std::array< double, 1<< TrackBitWidths::kBendChi2Size > bendChi2Bins
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
std::vector< FrameTrack > StreamTrack
std::unique_ptr< L1TrackQuality > trackQualityModel_
std::pair< TTTrackRef, Frame > FrameTrack
int numSectorsEta() const
void settrkMVA1(double atrkMVA1)
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
#define DEFINE_FWK_MODULE(type)
ProcessHistory const & processHistory() const
void beginRun(const Run &, const EventSetup &) override
int weightBinFraction() const
double hybridChosenRofPhi() const
std::vector< TrackKFOutSAPtr > TrackKFOutSAPtrCollection
void checkHistory(const edm::ProcessHistory &processHistory) const
static constexpr float d0
void produce(Event &, const EventSetup &) override
Class to store the L1 Track Trigger tracks.
static constexpr int kTrackWordSize
~ProducerKFout() override
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
static constexpr std::array< double, 1<< TrackBitWidths::kChi2RZSize > chi2RZBins
std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > TTTracks
Converts KF output into tttrack collection and TFP output A bit accurate emulation of the track trans...
const DataFormats * dataFormats_
EDGetTokenT< StreamsTrack > edGetTokenTracks_
void setTrackWordBits()
Set bits in 96-bit Track word.
Power< A, B >::type pow(const A &a, const B &b)
int dphiTruncation() const
unsigned int digitise(const T &bins, double value, double factor)