179 uint32_t expectedTotalET = 0;
180 if(!
layer1->clearEvent()) {
181 LOG_ERROR <<
"UCT: Failed to clear event" << std::endl;
185 for (
const auto& ecalTp : *ecalTPs ) {
187 int caloEta = ecalTp.id().ieta();
188 int caloPhi = ecalTp.id().iphi();
189 int et = ecalTp.compressedEt();
190 bool fgVeto = ecalTp.fineGrain();
191 UCTTowerIndex
t = UCTTowerIndex(caloEta, caloPhi);
192 if(!
layer1->setECALData(t,fgVeto,et)) {
193 LOG_ERROR <<
"UCT: Failed loading an ECAL tower" << std::endl;
196 expectedTotalET +=
et;
201 for (
const auto& hcalTp : *hcalTPs ) {
203 int caloEta = hcalTp.id().ieta();
204 uint32_t absCaloEta =
std::abs(caloEta);
206 if(absCaloEta == 29) {
210 else if(hcalTp.id().version() == 0 && absCaloEta > 29) {
213 else if(absCaloEta <= 41) {
214 int caloPhi = hcalTp.id().iphi();
215 int et = hcalTp.SOI_compressedEt();
216 bool fg = hcalTp.t0().fineGrain(0);
217 bool fg2 = hcalTp.t0().fineGrain(1);
219 UCTTowerIndex t = UCTTowerIndex(caloEta, caloPhi);
220 uint32_t featureBits = 0;
221 if(fg) featureBits |= 0b01;
223 if(absCaloEta > 29 && fg2) featureBits |= 0b10;
224 if(!
layer1->setHCALData(t, featureBits, et)) {
225 LOG_ERROR <<
"caloEta = " << caloEta <<
"; caloPhi =" << caloPhi << std::endl;
226 LOG_ERROR <<
"UCT: Failed loading an HCAL tower" << std::endl;
229 expectedTotalET +=
et;
232 LOG_ERROR <<
"Illegal Tower: caloEta = " << caloEta <<
"; caloPhi =" << caloPhi <<
"; et = " << et << std::endl;
236 LOG_ERROR <<
"Illegal Tower: caloEta = " << caloEta << std::endl;
243 LOG_ERROR <<
"UCT: Failed to process layer 1" << std::endl;
248 for(uint32_t twr = 0; twr <
twrList.size(); twr++) {
263 vector<UCTCrate*> crates =
layer1->getCrates();
264 for(uint32_t crt = 0; crt < crates.size(); crt++) {
265 vector<UCTCard*> cards = crates[crt]->getCards();
266 for(uint32_t crd = 0; crd < cards.size(); crd++) {
267 vector<UCTRegion*>
regions = cards[crd]->getRegions();
268 for(uint32_t rgn = 0; rgn < regions.size(); rgn++) {
269 uint32_t rawData = regions[rgn]->rawData();
270 uint32_t regionData = rawData & 0x0000FFFF;
271 uint32_t crate = regions[rgn]->getCrate();
272 uint32_t card = regions[rgn]->getCard();
273 uint32_t region = regions[rgn]->getRegion();
274 bool negativeEta = regions[rgn]->isNegativeEta();
275 uint32_t rPhi = g.getUCTRegionPhiIndex(crate, card);
276 if(region < NRegionsInCard) {
277 uint32_t rEta = 10 - region;
278 if(!negativeEta) rEta = 11 + region;
279 rgnCollection.push_back(
L1CaloRegion((uint16_t) regionData, (
unsigned) rEta, (
unsigned) rPhi, (int16_t) 0));
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< HcalTrigPrimDigiCollection > hcalTPSource
std::vector< UCTTower * > twrList
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
Abs< T >::type abs(const T &t)
void setHwEtRatio(int ratio)
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTPSource
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
edm::EDPutTokenT< CaloTowerBxCollection > towerPutToken
et
define resolution functions of each parameter
A calorimeter trigger region (sum of 4x4 trigger towers)
std::vector< L1CaloRegion > L1CaloRegionCollection
void push_back(int bx, T object)