ATLAS Offline Software
Loading...
Searching...
No Matches
eFEXSysSim.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5//***************************************************************************
6// eFEXSysSim.h -
7// -------------------
8// begin : 12 07 2019
9// email : alison.elliot@cern.ch, jacob.julian.kempster@cern.ch
10// ***************************************************************************/
11
12
13#ifndef eFEXSysSim_H
14#define eFEXSysSim_H
16#include "eFEXFillEDM.h"
18#include "eFEXSim.h"
19#include "L1CaloFEXSim/eTower.h"
24
27
30
31namespace LVL1 {
32
33 //Doxygen class description below:
40 static const InterfaceID IID_IeFEXSysSim("LVL1::eFEXSysSim", 1, 0);
41
42 class eFEXSysSim : public AthAlgTool {
43
44 public:
45 static const InterfaceID& interfaceID() { return IID_IeFEXSysSim; };
47
48 eFEXSysSim(const std::string& type,const std::string& name,const IInterface* parent);
50 eFEXSysSim&& operator= (const eFEXSysSim& ) = delete;
51
53 virtual StatusCode initialize();
54
55 virtual StatusCode execute(eFEXOutputCollection* inputOutputCollection);
56
57 virtual int calcTowerID(int eta, int phi, int mod) const;
58
60 private:
61 // TOB sorting function
62 template <class TOBObjectClass> static bool TOBetSort(const TOBObjectClass& i, const TOBObjectClass& j, bool isTau ) {
63 auto et_i = (i->getTobword() >> 0 ) & 0xfff;
64 auto et_j = (j->getTobword() >> 0 ) & 0xfff;
65 if(et_i > et_j) return true;
66 if(et_i==et_j) {
67 // resolve ties with procNumber (2,1,3,0 for em, 2,1,0,3 for tau), then phi, then eta
68 auto procOrder = (isTau) ? std::map<unsigned int,unsigned int>{{2,3},{1,2},{0,1},{3,0}} :
69 std::map<unsigned int,unsigned int>{{2,3},{1,2},{3,1},{0,0}};
70 auto proc_i = procOrder.at((i->getTobword()) >> 30);
71 auto proc_j = procOrder.at((j->getTobword()) >> 30);
72 if(proc_i > proc_j) return true;
73 if (proc_i == proc_j) {
74 auto phi_i = (i->getTobword()) & 0x07000000;
75 auto phi_j = (j->getTobword()) & 0x07000000;
76 if(phi_i > phi_j) return true;
77 if(phi_i == phi_j) {
78 auto eta_i = (i->getTobword()) & 0x38000000;
79 auto eta_j = (j->getTobword()) & 0x38000000;
80 if(eta_i > eta_j) return true;
81 }
82
83 }
84 }
85 return false;
86 }
87
88 // Auxiliary for storing EDMs of both tau algos
89 StatusCode StoreTauTOBs(std::map<int, std::vector<std::unique_ptr<eFEXtauTOB>> >& allTauTobObjects,
92
93 // EM TOBs and xTOBS
94 ToolHandle<eFEXSim> m_eFEXSimTool {this, "eFEXSimTool", "LVL1::eFEXSim", "Tool that creates the eFEX Simulation"};
95
96 ToolHandle<eFEXFillEDM> m_eFEXFillEDMTool {this, "eFEXFillEDMTool", "LVL1::eFEXFillEDM", "Tool to fille eFEX EDMs"};
97
98 SG::ReadHandleKey<LVL1::eTowerContainer> m_eTowerContainerSGKey {this, "MyETowers", "eTowerContainer", "Input container for eTowers"};
99 SG::ReadHandleKey<TrigConf::L1Menu> m_l1MenuKey{this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu","Name of the L1Menu object to read configuration from"};
100
101 SG::WriteHandleKey< xAOD::eFexEMRoIContainer > m_eFexOutKey {this,"Key_eFexEMOutputContainer","L1_eEMRoI","Output eFexEM TOB container"};
102 SG::WriteHandleKey< xAOD::eFexEMRoIContainer > m_eFexEMxTOBOutKey {this,"Key_eFexEMxTOBOutputContainer","L1_eEMxRoI","Output eFexEM xTOB container"};
103 SG::WriteHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauActiveOutKey {this,"Key_eFexTauOutputContainer","L1_eTauRoI","Output eFexTau active (BDT/heuristic) algorithm TOB container"};
104 SG::WriteHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauActivexTOBOutKey {this,"Key_eFexTauxTOBOutputContainer","L1_eTauxRoI","Output eFexTau active (BDT/heuristic) algorithm xTOB container"};
105 SG::WriteHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauAltOutKey {this,"Key_eFexAltTauOutputContainer","","Output eFexTau alternative (BDT/heuristic) algorithm TOB container"};
106 SG::WriteHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauAltxTOBOutKey {this,"Key_eFexAltTauxTOBOutputContainer","","Output eFexTau alternative (BDT/heuristic) algorithm xTOB container"};
107 ToolHandle<eFEXFPGATowerIdProvider> m_eFEXFPGATowerIdProviderTool {this, "eFEXFPGATowerIdProviderTool", "LVL1::eFEXFPGATowerIdProvider", "Tool that provides tower-FPGA mapping"};
108
109 //std::map<int,eTower> m_eTowersColl;
110
111 };
112
113} // end of namespace
114
115//CLASS_DEF( LVL1::eFEXSysSim , 32201258 , 1 )
116
117
118#endif
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
bool isTau(const T &p)
Definition AtlasPID.h:208
macros to associate a CLID to a type
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
ToolHandle< eFEXSim > m_eFEXSimTool
Definition eFEXSysSim.h:94
SG::WriteHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauAltOutKey
Definition eFEXSysSim.h:105
eFEXSysSim && operator=(const eFEXSysSim &)=delete
Destructor.
static const InterfaceID & interfaceID()
Definition eFEXSysSim.h:45
SG::ReadHandleKey< TrigConf::L1Menu > m_l1MenuKey
Definition eFEXSysSim.h:99
SG::WriteHandleKey< xAOD::eFexEMRoIContainer > m_eFexOutKey
Definition eFEXSysSim.h:101
ToolHandle< eFEXFillEDM > m_eFEXFillEDMTool
Definition eFEXSysSim.h:96
virtual StatusCode execute(eFEXOutputCollection *inputOutputCollection)
ToolHandle< eFEXFPGATowerIdProvider > m_eFEXFPGATowerIdProviderTool
Definition eFEXSysSim.h:107
StatusCode StoreTauTOBs(std::map< int, std::vector< std::unique_ptr< eFEXtauTOB > > > &allTauTobObjects, SG::WriteHandleKey< xAOD::eFexTauRoIContainer > &eFexTauxTOBOutKey, SG::WriteHandleKey< xAOD::eFexTauRoIContainer > &eFexTauOutKey)
static bool TOBetSort(const TOBObjectClass &i, const TOBObjectClass &j, bool isTau)
Internal data.
Definition eFEXSysSim.h:62
SG::WriteHandleKey< xAOD::eFexEMRoIContainer > m_eFexEMxTOBOutKey
Definition eFEXSysSim.h:102
SG::WriteHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauActivexTOBOutKey
Definition eFEXSysSim.h:104
virtual StatusCode initialize()
standard Athena-Algorithm method
eFEXSysSim(const std::string &type, const std::string &name, const IInterface *parent)
Constructors.
SG::WriteHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauActiveOutKey
Definition eFEXSysSim.h:103
virtual int calcTowerID(int eta, int phi, int mod) const
SG::ReadHandleKey< LVL1::eTowerContainer > m_eTowerContainerSGKey
Definition eFEXSysSim.h:98
SG::WriteHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauAltxTOBOutKey
Definition eFEXSysSim.h:106
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Provide tower-FPGA mapping.
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
static const InterfaceID IID_IeFEXSysSim("LVL1::eFEXSysSim", 1, 0)
The eFEXSysSim class defines the structure of the eFEX system Its purpose is: