ATLAS Offline Software
CpmMonitorAlgorithm.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef TRIGT1CALOMONITORING_CPMMONITORALGORITHM_H
5 #define TRIGT1CALOMONITORING_CPMMONITORALGORITHM_H
6 
16 
17 
19  public:CpmMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
20  virtual ~CpmMonitorAlgorithm()=default;
21  virtual StatusCode initialize() override;
22  virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
23 
24  // monitoring trigger tower structs for various towers
25  struct MonitorTT{
27  double phi_scaled{}; // rescaled for 2D plots
28  };
29 
30  struct MonitorCpmTT{
32  // some modified/derived information
33  double phi_scaled{}; // rescaled for 2D plots
34  int slice{}; // crate * m_maxSlices + emEnergyVec()).size() - 1;
35  // errors
36  bool emParityError{};
40  };
41 
42  struct MonitorTobRoI{
44  // some modified/derived information
45  double etaMod{};
46  double phiMod{};
47  };
48 
50  MonitorCmxCpTob() = default; // suppresses a cppcheck false positive
52  // some modified/derived information
53  uint8_t x{}; // crate * m_modules + cpm - 1
54  uint8_t y{}; // chip * 4 + location
55  int ybase{}; // cmx * 5
56  // errors required to be used as masks
57  bool parityError{};
58  int ybaseError{};
59  };
60 
63  // some modified/derived information
64  uint8_t crateSlices{}; // crate * m_maxSlices + slices - 1
65  uint8_t crateCmx{}; // crate * 2 + cmx
66  // source flag
68  };
69 
70 
71 private:
72 
73  // Phi scale for trigger tower eta/phi plots
74  double m_phiScaleTT{};
75 
76  StringProperty m_packageName{this,"PackageName","CpmMonitor","group name for histograming"};
77 
78  Gaudi::Property<int> m_crates{this,"s_crates", 4, "Number of CPM crates"};
79  Gaudi::Property<int> m_modules{this,"s_modules", 14, "Number of modules per crate (modules numbered 1-14)"};
80  Gaudi::Property<int> m_maxSlices{this,"s_maxSlices", 5, "Maximum number of slices"};
81  Gaudi::Property<int> m_tobsPerCPM{this,"s_tobsPerCPM", 5, "Maximum number of TOBs per CPM sent to CMX"};
82  Gaudi::Property<int> m_isolBits{this,"s_isolBits", 5, "Number of bits for encoded isolation"};
83  Gaudi::Property<int> m_threshBits{this,"s_threshBits", 3, "Number of bits per threshold for hit sums"};
84  Gaudi::Property<int> m_thresholds{this,"s_thresholds", 16, "Number of EM/Tau threshold bits"};
85  Gaudi::Property<int> m_maxTobsPerCmx{this,"MaxTOBsPerCMX", 70, "Maximum number of TOBs per CMX plotted"};
86 
87  // Error vector StoreGate key
88  SG::WriteHandleKey<std::vector<int>> m_errorLocation{this,"ErrorLocation","L1CaloCPMErrorVector","Error vector name"};
89 
90  // Error summary plot bins
93 
94 
95  // container keys including steering parameter and description
98  SG::ReadHandleKey<xAOD::CPMTowerContainer> m_cpmTowerLocationOverlap{this, "CPMTowerLocationOverlap",LVL1::TrigT1CaloDefs::CPMTowerLocation + "Overlap", "CPM Overlap container"};
102 
103  std::vector<bool> getIsolationBits(int val, int nThresh, int nBits) const;
104 
105 
107  std::vector<MonitorCpmTT> &monCpmTTs_em, std::vector<MonitorCpmTT> &monCpmTTs_had,
108  std::vector<int> &errorsCPM,
109  bool core,
110  Monitored::Scalar<int> &cpmLoc,
111  Monitored::Scalar<int> &GLinkParityError
112  ) const;
113 
114 
115 };
116 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
CpmMonitorAlgorithm::MonitorCmxCpTob::ybase
int ybase
Definition: CpmMonitorAlgorithm.h:55
CpmMonitorAlgorithm::m_thresholds
Gaudi::Property< int > m_thresholds
Definition: CpmMonitorAlgorithm.h:84
CpmMonitorAlgorithm::SumParity
@ SumParity
Definition: CpmMonitorAlgorithm.h:92
CpmMonitorAlgorithm::CPMStatus
@ CPMStatus
Definition: CpmMonitorAlgorithm.h:91
CpmMonitorAlgorithm::MonitorCmxCpTob::MonitorCmxCpTob
MonitorCmxCpTob()=default
CpmMonitorAlgorithm::HadParity
@ HadParity
Definition: CpmMonitorAlgorithm.h:91
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
CpmMonitorAlgorithm::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: CpmMonitorAlgorithm.cxx:46
CpmMonitorAlgorithm::m_packageName
StringProperty m_packageName
Definition: CpmMonitorAlgorithm.h:76
CpmMonitorAlgorithm::NumberOfSummaryBins
@ NumberOfSummaryBins
Definition: CpmMonitorAlgorithm.h:92
CpmMonitorAlgorithm::m_crates
Gaudi::Property< int > m_crates
Definition: CpmMonitorAlgorithm.h:78
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
CpmMonitorAlgorithm::fillCpmTowerVectors
StatusCode fillCpmTowerVectors(SG::ReadHandle< xAOD::CPMTowerContainer > &cpmTower, std::vector< MonitorCpmTT > &monCpmTTs_em, std::vector< MonitorCpmTT > &monCpmTTs_had, std::vector< int > &errorsCPM, bool core, Monitored::Scalar< int > &cpmLoc, Monitored::Scalar< int > &GLinkParityError) const
Definition: CpmMonitorAlgorithm.cxx:780
CpmMonitorAlgorithm::m_maxSlices
Gaudi::Property< int > m_maxSlices
Definition: CpmMonitorAlgorithm.h:80
CpmMonitorAlgorithm::MonitorCmxCpHits::crateCmx
uint8_t crateCmx
Definition: CpmMonitorAlgorithm.h:65
CpmMonitorAlgorithm::SummaryErrors
SummaryErrors
Definition: CpmMonitorAlgorithm.h:91
CpmMonitorAlgorithm::getIsolationBits
std::vector< bool > getIsolationBits(int val, int nThresh, int nBits) const
Definition: CpmMonitorAlgorithm.cxx:761
CPMTowerContainer.h
LVL1::TrigT1CaloDefs::CMXCPTobLocation
static const std::string CMXCPTobLocation
Definition: TrigT1CaloDefs.h:58
CpmMonitorAlgorithm::EMLink
@ EMLink
Definition: CpmMonitorAlgorithm.h:91
xAOD::CMXCPTob_v1
Description of CMXCPTob_v1.
Definition: CMXCPTob_v1.h:27
CpmMonitorAlgorithm::m_cmxCpHitsLocation
SG::ReadHandleKey< xAOD::CMXCPHitsContainer > m_cmxCpHitsLocation
Definition: CpmMonitorAlgorithm.h:101
CpmMonitorAlgorithm::CMXStatus
@ CMXStatus
Definition: CpmMonitorAlgorithm.h:92
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
CMXCPTobContainer.h
CpmMonitorAlgorithm::MonitorTT
Definition: CpmMonitorAlgorithm.h:25
CpmMonitorAlgorithm::MonitorCmxCpTob::tob
const xAOD::CMXCPTob_v1 * tob
Definition: CpmMonitorAlgorithm.h:51
CpmMonitorAlgorithm::m_cpmTowerLocationOverlap
SG::ReadHandleKey< xAOD::CPMTowerContainer > m_cpmTowerLocationOverlap
Definition: CpmMonitorAlgorithm.h:98
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
CMXCPHitsContainer.h
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
CpmMonitorAlgorithm::MonitorTobRoI::tobroi
const xAOD::CPMTobRoI_v1 * tobroi
Definition: CpmMonitorAlgorithm.h:43
CpmMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: CpmMonitorAlgorithm.cxx:16
CPMTobRoIContainer.h
CpmMonitorAlgorithm::MonitorCpmTT::emLinkDownError
bool emLinkDownError
Definition: CpmMonitorAlgorithm.h:37
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CpmMonitorAlgorithm::MonitorCpmTT::hadParityError
bool hadParityError
Definition: CpmMonitorAlgorithm.h:38
AthMonitorAlgorithm.h
CpmMonitorAlgorithm::MonitorCmxCpTob::y
uint8_t y
Definition: CpmMonitorAlgorithm.h:54
CpmMonitorAlgorithm::MonitorCpmTT::hadLinkDownError
bool hadLinkDownError
Definition: CpmMonitorAlgorithm.h:39
CpmMonitorAlgorithm::MonitorCpmTT::ttower
const xAOD::CPMTower_v2 * ttower
Definition: CpmMonitorAlgorithm.h:31
xAOD::TriggerTower_v2
Description of TriggerTower_v2.
Definition: TriggerTower_v2.h:49
CpmMonitorAlgorithm::MonitorTobRoI
Definition: CpmMonitorAlgorithm.h:42
CpmMonitorAlgorithm
Definition: CpmMonitorAlgorithm.py:1
CpmMonitorAlgorithm::m_tobsPerCPM
Gaudi::Property< int > m_tobsPerCPM
Definition: CpmMonitorAlgorithm.h:81
CpmMonitorAlgorithm::MonitorCmxCpHits::hit
const xAOD::CMXCPHits_v1 * hit
Definition: CpmMonitorAlgorithm.h:62
LVL1::TrigT1CaloDefs::CPMTowerLocation
static const std::string CPMTowerLocation
Definition: TrigT1CaloDefs.h:38
CpmMonitorAlgorithm::MonitorCmxCpHits
Definition: CpmMonitorAlgorithm.h:61
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
CpmMonitorAlgorithm::m_maxTobsPerCmx
Gaudi::Property< int > m_maxTobsPerCmx
Definition: CpmMonitorAlgorithm.h:85
CpmMonitorAlgorithm::MonitorTT::ttower
const xAOD::TriggerTower_v2 * ttower
Definition: CpmMonitorAlgorithm.h:26
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
CpmMonitorAlgorithm::MonitorCmxCpHits::crateSlices
uint8_t crateSlices
Definition: CpmMonitorAlgorithm.h:64
CpmMonitorAlgorithm::m_isolBits
Gaudi::Property< int > m_isolBits
Definition: CpmMonitorAlgorithm.h:82
CpmMonitorAlgorithm::MonitorTobRoI::etaMod
double etaMod
Definition: CpmMonitorAlgorithm.h:45
CpmMonitorAlgorithm::m_cpmTobRoiLocation
SG::ReadHandleKey< xAOD::CPMTobRoIContainer > m_cpmTobRoiLocation
Definition: CpmMonitorAlgorithm.h:99
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CpmMonitorAlgorithm::m_xAODTriggerTowerContainerName
SG::ReadHandleKey< xAOD::TriggerTowerContainer > m_xAODTriggerTowerContainerName
Definition: CpmMonitorAlgorithm.h:96
CpmMonitorAlgorithm::MonitorTobRoI::phiMod
double phiMod
Definition: CpmMonitorAlgorithm.h:46
CpmMonitorAlgorithm::MonitorCmxCpTob::ybaseError
int ybaseError
Definition: CpmMonitorAlgorithm.h:58
CpmMonitorAlgorithm::MonitorCpmTT
Definition: CpmMonitorAlgorithm.h:30
LVL1::TrigT1CaloDefs::xAODTriggerTowerLocation
static const std::string xAODTriggerTowerLocation
Definition: TrigT1CaloDefs.h:36
TrigT1CaloDefs.h
CpmMonitorAlgorithm::MonitorCmxCpHits::srcTopoCheckSum
bool srcTopoCheckSum
Definition: CpmMonitorAlgorithm.h:67
CpmMonitorAlgorithm::MonitorTT::phi_scaled
double phi_scaled
Definition: CpmMonitorAlgorithm.h:27
CpmMonitorAlgorithm::MonitorCmxCpTob::parityError
bool parityError
Definition: CpmMonitorAlgorithm.h:57
CpmMonitorAlgorithm::m_threshBits
Gaudi::Property< int > m_threshBits
Definition: CpmMonitorAlgorithm.h:83
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
CpmMonitorAlgorithm::MonitorCpmTT::emParityError
bool emParityError
Definition: CpmMonitorAlgorithm.h:36
CpmMonitorAlgorithm::m_errorLocation
SG::WriteHandleKey< std::vector< int > > m_errorLocation
Definition: CpmMonitorAlgorithm.h:88
CpmMonitorAlgorithm::MonitorCmxCpTob
Definition: CpmMonitorAlgorithm.h:49
LVL1::TrigT1CaloDefs::CPMTobRoILocation
static const std::string CPMTobRoILocation
Definition: TrigT1CaloDefs.h:62
CpmMonitorAlgorithm::m_phiScaleTT
double m_phiScaleTT
Definition: CpmMonitorAlgorithm.h:74
CpmMonitorAlgorithm::m_cmxCpTobLocation
SG::ReadHandleKey< xAOD::CMXCPTobContainer > m_cmxCpTobLocation
Definition: CpmMonitorAlgorithm.h:100
CpmMonitorAlgorithm::TOBParity
@ TOBParity
Definition: CpmMonitorAlgorithm.h:92
CpmMonitorAlgorithm::MonitorCpmTT::slice
int slice
Definition: CpmMonitorAlgorithm.h:34
CpmMonitorAlgorithm::m_cpmTowerLocation
SG::ReadHandleKey< xAOD::CPMTowerContainer > m_cpmTowerLocation
Definition: CpmMonitorAlgorithm.h:97
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
xAOD::CMXCPHits_v1
Description of CMXCPHits_v1.
Definition: CMXCPHits_v1.h:27
CpmMonitorAlgorithm::MonitorCmxCpTob::x
uint8_t x
Definition: CpmMonitorAlgorithm.h:53
CpmMonitorAlgorithm::MonitorCpmTT::phi_scaled
double phi_scaled
Definition: CpmMonitorAlgorithm.h:33
CpmMonitorAlgorithm::m_modules
Gaudi::Property< int > m_modules
Definition: CpmMonitorAlgorithm.h:79
LVL1::TrigT1CaloDefs::CMXCPHitsLocation
static const std::string CMXCPHitsLocation
Definition: TrigT1CaloDefs.h:59
CpmMonitorAlgorithm::EMParity
@ EMParity
Definition: CpmMonitorAlgorithm.h:91
CpmMonitorAlgorithm::~CpmMonitorAlgorithm
virtual ~CpmMonitorAlgorithm()=default
xAOD::CPMTobRoI_v1
Description of CPMTobRoI_v1.
Definition: CPMTobRoI_v1.h:24
xAOD::CPMTower_v2
Description of CPMTower_v2.
Definition: CPMTower_v2.h:26
CpmMonitorAlgorithm::CpmMonitorAlgorithm
CpmMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: CpmMonitorAlgorithm.cxx:10
CpmMonitorAlgorithm::HadLink
@ HadLink
Definition: CpmMonitorAlgorithm.h:91