29 declareInterface<IjFEXForwardJetsAlgo>(
this);
48 return StatusCode::SUCCESS;
58 return StatusCode::FAILURE;
61 return StatusCode::SUCCESS;
65 return StatusCode::SUCCESS;
95 return itr->second[0];
100 std::unordered_map<int, jFEXForwardJetsInfo> FCALJetTowerIDLists;
102 std::vector<int> lower_centre_neta;
103 std::vector<int> upper_centre_neta;
132 for(
int myCounter = 0; myCounter<3; myCounter++) {
133 for(
int centre_nphi = lower_centre_nphi[myCounter]; centre_nphi < upper_centre_nphi[myCounter]; centre_nphi++) {
134 for(
int centre_neta = lower_centre_neta[myCounter]; centre_neta < upper_centre_neta[myCounter]; centre_neta++) {
144 bool bool_isLM =
false;
145 bool bool_condCorr2 =
false;
146 bool bool_isLMabove =
false;
147 bool bool_condCorr =
false;
153 if(elemCorr == 0 and elemCorr2 == 0){
154 bool_isLM =
isLM(myTTIDKey);
157 else if(elemCorr == 0 and elemCorr2 > 0){
158 bool_isLM =
isLM(myTTIDKey);
160 iAmJet = bool_isLM and bool_condCorr2;
162 else if(elemCorr > 0 and elemCorr2 == 0){
163 bool_isLM =
isLM(myTTIDKey);
165 bool_condCorr =
condCorr(myTTIDKey);
166 iAmJet = bool_isLM or (bool_isLMabove and bool_condCorr);
168 else if(elemCorr > 0 and elemCorr2 > 0){
169 bool_isLM =
isLM(myTTIDKey);
172 bool_condCorr =
condCorr(myTTIDKey);
173 iAmJet = (bool_isLM and bool_condCorr2) or (bool_isLMabove and bool_condCorr);
177 if (
SumEtSeed(myTTIDKey) <= seedThreshold){
189 const auto [centreTT_eta,centreTT_phi] =
globalEtaPhi(myTTIDKey);
199 ATH_MSG_ERROR(
"Could not find TT" << myTTIDKey <<
" in Jet seed file.");
202 for(
const auto& seedTT : it_seed_map->second){
211 ATH_MSG_ERROR(
"Could not find TT" << myTTIDKey <<
" in 1st Energy ring file.");
214 for(
const auto& firstER_TT : it_seed_map->second){
223 if(saturation) TriggerTowerInformation.
setSRjetSat();
229 ATH_MSG_ERROR(
"Could not find TT" << myTTIDKey <<
" in 2nd Energy ring file.");
232 for(
const auto& secondER_TT : it_seed_map->second){
241 if(saturation) TriggerTowerInformation.
setLRjetSat();
244 FCALJetTowerIDLists[myTTIDKey] = std::move(TriggerTowerInformation);
251 return FCALJetTowerIDLists;
259 ATH_MSG_ERROR(
"Could not find TT" << TTID <<
" in Jet seed file.");
263 for(
const auto& seedTT : it_seed_map->second){
265 const int thisEt =
getEt(seedTT);
267 summedEt +=
getEt(seedTT);
281 ATH_MSG_ERROR(
"Could not find TT" << TTID <<
" in the search (>) local maxima for jets file.");
286 for (
const auto& Gtt : it_seed_map->second ){
289 if( !(CentralSeedEt > tmpEt) ){
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 ){
311 if( !(CentralSeedEt >= tmpEt) ){
312 greaterEqual =
false;
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());
342 ATH_MSG_ERROR(
"Could not find TT" << TTID <<
" in the condition (greater than) for jets file.");
346 return (it_seed_map->second).size();
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);
366 for (
const auto& Gtt : it_seed_map->second ){
368 int tmpEt =
getEt(Gtt);
370 if( !(centralEt > tmpEt && centralSeed >= tmpSeedEt ) ){
382 ATH_MSG_ERROR(
"Could not find TT" << TTID <<
" in the condition (greater than) for jets file.");
386 return (it_seed_map->second).size();
394 ATH_MSG_ERROR(
"Could not find TT" << TTID <<
" in the correction (greater or equal) file.");
398 int centralEt =
getEt(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);
441 std::ifstream myfile(fileName);
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){
467 ATH_MSG_ERROR(
"Unexpected number of elemennts (<1 expected) in file: "<< fileName);
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;
#define ATH_CHECK
Evaluate an expression and check for errors.
static constexpr int jFEX_algoSpace_C_EMB_start_eta
static constexpr int jFEX_wide_algoSpace_width
static constexpr int jFEX_algoSpace_A_FCAL_end_eta
static constexpr int jFEX_algoSpace_C_EMB_end_eta
static constexpr int jFEX_algoSpace_EMIE_end_phi
static constexpr int jFEX_algoSpace_C_FCAL_end_eta
static constexpr int jFEX_algoSpace_A_upperEM_eta
static constexpr int jFEX_algoSpace_A_EMB_eta
static constexpr int jFEX_algoSpace_A_FCAL_start_eta
static constexpr int jFEX_algoSpace_C_upperEM_eta
static constexpr int jFEX_algoSpace_C_FCAL_start_eta
static constexpr int jFEX_algoSpace_A_EMIE_eta
static constexpr int jFEX_algoSpace_A_lowerEM_eta
static constexpr int jFEX_algoSpace_FCAL_end_phi
static constexpr int jFEX_algoSpace_EMB_end_phi
static constexpr int jFEX_algoSpace_FCAL_start_phi
static constexpr int jFEX_algoSpace_EMIE_start_phi
static constexpr int jFEX_algoSpace_EMB_start_phi
static constexpr int jFEX_algoSpace_C_lowerEM_eta
static constexpr int jFEX_algoSpace_height
static constexpr int jFEX_algoSpace_C_EMIE_start_eta
static constexpr int jFEX_algoSpace_C_EMIE_end_eta
virtual void setup(int inputTable[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width], int jfex) override
virtual void setFPGAEnergy(std::unordered_map< int, std::vector< int > > et_map) override
std::unordered_map< unsigned int, std::vector< unsigned int > > m_SearchGMap
bool condCorr(unsigned int TTID) const
unsigned int elementsCorr2(unsigned int TTID) const
Gaudi::Property< std::string > m_2ndRingStr
virtual StatusCode reset() override
std::unordered_map< int, std::vector< int > > m_map_Etvalues
Gaudi::Property< std::string > m_Corr2Str
Gaudi::Property< std::string > m_CorrStr
std::unordered_map< unsigned int, std::vector< unsigned int > > m_2ndRingMap
Gaudi::Property< std::string > m_SeedRingStr
std::array< float, 2 > globalEtaPhi(int TTID)
virtual std::unordered_map< int, jFEXForwardJetsInfo > FcalJetsTowerIDLists(int seedThreshold) override
std::unordered_map< unsigned int, std::vector< unsigned int > > m_1stRingMap
virtual std::unordered_map< int, jFEXForwardJetsInfo > calculateJetETs(int seedThreshold) override
int getEt(unsigned int TTID) const
SG::ReadHandle< jTowerContainer > m_jTowerContainer
virtual StatusCode safetyTest() override
bool getTTowerSat(unsigned int TTID)
bool isLM(unsigned int TTID) const
virtual StatusCode initialize() override
standard Athena-Algorithm method
int m_jFEXalgoTowerID[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width]
bool condCorr2(unsigned int TTID) const
bool m_storeEnergyRingTTIDs
jFEXForwardJetsAlgo(const std::string &type, const std::string &name, const IInterface *parent)
Constructors.
std::unordered_map< unsigned int, std::vector< unsigned int > > m_Corr2Map
Gaudi::Property< std::string > m_1stRingStr
std::unordered_map< unsigned int, std::vector< unsigned int > > m_SearchGeMap
std::unordered_map< unsigned int, std::vector< unsigned int > > m_SeedRingMap
StatusCode ReadfromFile(const std::string &, std::unordered_map< unsigned int, std::vector< unsigned int > > &) const
bool isLMabove(unsigned int TTID) const
virtual int SumEtSeed(unsigned int TTID) const override
SG::ReadHandleKey< LVL1::jTowerContainer > m_jFEXForwardJetsAlgo_jTowerContainerKey
virtual ~jFEXForwardJetsAlgo()
Destructor.
std::unordered_map< unsigned int, std::vector< unsigned int > > m_CorrMap
Gaudi::Property< std::string > m_SearchGStr
Gaudi::Property< std::string > m_SearchGeStr
unsigned int elementsCorr(unsigned int TTID) const
void addToSecondEnergyRingET(int secondER_ET)
void addToFirstEnergyRingET(int firstER_ET)
void setCentreLocalTTEta(float centreLocalTTEta)
void setCentreTTPhi(float centreTTPhi)
void includeTTIDinFirstER(int firstER_TTID)
void includeTTIDinSecondER(int secondER_TTID)
void includeTTinSeed(int TT_ID)
void setCentreTTEta(float centreTTEta)
void setCentreLocalTTPhi(float centreLocalTTPhi)
void addToSeedET(int seed_ET)
The jTower class is an interface object for jFEX trigger algorithms The purposes are twofold:
float centrephi_toPI() const
static std::string find_calib_file(const std::string &logical_file_name)
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...