57 virtual void endJob() ;
84 m_caloTowerToken = consumes <CaloTowerBxCollection> (m_caloLabel);
86 produces<GMTInputCaloSumBxCollection>(
"TriggerTowerSums");
87 produces<GMTInputCaloSumBxCollection>(
"TriggerTower2x2s");
113 std::map<int, GMTInputCaloSum> sums;
114 std::map<int, GMTInputCaloSum> regs;
122 int ieta2x2 = (twr.
hwEta() + 27) / 2;
123 int iphi2x2 = twr.
hwPhi() / 2;
124 int muon_idx = iphi2x2 * 28 + ieta2x2;
125 if (regs.count(muon_idx) == 0) {
128 regs.at(muon_idx).
setEtBits(regs.at(muon_idx).etBits() + twr.
hwPt());
133 for (
int ieta = -27; ieta < 28; ++ieta) {
134 for (
int iphi = 0; iphi < 72; ++iphi) {
136 int dphi = iphi - twr.
hwPhi();
144 if (deta <= 4 && dphi <= 4) {
145 int ietamu = (ieta + 27) / 2;
146 int iphimu = iphi / 2;
147 int idxmu = iphimu * 28 + ietamu;
148 if (sums.count(idxmu) == 0) {
151 sums.at(idxmu).
setEtBits(sums.at(idxmu).etBits() + twr.
hwPt());
159 LogError(
"GlobalMuon") <<
"CaloTowers not found." << std::endl;
162 for (
auto it = sums.begin(); it != sums.end(); ++it) {
163 if (it->second.etBits() > 0) {
169 towerSums->push_back(0, sum);
172 for (
auto it = regs.begin(); it != regs.end(); ++it) {
173 if (it->second.etBits() > 0) {
174 tower2x2s->push_back(0, it->second);
178 iEvent.
put(towerSums,
"TriggerTowerSums");
179 iEvent.
put(tower2x2s,
"TriggerTower2x2s");
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void addDefault(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Abs< T >::type abs(const T &t)
BXVector< GMTInputCaloSum > GMTInputCaloSumBxCollection