6 #include "UCTRegion.hh"
7 #include "UCTGeometry.hh"
8 #include "UCTLogging.hh"
10 UCTCard::UCTCard(uint32_t crt, uint32_t crd) :
15 regions.reserve(2*g.getNRegions());
16 for(uint32_t rgn = 0; rgn < g.getNRegions(); rgn++) {
18 regions.push_back(
new UCTRegion(crate, card,
true, rgn));
20 regions.push_back(
new UCTRegion(crate, card,
false, rgn));
25 for(uint32_t
i = 0;
i < regions.size();
i++) {
26 if(regions[
i] != 0)
delete regions[
i];
32 for(uint32_t
i = 0;
i < regions.size();
i++) {
33 if(regions[
i] != 0) regions[
i]->process();
34 cardSummary += regions[
i]->et();
39 bool UCTCard::clearEvent() {
41 for(uint32_t
i = 0;
i < regions.size();
i++) {
42 if(!regions[
i]->clearEvent())
return false;
47 bool UCTCard::setECALData(UCTTowerIndex
t,
bool ecalFG, uint32_t ecalET) {
49 uint32_t absCaloEta =
abs(t.first);
50 uint32_t absCaloPhi =
abs(t.second);
51 bool negativeEta =
false;
52 if(t.first < 0) negativeEta =
true;
53 uint32_t
i = g.getRegion(absCaloEta, absCaloPhi) * 2;
55 if(i > regions.size()) {
56 LOG_ERROR <<
"UCTCard: Incorrect region requested -- bailing" << std::endl;
59 return regions[
i]->setECALData(t, ecalFG, ecalET);
62 bool UCTCard::setHCALData(UCTTowerIndex t, uint32_t hcalFB, uint32_t hcalET) {
64 uint32_t absCaloEta =
abs(t.first);
65 uint32_t absCaloPhi =
abs(t.second);
66 bool negativeEta =
false;
67 if(t.first < 0) negativeEta =
true;
68 uint32_t i = g.getRegion(absCaloEta, absCaloPhi) * 2;
70 if(i > regions.size()) {
71 LOG_ERROR <<
"UCTCard: Incorrect region requested -- bailing" << std::endl;
74 return regions[
i]->setHCALData(t, hcalFB, hcalET);
77 const UCTRegion* UCTCard::getRegion(UCTRegionIndex
r)
const {
79 UCTTowerIndex t = g.getUCTTowerIndex(r);
80 uint32_t absCaloEta =
std::abs(t.first);
81 uint32_t absCaloPhi =
std::abs(t.second);
82 bool negativeEta =
false;
83 if(t.first < 0) negativeEta =
true;
84 return getRegion(negativeEta, absCaloEta, absCaloPhi);
87 const UCTRegion* UCTCard::getRegion(
bool nE, uint32_t cEta, uint32_t cPhi)
const {
89 uint32_t i = g.getRegion(cEta, cPhi) * 2;
91 if(i > regions.size()) {
92 LOG_ERROR <<
"UCTCard: Incorrect region requested -- bailing" << std::endl;
98 std::ostream&
operator<<(std::ostream& os,
const UCTCard&
c) {
100 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)