ATLAS Offline Software
Loading...
Searching...
No Matches
TileTimeBCOffsetFilter Class Reference

This tool sets bad status for channels with 25ns or 50ns timing jump. More...

#include <TileTimeBCOffsetFilter.h>

Inheritance diagram for TileTimeBCOffsetFilter:
Collaboration diagram for TileTimeBCOffsetFilter:

Public Member Functions

 TileTimeBCOffsetFilter (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~TileTimeBCOffsetFilter ()
virtual StatusCode initialize () override
virtual StatusCode finalize () override
virtual StatusCode process (TileMutableRawChannelContainer &rchCont, const EventContext &ctx) const override

Private Member Functions

int find_partner (int ros, int channel) const
bool drawer_ok (int ros, int drawer, const TileBadChannels *badChannels, std::vector< int > &channel_time_ok, std::vector< int > &bad_dmu) const
bool ch_masked_or_empty (int ros, int drawer, int channel, int gain, const TileBchStatus &chStatus, const TileDQstatus *DQstatus, const TileDCSState *dcsState) const
float ref_digits_maxmindiff (int ros, int drawer, int ref_channel) const

Private Attributes

const TileHWIDm_tileHWID
 Pointer to TileHWID.
const TileCablingServicem_cabling
 TileCabling instance.
ServiceHandle< TileCablingSvcm_cablingSvc
SG::ReadCondHandleKey< TileDCSStatem_DCSStateKey
 Name of TileDCSState object in condition store.
SG::ReadCondHandleKey< TileEMScalem_emScaleKey
 Name of TileEMScale in condition store.
SG::ReadCondHandleKey< TileBadChannelsm_badChannelsKey
 Name of TileBadChannels in condition store.
SG::ReadHandleKey< TileDigitsContainerm_digitsContainerKey
SG::ReadHandleKey< TileDQstatusm_DQstatusKey
float m_ene_threshold_3chan
float m_ene_threshold_1chan
float m_time_threshold_diff
float m_time_threshold_ref_ch
float m_ene_threshold_aver_time
float m_sample_diffmaxmin_threshold_hg
float m_sample_diffmaxmin_threshold_lg
bool m_checkDCS

Detailed Description

This tool sets bad status for channels with 25ns or 50ns timing jump.

Definition at line 54 of file TileTimeBCOffsetFilter.h.

Constructor & Destructor Documentation

◆ TileTimeBCOffsetFilter()

TileTimeBCOffsetFilter::TileTimeBCOffsetFilter ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 38 of file TileTimeBCOffsetFilter.cxx.

40 : base_class(type, name, parent)
41 , m_tileHWID(nullptr)
42 , m_cabling(nullptr)
43{
44 declareProperty("EneThreshold3", m_ene_threshold_3chan = 1000);
45 declareProperty("EneThreshold1", m_ene_threshold_1chan = 3000);
46 declareProperty("TimeThreshold", m_time_threshold_diff = 15);
47 declareProperty("AverTimeEneThreshold", m_ene_threshold_aver_time = 500);
48 declareProperty("RefTimeThreshold", m_time_threshold_ref_ch = 10);
49 declareProperty("SampleDiffMaxMin_HG", m_sample_diffmaxmin_threshold_hg = 15);
50 declareProperty("SampleDiffMaxMin_LG", m_sample_diffmaxmin_threshold_lg = -1);
51
52 declareProperty("CheckDCS", m_checkDCS = false);
53}
const TileHWID * m_tileHWID
Pointer to TileHWID.
const TileCablingService * m_cabling
TileCabling instance.

◆ ~TileTimeBCOffsetFilter()

virtual TileTimeBCOffsetFilter::~TileTimeBCOffsetFilter ( )
inlinevirtual

Definition at line 61 of file TileTimeBCOffsetFilter.h.

61{};

Member Function Documentation

◆ ch_masked_or_empty()

bool TileTimeBCOffsetFilter::ch_masked_or_empty ( int ros,
int drawer,
int channel,
int gain,
const TileBchStatus & chStatus,
const TileDQstatus * DQstatus,
const TileDCSState * dcsState ) const
private

Definition at line 381 of file TileTimeBCOffsetFilter.cxx.

384 {
385 // check if channel is connected
386 int index, pmt;
387 m_cabling->h2s_cell_id_index(ros, drawer, channel, index, pmt);
388 if (index < 0) return true; // disconnected or MBTS
389
390 // DB status
391 if (chStatus.isBad()) return true;
392
393 // check DQstatus or DCS now
394 bool bad = !(DQstatus->isAdcDQgood(ros, drawer, channel, gain))
395 || (dcsState ? dcsState->isStatusBad(ros, drawer, channel) : false);
396 return bad;
397}
bool isBad() const
bool isStatusBad(unsigned int ros, unsigned int drawer) const
Return true if given Tile drawer considered as bad by summary drawer states per LVPS otherwise return...
bool isAdcDQgood(int partition, int drawer, int ch, int gain) const
returns status of single ADC returns False if there are any errors
str index
Definition DeMoScan.py:362

◆ drawer_ok()

bool TileTimeBCOffsetFilter::drawer_ok ( int ros,
int drawer,
const TileBadChannels * badChannels,
std::vector< int > & channel_time_ok,
std::vector< int > & bad_dmu ) const
private

Definition at line 350 of file TileTimeBCOffsetFilter.cxx.

353 {
354 /* checks whether the whole drawer is ok, i.e. none of its channel
355 is potentially suffering from the +/-25 ns (or +/-50 ns) time shifts
356 and fill vectors with status for every channel at the same time
357 */
358 bool status = true;
359 int last_dmu = -1;
360 const int nchan_dmu = 3; // number of channels in a single DMU
361 for (unsigned int ch=0; ch<TileCalibUtils::MAX_CHAN; ++ch) {
362 HWIdentifier adc_id = m_tileHWID->adc_id(ros, drawer, ch, 0);
363 TileBchStatus chStatus = badChannels->getAdcStatus(adc_id);
364 if (chStatus.isTimingDmuBcOffset()) { // channel timing is not stable
365 int dmu = ch/nchan_dmu;
366 if (dmu!=last_dmu) {
367 bad_dmu.push_back(dmu);
368 last_dmu=dmu;
369 }
370 if (chStatus.isTimingDmuBcOffsetNeg()) {
371 channel_time_ok[ch] = -1;
372 } else {
373 channel_time_ok[ch] = +1;
374 }
375 status = false;
376 }
377 }
378 return status;
379}
const TileBchStatus & getAdcStatus(const HWIdentifier adc_id) const
Return Tile ADC status.
bool isTimingDmuBcOffset() const
bool isTimingDmuBcOffsetNeg() const
static const unsigned int MAX_CHAN
Number of channels in drawer.
status
Definition merge.py:16

◆ finalize()

StatusCode TileTimeBCOffsetFilter::finalize ( )
overridevirtual

Definition at line 95 of file TileTimeBCOffsetFilter.cxx.

95 {
96 return StatusCode::SUCCESS;
97}

◆ find_partner()

int TileTimeBCOffsetFilter::find_partner ( int ros,
int channel ) const
private

Definition at line 399 of file TileTimeBCOffsetFilter.cxx.

399 {
400 /* returns the "partner" channel, i.e. the channel reading the same cell
401 as channel "ch" */
402 int lbcells[48] = {
403 -1, 4, 3, 2, 1, 8, 7, 6, 5,
404 10, 9, 12, 11, 14, 13, 18, 17, 16, 15,
405 20, 19, 22, 21, 26, 25, 24, 23,
406 28, 27, 32, -1, -1, 29,
407 34, 33, 38, 37, 36, 35,
408 40, 39, 44, 47, -1, 41, 46, 45, 42
409 };
410 int ebcells[48] = {
411 -1, -1, 3, 2, 5, 4,
412 7, 6, 9, 8, 11, 10,
413 -1, -1, 15, 14, 17, 16,
414 -1, -1, 21, 20, 23, 22,
415 -1, -1, -1, -1, -1, -1,
416 35, 32, 31, -1, -1, 30,
417 39, 38, 37, 36, 41, 40,
418 -1, -1, -1, -1, -1, -1
419 };
420 if (ros < 3) // LB
421 return lbcells[ch];
422 else // EB
423 return ebcells[ch];
424}

◆ initialize()

StatusCode TileTimeBCOffsetFilter::initialize ( )
overridevirtual

Definition at line 55 of file TileTimeBCOffsetFilter.cxx.

55 {
56 ATH_MSG_INFO( "TileTimeBCOffsetFilter::initialize()" );
57
58 if (msgLvl(MSG::DEBUG)) {
59 msg(MSG::DEBUG) << "EneThreshold3 = "
61 msg(MSG::DEBUG) << "EneThreshold1 = "
63 msg(MSG::DEBUG) << "TimeThreshold = "
65 msg(MSG::DEBUG) << "AverTimeEneThreshold = "
67 msg(MSG::DEBUG) << "RefTimeThreshold = "
69 msg(MSG::DEBUG) << "SampleDiffMaxMin_HG = "
71 msg(MSG::DEBUG) << "SampleDiffMaxMin_LG = "
73 msg(MSG::DEBUG) << "CheckDCS = "
74 << ((m_checkDCS)?"true":"false") << endmsg;
75 }
76
77 ATH_CHECK( detStore()->retrieve(m_tileHWID) );
78
79 ATH_CHECK( m_emScaleKey.initialize() );
80
81 ATH_CHECK( m_badChannelsKey.initialize() );
82
83 ATH_CHECK( m_DCSStateKey.initialize(m_checkDCS) );
84
85 ATH_CHECK( m_cablingSvc.retrieve() );
86 m_cabling = m_cablingSvc->cablingService();
87
88 ATH_CHECK( m_DQstatusKey.initialize() );
89
90 ATH_CHECK(m_digitsContainerKey.initialize());
91
92 return StatusCode::SUCCESS;
93}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
Name of TileEMScale in condition store.
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
SG::ReadCondHandleKey< TileDCSState > m_DCSStateKey
Name of TileDCSState object in condition store.
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
SG::ReadCondHandleKey< TileBadChannels > m_badChannelsKey
Name of TileBadChannels in condition store.
ServiceHandle< TileCablingSvc > m_cablingSvc
MsgStream & msg
Definition testRead.cxx:32

◆ process()

StatusCode TileTimeBCOffsetFilter::process ( TileMutableRawChannelContainer & rchCont,
const EventContext & ctx ) const
overridevirtual

Definition at line 100 of file TileTimeBCOffsetFilter.cxx.

101{
102 ATH_MSG_DEBUG("in TileTimeBCOffsetFilter::process()");
103
104 // Now retrieve the TileDQstatus
105 const TileDQstatus* DQstatus = SG::makeHandle (m_DQstatusKey, ctx).get();
106 const TileDCSState* dcsState = m_checkDCS ? SG::ReadCondHandle(m_DCSStateKey, ctx).cptr() : nullptr;
107
108 SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey, ctx);
109 ATH_CHECK( emScale.isValid() );
110
111 SG::ReadCondHandle<TileBadChannels> badChannels(m_badChannelsKey, ctx);
112 ATH_CHECK( badChannels.isValid() );
113
114 const char * part[5] = {"AUX","LBA","LBC","EBA","EBC"};
115 const int nchan_dmu = 3; // number of channels in a single DMU
116
117 TileRawChannelUnit::UNIT rchUnit = rchCont.get_unit();
118
119 for (IdentifierHash hash : rchCont.GetAllCurrentHashes()) {
120 TileRawChannelCollection* coll = rchCont.indexFindPtr (hash);
121
122 if (coll->size() != TileCalibUtils::MAX_CHAN) {
123 ATH_MSG_DEBUG("drawer container does not contain all channels");
124 continue;
125 }
126
127 /* Get drawer ID and build drawer index. */
128 HWIdentifier drawer_id = m_tileHWID->drawer_id(coll->identify());
129 int ros = m_tileHWID->ros(drawer_id);
130 int drawer = m_tileHWID->drawer(drawer_id);
131
132 unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
133 std::vector<int> channel_time_ok(TileCalibUtils::MAX_CHAN,0);
134 std::vector<int> bad_dmu;
135 if (drawer_ok(ros, drawer, *badChannels, channel_time_ok, bad_dmu)) continue;
136 if (msgLvl(MSG::VERBOSE)) {
137 for (unsigned int ch=0; ch<TileCalibUtils::MAX_CHAN; ++ch) {
138 if (channel_time_ok[ch]!=0) {
139 ATH_MSG_VERBOSE( "Checking BCOffset in module " << part[ros]
140 << std::setw(2) << std::setfill('0') << drawer+1
141 << " channel " << std::setw(2) << std::setfill(' ') << ch );
142 }
143 }
144 }
145
146 // in loop below rely on the channel order 0..47 inside collection
147 // print an ERROR and do nothing if order is wrong
148
149 for (int dmu : bad_dmu) {
150 ATH_MSG_VERBOSE( "Checking DMU " << dmu);
151 int dmu_offset = dmu * nchan_dmu;
152
153 /* the order is: [0] - channel on a different DMU, being a partner of
154 one of the channels on this DMU. We call it reference channel.
155 Indices [1]..[3] correspond to the channels on this DMU.
156 There might be more reference channels in one DMU (e.g. LB DMU#0 has
157 two partners on different DMU: ch=3 and ch=4), in that case we pick up
158 that with the highest energy.*/
159 bool ch_status[nchan_dmu+1];
160 int ch_number[nchan_dmu+1];
161 float ch_amp[nchan_dmu+1];
162 float ch_time[nchan_dmu+1];
163 bool ch_mask[nchan_dmu+1];
164
165 // search for reference channels, picking that with highest energy
166 int ch_p = -1, ch_0 = -1;
167 float ch_p_amp = -1000000;
168 for(int i=0; i < nchan_dmu; ++i) {
169 int ch = i+dmu_offset;
170 int ch_p_tmp = find_partner(ros,ch);
171 if ((ch_p_tmp >= 0) && (ch_p_tmp/nchan_dmu != dmu)) { // partner on different DMU
172 const TileRawChannel * rch = coll->at(ch_p_tmp);
173 HWIdentifier adc_id = rch->adc_HWID();
174 if (m_tileHWID->channel(adc_id) != ch_p_tmp) {
175 ATH_MSG_ERROR("Channels in drawer collection are out of order");
176 continue;
177 }
178 int gain = m_tileHWID->adc(adc_id);
179 TileBchStatus chStatus = badChannels->getAdcStatus(adc_id);
180 if (channel_time_ok[ch_p_tmp]==0 &&
181 (! ch_masked_or_empty(ros, drawer, ch_p_tmp, gain, chStatus, DQstatus, dcsState))) {
182 float amp = rch->amplitude();
184 amp = emScale->calibrateChannel(drawerIdx, ch_p_tmp, gain, amp, rchUnit, TileRawChannelUnit::MegaElectronVolts);
185 }
186 if (amp > ch_p_amp) {
187 ch_p = ch_p_tmp;
188 ch_p_amp = amp;
189 ch_0 = ch;
190 }
191 }
192 }
193 }
194 if (ch_p < 0) { // no suitable reference channel found, cannot do anything
195 continue;
196 }
197
198 ch_number[0] = ch_p;
199 ch_status[0] = channel_time_ok[ch_p];
200 ch_number[1] = ch_0;
201 ch_status[1] = channel_time_ok[ch_0];
202 int index = 2;
203 for(int i=0; i < nchan_dmu; ++i) {
204 int ch = i+dmu_offset;
205 if (ch != ch_0) {
206 ch_number[index] = ch;
207 ch_status[index] = channel_time_ok[ch];
208 ++index;
209 }
210 }
211
212 // init ch_amp, ch_time, ch_mask; ch_status already filled-in above
213 int nprob = 0; // number of potentially problematic channels in the DMU
214 for(int i=0; i <= nchan_dmu; ++i) {
215 int ch = ch_number[i];
216 const TileRawChannel * rch = coll->at(ch);
217 HWIdentifier adc_id = rch->adc_HWID();
218 if (m_tileHWID->channel(adc_id) != ch) {
219 ATH_MSG_ERROR("Channels in drawer collection are out of order");
220 continue;
221 }
222 int gain = m_tileHWID->adc(adc_id);
223 TileBchStatus chStatus = badChannels->getAdcStatus(adc_id);
224 if (ch_masked_or_empty(ros, drawer, ch, gain, chStatus, DQstatus, dcsState)) {
225 ch_number[i] = -10;
226 ch_amp[i] = 0;
227 ch_time[i] = 0;
228 ch_mask[i] = false;
229 } else {
230 ch_amp[i] = rch->amplitude();
232 ch_amp[i] = emScale->calibrateChannel(drawerIdx, ch, gain, ch_amp[i], rchUnit, TileRawChannelUnit::MegaElectronVolts);
233 }
234 ch_time[i] = rch->time();
235 ch_mask[i] = false;
236 if ((i > 0) && (ch_status[i]!=0)) ++nprob;
237 }
238 }
239
240 ATH_MSG_VERBOSE( "DMU " << dmu << " number of problems found " << nprob);
241 if (nprob == 0) continue; // no potential problems, skipping
242
243 float ene_threshold;
244 if (nprob == 1) {
245 ene_threshold = m_ene_threshold_1chan;
246 } else {
247 ene_threshold = m_ene_threshold_3chan;
248 }
249 /* Look at both reference and potentially affected channels in the given
250 DMU. At least one channel of the four should be above threshold,
251 and the time difference of affected channsl wrt reference channel
252 should be above 15 ns. */
253 bool ene_above = false;
254 for(int i=0; i <= nchan_dmu; ++i) {
255 ene_above = ene_above || ((ch_number[i] >= 0) && (std::abs(ch_amp[i]) > ene_threshold));
256 }
257 if (ene_above) { // at least 1 channel above the threshold
258 ATH_MSG_VERBOSE("Absolute energy above threshold in at least one relevant channel");
259 /* first check whether the times of 1-3 channels on the DMU are within
260 15 ns, also calculate the average time, use only channels with energy above threshold) */
261 bool time_dmu_same = true;
262 float time_dmu_aver = 0;
263 int n_dmu_aver = 0;
264 for(int i=1; (i <= nchan_dmu) && time_dmu_same; ++i) {
265 if (ch_number[i] < 0 || std::abs(ch_amp[i]) < m_ene_threshold_aver_time) continue;
266 time_dmu_aver += ch_time[i];
267 ++n_dmu_aver;
268 for(int j=i+1; (j <= nchan_dmu) && time_dmu_same; ++j) {
269 if (ch_number[j] >= 0 && std::abs(ch_amp[j]) > m_ene_threshold_aver_time) {
270 time_dmu_same = time_dmu_same &&
271 (std::abs(ch_time[i]-ch_time[j]) < m_time_threshold_diff);
272 }
273 }
274 }
275 if (time_dmu_same && (n_dmu_aver != 0)) {
276 time_dmu_aver /= n_dmu_aver;
277 ATH_MSG_VERBOSE( "Average time "<< time_dmu_aver);
278
279 int expected_sign = 0;
280 for(int i=1; i <= nchan_dmu; ++i) {
281 if (ch_number[i] >= 0) {
282 expected_sign = channel_time_ok[ch_number[i]];
283 ATH_MSG_VERBOSE("Expected BCOffset sign in " << part[ros]
284 << std::setw(2) << std::setfill('0') << drawer+1
285 << ": " << expected_sign);
286 break;
287 }
288 }
289 bool time_offset = false; // if reference time is far from average DMU time
290 switch (expected_sign) // correct bool expression for given expected sign of BCOffset in given DMU
291 {
292 case +1:
293 time_offset = time_dmu_aver - ch_time[0] > m_time_threshold_diff;
294 break;
295 case -1:
296 time_offset = ch_time[0] - time_dmu_aver > m_time_threshold_diff;
297 break;
298 }
299 // masking channels with BCOffset
300 if (time_offset && (std::abs(ch_time[0]) < m_time_threshold_ref_ch)) { // BCOffset && reference time ~0 ns
301 // calculate difference between maximal and minimal sample value in reference channel
302 ATH_MSG_VERBOSE("Retrieving digits in " << part[ros]
303 << std::setw(2) << std::setfill('0') << drawer+1
304 << " ch " << std::setw(2) << std::setfill(' ') << ch_number[0]
305 << " run " << ctx.eventID().run_number()
306 << " evt " << ctx.eventID().event_number());
307 float ref_maxmindiff = ref_digits_maxmindiff(ros, drawer, ch_number[0]);
308 // set threshold for high and low gain
309 float sample_threshold;
310 const TileRawChannel * rch = coll->at(ch_number[0]);
311 HWIdentifier adc_id = rch->adc_HWID();
312 int gain = m_tileHWID->adc(adc_id);
313 if (gain == 1) {
314 sample_threshold = m_sample_diffmaxmin_threshold_hg;
315 } else {
316 sample_threshold = m_sample_diffmaxmin_threshold_lg;
317 }
318 sample_threshold = sample_threshold - 0.5; // samples are integers in float data type -> '-0.5' for float comparison
319 if (ref_maxmindiff > sample_threshold) { // max - min sample should be above threshold
320 for(int i=1; i <= nchan_dmu; ++i) {
321 if (ch_number[i] >= 0) ch_mask[i] = true;
322 }
323 }
324 }
325 } else {
326 ATH_MSG_VERBOSE( "Can not determine average time");
327 }
328 }
329 // now apply mask to RawChannelContainer for channels spotted above
330 for(int i=1; i<= nchan_dmu;++i) {
331 if ((ch_number[i] >= 0) && ch_mask[i]) {
332 ATH_MSG_DEBUG( "Masking " << part[ros]
333 << std::setw(2) << std::setfill('0') << drawer+1
334 << " ch " << std::setw(2) << std::setfill(' ') << ch_number[i]
335 << " ene " << ch_amp[i]
336 << " time " << ch_time[i]
337 << " ref_ene " << ch_amp[0]
338 << " ref_time " << ch_time[0]
339 << " run " << ctx.eventID().run_number()
340 << " evt " << ctx.eventID().event_number() );
341 coll->at(ch_number[i])->setPedestal(fmod(coll->at(ch_number[i])->pedestal(),10000.)+240000.0);
342 }
343 }
344 } // end-of-loop over all DMUs in the given drawer
345 } // end-of loop over drawers
346
347 return StatusCode::SUCCESS;
348}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual std::vector< IdentifierHash > GetAllCurrentHashes() const override final
Returns a collection of all hashes availiable in this IDC.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Collection * indexFindPtr(IdentifierHash hash)
Look up a (non-const) collection via hash.
float time(int ind=0) const
float amplitude(int ind=0) const
HWIdentifier adc_HWID(void) const
Definition TileRawData.h:53
bool ch_masked_or_empty(int ros, int drawer, int channel, int gain, const TileBchStatus &chStatus, const TileDQstatus *DQstatus, const TileDCSState *dcsState) const
float ref_digits_maxmindiff(int ros, int drawer, int ref_channel) const
bool drawer_ok(int ros, int drawer, const TileBadChannels *badChannels, std::vector< int > &channel_time_ok, std::vector< int > &bad_dmu) const
int find_partner(int ros, int channel) const
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ ref_digits_maxmindiff()

