171 uint32_t expectedTotalET = 0;
172 if (!
layer1->clearEvent()) {
173 LOG_ERROR <<
"UCT: Failed to clear event" << std::endl;
177 for (
const auto& ecalTp : *ecalTPs) {
180 int caloEta = ecalTp.id().ieta();
181 int caloPhi = ecalTp.id().iphi();
182 int et = ecalTp.compressedEt();
183 bool fgVeto = ecalTp.fineGrain();
184 UCTTowerIndex
t = UCTTowerIndex(caloEta, caloPhi);
185 if (!
layer1->setECALData(t, fgVeto, et)) {
186 LOG_ERROR <<
"UCT: Failed loading an ECAL tower" << std::endl;
189 expectedTotalET +=
et;
193 for (
const auto& hcalTp : *hcalTPs) {
196 int caloEta = hcalTp.id().ieta();
197 uint32_t absCaloEta =
std::abs(caloEta);
199 if (absCaloEta == 29) {
203 else if (hcalTp.id().version() == 0 && absCaloEta > 29) {
205 }
else if (absCaloEta <= 41) {
206 int caloPhi = hcalTp.id().iphi();
207 int et = hcalTp.SOI_compressedEt();
208 bool fg = hcalTp.t0().fineGrain(0);
209 bool fg2 = hcalTp.t0().fineGrain(1);
211 UCTTowerIndex t = UCTTowerIndex(caloEta, caloPhi);
212 uint32_t featureBits = 0;
216 if (absCaloEta > 29 && fg2)
218 if (!
layer1->setHCALData(t, featureBits, et)) {
219 LOG_ERROR <<
"caloEta = " << caloEta <<
"; caloPhi =" << caloPhi << std::endl;
220 LOG_ERROR <<
"UCT: Failed loading an HCAL tower" << std::endl;
223 expectedTotalET +=
et;
225 LOG_ERROR <<
"Illegal Tower: caloEta = " << caloEta <<
"; caloPhi =" << caloPhi <<
"; et = " << et
229 LOG_ERROR <<
"Illegal Tower: caloEta = " << caloEta << std::endl;
236 LOG_ERROR <<
"UCT: Failed to process layer 1" << std::endl;
241 for (uint32_t twr = 0; twr <
twrList.size(); twr++) {
256 vector<UCTCrate*> crates =
layer1->getCrates();
257 for (uint32_t crt = 0; crt < crates.size(); crt++) {
258 vector<UCTCard*> cards = crates[crt]->getCards();
259 for (uint32_t crd = 0; crd < cards.size(); crd++) {
260 vector<UCTRegion*>
regions = cards[crd]->getRegions();
261 for (uint32_t rgn = 0; rgn < regions.size(); rgn++) {
262 uint32_t
rawData = regions[rgn]->rawData();
263 uint32_t regionData = rawData & 0x0000FFFF;
264 uint32_t crate = regions[rgn]->getCrate();
265 uint32_t card = regions[rgn]->getCard();
266 uint32_t
region = regions[rgn]->getRegion();
267 bool negativeEta = regions[rgn]->isNegativeEta();
268 uint32_t rPhi = g.getUCTRegionPhiIndex(crate, card);
269 if (region < NRegionsInCard) {
275 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
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
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
edm::EDPutTokenT< CaloTowerBxCollection > towerPutToken
A calorimeter trigger region (sum of 4x4 trigger towers)
std::vector< L1CaloRegion > L1CaloRegionCollection
void push_back(int bx, T object)