CMS 3D CMS Logo

Functions
l1t::demo::codecs Namespace Reference

Functions

std::vector< l1t::EtSumdecodeEtSums (const std::vector< ap_uint< 64 >> &)
 
std::vector< l1t::EtSumdecodeHtSums (const std::vector< ap_uint< 64 >> &)
 
std::vector< l1t::TkJetWorddecodeTkJets (const std::vector< ap_uint< 64 >> &)
 
std::vector< TTTrack_TrackWorddecodeTracks (const std::vector< ap_uint< 64 >> &)
 
std::array< std::vector< TTTrack_TrackWord >, 18 > decodeTracks (const std::array< std::vector< ap_uint< 64 >>, 18 > &)
 
std::vector< l1t::VertexWorddecodeVertices (const std::vector< ap_uint< 64 >> &)
 
ap_uint< 64 > encodeEtSum (const l1t::EtSum &v)
 
std::array< std::vector< ap_uint< 64 > >, 1 > encodeEtSums (const edm::View< l1t::EtSum > &)
 
ap_uint< 64 > encodeHtSum (const l1t::EtSum &v)
 
std::array< std::vector< ap_uint< 64 > >, 1 > encodeHtSums (const edm::View< l1t::EtSum > &)
 
size_t encodeLinks (std::array< std::vector< ap_uint< 96 >>, 18 > &trackWords, std::array< std::vector< ap_uint< 64 >>, 18 > &linkData)
 
ap_uint< 64 > encodeTkJet (const l1t::TkJetWord &t)
 
std::array< std::vector< ap_uint< 64 > >, 1 > encodeTkJets (const edm::View< l1t::TkJetWord > &)
 
ap_uint< 96 > encodeTrack (const TTTrack_TrackWord &t)
 
std::array< std::vector< ap_uint< 64 > >, 18 > encodeTracks (const edm::View< TTTrack< Ref_Phase2TrackerDigi_ >> &, int debug=0)
 
std::array< std::vector< ap_uint< 64 > >, 18 > encodeTracks (const edm::Handle< std::vector< TTTrack< Ref_Phase2TrackerDigi_ >>> &, const edm::Handle< edm::RefVector< std::vector< TTTrack< Ref_Phase2TrackerDigi_ >>>> &, int debug=0)
 
ap_uint< 64 > encodeVertex (const l1t::VertexWord &v)
 
std::array< std::vector< ap_uint< 64 > >, 1 > encodeVertices (const edm::View< l1t::VertexWord > &)
 
std::array< std::vector< ap_uint< 96 > >, 18 > getTrackWords (const edm::View< TTTrack< Ref_Phase2TrackerDigi_ >> &)
 
std::array< std::vector< ap_uint< 96 > >, 18 > getTrackWords (const edm::Handle< std::vector< TTTrack< Ref_Phase2TrackerDigi_ >>> &, const edm::Handle< edm::RefVector< std::vector< TTTrack< Ref_Phase2TrackerDigi_ >>>> &)
 
template<typename T >
unsigned int gttLinkID (T track)
 
static std::pair< unsigned int, unsigned int > sectorsEtaPhiFromGTTLinkID (unsigned int id)
 
bool trackInCollection (const edm::Ref< std::vector< TTTrack< Ref_Phase2TrackerDigi_ >>> &, const edm::Handle< edm::RefVector< std::vector< TTTrack< Ref_Phase2TrackerDigi_ >>>> &)
 

Function Documentation

◆ decodeEtSums()

std::vector< l1t::EtSum > l1t::demo::codecs::decodeEtSums ( const std::vector< ap_uint< 64 >> &  frames)

Definition at line 34 of file codecs_etsums.cc.

References l1tmetemu::kMETPhiSize, l1tmetemu::kMETSize, L1Analysis::kMissingEt, alignCSCRings::s, findQualityFiles::v, and x.

