ATLAS Offline Software
Loading...
Searching...
No Matches
LArNoisyROTool.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5*/
6
7// LArNoisyROTool.h
8// Header file for class LArNoisyROTool
9// Author: S.Binet<binet@cern.ch>
11#ifndef LARCELLREC_LARNOISYROTOOL_H
12#define LARCELLREC_LARNOISYROTOOL_H 1
13
14
15// FrameWork includes
19
25
26// STL includes
27#include <string>
28#include <set>
29#include <array>
30#include <unordered_map>
31#include <memory>
32
33class LArOnlineID;
34class CaloCell_ID;
37class LArElectrodeID;
38class LArHVNMap;
39
40class LArNoisyROTool : public extends<AthAlgTool, ILArNoisyROTool> {
41 public:
42 // delegate constructor
43 using base_class::base_class;
44
46 virtual ~LArNoisyROTool() = default;
47
48 // Athena algtool's Hooks
49 virtual StatusCode initialize();
50
51 virtual std::unique_ptr<LArNoisyROSummary> process(const EventContext&, const CaloCellContainer*, const std::set<unsigned int>*,
52 const std::vector<HWIdentifier>*, const LArHVNMap*, const CaloDetDescrManager*,
53 const LArHVIdMapping*) const;
54
55 private: // classes
56 // this class accumulates the number of bad channel in a FEB, per preamp in a FEB
58 public:
59 FEBEvtStat() = default;
60
61 void addBadChannel(unsigned int channel){
63 unsigned int preamp = channel / 4;
64 m_PAcounters[preamp]++;
65 }
66
68 m_chanCounter = 0;
69 for (size_t i = 0; i < 32; i++)
70 m_PAcounters[i] = 0;
71 }
72
73 unsigned int badChannels() const { return m_chanCounter; }
74 const unsigned int* PAcounters() const { return &m_PAcounters[0]; }
75
76
77 private:
78 unsigned int m_chanCounter{};
79 unsigned int m_PAcounters[32]{};
80 };
81
82 size_t partitionNumber(const HWIdentifier) const;
83
84 typedef std::unordered_map<unsigned int, FEBEvtStat> FEBEvtStatMap;
85
86 std::unordered_map<unsigned int, unsigned int> m_mapPSFEB;
87
89 uint32_t noisy;
90 uint32_t sharedNoisy; // each cell is counted with a multiplicity equal to the number of HV lines it is fed by
91 };
92 typedef std::unordered_map<HWIdentifier, HVlinesStatMapValue> HVlinesStatMap;
93
94 private:
95 ToolHandle<ILArHVMapTool> m_hvMapTool{"LArHVMapTool"};
96
97 const CaloCell_ID* m_calo_id = nullptr;
98 const LArOnlineID* m_onlineID = nullptr;
99 const LArElectrodeID* m_elecID = nullptr;
100 SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this, "CablingKey", "LArOnOffIdMap", "key to read OnOff mapping"};
101
102 Gaudi::Property<unsigned int> m_CellQualityCut{this, "CellQualityCut", 4000, "Qfactor value above which a channel is considered bad"};
103
104 Gaudi::Property<bool> m_ignore_masked_cells{this, "IgnoreMaskedCells", false, "ignore masked cells"};
105
106 Gaudi::Property<bool> m_ignore_front_innerwheel_cells{this, "IgnoreFrontInnerWheelCells", true, "ignore front inner wheel cells ?"};
107
108 Gaudi::Property<unsigned int> m_BadChanPerFEB{this, "BadChanPerFEB", 30, "number of bad channels to declare a FEB noisy"};
109
110 Gaudi::Property<unsigned int> m_MinBadFEB{this, "BadFEBCut", 3, "min number of bad FEB to put LAr warning in event info"};
111
112 Gaudi::Property<unsigned int> m_SaturatedCellQualityCut{this, "SaturatedCellQualityCut", 65535,
113 " Qfactor value above which (>=) a channel is considered with a saturated Qfactor"};
114
115 Gaudi::Property<float> m_SaturatedCellEnergyTightCut{this, "SaturatedCellEnergyTightCut", 1000.,
116 "Count saturated Qfactor cells above this energy cut (absolute value)"};
117
118 Gaudi::Property<unsigned int> m_SaturatedCellTightCut{this, "SaturatedCellTightCut", 20, "min number of saturated Qfactor cells to declare an event bad"};
119
120 Gaudi::Property<bool> m_doHVline{this, "DoHVflag", true, "do HVline flagging"};
121
122 Gaudi::Property<float> m_BadChanFracPerHVline{this, "BadChanFracPerHVline", 0.25, "min fraction of bad cells in one HV line"};
123 Gaudi::Property<unsigned int> m_MinBadHV{this, "BadHVCut", 3, " min number of bad HV lines"};
124 Gaudi::Property<unsigned int> m_connChanPerHVline{this, "ConnectedChanPerHVline", 10, "min number of cells connected to HV line for it to be used for HV flag"};
125
126 Gaudi::Property<unsigned int> m_MNBLooseCut{this, "MNBLooseCut", 5, "Loose cut on number of cells above CellQualityCut"};
127 Gaudi::Property<unsigned int> m_MNBTightCut{this, "MNBTightCut", 17, "Thight cut on number of cells above CellQualityCut"};
128 Gaudi::Property<std::vector<unsigned int> > m_MNBTight_PsVetoCut{this, "MNBTight_PsVetoCut", {13, 3}};
129
132 // beware: The order matters!
133};
134
135inline size_t LArNoisyROTool::partitionNumber(const HWIdentifier hwid) const {
136 int pn=m_onlineID->pos_neg(hwid);
137
138 if (m_onlineID->isEMECchannel(hwid)) {
139 if (pn)
140 return 0; // positive EMECA side
141 else
142 return 3; // negative EMECC side
143 }
144 if (m_onlineID->isEMBchannel(hwid)) {
145 if (pn)
146 return 1; // positive EMBA side
147 else
148 return 2; // negative EMBC side
149 }
150 return 4;//Anything else
151}
152
153#endif //> !LARCELLREC_LARNOISYROTOOL_H
Container class for CaloCell.
Helper class for offline cell identifiers.
Definition CaloCell_ID.h:34
This class provides the client interface for accessing the detector description information common to...
Helper for the Liquid Argon Calorimeter cell at the electrode level.
const unsigned int * PAcounters() const
void addBadChannel(unsigned int channel)
unsigned int m_PAcounters[32]
unsigned int badChannels() const
Gaudi::Property< unsigned int > m_MNBLooseCut
Gaudi::Property< unsigned int > m_connChanPerHVline
Gaudi::Property< unsigned int > m_SaturatedCellTightCut
virtual StatusCode initialize()
Gaudi::Property< std::vector< unsigned int > > m_MNBTight_PsVetoCut
Gaudi::Property< float > m_SaturatedCellEnergyTightCut
size_t partitionNumber(const HWIdentifier) const
Gaudi::Property< bool > m_ignore_front_innerwheel_cells
ToolHandle< ILArHVMapTool > m_hvMapTool
const LArElectrodeID * m_elecID
const LArOnlineID * m_onlineID
std::unordered_map< unsigned int, FEBEvtStat > FEBEvtStatMap
Gaudi::Property< bool > m_doHVline
std::unordered_map< HWIdentifier, HVlinesStatMapValue > HVlinesStatMap
std::array< uint8_t, 4 > m_partitionMask
const CaloCell_ID * m_calo_id
Gaudi::Property< unsigned int > m_BadChanPerFEB
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
std::unordered_map< unsigned int, unsigned int > m_mapPSFEB
Gaudi::Property< bool > m_ignore_masked_cells
Gaudi::Property< unsigned int > m_MinBadFEB
Gaudi::Property< unsigned int > m_MNBTightCut
Gaudi::Property< float > m_BadChanFracPerHVline
virtual ~LArNoisyROTool()=default
Destructor:
Gaudi::Property< unsigned int > m_CellQualityCut
Gaudi::Property< unsigned int > m_SaturatedCellQualityCut
Gaudi::Property< unsigned int > m_MinBadHV
const std::string process