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  };
17  enum omtfAddress {
19  };
22  enum emtfAddress {
24  };
25 
26 
28 
31  m_dataword(0)
32  {
34  };
35 
36  RegionalMuonCand(int pt, int phi, int eta, int sign, int signvalid, int quality, int processor, tftype trackFinder) :
37  m_hwPt(pt),m_hwPt2(0),m_hwDXY(0),m_hwPhi(phi), m_hwEta(eta), m_hwHF(false), m_hwSign(sign), m_hwSignValid(signvalid), m_hwQuality(quality),
38  m_dataword(0)
39  {
40  setTFIdentifiers(processor, trackFinder);
41  // set default track addresses
42  if (trackFinder == tftype::bmtf) {
43  m_trackAddress = {{kWheelSide, 0}, {kWheelNum, 0}, {kStat1, 0}, {kStat2, 0}, {kStat3, 0}, {kStat4, 0}, {kSegSelStat1, 0}, {kSegSelStat2, 0}, {kSegSelStat3, 0}, {kSegSelStat4, 0}};
44  } else if (trackFinder == tftype::omtf_pos || trackFinder == tftype::omtf_neg) {
45  m_trackAddress = {{kLayers, 0}, {kZero, 0}, {kWeight, 0}};
46  } else if (trackFinder == tftype::emtf_pos || trackFinder == tftype::emtf_neg) {
47  m_trackAddress = {{kME1Seg, 0}, {kME1Ch, 0}, {kME2Seg, 0}, {kME2Ch, 0}, {kME3Seg, 0}, {kME3Ch, 0}, {kME4Seg, 0}, {kME4Ch, 0}, {kTrkNum, 0}, {kBX, 0}};
48  }
49  };
50 
51  RegionalMuonCand(int pt, int phi, int eta, int sign, int signvalid, int quality, int processor, tftype trackFinder, std::map<int, int> trackAddress) :
52  m_hwPt(pt) ,m_hwPt2(0),m_hwDXY(0),m_hwPhi(phi), m_hwEta(eta), m_hwHF(false), m_hwSign(sign), m_hwSignValid(signvalid), m_hwQuality(quality), m_trackAddress(trackAddress),
53  m_dataword(0)
54  {
55  setTFIdentifiers(processor, trackFinder);
56  };
57 
58  virtual ~RegionalMuonCand() {};
59 
61  void setHwPt(int bits) { m_hwPt = bits; };
63  void setHwPt2(int bits) { m_hwPt2 = bits; };
65  void setHwDXY(int bits) { m_hwDXY = bits; };
67  void setHwPhi(int bits) { m_hwPhi = bits; };
69  void setHwEta(int bits) { m_hwEta = bits; };
71  void setHwSign(int bits) { m_hwSign = bits; };
75  void setHwQual(int bits) { m_hwQuality = bits; };
77  void setHwHF(bool bit) { m_hwHF = bit; };
79  void setTFIdentifiers(int processor, tftype trackFinder);
80  // this is left to still be compatible with OMTF
81  void setLink(int link) {m_link = link; };
82  // Set the 64 bit word from two 32 words. bits 0-31->lsbs, bits 32-63->msbs
83  void setDataword(uint32_t msbs, uint32_t lsbs) { m_dataword = (((uint64_t)msbs) << 32) + lsbs; };
84  // Set the 64 bit word coming from HW directly
87  void setTrackSubAddress(bmtfAddress subAddress, int value) {
88  m_trackAddress[subAddress] = value;
89  }
91  void setTrackSubAddress(omtfAddress subAddress, int value) {
92  m_trackAddress[subAddress] = value;
93  }
95  void setTrackSubAddress(emtfAddress subAddress, int value) {
96  m_trackAddress[subAddress] = value;
97  }
99  void setTrackAddress(const std::map<int, int>& address) {
100  m_trackAddress = address;
101  }
102 
103 
105  const int hwPt() const { return m_hwPt; };
107  const int hwPt2() const { return m_hwPt2; };
109  const int hwDXY() const { return m_hwDXY; };
111  const int hwPhi() const { return m_hwPhi; };
113  const int hwEta() const { return m_hwEta; };
115  const int hwSign() const { return m_hwSign; };
117  const int hwSignValid() const { return m_hwSignValid; };
119  const int hwQual() const { return m_hwQuality; };
121  const int link() const { return m_link; };
123  const int processor() const { return m_processor; };
125  const tftype trackFinderType() const { return m_trackFinder; };
127  const int hwHF() const { return m_hwHF; };
129  const uint64_t dataword() const { return m_dataword; };
131  const uint32_t dataword32Msb() const { return (uint32_t)((m_dataword >> 32) & 0xFFFFFFFF); };
133  const uint32_t dataword32Lsb() const { return (uint32_t)(m_dataword & 0xFFFFFFFF); };
135  const std::map<int, int>& trackAddress() const {
136  return m_trackAddress;
137  }
139  int trackSubAddress(bmtfAddress subAddress) const {
140  return m_trackAddress.at(subAddress);
141  }
143  int trackSubAddress(omtfAddress subAddress) const {
144  return m_trackAddress.at(subAddress);
145  }
147  int trackSubAddress(emtfAddress subAddress) const {
148  return m_trackAddress.at(subAddress);
149  }
150 
151  bool operator==(const RegionalMuonCand& rhs) const;
152  inline bool operator!=(const RegionalMuonCand& rhs) const { return !(operator==(rhs)); };
153 
154 
155  private:
156  int m_hwPt;
157  int m_hwPt2;
158  int m_hwDXY;
159  int m_hwPhi;
160  int m_hwEta;
161  bool m_hwHF;
162  int m_hwSign;
165  int m_link;
168  std::map<int, int> m_trackAddress;
169 
172 
173 };
174 
175 }
176 
177 #endif /* define __l1t_regional_muon_candidate_h__ */
void setLink(int link)
void setHwPt2(int bits)
Set compressed second displaced pT as transmitted by hardware LSB = 1.0 (8 bits)
void setHwPhi(int bits)
Set compressed relative phi as transmitted by hardware LSB = 2*pi/576 (8 bits)
const uint32_t dataword32Msb() const
Get 32 MSBs of data word.
const int hwSignValid() const
Get charge sign valid bit (0 - not valid (high pT muon); 1 - valid)
const int hwDXY() const
Get compressed impact parameter (4 bits)
void setTrackSubAddress(emtfAddress subAddress, int value)
Set a part of the muon candidates track address; specialised for EMTF.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
std::map< int, int > m_trackAddress
delete x;
Definition: CaloConfig.h:22
void setTrackAddress(const std::map< int, int > &address)
Set the whole track address.
bool operator==(const RegionalMuonCand &rhs) const
const int hwQual() const
Get quality code.
int trackSubAddress(emtfAddress subAddress) const
Get part of track address (identifies track primitives used for reconstruction)
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
void setTrackSubAddress(bmtfAddress subAddress, int value)
Set a part of the muon candidates track address; specialised for BMTF.
const int hwHF() const
Get HF (halo / fine eta) bit (EMTF: halo -> 1; BMTF: fine eta -> 1)
void setDataword(uint32_t msbs, uint32_t lsbs)
void setHwHF(bool bit)
Set HF (halo / fine eta) bit (EMTF: halo -> 1; BMTF: fine eta -> 1)
void setDataword(uint64_t bits)
const int hwEta() const
Get compressed eta (returned int * 0.010875 = eta)
Definition: value.py:1
const std::map< int, int > & trackAddress() const
Get the track address (identifies track primitives used for reconstruction)
bool operator!=(const RegionalMuonCand &rhs) const
const int hwPhi() const
Get compressed local phi (returned int * 2*pi/576 = local phi in rad)
RegionalMuonCand(int pt, int phi, int eta, int sign, int signvalid, int quality, int processor, tftype trackFinder)
const int link() const
Get link on which the MicroGMT receives the candidate.
const tftype trackFinderType() const
Get track-finder which found the muon (bmtf, emtf_pos/emtf_neg or omtf_pos/omtf_neg) ...
void setHwQual(int bits)
Set compressed quality code as transmitted by hardware (4 bits)
void setHwPt(int bits)
Set compressed pT as transmitted by hardware LSB = 0.5 (9 bits)
void setHwEta(int bits)
Set compressed eta as transmitted by hardware LSB = 0.010875 (9 bits)
void setHwDXY(int bits)
Set compressed impact parameter with respect to beamspot (4 bits)
const int processor() const
Get processor ID on which the candidate was found (0..5 for OMTF/EMTF; 0..11 for BMTF) ...
unsigned long long uint64_t
Definition: Time.h:15
void setTrackSubAddress(omtfAddress subAddress, int value)
Set a part of the muon candidates track address; specialised for OMTF.
int trackSubAddress(bmtfAddress subAddress) const
Get part of track address (identifies track primitives used for reconstruction)
int trackSubAddress(omtfAddress subAddress) const
Get part of track address (identifies track primitives used for reconstruction)
const int hwPt() const
Get compressed pT (returned int * 0.5 = pT (GeV))
const uint64_t dataword() const
Get 64 bit data word.
const int hwSign() const
Get charge sign bit (charge = (-1)^(sign))
void setHwSignValid(int bits)
Set whether charge measurement is valid (0 for high pT muons)
RegionalMuonCand(int pt, int phi, int eta, int sign, int signvalid, int quality, int processor, tftype trackFinder, std::map< int, int > trackAddress)
uint64_t m_dataword
This is the 64 bit word as transmitted in HW.
const int hwPt2() const
Get second compressed pT (returned int * 1.0 = pT (GeV))
const uint32_t dataword32Lsb() const
Get 32 LSBs of data word.
void setHwSign(int bits)
Set charge sign bit (charge = (-1)^(sign))