34  {
35  std::vector<l1t::EtSum> etSums;
36 
37  for (const auto& x : frames) {
38  if (not x.test(0))
39  break;
40 
41  math::XYZTLorentzVector v(0, 0, 0, 0);
42  l1t::EtSum s(
43  v,
46  0,
48  0);
49  etSums.push_back(s);
50  }
51 
52  return etSums;
53  }
ap_int< kMETPhiSize > METWordphi_t
ap_ufixed< kMETSize, kMETMagSize, AP_RND_CONV, AP_SAT > METWord_t
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
const unsigned int kMETSize
const unsigned int kMETPhiSize
float x

◆ decodeHtSums()

std::vector< l1t::EtSum > l1t::demo::codecs::decodeHtSums ( const std::vector< ap_uint< 64 >> &  frames)

Definition at line 35 of file codecs_htsums.cc.

References l1tmhtemu::kHTLSB, l1tmhtemu::kHTMSB, l1tmhtemu::kMHTLSB, l1tmhtemu::kMHTMSB, l1tmhtemu::kMHTPhiLSB, l1tmhtemu::kMHTPhiMSB, L1Analysis::kMissingHt, alignCSCRings::s, findQualityFiles::v, and x.

35  {
36  std::vector<l1t::EtSum> htSums;
37 
38  for (const auto& x : frames) {
39  if (not x.test(0))
40  break;
41 
43  l1t::EtSum s(v,
46  0,
48  0);
49  htSums.push_back(s);
50  }
51 
52  return htSums;
53  }
ap_uint< kMHTPhiSize > MHTphi_t
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
ap_ufixed< kMHTSize, kMHTIntSize > MHT_t
float x

◆ decodeTkJets()

std::vector< l1t::TkJetWord > l1t::demo::codecs::decodeTkJets ( const std::vector< ap_uint< 64 >> &  frames)

Definition at line 28 of file codecs_tkjets.cc.

References f, dqmiolumiharvest::j, l1tmhtemu::kUnassignedLSB, and l1tmhtemu::kUnassignedMSB.

28  {
29  std::vector<l1t::TkJetWord> tkJets;
30 
31  for (size_t f = 0; f < frames.size(); f += 2) {
32  // There is no valid bit in the definition right now.
33  // Uncomment the next two lines when this is available.
34  //if (not x.test(TkJetWord::kValidLSB))
35  // break;
36 
37  TkJetWord j(
38  TkJetWord::pt_t(frames[f](TkJetWord::TkJetBitLocations::kPtMSB, TkJetWord::TkJetBitLocations::kPtLSB)),
40  frames[f](TkJetWord::TkJetBitLocations::kGlbPhiMSB, TkJetWord::TkJetBitLocations::kGlbPhiLSB)),
42  frames[f](TkJetWord::TkJetBitLocations::kGlbEtaMSB, TkJetWord::TkJetBitLocations::kGlbEtaLSB)),
43  TkJetWord::z0_t(frames[f](TkJetWord::TkJetBitLocations::kZ0MSB, TkJetWord::TkJetBitLocations::kZ0LSB)),
44  TkJetWord::nt_t(frames[f](TkJetWord::TkJetBitLocations::kNtMSB, TkJetWord::TkJetBitLocations::kNtLSB)),
45  TkJetWord::nx_t(frames[f](TkJetWord::TkJetBitLocations::kXtMSB, TkJetWord::TkJetBitLocations::kXtLSB)),
46  TkJetWord::dispflag_t(
47  frames[f](TkJetWord::TkJetBitLocations::kDispFlagMSB, TkJetWord::TkJetBitLocations::kDispFlagLSB)),
48  TkJetWord::tkjetunassigned_t(
50  tkJets.push_back(j);
51  }
52 
53  return tkJets;
54  }
ap_int< 11 > glbphi_t
Definition: datatypes.h:19
double f[11][100]
ap_int< 10 > z0_t
Definition: datatypes.h:21
ap_ufixed< 16, 14 > pt_t
Definition: TauNNIdHW.h:13
ap_int< 12 > glbeta_t
Definition: datatypes.h:18

