29 declareInterface<IjFEXForwardElecAlgo>(
this);
45 return StatusCode::SUCCESS;
53 return StatusCode::FAILURE;
55 return StatusCode::SUCCESS;
87 return {TT_EtEM, TT_EtHad};
100 std::unordered_map<
int,std::vector<int> > etmapEM,
101 std::unordered_map<
int,std::vector<int> > etmapHAD) {
108 auto [centreTT_EtEM,centreTT_EtHad] =
getEtEmHad(seedTTID);
113 ATH_MSG_ERROR(
"Could not find TT" << seedTTID <<
" in the seach (>) local maxima for tau/em file.");
116 for (
const auto& gtt : it_seed_map->second ){
118 if(tmp_EtEM>=centreTT_EtEM) {
128 ATH_MSG_ERROR(
"Could not find TT" << seedTTID <<
" in the seach (>=) local maxima for tau/em file.");
131 for (
const auto& gtt : it_seed_map->second ){
133 if( tmp_EtEM>centreTT_EtEM) {
145 int direction =
m_jfex < 3 ? -1 : +1;
147 std::vector<std::pair<int,int>> neighbours;
153 neighbours = { {neta , nphi+1},
161 neighbours = { {neta, nphi+1},
163 {neta-direction, nphi},
164 {neta+direction, nphi/2}
169 neighbours = { {neta, nphi+1},
171 {neta+direction, nphi},
172 {neta-direction, 2*nphi+0},
173 {neta-direction, 2*nphi+1},
178 neighbours = { {neta , nphi+1},
186 neighbours = { {neta, nphi+1},
188 {neta-direction, nphi},
189 {neta+2*direction, nphi/2}
195 neighbours = { {neta-2*direction, 2*nphi+0},
196 {neta-2*direction, 2*nphi+1},
197 {neta+direction, nphi}
202 neighbours = { {neta+1, nphi},
208 neighbours = { {neta-direction, nphi}
211 ATH_MSG_ERROR(
"Eta index " << neta <<
" (side: "<< (direction>0?
"A":
"C") <<
") does not seem to belong to any valid seed region");
215 for (
const auto& candEtaPhi: neighbours) {
217 const auto [candTT_EtEM, candTT_EtHad] =
getEtEmHad(candID);
229 std::unordered_map<uint, LVL1::jFEXForwardElecInfo> clusterList;
230 std::vector<int> lower_centre_neta;
231 std::vector<int> upper_centre_neta;
260 for(
uint region = 0; region<3; region++) {
261 for(
int nphi = lower_centre_nphi[region]; nphi < upper_centre_nphi[region]; nphi++) {
262 for(
int neta = lower_centre_neta[region]; neta < upper_centre_neta[region]; neta++) {
272 if(ttID == 0)
continue;
279 const auto [centreTT_eta, centreTT_phi] =
getEtaPhi(ttID);
280 const auto [centreTT_EtEM, centreTT_EtHad] =
getEtEmHad(ttID);
295 auto it_iso_map =
m_IsoMap.find(ttID);
297 for(
const auto& gtt : it_iso_map->second){
303 ATH_MSG_ERROR(
"Could not find TT" << ttID <<
" in jEM isolation map file.");
307 if(fabs(centreTT_eta) < 3.2) {
317 for(
const auto& gtt : it_frac1_map->second){
319 sumEtHad1 += tmp_EtHad;
323 ATH_MSG_ERROR(
"Could not find TT" << ttID <<
" in jEM frac1 map file.");
332 for(
const auto& gtt : it_frac2_map->second) {
334 sumEtHad2 += tmp_EtHad;
338 ATH_MSG_ERROR(
"Could not find TT" << ttID <<
" in jEM frac2 map file.");
344 clusterList[ttID] = std::move(elCluster);
354 std::ifstream myfile(fileName);
355 if ( !myfile.is_open() ){
357 return StatusCode::FAILURE;
361 while ( std::getline (myfile, myline) ) {
363 if(myline[0] ==
'#')
continue;
366 std::stringstream oneLine(myline);
369 std::vector<unsigned int> elements;
371 while(std::getline(oneLine, element,
' '))
373 elements.push_back(std::stoi(element));
377 if(elements.size() < 1){
378 ATH_MSG_ERROR(
"Unexpected number of elemennts (<1 expected) in file: "<< fileName);
379 return StatusCode::FAILURE;
383 unsigned int TTID = elements.at(0);
386 elements.erase(elements.begin());
387 fillingMap[TTID] = std::move(elements);
391 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
static constexpr int jFEX_algoSpace_A_FCAL1_1st
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_EMB_eta
static constexpr int jFEX_algoSpace_A_FCAL_start_eta
static constexpr int jFEX_algoSpace_C_FCAL_start_eta
static constexpr int jFEX_algoSpace_A_EMIE_eta
static constexpr int jFEX_algoSpace_FCAL_end_phi
static constexpr int jFEX_algoSpace_C_FCAL1_1st
static constexpr int jFEX_algoSpace_EMB_end_phi
static constexpr int jFEX_algoSpace_A_FwdEl_start
static constexpr int jFEX_algoSpace_FCAL_start_phi
static constexpr int jFEX_algoSpace_EMIE_start_phi
static constexpr int jFEX_algoSpace_C_FwdEl_start
static constexpr int jFEX_algoSpace_EMB_start_phi
static constexpr int jFEX_algoSpace_height
static constexpr int jFEX_algoSpace_C_EMIE_start_eta
static constexpr int jFEX_algoSpace_C_EMIE_end_eta
Gaudi::Property< std::string > m_Frac2MapStr
std::unordered_map< int, std::vector< int > > m_map_Etvalues_EM
std::unordered_map< int, std::vector< int > > m_map_Etvalues_HAD
std::unordered_map< unsigned int, std::vector< unsigned int > > m_Frac1Map
std::unordered_map< unsigned int, std::vector< unsigned int > > m_Frac2Map
virtual std::array< int, 2 > getEtEmHad(uint) const override
jFEXForwardElecAlgo(const std::string &type, const std::string &name, const IInterface *parent)
Constructors.
int m_jFEXalgoTowerID[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width]
SG::ReadHandleKey< LVL1::jTowerContainer > m_jTowerContainerKey
virtual void setup(int inputTable[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width], int jfex, int fpga) override
virtual StatusCode safetyTest() override
Standard methods.
virtual std::array< float, 2 > getEtaPhi(uint) override
void findAndFillNextTT(jFEXForwardElecInfo &elCluster, int neta, int nphi)
Gaudi::Property< std::string > m_SearchGeTauStr
bool isValidSeed(uint seedTTID) const
SG::ReadHandle< jTowerContainer > m_jTowerContainer
Gaudi::Property< std::string > m_SearchGTauStr
bool getEMSat(unsigned int ttID)
StatusCode ReadfromFile(const std::string &, std::unordered_map< unsigned int, std::vector< unsigned int > > &) const
virtual void setFPGAEnergy(std::unordered_map< int, std::vector< int > > etmapEM, std::unordered_map< int, std::vector< int > > etmapHAD) override
virtual StatusCode initialize() override
standard Athena-Algorithm method
virtual ~jFEXForwardElecAlgo()
Destructor.
Gaudi::Property< std::string > m_IsoMapStr
Gaudi::Property< std::string > m_Frac1MapStr
std::unordered_map< unsigned int, std::vector< unsigned int > > m_IsoMap
std::unordered_map< unsigned int, std::vector< unsigned int > > m_SearchGTauMap
std::unordered_map< unsigned int, std::vector< unsigned int > > m_SearchGeTauMap
virtual std::unordered_map< uint, jFEXForwardElecInfo > calculateEDM() override
void setCoreTTEtEM(int ET_EM)
void setNextTTEtEM(int ET_EM)
void setCoreTTfEta(float feta)
void setCoreTTfPhi(float fphi)
void setCoreTTSatEM(bool sat)
void setNextTTSatEM(bool sat)
void setNextTTID(uint TTID)
int getNextTTEtEM() const
void setTTEtHad1(int ET_HAD)
void setTTEtEMiso(int iso_ET)
void setTTEtHad2(int ET_HAD)
void setup(int jfex, uint ttid, int neta, int nphi)
The jTower class is an interface object for jFEX trigger algorithms The purposes are twofold:
static std::string find_calib_file(const std::string &logical_file_name)
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...