CMS 3D CMS Logo

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

#include <L1TPhase2GMTBarrelStubProcessor.h>

Public Member Functions

 L1TPhase2GMTBarrelStubProcessor ()
 
 L1TPhase2GMTBarrelStubProcessor (const edm::ParameterSet &)
 
l1t::MuonStubCollection makeStubs (const L1Phase2MuDTPhContainer *, const L1MuDTChambThContainer *)
 
 ~L1TPhase2GMTBarrelStubProcessor ()
 

Private Member Functions

l1t::MuonStub buildStub (const L1Phase2MuDTPhDigi &, const L1MuDTChambThDigi *)
 
l1t::MuonStub buildStubNoEta (const L1Phase2MuDTPhDigi &)
 
int calculateEta (uint, int, uint, uint)
 

Private Attributes

std::vector< int > coarseEta1_
 
std::vector< int > coarseEta2_
 
std::vector< int > coarseEta3_
 
std::vector< int > coarseEta4_
 
std::vector< int > eta1_
 
std::vector< int > eta2_
 
std::vector< int > eta3_
 
double etaLSB_
 
int maxBX_
 
int minBX_
 
int minPhiQuality_
 
int phiBFactor_
 
double phiLSB_
 
std::vector< int > phiOffset_
 
int verbose_
 

Detailed Description

Definition at line 13 of file L1TPhase2GMTBarrelStubProcessor.h.

Constructor & Destructor Documentation

◆ L1TPhase2GMTBarrelStubProcessor() [1/2]

L1TPhase2GMTBarrelStubProcessor::L1TPhase2GMTBarrelStubProcessor ( )

◆ L1TPhase2GMTBarrelStubProcessor() [2/2]

L1TPhase2GMTBarrelStubProcessor::L1TPhase2GMTBarrelStubProcessor ( const edm::ParameterSet iConfig)

Definition at line 11 of file L1TPhase2GMTBarrelStubProcessor.cc.