◆ decodeTracks() [1/2]

std::vector< TTTrack_TrackWord > l1t::demo::codecs::decodeTracks ( const std::vector< ap_uint< 64 >> &  frames)

Definition at line 109 of file codecs_tracks.cc.

References mps_fire::i, TTTrack_TrackWord::kBendChi2LSB, TTTrack_TrackWord::kBendChi2MSB, TTTrack_TrackWord::kChi2RPhiLSB, TTTrack_TrackWord::kChi2RPhiMSB, TTTrack_TrackWord::kChi2RZLSB, TTTrack_TrackWord::kChi2RZMSB, TTTrack_TrackWord::kD0LSB, TTTrack_TrackWord::kD0MSB, TTTrack_TrackWord::kHitPatternLSB, TTTrack_TrackWord::kHitPatternMSB, TTTrack_TrackWord::kMVAOtherLSB, TTTrack_TrackWord::kMVAOtherMSB, TTTrack_TrackWord::kMVAQualityLSB, TTTrack_TrackWord::kMVAQualityMSB, TTTrack_TrackWord::kPhiLSB, TTTrack_TrackWord::kPhiMSB, TTTrack_TrackWord::kRinvLSB, TTTrack_TrackWord::kRinvMSB, TTTrack_TrackWord::kTanlLSB, TTTrack_TrackWord::kTanlMSB, TTTrack_TrackWord::kValidLSB, TTTrack_TrackWord::kValidMSB, TTTrack_TrackWord::kZ0LSB, TTTrack_TrackWord::kZ0MSB, TTTrack_TrackWord::setTrackWord(), and l1t::tracks.

Referenced by decodeTracks().

