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 
8 #include <array>
9 #include <set>
10 #include <string>
11 #include <vector>
12 
15 #include "GaudiKernel/ToolHandle.h"
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{this, "monitor_occupancy", false, ""};
53  Gaudi::Property<bool> m_monitor_signal{this, "monitor_signal", true, ""};
54  Gaudi::Property<bool> m_monitor_positive_noise{this, "monitor_positive_noise", true, ""};
55  Gaudi::Property<bool> m_monitor_negative_noise{this, "monitor_negative_noise", true, ""};
56  Gaudi::Property<bool> m_monitor_time{this, "monitor_time", true, ""};
57  Gaudi::Property<bool> m_monitor_quality{this, "monitor_quality", false, ""};
58  Gaudi::Property<bool> m_monitor_burst{this, "monitor_burst", true, ""};
59  Gaudi::Property<bool> m_monitor_febs{this, "monitor_febs", false, ""};
60  Gaudi::Property<bool> m_monitor_feedthroughs{this, "monitor_feedthroughs", false, ""};
61  Gaudi::Property<bool> m_monitor_detectors{this, "monitor_detectors", true, ""};
62  Gaudi::Property<std::vector<double>> m_occupancy_thresholds{this, "occupancy_thresholds", {8, 500. * Gaudi::Units::MeV}, ""};
63  Gaudi::Property<std::vector<double>> m_signal_thresholds{this, "signal_thresholds", {8, 500. * Gaudi::Units::MeV}, ""};
64  Gaudi::Property<std::vector<int>> m_pos_noise_thresholds{this, "pos_noise_thresholds", {8, 3}, ""};
65  Gaudi::Property<std::vector<int>> m_neg_noise_thresholds{this, "neg_noise_thresholds", {8, 3}, ""};
66  Gaudi::Property<double> m_bcid_signal_threshold{this, "bcid_signal_threshold", 500. * Gaudi::Units::MeV, ""};
67  Gaudi::Property<short> m_time_threshold{this, "time_threshold", 5, ""};
68  Gaudi::Property<unsigned short> m_quality_threshold{this, "quality_threshold", 4000, ""};
69  Gaudi::Property<short> m_noise_threshold{this, "noise_threshold", 3, ""};
70  Gaudi::Property<std::vector<double>> m_noise_burst_percent_thresholds{this, "noise_burst_percent_threshold", {8, 1.}, ""};
71  Gaudi::Property<std::vector<unsigned>> m_noise_burst_nChannel_thresholds{this, "noise_burst_nChannel_threshold", {8, 10}, ""};
72  Gaudi::Property<std::vector<std::string>> m_noise_streams{this, "noise_streams", {}, ""};
73  Gaudi::Property<bool> m_db_and_ofc_only{this, "db_and_ofc_only", true,
74  "use channels "
75  "only if pedestal and adc2e value from DB and OFC was used"};
76  Gaudi::Property<std::vector<std::string>> m_problemsToMask{this, "ProblemsToMask", {}, "Bad-Channel categories to mask"};
77  ToolHandleArray<IDQFilterTool> m_atlasReady_tools{this, "AtlasReadyFilterTool", {}};
78 
79  // --- ReadHandle keys ---
80  SG::ReadHandleKey<LArRawChannelContainer> m_LArRawChannel_container_key{this, "LArRawChannelContainerKey", "LArRawChannels"};
81 
82  // --- tools ---
84 
85  // Handle to bad-channel mask
87  SG::ReadCondHandleKey<LArBadChannelCont> m_bcContKey{this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"};
88  SG::ReadCondHandleKey<CaloNoise> m_noiseKey{this, "NoiseKey", "totalNoise", "SG key for noise"};
89  SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this, "CablingKey", "LArOnOffIdMap", "SG Key of LArOnOffIdMapping object"};
90  // To get the data-dependency right ...
91  SG::ReadDecorHandleKey<xAOD::EventInfo> m_larFlagKey{this, "LArStatusFlag", "EventInfo.larFlags", "Key for EventInfo object"};
92 
93  // Index of the GenericMonitoringTool associated to a given partition
94  // in the vector AthMonitorAlgorithm::m_tools
95  std::array<int, 8> m_monitoring_tool_index;
96 
97  // Dictionary FEB hash <-> partition
98  std::vector<int8_t> m_feb_hash_to_detector;
99 
100  // Number of LArRawChannels connected in each detector
101  std::array<uint32_t, 8> m_det_to_nchannels;
102 
103  // Same as m_noise_streams but retaining only unique streams
104  std::set<std::string> m_noise_streams_set;
105 };
106 
107 #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:73
LArRawChannelMonAlg::m_larFlagKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_larFlagKey
Definition: LArRawChannelMonAlg.h:91
LArRawChannelMonAlg::m_occupancy_thresholds
Gaudi::Property< std::vector< double > > m_occupancy_thresholds
Definition: LArRawChannelMonAlg.h:62
LArRawChannelMonAlg::m_bcMask
LArBadChannelMask m_bcMask
Definition: LArRawChannelMonAlg.h:86
LArRawChannelMonAlg::m_atlasReady_tools
ToolHandleArray< IDQFilterTool > m_atlasReady_tools
Definition: LArRawChannelMonAlg.h:77
LArRawChannelMonAlg::m_pos_noise_thresholds
Gaudi::Property< std::vector< int > > m_pos_noise_thresholds
Definition: LArRawChannelMonAlg.h:64
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
LArRawChannelMonAlg::m_monitor_time
Gaudi::Property< bool > m_monitor_time
Definition: LArRawChannelMonAlg.h:56
LArRawChannelMonAlg::m_signal_thresholds
Gaudi::Property< std::vector< double > > m_signal_thresholds
Definition: LArRawChannelMonAlg.h:63
SG::ReadHandleKey< LArRawChannelContainer >
LArRawChannelMonAlg::m_bcContKey
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
Definition: LArRawChannelMonAlg.h:87
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:83
LArOnOffIdMapping.h
LArRawChannelMonAlg::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: LArRawChannelMonAlg.h:89
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:61
LArRawChannelMonAlg::m_time_threshold
Gaudi::Property< short > m_time_threshold
Definition: LArRawChannelMonAlg.h:67
DQAtlasReadyFilterTool.h
LArRawChannelMonAlg::m_monitor_feedthroughs
Gaudi::Property< bool > m_monitor_feedthroughs
Definition: LArRawChannelMonAlg.h:60
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:95
LArRawChannelMonAlg::m_monitor_positive_noise
Gaudi::Property< bool > m_monitor_positive_noise
Definition: LArRawChannelMonAlg.h:54
LArRawChannelMonAlg::m_noise_streams_set
std::set< std::string > m_noise_streams_set
Definition: LArRawChannelMonAlg.h:104
LArRawChannelMonAlg::m_quality_threshold
Gaudi::Property< unsigned short > m_quality_threshold
Definition: LArRawChannelMonAlg.h:68
LArRawChannelMonAlg::m_monitor_signal
Gaudi::Property< bool > m_monitor_signal
Definition: LArRawChannelMonAlg.h:53
LArRawChannelMonAlg::m_monitor_negative_noise
Gaudi::Property< bool > m_monitor_negative_noise
Definition: LArRawChannelMonAlg.h:55
LArRawChannelMonAlg::m_monitor_burst
Gaudi::Property< bool > m_monitor_burst
Definition: LArRawChannelMonAlg.h:58
ReadCondHandleKey.h
LArRawChannelMonAlg::m_problemsToMask
Gaudi::Property< std::vector< std::string > > m_problemsToMask
Definition: LArRawChannelMonAlg.h:76
CaloNoise
Definition: CaloNoise.h:16
LArRawChannelMonAlg::m_noise_burst_nChannel_thresholds
Gaudi::Property< std::vector< unsigned > > m_noise_burst_nChannel_thresholds
Definition: LArRawChannelMonAlg.h:71
LArRawChannelMonAlg::m_noise_streams
Gaudi::Property< std::vector< std::string > > m_noise_streams
Definition: LArRawChannelMonAlg.h:72
LArRawChannelMonAlg::m_feb_hash_to_detector
std::vector< int8_t > m_feb_hash_to_detector
Definition: LArRawChannelMonAlg.h:98
LArRawChannelMonAlg::m_noise_burst_percent_thresholds
Gaudi::Property< std::vector< double > > m_noise_burst_percent_thresholds
Definition: LArRawChannelMonAlg.h:70
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:65
LArRawChannelMonAlg::m_monitor_febs
Gaudi::Property< bool > m_monitor_febs
Definition: LArRawChannelMonAlg.h:59
LArRawChannelMonAlg
Definition: LArRawChannelMonAlg.py:1
LArRawChannelMonAlg::m_bcid_signal_threshold
Gaudi::Property< double > m_bcid_signal_threshold
Definition: LArRawChannelMonAlg.h:66
LArRawChannelMonAlg::m_noiseKey
SG::ReadCondHandleKey< CaloNoise > m_noiseKey
Definition: LArRawChannelMonAlg.h:88
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:101
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:69
LArRawChannelMonAlg::m_LArRawChannel_container_key
SG::ReadHandleKey< LArRawChannelContainer > m_LArRawChannel_container_key
Definition: LArRawChannelMonAlg.h:80
LArRawChannelContainer.h
LArRawChannelMonAlg::m_monitor_quality
Gaudi::Property< bool > m_monitor_quality
Definition: LArRawChannelMonAlg.h:57
LArBadChannelMask
Definition: LArBadChannelMask.h:18