28 declareInterface<IjFEXmetAlgo>(
this);
36 ATH_CHECK(m_jTowerContainerKey.initialize());
37 return StatusCode::SUCCESS;
44 if(!m_jTowerContainer.isValid()) {
45 ATH_MSG_ERROR(
"Could not retrieve jTowerContainer " << m_jTowerContainerKey.key());
46 return StatusCode::FAILURE;
48 return StatusCode::SUCCESS;
55 return StatusCode::SUCCESS;
61 ATH_MSG_DEBUG(
"---------------- jFEXmetAlgo::setup ----------------");
63 m_hemisphere = hemisphere;
68 for(
int ieta=8;ieta<16;ieta++){
69 m_FPGA[iphi].push_back(
FPGA[iphi][ieta]);
70 m_saturation = m_saturation || getTTowerSat(
FPGA[iphi][ieta]);
78 ATH_MSG_DEBUG(
"---------------- jFEXmetAlgo::setup ----------------");
80 m_hemisphere = hemisphere;
85 for(
int ieta=8;ieta<17;ieta++){
86 m_FPGA[iphi].push_back(
FPGA[iphi][ieta]);
87 m_saturation = m_saturation || getTTowerSat(
FPGA[iphi][ieta]);
90 m_FPGA_phi02.resize(16);
91 for(
int iphi=0;iphi<16;iphi++){
92 for(
int ieta=17;ieta<21;ieta++){
93 m_FPGA_phi02[iphi].push_back(
FPGA[iphi][ieta]);
94 m_saturation = m_saturation || getTTowerSat(
FPGA[iphi][ieta]);
97 m_FPGA_fcal.resize(8);
98 for(
int iphi=0;iphi<8;iphi++){
100 m_FPGA_fcal[iphi].push_back(
FPGA[iphi][ieta]);
101 m_saturation = m_saturation || getTTowerSat(
FPGA[iphi][ieta]);
110 ATH_MSG_DEBUG(
"---------------- jFEXmetAlgo::buildBarrelmet ----------------");
117 m_met_angle.resize(32,0);
119 for(
uint iphi=0;iphi<m_FPGA.size();iphi++){
120 for(
uint ieta=0;ieta<m_FPGA[iphi].size();ieta++){
121 m_met[iphi]+=getTTowerET(m_FPGA[iphi][ieta]);
123 const LVL1::jTower * tmpTower = m_jTowerContainer->findTower(m_FPGA[iphi][0]);
126 buildMetXComponent();
127 buildMetYComponent();
133 ATH_MSG_DEBUG(
"---------------- jFEXmetAlgo::buildFWDmet ----------------");
140 m_met.resize(m_FPGA.size(),0);
142 m_met_angle.resize(m_FPGA.size(),0);
144 for(
uint iphi=0;iphi<m_FPGA.size();iphi++){
145 for(
uint ieta=0;ieta<m_FPGA[iphi].size();ieta++){
146 m_met[iphi]+=getTTowerET(m_FPGA[iphi][ieta]);
148 const LVL1::jTower * tmpTower = m_jTowerContainer->findTower(m_FPGA[iphi][0]);
151 buildMetXComponent();
152 buildMetYComponent();
156 m_met.resize(m_FPGA_phi02.size(),0);
158 m_met_angle.resize(m_FPGA_phi02.size(),0);
160 for(
uint iphi=0;iphi<m_FPGA_phi02.size();iphi++){
161 for(
uint ieta=0;ieta<m_FPGA_phi02[iphi].size();ieta++){
162 m_met[iphi]+=getTTowerET(m_FPGA_phi02[iphi][ieta]);
164 const LVL1::jTower * tmpTower = m_jTowerContainer->findTower(m_FPGA_phi02[iphi][0]);
167 buildMetXComponent();
168 buildMetYComponent();
172 m_met.resize(m_FPGA_fcal.size(),0);
174 m_met_angle.resize(m_FPGA_fcal.size(),0);
176 for(
uint iphi=0;iphi<m_FPGA_fcal.size();iphi++){
177 for(
uint ieta=0;ieta<m_FPGA_fcal[iphi].size();ieta++){
178 m_met[iphi]+=getTTowerET(m_FPGA_fcal[iphi][ieta]);
180 const LVL1::jTower * tmpTower = m_jTowerContainer->findTower(m_FPGA_fcal[iphi][0]);
181 m_met_angle[iphi]=(
static_cast<int>(tmpTower->
iPhi()/4))*(
M_PI/8) +
M_PI/16;
183 buildMetXComponent();
184 buildMetYComponent();
192 m_met_Xcoord.clear();
193 m_met_Xcoord.resize(m_met.size(),0);
196 for(
uint iphi=0;iphi<m_met.size();iphi++){
198 m_met_Xcoord[iphi]= m_met[iphi]*
cos;
202 for(
auto met_val : m_met_Xcoord){
203 m_Totalmet_Xcoord += met_val;
210 return m_Totalmet_Xcoord >> m_firmware_bit_offset;
217 m_met_Ycoord.clear();
218 m_met_Ycoord.resize(m_met.size(),0);
220 for(
uint iphi=0;iphi<m_met.size();iphi++){
222 m_met_Ycoord[iphi]= m_met[iphi]*
sin;
226 for(
auto met_val : m_met_Ycoord){
227 m_Totalmet_Ycoord += met_val;
234 return m_Totalmet_Ycoord >> m_firmware_bit_offset;
243 if(m_map_Etvalues.find(TTID) != m_map_Etvalues.end()) {
244 return m_map_Etvalues[TTID][1];
262 const LVL1::jTower * tmpTower = m_jTowerContainer->findTower(TTID);
268 m_map_Etvalues=et_map;