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_ >>>> &)
 
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(v,
45  0,
47  0);
48  etSums.push_back(s);
49  }
50 
51  return etSums;
52  }
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:28
double f[11][100]
ap_int< 10 > z0_t
Definition: datatypes.h:30
ap_ufixed< 16, 14 > pt_t
Definition: TauNNIdHW.h:27
ap_int< 12 > glbeta_t
Definition: datatypes.h:27

◆ decodeTracks() [1/2]

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

Definition at line 110 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().

110  {
111  std::vector<TTTrack_TrackWord> tracks;
112 
113  if ((frames.size() % 3) != 0) {
114  std::stringstream message;
115  message << "The number of track frames (" << frames.size() << ") is not evenly divisible by 3";
116  throw std::runtime_error(message.str());
117  }
118 
119  for (size_t i = 0; i < frames.size(); i += 3) {
120  TTTrack_TrackWord::tkword_t combination1 = (ap_uint<32>(frames.at(i + 1)(31, 0)), frames.at(i)(63, 0));
121  TTTrack_TrackWord::tkword_t combination2 = (frames.at(i + 2)(63, 0), ap_uint<32>(frames.at(i + 1)(63, 32)));
122  TTTrack_TrackWord track1, track2;
123  track1.setTrackWord(
138  track2.setTrackWord(
153  tracks.push_back(track1);
154  tracks.push_back(track2);
155  }
156 
157  return tracks;
158  }
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 161 of file codecs_tracks.cc.

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

161  {
162  std::array<std::vector<TTTrack_TrackWord>, 18> tracks;
163 
164  for (size_t i = 0; i < tracks.size(); i++) {
165  tracks.at(i) = decodeTracks(frames.at(i));
166  }
167 
168  return tracks;
169  }
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 52 of file codecs_tracks.cc.

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

Referenced by encodeTracks().

53  {
54  size_t counter = 0;
55  for (size_t i = 0; i < linkData.size(); i++) {
56  // Pad track vectors -> full packet length (156 frames = 104 tracks)
57  trackWords.at(i).resize(104, 0);
58  linkData.at(i).resize(156, {0});
59 
60  for (size_t j = 0; (j < trackWords.at(i).size()); j += 2) {
61  linkData.at(i).at(3 * j / 2) = trackWords.at(i).at(j)(63, 0);
62  linkData.at(i).at(3 * j / 2 + 1) =
63  (ap_uint<32>(trackWords.at(i).at(j + 1)(31, 0)), ap_uint<32>(trackWords.at(i).at(j)(95, 64)));
64  linkData.at(i).at(3 * j / 2 + 2) = trackWords.at(i).at(j + 1)(95, 32);
65  counter += trackWords.at(i).at(j)(95, 95) + trackWords.at(i).at(j + 1)(95, 95);
66  }
67  }
68  return counter;
69  }
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 72 of file codecs_tracks.cc.

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

Referenced by GTTFileWriter::analyze().

73  {
74  if (debug > 0) {
75  edm::LogInfo("l1t::demo::codecs") << "encodeTrack::Encoding " << tracks.size() << " tracks";
76  }
77 
78  std::array<std::vector<ap_uint<96>>, 18> trackWords = getTrackWords(tracks);
79  std::array<std::vector<ap_uint<64>>, 18> linkData;
80  size_t counter = encodeLinks(trackWords, linkData);
81 
82  if (debug > 0) {
83  edm::LogInfo("l1t::demo::codecs") << "encodeTrack::Encoded " << counter << " tracks";
84  }
85 
86  return linkData;
87  }
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 91 of file codecs_tracks.cc.

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

94  {
95  if (debug > 0) {
96  edm::LogInfo("l1t::demo::codecs") << "encodeTrack::Encoding " << tracks->size() << " tracks";
97  }
98 
99  std::array<std::vector<ap_uint<96>>, 18> trackWords = getTrackWords(referenceTracks, tracks);
100  std::array<std::vector<ap_uint<64>>, 18> linkData;
101  size_t counter = encodeLinks(trackWords, linkData);
102 
103  if (debug > 0) {
104  edm::LogInfo("l1t::demo::codecs") << "encodeTrack::Encoded " << counter << " tracks";
105  }
106 
107  return linkData;
108  }
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(), HLT_2023v12_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((track.eta() >= 0 ? 1 : 0) + (2 * track.phiSector())).push_back(encodeTrack(track));
28  }
29  return trackWords;
30  }
ap_uint< 96 > encodeTrack(const TTTrack_TrackWord &t)

◆ 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(), 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((referenceTrack.eta() >= 0 ? 1 : 0) + (2 * referenceTrack.phiSector()))
43  .push_back(encodeTrack(referenceTrack));
44  } else {
45  trackWords.at((referenceTrack.eta() >= 0 ? 1 : 0) + (2 * referenceTrack.phiSector())).push_back(ap_uint<96>(0));
46  }
47  }
48  return trackWords;
49  }
ap_uint< 96 > encodeTrack(const TTTrack_TrackWord &t)
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

◆ 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 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  }