float TileTimeBCOffsetFilter::ref_digits_maxmindiff ( int ros,
int drawer,
int ref_channel ) const
private

Definition at line 426 of file TileTimeBCOffsetFilter.cxx.

426 {
427 /* Retrieve digits in reference channel of bad DMUs for calculation of
428 sample_max - sample_min used later in loop over raw channel collections
429 if samples are not in the collection the return value is set to -10. */
430 float max_min_diff = 0.;
431 // get named TileDigitsContaner from TES
432 SG::ReadHandle<TileDigitsContainer> digitsContainer(m_digitsContainerKey);
433 // Iterate over all collections (drawers) with digits
434 for (const TileDigitsCollection *digitsCollection : *digitsContainer) {
435 // Get drawer ID and build drawer index.
436 HWIdentifier drawer_id = m_tileHWID->drawer_id(digitsCollection->identify());
437 int digits_ros = m_tileHWID->ros(drawer_id);
438 int digits_drawer = m_tileHWID->drawer(drawer_id);
439 // retrieve reference channel digits
440 if (digits_ros == ros && digits_drawer == drawer) {
441 bool ref_ch_is_in_coll = false;
442 for (uint i_ch = 0; i_ch < digitsCollection->size(); i_ch++) {
443 const TileDigits * tdig = digitsCollection->at(i_ch);
444 HWIdentifier adc_id = tdig->adc_HWID();
445 int ch_number = m_tileHWID->channel(adc_id);
446 if (ch_number == ref_channel) {
447 std::vector<float> ref_samples = tdig->samples();
448
449 float max_sample = *max_element(ref_samples.begin(), ref_samples.end());
450 float min_sample = *min_element(ref_samples.begin(), ref_samples.end());
451 max_min_diff = max_sample - min_sample;
452 ATH_MSG_VERBOSE("Reference channel: max - min sample = " << max_min_diff);
453 ref_ch_is_in_coll = true;
454 }
455 }
456 if (!ref_ch_is_in_coll) {
457 ATH_MSG_VERBOSE("Reference channel is not in the digits collection");
458 max_min_diff = -10.;
459 }
460 }
461 } // end of loop over drawers
462 return max_min_diff;
463}
unsigned int uint
const std::vector< float > & samples() const
Definition TileDigits.h:58

