ATLAS Offline Software
LArRawChannelMonAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LARMONITORING_LARRAWCHANNELMONALG_H
6 #define LARMONITORING_LARRAWCHANNELMONALG_H
7 
10 #include "GaudiKernel/ToolHandle.h"
17 
18 #include <string>
19 #include <vector>
20 #include <set>
21 #include <array>
22 
23 class LArOnlineID;
24 class CaloNoise;
25 
26 // A monitoring algorithm for the LAr's Raw Channels
27 //
28 // This AthMonitorAlgorithm is largely based upon the original class
29 // LArRawChannelMonTool authored by Rob McPherson &Frank Berghaus.
30 // For the time being, it provides only a subset of the monitoring
31 // histograms defined in the original class.
33  public:
34  LArRawChannelMonAlg(const std::string&, ISvcLocator*);
35 
36  virtual ~LArRawChannelMonAlg();
37 
38  // Connects to services and tools
39  //
40  // The LArOnlineID and LArCablingService are retrieved.
41  // Mapping from FEB hash to sub-detector is created.
42  virtual StatusCode initialize() override;
43 
44  // Fill histograms with monitoring quantities
45  //
46  // Returns success if no LArRawChannelContainer exists, returns failure if
47  // LArRawChannelContainer cannot be retrieved.
48  virtual StatusCode fillHistograms(const EventContext& ctx) const override;
49 
50  private:
51  // Public alg properties
52  Gaudi::Property<bool> m_monitor_occupancy{
53  this, "monitor_occupancy", false, ""};
54  Gaudi::Property<bool> m_monitor_signal{
55  this, "monitor_signal", true, ""};
56  Gaudi::Property<bool> m_monitor_positive_noise{
57  this, "monitor_positive_noise", true, ""};
58  Gaudi::Property<bool> m_monitor_negative_noise{
59  this, "monitor_negative_noise", true, ""};
60  Gaudi::Property<bool> m_monitor_time{
61  this, "monitor_time", true, ""};
62  Gaudi::Property<bool> m_monitor_quality{
63  this, "monitor_quality", false, ""};
64  Gaudi::Property<bool> m_monitor_burst{
65  this, "monitor_burst", true, ""};
66  Gaudi::Property<bool> m_monitor_febs{
67  this, "monitor_febs", false, ""};
68  Gaudi::Property<bool> m_monitor_feedthroughs{
69  this, "monitor_feedthroughs", false, ""};
70  Gaudi::Property<bool> m_monitor_detectors{
71  this, "monitor_detectors", true, ""};
72  Gaudi::Property<std::vector<double>> m_occupancy_thresholds{
73  this, "occupancy_thresholds", {8, 500. * Gaudi::Units::MeV}, ""};
74  Gaudi::Property<std::vector<double>> m_signal_thresholds{
75  this, "signal_thresholds", {8, 500. * Gaudi::Units::MeV}, ""};
76  Gaudi::Property<std::vector<int>> m_pos_noise_thresholds{
77  this, "pos_noise_thresholds", {8, 3}, ""};
78  Gaudi::Property<std::vector<int>> m_neg_noise_thresholds{
79  this, "neg_noise_thresholds", {8, 3}, ""};
80  Gaudi::Property<double> m_bcid_signal_threshold{
81  this, "bcid_signal_threshold", 500. * Gaudi::Units::MeV, ""};
82  Gaudi::Property<short> m_time_threshold{
83  this, "time_threshold", 5, ""};
84  Gaudi::Property<unsigned short> m_quality_threshold{
85  this, "quality_threshold", 4000, ""};
86  Gaudi::Property<short> m_noise_threshold{
87  this, "noise_threshold", 3, ""};
88  Gaudi::Property<std::vector<double>> m_noise_burst_percent_thresholds{
89  this, "noise_burst_percent_threshold", {8, 1.}, ""};
90  Gaudi::Property<std::vector<unsigned>> m_noise_burst_nChannel_thresholds{
91  this, "noise_burst_nChannel_threshold", {8, 10}, ""};
92  Gaudi::Property<std::vector<std::string>> m_noise_streams{
93  this, "noise_streams", {}, ""};
94  Gaudi::Property<bool> m_db_and_ofc_only{
95  this, "db_and_ofc_only", true, "use channels "
96  "only if pedestal and adc2e value from DB and OFC was used"};
97  Gaudi::Property<std::vector<std::string>> m_problemsToMask{
98  this,"ProblemsToMask", {}, "Bad-Channel categories to mask"};
99  ToolHandleArray<IDQFilterTool> m_atlasReady_tools{
100  this, "AtlasReadyFilterTool", {}};
101 
102  // --- ReadHandle keys ---
104  this, "LArRawChannelContainerKey", "LArRawChannels"};
105 
106  // --- tools ---
108 
109  // Handle to bad-channel mask
112  this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"};
114  this, "NoiseKey", "totalNoise", "SG key for noise" };
116  this,"CablingKey", "LArOnOffIdMap",
117  "SG Key of LArOnOffIdMapping object"};
118  //To get the data-dependency right ...
119  SG::ReadDecorHandleKey<xAOD::EventInfo> m_larFlagKey{this, "LArStatusFlag", "EventInfo.larFlags", "Key for EventInfo object"};
120 
121  // Index of the GenericMonitoringTool associated to a given partition
122  // in the vector AthMonitorAlgorithm::m_tools
123  std::array<int, 8> m_monitoring_tool_index;
124 
125  // Dictionary FEB hash <-> partition
126  std::vector<int8_t> m_feb_hash_to_detector;
127 
128  // Number of LArRawChannels connected in each detector
129  std::array<uint32_t, 8> m_det_to_nchannels;
130 
131  // Same as m_noise_streams but retaining only unique streams
132  std::set<std::string> m_noise_streams_set;
133 };
134 
135 #endif // LARMONITORING_LARRAWCHANNELMONALG_H
LArRawChannelMonAlg::~LArRawChannelMonAlg
virtual ~LArRawChannelMonAlg()
Definition: LArRawChannelMonAlg.cxx:70
LArRawChannelMonAlg::m_db_and_ofc_only
Gaudi::Property< bool > m_db_and_ofc_only
Definition: LArRawChannelMonAlg.h:94
LArRawChannelMonAlg::m_larFlagKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_larFlagKey
Definition: LArRawChannelMonAlg.h:119
LArRawChannelMonAlg::m_occupancy_thresholds
Gaudi::Property< std::vector< double > > m_occupancy_thresholds
Definition: LArRawChannelMonAlg.h:72
LArRawChannelMonAlg::m_bcMask
LArBadChannelMask m_bcMask
Definition: LArRawChannelMonAlg.h:110
LArRawChannelMonAlg::m_atlasReady_tools
ToolHandleArray< IDQFilterTool > m_atlasReady_tools
Definition: LArRawChannelMonAlg.h:99
LArRawChannelMonAlg::m_pos_noise_thresholds
Gaudi::Property< std::vector< int > > m_pos_noise_thresholds
Definition: LArRawChannelMonAlg.h:76
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
LArRawChannelMonAlg::m_monitor_time
Gaudi::Property< bool > m_monitor_time
Definition: LArRawChannelMonAlg.h:60
LArRawChannelMonAlg::m_signal_thresholds
Gaudi::Property< std::vector< double > > m_signal_thresholds
Definition: LArRawChannelMonAlg.h:74
SG::ReadHandleKey< LArRawChannelContainer >
LArRawChannelMonAlg::m_bcContKey
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
Definition: LArRawChannelMonAlg.h:111
LArRawChannelMonAlg::initialize
virtual StatusCode initialize() override
initialize
Definition: LArRawChannelMonAlg.cxx:73
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
LArRawChannelMonAlg::m_lar_online_id_ptr
const LArOnlineID * m_lar_online_id_ptr
Definition: LArRawChannelMonAlg.h:107
LArOnOffIdMapping.h
LArRawChannelMonAlg::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: LArRawChannelMonAlg.h:115
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthMonitorAlgorithm.h
LArRawChannelMonAlg::m_monitor_detectors
Gaudi::Property< bool > m_monitor_detectors
Definition: LArRawChannelMonAlg.h:70
LArRawChannelMonAlg::m_time_threshold
Gaudi::Property< short > m_time_threshold
Definition: LArRawChannelMonAlg.h:82
DQAtlasReadyFilterTool.h
LArRawChannelMonAlg::m_monitor_feedthroughs
Gaudi::Property< bool > m_monitor_feedthroughs
Definition: LArRawChannelMonAlg.h:68
LArRawChannelMonAlg::m_monitor_occupancy
Gaudi::Property< bool > m_monitor_occupancy
Definition: LArRawChannelMonAlg.h:52
LArRawChannelMonAlg::m_monitoring_tool_index
std::array< int, 8 > m_monitoring_tool_index
Definition: LArRawChannelMonAlg.h:123
LArRawChannelMonAlg::m_monitor_positive_noise
Gaudi::Property< bool > m_monitor_positive_noise
Definition: LArRawChannelMonAlg.h:56
LArRawChannelMonAlg::m_noise_streams_set
std::set< std::string > m_noise_streams_set
Definition: LArRawChannelMonAlg.h:132
LArRawChannelMonAlg::m_quality_threshold
Gaudi::Property< unsigned short > m_quality_threshold
Definition: LArRawChannelMonAlg.h:84
LArRawChannelMonAlg::m_monitor_signal
Gaudi::Property< bool > m_monitor_signal
Definition: LArRawChannelMonAlg.h:54
LArRawChannelMonAlg::m_monitor_negative_noise
Gaudi::Property< bool > m_monitor_negative_noise
Definition: LArRawChannelMonAlg.h:58
LArRawChannelMonAlg::m_monitor_burst
Gaudi::Property< bool > m_monitor_burst
Definition: LArRawChannelMonAlg.h:64
ReadCondHandleKey.h
LArRawChannelMonAlg::m_problemsToMask
Gaudi::Property< std::vector< std::string > > m_problemsToMask
Definition: LArRawChannelMonAlg.h:97
CaloNoise
Definition: CaloNoise.h:16
LArRawChannelMonAlg::m_noise_burst_nChannel_thresholds
Gaudi::Property< std::vector< unsigned > > m_noise_burst_nChannel_thresholds
Definition: LArRawChannelMonAlg.h:90
LArRawChannelMonAlg::m_noise_streams
Gaudi::Property< std::vector< std::string > > m_noise_streams
Definition: LArRawChannelMonAlg.h:92
LArRawChannelMonAlg::m_feb_hash_to_detector
std::vector< int8_t > m_feb_hash_to_detector
Definition: LArRawChannelMonAlg.h:126
LArRawChannelMonAlg::m_noise_burst_percent_thresholds
Gaudi::Property< std::vector< double > > m_noise_burst_percent_thresholds
Definition: LArRawChannelMonAlg.h:88
LArOnlineID
Definition: LArOnlineID.h:20
LArRawChannelMonAlg::LArRawChannelMonAlg
LArRawChannelMonAlg(const std::string &, ISvcLocator *)
Definition: LArRawChannelMonAlg.cxx:60
EventInfo.h
SG::ReadCondHandleKey
Definition: ReadCondHandleKey.h:20
LArRawChannelMonAlg::m_neg_noise_thresholds
Gaudi::Property< std::vector< int > > m_neg_noise_thresholds
Definition: LArRawChannelMonAlg.h:78
LArRawChannelMonAlg::m_monitor_febs
Gaudi::Property< bool > m_monitor_febs
Definition: LArRawChannelMonAlg.h:66
LArRawChannelMonAlg
Definition: LArRawChannelMonAlg.py:1
LArRawChannelMonAlg::m_bcid_signal_threshold
Gaudi::Property< double > m_bcid_signal_threshold
Definition: LArRawChannelMonAlg.h:80
LArRawChannelMonAlg::m_noiseKey
SG::ReadCondHandleKey< CaloNoise > m_noiseKey
Definition: LArRawChannelMonAlg.h:113
ReadDecorHandle.h
Handle class for reading a decoration on an object.
LArRawChannelMonAlg::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: LArRawChannelMonAlg.cxx:155
LArRawChannelMonAlg::m_det_to_nchannels
std::array< uint32_t, 8 > m_det_to_nchannels
Definition: LArRawChannelMonAlg.h:129
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
LArBadChannelMask.h
LArRawChannelMonAlg::m_noise_threshold
Gaudi::Property< short > m_noise_threshold
Definition: LArRawChannelMonAlg.h:86
LArRawChannelMonAlg::m_LArRawChannel_container_key
SG::ReadHandleKey< LArRawChannelContainer > m_LArRawChannel_container_key
Definition: LArRawChannelMonAlg.h:103
LArRawChannelContainer.h
LArRawChannelMonAlg::m_monitor_quality
Gaudi::Property< bool > m_monitor_quality
Definition: LArRawChannelMonAlg.h:62
LArBadChannelMask
Definition: LArBadChannelMask.h:18