33 declareInterface<IjFEXForwardJetsAlgo>(
this);
42 ATH_CHECK(m_jFEXForwardJetsAlgo_jTowerContainerKey.initialize());
52 return StatusCode::SUCCESS;
59 if(! m_jTowerContainer.isValid()) {
60 ATH_MSG_ERROR(
"Could not retrieve jTowerContainer " << m_jFEXForwardJetsAlgo_jTowerContainerKey.key());
62 return StatusCode::FAILURE;
65 return StatusCode::SUCCESS;
69 return StatusCode::SUCCESS;
84 const LVL1::jTower *tmpTower = m_jTowerContainer->findTower(TTID);
93 auto itr = m_map_Etvalues.find(TTID);
95 if( itr == m_map_Etvalues.end()) {
99 return itr->second[0];
104 std::unordered_map<int, jFEXForwardJetsInfo> FCALJetTowerIDLists;
106 std::vector<int> lower_centre_neta;
107 std::vector<int> upper_centre_neta;
136 for(
int myCounter = 0; myCounter<3; myCounter++) {
137 for(
int centre_nphi = lower_centre_nphi[myCounter]; centre_nphi < upper_centre_nphi[myCounter]; centre_nphi++) {
138 for(
int centre_neta = lower_centre_neta[myCounter]; centre_neta < upper_centre_neta[myCounter]; centre_neta++) {
141 int myTTIDKey = m_jFEXalgoTowerID[centre_nphi][centre_neta];
148 bool bool_isLM =
false;
149 bool bool_condCorr2 =
false;
150 bool bool_isLMabove =
false;
151 bool bool_condCorr =
false;
154 unsigned int elemCorr = elementsCorr(myTTIDKey);
155 unsigned int elemCorr2 = elementsCorr2(myTTIDKey);
157 if(elemCorr == 0 and elemCorr2 == 0){
158 bool_isLM = isLM(myTTIDKey);
161 else if(elemCorr == 0 and elemCorr2 > 0){
162 bool_isLM = isLM(myTTIDKey);
163 bool_condCorr2 = condCorr2(myTTIDKey);
164 iAmJet = bool_isLM and bool_condCorr2;
166 else if(elemCorr > 0 and elemCorr2 == 0){
167 bool_isLM = isLM(myTTIDKey);
168 bool_isLMabove = isLMabove(myTTIDKey);
169 bool_condCorr = condCorr(myTTIDKey);
170 iAmJet = bool_isLM or (bool_isLMabove and bool_condCorr);
172 else if(elemCorr > 0 and elemCorr2 > 0){
173 bool_isLM = isLM(myTTIDKey);
174 bool_condCorr2 = condCorr2(myTTIDKey);
175 bool_isLMabove = isLMabove(myTTIDKey);
176 bool_condCorr = condCorr(myTTIDKey);
177 iAmJet = (bool_isLM and bool_condCorr2) or (bool_isLMabove and bool_condCorr);
181 if (SumEtSeed(myTTIDKey) <= seedThreshold){
193 const auto [centreTT_eta,centreTT_phi] = globalEtaPhi(myTTIDKey);
201 auto it_seed_map = m_SeedRingMap.find(myTTIDKey);
202 if(it_seed_map == m_SeedRingMap.end()) {
203 ATH_MSG_ERROR(
"Could not find TT" << myTTIDKey <<
" in Jet seed file.");
206 for(
const auto& seedTT : it_seed_map->second){
208 saturation = saturation || getTTowerSat(seedTT);
209 TriggerTowerInformation.
addToSeedET(getEt(seedTT));
213 it_seed_map = m_1stRingMap.find(myTTIDKey);
214 if(it_seed_map == m_1stRingMap.end()) {
215 ATH_MSG_ERROR(
"Could not find TT" << myTTIDKey <<
" in 1st Energy ring file.");
218 for(
const auto& firstER_TT : it_seed_map->second){
220 saturation = saturation || getTTowerSat(firstER_TT);
221 if(m_storeEnergyRingTTIDs) {
227 if(saturation) TriggerTowerInformation.
setSRjetSat();
231 it_seed_map = m_2ndRingMap.find(myTTIDKey);
232 if(it_seed_map == m_2ndRingMap.end()) {
233 ATH_MSG_ERROR(
"Could not find TT" << myTTIDKey <<
" in 2nd Energy ring file.");
236 for(
const auto& secondER_TT : it_seed_map->second){
238 saturation = saturation || getTTowerSat(secondER_TT);
239 if(m_storeEnergyRingTTIDs) {
245 if(saturation) TriggerTowerInformation.
setLRjetSat();
248 FCALJetTowerIDLists[myTTIDKey] = std::move(TriggerTowerInformation);
255 return FCALJetTowerIDLists;
261 auto it_seed_map = m_SeedRingMap.find(TTID);
262 if(it_seed_map == m_SeedRingMap.end()) {
263 ATH_MSG_ERROR(
"Could not find TT" << TTID <<
" in Jet seed file.");
267 for(
const auto& seedTT : it_seed_map->second){
268 summedEt += getEt(seedTT);
276 int CentralSeedEt = SumEtSeed(TTID);
279 auto it_seed_map = m_SearchGMap.find(TTID);
280 if(it_seed_map == m_SearchGMap.end()) {
281 ATH_MSG_ERROR(
"Could not find TT" << TTID <<
" in the seach (>) local maxima for jets file.");
286 for (
const auto& Gtt : it_seed_map->second ){
288 int tmpEt = SumEtSeed(Gtt);
289 if( !(CentralSeedEt > tmpEt) ){
301 it_seed_map = m_SearchGeMap.find(TTID);
302 if(it_seed_map == m_SearchGeMap.end()) {
303 ATH_MSG_ERROR(
"Could not find TT" << TTID <<
" in the seach (>=) local maxima for jets file.");
307 bool greaterEqual =
true;
308 for (
const auto& Gtt : it_seed_map->second ){
310 int tmpEt = SumEtSeed(Gtt);
311 if( !(CentralSeedEt >= tmpEt) ){
312 greaterEqual =
false;
327 auto it_seed_map = m_CorrMap.find(TTID);
328 if(it_seed_map == m_CorrMap.end()) {
329 ATH_MSG_ERROR(
"Could not find TT" << TTID <<
" in the correction (LM above) for jets file.");
334 const auto & GttVec = it_seed_map->second;
335 if (! GttVec.empty())
return isLM(GttVec.front());
340 auto it_seed_map = m_CorrMap.find(TTID);
341 if(it_seed_map == m_CorrMap.end()) {
342 ATH_MSG_ERROR(
"Could not find TT" << TTID <<
" in the condition (greater than) for jets file.");
346 return (it_seed_map->second).size();
352 auto it_seed_map = m_CorrMap.find(TTID);
353 if(it_seed_map == m_CorrMap.end()) {
354 ATH_MSG_ERROR(
"Could not find TT" << TTID <<
" in the condition (greater than) for jets file.");
359 if( (it_seed_map->second).size() == 0){
360 ATH_MSG_ERROR(
"Elements=0 in condCorr function for element"<< TTID <<
". This should never happend. REPORT IT!");
364 int centralEt = getEt(TTID);
365 int centralSeed = SumEtSeed(TTID);
366 for (
const auto& Gtt : it_seed_map->second ){
368 int tmpEt = getEt(Gtt);
369 int tmpSeedEt = SumEtSeed(Gtt);
370 if( !(centralEt > tmpEt && centralSeed >= tmpSeedEt ) ){
380 auto it_seed_map = m_Corr2Map.find(TTID);
381 if(it_seed_map == m_Corr2Map.end()) {
382 ATH_MSG_ERROR(
"Could not find TT" << TTID <<
" in the condition (greater than) for jets file.");
386 return (it_seed_map->second).size();
392 auto it_seed_map = m_Corr2Map.find(TTID);
393 if(it_seed_map == m_Corr2Map.end()) {
394 ATH_MSG_ERROR(
"Could not find TT" << TTID <<
" in the correction (greater or equal) file.");
398 int centralEt = getEt(TTID);
399 int centralSeed = SumEtSeed(TTID);
401 for (
const auto& Gtt : it_seed_map->second ){
403 int tmpEt = getEt(Gtt);
406 if( !( centralEt >= tmpEt || centralSeed > SumEtSeed(Gtt) ) ){
417 std::unordered_map<int, jFEXForwardJetsInfo> localMaximas = FcalJetsTowerIDLists(seedThreshold);
423 m_map_Etvalues=std::move(et_map);
432 const LVL1::jTower * tmpTower = m_jTowerContainer->findTower(TTID);
443 if ( !myfile.is_open() ){
445 return StatusCode::FAILURE;
449 while ( std::getline (myfile, myline) ) {
452 if(myline[0] ==
'#')
continue;
455 std::stringstream oneLine(myline);
458 std::vector<unsigned int> elements;
460 while(std::getline(oneLine, element,
' '))
462 elements.push_back(std::stoi(element));
466 if(elements.size() < 1){
468 return StatusCode::FAILURE;
472 unsigned int TTID = elements.at(0);
475 elements.erase(elements.begin());
477 fillingMap[TTID] = std::move(elements);
482 return StatusCode::SUCCESS;