Member Data Documentation

◆ m_badChannelsKey

SG::ReadCondHandleKey<TileBadChannels> TileTimeBCOffsetFilter::m_badChannelsKey
private
Initial value:
{this,
"TileBadChannels", "TileBadChannels", "Input Tile bad channel status"}

Name of TileBadChannels in condition store.

Definition at line 99 of file TileTimeBCOffsetFilter.h.

99 {this,
100 "TileBadChannels", "TileBadChannels", "Input Tile bad channel status"};

◆ m_cabling

const TileCablingService* TileTimeBCOffsetFilter::m_cabling
private

TileCabling instance.

Definition at line 79 of file TileTimeBCOffsetFilter.h.

◆ m_cablingSvc

ServiceHandle<TileCablingSvc> TileTimeBCOffsetFilter::m_cablingSvc
private
Initial value:
{ this,
"TileCablingSvc", "TileCablingSvc", "The Tile cabling service"}

Definition at line 81 of file TileTimeBCOffsetFilter.h.

81 { this,
82 "TileCablingSvc", "TileCablingSvc", "The Tile cabling service"};

◆ m_checkDCS

bool TileTimeBCOffsetFilter::m_checkDCS
private

Definition at line 118 of file TileTimeBCOffsetFilter.h.

◆ m_DCSStateKey