109  {
110  std::vector<TTTrack_TrackWord> tracks;
111 
112  if ((frames.size() % 3) != 0) {
113  std::stringstream message;
114  message << "The number of track frames (" << frames.size() << ") is not evenly divisible by 3";
115  throw std::runtime_error(message.str());
116  }
117 
118  for (size_t i = 0; i < frames.size(); i += 3) {
119  TTTrack_TrackWord::tkword_t combination1 = (ap_uint<32>(frames.at(i + 1)(31, 0)), frames.at(i)(63, 0));
120  TTTrack_TrackWord::tkword_t combination2 = (frames.at(i + 2)(63, 0), ap_uint<32>(frames.at(i + 1)(63, 32)));
121  TTTrack_TrackWord track1, track2;
122  track1.setTrackWord(
137  track2.setTrackWord(
152  tracks.push_back(track1);
153  tracks.push_back(track2);
154  }
155 
156  return tracks;
157  }
ap_uint< TrackBitWidths::kTrackWordSize > tkword_t
ap_uint< TrackBitWidths::kMVAQualitySize > qualityMVA_t
ap_uint< TrackBitWidths::kZ0Size > z0_t
void setTrackWord(unsigned int valid, const GlobalVector &momentum, const GlobalPoint &POCA, double rInv, double chi2RPhi, double chi2RZ, double bendChi2, unsigned int hitPattern, unsigned int mvaQuality, unsigned int mvaOther, unsigned int sector)
ap_uint< TrackBitWidths::kMVAOtherSize > otherMVA_t
ap_uint< TrackBitWidths::kValidSize > valid_t
ap_uint< TrackBitWidths::kRinvSize > rinv_t
ap_uint< TrackBitWidths::kHitPatternSize > hit_t
ap_uint< TrackBitWidths::kChi2RZSize > chi2rz_t
ap_uint< TrackBitWidths::kTanlSize > tanl_t
ap_uint< TrackBitWidths::kD0Size > d0_t
ap_uint< TrackBitWidths::kChi2RPhiSize > chi2rphi_t
ap_uint< TrackBitWidths::kBendChi2Size > bendChi2_t
ap_uint< TrackBitWidths::kPhiSize > phi_t

◆ decodeTracks() [2/2]

std::array< std::vector< TTTrack_TrackWord >, 18 > l1t::demo::codecs::decodeTracks ( const std::array< std::vector< ap_uint< 64 >>, 18 > &  frames)

Definition at line 160 of file codecs_tracks.cc.

References decodeTracks(), mps_fire::i, and l1t::tracks.

160  {
161  std::array<std::vector<TTTrack_TrackWord>, 18> tracks;
162 
163  for (size_t i = 0; i < tracks.size(); i++) {
164  tracks.at(i) = decodeTracks(frames.at(i));
165  }
166 
167  return tracks;
168  }
std::vector< TTTrack_TrackWord > decodeTracks(const std::vector< ap_uint< 64 >> &)

◆ decodeVertices()

std::vector< l1t::VertexWord > l1t::demo::codecs::decodeVertices ( const std::vector< ap_uint< 64 >> &  frames)

Definition at line 26 of file codecs_vertices.cc.

References l1t::VertexWord::kNTrackInPVLSB, l1t::VertexWord::kNTrackInPVMSB, l1t::VertexWord::kNTrackOutPVLSB, l1t::VertexWord::kNTrackOutPVMSB, l1t::VertexWord::kQualityLSB, l1t::VertexWord::kQualityMSB, l1t::VertexWord::kSumPtLSB, l1t::VertexWord::kSumPtMSB, l1t::VertexWord::kUnassignedLSB, l1t::VertexWord::kUnassignedMSB, l1t::VertexWord::kValidLSB, l1t::VertexWord::kZ0LSB, l1t::VertexWord::kZ0MSB, findQualityFiles::v, AlignmentTracksFromVertexSelector_cfi::vertices, and x.

Referenced by GTTFileReader::produce().

26  {
27  std::vector<l1t::VertexWord> vertices;
28 
29  for (const auto& x : frames) {
30  if (not x.test(VertexWord::kValidLSB))
31  break;
32 
33  VertexWord v(VertexWord::vtxvalid_t(1),
34  VertexWord::vtxz0_t(x(VertexWord::kZ0MSB, VertexWord::kZ0LSB)),
35  VertexWord::vtxmultiplicity_t(x(VertexWord::kNTrackInPVMSB, VertexWord::kNTrackInPVLSB)),
36  VertexWord::vtxsumpt_t(x(VertexWord::kSumPtMSB, VertexWord::kSumPtLSB)),
37  VertexWord::vtxquality_t(x(VertexWord::kQualityMSB, VertexWord::kQualityLSB)),
38  VertexWord::vtxinversemult_t(x(VertexWord::kNTrackOutPVMSB, VertexWord::kNTrackOutPVLSB)),
39  VertexWord::vtxunassigned_t(x(VertexWord::kUnassignedMSB, VertexWord::kUnassignedLSB)));
40  vertices.push_back(v);
41  }
42 
43  return vertices;
44  }
float x

◆ encodeEtSum()

ap_uint< 64 > l1t::demo::codecs::encodeEtSum ( const l1t::EtSum v)

Definition at line 6 of file codecs_etsums.cc.

References l1tmetemu::EtMiss::Et, l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), l1t::L1Candidate::hwQual(), l1tmetemu::kMETPhiSize, l1tmetemu::kMETSize, l1tmetemu::EtMiss::Phi, and validateGeometry_cfg::valid.

Referenced by encodeEtSums().

6  {
7  l1tmetemu::EtMiss etMiss;
8  etMiss.Et.V = etSum.hwPt();
9  etMiss.Phi = etSum.hwPhi();
10  ap_uint<1> valid = (etSum.hwQual() > 0);
11  ap_uint<64 - (l1tmetemu::kMETSize + l1tmetemu::kMETPhiSize + 1)> unassigned = 0;
12  ap_uint<64> etSumWord = (unassigned, etMiss.Phi, etMiss.Et.range(), valid);
13  return etSumWord;
14  }
const unsigned int kMETSize
const unsigned int kMETPhiSize

◆ encodeEtSums()

std::array< std::vector< ap_uint< 64 > >, 1 > l1t::demo::codecs::encodeEtSums ( const edm::View< l1t::EtSum > &  etSums)

Definition at line 17 of file codecs_etsums.cc.

References encodeEtSum(), and mps_fire::i.

Referenced by GTTFileWriter::analyze().

17  {
18  std::vector<ap_uint<64>> etSumWords;
19 
20  for (const auto& etSum : etSums)
21  etSumWords.push_back(encodeEtSum(etSum));
22 
23  std::array<std::vector<ap_uint<64>>, 1> linkData;
24 
25  for (size_t i = 0; i < linkData.size(); i++) {
26  // Pad etsum vectors -> full packet length (48 frames, but only 1 etsum max)
27  etSumWords.resize(1, 0);
28  linkData.at(i) = etSumWords;
29  }
30 
31  return linkData;
32  }
ap_uint< 64 > encodeEtSum(const l1t::EtSum &v)
Definition: codecs_etsums.cc:6

◆ encodeHtSum()

ap_uint< 64 > l1t::demo::codecs::encodeHtSum ( const l1t::EtSum v)

Definition at line 6 of file codecs_htsums.cc.

References l1tmhtemu::EtMiss::Et, tmtt::Utility::HT, l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), l1t::L1Candidate::hwQual(), reco::LeafCandidate::p4(), l1tmhtemu::EtMiss::Phi, and validateGeometry_cfg::valid.

