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 96 of file L1TMuonCaloSumProducer.cc.
References funct::abs(), l1GtPatternGenerator_cfi::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(), LEDCalibrationChannels::ieta, iEvent, LEDCalibrationChannels::iphi, eostools::move(), and l1t::MuonCaloSum::setEtBits().
98 std::unique_ptr<MuonCaloSumBxCollection> towerSums(std::make_unique<MuonCaloSumBxCollection>());
99 std::unique_ptr<MuonCaloSumBxCollection> tower2x2s(std::make_unique<MuonCaloSumBxCollection>());
107 const int iFirstBx =
caloTowers->getFirstBX();
111 towerSums->setBXRange(iFirstBx, iLastBx);
112 tower2x2s->setBXRange(iFirstBx, iLastBx);
114 for (
int bx = iFirstBx;
bx <= iLastBx; ++
bx) {
115 std::map<int, MuonCaloSum> sums;
116 std::map<int, MuonCaloSum> regs;
131 int ieta2x2 = (
hwEta + 27) / 2;
132 int iphi2x2 =
hwPhi / 2;
133 int muon_idx = iphi2x2 * 28 + ieta2x2;
134 if (regs.count(muon_idx) == 0) {
137 regs.at(muon_idx).setEtBits(regs.at(muon_idx).etBits() +
hwPt);
143 int ietamax =
hwEta + detamax + 1;
148 int ietamu = (
ieta + 27) / 2;
149 int iphimax =
hwPhi + dphimax + 1;
151 int iphiwrapped =
iphi;
152 if (iphiwrapped < 0) {
154 }
else if (iphiwrapped > 71) {
157 int iphimu = iphiwrapped / 2;
158 int idxmu = iphimu * 28 + ietamu;
159 if (sums.count(idxmu) == 0) {
162 sums.at(idxmu).setEtBits(sums.at(idxmu).etBits() +
hwPt);
169 for (
auto it = sums.begin(); it != sums.end(); ++it) {
170 if (it->second.etBits() > 0) {
176 towerSums->push_back(
bx, sum);
180 for (
auto it = regs.begin(); it != regs.end(); ++it) {
181 if (it->second.etBits() > 0) {
182 tower2x2s->push_back(
bx, it->second);
187 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