SG::ReadCondHandleKey<TileDCSState> TileTimeBCOffsetFilter::m_DCSStateKey
private
Initial value:
{this,
"TileDCS", "TileDCS", "Input Tile DCS status"}

Name of TileDCSState object in condition store.

Definition at line 87 of file TileTimeBCOffsetFilter.h.

87 {this,
88 "TileDCS", "TileDCS", "Input Tile DCS status"};

◆ m_digitsContainerKey

SG::ReadHandleKey<TileDigitsContainer> TileTimeBCOffsetFilter::m_digitsContainerKey
private
Initial value:
{this,"TileDigitsContainer","TileDigitsCnt",
"Input Tile digits container key"}

Definition at line 103 of file TileTimeBCOffsetFilter.h.

103 {this,"TileDigitsContainer","TileDigitsCnt",
104 "Input Tile digits container key"};

◆ m_DQstatusKey

SG::ReadHandleKey<TileDQstatus> TileTimeBCOffsetFilter::m_DQstatusKey
private
Initial value:
{this, "TileDQstatus",
"TileDQstatus",
"TileDQstatus key"}

Definition at line 107 of file TileTimeBCOffsetFilter.h.

107 {this, "TileDQstatus",
108 "TileDQstatus",
109 "TileDQstatus key"};

