Description: takes generated muons and fills them in the expected collections for the MicroGMT
Implementation: [Notes on implementation]
Definition at line 47 of file L1TMuonCaloSumProducer.cc.
Definition at line 85 of file L1TMuonCaloSumProducer.cc.
References funct::abs(), nano_mu_digi_cff::bx, eleHcalExtractorBlocks_cff::caloTowers, l1t::MuonCaloSum::etBits(), l1trig_cff::hwEta, l1t::L1Candidate::hwEta(), l1trig_cff::hwPhi, l1t::L1Candidate::hwPhi(), l1trig_cff::hwPt, l1t::L1Candidate::hwPt(), hcalRecHitTable_cff::ieta, iEvent, hcalRecHitTable_cff::iphi, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, eostools::move(), and l1t::MuonCaloSum::setEtBits().
87 std::unique_ptr<MuonCaloSumBxCollection> towerSums(std::make_unique<MuonCaloSumBxCollection>());
88 std::unique_ptr<MuonCaloSumBxCollection> tower2x2s(std::make_unique<MuonCaloSumBxCollection>());
100 towerSums->setBXRange(iFirstBx, iLastBx);
101 tower2x2s->setBXRange(iFirstBx, iLastBx);
103 for (
int bx = iFirstBx;
bx <= iLastBx; ++
bx) {
104 std::map<int, MuonCaloSum> sums;
105 std::map<int, MuonCaloSum> regs;
120 int ieta2x2 = (
hwEta + 27) / 2;
121 int iphi2x2 =
hwPhi / 2;
122 int muon_idx = iphi2x2 * 28 + ieta2x2;
123 if (regs.count(muon_idx) == 0) {
126 regs.at(muon_idx).setEtBits(regs.at(muon_idx).etBits() +
hwPt);
132 int ietamax =
hwEta + detamax + 1;
137 int ietamu = (
ieta + 27) / 2;
138 int iphimax =
hwPhi + dphimax + 1;
140 int iphiwrapped =
iphi;
141 if (iphiwrapped < 0) {
143 }
else if (iphiwrapped > 71) {
146 int iphimu = iphiwrapped / 2;
147 int idxmu = iphimu * 28 + ietamu;
148 if (sums.count(idxmu) == 0) {
151 sums.at(idxmu).setEtBits(sums.at(idxmu).etBits() +
hwPt);
158 for (
auto it = sums.begin();
it != sums.end(); ++
it) {
159 if (
it->second.etBits() > 0) {
165 towerSums->push_back(
bx, sum);
169 for (
auto it = regs.begin();
it != regs.end(); ++
it) {
170 if (
it->second.etBits() > 0) {
171 tower2x2s->push_back(
bx,
it->second);
176 LogWarning(
"GlobalMuon") <<
"CaloTowers not found. Producing empty collections." << std::endl;
edm::EDGetTokenT< CaloTowerBxCollection > m_caloTowerToken
Abs< T >::type abs(const T &t)
Log< level::Warning, false > LogWarning