12  : minPhiQuality_(iConfig.getParameter<int>("minPhiQuality")),
13  minBX_(iConfig.getParameter<int>("minBX")),
14  maxBX_(iConfig.getParameter<int>("maxBX")),
15  eta1_(iConfig.getParameter<std::vector<int> >("eta_1")),
16  eta2_(iConfig.getParameter<std::vector<int> >("eta_2")),
17  eta3_(iConfig.getParameter<std::vector<int> >("eta_3")),
18  coarseEta1_(iConfig.getParameter<std::vector<int> >("coarseEta_1")),
19  coarseEta2_(iConfig.getParameter<std::vector<int> >("coarseEta_2")),
20  coarseEta3_(iConfig.getParameter<std::vector<int> >("coarseEta_3")),
21  coarseEta4_(iConfig.getParameter<std::vector<int> >("coarseEta_4")),
22  phiOffset_(iConfig.getParameter<std::vector<int> >("phiOffset")),
23  phiBFactor_(iConfig.getParameter<int>("phiBDivider")),
24  verbose_(iConfig.getParameter<int>("verbose")),
25  phiLSB_(iConfig.getParameter<double>("phiLSB")),
26  etaLSB_(iConfig.getParameter<double>("etaLSB")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

◆ ~L1TPhase2GMTBarrelStubProcessor()

L1TPhase2GMTBarrelStubProcessor::~L1TPhase2GMTBarrelStubProcessor ( )

Definition at line 28 of file L1TPhase2GMTBarrelStubProcessor.cc.

28 {}

Member Function Documentation

◆ buildStub()

l1t::MuonStub L1TPhase2GMTBarrelStubProcessor::buildStub ( const L1Phase2MuDTPhDigi phiS,
const L1MuDTChambThDigi etaS 
)
private

Definition at line 30 of file L1TPhase2GMTBarrelStubProcessor.cc.

References buildStubNoEta(), calculateEta(), HLT_2024v13_cff::eta1, HLT_2024v13_cff::eta2, etaLSB_, mps_fire::i, l1t::MuonStub::offline_coord1(), l1t::MuonStub::offline_coord2(), L1MuDTChambThDigi::position(), L1MuDTChambThDigi::quality(), L1MuDTChambThDigi::scNum(), l1t::MuonStub::setEta(), l1t::MuonStub::setOfflineQuantities(), L1MuDTChambThDigi::stNum(), parallelization::uint, and L1MuDTChambThDigi::whNum().

Referenced by makeStubs().

31  {
32  l1t::MuonStub stub = buildStubNoEta(phiS);
33 
34  //Now full eta
35  int qeta1 = -16384;
36  int qeta2 = -16384;
37  int eta1 = -16384;
38  int eta2 = -16384;
39 
40  bool hasEta = false;
41  for (uint i = 0; i < 7; ++i) {
42  if (etaS->position(i) == 0)
43  continue;
44  if (!hasEta) {
45  hasEta = true;
46  eta1 = calculateEta(i, etaS->whNum(), etaS->scNum(), etaS->stNum());
47 
48  if (etaS->quality(i) == 1)
49  qeta1 = 2;
50  else
51  qeta1 = 1;
52  } else {
53  eta2 = calculateEta(i, etaS->whNum(), etaS->scNum(), etaS->stNum());
54  if (etaS->quality(i) == 1)
55  qeta2 = 2;
56  else
57  qeta2 = 1;
58  }
59  }
60 
61  if (qeta2 > 0) { //both stubs->average
62  stub.setEta(eta1, eta2, 3);
64 
65  } else if (qeta1 > 0) { //Good single stub
66  stub.setEta(eta1, 0, 1);
67  stub.setOfflineQuantities(stub.offline_coord1(), stub.offline_coord2(), eta1 * etaLSB_, 0.0);
68  }
69 
70  return stub;
71 }
void setOfflineQuantities(double coord1, double coord2, double eta1, double eta2)
Definition: MuonStub.h:123
double offline_coord1() const
Definition: MuonStub.h:118
int position(const int i) const
l1t::MuonStub buildStubNoEta(const L1Phase2MuDTPhDigi &)
double offline_coord2() const
Definition: MuonStub.h:119
void setEta(int eta1, int eta2, int etaQ)
Definition: MuonStub.h:129
int quality(const int i) const

◆ buildStubNoEta()

l1t::MuonStub L1TPhase2GMTBarrelStubProcessor::buildStubNoEta ( const L1Phase2MuDTPhDigi phiS)
private

Definition at line 73 of file L1TPhase2GMTBarrelStubProcessor.cc.

References nano_mu_digi_cff::bx, L1Phase2MuDTPhDigi::bxNum(), coarseEta1_, coarseEta2_, coarseEta3_, coarseEta4_, PVValHelper::eta, etaLSB_, L1Phase2MuDTPhDigi::index(), createfilelist::int, M_PI, phi, L1Phase2MuDTPhDigi::phi(), L1Phase2MuDTPhDigi::phiBend(), L1Phase2MuDTPhDigi::quality(), quality, L1Phase2MuDTPhDigi::scNum(), nano_mu_digi_cff::sector, l1t::MuonStub::setOfflineQuantities(), Validation_hcalonly_cfi::sign, relativeConstraints::station, L1Phase2MuDTPhDigi::stNum(), makeGlobalPositionRcd_cfg::tag, parallelization::uint, makeMuonMisalignmentScenario::wheel, and L1Phase2MuDTPhDigi::whNum().

Referenced by buildStub(), and makeStubs().

73  {
74  int wheel = phiS.whNum();
75  int abswheel = fabs(phiS.whNum());
76  int sign = wheel > 0 ? 1 : -1;
77  int sector = phiS.scNum();
78  int station = phiS.stNum();
79 
80  ap_uint<18> normalization0 = sector * ap_uint<15>(21845);
81  ap_int<18> normalization1 = ap_int<18>(ap_int<17>(phiS.phi()) * ap_ufixed<8, 0>(0.3183));
82  ap_int<18> kmtf_phi = ap_int<18>(normalization0 + normalization1);
83  int phi = int(kmtf_phi);
84  float globalPhi = phi * M_PI / (1 << 17);
85 
86  // double globalPhi = (sector * 30) + phiS.phi() * 30. / 65535.;
87  int tag = phiS.index();
88 
89  int bx = phiS.bxNum() - 20;
90  int quality = phiS.quality();
91  uint tfLayer = phiS.stNum() - 1;
92  int eta = -16384;
93  if (station == 1) {
94  eta = coarseEta1_[abswheel];
95  } else if (station == 2) {
96  eta = coarseEta2_[abswheel];
97  } else if (station == 3) {
98  eta = coarseEta3_[abswheel];
99  } else if (station == 4) {
100  eta = coarseEta4_[abswheel];
101  }
102 
103  //override!!!
104  // eta=abswheel;
105 
106  //Now full eta
107 
108  eta = eta * sign;
109  l1t::MuonStub stub(wheel, sector, station, tfLayer, phi, phiS.phiBend(), tag, bx, quality, eta, 0, 0, 1);
110 
111  stub.setOfflineQuantities(globalPhi, float(phiS.phiBend() * 0.49e-3), eta * etaLSB_, 0.0);
112  return stub;
113 }
void setOfflineQuantities(double coord1, double coord2, double eta1, double eta2)
Definition: MuonStub.h:123
string quality
#define M_PI

◆ calculateEta()

int L1TPhase2GMTBarrelStubProcessor::calculateEta ( uint  i,
int  wheel,
uint  sector,
uint  station 
)
private

Definition at line 182 of file L1TPhase2GMTBarrelStubProcessor.cc.

References PVValHelper::eta, eta1_, eta2_, eta3_, mps_fire::i, nano_mu_digi_cff::sector, relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

Referenced by buildStub().

182  {
183  int eta = 0;
184  if (wheel > 0) {
185  eta = 7 * wheel + 3 - i;
186  } else if (wheel < 0) {
187  eta = 7 * wheel + i - 3;
188  } else {
189  if (sector == 0 || sector == 3 || sector == 4 || sector == 7 || sector == 8 || sector == 11)
190  eta = i - 3;
191  else
192  eta = 3 - i;
193  }
194 
195  if (station == 1)
196  eta = eta1_[eta + 17];
197  else if (station == 2)
198  eta = eta2_[eta + 17];
199  else
200  eta = eta3_[eta + 17];
201 
202  return eta;
203 }

◆ makeStubs()

l1t::MuonStubCollection L1TPhase2GMTBarrelStubProcessor::makeStubs ( const L1Phase2MuDTPhContainer phiContainer,
const L1MuDTChambThContainer etaContainer 
)

Definition at line 115 of file L1TPhase2GMTBarrelStubProcessor.cc.

References buildStub(), buildStubNoEta(), nano_mu_digi_cff::bx, L1MuDTChambThContainer::chThetaSegm(), TauDecayModes::dec, L1Phase2MuDTPhContainer::getContainer(), maxBX_, minBX_, minPhiQuality_, l1tGTMenu_BTagSeeds_cff::os, MillePedeFileConverter_cfg::out, nano_mu_digi_cff::sector, relativeConstraints::station, verbose_, and makeMuonMisalignmentScenario::wheel.

Referenced by Phase2L1TGMTStubProducer::produce().

116  {
118  for (int bx = minBX_; bx <= maxBX_; bx++) {
119  ostringstream os;
120  if (verbose_ == 2)
121  os << "PATTERN ";
122  for (int wheel = -2; wheel <= 2; wheel++) {
123  for (int sector = 0; sector < 12; sector++) {
124  for (int station = 1; station < 5; station++) {
125  bool hasEta = false;
126  const L1MuDTChambThDigi* tseta = etaContainer->chThetaSegm(wheel, station, sector, bx);
127  if (tseta != nullptr) {
128  hasEta = true;
129  }
130 
131  for (const auto& phiDigi : *phiContainer->getContainer()) {
132  if ((phiDigi.bxNum() - 20) != bx || phiDigi.whNum() != wheel || phiDigi.scNum() != sector ||
133  phiDigi.stNum() != station)
134  continue;
135  if (phiDigi.quality() < minPhiQuality_)
136  continue;
137 
138  if (verbose_ == 2) {
139  ap_uint<64> wphi = ap_uint<17>(phiDigi.phi());
140  ap_uint<64> wphib = ap_uint<13>(phiDigi.phiBend());
141  ap_uint<64> wr1 = ap_uint<21>(0);
142  ap_uint<64> wq = ap_uint<4>(phiDigi.quality());
143  ap_uint<64> wr2 = ap_uint<9>(0);
144  ap_uint<64> sN = 0;
145  sN = sN | wphi;
146  sN = sN | (wphib << 17);
147  sN = sN | (wr1 << 30);
148  sN = sN | (wq << 51);
149  sN = sN | (wr2 << 55);
150  os << std::setw(0) << std::dec << sector << " " << wheel << " " << station << " ";
151  os << std::uppercase << std::setfill('0') << std::setw(16) << std::hex << uint64_t(sN) << " ";
152  }
153 
154  if (hasEta) {
155  out.push_back(buildStub(phiDigi, tseta));
156  } else {
157  out.push_back(buildStubNoEta(phiDigi));
158  }
159  }
160  }
161  }
162  }
163  if (verbose_ == 2)
164  edm::LogInfo("BarrelStub") << os.str() << std::endl;
165  }
166 
167  if (verbose_) {
168  edm::LogInfo("BarrelStub") << "Barrel Stubs";
169  for (const auto& stub : out)
170  edm::LogInfo("BarrelStub") << "Barrel Stub bx=" << stub.bxNum() << " TF=" << stub.tfLayer()
171  << " etaRegion=" << stub.etaRegion() << " phiRegion=" << stub.phiRegion()
172  << " depthRegion=" << stub.depthRegion() << " coord1=" << stub.offline_coord1() << ","
173  << stub.coord1() << " coord2=" << stub.offline_coord2() << "," << stub.coord2()
174  << " eta1=" << stub.offline_eta1() << "," << stub.eta1()
175  << " eta2=" << stub.offline_eta2() << "," << stub.eta2()
176  << " quality=" << stub.quality() << " etaQuality=" << stub.etaQuality();
177  }
178 
179  return out;
180 }
L1MuDTChambThDigi const * chThetaSegm(int wheel, int stat, int sect, int bx) const
std::vector< MuonStub > MuonStubCollection
Definition: MuonStub.h:40
l1t::MuonStub buildStub(const L1Phase2MuDTPhDigi &, const L1MuDTChambThDigi *)
Log< level::Info, false > LogInfo
unsigned long long uint64_t
Definition: Time.h:13
l1t::MuonStub buildStubNoEta(const L1Phase2MuDTPhDigi &)
Segment_Container const * getContainer() const

Member Data Documentation

◆ coarseEta1_

std::vector<int> L1TPhase2GMTBarrelStubProcessor::coarseEta1_
private

Definition at line 35 of file L1TPhase2GMTBarrelStubProcessor.h.

Referenced by buildStubNoEta().

◆ coarseEta2_

std::vector<int> L1TPhase2GMTBarrelStubProcessor::coarseEta2_
private

Definition at line 36 of file L1TPhase2GMTBarrelStubProcessor.h.

Referenced by buildStubNoEta().

◆ coarseEta3_

std::vector<int> L1TPhase2GMTBarrelStubProcessor::coarseEta3_
private

Definition at line 37 of file L1TPhase2GMTBarrelStubProcessor.h.

Referenced by buildStubNoEta().

◆ coarseEta4_

std::vector<int> L1TPhase2GMTBarrelStubProcessor::coarseEta4_
private

Definition at line 38 of file L1TPhase2GMTBarrelStubProcessor.h.

Referenced by buildStubNoEta().

◆ eta1_

std::vector<int> L1TPhase2GMTBarrelStubProcessor::eta1_
private

Definition at line 32 of file L1TPhase2GMTBarrelStubProcessor.h.

Referenced by calculateEta().

◆ eta2_

std::vector<int> L1TPhase2GMTBarrelStubProcessor::eta2_
private

Definition at line 33 of file L1TPhase2GMTBarrelStubProcessor.h.

Referenced by calculateEta().

◆ eta3_

std::vector<int> L1TPhase2GMTBarrelStubProcessor::eta3_
private

Definition at line 34 of file L1TPhase2GMTBarrelStubProcessor.h.

Referenced by calculateEta().

◆ etaLSB_

double L1TPhase2GMTBarrelStubProcessor::etaLSB_
private

Definition at line 43 of file L1TPhase2GMTBarrelStubProcessor.h.

Referenced by buildStub(), and buildStubNoEta().

◆ maxBX_

int L1TPhase2GMTBarrelStubProcessor::maxBX_
private

Definition at line 30 of file L1TPhase2GMTBarrelStubProcessor.h.

Referenced by makeStubs().

◆ minBX_

int L1TPhase2GMTBarrelStubProcessor::minBX_
private

Definition at line 29 of file L1TPhase2GMTBarrelStubProcessor.h.

Referenced by makeStubs().

◆ minPhiQuality_

int L1TPhase2GMTBarrelStubProcessor::minPhiQuality_
private

Definition at line 27 of file L1TPhase2GMTBarrelStubProcessor.h.

Referenced by makeStubs().

◆ phiBFactor_

int L1TPhase2GMTBarrelStubProcessor::phiBFactor_
private

Definition at line 40 of file L1TPhase2GMTBarrelStubProcessor.h.

◆ phiLSB_

double L1TPhase2GMTBarrelStubProcessor::phiLSB_
private

Definition at line 42 of file L1TPhase2GMTBarrelStubProcessor.h.

◆ phiOffset_

std::vector<int> L1TPhase2GMTBarrelStubProcessor::phiOffset_
private

Definition at line 39 of file L1TPhase2GMTBarrelStubProcessor.h.

◆ verbose_

int L1TPhase2GMTBarrelStubProcessor::verbose_
private

Definition at line 41 of file L1TPhase2GMTBarrelStubProcessor.h.

Referenced by makeStubs().