ATLAS Offline Software
Loading...
Searching...
No Matches
GepCellsHandlerAlg.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 TRIGGEPPERF_GepCellsHandlerALG_H
6#define TRIGGEPPERF_GepCellsHandlerALG_H
7
9
11#include "GaudiKernel/ToolHandle.h"
14
16
17#include <vector>
18#include <map>
19class CaloCell;
20class CaloCell_ID;
21
23
24 public:
25
26 GepCellsHandlerAlg( const std::string& name, ISvcLocator* pSvcLocator );
27
28 virtual StatusCode initialize() override;
29 virtual StatusCode execute(const EventContext&) const override;
30
31 private:
32
33 StatusCode setNumberOfEnergyBits(int value) {
34
35 // At the moment only have a detailed scheme for 6-10 bit readouts, thus rejecting any other value
36 switch(value) {
37 case 6: m_maxCellsPerFEB = 62; break;
38 case 7: m_maxCellsPerFEB = 54; break;
39 case 8: m_maxCellsPerFEB = 48; break;
40 case 9: m_maxCellsPerFEB = 43; break;
41 case 10: m_maxCellsPerFEB = 39; break;
42 default: ATH_MSG_FATAL("A GEP energy encoding scheme with " << value << " energy bits is currently not defined");
43 return StatusCode::FAILURE;
44 }
45
46 ATH_MSG_INFO("Setting GEP energy encoding to a " << value << "-bit scheme which allows for the sending of " << m_maxCellsPerFEB << " cells to GEP per FEB");
47 m_nEnergyBits = value;
48
49 return StatusCode::SUCCESS;
50 }
51
52 StatusCode setLeastSignificantBit(int value) {
53 if (value < 1) {
54 ATH_MSG_FATAL("The value of the least significant bit in the GEP energy encoding cannot be set to " << value);
55 return StatusCode::FAILURE;
56 }
57 ATH_MSG_INFO("Setting the value for the least significant bit in the GEP energy encoding to " << value << " MeV");
58 m_valLeastSigBit = value;
59
60 return StatusCode::SUCCESS;
61 }
62
63 StatusCode setG(int value) {
64 if (value < 1) {
65 ATH_MSG_FATAL("The value of G in the GEP energy encoding cannot be set to " << value);
66 return StatusCode::FAILURE;
67 }
68 ATH_MSG_INFO("Setting the value for G in the GEP energy encoding to " << value);
69 m_valG = value;
70
71 return StatusCode::SUCCESS;
72 }
73
74 // Values are set in the initialize function
75 int m_nEnergyBits = -1;
77 int m_valG = -1;
78 int m_readoutRanges[5] = {-1,-1,-1,-1,-1};
80 unsigned m_maxCellsPerFEB = -1;
81
82 std::map<unsigned int,Gep::GepCaloCell> m_gepCellsBase = {};
83
84 Gaudi::Property<std::string> m_GepEnergyEncodingScheme {this, "GEPEnergyEncodingScheme", "",
85 "String defining the GEP readout scheme according to number of readout bits + '-' + value of LSB in MeV + '-' + gain value"};
86
87 Gaudi::Property<bool> m_doGepHardwareStyleEnergyEncoding {this, "HardwareStyleEnergyEncoding", false,
88 "Enabling or disabling the hardware-style energy encoding for the GEP"};
89
90 Gaudi::Property<bool> m_doTruncationOfOverflowingFEBs {this, "TruncationOfOverflowingFEBs", false,
91 "Enabling or disabling the truncation of cells from FEBs with more than the maximum number of cells which can be send"};
92
93 Gaudi::Property<bool> m_writeAllCells {this, "WriteAllCells", false,
94 "If true, all cells are considered regardless whether they are truncated or below the 2sigma threshold"};
95
96 Gaudi::Property<std::string> m_LArCellMap {this, "LArCellMapFile", "UpgradePerformanceFunctions/LAr_Cell_Map_offlineID_0.csv",
97 "File associating LAr cells with readout FEBs and connection technology"};
98
101
102 SG::ReadCondHandleKey<CaloNoise> m_electronicNoiseKey{this, "electronicNoiseKey", "totalNoise", "SG Key of CaloNoise data object"};
103
104 SG::ReadCondHandleKey<CaloNoise> m_totalNoiseKey{this, "totalNoiseKey", "totalNoise", "SG Key of CaloNoise data object"};
105
106 SG::WriteHandleKey<Gep::GepCellMap> m_outputGepCellsKey{this, "outputGepCellsKey", "", "Key for GepCell map"};
107
108 SG::ReadHandleKey<CaloCellContainer> m_caloCellsKey {this, "caloCells", "AllCalo", "key to read in a CaloCell constainer"};
109
110 const CaloCell_ID* m_CaloCell_ID{nullptr};
111 int getGepEnergy(float offline_et) const;
112 std::vector<unsigned int> getNeighbours(const CaloCellContainer& allcells,
113 const CaloCell* acell,
114 const EventContext&) const;
115 StatusCode removeCellsFromOverloadedFEB(std::vector<Gep::GepCaloCell> &cells) const;
116
117};
118
119#endif //> !TRIGGEPPERF_GEPCELLSHANDLERALG_H
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
Definition of CaloDetDescrManager.
An algorithm that can be simultaneously executed in multiple threads.
Container class for CaloCell.
Helper class for offline cell identifiers.
Definition CaloCell_ID.h:34
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
std::map< unsigned int, Gep::GepCaloCell > m_gepCellsBase
Gaudi::Property< std::string > m_GepEnergyEncodingScheme
Gaudi::Property< bool > m_doTruncationOfOverflowingFEBs
virtual StatusCode execute(const EventContext &) const override
virtual StatusCode initialize() override
Gaudi::Property< std::string > m_LArCellMap
GepCellsHandlerAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadCondHandleKey< CaloNoise > m_totalNoiseKey
Gaudi::Property< bool > m_writeAllCells
StatusCode setG(int value)
StatusCode setNumberOfEnergyBits(int value)
SG::WriteHandleKey< Gep::GepCellMap > m_outputGepCellsKey
StatusCode removeCellsFromOverloadedFEB(std::vector< Gep::GepCaloCell > &cells) const
SG::ReadCondHandleKey< CaloNoise > m_electronicNoiseKey
Key of the CaloNoise Conditions data object.
int getGepEnergy(float offline_et) const
StatusCode setLeastSignificantBit(int value)
Gaudi::Property< bool > m_doGepHardwareStyleEnergyEncoding
SG::ReadHandleKey< CaloCellContainer > m_caloCellsKey
std::vector< unsigned int > getNeighbours(const CaloCellContainer &allcells, const CaloCell *acell, const EventContext &) const
const CaloCell_ID * m_CaloCell_ID
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.