Referenced by encodeHtSums().

6  {
7  l1tmhtemu::EtMiss htMiss;
8  htMiss.Et = htSum.p4().energy();
9  htMiss.Phi = htSum.hwPhi();
10  ap_uint<l1tmhtemu::kMHTSize> HT = htSum.hwPt();
11  ap_uint<l1tmhtemu::kValidSize> valid = (htSum.hwQual() > 0);
12  ap_uint<l1tmhtemu::kUnassignedSize> unassigned = 0;
13  ap_uint<64> htSumWord = (unassigned, HT, htMiss.Phi, htMiss.Et.range(), valid);
14  return htSumWord;
15  }
Definition: HT.h:21

◆ encodeHtSums()

std::array< std::vector< ap_uint< 64 > >, 1 > l1t::demo::codecs::encodeHtSums ( const edm::View< l1t::EtSum > &  htSums)

Definition at line 18 of file codecs_htsums.cc.

References encodeHtSum(), and mps_fire::i.

Referenced by GTTFileWriter::analyze().

18  {
19  std::vector<ap_uint<64>> htSumWords;
20 
21  for (const auto& htSum : htSums)
22  htSumWords.push_back(encodeHtSum(htSum));
23 
24  std::array<std::vector<ap_uint<64>>, 1> linkData;
25 
26  for (size_t i = 0; i < linkData.size(); i++) {
27  // Pad etsum vectors -> full packet length (48 frames, but only 1 htsum max)
28  htSumWords.resize(1, 0);
29  linkData.at(i) = htSumWords;
30  }
31 
32  return linkData;
33  }
ap_uint< 64 > encodeHtSum(const l1t::EtSum &v)
Definition: codecs_htsums.cc:6

◆ encodeLinks()

size_t l1t::demo::codecs::encodeLinks ( std::array< std::vector< ap_uint< 96 >>, 18 > &  trackWords,
std::array< std::vector< ap_uint< 64 >>, 18 > &  linkData 
)

Definition at line 51 of file codecs_tracks.cc.

References counter, mps_fire::i, and dqmiolumiharvest::j.

Referenced by encodeTracks().

