6 #include "UCTLayer1.hh" 10 #include "UCTRegion.hh" 11 #include "UCTTower.hh" 13 #include "UCTGeometry.hh" 14 #include "UCTLogging.hh" 18 UCTLayer1::UCTLayer1(
int fwv) : uctSummary(0),
fwVersion(fwv) {
20 crates.reserve(g.getNCrates());
21 for(uint32_t crate = 0; crate < g.getNCrates(); crate++) {
22 crates.push_back(
new UCTCrate(crate,
fwVersion));
26 UCTLayer1::~UCTLayer1() {
27 for(uint32_t
i = 0;
i < crates.size();
i++) {
28 if(crates[
i] != 0)
delete crates[
i];
32 bool UCTLayer1::clearEvent() {
33 for(uint32_t
i = 0;
i < crates.size();
i++) {
34 if(crates[
i] != 0) crates[
i]->clearEvent();
39 const UCTRegion* UCTLayer1::getRegion(
int regionEtaIndex, uint32_t regionPhiIndex)
const {
40 if(regionEtaIndex == 0 || (uint32_t)
std::abs(regionEtaIndex) > NRegionsInCard || regionPhiIndex >= MaxUCTRegionsPhi) {
45 UCTRegionIndex
r = UCTRegionIndex(regionEtaIndex, regionPhiIndex);
46 UCTTowerIndex
t = g.getUCTTowerIndex(r);
47 uint32_t absCaloEta =
std::abs(t.first);
48 uint32_t absCaloPhi =
std::abs(t.second);
49 uint32_t crt = g.getCrate(absCaloEta, absCaloPhi);
50 if(crt >= crates.size()) {
51 LOG_ERROR <<
"UCTLayer1::getRegion - Crate number is wrong - " << std::hex << crt
53 <<
" (rEta,rPhi)=(" << regionEtaIndex <<
","<< regionPhiIndex <<
")" 54 <<
" (eta,phi)=(" << absCaloEta <<
","<< absCaloPhi <<
")" << std::endl;
57 const UCTCrate* crate = crates[crt];
58 const UCTCard* card = crate->getCard(t);
59 const UCTRegion* region = card->getRegion(r);
63 const UCTTower* UCTLayer1::getTower(
int caloEta,
int caloPhi)
const {
65 LOG_ERROR <<
"UCT::getTower - Negative caloPhi is unacceptable -- bailing" << std::endl;
69 UCTTowerIndex twr = UCTTowerIndex(caloEta, caloPhi);
70 const UCTRegionIndex rgn = g.getUCTRegionIndex(twr);
71 const UCTRegion* region = getRegion(rgn);
72 const UCTTower* tower = region->getTower(twr);
76 bool UCTLayer1::setECALData(UCTTowerIndex t,
bool ecalFG, uint32_t ecalET) {
77 uint32_t absCaloEta =
std::abs(t.first);
78 uint32_t absCaloPhi =
std::abs(t.second);
80 uint32_t crt = g.getCrate(absCaloEta, absCaloPhi);
81 if(crt >= crates.size()) {
82 LOG_ERROR <<
"UCTLayer1::setECALData - Crate number is wrong - " << std::hex << crt <<
std::dec 83 <<
" (eta,phi)=(" << absCaloEta <<
","<< absCaloPhi <<
")" << std::endl;
86 UCTCrate* crate = crates[crt];
87 return crate->setECALData(t, ecalFG, ecalET);
90 bool UCTLayer1::setHCALData(UCTTowerIndex t, uint32_t hcalFB, uint32_t hcalET) {
91 uint32_t absCaloEta =
std::abs(t.first);
92 uint32_t absCaloPhi =
std::abs(t.second);
94 uint32_t crt = g.getCrate(absCaloEta, absCaloPhi);
95 if(crt >= crates.size()) {
96 LOG_ERROR <<
"UCTLayer1::setHCALData - Crate number is wrong - " << std::hex << crt <<
std::dec 97 <<
" (eta,phi)=(" << absCaloEta <<
","<< absCaloPhi <<
")" << std::endl;
100 UCTCrate* crate = crates[crt];
101 return crate->setHCALData(t, hcalFB, hcalET);
106 for(uint32_t
i = 0;
i < crates.size();
i++) {
108 crates[
i]->process();
109 uctSummary += crates[
i]->et();
117 os <<
"UCTLayer1: Summary " << l.uctSummary << std::endl;
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)
std::ostream & operator<<(std::ostream &os, const UCTLayer1 &l)