CMS 3D CMS Logo

RegionalMuonCand.h
Go to the documentation of this file.
1 #ifndef __l1t_regional_muon_candidate_h__
2 #define __l1t_regional_muon_candidate_h__
3 
4 #include "RegionalMuonCandFwd.h"
5 #include <map>
6 
7 namespace l1t {
9  public:
12  enum bmtfAddress {
14  kWheelNum = 1,
15  kStat1 = 2,
16  kStat2 = 3,
17  kStat3 = 4,
18  kStat4 = 5,
24  };
27  enum omtfAddress { kLayers = 0, kZero = 1, kWeight = 2, kNumOmtfSubAddr = 3 };
30  enum emtfAddress {
31  kME1Seg = 0,
32  kME1Ch = 1,
33  kME2Seg = 2,
34  kME2Ch = 3,
35  kME3Seg = 4,
36  kME3Ch = 5,
37  kME4Seg = 6,
38  kME4Ch = 7,
39  kTrkNum = 8,
40  kBX = 9,
42  };
43 
45 
47  : m_hwPt(0),
49  m_hwDXY(0),
50  m_hwPhi(0),
51  m_hwEta(0),
52  m_hwHF(false),
53  m_hwSign(0),
54  m_hwSignValid(0),
55  m_hwQuality(0),
56  m_dataword(0) {
58  };
59 
60  RegionalMuonCand(int pt, int phi, int eta, int sign, int signvalid, int quality, int processor, tftype trackFinder)
61  : m_hwPt(pt),
63  m_hwDXY(0),
64  m_hwPhi(phi),
65  m_hwEta(eta),
66  m_hwHF(false),
67  m_hwSign(sign),
68  m_hwSignValid(signvalid),
70  m_dataword(0) {
71  setTFIdentifiers(processor, trackFinder);
72  // set default track addresses
73  if (trackFinder == tftype::bmtf) {
74  m_trackAddress = {{kWheelSide, 0},
75  {kWheelNum, 0},
76  {kStat1, 0},
77  {kStat2, 0},
78  {kStat3, 0},
79  {kStat4, 0},
80  {kSegSelStat1, 0},
81  {kSegSelStat2, 0},
82  {kSegSelStat3, 0},
83  {kSegSelStat4, 0}};
84  } else if (trackFinder == tftype::omtf_pos || trackFinder == tftype::omtf_neg) {
85  m_trackAddress = {{kLayers, 0}, {kZero, 0}, {kWeight, 0}};
86  } else if (trackFinder == tftype::emtf_pos || trackFinder == tftype::emtf_neg) {
87  m_trackAddress = {{kME1Seg, 0},
88  {kME1Ch, 0},
89  {kME2Seg, 0},
90  {kME2Ch, 0},
91  {kME3Seg, 0},
92  {kME3Ch, 0},
93  {kME4Seg, 0},
94  {kME4Ch, 0},
95  {kTrkNum, 0},
96  {kBX, 0}};
97  }
98  };
99 
101  int phi,
102  int eta,
103  int sign,
104  int signvalid,
105  int quality,
106  int processor,
107  tftype trackFinder,
108  std::map<int, int> trackAddress)
109  : m_hwPt(pt),
111  m_hwDXY(0),
112  m_hwPhi(phi),
113  m_hwEta(eta),
114  m_hwHF(false),
115  m_hwSign(sign),
116  m_hwSignValid(signvalid),
119  m_dataword(0) {
120  setTFIdentifiers(processor, trackFinder);
121  };
122 
123  virtual ~RegionalMuonCand(){};
124 
126  void setHwPt(int bits) { m_hwPt = bits; };
128  void setHwPtUnconstrained(int bits) { m_hwPtUnconstrained = bits; };
130  void setHwDXY(int bits) { m_hwDXY = bits; };
132  void setHwPhi(int bits) { m_hwPhi = bits; };
134  void setHwEta(int bits) { m_hwEta = bits; };
136  void setHwSign(int bits) { m_hwSign = bits; };
138  void setHwSignValid(int bits) { m_hwSignValid = bits; };
140  void setHwQual(int bits) { m_hwQuality = bits; };
142  void setHwHF(bool bit) { m_hwHF = bit; };
144  void setTFIdentifiers(int processor, tftype trackFinder);
145  // this is left to still be compatible with OMTF
146  void setLink(int link) { m_link = link; };
147  // Set the 64 bit word from two 32 words. bits 0-31->lsbs, bits 32-63->msbs
148  void setDataword(uint32_t msbs, uint32_t lsbs) { m_dataword = (((uint64_t)msbs) << 32) + lsbs; };
149  // Set the 64 bit word coming from HW directly
150  void setDataword(uint64_t bits) { m_dataword = bits; };
152  void setTrackSubAddress(bmtfAddress subAddress, int value) { m_trackAddress[subAddress] = value; }
154  void setTrackSubAddress(omtfAddress subAddress, int value) { m_trackAddress[subAddress] = value; }
156  void setTrackSubAddress(emtfAddress subAddress, int value) { m_trackAddress[subAddress] = value; }
158  void setTrackAddress(const std::map<int, int>& address) { m_trackAddress = address; }
159 
161  const int hwPt() const { return m_hwPt; };
163  const int hwPtUnconstrained() const { return m_hwPtUnconstrained; };
165  const int hwDXY() const { return m_hwDXY; };
167  const int hwPhi() const { return m_hwPhi; };
169  const int hwEta() const { return m_hwEta; };
171  const int hwSign() const { return m_hwSign; };
173  const int hwSignValid() const { return m_hwSignValid; };
175  const int hwQual() const { return m_hwQuality; };
177  const int link() const { return m_link; };
179  const int processor() const { return m_processor; };
181  const tftype trackFinderType() const { return m_trackFinder; };
183  const int hwHF() const { return m_hwHF; };
185  const uint64_t dataword() const { return m_dataword; };
187  const uint32_t dataword32Msb() const { return (uint32_t)((m_dataword >> 32) & 0xFFFFFFFF); };
189  const uint32_t dataword32Lsb() const { return (uint32_t)(m_dataword & 0xFFFFFFFF); };
191  const std::map<int, int>& trackAddress() const { return m_trackAddress; }
193  int trackSubAddress(bmtfAddress subAddress) const { return m_trackAddress.at(subAddress); }
195  int trackSubAddress(omtfAddress subAddress) const { return m_trackAddress.at(subAddress); }
197  int trackSubAddress(emtfAddress subAddress) const { return m_trackAddress.at(subAddress); }
198 
199  bool operator==(const RegionalMuonCand& rhs) const;
200  inline bool operator!=(const RegionalMuonCand& rhs) const { return !(operator==(rhs)); };
201 
202  private:
203  int m_hwPt;
205  int m_hwDXY;
206  int m_hwPhi;
207  int m_hwEta;
208  bool m_hwHF;
209  int m_hwSign;
212  int m_link;
215  std::map<int, int> m_trackAddress;
216 
219  };
220 
221 } // namespace l1t
222 
223 #endif /* define __l1t_regional_muon_candidate_h__ */
l1t::RegionalMuonCand::kME1Ch
Definition: RegionalMuonCand.h:32
l1t::RegionalMuonCand::m_hwSignValid
int m_hwSignValid
Definition: RegionalMuonCand.h:210
l1t::RegionalMuonCand::kStat2
Definition: RegionalMuonCand.h:16
l1t::RegionalMuonCand::kLayers
Definition: RegionalMuonCand.h:27
l1t::RegionalMuonCand::kME3Seg
Definition: RegionalMuonCand.h:35
l1t::bmtf
Definition: RegionalMuonCandFwd.h:8
l1t::emtf_neg
Definition: RegionalMuonCandFwd.h:8
l1t::RegionalMuonCand::kWheelNum
Definition: RegionalMuonCand.h:14
l1t::RegionalMuonCand::processor
const int processor() const
Get processor ID on which the candidate was found (0..5 for OMTF/EMTF; 0..11 for BMTF)
Definition: RegionalMuonCand.h:179
l1t::RegionalMuonCand::link
const int link() const
Get link on which the MicroGMT receives the candidate.
Definition: RegionalMuonCand.h:177
l1t::RegionalMuonCand::RegionalMuonCand
RegionalMuonCand()
Definition: RegionalMuonCand.h:46
l1t::RegionalMuonCand::hwPhi
const int hwPhi() const
Get compressed local phi (returned int * 2*pi/576 = local phi in rad)
Definition: RegionalMuonCand.h:167
l1t::RegionalMuonCand::kSegSelStat4
Definition: RegionalMuonCand.h:22
l1t::RegionalMuonCand::m_hwEta
int m_hwEta
Definition: RegionalMuonCand.h:207
l1t::RegionalMuonCand::trackSubAddress
int trackSubAddress(omtfAddress subAddress) const
Get part of track address (identifies track primitives used for reconstruction)
Definition: RegionalMuonCand.h:195
l1t::RegionalMuonCand::m_dataword
uint64_t m_dataword
This is the 64 bit word as transmitted in HW.
Definition: RegionalMuonCand.h:218
funct::false
false
Definition: Factorize.h:29
l1t::RegionalMuonCand::setLink
void setLink(int link)
Definition: RegionalMuonCand.h:146
l1t::RegionalMuonCand::kSegSelStat1
Definition: RegionalMuonCand.h:19
l1t::RegionalMuonCand::operator==
bool operator==(const RegionalMuonCand &rhs) const
Definition: RegionalMuonCand.cc:27
l1t::RegionalMuonCand::dataword32Msb
const uint32_t dataword32Msb() const
Get 32 MSBs of data word.
Definition: RegionalMuonCand.h:187
l1t::omtf_pos
Definition: RegionalMuonCandFwd.h:8
l1t::RegionalMuonCand::kME2Ch
Definition: RegionalMuonCand.h:34
l1t::tftype
tftype
Definition: RegionalMuonCandFwd.h:8
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
l1t::RegionalMuonCand::setHwSign
void setHwSign(int bits)
Set charge sign bit (charge = (-1)^(sign))
Definition: RegionalMuonCand.h:136
l1t::RegionalMuonCand::kBX
Definition: RegionalMuonCand.h:40
l1t::RegionalMuonCand::hwHF
const int hwHF() const
Get HF (halo / fine eta) bit (EMTF: halo -> 1; BMTF: fine eta -> 1)
Definition: RegionalMuonCand.h:183
l1t::RegionalMuonCand::setTrackAddress
void setTrackAddress(const std::map< int, int > &address)
Set the whole track address.
Definition: RegionalMuonCand.h:158
l1t::RegionalMuonCand::kME1Seg
Definition: RegionalMuonCand.h:31
l1t::RegionalMuonCand::kStat4
Definition: RegionalMuonCand.h:18
l1t::RegionalMuonCand::kStat3
Definition: RegionalMuonCand.h:17
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
l1t::RegionalMuonCand::setTrackSubAddress
void setTrackSubAddress(emtfAddress subAddress, int value)
Set a part of the muon candidates track address; specialised for EMTF.
Definition: RegionalMuonCand.h:156
l1t::RegionalMuonCand::dataword
const uint64_t dataword() const
Get 64 bit data word.
Definition: RegionalMuonCand.h:185
l1t::RegionalMuonCand::m_link
int m_link
Definition: RegionalMuonCand.h:212
l1t::RegionalMuonCand::kNumOmtfSubAddr
Definition: RegionalMuonCand.h:27
l1t::RegionalMuonCand::~RegionalMuonCand
virtual ~RegionalMuonCand()
Definition: RegionalMuonCand.h:123
l1t::RegionalMuonCand::hwQual
const int hwQual() const
Get quality code.
Definition: RegionalMuonCand.h:175
l1t::RegionalMuonCand::hwEta
const int hwEta() const
Get compressed eta (returned int * 0.010875 = eta)
Definition: RegionalMuonCand.h:169
l1t::RegionalMuonCand::m_trackAddress
std::map< int, int > m_trackAddress
Definition: RegionalMuonCand.h:215
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:109
l1t::RegionalMuonCand::hwPt
const int hwPt() const
Get compressed pT (returned int * 0.5 = pT (GeV))
Definition: RegionalMuonCand.h:161
l1t::RegionalMuonCand::setDataword
void setDataword(uint32_t msbs, uint32_t lsbs)
Definition: RegionalMuonCand.h:148
PVValHelper::eta
Definition: PVValidationHelpers.h:70
l1t::RegionalMuonCand::setTFIdentifiers
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
Definition: RegionalMuonCand.cc:5
l1t::RegionalMuonCand::kZero
Definition: RegionalMuonCand.h:27
l1t::RegionalMuonCand::m_processor
int m_processor
Definition: RegionalMuonCand.h:213
l1t::RegionalMuonCand::kStat1
Definition: RegionalMuonCand.h:15
l1t::RegionalMuonCand::trackFinderType
const tftype trackFinderType() const
Get track-finder which found the muon (bmtf, emtf_pos/emtf_neg or omtf_pos/omtf_neg)
Definition: RegionalMuonCand.h:181
l1t::RegionalMuonCand::m_hwQuality
int m_hwQuality
Definition: RegionalMuonCand.h:211
l1t::RegionalMuonCand::m_hwDXY
int m_hwDXY
Definition: RegionalMuonCand.h:205
l1t::RegionalMuonCand::dataword32Lsb
const uint32_t dataword32Lsb() const
Get 32 LSBs of data word.
Definition: RegionalMuonCand.h:189
l1t::RegionalMuonCand::setHwPt
void setHwPt(int bits)
Set compressed pT as transmitted by hardware LSB = 0.5 (9 bits)
Definition: RegionalMuonCand.h:126
l1t::RegionalMuonCand::setHwHF
void setHwHF(bool bit)
Set HF (halo / fine eta) bit (EMTF: halo -> 1; BMTF: fine eta -> 1)
Definition: RegionalMuonCand.h:142
l1t::RegionalMuonCand::setDataword
void setDataword(uint64_t bits)
Definition: RegionalMuonCand.h:150
l1t::RegionalMuonCand::bmtfAddress
bmtfAddress
Definition: RegionalMuonCand.h:12
l1t::RegionalMuonCand::m_hwPtUnconstrained
int m_hwPtUnconstrained
Definition: RegionalMuonCand.h:204
l1t::RegionalMuonCand::hwDXY
const int hwDXY() const
Get compressed impact parameter (4 bits)
Definition: RegionalMuonCand.h:165
l1t
delete x;
Definition: CaloConfig.h:22
l1t::RegionalMuonCand::setHwEta
void setHwEta(int bits)
Set compressed eta as transmitted by hardware LSB = 0.010875 (9 bits)
Definition: RegionalMuonCand.h:134
l1t::RegionalMuonCand::m_trackFinder
tftype m_trackFinder
Definition: RegionalMuonCand.h:214
l1t::RegionalMuonCand::kNumBmtfSubAddr
Definition: RegionalMuonCand.h:23
l1t::RegionalMuonCand::setTrackSubAddress
void setTrackSubAddress(omtfAddress subAddress, int value)
Set a part of the muon candidates track address; specialised for OMTF.
Definition: RegionalMuonCand.h:154
value
Definition: value.py:1
l1t::RegionalMuonCand::hwPtUnconstrained
const int hwPtUnconstrained() const
Get second compressed pT (returned int * 1.0 = pT (GeV))
Definition: RegionalMuonCand.h:163
l1t::RegionalMuonCand::kSegSelStat2
Definition: RegionalMuonCand.h:20
l1t::RegionalMuonCand::RegionalMuonCand
RegionalMuonCand(int pt, int phi, int eta, int sign, int signvalid, int quality, int processor, tftype trackFinder)
Definition: RegionalMuonCand.h:60
l1t::RegionalMuonCand::kSegSelStat3
Definition: RegionalMuonCand.h:21
l1t::RegionalMuonCand::kWheelSide
Definition: RegionalMuonCand.h:13
l1t::RegionalMuonCand::kME4Seg
Definition: RegionalMuonCand.h:37
l1t::RegionalMuonCand::setTrackSubAddress
void setTrackSubAddress(bmtfAddress subAddress, int value)
Set a part of the muon candidates track address; specialised for BMTF.
Definition: RegionalMuonCand.h:152
l1t::RegionalMuonCand::setHwQual
void setHwQual(int bits)
Set compressed quality code as transmitted by hardware (4 bits)
Definition: RegionalMuonCand.h:140
l1t::RegionalMuonCand::kWeight
Definition: RegionalMuonCand.h:27
l1t::RegionalMuonCand::setHwSignValid
void setHwSignValid(int bits)
Set whether charge measurement is valid (0 for high pT muons)
Definition: RegionalMuonCand.h:138
l1t::RegionalMuonCand::kTrkNum
Definition: RegionalMuonCand.h:39
l1t::RegionalMuonCand::emtfAddress
emtfAddress
Definition: RegionalMuonCand.h:30
l1t::RegionalMuonCand::operator!=
bool operator!=(const RegionalMuonCand &rhs) const
Definition: RegionalMuonCand.h:200
l1t::RegionalMuonCand::m_hwSign
int m_hwSign
Definition: RegionalMuonCand.h:209
l1t::RegionalMuonCand::trackAddress
const std::map< int, int > & trackAddress() const
Get the track address (identifies track primitives used for reconstruction)
Definition: RegionalMuonCand.h:191
l1t::RegionalMuonCand::hwSign
const int hwSign() const
Get charge sign bit (charge = (-1)^(sign))
Definition: RegionalMuonCand.h:171
l1t::emtf_pos
Definition: RegionalMuonCandFwd.h:8
l1t::RegionalMuonCand::omtfAddress
omtfAddress
Definition: RegionalMuonCand.h:27
relativeConstraints.value
value
Definition: relativeConstraints.py:53
l1t::RegionalMuonCand::m_hwPt
int m_hwPt
Definition: RegionalMuonCand.h:200
l1t::RegionalMuonCand::setHwDXY
void setHwDXY(int bits)
Set compressed impact parameter with respect to beamspot (4 bits)
Definition: RegionalMuonCand.h:130
l1t::RegionalMuonCand::kNumEmtfSubAddr
Definition: RegionalMuonCand.h:41
l1t::RegionalMuonCand::RegionalMuonCand
RegionalMuonCand(int pt, int phi, int eta, int sign, int signvalid, int quality, int processor, tftype trackFinder, std::map< int, int > trackAddress)
Definition: RegionalMuonCand.h:100
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
l1t::RegionalMuonCand::kME2Seg
Definition: RegionalMuonCand.h:33
l1t::RegionalMuonCand::hwSignValid
const int hwSignValid() const
Get charge sign valid bit (0 - not valid (high pT muon); 1 - valid)
Definition: RegionalMuonCand.h:173
l1t::RegionalMuonCand::kME3Ch
Definition: RegionalMuonCand.h:36
RegionalMuonCandFwd.h
l1t::RegionalMuonCand::setHwPtUnconstrained
void setHwPtUnconstrained(int bits)
Set compressed second displaced pT as transmitted by hardware LSB = 1.0 (8 bits)
Definition: RegionalMuonCand.h:128
l1t::RegionalMuonCand::setHwPhi
void setHwPhi(int bits)
Set compressed relative phi as transmitted by hardware LSB = 2*pi/576 (8 bits)
Definition: RegionalMuonCand.h:132
l1t::omtf_neg
Definition: RegionalMuonCandFwd.h:8
l1t::RegionalMuonCand::trackSubAddress
int trackSubAddress(bmtfAddress subAddress) const
Get part of track address (identifies track primitives used for reconstruction)
Definition: RegionalMuonCand.h:193
l1t::RegionalMuonCand::m_hwHF
bool m_hwHF
Definition: RegionalMuonCand.h:208
l1t::RegionalMuonCand
Definition: RegionalMuonCand.h:8
l1t::RegionalMuonCand::kME4Ch
Definition: RegionalMuonCand.h:38
l1t::RegionalMuonCand::m_hwPhi
int m_hwPhi
Definition: RegionalMuonCand.h:206
l1t::RegionalMuonCand::trackSubAddress
int trackSubAddress(emtfAddress subAddress) const
Get part of track address (identifies track primitives used for reconstruction)
Definition: RegionalMuonCand.h:197