52  {
53  size_t counter = 0;
54  for (size_t i = 0; i < linkData.size(); i++) {
55  // Pad track vectors -> full packet length (156 frames = 104 tracks)
56  trackWords.at(i).resize(104, 0);
57  linkData.at(i).resize(156, {0});
58 
59  for (size_t j = 0; (j < trackWords.at(i).size()); j += 2) {
60  linkData.at(i).at(3 * j / 2) = trackWords.at(i).at(j)(63, 0);
61  linkData.at(i).at(3 * j / 2 + 1) =
62  (ap_uint<32>(trackWords.at(i).at(j + 1)(31, 0)), ap_uint<32>(trackWords.at(i).at(j)(95, 64)));
63  linkData.at(i).at(3 * j / 2 + 2) = trackWords.at(i).at(j + 1)(95, 32);
64  counter += trackWords.at(i).at(j)(95, 95) + trackWords.at(i).at(j + 1)(95, 95);
65  }
66  }
67  return counter;
68  }
static std::atomic< unsigned int > counter

◆ encodeTkJet()

ap_uint< 64 > l1t::demo::codecs::encodeTkJet ( const l1t::TkJetWord t)

Definition at line 6 of file codecs_tkjets.cc.

References dqmiolumiharvest::j.

Referenced by encodeTkJets().

6 { return j.tkJetWord(); }

◆ encodeTkJets()

std::array< std::vector< ap_uint< 64 > >, 1 > l1t::demo::codecs::encodeTkJets ( const edm::View< l1t::TkJetWord > &  tkJets)

Definition at line 9 of file codecs_tkjets.cc.

References encodeTkJet(), and mps_fire::i.

Referenced by GTTFileWriter::analyze().

9  {
10  std::vector<ap_uint<64>> tkJetWords;
11 
12  for (const auto& tkJet : tkJets) {
13  tkJetWords.push_back(encodeTkJet(tkJet));
14  tkJetWords.push_back(ap_uint<64>(0));
15  }
16 
17  std::array<std::vector<ap_uint<64>>, 1> linkData;
18 
19  for (size_t i = 0; i < linkData.size(); i++) {
20  // Pad TkJet vectors -> full packet length (48 frames, but only 12 TkJets max, two words per jet)
21  tkJetWords.resize(24, 0);
22  linkData.at(i) = tkJetWords;
23  }
24 
25  return linkData;
26  }
ap_uint< 64 > encodeTkJet(const l1t::TkJetWord &t)
Definition: codecs_tkjets.cc:6

◆ encodeTrack()

ap_uint< 96 > l1t::demo::codecs::encodeTrack ( const TTTrack_TrackWord t)

Definition at line 21 of file codecs_tracks.cc.

References submitPVValidationJobs::t.

Referenced by getTrackWords().

21 { return t.getTrackWord(); }

◆ encodeTracks() [1/2]

std::array< std::vector< ap_uint< 64 > >, 18 > l1t::demo::codecs::encodeTracks ( const edm::View< TTTrack< Ref_Phase2TrackerDigi_ >> &  tracks,
int  debug = 0 
)

Definition at line 71 of file codecs_tracks.cc.

References debug, encodeLinks(), getTrackWords(), and l1t::tracks.

Referenced by GTTFileWriter::analyze().

72  {
73  if (debug > 0) {
74  edm::LogInfo("l1t::demo::codecs") << "encodeTrack::Encoding " << tracks.size() << " tracks";
75  }
76 
77  std::array<std::vector<ap_uint<96>>, 18> trackWords = getTrackWords(tracks);
78  std::array<std::vector<ap_uint<64>>, 18> linkData;
79  size_t counter = encodeLinks(trackWords, linkData);
80 
81  if (debug > 0) {
82  edm::LogInfo("l1t::demo::codecs") << "encodeTrack::Encoded " << counter << " tracks";
83  }
84 
85  return linkData;
86  }
size_t encodeLinks(std::array< std::vector< ap_uint< 96 >>, 18 > &trackWords, std::array< std::vector< ap_uint< 64 >>, 18 > &linkData)
Log< level::Info, false > LogInfo
#define debug
Definition: HDRShower.cc:19
std::array< std::vector< ap_uint< 96 > >, 18 > getTrackWords(const edm::View< TTTrack< Ref_Phase2TrackerDigi_ >> &)

