70 const static int m_maxMuons = 108;
86 : m_currEvt(0), m_rnd(0) {
90 produces<RegionalMuonCandBxCollection>(
"BarrelTFMuons");
91 produces<RegionalMuonCandBxCollection>(
"OverlapTFMuons");
92 produces<RegionalMuonCandBxCollection>(
"ForwardTFMuons");
93 produces<MuonCaloSumBxCollection>(
"TriggerTowerSums");
118 std::vector<RegionalMuonCand> bmMuons;
119 std::vector<RegionalMuonCand> omMuons;
120 std::vector<RegionalMuonCand> emMuons;
122 std::vector<int> muIndices;
130 muIndices.push_back(cntr);
134 LogTrace(
"GlobalMuon") <<
" GenParticleCollection not found." << std::endl;
140 const float phiToInt = 91.67324722093171f;
142 const float etaToInt = 90.9090909090f;
143 const int maxPt = (1 << 9) - 1;
148 for (
auto it = muIndices.begin(); it != muIndices.end(); ++it) {
155 double eta = mcMuon.
eta();
156 if (fabs(
eta) > 2.45)
158 int hwPt =
int(mcMuon.
pt() * 2);
160 int hwEta =
int(
eta * etaToInt);
161 double phi = mcMuon.
phi();
164 int hwPhi = (
int(
phi * phiToInt)) % 576;
166 int hwCharge = (mcMuon.
charge() > 0) ? 0 : 1;
167 int hwChargeValid = 1;
172 int globalWedgePhi = (hwPhi + 24) % 576;
173 int localPhi = globalWedgePhi % 48;
174 int processor = globalWedgePhi / 48 + 1;
175 int globalSectorPhi = (hwPhi - 24);
176 if (globalSectorPhi < 0) {
177 globalSectorPhi += 576;
180 if (fabs(
eta) > 0.8) {
181 if (fabs(
eta) < 1.2) {
183 processor = globalSectorPhi / 96 + 1;
184 localPhi = globalSectorPhi % 96;
187 processor = globalSectorPhi / 96 + 1;
188 localPhi = globalSectorPhi % 96;
191 mu.setHwPhi(localPhi);
192 mu.setTFIdentifiers(processor, tf);
195 mu.setHwSign(hwCharge);
196 mu.setHwSignValid(hwChargeValid);
197 mu.setHwQual(hwQual);
199 if (fabs(
eta) < 0.8 && bmMuons.size() < 36) {
200 bmMuons.push_back(
mu);
202 }
else if (fabs(
eta) < 1.2 && omMuons.size() < 36) {
203 omMuons.push_back(
mu);
205 }
else if (emMuons.size() < 36) {
206 emMuons.push_back(
mu);
215 for (
const auto&
mu : bmMuons) {
216 barrelMuons->push_back(0,
mu);
219 for (
const auto&
mu : omMuons) {
220 overlapMuons->push_back(0,
mu);
223 for (
const auto&
mu : emMuons) {
224 endcapMuons->push_back(0,
mu);
227 for (
int i = 0;
i < 1008; ++
i) {
235 towerSums->push_back(0, sum);