118 std::vector<RegionalMuonCand> bmMuons;
119 std::vector<RegionalMuonCand> omMuons;
120 std::vector<RegionalMuonCand> emMuons;
122 std::vector<int> muIndices;
127 for (
auto it = genParticles->cbegin(); it != genParticles->cend(); ++it) {
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;
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);
void setHwPhi(int bits)
Set compressed relative phi as transmitted by hardware LSB = 2*pi/576 (8 bits)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
BXVector< RegionalMuonCand > RegionalMuonCandBxCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
BXVector< MuonCaloSum > MuonCaloSumBxCollection
virtual int status() const =0
status word
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
virtual int pdgId() const =0
PDG identifier.
Abs< T >::type abs(const T &t)
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)
virtual double eta() const =0
momentum pseudorapidity
virtual double pt() const =0
transverse momentum
virtual int charge() const =0
electric charge
void setHwSignValid(int bits)
Set whether charge measurement is valid (0 for high pT muons)
virtual double phi() const =0
momentum azimuthal angle
void setHwSign(int bits)
Set charge sign bit (charge = (-1)^(sign))