ATLAS Offline Software
LArCelldeadOTXTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LARCELLREC_LArCelldeadOTXTool_H
6 #define LARCELLREC_LArCelldeadOTXTool_H
7 
8 
18 
19 class CaloCellContainer;
20 class LArOnlineID;
21 class CaloCell_ID;
22 
23 class LArCelldeadOTXTool : public extends<AthAlgTool, ICaloCellMakerTool> {
24 public:
25  using base_class::base_class;
26 
27  ~LArCelldeadOTXTool() = default;
28  virtual StatusCode initialize() override final;
29  virtual StatusCode finalize() override final;
30  //Implements the ICaloCellMaker interface
31  virtual StatusCode process(CaloCellContainer* cellCollection, const EventContext& ctx) const override final;
32 
33  private:
34  SG::ReadHandleKey<LArRawSCContainer> m_SCKey{this, "keySC", "SC_ET","Key for SuperCells container"};
35  SG::ReadCondHandleKey<LArBadFebCont> m_MFKey{this, "keyMF", "LArBadFeb", "Key for missing FEBs"};
36  SG::ReadCondHandleKey<LArBadChannelCont> m_badSCKey{this, "BadSCKey", "LArBadChannelSC", "Key of the LArBadChannelCont SC" };
37  SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this, "keyCabling", "LArOnOffIdMap", "Key for the cabling"};
38  SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingSCKey{this, "keySCCabling", "LArOnOffIdMapSC", "Key for the cabling of the SC"};
39  SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey{this,"CaloDetDescrManager", "CaloDetDescrManager"};
40 
41  Gaudi::Property<int> m_scCut{this,"SCEneCut",70,"Do not use super-cells with values below this cut"};
42  Gaudi::Property<bool> m_testMode{this,"TestMode",false};
43  const LArOnlineID* m_onlineID=nullptr;
44  const CaloCell_ID* m_calo_id=nullptr;
45  ToolHandle<ICaloSuperCellIDTool> m_scidtool{this, "CaloSuperCellIDTool", "CaloSuperCellIDTool", "Offline / SuperCell ID mapping tool"};
46 
47  typedef std::map<HWIdentifier,std::vector<std::pair<IdentifierHash,float> > > scToDeadCellMap_t;
48  //map key: SuperCell HWIdentifer, value.first: dead feb-cell hash, value.second: conversion factor from SC-ET integer to cell E in MeV
49 
50  void buildMap(const EventContext& ctx, scToDeadCellMap_t& map, StatusCode& sc) const;
51  mutable std::once_flag m_onceFlag ATLAS_THREAD_SAFE;
52  mutable scToDeadCellMap_t m_scToDead ATLAS_THREAD_SAFE; //protected by the once_flag above
53 
54  mutable std::unordered_map<int,std::pair<float,int> > m_testMap ATLAS_THREAD_SAFE; //Only used in testMode + mtx-protected
55  mutable std::mutex m_mtx;
56 };
57 
58 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
LArCelldeadOTXTool::m_scCut
Gaudi::Property< int > m_scCut
Definition: LArCelldeadOTXTool.h:41
LArCelldeadOTXTool::m_MFKey
SG::ReadCondHandleKey< LArBadFebCont > m_MFKey
Definition: LArCelldeadOTXTool.h:35
LArRawSCContainer.h
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
LArCelldeadOTXTool::ATLAS_THREAD_SAFE
std::unordered_map< int, std::pair< float, int > > m_testMap ATLAS_THREAD_SAFE
Definition: LArCelldeadOTXTool.h:54
LArCelldeadOTXTool::buildMap
void buildMap(const EventContext &ctx, scToDeadCellMap_t &map, StatusCode &sc) const
Definition: LArCelldeadOTXTool.cxx:120
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
LArRawSCContainer
Container class for LArRawSC.
Definition: LArRawSCContainer.h:17
LArCelldeadOTXTool::ATLAS_THREAD_SAFE
scToDeadCellMap_t m_scToDead ATLAS_THREAD_SAFE
Definition: LArCelldeadOTXTool.h:52
LArCelldeadOTXTool::m_badSCKey
SG::ReadCondHandleKey< LArBadChannelCont > m_badSCKey
Definition: LArCelldeadOTXTool.h:36
LArCelldeadOTXTool::process
virtual StatusCode process(CaloCellContainer *cellCollection, const EventContext &ctx) const override final
Definition: LArCelldeadOTXTool.cxx:35
LArCelldeadOTXTool::finalize
virtual StatusCode finalize() override final
Definition: LArCelldeadOTXTool.cxx:210
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
ICaloSuperCellIDTool.h
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LArBadChannelCont.h
LArCelldeadOTXTool::m_SCKey
SG::ReadHandleKey< LArRawSCContainer > m_SCKey
Definition: LArCelldeadOTXTool.h:34
LArOnOffIdMapping.h
LArCelldeadOTXTool::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: LArCelldeadOTXTool.h:37
LArCelldeadOTXTool::m_scidtool
ToolHandle< ICaloSuperCellIDTool > m_scidtool
Definition: LArCelldeadOTXTool.h:45
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
LArCelldeadOTXTool
Definition: LArCelldeadOTXTool.h:23
LArCelldeadOTXTool::m_onlineID
const LArOnlineID * m_onlineID
Definition: LArCelldeadOTXTool.h:43
LArCelldeadOTXTool::m_testMode
Gaudi::Property< bool > m_testMode
Definition: LArCelldeadOTXTool.h:42
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
LArCelldeadOTXTool::m_cablingSCKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingSCKey
Definition: LArCelldeadOTXTool.h:38
ReadCondHandleKey.h
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
LArCelldeadOTXTool::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: LArCelldeadOTXTool.h:39
LArCelldeadOTXTool::~LArCelldeadOTXTool
~LArCelldeadOTXTool()=default
LArOnlineID
Definition: LArOnlineID.h:20
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
ICaloCellMakerTool.h
SG::ReadCondHandleKey
Definition: ReadCondHandleKey.h:20
LArCelldeadOTXTool::m_mtx
std::mutex m_mtx
Definition: LArCelldeadOTXTool.h:55
LArCelldeadOTXTool::m_calo_id
const CaloCell_ID * m_calo_id
Definition: LArCelldeadOTXTool.h:44
LArCelldeadOTXTool::ATLAS_THREAD_SAFE
std::once_flag m_onceFlag ATLAS_THREAD_SAFE
Definition: LArCelldeadOTXTool.h:51
LArCelldeadOTXTool::initialize
virtual StatusCode initialize() override final
Definition: LArCelldeadOTXTool.cxx:13
LArCelldeadOTXTool::scToDeadCellMap_t
std::map< HWIdentifier, std::vector< std::pair< IdentifierHash, float > > > scToDeadCellMap_t
Definition: LArCelldeadOTXTool.h:47