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 39 of file TileTimeBCOffsetFilter.cxx.

41 : base_class(type, name, parent)
42 , m_tileHWID(nullptr)
43 , m_cabling(nullptr)
44{
45 declareProperty("EneThreshold3", m_ene_threshold_3chan = 1000);
46 declareProperty("EneThreshold1", m_ene_threshold_1chan = 3000);
47 declareProperty("TimeThreshold", m_time_threshold_diff = 15);
48 declareProperty("AverTimeEneThreshold", m_ene_threshold_aver_time = 500);
49 declareProperty("RefTimeThreshold", m_time_threshold_ref_ch = 10);
50 declareProperty("SampleDiffMaxMin_HG", m_sample_diffmaxmin_threshold_hg = 15);
51 declareProperty("SampleDiffMaxMin_LG", m_sample_diffmaxmin_threshold_lg = -1);
52
53 declareProperty("CheckDCS", m_checkDCS = false);
54}
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 382 of file TileTimeBCOffsetFilter.cxx.

385 {
386 // check if channel is connected
387 int index, pmt;
388 m_cabling->h2s_cell_id_index(ros, drawer, channel, index, pmt);
389 if (index < 0) return true; // disconnected or MBTS
390
391 // DB status
392 if (chStatus.isBad()) return true;
393
394 // check DQstatus or DCS now
395 bool bad = !(DQstatus->isAdcDQgood(ros, drawer, channel, gain))
396 || (dcsState ? dcsState->isStatusBad(ros, drawer, channel) : false);
397 return bad;
398}
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 351 of file TileTimeBCOffsetFilter.cxx.

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

96 {
97 return StatusCode::SUCCESS;
98}

◆ find_partner()

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

Definition at line 400 of file TileTimeBCOffsetFilter.cxx.

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

◆ initialize()

StatusCode TileTimeBCOffsetFilter::initialize ( )
overridevirtual

Definition at line 56 of file TileTimeBCOffsetFilter.cxx.

56 {
57 ATH_MSG_INFO( "TileTimeBCOffsetFilter::initialize()" );
58
59 if (msgLvl(MSG::DEBUG)) {
60 msg(MSG::DEBUG) << "EneThreshold3 = "
62 msg(MSG::DEBUG) << "EneThreshold1 = "
64 msg(MSG::DEBUG) << "TimeThreshold = "
66 msg(MSG::DEBUG) << "AverTimeEneThreshold = "
68 msg(MSG::DEBUG) << "RefTimeThreshold = "
70 msg(MSG::DEBUG) << "SampleDiffMaxMin_HG = "
72 msg(MSG::DEBUG) << "SampleDiffMaxMin_LG = "
74 msg(MSG::DEBUG) << "CheckDCS = "
75 << ((m_checkDCS)?"true":"false") << endmsg;
76 }
77
79
80 ATH_CHECK( m_emScaleKey.initialize() );
81
82 ATH_CHECK( m_badChannelsKey.initialize() );
83
84 ATH_CHECK( m_DCSStateKey.initialize(m_checkDCS) );
85
86 ATH_CHECK( m_cablingSvc.retrieve() );
87 m_cabling = m_cablingSvc->cablingService();
88
89 ATH_CHECK( m_DQstatusKey.initialize() );
90
91 ATH_CHECK(m_digitsContainerKey.initialize());
92
93 return StatusCode::SUCCESS;
94}
#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
retrieve(aClass, aKey=None)
Definition PyKernel.py:110
MsgStream & msg
Definition testRead.cxx:32

◆ process()

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

Definition at line 101 of file TileTimeBCOffsetFilter.cxx.

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

◆ ref_digits_maxmindiff()

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

Definition at line 427 of file TileTimeBCOffsetFilter.cxx.

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