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);
159 hwPt = (hwPt < maxPt ? hwPt : maxPt);
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);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
BXVector< RegionalMuonCand > RegionalMuonCandBxCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual double pt() const =0
transverse momentum
BXVector< MuonCaloSum > MuonCaloSumBxCollection
virtual int status() const =0
status word
Abs< T >::type abs(const T &t)
virtual int charge() const =0
electric charge
virtual int pdgId() const =0
PDG identifier.
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity