182 uint32_t expectedTotalET = 0;
183 if(!
layer1->clearEvent()) {
184 LOG_ERROR <<
"UCT: Failed to clear event" << std::endl;
188 for (
const auto& ecalTp : *ecalTPs ) {
189 if (
unpackEcalMask && ((ecalTp.sample(0).raw()>>13) & 0x1) )
continue;
190 int caloEta = ecalTp.id().ieta();
191 int caloPhi = ecalTp.id().iphi();
192 int et = ecalTp.compressedEt();
193 bool fgVeto = ecalTp.fineGrain();
194 UCTTowerIndex
t = UCTTowerIndex(caloEta, caloPhi);
195 if(!
layer1->setECALData(t,fgVeto,et)) {
196 LOG_ERROR <<
"UCT: Failed loading an ECAL tower" << std::endl;
199 expectedTotalET +=
et;
204 for (
const auto& hcalTp : *hcalTPs ) {
205 if (
unpackHcalMask && ((hcalTp.sample(0).raw()>>13) & 0x1) )
continue;
206 int caloEta = hcalTp.id().ieta();
207 uint32_t absCaloEta =
abs(caloEta);
209 if(absCaloEta == 29) {
213 else if(hcalTp.id().version() == 0 && absCaloEta > 29) {
216 else if(absCaloEta <= 41) {
217 int caloPhi = hcalTp.id().iphi();
218 int et = hcalTp.SOI_compressedEt();
219 bool fg = hcalTp.t0().fineGrain(0);
220 bool fg2 = hcalTp.t0().fineGrain(1);
222 UCTTowerIndex t = UCTTowerIndex(caloEta, caloPhi);
223 uint32_t featureBits = 0;
224 if(fg) featureBits |= 0b01;
226 if(absCaloEta > 29 && fg2) featureBits |= 0b10;
227 if(!
layer1->setHCALData(t, featureBits, et)) {
228 LOG_ERROR <<
"caloEta = " << caloEta <<
"; caloPhi =" << caloPhi << std::endl;
229 LOG_ERROR <<
"UCT: Failed loading an HCAL tower" << std::endl;
232 expectedTotalET +=
et;
235 LOG_ERROR <<
"Illegal Tower: caloEta = " << caloEta <<
"; caloPhi =" << caloPhi <<
"; et = " << et << std::endl;
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++) {
260 towersColl->push_back(theBX, caloTower);
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++) {
272 uint32_t rawData = regions[rgn]->rawData();
273 uint32_t regionData = rawData & 0x0000FFFF;
274 uint32_t crate = regions[rgn]->getCrate();
275 uint32_t card = regions[rgn]->getCard();
276 uint32_t region = regions[rgn]->getRegion();
277 bool negativeEta = regions[rgn]->isNegativeEta();
278 uint32_t rPhi = g.getUCTRegionPhiIndex(crate, card);
279 if(region < NRegionsInCard) {
280 uint32_t rEta = 10 - region;
281 if(!negativeEta) rEta = 11 + region;
282 rgnCollection->push_back(
L1CaloRegion((uint16_t) regionData, (
unsigned) rEta, (
unsigned) rPhi, (int16_t) 0));
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
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
Abs< T >::type abs(const T &t)
void setHwEtRatio(int ratio)
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTPSource
et
define resolution functions of each parameter
A calorimeter trigger region (sum of 4x4 trigger towers)
std::vector< L1CaloRegion > L1CaloRegionCollection