CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1TkEtMissEmuTrackTransform Class Reference

#include <L1TkEtMissEmuTrackTransform.h>

Public Member Functions

l1tmetemu::nstub_t countNStub (TTTrack_TrackWord::hit_t Hitpattern)
 
void generateLUTs ()
 
std::vector< l1tmetemu::global_phi_tgeneratePhiSliceLUT (unsigned int N)
 
std::vector< l1tmetemu::global_phi_tgetPhiQuad () const
 
std::vector< l1tmetemu::global_phi_tgetPhiShift () const
 
 L1TkEtMissEmuTrackTransform ()=default
 
l1tmetemu::global_phi_t localToGlobalPhi (TTTrack_TrackWord::phi_t local_phi, l1tmetemu::global_phi_t sector_shift)
 
void setGTTinput (bool input)
 
template<class track , class vertex >
InternalEtWord transformTrack (track &track_ref, vertex &PV)
 
 ~L1TkEtMissEmuTrackTransform ()=default
 

Private Attributes

bool GTTinput_ = false
 
std::vector< l1tmetemu::global_phi_tphiQuadrants
 
std::vector< l1tmetemu::global_phi_tphiShift
 

Detailed Description

Definition at line 41 of file L1TkEtMissEmuTrackTransform.h.

Constructor & Destructor Documentation

◆ L1TkEtMissEmuTrackTransform()

L1TkEtMissEmuTrackTransform::L1TkEtMissEmuTrackTransform ( )
default

◆ ~L1TkEtMissEmuTrackTransform()

L1TkEtMissEmuTrackTransform::~L1TkEtMissEmuTrackTransform ( )
default

Member Function Documentation

◆ countNStub()

nstub_t L1TkEtMissEmuTrackTransform::countNStub ( TTTrack_TrackWord::hit_t  Hitpattern)

Definition at line 34 of file L1TkEtMissEmuTrackTransform.cc.

References mps_fire::i, dqmdumpme::k, and TTTrack_TrackWord::kHitPatternSize.

Referenced by transformTrack().

34  {
35  nstub_t Nstub = 0;
36  for (int i = (TTTrack_TrackWord::kHitPatternSize - 1); i >= 0; i--) {
37  int k = Hitpattern >> i;
38  if (k & 1)
39  Nstub++;
40  }
41  return Nstub;
42 }
ap_uint< 3 > nstub_t

◆ generateLUTs()

void L1TkEtMissEmuTrackTransform::generateLUTs ( )

Definition at line 7 of file L1TkEtMissEmuTrackTransform.cc.

References l1tmetemu::kNQuadrants, and l1tmetemu::kNSector.

Referenced by L1TrackerEtMissEmulatorProducer::L1TrackerEtMissEmulatorProducer().

7  {
10 }
std::vector< l1tmetemu::global_phi_t > generatePhiSliceLUT(unsigned int N)
const unsigned int kNQuadrants
const unsigned int kNSector
std::vector< l1tmetemu::global_phi_t > phiQuadrants
std::vector< l1tmetemu::global_phi_t > phiShift

◆ generatePhiSliceLUT()

std::vector< global_phi_t > L1TkEtMissEmuTrackTransform::generatePhiSliceLUT ( unsigned int  N)

Definition at line 44 of file L1TkEtMissEmuTrackTransform.cc.

References l1tmetemu::kStepPhi, M_PI, N, and submitPVResolutionJobs::q.

44  {
45  float sliceCentre = 0.0;
46  std::vector<global_phi_t> phiLUT;
47  for (unsigned int q = 0; q <= N; q++) {
48  phiLUT.push_back((global_phi_t)(sliceCentre / l1tmetemu::kStepPhi));
49  sliceCentre += 2 * M_PI / N;
50  }
51  return phiLUT;
52 }
#define M_PI
ap_uint< kInternalPhiWidth+kGlobalPhiExtra > global_phi_t
#define N
Definition: blowfish.cc:9
const double kStepPhi

◆ getPhiQuad()

std::vector<l1tmetemu::global_phi_t> L1TkEtMissEmuTrackTransform::getPhiQuad ( ) const
inline

Definition at line 60 of file L1TkEtMissEmuTrackTransform.h.

References phiQuadrants.

Referenced by L1TrackerEtMissEmulatorProducer::L1TrackerEtMissEmulatorProducer().

60 { return phiQuadrants; }
std::vector< l1tmetemu::global_phi_t > phiQuadrants

