CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
Phase2L1GMT::TrackConverter Class Reference

#include <TrackConverter.h>

Public Member Functions

std::vector< ConvertedTTTrackconvertTracks (const std::vector< edm::Ptr< l1t::TrackerMuon::L1TTTrackType > > &tracks)
 
 TrackConverter (const edm::ParameterSet &iConfig)
 
 ~TrackConverter ()
 

Private Types

typedef ap_uint< 96 > wordtype
 

Private Member Functions

ConvertedTTTrack convert (const edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > &track)
 
uint etaLookup (uint absTanL)
 
uint generateQuality (const edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > &track)
 
uint ptLookup (uint absCurv)
 

Private Attributes

int verbose_
 

Detailed Description

Definition at line 11 of file TrackConverter.h.

Member Typedef Documentation

◆ wordtype

typedef ap_uint<96> Phase2L1GMT::TrackConverter::wordtype
private

Definition at line 26 of file TrackConverter.h.

Constructor & Destructor Documentation

◆ TrackConverter()

Phase2L1GMT::TrackConverter::TrackConverter ( const edm::ParameterSet iConfig)
inline

Definition at line 13 of file TrackConverter.h.

13 : verbose_(iConfig.getParameter<int>("verbose")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

◆ ~TrackConverter()

Phase2L1GMT::TrackConverter::~TrackConverter ( )
inline

Definition at line 14 of file TrackConverter.h.

14 {}

Member Function Documentation

◆ convert()

ConvertedTTTrack Phase2L1GMT::TrackConverter::convert ( const edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > &  track)
inlineprivate

Definition at line 54 of file TrackConverter.h.

References Phase2L1GMT::BITSD0, Phase2L1GMT::BITSPHI, Phase2L1GMT::BITSTTCURV, Phase2L1GMT::BITSTTPHI, Phase2L1GMT::BITSTTTANL, Phase2L1GMT::BITSZ0, ALCARECOTkAlJpsiMuMu_cff::charge, PixelRecoUtilities::curvature(), d0, PVValHelper::eta, etaLookup(), Phase2L1GMT::etaLUT, generateQuality(), M_PI, Phase2L1GMT::maxCurv_, Phase2L1GMT::maxD0_, Phase2L1GMT::maxTanl_, Phase2L1GMT::maxZ0_, DiDispStaMuonMonitor_cfi::pt, ptLookup(), Phase2L1GMT::ptLUT, quality, Phase2L1GMT::ConvertedTTTrack::setOfflineQuantities(), HLT_2024v12_cff::track, parallelization::uint, and verbose_.

Referenced by convertTracks().

54  {
55  uint charge = (track->rInv() < 0) ? 1 : 0;
56  int curvature = track->rInv() * (1 << (BITSTTCURV - 1)) / maxCurv_;
57  int phi = track->phi() * (1 << (BITSPHI - 1)) / (M_PI);
58  int tanLambda = track->tanL() * (1 << (BITSTTTANL - 1)) / maxTanl_;
59  int z0 = track->z0() * (1 << (BITSZ0 - 1)) / maxZ0_;
60  int d0 = track->d0() * (1 << (BITSD0 - 1)) / maxD0_;
61  //calculate pt
62  uint absCurv = curvature > 0 ? (curvature) : (-curvature);
63  uint pt = ptLUT[ptLookup(absCurv)];
65  uint absTanL = tanLambda > 0 ? (tanLambda) : (-tanLambda);
66  uint absEta = etaLUT[etaLookup(absTanL)];
67  int eta = tanLambda > 0 ? (absEta) : (-absEta);
68 
69  ap_int<BITSPHI> phiSec = ap_int<BITSPHI>(phi) -
70  ap_int<BITSPHI>((track->phiSector() * 40 * M_PI / 180.) * (1 << (BITSPHI - 1)) / (M_PI));
71  ap_int<BITSPHI> phiCorrected = ap_int<BITSPHI>(phiSec + track->phiSector() * 910);
72 
73  wordtype word = 0;
74  int bstart = 0;
75  bstart = wordconcat<wordtype>(word, bstart, curvature, BITSTTCURV);
76  bstart = wordconcat<wordtype>(word, bstart, phiSec, BITSTTPHI);
77  bstart = wordconcat<wordtype>(word, bstart, tanLambda, BITSTTTANL);
78  bstart = wordconcat<wordtype>(word, bstart, z0, BITSZ0);
79  bstart = wordconcat<wordtype>(word, bstart, d0, BITSD0);
80  bstart = wordconcat<wordtype>(word, bstart, uint(track->chi2()), 4);
81 
82  ConvertedTTTrack convertedTrack(charge, curvature, absEta, pt, eta, phiCorrected.to_int(), z0, d0, quality, word);
83  convertedTrack.setOfflineQuantities(track->momentum().transverse(), track->eta(), track->phi());
84  if (verbose_)
85  convertedTrack.print();
86  convertedTrack.setTrkPtr(track);
87  return convertedTrack;
88  }
const float maxZ0_
Definition: Constants.h:81
const int BITSZ0
Definition: Constants.h:27
const float maxD0_
Definition: Constants.h:82
T curvature(T InversePt, const MagneticField &field)
const int BITSTTPHI
Definition: Constants.h:12
string quality
uint64_t word
const float maxCurv_
Definition: Constants.h:78
uint etaLookup(uint absTanL)
const int BITSPHI
Definition: Constants.h:25
const int BITSD0
Definition: Constants.h:28
const int BITSTTCURV
Definition: Constants.h:10
uint ptLookup(uint absCurv)
#define M_PI
const float maxTanl_
Definition: Constants.h:80
static constexpr float d0
const ap_uint< BITSPT > ptLUT[1858]
Definition: Constants.h:18
const int BITSTTTANL
Definition: Constants.h:13
uint generateQuality(const edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > &track)
const uint etaLUT[4082]
Definition: Constants.h:121

◆ convertTracks()

std::vector<ConvertedTTTrack> Phase2L1GMT::TrackConverter::convertTracks ( const std::vector< edm::Ptr< l1t::TrackerMuon::L1TTTrackType > > &  tracks)
inline

Definition at line 16 of file TrackConverter.h.

References convert(), MillePedeFileConverter_cfg::out, submitPVValidationJobs::t, and DiMuonV_cfg::tracks.

16  {
17  std::vector<ConvertedTTTrack> out;
18  out.reserve(tracks.size());
19  for (const auto& t : tracks)
20  out.push_back(convert(t));
21  return out;
22  }
ConvertedTTTrack convert(const edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > &track)

◆ etaLookup()

uint Phase2L1GMT::TrackConverter::etaLookup ( uint  absTanL)
inlineprivate

Definition at line 42 of file TrackConverter.h.

References Phase2L1GMT::etaShifts, mps_fire::i, and parallelization::uint.

Referenced by convert().

42  {
43  for (auto i : etaShifts) {
44  if (absTanL >= uint(i[0]) && absTanL < uint(i[1])) {
45  if (i[2] < 0)
46  return i[4];
47  else
48  return (absTanL >> i[2]) + i[3];
49  }
50  }
51  return 0;
52  }
const int etaShifts[4][5]
Definition: Constants.h:118

◆ generateQuality()

uint Phase2L1GMT::TrackConverter::generateQuality ( const edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > &  track)
inlineprivate

Definition at line 28 of file TrackConverter.h.

Referenced by convert().

28 { return 1; }

◆ ptLookup()

uint Phase2L1GMT::TrackConverter::ptLookup ( uint  absCurv)
inlineprivate

Definition at line 30 of file TrackConverter.h.

References mps_fire::i, Phase2L1GMT::ptShifts, and parallelization::uint.

Referenced by convert().

30  {
31  for (auto i : ptShifts) {
32  if (absCurv >= uint(i[0]) && absCurv < uint(i[1])) {
33  if (i[2] < 0)
34  return i[4];
35  else
36  return (absCurv >> i[2]) + i[3];
37  }
38  }
39  return 0;
40  }
const int ptShifts[9][5]
Definition: Constants.h:8

Member Data Documentation

◆ verbose_

int Phase2L1GMT::TrackConverter::verbose_
private

Definition at line 25 of file TrackConverter.h.

Referenced by convert().