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