29 declareInterface<IjFEXForwardElecAlgo>(
this);
37 ATH_CHECK(m_jTowerContainerKey.initialize());
45 return StatusCode::SUCCESS;
51 if(! m_jTowerContainer.isValid()) {
52 ATH_MSG_ERROR(
"Could not retrieve jTowerContainer " << m_jTowerContainerKey.key());
53 return StatusCode::FAILURE;
55 return StatusCode::SUCCESS;
59 return StatusCode::SUCCESS;
73 const LVL1::jTower *tmpTower = m_jTowerContainer->findTower(ttID);
82 if(m_map_Etvalues_EM.find(ttID) != m_map_Etvalues_EM.end()) {
83 TT_EtEM = m_map_Etvalues_EM.at(ttID)[0];
86 if(m_map_Etvalues_HAD.find(ttID) != m_map_Etvalues_HAD.end()) {
87 TT_EtHad = m_map_Etvalues_HAD.at(ttID)[0];
90 return {TT_EtEM, TT_EtHad};
98 const LVL1::jTower * tmpTower = m_jTowerContainer->findTower(ttID);
103 std::unordered_map<
int,std::vector<int> > etmapEM,
104 std::unordered_map<
int,std::vector<int> > etmapHAD) {
105 m_map_Etvalues_EM=etmapEM;
106 m_map_Etvalues_HAD=etmapHAD;
111 auto [centreTT_EtEM,centreTT_EtHad] = getEtEmHad(seedTTID);
114 auto it_seed_map = m_SearchGTauMap.find(seedTTID);
115 if(it_seed_map == m_SearchGTauMap.end()) {
116 ATH_MSG_ERROR(
"Could not find TT" << seedTTID <<
" in the seach (>) local maxima for tau/em file.");
119 for (
const auto& gtt : it_seed_map->second ){
120 auto [tmp_EtEM,tmp_EtHad] = getEtEmHad(gtt);
121 if(tmp_EtEM>=centreTT_EtEM) {
129 auto it_seed_map = m_SearchGeTauMap.find(seedTTID);
130 if(it_seed_map == m_SearchGeTauMap.end()) {
131 ATH_MSG_ERROR(
"Could not find TT" << seedTTID <<
" in the seach (>=) local maxima for tau/em file.");
134 for (
const auto& gtt : it_seed_map->second ){
135 auto [tmp_EtEM,tmp_EtHad] = getEtEmHad(gtt);
136 if( tmp_EtEM>centreTT_EtEM) {
148 int direction = m_jfex < 3 ? -1 : +1;
150 std::vector<std::pair<int,int>> neighbours;
156 neighbours = { {neta , nphi+1},
164 neighbours = { {neta, nphi+1},
166 {neta-direction, nphi},
167 {neta+direction, nphi/2}
172 neighbours = { {neta, nphi+1},
174 {neta+direction, nphi},
175 {neta-direction, 2*nphi+0},
176 {neta-direction, 2*nphi+1},
181 neighbours = { {neta , nphi+1},
189 neighbours = { {neta, nphi+1},
191 {neta-direction, nphi},
192 {neta+2*direction, nphi/2}
198 neighbours = { {neta-2*direction, 2*nphi+0},
199 {neta-2*direction, 2*nphi+1},
200 {neta+direction, nphi}
205 neighbours = { {neta+1, nphi},
211 neighbours = { {neta-direction, nphi}
214 ATH_MSG_ERROR(
"Eta index " << neta <<
" (side: "<< (direction>0?
"A":
"C") <<
") does not seem to belong to any valid seed region");
218 for (
const auto& candEtaPhi: neighbours) {
219 uint candID = m_jFEXalgoTowerID[candEtaPhi.second][candEtaPhi.first];
220 const auto [candTT_EtEM, candTT_EtHad] = getEtEmHad(candID);
232 std::unordered_map<uint, LVL1::jFEXForwardElecInfo> clusterList;
233 std::vector<int> lower_centre_neta;
234 std::vector<int> upper_centre_neta;
263 for(
uint region = 0; region<3; region++) {
264 for(
int nphi = lower_centre_nphi[region]; nphi < upper_centre_nphi[region]; nphi++) {
265 for(
int neta = lower_centre_neta[region]; neta < upper_centre_neta[region]; neta++) {
274 uint ttID = m_jFEXalgoTowerID[nphi][neta];
275 if(ttID == 0)
continue;
277 if(!isValidSeed(ttID))
continue;
281 elCluster.
setup(m_jfex, ttID, neta, nphi);
282 const auto [centreTT_eta, centreTT_phi] = getEtaPhi(ttID);
283 const auto [centreTT_EtEM, centreTT_EtHad] = getEtEmHad(ttID);
293 findAndFillNextTT(elCluster, neta, nphi);
298 auto it_iso_map = m_IsoMap.find(ttID);
299 if(it_iso_map != m_IsoMap.end()) {
300 for(
const auto& gtt : it_iso_map->second){
301 auto [tmp_EtEM,tmp_EtHad] = getEtEmHad(gtt);
306 ATH_MSG_ERROR(
"Could not find TT" << ttID <<
" in jEM isolation map file.");
310 if(fabs(centreTT_eta) < 3.2) {
318 auto it_frac1_map = m_Frac1Map.find(ttID);
319 if(it_frac1_map != m_Frac1Map.end()) {
320 for(
const auto& gtt : it_frac1_map->second){
321 auto [tmp_EtEM,tmp_EtHad] = getEtEmHad(gtt);
322 sumEtHad1 += tmp_EtHad;
326 ATH_MSG_ERROR(
"Could not find TT" << ttID <<
" in jEM frac1 map file.");
333 auto it_frac2_map = m_Frac2Map.find(ttID);
334 if(it_frac2_map != m_Frac2Map.end()) {
335 for(
const auto& gtt : it_frac2_map->second) {
336 auto [tmp_EtEM,tmp_EtHad] = getEtEmHad(gtt);
337 sumEtHad2 += tmp_EtHad;
341 ATH_MSG_ERROR(
"Could not find TT" << ttID <<
" in jEM frac2 map file.");
347 clusterList[ttID] = elCluster;
358 if ( !myfile.is_open() ){
360 return StatusCode::FAILURE;
364 while ( std::getline (myfile, myline) ) {
366 if(myline[0] ==
'#')
continue;
369 std::stringstream oneLine(myline);
372 std::vector<unsigned int> elements;
374 while(std::getline(oneLine, element,
' '))
376 elements.push_back(std::stoi(element));
380 if(elements.size() < 1){
382 return StatusCode::FAILURE;
386 unsigned int TTID = elements.at(0);
389 elements.erase(elements.begin());
390 fillingMap[TTID] = elements;
394 return StatusCode::SUCCESS;