6 #include "UCTRegion.hh"
7 #include "UCTGeometry.hh"
8 #include "UCTLogging.hh"
10 UCTCard::UCTCard(uint32_t crt, uint32_t crd,
int fwv) :
16 regions.reserve(2*g.getNRegions());
17 for(uint32_t rgn = 0; rgn < g.getNRegions(); rgn++) {
19 regions.push_back(
new UCTRegion(crate, card,
true, rgn,
fwVersion));
21 regions.push_back(
new UCTRegion(crate, card,
false, rgn,
fwVersion));
26 for(uint32_t
i = 0;
i < regions.size();
i++) {
27 if(regions[
i] != 0)
delete regions[
i];
33 for(uint32_t
i = 0;
i < regions.size();
i++) {
34 if(regions[
i] != 0) regions[
i]->process();
35 cardSummary += regions[
i]->et();
40 bool UCTCard::clearEvent() {
42 for(uint32_t
i = 0;
i < regions.size();
i++) {
43 if(!regions[
i]->clearEvent())
return false;
48 bool UCTCard::setECALData(UCTTowerIndex
t,
bool ecalFG, uint32_t ecalET) {
50 uint32_t absCaloEta =
abs(t.first);
51 uint32_t absCaloPhi =
abs(t.second);
52 bool negativeEta =
false;
53 if(t.first < 0) negativeEta =
true;
54 uint32_t
i = g.getRegion(absCaloEta, absCaloPhi) * 2;
56 if(i > regions.size()) {
57 LOG_ERROR <<
"UCTCard: Incorrect region requested -- bailing" << std::endl;
60 return regions[
i]->setECALData(t, ecalFG, ecalET);
63 bool UCTCard::setHCALData(UCTTowerIndex t, uint32_t hcalFB, uint32_t hcalET) {
65 uint32_t absCaloEta =
abs(t.first);
66 uint32_t absCaloPhi =
abs(t.second);
67 bool negativeEta =
false;
68 if(t.first < 0) negativeEta =
true;
69 uint32_t i = g.getRegion(absCaloEta, absCaloPhi) * 2;
71 if(i > regions.size()) {
72 LOG_ERROR <<
"UCTCard: Incorrect region requested -- bailing" << std::endl;
75 return regions[
i]->setHCALData(t, hcalFB, hcalET);
78 const UCTRegion* UCTCard::getRegion(UCTRegionIndex
r)
const {
80 UCTTowerIndex t = g.getUCTTowerIndex(r);
81 uint32_t absCaloEta =
std::abs(t.first);
82 uint32_t absCaloPhi =
std::abs(t.second);
83 bool negativeEta =
false;
84 if(t.first < 0) negativeEta =
true;
85 return getRegion(negativeEta, absCaloEta, absCaloPhi);
88 const UCTRegion* UCTCard::getRegion(
bool nE, uint32_t cEta, uint32_t cPhi)
const {
90 uint32_t i = g.getRegion(cEta, cPhi) * 2;
92 if(i > regions.size()) {
93 LOG_ERROR <<
"UCTCard: Incorrect region requested -- bailing" << std::endl;
99 std::ostream&
operator<<(std::ostream& os,
const UCTCard&
c) {
100 if(c.cardSummary > 0)
101 os <<
"UCTCard: card = " << c.card <<
"; Summary = " << c.cardSummary << std::endl;
std::ostream & operator<<(std::ostream &out, const ALILine &li)
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)