ATLAS Offline Software
Loading...
Searching...
No Matches
TileCellSelector.h
Go to the documentation of this file.
1// -*- C++ -*-
2
3/*
4 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef TILERECALGS_TILESELECTOR_H
8#define TILERECALGS_TILESELECTOR_H
9
10// Tile includes
16
17// Calo includes
19
20// Atlas includes
24
25// Gaudi incldues
26#include "GaudiKernel/ToolHandle.h"
27#include "Gaudi/Property.h"
28
29#include <string>
30#include <vector>
31
32class TileID;
33class TileHWID;
34class TileCell;
36class TileInfo;
37
38
40
42 public:
43 TileCellSelector(const std::string& name, ISvcLocator* pSvcLocator);
44 virtual ~TileCellSelector();
45
46 virtual StatusCode initialize() override;
47 virtual StatusCode execute(const EventContext& ctx) override;
48 virtual StatusCode finalize() override;
49
50 private:
51
52 int Are3FF(std::vector<float> & OptFilterDigits, int OptFilterGain, int ch_type);
53 void printCell(const TileCell * cell);
54
55 unsigned int m_counter{0};
56 unsigned int m_accept{0};
57 unsigned int m_minCell{0};
58 unsigned int m_maxCell{0};
59 unsigned int m_minChan{0};
60 unsigned int m_maxChan{0};
61 unsigned int m_jump{0};
62 unsigned int m_const{0};
63 unsigned int m_overLG{0};
64 unsigned int m_overHG{0};
65 unsigned int m_underLG{0};
66 unsigned int m_underHG{0};
67 unsigned int m_dqerr{0};
68 unsigned int m_dmuerr{0};
69 unsigned int m_warnerr{0};
70
71 const TileID* m_tileID{nullptr};
72 const TileHWID* m_tileHWID{nullptr};
74 ToolHandle<ITileBadChanTool> m_tileBadChanTool{this, "TileBadChanTool", "TileBadChanTool", "Tile bad channel tool"};
75 SG::ReadHandleKey<TileDQstatus> m_dqStatusKey{this, "TileDQstatus", "TileDQstatus", "TileDQstatus key"};
76 ToolHandle<ITileDCSTool> m_tileDCS{this, "TileDCSTool", "TileDCSTool", "Tile DCS tool"};
77
78 unsigned int m_runNum{0};
79 unsigned int m_lumiBlock{0};
80 unsigned int m_evtNum{0};
81 unsigned int m_evtBCID{0};
82 // flag will contain status of a given event
83 // every 4 bits - status of partitions LBA,LBC,EBA,EBC
84 // bits 0-3 - there is a signal above threshold in partitions
85 // bits 4-7 - there are channels with underflow (sample=0) in partition (since rel 17.2.6.4)
86 // bits 8-11 - there are channels with overflow (sample=1023) in partition (since rel 17.2.6.4)
87 // bits 12-15 - there are at least 16 drawers with bad quality in partition
88 // bits 16-19 - maximal length of consecutive bad area (since rel 17.2.6.5)
89 // bits 20-23 - there are at least 16 drawers which are completely masked in partition
90 // bits 24-27 - there are at least 16 drawers which do not send data in partition
91 // bits 28-31 - reserved for global good/warning/bad status
92 // bits 20-27 are also used for module number which gives warning status (since release 17.2.6.5)
93 // in case of warning we are sure that bits which indicates error are not filled
94 unsigned int m_tileFlag{0};
95 // global status: 0=OK, 1=warning, 2=error
96 unsigned int m_tileError{0};
97
98 std::vector<bool> m_chanBad;
99 std::vector<float> m_chanEne;
100 std::vector<float> m_chanTime;
101 std::vector<float> m_chanDsp;
102 std::vector<float> m_chanTDsp;
103 std::vector<float> m_chanQua;
104 std::vector<bool> m_chanSel;
105 std::vector<bool> m_chanToSkip;
106 std::vector<bool> m_drawerToSkip;
107
108 bool m_readCells{true};
110 bool m_readDigits{true};
111
113 "AllCalo", "Input Calo cell container key"};
114
116 "TileDigitsFlt", "Input Tile digits container key"};
117
119 "TileRawChannelCnt",
120 "Input Tile raw channel container key"};
121
123 "EventInfo", "Input event info key"};
124
125 Gaudi::Property<float> m_minEneCell{this, "MinEnergyCell", -5000., "Cut on cell energy"};
126 Gaudi::Property<float> m_maxEneCell{this, "MaxEnergyCell", 1000000., "Cut on cell energy"};
127 Gaudi::Property<float> m_minEneChan[3]{{this, "MinEnergyChan", -5000., "Cut on channel energy for normal channels"},
128 {this, "MinEnergyGap", -10000., "Cut on channel energy for gap/crack scintillators"},
129 {this, "MinEnergyMBTS", -10000., "Cut on channel energy for MBTS"}};
130 Gaudi::Property<float> m_maxEneChan[3]{{this, "MaxEnergyChan", 500000., "Cut on channel energy for normal channels"},
131 {this, "MaxEnergyGap", 500000., "Cut on channel energy for gap/crack scintillators"},
132 {this, "MaxEnergyMBTS", 500000., "Cut on channel energy for MBTS"}};
133 Gaudi::Property<float> m_minTimeCell{this, "MinTimeCell", -100., "Cut on cell time"};
134 Gaudi::Property<float> m_maxTimeCell{this, "MaxTimeCell", 100., "Cut on cell time"};
135 Gaudi::Property<float> m_minTimeChan[3]{{this, "MinTimeChan", -100., "Cut on channel time for normal channels"},
136 {this, "MinTimeGap", -100., "Cut on channel time for gap/crack scintillators"},
137 {this, "MinTimeMBTS", -100., "Cut on channel time for MBTS"}};
138 Gaudi::Property<float> m_maxTimeChan[3]{{this, "MaxTimeChan", 100., "Cut on channel time for normal channels"},
139 {this, "MaxTimeGap", 100., "Cut on channel time for gap/crack scintillators"},
140 {this, "MaxTimeMBTS", 100., "Cut on channel time for MBTS"}};
141 // pattern - decimal number with up to 5 digits
142 // only values 1(=true) and 0(=false) for every digit are used
143 // digit 0 set to 1 - accept event if value < min
144 // digit 1 set to 1 - accept event if min < value < max
145 // digit 2 set to 1 - accept event if value > max
146 // digit 3 set to 1 - accept ene only if quality is good
147 // or accept time if time != 0
148 // digit 4 set to 1 - accept ene only if quality is bad
149 // or accept time if time == 0
150 Gaudi::Property<int> m_ptnEneCell{this, "PtnEnergyCell", 101, "Cell energy pattern, accept events only below min (+1), between min-max (+10), above max (+100)"};
151 Gaudi::Property<int> m_ptnEneChan[3]{{this, "PtnEnergyChan", 101, "Channel energy pattern for normal channels"},
152 {this, "PtnEnergyGap", 101, "Channel energy pattern for gap/crack scintillators"},
153 {this, "PtnEnergyMBTS", 101, "Channel energy pattern for MBTS"}};
154 Gaudi::Property<int> m_ptnTimeCell{this, "PtnTimeCell", 10, "Cell time pattern, accept events only below min (+1), between min-max (+10), above max (+100)"};
155 Gaudi::Property<int> m_ptnTimeChan[3]{{this, "PtnTimeChan", 10, "Channel time pattern for normal channels"},
156 {this, "PtnTimeGap", 10, "Channel time pattern for gap/crack scintillators"},
157 {this, "PtnTimeMBTS", 10, "Channel time pattern for MBTS"}};
158 Gaudi::Property<int> m_selectGain{this, "SelectGain", 2, "0 - select LG only, 1 - HG only, 2 - both gains"};
159 bool m_skipGain[2]{};
160#define ptnlength 5
165 Gaudi::Property<float> m_secondMaxLevel{this, "SecondMaxLevel", 0.3, "Sample below max should be above (max-min)*SecondMaxLevel"};
166 Gaudi::Property<float> m_jumpDeltaHG{this, "JumpDeltaHG", 50.0, "Minimal jump in high gain"};
167 Gaudi::Property<float> m_jumpDeltaLG{this, "JumpDeltaLG", 10.0, "Minimal jump in low gain"};
168 Gaudi::Property<float> m_pedDeltaHG{this, "PedDetlaHG", 4.1, "Max variation of \"const\" value in high gain"};
169 Gaudi::Property<float> m_pedDeltaLG{this, "PedDetlaLG", 4.1, "Max variation of \"const\" value in low gain"};
170 Gaudi::Property<int> m_constLength{this, "ConstLength", 6, "Min number of consecutive samples of the same value"};
171 Gaudi::Property<int> m_minBadDMU{this, "MinBadDMU", 4, "Min number of bad DMUs to accept event"};
172 Gaudi::Property<int> m_maxBadDMU{this, "MaxBadDMU", 15, "Max number of bad DMUs to accept event"};
173 Gaudi::Property<int> m_minBadMB{this, "MinBadMB", 4, "Min number of bad motherboards in a drawer to accept event"};
174 Gaudi::Property<bool> m_skipEmpty{this, "SkipEmpty", true, "Ignore empty channels in selection or not"};
175 Gaudi::Property<bool> m_skipMasked{this, "SkipMasked", true, "Ignore masked channels in selection or not"};
176 Gaudi::Property<bool> m_skipMBTS{this, "SkipMBTS", true, "Ignore MBTS channels in selection or not"};
177 Gaudi::Property<bool> m_checkDCS{this, "CheckDCS", true, "Additional check for DCS status"};
178 Gaudi::Property<bool> m_checkJumps{this, "CheckJumps", true, "Global flag which allows to switch on/off all checks in digits"};
179 Gaudi::Property<bool> m_checkDMUs{this, "CheckDMUs", true, "Global flag which allows to switch on/off DMU checks"};
180 Gaudi::Property<bool> m_checkOverLG{this, "CheckOverLG", true, "Select events with overflow in low gain"};
181 Gaudi::Property<bool> m_checkOverHG{this, "CheckOverHG", false, "Select events with overflow in high gain"};
182 Gaudi::Property<bool> m_checkUnderLG{this, "CheckUnderLG", false, "Select events with underflow in low gain"};
183 Gaudi::Property<bool> m_checkUnderHG{this, "CheckUnderHG", false, "Select events with underflow in high gain"};
184 Gaudi::Property<float> m_overflowLG{this, "OverflowLG", -0.1, "Threshold for overflow in low gain (smaller than ADCmax by this value)"};
185 Gaudi::Property<float> m_overflowHG{this, "OverflowHG", -1.1, "Threshold for overflow in high gain (smaller than ADCmax by this value)"};
186 Gaudi::Property<float> m_underflowLG{this, "UnderflowLG", 0.1, "Threshold for underflow in low gain"};
187 Gaudi::Property<float> m_underflowHG{this, "UnderflowHG", 2.1, "Threshold for underflow in high gain"};
188 Gaudi::Property<bool> m_checkWarning{this, "CheckWarning", false, "Select events with warning status in TileCal status word"};
189 Gaudi::Property<bool> m_checkError{this, "CheckError", false, "Select events with error status in TileCal status word"};
190 Gaudi::Property<bool> m_printOnly{this, "PrintOnly", false, "Only print accepted events, but do not accept anything"};
191
192 Gaudi::Property<std::vector<int>> m_drawer{this, "DrawerToDump", {}, "Drawers for which all channels should be printed"};
193 Gaudi::Property<std::vector<int>> m_drawerToCheck{this, "DrawerToCheck", {}, "Drawers for which all checks should be performed"};
194 Gaudi::Property<std::vector<int>> m_chanToCheck{this, "ChannelToCheck", {}, "Channels for which all checks should be performed"};
195
196 Gaudi::Property<int> m_maxVerboseCnt{this, "MaxVerboseCnt", 20, "Max number of verbose output lines about drawer off"};
197 std::vector<int> m_nDrawerOff;
198
199 Gaudi::Property<std::string> m_infoName{this, "TileInfoName", "TileInfo", "Name of TileInfo object in DetectorStore"};
200 const TileInfo* m_tileInfo{nullptr};
201 float m_ADCmaxMinusEps = 0.0F;
203};
204
205#endif // TILERECALGS_TILESELECTOR_H
Property holding a SG store/key/clid from which a ReadHandle is made.
#define ptnlength
Information produced by TileDQstatusAlg (used to be done by TileBeamInfoProvider).
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Property holding a SG store/key/clid from which a ReadHandle is made.
Gaudi::Property< bool > m_checkOverHG
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Gaudi::Property< int > m_ptnEneChan[3]
std::vector< float > m_chanEne
bool m_bitTimeCell[ptnlength]
const TileCablingService * m_cabling
Gaudi::Property< float > m_minTimeCell
unsigned int m_minCell
int Are3FF(std::vector< float > &OptFilterDigits, int OptFilterGain, int ch_type)
std::vector< float > m_chanDsp
Gaudi::Property< std::vector< int > > m_drawer
bool m_bitEneChan[3][ptnlength]
Gaudi::Property< int > m_ptnTimeCell
ToolHandle< ITileBadChanTool > m_tileBadChanTool
Gaudi::Property< float > m_maxEneCell
unsigned int m_jump
unsigned int m_runNum
unsigned int m_lumiBlock
SG::ReadHandleKey< TileDQstatus > m_dqStatusKey
std::vector< bool > m_chanSel
unsigned int m_evtBCID
unsigned int m_evtNum
Gaudi::Property< float > m_underflowLG
TileCellSelector(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< float > m_underflowHG
Gaudi::Property< bool > m_checkUnderHG
Gaudi::Property< bool > m_checkOverLG
std::vector< bool > m_chanToSkip
Gaudi::Property< float > m_maxTimeChan[3]
Gaudi::Property< float > m_pedDeltaLG
unsigned int m_warnerr
ToolHandle< ITileDCSTool > m_tileDCS
unsigned int m_const
Gaudi::Property< float > m_overflowLG
void printCell(const TileCell *cell)
Gaudi::Property< float > m_jumpDeltaLG
unsigned int m_underLG
virtual StatusCode initialize() override
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
Gaudi::Property< int > m_selectGain
Gaudi::Property< int > m_maxBadDMU
unsigned int m_dmuerr
Gaudi::Property< bool > m_skipEmpty
Gaudi::Property< int > m_minBadMB
Gaudi::Property< float > m_minEneChan[3]
std::vector< bool > m_chanBad
bool m_bitTimeChan[3][ptnlength]
unsigned int m_underHG
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
SG::ReadHandleKey< CaloCellContainer > m_cellContainerKey
Gaudi::Property< bool > m_printOnly
unsigned int m_counter
Gaudi::Property< bool > m_checkUnderLG
Gaudi::Property< bool > m_checkDMUs
Gaudi::Property< float > m_minEneCell
Gaudi::Property< bool > m_skipMasked
unsigned int m_maxCell
Gaudi::Property< int > m_maxVerboseCnt
Gaudi::Property< bool > m_checkJumps
unsigned int m_tileFlag
unsigned int m_accept
Gaudi::Property< std::vector< int > > m_chanToCheck
Gaudi::Property< float > m_maxTimeCell
Gaudi::Property< bool > m_checkError
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
unsigned int m_overLG
Gaudi::Property< std::vector< int > > m_drawerToCheck
virtual StatusCode finalize() override
const TileHWID * m_tileHWID
Gaudi::Property< float > m_maxEneChan[3]
Gaudi::Property< std::string > m_infoName
std::vector< int > m_nDrawerOff
Gaudi::Property< int > m_minBadDMU
Gaudi::Property< bool > m_checkWarning
std::vector< float > m_chanTime
unsigned int m_maxChan
Gaudi::Property< int > m_ptnTimeChan[3]
unsigned int m_minChan
Gaudi::Property< float > m_jumpDeltaHG
std::vector< bool > m_drawerToSkip
const TileInfo * m_tileInfo
Gaudi::Property< float > m_overflowHG
unsigned int m_overHG
const TileID * m_tileID
Gaudi::Property< int > m_ptnEneCell
std::vector< float > m_chanTDsp
std::vector< float > m_chanQua
Gaudi::Property< float > m_minTimeChan[3]
Gaudi::Property< float > m_pedDeltaHG
unsigned int m_tileError
Gaudi::Property< int > m_constLength
Gaudi::Property< float > m_secondMaxLevel
Gaudi::Property< bool > m_skipMBTS
unsigned int m_dqerr
bool m_bitEneCell[ptnlength]
Gaudi::Property< bool > m_checkDCS
Helper class for TileCal online (hardware) identifiers.
Definition TileHWID.h:49
Helper class for TileCal offline identifiers.
Definition TileID.h:67