◆ encodeTracks() [2/2]

std::array< std::vector< ap_uint< 64 > >, 18 > l1t::demo::codecs::encodeTracks ( const edm::Handle< std::vector< TTTrack< Ref_Phase2TrackerDigi_ >>> &  referenceTracks,
const edm::Handle< edm::RefVector< std::vector< TTTrack< Ref_Phase2TrackerDigi_ >>>> &  tracks,
int  debug = 0 
)

Definition at line 90 of file codecs_tracks.cc.

References debug, encodeLinks(), getTrackWords(), and l1t::tracks.

93  {
94  if (debug > 0) {
95  edm::LogInfo("l1t::demo::codecs") << "encodeTrack::Encoding " << tracks->size() << " tracks";
96  }
97 
98  std::array<std::vector<ap_uint<96>>, 18> trackWords = getTrackWords(referenceTracks, tracks);
99  std::array<std::vector<ap_uint<64>>, 18> linkData;
100  size_t counter = encodeLinks(trackWords, linkData);
101 
102  if (debug > 0) {
103  edm::LogInfo("l1t::demo::codecs") << "encodeTrack::Encoded " << counter << " tracks";
104  }
105 
106  return linkData;
107  }
size_t encodeLinks(std::array< std::vector< ap_uint< 96 >>, 18 > &trackWords, std::array< std::vector< ap_uint< 64 >>, 18 > &linkData)
Log< level::Info, false > LogInfo
#define debug
Definition: HDRShower.cc:19
std::array< std::vector< ap_uint< 96 > >, 18 > getTrackWords(const edm::View< TTTrack< Ref_Phase2TrackerDigi_ >> &)

◆ encodeVertex()

ap_uint< 64 > l1t::demo::codecs::encodeVertex ( const l1t::VertexWord v)

Definition at line 6 of file codecs_vertices.cc.

References findQualityFiles::v.

Referenced by encodeVertices().

6 { return v.vertexWord(); }

◆ encodeVertices()

std::array< std::vector< ap_uint< 64 > >, 1 > l1t::demo::codecs::encodeVertices ( const edm::View< l1t::VertexWord > &  vertices)

Definition at line 9 of file codecs_vertices.cc.

References encodeVertex(), mps_fire::i, bphysicsOniaDQM_cfi::vertex, and AlignmentTracksFromVertexSelector_cfi::vertices.

Referenced by GTTFileWriter::analyze().

9  {
10  std::vector<ap_uint<64>> vertexWords;
11 
12  for (const auto& vertex : vertices)
13  vertexWords.push_back(encodeVertex(vertex));
14 
15  std::array<std::vector<ap_uint<64>>, 1> linkData;
16 
17  for (size_t i = 0; i < linkData.size(); i++) {
18  // Pad vertex vectors -> full packet length (48 frames, but only 10 vertices max)
19  vertexWords.resize(10, 0);
20  linkData.at(i) = vertexWords;
21  }
22 
23  return linkData;
24  }
ap_uint< 64 > encodeVertex(const l1t::VertexWord &v)

◆ getTrackWords() [1/2]

std::array< std::vector< ap_uint< 96 > >, 18 > l1t::demo::codecs::getTrackWords ( const edm::View< TTTrack< Ref_Phase2TrackerDigi_ >> &  tracks)

Definition at line 24 of file codecs_tracks.cc.

References encodeTrack(), gttLinkID(), HLT_2024v10_cff::track, and l1t::tracks.

Referenced by encodeTracks().

24  {
25  std::array<std::vector<ap_uint<96>>, 18> trackWords;
26  for (const auto& track : tracks) {
27  trackWords.at(gttLinkID(track)).push_back(encodeTrack(track));
28  }
29  return trackWords;
30  }
ap_uint< 96 > encodeTrack(const TTTrack_TrackWord &t)
unsigned int gttLinkID(T track)
Definition: tracks.h:20

