58 virtual void endJob()
override ;
85 m_caloTowerToken = consumes <CaloTowerBxCollection> (m_caloLabel);
87 produces<MuonCaloSumBxCollection>(
"TriggerTowerSums");
88 produces<MuonCaloSumBxCollection>(
"TriggerTower2x2s");
114 std::map<int, MuonCaloSum> sums;
115 std::map<int, MuonCaloSum> regs;
123 int ieta2x2 = (twr.
hwEta() + 27) / 2;
124 int iphi2x2 = twr.
hwPhi() / 2;
125 int muon_idx = iphi2x2 * 28 + ieta2x2;
126 if (regs.count(muon_idx) == 0) {
129 regs.at(muon_idx).
setEtBits(regs.at(muon_idx).etBits() + twr.
hwPt());
134 for (
int ieta = -27; ieta < 28; ++ieta) {
135 for (
int iphi = 0; iphi < 72; ++iphi) {
137 int dphi = iphi - twr.
hwPhi();
145 if (deta <= 4 && dphi <= 4) {
146 int ietamu = (ieta + 27) / 2;
147 int iphimu = iphi / 2;
148 int idxmu = iphimu * 28 + ietamu;
149 if (sums.count(idxmu) == 0) {
152 sums.at(idxmu).
setEtBits(sums.at(idxmu).etBits() + twr.
hwPt());
160 LogError(
"GlobalMuon") <<
"CaloTowers not found." << std::endl;
163 for (
auto it = sums.begin(); it != sums.end(); ++it) {
164 if (it->second.etBits() > 0) {
170 towerSums->push_back(0, sum);
173 for (
auto it = regs.begin(); it != regs.end(); ++it) {
174 if (it->second.etBits() > 0) {
175 tower2x2s->push_back(0, it->second);
179 iEvent.
put(towerSums,
"TriggerTowerSums");
180 iEvent.
put(tower2x2s,
"TriggerTower2x2s");
T getParameter(std::string const &) const
virtual void endRun(const edm::Run &, edm::EventSetup const &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
BXVector< MuonCaloSum > MuonCaloSumBxCollection
edm::EDGetTokenT< CaloTowerBxCollection > m_caloTowerToken
L1TMuonCaloSumProducer(const edm::ParameterSet &)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void endJob() override
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 void beginLuminosityBlock(const edm::LuminosityBlock &, edm::EventSetup const &) override
virtual void produce(edm::Event &, const edm::EventSetup &) override
virtual void beginRun(const edm::Run &, edm::EventSetup const &) override
virtual void endLuminosityBlock(const edm::LuminosityBlock &, edm::EventSetup const &) override
virtual void beginJob() override
~L1TMuonCaloSumProducer()
edm::InputTag m_caloLabel