◆ getPhiShift()

std::vector<l1tmetemu::global_phi_t> L1TkEtMissEmuTrackTransform::getPhiShift ( ) const
inline

Definition at line 61 of file L1TkEtMissEmuTrackTransform.h.

References phiShift.

Referenced by L1TrackerEtMissEmulatorProducer::L1TrackerEtMissEmulatorProducer().

61 { return phiShift; }
std::vector< l1tmetemu::global_phi_t > phiShift

◆ localToGlobalPhi()

global_phi_t L1TkEtMissEmuTrackTransform::localToGlobalPhi ( TTTrack_TrackWord::phi_t  local_phi,
l1tmetemu::global_phi_t  sector_shift 
)

Definition at line 12 of file L1TkEtMissEmuTrackTransform.cc.

References l1tmetemu::kInternalPhiWidth, MonitorTrackSTAMuons_cfi::PhiMax, MonitorTrackSTAMuons_cfi::PhiMin, funct::pow(), and l1tmetemu::unpackSignedValue().

Referenced by transformTrack().

13  {
14  int PhiMin = 0;
15  int PhiMax = phiQuadrants.back();
16  int phiMultiplier = TTTrack_TrackWord::TrackBitWidths::kPhiSize - l1tmetemu::kInternalPhiWidth;
17 
18  int tempPhi =
19  floor(unpackSignedValue(local_phi, TTTrack_TrackWord::TrackBitWidths::kPhiSize) / pow(2, phiMultiplier)) +
20  sector_shift;
21 
22  if (tempPhi < PhiMin) {
23  tempPhi = tempPhi + PhiMax;
24  } else if (tempPhi > PhiMax) {
25  tempPhi = tempPhi - PhiMax;
26  } // else
27  // tempPhi = tempPhi;
28 
29  global_phi_t globalPhi = global_phi_t(tempPhi);
30 
31  return globalPhi;
32 }
int unpackSignedValue(unsigned int bits, unsigned int nBits)
std::vector< l1tmetemu::global_phi_t > phiQuadrants
ap_uint< kInternalPhiWidth+kGlobalPhiExtra > global_phi_t
const unsigned int kInternalPhiWidth
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ setGTTinput()

void L1TkEtMissEmuTrackTransform::setGTTinput ( bool  input)
inline

Definition at line 63 of file L1TkEtMissEmuTrackTransform.h.

References GTTinput_, and input.

Referenced by L1TrackerEtMissEmulatorProducer::L1TrackerEtMissEmulatorProducer().

63 { GTTinput_ = input; }
static std::string const input
Definition: EdmProvDump.cc:47

◆ transformTrack()

template<class track , class vertex >
InternalEtWord L1TkEtMissEmuTrackTransform::transformTrack ( track &  track_ref,
vertex &  PV 
)

Definition at line 74 of file L1TkEtMissEmuTrackTransform.h.

References funct::abs(), InternalEtWord::bendChi2, InternalEtWord::chi2rphidof, InternalEtWord::chi2rzdof, countNStub(), InternalEtWord::eta, InternalEtWord::EtaSector, InternalEtWord::globalPhi, GTTinput_, InternalEtWord::Hitpattern, l1tmetemu::kInternalEtaWidth, l1tmetemu::kInternalPtWidth, l1tmetemu::kInternalVTXWidth, l1tmetemu::kStepEta, l1tmetemu::kStepPt, localToGlobalPhi(), InternalEtWord::nstubs, InternalEtWord::phi, phiShift, InternalEtWord::pt, InternalEtWord::pV, nanoDQM_cfi::PV, InternalEtWord::Sector, TTTrack_TrackWord::stepZ0, l1tmetemu::transformSignedValue(), and InternalEtWord::z0.

Referenced by L1TrackerEtMissEmulatorProducer::produce().