◆ getTrackWords() [2/2]

std::array< std::vector< ap_uint< 96 > >, 18 > l1t::demo::codecs::getTrackWords ( const edm::Handle< std::vector< TTTrack< Ref_Phase2TrackerDigi_ >>> &  referenceTracks,
const edm::Handle< edm::RefVector< std::vector< TTTrack< Ref_Phase2TrackerDigi_ >>>> &  tracks 
)

Definition at line 33 of file codecs_tracks.cc.

References encodeTrack(), gttLinkID(), BTVHLTOfflineSource_cfi::referenceTrack, trackInCollection(), and l1t::tracks.

35  {
36  std::array<std::vector<ap_uint<96>>, 18> trackWords;
37  for (unsigned int itrack = 0; itrack < referenceTracks->size(); itrack++) {
38  const auto& referenceTrack = referenceTracks->at(itrack);
39  edm::Ref<std::vector<TTTrack<Ref_Phase2TrackerDigi_>>> referenceTrackRef(referenceTracks, itrack);
40 
41  if (trackInCollection(referenceTrackRef, tracks)) {
42  trackWords.at(gttLinkID(referenceTrack)).push_back(encodeTrack(referenceTrack));
43  } else {
44  trackWords.at(gttLinkID(referenceTrack)).push_back(ap_uint<96>(0));
45  }
46  }
47  return trackWords;
48  }
ap_uint< 96 > encodeTrack(const TTTrack_TrackWord &t)
unsigned int gttLinkID(T track)
Definition: tracks.h:20
bool trackInCollection(const edm::Ref< std::vector< TTTrack< Ref_Phase2TrackerDigi_ >>> &, const edm::Handle< edm::RefVector< std::vector< TTTrack< Ref_Phase2TrackerDigi_ >>>> &)
Definition: codecs_tracks.cc:7

◆ gttLinkID()

template<typename T >
unsigned int l1t::demo::codecs::gttLinkID ( T  track)

Definition at line 20 of file tracks.h.

References HLT_2024v10_cff::track.

Referenced by getTrackWords(), and L1TrackVertexAssociationProducer::TTTrackWordLinkLimitSelector::operator()().

20  {
21  // use the sign bit of the tanL word to remove dependence on TTTrack eta member.
22  unsigned int etaSector = (track.getTrackWord()(TTTrack_TrackWord::TrackBitLocations::kTanlMSB,
23  TTTrack_TrackWord::TrackBitLocations::kTanlMSB)
24  ? 0
25  : 1);
26  return etaSector + (2 * track.phiSector());
27  }

◆ sectorsEtaPhiFromGTTLinkID()

static std::pair<unsigned int, unsigned int> l1t::demo::codecs::sectorsEtaPhiFromGTTLinkID ( unsigned int  id)
inlinestatic

Definition at line 29 of file tracks.h.

References l1ctLayer2EG_cff::id.

29  {
30  unsigned int etaSector = (id % 2);
31  unsigned int phiSector = (static_cast<unsigned int>(id) - etaSector) / 2;
32  return std::pair<unsigned int, unsigned int>(etaSector, phiSector);
33  }

◆ trackInCollection()

bool l1t::demo::codecs::trackInCollection ( const edm::Ref< std::vector< TTTrack< Ref_Phase2TrackerDigi_ >>> &  trackRef,
const edm::Handle< edm::RefVector< std::vector< TTTrack< Ref_Phase2TrackerDigi_ >>>> &  trackRefCollection 
)

Definition at line 7 of file codecs_tracks.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and getGTfromDQMFile::obj.

Referenced by getTrackWords().

9  {
10  auto it = std::find_if(
11  trackRefCollection->begin(),
12  trackRefCollection->end(),
13  [&trackRef](edm::Ref<std::vector<TTTrack<Ref_Phase2TrackerDigi_>>> const& obj) { return obj == trackRef; });
14  if (it != trackRefCollection->end())
15  return true;
16  else
17  return false;
18  }