ATLAS Offline Software
LArCellPreparationAlg.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef GLOBALSIM_LARCELLPREPARATIONALG_H
6 #define GLOBALSIM_LARCELLPREPARATIONALG_H
7 
8 /*
9  This Algorithm simulates the energy encoding of all LAr cells for Global and simulated the truncation of cells
10  from overflowing FEB2s. The hardware-accurate cells are then stored in a GlobalLArCellContainer object within
11  StoreGate
12 */
13 
17 #include "GaudiKernel/ToolHandle.h"
20 
21 #include "GlobalLArCell.h"
22 #include "GlobalLArCellContainer.h"
23 
24 #include <vector>
25 #include <boost/dynamic_bitset.hpp>
26 
27 namespace GlobalSim {
28 
30  public:
31 
32  using AthReentrantAlgorithm::AthReentrantAlgorithm;
33 
35  virtual StatusCode initialize() override;
37  virtual StatusCode execute(const EventContext& ) const override;
38 
39  private:
40 
42  std::pair<float,boost::dynamic_bitset<>> encodeEnergy(float energy) const;
44  StatusCode removeCellsFromOverloadedFEB(std::vector<GlobalSim::GlobalLArCell> &cells) const;
45 
47  int m_readoutRanges[5] = {-1,-1,-1,-1,-1};
49  int m_stepsPerRange = -1;
51  unsigned m_maxCellsPerFEB = -1;
52 
54  std::map<int,GlobalSim::GlobalLArCell> m_gblLArCellMap = {};
56  std::unique_ptr<GlobalSim::GlobalLArCellContainer> m_gblLArCellContainerTemplate;
57 
59  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfo{this, "EventInfo", "EventInfo", "Key for the EventInfo container"};
60 
62  Gaudi::Property<int> m_numberOfEnergyBits {this, "numberOfEnergyBits", 6, "Number of bits reserved for the multilinear energy encoding"};
63  Gaudi::Property<int> m_valueLSB {this, "valueLeastSignificantBit", 40, "Value of the least significant bit in MeV"};
64  Gaudi::Property<int> m_valueGainFactor {this, "valueGainFactor", 4, "Value of the gain factor of the multilinear energey encoding"};
65 
67  Gaudi::Property<std::string> m_LArCellMap {this, "LArCellMapFile", "UpgradePerformanceFunctions/LAr_Cell_Map_offlineID_1.csv",
68  "File associating LAr cells with readout FEBs and connection technology"};
69 
71  SG::ReadHandleKey<CaloCellContainer> m_caloCellsKey {this, "caloCells", "AllCalo", "key to read in a CaloCell container"};
72 
74  SG::ReadCondHandleKey<CaloNoise> m_totalNoiseKey{this, "totalNoiseKey", "totalNoise", "SG Key of CaloNoise data object"};
75 
77  SG::WriteHandleKey<GlobalSim::GlobalLArCellContainer> m_LArCellContainerKey{this, "GlobalLArCellsKey", "GlobalLArCells", "Key for the output container of the LAr cells sent to Global"};
78 
79  };
80 
81 }
82 #endif
83 
84 
85 
86 
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:281
GlobalSim::LArCellPreparationAlg::m_gblLArCellContainerTemplate
std::unique_ptr< GlobalSim::GlobalLArCellContainer > m_gblLArCellContainerTemplate
GlobalLArCellContainer template which is constructed in initialize and used in execute.
Definition: LArCellPreparationAlg.h:56
GlobalSim::LArCellPreparationAlg::m_valueGainFactor
Gaudi::Property< int > m_valueGainFactor
Definition: LArCellPreparationAlg.h:64
GlobalSim::LArCellPreparationAlg::m_gblLArCellMap
std::map< int, GlobalSim::GlobalLArCell > m_gblLArCellMap
LAr cell map where the key is the offline cell ID.
Definition: LArCellPreparationAlg.h:54
GlobalSim::LArCellPreparationAlg::m_totalNoiseKey
SG::ReadCondHandleKey< CaloNoise > m_totalNoiseKey
Key to the total noise used for each CaloCell.
Definition: LArCellPreparationAlg.h:74
GlobalSim::LArCellPreparationAlg::m_readoutRanges
int m_readoutRanges[5]
array holding the energy edges of the multilinear encoding
Definition: LArCellPreparationAlg.h:47
GlobalSim::LArCellPreparationAlg::m_valueLSB
Gaudi::Property< int > m_valueLSB
Definition: LArCellPreparationAlg.h:63
GlobalSim::LArCellPreparationAlg
Definition: LArCellPreparationAlg.h:29
GlobalLArCellContainer.h
GlobalSim::LArCellPreparationAlg::initialize
virtual StatusCode initialize() override
initialize function running before first event
Definition: LArCellPreparationAlg.cxx:27
SG::ReadHandleKey< xAOD::EventInfo >
GlobalSim::LArCellPreparationAlg::m_stepsPerRange
int m_stepsPerRange
number of discrete values per multilinear energy encoding range
Definition: LArCellPreparationAlg.h:49
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
GlobalSim
AlgTool to obtain a selection of eFex RoIs read in from the event store.
Definition: dump.h:8
GlobalSim::LArCellPreparationAlg::m_numberOfEnergyBits
Gaudi::Property< int > m_numberOfEnergyBits
Parameters defining the multilinear energy encoding scheme.
Definition: LArCellPreparationAlg.h:62
GlobalSim::LArCellPreparationAlg::encodeEnergy
std::pair< float, boost::dynamic_bitset<> > encodeEnergy(float energy) const
Function to simulate the cell energy as seen by Global.
Definition: LArCellPreparationAlg.cxx:218
SG::WriteHandleKey< GlobalSim::GlobalLArCellContainer >
GlobalSim::LArCellPreparationAlg::m_caloCellsKey
SG::ReadHandleKey< CaloCellContainer > m_caloCellsKey
Key to the CaloCell container.
Definition: LArCellPreparationAlg.h:71
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
GlobalLArCell.h
GlobalSim::LArCellPreparationAlg::execute
virtual StatusCode execute(const EventContext &) const override
execute function running for every event
Definition: LArCellPreparationAlg.cxx:130
AthReentrantAlgorithm.h
GlobalSim::LArCellPreparationAlg::m_LArCellMap
Gaudi::Property< std::string > m_LArCellMap
Path to the LAr cell map in the CVMFS GroupData space.
Definition: LArCellPreparationAlg.h:67
CaloNoise.h
CaloCellContainer.h
EventInfo.h
SG::ReadCondHandleKey< CaloNoise >
GlobalSim::LArCellPreparationAlg::m_maxCellsPerFEB
unsigned m_maxCellsPerFEB
maximum number of cells that can be send to Global for each FEB2
Definition: LArCellPreparationAlg.h:51
GlobalSim::LArCellPreparationAlg::removeCellsFromOverloadedFEB
StatusCode removeCellsFromOverloadedFEB(std::vector< GlobalSim::GlobalLArCell > &cells) const
Function to simulate the truncation of overflowing FEB2s.
Definition: LArCellPreparationAlg.cxx:255
GlobalSim::LArCellPreparationAlg::m_eventInfo
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Key for the EventInfo object.
Definition: LArCellPreparationAlg.h:59
GlobalSim::LArCellPreparationAlg::m_LArCellContainerKey
SG::WriteHandleKey< GlobalSim::GlobalLArCellContainer > m_LArCellContainerKey
Key to writing the GlobalLArCellContainer to StoreGate.
Definition: LArCellPreparationAlg.h:77