◆ m_emScaleKey

SG::ReadCondHandleKey<TileEMScale> TileTimeBCOffsetFilter::m_emScaleKey
private
Initial value:
{this,
"TileEMScale", "TileEMScale", "Input Tile EMS calibration constants"}

Name of TileEMScale in condition store.

Definition at line 93 of file TileTimeBCOffsetFilter.h.

93 {this,
94 "TileEMScale", "TileEMScale", "Input Tile EMS calibration constants"};

◆ m_ene_threshold_1chan

float TileTimeBCOffsetFilter::m_ene_threshold_1chan
private

Definition at line 112 of file TileTimeBCOffsetFilter.h.

◆ m_ene_threshold_3chan

float TileTimeBCOffsetFilter::m_ene_threshold_3chan
private

Definition at line 111 of file TileTimeBCOffsetFilter.h.

◆ m_ene_threshold_aver_time

float TileTimeBCOffsetFilter::m_ene_threshold_aver_time
private

Definition at line 115 of file TileTimeBCOffsetFilter.h.

◆ m_sample_diffmaxmin_threshold_hg

float TileTimeBCOffsetFilter::m_sample_diffmaxmin_threshold_hg
private

Definition at line 116 of file TileTimeBCOffsetFilter.h.

◆ m_sample_diffmaxmin_threshold_lg

float TileTimeBCOffsetFilter::m_sample_diffmaxmin_threshold_lg
private

Definition at line 117 of file TileTimeBCOffsetFilter.h.

◆ m_tileHWID

const TileHWID* TileTimeBCOffsetFilter::m_tileHWID
private

Pointer to TileHWID.

Definition at line 77 of file TileTimeBCOffsetFilter.h.

◆ m_time_threshold_diff

float TileTimeBCOffsetFilter::m_time_threshold_diff
private

Definition at line 113 of file TileTimeBCOffsetFilter.h.

◆ m_time_threshold_ref_ch

float TileTimeBCOffsetFilter::m_time_threshold_ref_ch
private

Definition at line 114 of file TileTimeBCOffsetFilter.h.


The documentation for this class was generated from the following files: