ATLAS Offline Software
Loading...
Searching...
No Matches
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"
23
24#include <vector>
25#include <boost/dynamic_bitset.hpp>
26
27namespace 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};
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
An algorithm that can be simultaneously executed in multiple threads.
virtual StatusCode execute(const EventContext &) const override
execute function running for every event
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Key for the EventInfo object.
Gaudi::Property< int > m_numberOfEnergyBits
Parameters defining the multilinear energy encoding scheme.
Gaudi::Property< std::string > m_LArCellMap
Path to the LAr cell map in the CVMFS GroupData space.
std::pair< float, boost::dynamic_bitset<> > encodeEnergy(float energy) const
Function to simulate the cell energy as seen by Global.
std::map< int, GlobalSim::GlobalLArCell > m_gblLArCellMap
LAr cell map where the key is the offline cell ID.
virtual StatusCode initialize() override
initialize function running before first event
int m_readoutRanges[5]
array holding the energy edges of the multilinear encoding
int m_stepsPerRange
number of discrete values per multilinear energy encoding range
StatusCode removeCellsFromOverloadedFEB(std::vector< GlobalSim::GlobalLArCell > &cells) const
Function to simulate the truncation of overflowing FEB2s.
std::unique_ptr< GlobalSim::GlobalLArCellContainer > m_gblLArCellContainerTemplate
GlobalLArCellContainer template which is constructed in initialize and used in execute.
SG::ReadCondHandleKey< CaloNoise > m_totalNoiseKey
Key to the total noise used for each CaloCell.
unsigned m_maxCellsPerFEB
maximum number of cells that can be send to Global for each FEB2
SG::ReadHandleKey< CaloCellContainer > m_caloCellsKey
Key to the CaloCell container.
SG::WriteHandleKey< GlobalSim::GlobalLArCellContainer > m_LArCellContainerKey
Key to writing the GlobalLArCellContainer to StoreGate.
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.
AlgTool that to test whether expected the TIP values generated by data supplied by eEmMultTestBench c...