59 virtual void endJob() ;
71 const static int m_maxMuons = 108;
88 m_currEvt(0), m_rnd(0)
93 produces<RegionalMuonCandBxCollection>(
"BarrelTFMuons");
94 produces<RegionalMuonCandBxCollection>(
"OverlapTFMuons");
95 produces<RegionalMuonCandBxCollection>(
"ForwardTFMuons");
96 produces<GMTInputCaloSumBxCollection>(
"TriggerTowerSums");
128 std::vector<RegionalMuonCand> bmMuons;
129 std::vector<RegionalMuonCand> omMuons;
130 std::vector<RegionalMuonCand> emMuons;
133 std::vector<int> muIndices;
140 if(
abs(mcParticle.
pdgId()) == 13 && mcParticle.
status() == 1 ) muIndices.push_back(cntr);
145 LogTrace(
"GlobalMuon") <<
" GenParticleCollection not found." << std::endl;
151 const float phiToInt = 91.67324722093171f;
153 const float etaToInt = 90.9090909090f;
154 const int maxPt = (1 << 9)-1;
159 for (
auto it = muIndices.begin(); it != muIndices.end(); ++it) {
165 double eta = mcMuon.
eta();
166 if (fabs(eta) > 2.45)
continue;
167 int hwPt = int(mcMuon.
pt() * 2);
168 hwPt = (hwPt < maxPt ? hwPt : maxPt);
169 int hwEta = int(eta * etaToInt);
170 double phi = mcMuon.
phi();
171 if (phi < 0) phi +=
twoPi;
172 int hwPhi = (int(phi * phiToInt))%576;
174 int hwCharge = (mcMuon.
charge() > 0) ? 0 : 1;
175 int hwChargeValid = 1;
182 int globalWedgePhi = (hwPhi+24)%576;
183 int localPhi = globalWedgePhi%48;
184 int processor = globalWedgePhi / 48 + 1;
185 int globalSectorPhi = (hwPhi-24);
186 if (globalSectorPhi < 0) {
187 globalSectorPhi += 576;
191 if (fabs(eta) > 0.8) {
192 if (fabs(eta) < 1.2) {
194 processor = globalSectorPhi / 96 + 1;
195 localPhi = globalSectorPhi%96;
198 processor = globalSectorPhi / 96 + 1;
199 localPhi = globalSectorPhi%96;
202 mu.setHwPhi(localPhi);
203 mu.setTFIdentifiers(processor, tf);
206 mu.setHwSign(hwCharge);
207 mu.setHwSignValid(hwChargeValid);
208 mu.setHwQual(hwQual);
210 if (fabs(eta) < 0.8 && bmMuons.size() < 36) {
211 bmMuons.push_back(
mu);
213 }
else if (fabs(eta) < 1.2 && omMuons.size() < 36) {
214 omMuons.push_back(
mu);
216 }
else if (emMuons.size() < 36) {
217 emMuons.push_back(
mu);
226 for (
const auto&
mu:bmMuons) {
227 barrelMuons->push_back(0,
mu);
230 for (
const auto&
mu:omMuons) {
231 overlapMuons->push_back(0,
mu);
234 for (
const auto&
mu:emMuons) {
235 endcapMuons->push_back(0,
mu);
238 for (
int i = 0;
i < 1008; ++
i) {
241 if (energy < 0) energy = 0;
242 if (energy > 31) energy = 31;
244 towerSums->push_back(0, sum);
247 iEvent.
put(barrelMuons,
"BarrelTFMuons");
248 iEvent.
put(overlapMuons,
"OverlapTFMuons");
249 iEvent.
put(endcapMuons,
"ForwardTFMuons");
250 iEvent.
put(towerSums,
"TriggerTowerSums");
BXVector< RegionalMuonCand > RegionalMuonCandBxCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual double pt() const =0
transverse momentum
#define DEFINE_FWK_MODULE(type)
virtual int status() const =0
status word
void addDefault(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Abs< T >::type abs(const T &t)
virtual int charge() const =0
electric charge
BXVector< GMTInputCaloSum > GMTInputCaloSumBxCollection
virtual int pdgId() const =0
PDG identifier.
const int processor() const
Get processor ID on which the candidate was found (1..6 for OMTF/EMTF; 1..12 for BMTF) ...
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity