ATLAS Offline Software
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
18 #include "AthenaKernel/CLASS_DEF.h"
19 #include "L1CaloFEXSim/eFEXSim.h"
20 #include "L1CaloFEXSim/eTower.h"
23 #include "L1CaloFEXSim/eFEXegTOB.h"
25 
28 
31 
32 namespace LVL1 {
33 
34  //Doxygen class description below:
42  class eFEXSysSim : public AthAlgTool, virtual public IeFEXSysSim {
43 
44  public:
45 
48  eFEXSysSim(const std::string& type,const std::string& name,const IInterface* parent);
50  eFEXSysSim&& operator= (const eFEXSysSim& ) = delete;
51 
53  virtual StatusCode initialize() override;
54 
55  virtual StatusCode execute(eFEXOutputCollection* inputOutputCollection) override ;
56 
57  virtual int calcTowerID(int eta, int phi, int mod) const override;
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<IeFEXSim> m_eFEXSimTool {this, "eFEXSimTool", "LVL1::eFEXSim", "Tool that creates the eFEX Simulation"};
95 
96  ToolHandle<IeFEXFillEDM> 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<IeFEXFPGATowerIdProvider> m_eFEXFPGATowerIdProviderTool {this, "eFEXFPGATowerIdProviderTool", "LVL1::eFEXFPGATowerIdProvider", "Tool that provides tower-FPGA mapping"};
108  ToolHandle<IeFEXFPGA> m_eFEXFPGATool {this, "eFEXFPGATool", "LVL1::eFEXFPGA", "Tool that simulates the FPGA hardware"};
109 
110  //std::map<int,eTower> m_eTowersColl;
111 
112  };
113 
114 } // end of namespace
115 
116 //CLASS_DEF( LVL1::eFEXSysSim , 32201258 , 1 )
117 
118 
119 #endif
LVL1::eFEXSysSim::m_eFexTauActiveOutKey
SG::WriteHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauActiveOutKey
Definition: eFEXSysSim.h:103
eTowerContainer.h
LVL1::eFEXSysSim::m_eFexTauActivexTOBOutKey
SG::WriteHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauActivexTOBOutKey
Definition: eFEXSysSim.h:104
LVL1::eFEXSysSim::execute
virtual StatusCode execute(eFEXOutputCollection *inputOutputCollection) override
Definition: eFEXSysSim.cxx:81
LVL1::eFEXSysSim::StoreTauTOBs
StatusCode StoreTauTOBs(std::map< int, std::vector< std::unique_ptr< eFEXtauTOB >> > &allTauTobObjects, SG::WriteHandleKey< xAOD::eFexTauRoIContainer > &eFexTauxTOBOutKey, SG::WriteHandleKey< xAOD::eFexTauRoIContainer > &eFexTauOutKey)
Definition: eFEXSysSim.cxx:457
eFEXSim.h
LVL1::eFEXSysSim::m_eFEXSimTool
ToolHandle< IeFEXSim > m_eFEXSimTool
Definition: eFEXSysSim.h:94
eFexEMRoIAuxContainer.h
eFEXtauTOB.h
eFexTauRoIContainer.h
LVL1::eFEXSysSim::m_eTowerContainerSGKey
SG::ReadHandleKey< LVL1::eTowerContainer > m_eTowerContainerSGKey
Definition: eFEXSysSim.h:98
LVL1::eFEXSysSim
The eFEXSysSim class defines the structure of the eFEX system Its purpose is:
Definition: eFEXSysSim.h:42
SG::ReadHandleKey< LVL1::eTowerContainer >
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::eFEXSysSim::m_eFexTauAltxTOBOutKey
SG::WriteHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauAltxTOBOutKey
Definition: eFEXSysSim.h:106
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
maskDeadModules.mod
mod
Definition: maskDeadModules.py:36
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LVL1::eFEXSysSim::m_eFexEMxTOBOutKey
SG::WriteHandleKey< xAOD::eFexEMRoIContainer > m_eFexEMxTOBOutKey
Definition: eFEXSysSim.h:102
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LVL1::eFEXSysSim::calcTowerID
virtual int calcTowerID(int eta, int phi, int mod) const override
Definition: eFEXSysSim.cxx:76
LVL1::eFEXSysSim::eFEXSysSim
eFEXSysSim(const std::string &type, const std::string &name, const IInterface *parent)
Constructors.
Definition: eFEXSysSim.cxx:37
LVL1::eFEXSysSim::m_eFEXFPGATowerIdProviderTool
ToolHandle< IeFEXFPGATowerIdProvider > m_eFEXFPGATowerIdProviderTool
Definition: eFEXSysSim.h:107
eFEXegTOB.h
eFEXFPGATowerIdProvider.h
Provide tower-FPGA mapping.
LVL1::eFEXSysSim::m_l1MenuKey
SG::ReadHandleKey< TrigConf::L1Menu > m_l1MenuKey
Definition: eFEXSysSim.h:99
TrigConf::name
Definition: HLTChainList.h:35
isTau
bool isTau(const T &p)
Definition: AtlasPID.h:173
LVL1::eFEXSysSim::m_eFexOutKey
SG::WriteHandleKey< xAOD::eFexEMRoIContainer > m_eFexOutKey
Definition: eFEXSysSim.h:101
LVL1::eFEXSysSim::initialize
virtual StatusCode initialize() override
standard Athena-Algorithm method
Definition: eFEXSysSim.cxx:52
IeFEXFillEDM.h
LVL1::eFEXSysSim::m_eFexTauAltOutKey
SG::WriteHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauAltOutKey
Definition: eFEXSysSim.h:105
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1::IeFEXSysSim
Definition: IeFEXSysSim.h:27
eFexTauRoIAuxContainer.h
LVL1::eFEXSysSim::m_eFEXFPGATool
ToolHandle< IeFEXFPGA > m_eFEXFPGATool
Definition: eFEXSysSim.h:108
IeFEXSysSim.h
AthAlgTool
Definition: AthAlgTool.h:26
LVL1::eFEXSysSim::TOBetSort
static bool TOBetSort(const TOBObjectClass &i, const TOBObjectClass &j, bool isTau)
Internal data.
Definition: eFEXSysSim.h:62
LVL1::eFEXOutputCollection
Definition: eFEXOutputCollection.h:23
eTower.h
LVL1::eFEXSysSim::m_eFEXFillEDMTool
ToolHandle< IeFEXFillEDM > m_eFEXFillEDMTool
Definition: eFEXSysSim.h:96
CLASS_DEF.h
macros to associate a CLID to a type
LVL1::eFEXSysSim::operator=
eFEXSysSim && operator=(const eFEXSysSim &)=delete
Destructor.
eFexEMRoIContainer.h