175 uint32_t expectedTotalET = 0;
176 if (!
layer1->clearEvent()) {
177 LOG_ERROR <<
"UCT: Failed to clear event" << std::endl;
181 for (
const auto& ecalTp : *ecalTPs) {
184 int caloEta = ecalTp.id().ieta();
185 int caloPhi = ecalTp.id().iphi();
186 int et = ecalTp.compressedEt();
187 bool fgVeto = ecalTp.fineGrain();
188 UCTTowerIndex
t = UCTTowerIndex(caloEta, caloPhi);
189 if (!
layer1->setECALData(
t, fgVeto,
et)) {
190 LOG_ERROR <<
"UCT: Failed loading an ECAL tower" << std::endl;
193 expectedTotalET +=
et;
197 for (
const auto& hcalTp : *hcalTPs) {
200 int caloEta = hcalTp.id().ieta();
201 uint32_t absCaloEta =
std::abs(caloEta);
203 if (absCaloEta == 29) {
207 else if (hcalTp.id().version() == 0 && absCaloEta > 29) {
209 }
else if (absCaloEta <= 41) {
210 int caloPhi = hcalTp.id().iphi();
211 int et = hcalTp.SOI_compressedEt();
212 bool fg = hcalTp.t0().fineGrain(0);
213 bool fg2 = hcalTp.t0().fineGrain(1);
214 bool fg3 = hcalTp.t0().fineGrain(2);
215 bool fg4 = hcalTp.t0().fineGrain(3);
218 UCTTowerIndex
t = UCTTowerIndex(caloEta, caloPhi);
219 uint32_t featureBits = 0;
220 if (absCaloEta > 29) {
226 }
else if (absCaloEta < 16)
227 featureBits |= (fg | ((!fg2) & (fg3 | fg4)));
228 if (!
layer1->setHCALData(
t, featureBits,
et)) {
229 LOG_ERROR <<
"caloEta = " << caloEta <<
"; caloPhi =" << caloPhi << std::endl;
230 LOG_ERROR <<
"UCT: Failed loading an HCAL tower" << std::endl;
233 expectedTotalET +=
et;
235 LOG_ERROR <<
"Illegal Tower: caloEta = " << caloEta <<
"; caloPhi =" << caloPhi <<
"; et = " <<
et 239 LOG_ERROR <<
"Illegal Tower: caloEta = " << caloEta << std::endl;
246 LOG_ERROR <<
"UCT: Failed to process layer 1" << std::endl;
251 for (uint32_t twr = 0; twr <
twrList.size(); twr++) {
266 vector<UCTCrate*> crates =
layer1->getCrates();
267 for (uint32_t crt = 0; crt < crates.size(); crt++) {
268 vector<UCTCard*> cards = crates[crt]->getCards();
269 for (uint32_t crd = 0; crd < cards.size(); crd++) {
270 vector<UCTRegion*>
regions = cards[crd]->getRegions();
271 for (uint32_t rgn = 0; rgn <
regions.size(); rgn++) {
273 uint32_t regionData =
rawData & 0x0000FFFF;
274 uint32_t crate =
regions[rgn]->getCrate();
275 uint32_t card =
regions[rgn]->getCard();
277 bool negativeEta =
regions[rgn]->isNegativeEta();
278 uint32_t rPhi =
g.getUCTRegionPhiIndex(crate, card);
279 if (
region < NRegionsInCard) {
285 rgnCollection.push_back(
L1CaloRegion((uint16_t)regionData, (
unsigned)rEta, (
unsigned)rPhi, (int16_t)0));
edm::EDGetTokenT< HcalTrigPrimDigiCollection > hcalTPSource
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
std::unique_ptr< UCTLayer1 > layer1
edm::EDPutTokenT< L1CaloRegionCollection > regionPutToken
std::vector< UCTTower * > twrList
Abs< T >::type abs(const T &t)
void setHwEtRatio(int ratio)
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTPSource
edm::EDPutTokenT< CaloTowerBxCollection > towerPutToken
A calorimeter trigger region (sum of 4x4 trigger towers)
std::vector< L1CaloRegion > L1CaloRegionCollection
void push_back(int bx, T object)