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
88 typedef std::unordered_map<HWIdentifier, unsigned int> HVlinesStatMap;
89
90 private:
91 ToolHandle<ILArHVMapTool> m_hvMapTool{"LArHVMapTool"};
92
93 const CaloCell_ID* m_calo_id = nullptr;
94 const LArOnlineID* m_onlineID = nullptr;
95 const LArElectrodeID* m_elecID = nullptr;
96 SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this, "CablingKey", "LArOnOffIdMap", "key to read OnOff mapping"};
97
98 Gaudi::Property<unsigned int> m_CellQualityCut{this, "CellQualityCut", 4000, "Qfactor value above which a channel is considered bad"};
99
100 Gaudi::Property<bool> m_ignore_masked_cells{this, "IgnoreMaskedCells", false, "ignore masked cells"};
101
102 Gaudi::Property<bool> m_ignore_front_innerwheel_cells{this, "IgnoreFrontInnerWheelCells", true, "ignore front inner wheel cells ?"};
103
104 Gaudi::Property<unsigned int> m_BadChanPerFEB{this, "BadChanPerFEB", 30, "number of bad channels to declare a FEB noisy"};
105
106 Gaudi::Property<unsigned int> m_MinBadFEB{this, "BadFEBCut", 3, "min number of bad FEB to put LAr warning in event info"};
107
108 Gaudi::Property<unsigned int> m_SaturatedCellQualityCut{this, "SaturatedCellQualityCut", 65535,
109 " Qfactor value above which (>=) a channel is considered with a saturated Qfactor"};
110
111 Gaudi::Property<float> m_SaturatedCellEnergyTightCut{this, "SaturatedCellEnergyTightCut", 1000.,
112 "Count saturated Qfactor cells above this energy cut (absolute value)"};
113
114 Gaudi::Property<unsigned int> m_SaturatedCellTightCut{this, "SaturatedCellTightCut", 20, "min number of saturated Qfactor cells to declare an event bad"};
115
116 Gaudi::Property<bool> m_doHVline{this, "DoHVflag", true, "do HVline flagging"};
117
118 Gaudi::Property<float> m_BadChanFracPerHVline{this, "BadChanFracPerHVline", 0.25, "fraction of bad cells in one HV line"};
119
120 Gaudi::Property<unsigned int> m_MinBadHV{this, "BadHVCut", 3, " min number of bad HV lines"};
121
122 Gaudi::Property<unsigned int> m_MNBLooseCut{this, "MNBLooseCut", 5, "Loose cut on number of cells above CellQualityCut"};
123 Gaudi::Property<unsigned int> m_MNBTightCut{this, "MNBTightCut", 17, "Thight cut on number of cells above CellQualityCut"};
124 Gaudi::Property<std::vector<unsigned int> > m_MNBTight_PsVetoCut{this, "MNBTight_PsVetoCut", {13, 3}};
125
128 // beware: The order matters!
129};
130
131inline size_t LArNoisyROTool::partitionNumber(const HWIdentifier hwid) const {
132 int pn=m_onlineID->pos_neg(hwid);
133
134 if (m_onlineID->isEMECchannel(hwid)) {
135 if (pn)
136 return 0; // positive EMECA side
137 else
138 return 3; // negative EMECC side
139 }
140 if (m_onlineID->isEMBchannel(hwid)) {
141 if (pn)
142 return 1; // positive EMBA side
143 else
144 return 2; // negative EMBC side
145 }
146 return 4;//Anything else
147}
148
149#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_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, unsigned int > 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