ATLAS Offline Software
EfexSimMonitorAlgorithm.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef TRIGT1CALOMONITORING_EFEXSIMMONITORALGORITHM_H
5 #define TRIGT1CALOMONITORING_EFEXSIMMONITORALGORITHM_H
6 
10 //
12 #include "xAODTrigger/eFexEMRoI.h"
14 #include "xAODTrigger/eFexTauRoI.h"
15 
18 #include "FourMomUtils/P4Helpers.h"
19 
21 
23 public:EfexSimMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
24  virtual ~EfexSimMonitorAlgorithm()=default;
25  virtual StatusCode initialize() override;
26  virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
27 
28 private:
29 
30  StringProperty m_packageName{this,"PackageName","EfexSimMonitor","group name for histograming"};
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;
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  // SG::ReadDecorHandleKey<xAOD::EventInfo> m_decorKey;
44  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"};
45 
46  SG::ReadCondHandleKey<LArBadChannelCont> m_bcContKey{this, "LArMaskedChannelKey", "LArMaskedSC", "Key of the OTF-Masked SC" };
47 
48 
49  struct SortableTob {
50  SortableTob(unsigned int w, float e, float p) : word0(w),eta(e),phi(p) { }
51  unsigned int word0;
52  float eta,phi;
53  };
54 
55  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 {
56  etas.clear();phis.clear();word0s.clear();
57  SG::ReadHandle<T> tobs{key, ctx};
58  if(tobs.isValid()) {
59  etas.reserve(tobs->size());
60  phis.reserve(tobs->size());
61  word0s.reserve(tobs->size());
62  std::vector<SortableTob> sortedTobs;
63  sortedTobs.reserve(tobs->size());
64  for(auto tob : *tobs) {
65  sortedTobs.emplace_back(SortableTob{tob->word0(),tob->eta(),tob->phi()});
66  }
67  std::sort(sortedTobs.begin(),sortedTobs.end(),[](const SortableTob& lhs, const SortableTob& rhs) { return lhs.word0<rhs.word0; });
68  for(auto& tob : sortedTobs) {
69  etas.push_back(tob.eta);
70  phis.push_back(tob.phi);
71  word0s.push_back(tob.word0);
72  }
73  }
74  }
75 
76 
77  template <typename T> unsigned int fillHistos(const SG::ReadHandleKey<T>& key1, const SG::ReadHandleKey<T>& key2, const EventContext& ctx, const std::string& signa = "" ) const;
78 
79 
80 };
81 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
EfexSimMonitorAlgorithm::m_eFexEmContainerKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eFexEmContainerKey
Definition: EfexSimMonitorAlgorithm.h:38
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
EfexSimMonitorAlgorithm::m_bcContKey
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
Definition: EfexSimMonitorAlgorithm.h:46
eFexTowerContainer.h
EfexSimMonitorAlgorithm::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: EfexSimMonitorAlgorithm.cxx:36
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
EfexSimMonitorAlgorithm::ATLAS_THREAD_SAFE
std::map< int, std::string > m_firstEvents_EmulatedTowers ATLAS_THREAD_SAFE
Definition: EfexSimMonitorAlgorithm.h:34
eFexTauRoIContainer.h
EfexSimMonitorAlgorithm::SortableTob::eta
float eta
Definition: EfexSimMonitorAlgorithm.h:52
EfexSimMonitorAlgorithm::SortableTob::word0
unsigned int word0
Definition: EfexSimMonitorAlgorithm.h:51
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
EfexSimMonitorAlgorithm
Definition: EfexSimMonitorAlgorithm.py:1
EfexSimMonitorAlgorithm::m_eFexTauContainerKey
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauContainerKey
Definition: EfexSimMonitorAlgorithm.h:39
EfexSimMonitorAlgorithm::EfexSimMonitorAlgorithm
EfexSimMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: EfexSimMonitorAlgorithm.cxx:9
EfexSimMonitorAlgorithm::m_packageName
StringProperty m_packageName
Definition: EfexSimMonitorAlgorithm.h:30
module_driven_slicing.key2
key2
Definition: module_driven_slicing.py:159
EfexSimMonitorAlgorithm::SortableTob::SortableTob
SortableTob(unsigned int w, float e, float p)
Definition: EfexSimMonitorAlgorithm.h:50
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
EfexSimMonitorAlgorithm::m_eFexEmSimContainerKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eFexEmSimContainerKey
Definition: EfexSimMonitorAlgorithm.h:40
LArBadChannelCont.h
EfexSimMonitorAlgorithm::SortableTob
Definition: EfexSimMonitorAlgorithm.h:49
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
EfexSimMonitorAlgorithm::m_eFexTowerContainerKey
SG::ReadHandleKey< xAOD::eFexTowerContainer > m_eFexTowerContainerKey
Definition: EfexSimMonitorAlgorithm.h:44
EfexSimMonitorAlgorithm::m_eFexTauSimContainerKey
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauSimContainerKey
Definition: EfexSimMonitorAlgorithm.h:41
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EfexSimMonitorAlgorithm::~EfexSimMonitorAlgorithm
virtual ~EfexSimMonitorAlgorithm()=default
AthMonitorAlgorithm.h
EfexSimMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: EfexSimMonitorAlgorithm.cxx:14
EfexSimMonitorAlgorithm::SortableTob::phi
float phi
Definition: EfexSimMonitorAlgorithm.h:52
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
P4Helpers.h
EfexSimMonitorAlgorithm::m_firstEventsMutex
std::mutex m_firstEventsMutex
Definition: EfexSimMonitorAlgorithm.h:35
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
eFexTauRoI.h
eFexTower.h
SG::ReadCondHandleKey
Definition: ReadCondHandleKey.h:20
EfexSimMonitorAlgorithm::ATLAS_THREAD_SAFE
std::map< int, std::string > m_firstEvents_DataTowers ATLAS_THREAD_SAFE
Definition: EfexSimMonitorAlgorithm.h:33
EfexSimMonitorAlgorithm::fillHistos
unsigned int fillHistos(const SG::ReadHandleKey< T > &key1, const SG::ReadHandleKey< T > &key2, const EventContext &ctx, const std::string &signa="") const
Definition: EfexSimMonitorAlgorithm.cxx:43
EfexSimMonitorAlgorithm::fillVectors
void fillVectors(const SG::ReadHandleKey< T > &key, const EventContext &ctx, std::vector< float > &etas, std::vector< float > &phis, std::vector< unsigned int > &word0s) const
Definition: EfexSimMonitorAlgorithm.h:55
eFexEMRoI.h
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
EgEfficiencyCorr_testFixedInput.etas
list etas
Definition: EgEfficiencyCorr_testFixedInput.py:9
eFexEMRoIContainer.h
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
module_driven_slicing.key1
key1
Definition: module_driven_slicing.py:158