29 declareInterface<IjFEXForwardElecAlgo>(
this);
45 return StatusCode::SUCCESS;
53 return StatusCode::FAILURE;
55 return StatusCode::SUCCESS;
59 return StatusCode::SUCCESS;
90 return {TT_EtEM, TT_EtHad};
103 std::unordered_map<
int,std::vector<int> > etmapEM,
104 std::unordered_map<
int,std::vector<int> > etmapHAD) {
111 auto [centreTT_EtEM,centreTT_EtHad] =
getEtEmHad(seedTTID);
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 ){
121 if(tmp_EtEM>=centreTT_EtEM) {
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 ){
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) {
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++) {
275 if(ttID == 0)
continue;
282 const auto [centreTT_eta, centreTT_phi] =
getEtaPhi(ttID);
283 const auto [centreTT_EtEM, centreTT_EtHad] =
getEtEmHad(ttID);
298 auto it_iso_map =
m_IsoMap.find(ttID);
300 for(
const auto& gtt : it_iso_map->second){
306 ATH_MSG_ERROR(
"Could not find TT" << ttID <<
" in jEM isolation map file.");
310 if(fabs(centreTT_eta) < 3.2) {
320 for(
const auto& gtt : it_frac1_map->second){
322 sumEtHad1 += tmp_EtHad;
326 ATH_MSG_ERROR(
"Could not find TT" << ttID <<
" in jEM frac1 map file.");
335 for(
const auto& gtt : it_frac2_map->second) {
337 sumEtHad2 += tmp_EtHad;
341 ATH_MSG_ERROR(
"Could not find TT" << ttID <<
" in jEM frac2 map file.");
347 clusterList[ttID] = std::move(elCluster);
357 std::ifstream myfile(fileName);
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){
381 ATH_MSG_ERROR(
"Unexpected number of elemennts (<1 expected) in file: "<< fileName);
382 return StatusCode::FAILURE;
386 unsigned int TTID = elements.at(0);
389 elements.erase(elements.begin());
390 fillingMap[TTID] = std::move(elements);
394 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
virtual StatusCode reset() override
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)
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...