74  {
75  InternalEtWord Outword;
76 
77  unsigned int temp_pt;
78  unsigned int temp_eta;
79 
80  if (GTTinput_) {
81  if ((track_ref.getRinvWord() & (1 << (TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1))) != 0) {
82  // Only Want Magnitude of Pt for sums so perform absolute value
83  temp_pt = abs((1 << (TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1)) - track_ref.getRinvWord());
84  } else {
85  temp_pt = track_ref.getRinvWord();
86  }
88  temp_pt * 2, TTTrack_TrackWord::TrackBitWidths::kRinvSize, l1tmetemu::kInternalPtWidth);
89 
90  if ((track_ref.getTanlWord() & (1 << (TTTrack_TrackWord::TrackBitWidths::kTanlSize - 1))) != 0) {
91  // Only Want Magnitude of Eta for cuts and track to vertex association so
92  // perform absolute value
93  temp_eta = abs((1 << (TTTrack_TrackWord::TrackBitWidths::kTanlSize)) - track_ref.getTanlWord());
94  } else {
95  temp_eta = track_ref.getTanlWord();
96  }
98  temp_eta, TTTrack_TrackWord::TrackBitWidths::kTanlSize, l1tmetemu::kInternalEtaWidth);
99 
100  } else {
101  track_ref.setTrackWordBits();
102  // Change track word digitization to digitization expected by track MET
103  Outword.pt = l1tmetemu::digitizeSignedValue<TTTrack_TrackWord::rinv_t>(
104  track_ref.momentum().perp(), l1tmetemu::kInternalPtWidth, l1tmetemu::kStepPt);
105 
106  Outword.eta = l1tmetemu::digitizeSignedValue<TTTrack_TrackWord::tanl_t>(
107  abs(track_ref.momentum().eta()), l1tmetemu::kInternalEtaWidth, l1tmetemu::kStepEta);
108  }
109 
110  Outword.chi2rphidof = track_ref.getChi2RPhiWord();
111  Outword.chi2rzdof = track_ref.getChi2RZWord();
112  Outword.bendChi2 = track_ref.getBendChi2Word();
113  Outword.nstubs = countNStub(track_ref.getHitPatternWord());
114  Outword.Hitpattern = track_ref.getHitPatternWord();
115  Outword.Sector = track_ref.phiSector();
116  Outword.EtaSector = (track_ref.getTanlWord() & (1 << (TTTrack_TrackWord::TrackBitWidths::kTanlSize - 1)));
117  Outword.phi = track_ref.phi();
118  Outword.globalPhi = localToGlobalPhi(track_ref.getPhiWord(), phiShift[track_ref.phiSector()]);
119 
120  unsigned int temp_pv = l1tmetemu::digitizeSignedValue<TTTrack_TrackWord::z0_t>(
121  PV.z0(),
122  TTTrack_TrackWord::TrackBitWidths::kZ0Size,
123  TTTrack_TrackWord::stepZ0); // Convert vertex to integer representation
124  //Rescale to internal representations
126  track_ref.getZ0Word(), TTTrack_TrackWord::TrackBitWidths::kZ0Size, l1tmetemu::kInternalVTXWidth);
128  temp_pv, TTTrack_TrackWord::TrackBitWidths::kZ0Size, l1tmetemu::kInternalVTXWidth);
129 
130  return Outword;
131 }
TTTrack_TrackWord::chi2rphi_t chi2rphidof
const double kStepEta
const double kStepPt
TTTrack_TrackWord::chi2rz_t chi2rzdof
const unsigned int kInternalVTXWidth
unsigned int transformSignedValue(unsigned int bits, unsigned int oldnBits, unsigned int newnBits)
TTTrack_TrackWord::hit_t Hitpattern
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const unsigned int kInternalPtWidth
l1tmetemu::nstub_t nstubs
l1tmetemu::global_phi_t globalPhi
l1tmetemu::global_phi_t localToGlobalPhi(TTTrack_TrackWord::phi_t local_phi, l1tmetemu::global_phi_t sector_shift)
TTTrack_TrackWord::bendChi2_t bendChi2
const unsigned int kInternalEtaWidth
std::vector< l1tmetemu::global_phi_t > phiShift
static constexpr double stepZ0
l1tmetemu::nstub_t countNStub(TTTrack_TrackWord::hit_t Hitpattern)

Member Data Documentation

◆ GTTinput_

bool L1TkEtMissEmuTrackTransform::GTTinput_ = false
private

Definition at line 69 of file L1TkEtMissEmuTrackTransform.h.

Referenced by setGTTinput(), and transformTrack().

◆ phiQuadrants

std::vector<l1tmetemu::global_phi_t> L1TkEtMissEmuTrackTransform::phiQuadrants
private

Definition at line 66 of file L1TkEtMissEmuTrackTransform.h.

Referenced by getPhiQuad().

◆ phiShift

std::vector<l1tmetemu::global_phi_t> L1TkEtMissEmuTrackTransform::phiShift
private

Definition at line 67 of file L1TkEtMissEmuTrackTransform.h.

Referenced by getPhiShift(), and transformTrack().