Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
jTowerMakerFromSuperCells.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <fstream>
8 
9 namespace LVL1 {
10 
12 
14 {
15 
16  ATH_CHECK( m_jTowerBuilderTool.retrieve() );
19 
20  return StatusCode::SUCCESS;
21 }
22 
23 
25 
26 
27  // STEP 0 - Make a fresh local jTowerContainer
28  std::unique_ptr<jTowerContainer> local_jTowerContainerRaw = std::make_unique<jTowerContainer>();
29 
30  // STEP 1 - Make some jTowers and fill the local container
31  m_jTowerBuilderTool->init(local_jTowerContainerRaw);
32 
33 
34  // STEP 2 - Do the supercell-tower mapping - put this information into the jTowerContainer
35  ATH_CHECK(m_jSuperCellTowerMapperTool->AssignSuperCellsToTowers(local_jTowerContainerRaw));
36  ATH_CHECK(m_jSuperCellTowerMapperTool->AssignTriggerTowerMapper(local_jTowerContainerRaw));
37 
38  //STEP 2.5 - Set up a file mapping if necessary (should only need to be done if the mapping changes, which should never happen unless major changes to the simulation are required)
39  // Only used for simulation experts. Contact one of us first
40  // With just one event should be enough to generate the file
41  if(false) {
42 
43  ATH_MSG_INFO("Writting the mapping for jFEX");
44  std::ofstream sc_tower_map;
45  sc_tower_map.open("./new_jfex_SCID.txt");
46  sc_tower_map << "# Simulation ID, 12 Scells (EMB or EMEC or FCAL1 layer) + 1 Scell (HEC or FCAL2/3 layer)" << "\n";
47 
48  for(const LVL1::jTower* jtower : *local_jTowerContainerRaw) {
49  sc_tower_map << jtower->OfflineID() << " ";
50 
51  std::vector<Identifier> vEM = jtower->getEMSCIDs();
52  for(const auto& SCellID : vEM) {
53  sc_tower_map << SCellID << " ";
54  }
55  for(unsigned int i=0; i<(12-vEM.size()); i++) {
56  sc_tower_map << "0xffffffffffffffff" << " ";
57  }
58 
59  std::vector<Identifier> vHAD = jtower->getHADSCIDs();
60  for(const auto& SCellID : vHAD) {
61  sc_tower_map << SCellID << " ";
62  }
63  if(vHAD.size()==0) {
64  sc_tower_map << "0xffffffffffffffff" << " ";
65  }
66  sc_tower_map << "\n";
67  }
68 
69  sc_tower_map.close();
70  }
71 
72  // STEP 3 - Write the completed jTowerContainer into StoreGate (move the local copy in memory)
74  ATH_CHECK(jTowerContainerSG.record(std::move( local_jTowerContainerRaw ) ) );
75 
76  // STEP 4 - Close and clean the event
78  m_jTowerBuilderTool->reset();
79 
80  return StatusCode::SUCCESS;
81 }
82 
83 } // end of LVL1 namespace
LVL1::jTowerMakerFromSuperCells::m_jTowerContainerSGKey
SG::WriteHandleKey< LVL1::jTowerContainer > m_jTowerContainerSGKey
Definition: jTowerMakerFromSuperCells.h:36
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
LVL1::jTowerMakerFromSuperCells::m_jTowerBuilderTool
ToolHandle< IjTowerBuilder > m_jTowerBuilderTool
Definition: jTowerMakerFromSuperCells.h:38
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
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
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LVL1::jTowerMakerFromSuperCells::m_jSuperCellTowerMapperTool
ToolHandle< IjSuperCellTowerMapper > m_jSuperCellTowerMapperTool
Definition: jTowerMakerFromSuperCells.h:39
LVL1::jTowerMakerFromSuperCells::initialize
virtual StatusCode initialize()
Definition: jTowerMakerFromSuperCells.cxx:13
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
LVL1::jTowerMakerFromSuperCells::execute
virtual StatusCode execute()
Definition: jTowerMakerFromSuperCells.cxx:24
AthAlgorithm
Definition: AthAlgorithm.h:47
TrigConf::name
Definition: HLTChainList.h:35
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
LVL1::jTowerMakerFromSuperCells::jTowerMakerFromSuperCells
jTowerMakerFromSuperCells(const std::string &name, ISvcLocator *svc)
Definition: jTowerMakerFromSuperCells.cxx:11
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
LVL1::jTower
The jTower class is an interface object for jFEX trigger algorithms The purposes are twofold:
Definition: jTower.h:36
jTowerMakerFromSuperCells.h