ATLAS Offline Software
Loading...
Searching...
No Matches
EfexSimMonitorAlgorithm.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef TRIGT1CALOMONITORING_EFEXSIMMONITORALGORITHM_H
5#define TRIGT1CALOMONITORING_EFEXSIMMONITORALGORITHM_H
6
10//
15
19
22
24public:EfexSimMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
25 virtual ~EfexSimMonitorAlgorithm()=default;
26 virtual StatusCode initialize() override;
27 virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
28
29private:
30
31
32 // these maps hold the binlabels (in form of LBN:FirstEventNum) to use for each lb
33 mutable std::map<int,std::string> m_firstEvents_DataTowers ATLAS_THREAD_SAFE;
34 mutable std::map<int,std::string> m_firstEvents_EmulatedTowers ATLAS_THREAD_SAFE;
35 mutable std::mutex m_firstEventsMutex;
36
37 // container keys including this, steering parameter, default value and help description
38 SG::ReadHandleKey<xAOD::eFexEMRoIContainer> m_eFexEmContainerKey{this,"eFexEMRoIContainer","L1_eEMRoI","SG key of the data eFex Em RoI container"};
39 SG::ReadHandleKey<xAOD::eFexTauRoIContainer> m_eFexTauContainerKey{this,"eFexTauRoIContainer","L1_eTauRoI","SG key of the data eFex Tau RoI container"};
40 SG::ReadHandleKey<xAOD::eFexEMRoIContainer> m_eFexEmSimContainerKey{this,"eFexEMRoISimContainer","L1_eEMRoISim","SG key of the simulated eFex Em RoI container"};
41 SG::ReadHandleKey<xAOD::eFexTauRoIContainer> m_eFexTauSimContainerKey{this,"eFexTauSimRoIContainer","L1_eTauRoISim","SG key of the simulated eFex Tau RoI container"};
42
43 // same again for xTOBs
44 SG::ReadHandleKey<xAOD::eFexEMRoIContainer> m_eFexEmxContainerKey{this,"eFexEMxRoIContainer","","SG key of the data eFex Em RoI container"};
45 SG::ReadHandleKey<xAOD::eFexTauRoIContainer> m_eFexTauxContainerKey{this,"eFexTauxRoIContainer","","SG key of the data eFex Tau RoI container"};
46 SG::ReadHandleKey<xAOD::eFexEMRoIContainer> m_eFexEmxSimContainerKey{this,"eFexEMxRoISimContainer","","SG key of the simulated eFex Em RoI container"};
47 SG::ReadHandleKey<xAOD::eFexTauRoIContainer> m_eFexTauxSimContainerKey{this,"eFexTauxSimRoIContainer","","SG key of the simulated eFex Tau RoI container"};
48
49 // need to check how many supercells there are, as expect mismatches when any are missing:
50 SG::ReadHandleKey<CaloCellContainer> m_scellKey { this, "CaloCellContainerReadKey", "SCell", "Read handle key for the supercells"};
51
52 SG::ReadHandleKey<xAOD::eFexTowerContainer> m_eFexTowerContainerKey{this,"eFexTowerContainer","L1_eFexDataTowers","SG key of the primary eFex tower container, which should be populated if fex readout occurring"};
53
54 SG::ReadCondHandleKey<LArBadChannelCont> m_bcContKey{this, "LArMaskedChannelKey", "LArMaskedSC", "Key of the OTF-Masked SC" };
55
56
57 struct SortableTob {
58 SortableTob(unsigned int w, float e, float p) : word0(w),eta(e),phi(p) { }
59 unsigned int word0;
60 float eta,phi;
61 };
62
63 template <typename T> void fillVectors(const SG::ReadHandleKey<T>& key, const EventContext& ctx, std::vector<float>& etas, std::vector<float>& phis, std::vector<unsigned int>& word0s) const {
64 etas.clear();phis.clear();word0s.clear();
65 SG::ReadHandle<T> tobs{key, ctx};
66 if(tobs.isValid()) {
67 etas.reserve(tobs->size());
68 phis.reserve(tobs->size());
69 word0s.reserve(tobs->size());
70 std::vector<SortableTob> sortedTobs;
71 sortedTobs.reserve(tobs->size());
72 for(auto tob : *tobs) {
73 sortedTobs.emplace_back(SortableTob{tob->word0(),tob->eta(),tob->phi()});
74 }
75 std::sort(sortedTobs.begin(),sortedTobs.end(),[](const SortableTob& lhs, const SortableTob& rhs) { return lhs.word0<rhs.word0; });
76 for(auto& tob : sortedTobs) {
77 etas.push_back(tob.eta);
78 phis.push_back(tob.phi);
79 word0s.push_back(tob.word0);
80 }
81 }
82 }
83
84
85 template <typename T> unsigned int fillHistos(const SG::ReadHandleKey<T>& key1, const SG::ReadHandleKey<T>& key2, const EventContext& ctx, const std::string& signa = "" ) const;
86
87
88};
89#endif
Header file to be included by clients of the Monitored infrastructure.
Property holding a SG store/key/clid from which a ReadHandle is made.
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eFexEmContainerKey
SG::ReadHandleKey< CaloCellContainer > m_scellKey
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
std::map< int, std::string > m_firstEvents_DataTowers ATLAS_THREAD_SAFE
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauxSimContainerKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eFexEmSimContainerKey
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauContainerKey
SG::ReadHandleKey< xAOD::eFexTowerContainer > m_eFexTowerContainerKey
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauSimContainerKey
void fillVectors(const SG::ReadHandleKey< T > &key, const EventContext &ctx, std::vector< float > &etas, std::vector< float > &phis, std::vector< unsigned int > &word0s) const
virtual ~EfexSimMonitorAlgorithm()=default
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eFexEmxSimContainerKey
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauxContainerKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eFexEmxContainerKey
Property holding a SG store/key/clid from which a ReadHandle is made.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
void initialize()
SortableTob(unsigned int w, float e, float p)