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

#include <TileCellSelector.h>

Inheritance diagram for TileCellSelector:

Public Member Functions

 TileCellSelector (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~TileCellSelector ()
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) override
 Execute method.
virtual StatusCode finalize () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

int Are3FF (std::vector< float > &OptFilterDigits, int OptFilterGain, int ch_type)
void printCell (const TileCell *cell)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

unsigned int m_counter {0}
unsigned int m_accept {0}
unsigned int m_minCell {0}
unsigned int m_maxCell {0}
unsigned int m_minChan {0}
unsigned int m_maxChan {0}
unsigned int m_jump {0}
unsigned int m_const {0}
unsigned int m_overLG {0}
unsigned int m_overHG {0}
unsigned int m_underLG {0}
unsigned int m_underHG {0}
unsigned int m_dqerr {0}
unsigned int m_dmuerr {0}
unsigned int m_warnerr {0}
const TileID * m_tileID {nullptr}
const TileHWID * m_tileHWID {nullptr}
const TileCablingService * m_cabling {nullptr}
ToolHandle< ITileBadChanTool > m_tileBadChanTool {this, "TileBadChanTool", "TileBadChanTool", "Tile bad channel tool"}
SG::ReadHandleKey< TileDQstatus > m_dqStatusKey {this, "TileDQstatus", "TileDQstatus", "TileDQstatus key"}
ToolHandle< ITileDCSTool > m_tileDCS {this, "TileDCSTool", "TileDCSTool", "Tile DCS tool"}
unsigned int m_runNum {0}
unsigned int m_lumiBlock {0}
unsigned int m_evtNum {0}
unsigned int m_evtBCID {0}
unsigned int m_tileFlag {0}
unsigned int m_tileError {0}
std::vector< bool > m_chanBad
std::vector< float > m_chanEne
std::vector< float > m_chanTime
std::vector< float > m_chanDsp
std::vector< float > m_chanTDsp
std::vector< float > m_chanQua
std::vector< bool > m_chanSel
std::vector< bool > m_chanToSkip
std::vector< bool > m_drawerToSkip
bool m_readCells {true}
bool m_readRawChannels {true}
bool m_readDigits {true}
SG::ReadHandleKey< CaloCellContainer > m_cellContainerKey
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Gaudi::Property< float > m_minEneCell {this, "MinEnergyCell", -5000., "Cut on cell energy"}
Gaudi::Property< float > m_maxEneCell {this, "MaxEnergyCell", 1000000., "Cut on cell energy"}
Gaudi::Property< float > m_minEneChan [3]
Gaudi::Property< float > m_maxEneChan [3]
Gaudi::Property< float > m_minTimeCell {this, "MinTimeCell", -100., "Cut on cell time"}
Gaudi::Property< float > m_maxTimeCell {this, "MaxTimeCell", 100., "Cut on cell time"}
Gaudi::Property< float > m_minTimeChan [3]
Gaudi::Property< float > m_maxTimeChan [3]
Gaudi::Property< int > m_ptnEneCell {this, "PtnEnergyCell", 101, "Cell energy pattern, accept events only below min (+1), between min-max (+10), above max (+100)"}
Gaudi::Property< int > m_ptnEneChan [3]
Gaudi::Property< int > m_ptnTimeCell {this, "PtnTimeCell", 10, "Cell time pattern, accept events only below min (+1), between min-max (+10), above max (+100)"}
Gaudi::Property< int > m_ptnTimeChan [3]
Gaudi::Property< int > m_selectGain {this, "SelectGain", 2, "0 - select LG only, 1 - HG only, 2 - both gains"}
bool m_skipGain [2] {}
bool m_bitEneCell [ptnlength] {}
bool m_bitTimeCell [ptnlength] {}
bool m_bitEneChan [3][ptnlength] {}
bool m_bitTimeChan [3][ptnlength] {}
Gaudi::Property< float > m_secondMaxLevel {this, "SecondMaxLevel", 0.3, "Sample below max should be above (max-min)*SecondMaxLevel"}
Gaudi::Property< float > m_jumpDeltaHG {this, "JumpDeltaHG", 50.0, "Minimal jump in high gain"}
Gaudi::Property< float > m_jumpDeltaLG {this, "JumpDeltaLG", 10.0, "Minimal jump in low gain"}
Gaudi::Property< float > m_pedDeltaHG {this, "PedDetlaHG", 4.1, "Max variation of \"const\" value in high gain"}
Gaudi::Property< float > m_pedDeltaLG {this, "PedDetlaLG", 4.1, "Max variation of \"const\" value in low gain"}
Gaudi::Property< int > m_constLength {this, "ConstLength", 6, "Min number of consecutive samples of the same value"}
Gaudi::Property< int > m_minBadDMU {this, "MinBadDMU", 4, "Min number of bad DMUs to accept event"}
Gaudi::Property< int > m_maxBadDMU {this, "MaxBadDMU", 15, "Max number of bad DMUs to accept event"}
Gaudi::Property< int > m_minBadMB {this, "MinBadMB", 4, "Min number of bad motherboards in a drawer to accept event"}
Gaudi::Property< bool > m_skipEmpty {this, "SkipEmpty", true, "Ignore empty channels in selection or not"}
Gaudi::Property< bool > m_skipMasked {this, "SkipMasked", true, "Ignore masked channels in selection or not"}
Gaudi::Property< bool > m_skipMBTS {this, "SkipMBTS", true, "Ignore MBTS channels in selection or not"}
Gaudi::Property< bool > m_checkDCS {this, "CheckDCS", true, "Additional check for DCS status"}
Gaudi::Property< bool > m_checkJumps {this, "CheckJumps", true, "Global flag which allows to switch on/off all checks in digits"}
Gaudi::Property< bool > m_checkDMUs {this, "CheckDMUs", true, "Global flag which allows to switch on/off DMU checks"}
Gaudi::Property< bool > m_checkOverLG {this, "CheckOverLG", true, "Select events with overflow in low gain"}
Gaudi::Property< bool > m_checkOverHG {this, "CheckOverHG", false, "Select events with overflow in high gain"}
Gaudi::Property< bool > m_checkUnderLG {this, "CheckUnderLG", false, "Select events with underflow in low gain"}
Gaudi::Property< bool > m_checkUnderHG {this, "CheckUnderHG", false, "Select events with underflow in high gain"}
Gaudi::Property< float > m_overflowLG {this, "OverflowLG", -0.1, "Threshold for overflow in low gain (smaller than ADCmax by this value)"}
Gaudi::Property< float > m_overflowHG {this, "OverflowHG", -1.1, "Threshold for overflow in high gain (smaller than ADCmax by this value)"}
Gaudi::Property< float > m_underflowLG {this, "UnderflowLG", 0.1, "Threshold for underflow in low gain"}
Gaudi::Property< float > m_underflowHG {this, "UnderflowHG", 2.1, "Threshold for underflow in high gain"}
Gaudi::Property< bool > m_checkWarning {this, "CheckWarning", false, "Select events with warning status in TileCal status word"}
Gaudi::Property< bool > m_checkError {this, "CheckError", false, "Select events with error status in TileCal status word"}
Gaudi::Property< bool > m_printOnly {this, "PrintOnly", false, "Only print accepted events, but do not accept anything"}
Gaudi::Property< std::vector< int > > m_drawer {this, "DrawerToDump", {}, "Drawers for which all channels should be printed"}
Gaudi::Property< std::vector< int > > m_drawerToCheck {this, "DrawerToCheck", {}, "Drawers for which all checks should be performed"}
Gaudi::Property< std::vector< int > > m_chanToCheck {this, "ChannelToCheck", {}, "Channels for which all checks should be performed"}
Gaudi::Property< int > m_maxVerboseCnt {this, "MaxVerboseCnt", 20, "Max number of verbose output lines about drawer off"}
std::vector< int > m_nDrawerOff
Gaudi::Property< std::string > m_infoName {this, "TileInfoName", "TileInfo", "Name of TileInfo object in DetectorStore"}
const TileInfo * m_tileInfo {nullptr}
float m_ADCmaxMinusEps = 0.0F
float m_ADCmaskValueMinusEps = 0.0F
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 41 of file TileCellSelector.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TileCellSelector()

TileCellSelector::TileCellSelector ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 35 of file TileCellSelector.cxx.

36 : AthAlgorithm(name, pSvcLocator)
37{
38}
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.

◆ ~TileCellSelector()

TileCellSelector::~TileCellSelector ( )
virtual

Definition at line 41 of file TileCellSelector.cxx.

41 {
42}

Member Function Documentation

◆ Are3FF()

int TileCellSelector::Are3FF ( std::vector< float > & OptFilterDigits,
int OptFilterGain,
int ch_type )
private

Definition at line 2005 of file TileCellSelector.cxx.

2005 {
2006 bool allSaturated = true;
2007 int error = 0;
2008
2009 unsigned int nSamp = OptFilterDigits.size();
2010 if (nSamp) {
2011 float dmin = OptFilterDigits[0];
2012 float dmax = dmin;
2013
2014 for (unsigned int i = 1; i < nSamp; ++i) {
2015 float dig = OptFilterDigits[i];
2016 if (dig > dmax) dmax = dig;
2017 else if (dig < dmin) dmin = dig;
2018 }
2019 allSaturated = (dmin > m_ADCmaxMinusEps);
2020
2021 // FIXME:: set these parameters from JobOptions
2022 // FIXME:: move this method to base class
2023 const float epsilon = 4.1; // allow +/- 2 counts fluctuations around const value
2024 const float delta[4] = {29.9, 29.9, 49.9, 99.9}; // jump levels between constLG, constHG, non-constLG, non-constHG
2025 const float level0 = 29.9; // jump from this level to zero is bad
2026 const float level1 = 99.9; // jump from this level to m_tileInfo->ADCmax() is bad
2027 const float level2 = 199.9; // base line at this level is bad
2028 const float delt = std::min(std::min(std::min(delta[0], delta[1]), std::min(delta[2], delta[3])), level0);
2029
2030 if (!allSaturated && (dmax - dmin) > delt) {
2031 float abovemin = dmax;
2032 float belowmax = dmin;
2033 unsigned int nmin = 0;
2034 unsigned int nmax = 0;
2035 unsigned int pmin = nSamp;
2036 unsigned int pmax = nSamp;
2037 for (unsigned int i = 0; i < nSamp; ++i) {
2038 float smp = OptFilterDigits[i];
2039 if (smp - dmin < epsilon) {
2040 ++nmin;
2041 pmin = i;
2042 }
2043 if (dmax - smp < epsilon) {
2044 ++nmax;
2045 pmax = i;
2046 }
2047 if (smp < abovemin && smp > dmin) {
2048 abovemin = smp;
2049 }
2050 if (smp > belowmax && smp < dmax) {
2051 belowmax = smp;
2052 }
2053 }
2054
2055 if (abovemin != dmax || belowmax != dmin) { // more than two different values
2056 gain += 2; // shift index by 2, i.e. use thresholds for non-const levels
2057 }
2058
2059 if (dmin < 0.01 && dmax > m_ADCmaxMinusEps) { // jump from zero to saturation
2060 error = 1;
2061 } else if (dmin < 0.01 && abovemin > level0 && nmin > 1) { // at least two samples at zero, others - above pedestal
2062 error = 2;
2063 } else if (dmax > m_ADCmaxMinusEps && belowmax < level1 && nmax > 1) { // at least two saturated. others - close to pedestal
2064 error = 3;
2065 } else if (dmin>level2 && (gain==0 || ch_type<2) ) { // baseline above threshold is bad
2066 error = 9; // but should not apply that to MBTS
2067 } else if (nmax+nmin==nSamp && (dmax-dmin) > delta[gain]) {
2068 if (nmax>1 && nmin>1) { // at least 2 samples at two distinct levels
2069 error = 4;
2070 } else if (nmax==1) {
2071 if (pmax>0 && pmax<nSamp-1) { // jump up in one sample, but not at the edge
2072 error = 5;
2073 }
2074 } else if (nmin==1) { // jump down in one sample
2075 error = 6;
2076 }
2077 }
2078 if (!error && (dmax - dmin) > delta[gain]) {
2079 float secondMax = (dmax - dmin) * m_secondMaxLevel;
2080 if (pmax > 0 && pmax < nSamp - 1
2081 && std::max(OptFilterDigits[pmax - 1], OptFilterDigits[pmax + 1]) < dmin + secondMax) {
2082
2083 error = 7; // jump up in one sample in the middle. which is much higher than all others
2084 } else if (pmin > 0 && pmin < nSamp - 1
2085 && std::min(OptFilterDigits[pmin - 1], OptFilterDigits[pmin + 1]) > dmax - secondMax) {
2086
2087 error = 8; // jump down in one sample. which is much lower than all others
2088 }
2089 }
2090 }
2091 }
2092
2093 if (allSaturated)
2094 return 99;
2095 else
2096 return error;
2097}
const int nmax(200)
Gaudi::Property< float > m_secondMaxLevel

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode TileCellSelector::execute ( const EventContext & ctx)
overridevirtual

Execute method.

Implements AthAlgorithm.

Definition at line 270 of file TileCellSelector.cxx.

270 {
271 //ATH_MSG_DEBUG ("execute()");
272
273
274 ++m_counter;
275
276 SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfoKey, ctx);
277 if ( eventInfo.isValid() ) {
278 m_runNum = eventInfo->runNumber();
279 m_lumiBlock = eventInfo->lumiBlock();
280 m_evtNum = eventInfo->eventNumber();
281 m_evtBCID = eventInfo->bcid();
282 m_tileFlag = eventInfo->eventFlags(EventInfo::Tile);
283 m_tileError = eventInfo->errorState(EventInfo::Tile);
284 } else {
285 m_runNum = 0;
286 m_evtNum = 0;
287 m_lumiBlock = 0;
288 m_evtBCID = 0;
289 m_tileFlag = 0;
290 m_tileError = 0;
291 }
292
293 std::ostringstream evState;
294 evState << "Run "<< std::setw(6) << m_runNum
295 <<" LB "<< std::setw(4) << m_lumiBlock
296 <<" Evt "<< std::setw(9) << m_evtNum
297 <<" ErrState " << m_tileError
298 <<" Flags 0x" << std::hex << m_tileFlag << std::dec;
299
300 std::ostringstream evtnum;
301 evtnum << "Run "<< std::setw(6) << m_runNum
302 <<" LB "<< std::setw(4) << m_lumiBlock
303 <<" Evt "<< std::setw(9) << m_evtNum
304 <<" BCID "<< std::setw(4) << m_evtBCID;
305
306 std::ostringstream nevtnum;
307 nevtnum << evtnum.str()
308 <<" nevt "<< std::setw(6) << m_counter;
309
310 bool emptyBad = true;
311 bool badFromCell = false;
312 m_chanBad.clear();
313 m_chanBad.resize(1+TileHWID::NOT_VALID_HASH,true);
314 m_chanEne.clear();
316 m_chanTime.clear();
318 m_chanQua.clear();
320 m_chanSel.clear();
321 m_chanSel.resize(1+TileHWID::NOT_VALID_HASH,false);
322
323 IdContext chan_context = m_tileHWID->channel_context();
324 IdentifierHash hash;
325 for (size_t i=0; i<m_drawer.value().size(); ++i) {
326 HWIdentifier drawer_id = m_tileHWID->drawer_id(m_drawer.value()[i]);
327 HWIdentifier ch_id = m_tileHWID->channel_id(drawer_id,0);
328 m_tileHWID->get_hash(ch_id, hash, &chan_context);
329 auto itr = m_chanSel.begin() + hash;
330 std::fill(itr,itr+48,true);
331 }
332
333 bool statusOk = (m_checkWarning && m_tileError == EventInfo::Warning) ||
335 if (statusOk) {
336 ++m_warnerr;
337
338 using namespace boost::local_time;
339 using namespace boost::posix_time;
340 static const time_zone_ptr gva_tz(new posix_time_zone((std::string)"CET+01CEST01:00:00,M3.5.0/02:00:00,M10.5.0/03:00:00"));
341 local_date_time gva_time(from_time_t(eventInfo->timeStamp()),gva_tz);
342 evState << " " << gva_time << " ";
343
344
345 const char * part[5] = { "UNK", "LBA", "LBC", "EBA", "EBC" };
347 int dn = (m_tileFlag >> 16) & 0xF;
348 int n1 = (m_tileFlag >> 20) & 0x3F;
349 int n2 = (n1 + dn - 1) % 64;
350 int rr = ((m_tileFlag >> 26) & 0x3) + 1;
351 evState << " " << part[rr] <<std::setw(2)<<std::setfill('0')<<n1+1
352 << " - " << part[rr] <<std::setw(2)<<std::setfill('0')<<n2+1
353 << " " << dn << " consec bad ";
354 }
355 else if (m_tileError == EventInfo::Error) {
356 int dn = (m_tileFlag >> 16) & 0xF;
357 int p0 = m_tileFlag & 0xF; // sends any data above threshold
358 int p1 = (m_tileFlag >> 20) & 0xF; // 16 drawers masked
359 int p2 = (m_tileFlag >> 24) & 0xF; // 16 drawers off
360 int pp = 1;
361 for (int rr = 1; rr < 5; ++rr) {
362 if ((p2 & pp) || (p1 & pp)) {
363 evState << " " << part[rr];
364 if (p2 & pp) {
365 if (p0 & pp) evState << " off";
366 else evState << " OFF";
367 }
368 if (p1 & pp) {
369 if (p0 & pp) evState << " mask";
370 else evState << " MASK";
371 }
372 }
373 pp <<= 1;
374 }
375 evState << " " << dn << " consec bad ";
376 }
377
378 if (m_checkDCS) {
379 int n1 = -1;
380 int n2 = -1;
381 int dn = 0;
382 int rr = 0;
383 int m1 = -1;
384 int m2 = -1;
385 int dm = -1;
386 std::vector<int> allmod;
387 std::vector<int> consec;
388 for (int ros = 1; ros < 5; ++ros) {
389 int drmax = 65;
390 for (int dr = 0; dr < drmax; ++dr) {
391 int drawer = dr % 64;
392 if (m_tileDCS->getDCSStatus(ros, drawer) == TileDCSState::ALERT_DRAWER) {
393 if (m1 < 0) m1 = dr;
394 m2 = dr;
395 if (dr < 64) allmod.push_back((ros << 8) + dr);
396 } else if (m1 >= 0) {
397 dm = m2 - m1 + 1;
398 if (m1 == 0) drmax += dm;
399 if (dm > dn) {
400 n1 = m1;
401 n2 = m2;
402 dn = dm;
403 rr = ros;
404 consec.clear();
405 consec.push_back((ros << 8) + m1);
406 } else if (dm == dn) {
407 if (m1 < 64) consec.push_back((ros << 8) + m1);
408 }
409 m1 = m2 = -1;
410 }
411 }
412 }
413 evState << " DCS " << allmod.size() << " off ";
414 if (dn > 1) {
415 evState << dn;
416 if (consec.size() > 1) evState << "*" << (consec.size());
417 evState << " consec "
418 << part[rr] << std::setw(2) << std::setfill('0') << (n1 % 64) + 1 << " - "
419 << part[rr] << std::setw(2) << std::setfill('0') << (n2 % 64) + 1 << " ";
420 n1 += (rr << 8);
421 n2 += (rr << 8);
422 for (size_t n = 1; n < consec.size(); ++n) {
423 m1 = consec[n];
424 m2 = m1 + dn - 1;
425 evState << part[m1 >> 8] << std::setw(2) << std::setfill('0') << (m1 % 64) + 1 << " - "
426 << part[m2 >> 8] << std::setw(2) << std::setfill('0') << (m2 % 64) + 1 << " ";
427 for (size_t m = 0; m < allmod.size(); ++m) {
428 int mm = allmod[m];
429 if (mm >= m1 && mm <= m2) {
430 allmod[m] += n1 - m1;
431 }
432 }
433 }
434 } else {
435 n1 = n2 = dn = 0;
436 }
437 if (allmod.size() > (size_t) dn) {
438 for (size_t m = 0; m < allmod.size(); ++m) {
439 int mm = allmod[m];
440 if (!(mm >= n1 && mm <= n2)) {
441 evState << part[mm >> 8] << std::setw(2) << std::setfill('0') << (mm % 64) + 1 << " ";
442 }
443 }
444 }
445 }
446
447 ATH_MSG_DEBUG (evState.str() << " accepted");
448 }
449
450 int rawdata = -1;
451 const TileCell* cellminCh = 0;
452 const TileCell* cellmaxCh = 0;
453 const TileCell* tcellminCh = 0;
454 const TileCell* tcellmaxCh = 0;
455
456 if (m_readCells) {
457
458 // Get Calo cell container
459 SG::ReadHandle<CaloCellContainer> cellContainer(m_cellContainerKey, ctx);
460
461 if (!cellContainer.isValid()) {
462
463 ATH_MSG_WARNING("Unable to read CaloCellContainer from EventStore, disable reading of this container");
464 m_readCells = false;
465
466 } else {
467
468 float emin = 0.;
469 float emax = 0.;
470 float tmin = 0.;
471 float tmax = 0.;
472 float chmin = 0.;
473 float chmax = 0.;
474 float tcmin = 0.;
475 float tcmax = 0.;
476 const TileCell* cellmin = 0;
477 const TileCell* cellmax = 0;
478 const TileCell* tcellmin = 0;
479 const TileCell* tcellmax = 0;
480
481 // special case - check overflow here if digits container is not available
482 // should be careful here, because in TileCell overflow bit is set to 1
483 // both for overflow and underflow and underflow is HG are very often in gap cells
484 // also, overflow in HG might be masked if quality is too bad, so we'll not select all overflows...
485 // that's why only overflow in LG are checked
486 bool checkOver = (m_checkOverLG && m_digitsContainerKey.key().empty());
487
488 for (const CaloCell* cell : *cellContainer) {
489
490 Identifier id = cell->ID();
491 if ( m_tileID->is_tile(id) ) {
492 const TileCell* tile_cell = dynamic_cast<const TileCell*> (cell);
493 if (tile_cell==0) continue;
494 const CaloDetDescrElement * caloDDE = cell->caloDDE();
495 IdentifierHash hash1 = caloDDE->onl1();
496 IdentifierHash hash2 = caloDDE->onl2();
497 if ( m_chanToSkip[hash1] && m_chanToSkip[hash2] ) continue;
498 int ch_type = (hash2 == TileHWID::NOT_VALID_HASH) ? 1 : 0;
499 if (rawdata < 0) {
500 rawdata = (tile_cell->qbit1() & TileCell::MASK_CMPC) ? 0 : 1;
501 }
502
503 bool bad1 = tile_cell->badch1();
504 bool bad2 = tile_cell->badch2();
505 float ene1 = tile_cell->ene1();
506 float ene2 = tile_cell->ene2();
507 float time1 = tile_cell->time1();
508 float time2 = tile_cell->time2();
509 m_chanBad[hash1] = bad1;
510 m_chanBad[hash2] = bad2;
511 m_chanEne[hash1] = ene1;
512 m_chanEne[hash2] = ene2;
513 m_chanTime[hash1] = time1;
514 m_chanTime[hash2] = time2;
515 m_chanQua[hash1] = tile_cell->qual1();
516 m_chanQua[hash2] = tile_cell->qual2();
517
518 float ene = tile_cell->energy();
519 bool eneOk = false;
520 if (ene < m_minEneCell) {
521 eneOk = m_bitEneCell[0];
522 } else if (ene > m_maxEneCell) {
523 eneOk = m_bitEneCell[2];
524 } else {
525 eneOk = m_bitEneCell[1];
526 }
527
528 if (eneOk) {
529 if (bad1 && bad2) {
530 if (m_bitEneCell[3]) eneOk = false; // request good cells only, but cell is bad
531 } else {
532 if (m_bitEneCell[4]) eneOk = false; // request bad cells only, but cell is good
533 }
534 }
535
536 float time = tile_cell->time();
537 bool timeOk = false;
538 if (time < m_minTimeCell) {
539 timeOk = m_bitTimeCell[0];
540 } else if (time > m_maxTimeCell ) {
541 timeOk = m_bitTimeCell[2];
542 } else {
543 timeOk = m_bitTimeCell[1];
544 }
545
546 if (timeOk) {
547 if (time != 0.) {
548 if (m_bitTimeCell[4]) timeOk = false; // request time==0 only, but time!=0
549 } else {
550 if (m_bitTimeCell[3]) timeOk = false; // request time!=0 only, but time==0
551 }
552 }
553
554 if (timeOk && eneOk) {
555
556 ATH_MSG_VERBOSE( evtnum.str()
557 << " cell " << std::left << std::setw(14) << m_tileID->to_string(id,-2)
558 << " ene = " << ene << " time = " << time);
559
560 m_chanSel[hash1] = true;
561 m_chanSel[hash2] = true;
562
563 if (ene < emin) {
564 emin = ene;
565 cellmin = tile_cell;
566 } else if (ene > emax) {
567 emax = ene;
568 cellmax = tile_cell;
569 }
570
571 if (time<tmin) {
572 tmin = time;
573 tcellmin = tile_cell;
574 }
575 else if (time>tmax) {
576 tmax = time;
577 tcellmax = tile_cell;
578 }
579 }
580
581 if ( !(bad1 && bad2) ) {
582
583 bool ene1Ok = false;
584 bool time1Ok = false;
585
586 if ( !(bad1 || m_skipGain[tile_cell->gain1()]) ) {
587 if (time1 < m_minTimeChan[ch_type] ) {
588 time1Ok = m_bitTimeChan[ch_type][0];
589 } else if (time1 > m_maxTimeChan[ch_type] ) {
590 time1Ok = m_bitTimeChan[ch_type][2];
591 } else {
592 time1Ok = m_bitTimeChan[ch_type][1];
593 }
594
595 if (ene1 < m_minEneChan[ch_type] ) {
596 ene1Ok = m_bitEneChan[ch_type][0];
597 } else if (ene1 > m_maxEneChan[ch_type] ) {
598 ene1Ok = m_bitEneChan[ch_type][2];
599 } else {
600 ene1Ok = m_bitEneChan[ch_type][1];
601 }
602
603 if (ene1Ok) {
604 if (m_bitEneChan[ch_type][4]) ene1Ok = false; // request bad chan only, but chan is good
605 }
606
607 if (time1Ok) {
608 if (time1 != 0.) {
609 if (m_bitTimeChan[ch_type][4]) time1Ok = false; // request time==0 only, but time!=0
610 } else {
611 if (m_bitTimeChan[ch_type][3]) time1Ok = false; // request time!=0 only, but time==0
612 }
613 }
614 }
615
616 bool ene2Ok = false;
617 bool time2Ok = false;
618
619 if ( !(bad2 || m_skipGain[tile_cell->gain2()]) ) {
620 if (ene2 < m_minEneChan[ch_type] ) {
621 ene2Ok = m_bitEneChan[ch_type][0];
622 } else if (ene2 > m_maxEneChan[ch_type] ) {
623 ene2Ok = m_bitEneChan[ch_type][2];
624 } else {
625 ene2Ok = m_bitEneChan[ch_type][1];
626 }
627
628 if (time2 < m_minTimeChan[ch_type] ) {
629 time2Ok = m_bitTimeChan[ch_type][0];
630 } else if (time2 > m_maxTimeChan[ch_type] ) {
631 time2Ok = m_bitTimeChan[ch_type][2];
632 } else {
633 time2Ok = m_bitTimeChan[ch_type][1];
634 }
635
636 if (ene2Ok) {
637 if (m_bitEneChan[ch_type][4]) ene2Ok = false; // request bad chan only, but chan is good
638 }
639
640 if (time2Ok) {
641 if (time2 != 0.) {
642 if (m_bitTimeChan[ch_type][4]) time2Ok = false; // request time==0 only, but time!=0
643 } else {
644 if (m_bitTimeChan[ch_type][3]) time2Ok = false; // request time!=0 only, but time==0
645 }
646 }
647 }
648
649 bool over1=false;
650 bool over2=false;
651 if (checkOver) {
652 over1 = ( (!bad1) && (tile_cell->qbit1() & TileCell::MASK_OVER) && tile_cell->gain1()==TileID::LOWGAIN);
653 over2 = ( (!bad2) && (tile_cell->qbit2() & TileCell::MASK_OVER) && tile_cell->gain2()==TileID::LOWGAIN);
654 }
655
656 if ((ene1Ok && time1Ok) || over1) {
657
658 ATH_MSG_VERBOSE( evtnum.str()
659 << " cell " << std::left << std::setw(14) << m_tileID->to_string(id,-2)
660 << " ch_ene1 = " << ene1 << " ch_t1 = " << time1
661 << ((over1)?" overflow":""));
662
663 m_chanSel[hash1] = true;
664 m_chanSel[hash2] = true;
665
666 if (ene1 < chmin) {
667 chmin = ene1;
668 cellminCh = tile_cell;
669 } else if (ene1 > chmax) {
670 chmax = ene1;
671 cellmaxCh = tile_cell;
672 }
673
674 if (time1 < tcmin) {
675 tcmin = time1;
676 tcellminCh = tile_cell;
677 } else if (time1 > tcmax) {
678 tcmax = time1;
679 tcellmaxCh = tile_cell;
680 }
681 }
682
683 if ((ene2Ok && time2Ok) || over2) {
684
685 ATH_MSG_VERBOSE( evtnum.str()
686 << " cell " << std::left << std::setw(14) << m_tileID->to_string(id,-2)
687 << " ch_ene2 = " << ene2 << " ch_t2 = " << time2
688 << ((over2)?" overflow":""));
689
690 m_chanSel[hash1] = true;
691 m_chanSel[hash2] = true;
692
693 if (ene2 < chmin) {
694 chmin = ene2;
695 cellminCh = tile_cell;
696 } else if (ene2 > chmax) {
697 chmax = ene2;
698 cellmaxCh = tile_cell;
699 }
700
701 if (time2 < tcmin) {
702 tcmin = time2;
703 tcellminCh = tile_cell;
704 } else if (time2 > tcmax) {
705 tcmax = time2;
706 tcellmaxCh = tile_cell;
707 }
708 }
709
710 }
711 }
712 }
713
714 if (tcellmin && tcellmin != cellmin && tcellmin != cellmax) {
715 ATH_MSG_DEBUG( nevtnum.str()
716 << " cell " << std::left << std::setw(14) << m_tileID->to_string(tcellmin->ID(),-2)
717 << " ene = " << tcellmin->energy()
718 << " tmin = " << tcellmin->time());
719 }
720 if (tcellmax && tcellmax != cellmin && tcellmax != cellmax) {
721 ATH_MSG_DEBUG( nevtnum.str()
722 << " cell " << std::left << std::setw(14) << m_tileID->to_string(tcellmax->ID(),-2)
723 << " ene = " << tcellmax->energy()
724 << " tmax = " << tcellmax->energy());
725 }
726
727 if (tcellminCh && tcellminCh != cellminCh && tcellminCh != cellmaxCh) {
728 ATH_MSG_DEBUG( nevtnum.str()
729 << " cell " << std::left << std::setw(14) << m_tileID->to_string(tcellminCh->ID(),-2)
730 << " ch_ene = " << tcellminCh->ene1() << " " << tcellminCh->ene2()
731 << " ch_tmin = " << tcellminCh->time1() << " " << tcellminCh->time2());
732 }
733 if (tcellmaxCh && tcellmaxCh != cellminCh && tcellmaxCh != cellmaxCh) {
734 ATH_MSG_DEBUG( nevtnum.str()
735 << " cell " << std::left << std::setw(14) << m_tileID->to_string(tcellmaxCh->ID(),-2)
736 << " ch_ene = " << tcellmaxCh->ene1() << " " << tcellmaxCh->ene2()
737 << " ch_tmax = " << tcellmaxCh->time1() << " " << tcellmaxCh->time2());
738 }
739
740 if (cellmin) {
741 ++m_minCell;
742 statusOk = true;
743 const char * tit = (tcellmin == cellmin) ? " tmin = ": ((tcellmax == cellmin) ? " tmax = ": " t = ");
744 if (cellminCh!=cellmin) {
745 ATH_MSG_DEBUG( nevtnum.str()
746 << " cell " << std::left << std::setw(14) << m_tileID->to_string(cellmin->ID(),-2)
747 << " emin = " << emin
748 << tit << cellmin->time()
749 << " accepted");
750
751 } else {
752 ATH_MSG_DEBUG( nevtnum.str()
753 << " cell " << std::left << std::setw(14) << m_tileID->to_string(cellmin->ID(),-2)
754 << " emin = " << emin
755 << " ch_emin = " << chmin
756 << tit << cellmin->time()
757 << " accepted");
758 }
759 }
760
761 if (cellminCh) {
762 ++m_minChan;
763 statusOk = true;
764 const char * tit = (tcellminCh == cellminCh) ? " tmin = ": ((tcellmaxCh == cellminCh) ? " tmax = ": " t = ");
765 if (cellminCh!=cellmin) {
766 ATH_MSG_DEBUG( nevtnum.str()
767 << " cell " << std::left << std::setw(14) << m_tileID->to_string(cellminCh->ID(),-2)
768 << " ch_emin = " << chmin
769 << tit << cellminCh->time()
770 << " accepted");
771 }
772 }
773
774 if (cellmax) {
775 ++m_maxCell;
776 statusOk = true;
777 const char * tit = (tcellmin == cellmax) ? " tmin = ": ((tcellmax == cellmax) ? " tmax = ": " t = ");
778 if (cellmaxCh!=cellmax) {
779 ATH_MSG_DEBUG( nevtnum.str()
780 << " cell " << std::left << std::setw(14) << m_tileID->to_string(cellmax->ID(),-2)
781 << " emax = " << emax
782 << tit << cellmax->time()
783 << " accepted");
784
785 } else {
786 ATH_MSG_DEBUG( nevtnum.str()
787 << " cell " << std::left << std::setw(14) << m_tileID->to_string(cellmax->ID(),-2)
788 << " emax = " << emax
789 << " ch_emax = " << chmax
790 << tit << cellmax->time()
791 << " accepted");
792 }
793 }
794
795 if (cellmaxCh) {
796 ++m_maxChan;
797 statusOk = true;
798 const char * tit = (tcellminCh == cellmaxCh) ? " tmin = ": ((tcellmaxCh == cellmaxCh) ? " tmax = ": " t = ");
799 if (cellmaxCh!=cellmax) {
800 ATH_MSG_DEBUG( nevtnum.str()
801 << " cell " << std::left << std::setw(14) << m_tileID->to_string(cellmaxCh->ID(),-2)
802 << " ch_emax = " << chmax
803 << tit << cellmaxCh->time()
804 << " accepted");
805 }
806 }
807
808 emptyBad = false;
809 badFromCell = true;
810 }
811 }
812
813 const TileDQstatus* DQstatus(0);
814
815 if (m_readRawChannels) {
816
817 // Get Tile RawChannel container
818 SG::ReadHandle<TileRawChannelContainer> rawChannelContainer(m_rawChannelContainerKey, ctx);
819
820 if ( !rawChannelContainer.isValid() ) {
821 ATH_MSG_WARNING("Unable to read TileRawChannelContainer from EventStore, disable reading of this container");
822 m_readRawChannels = false;
823
824 } else {
825
826 float chmin = 0; // m_minEneChan[0];
827 float chmax = 0; // m_maxEneChan[0];
828 float tcmin = 0.;
829 float tcmax = 0.;
830 const TileRawChannel* minCh = 0;
831 const TileRawChannel* maxCh = 0;
832 const TileRawChannel* tminCh = 0;
833 const TileRawChannel* tmaxCh = 0;
834 TileRawChannelUnit::UNIT rChUnit = rawChannelContainer->get_unit();
835 bool allowAmpCheck = ( ( rChUnit == TileRawChannelUnit::MegaElectronVolts || // allow MeV only as units
837 bool fillChanEne = ( !m_readCells && allowAmpCheck ); // use amplitude from channel if cell container was not checked
838 if (!fillChanEne) {
839 m_chanDsp.clear();
841 m_chanTDsp.clear();
843 }
844
846 DQstatus = SG::makeHandle (m_dqStatusKey, ctx).get();
847 else
848 rawdata = 0;
849
850 IdContext chan_context = m_tileHWID->channel_context();
851 IdentifierHash hash;
852 int index=0, pmt;
853
854 int nbadMax = 0;
855 int nbadMBMax = 0;
856 const TileRawChannelCollection * collMax = 0;
857 const TileRawChannelCollection * collMBMax = 0;
858
859 bool someDQerrors = false;
860
861 for (const TileRawChannelCollection* rawChannelCollection : *rawChannelContainer) {
862
863 int frag = rawChannelCollection->identify();
864 bool eb = (frag > 0x2ff);
865 bool ebsp = (frag == 0x30e || frag == 0x411);
866
867 int ros = frag >> 8;
868 int drawer = frag & 0x3F;
869 unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros,drawer);
870 if ( m_drawerToSkip[drawerIdx] ) continue;
871
872 int chMBTS = -1;
873 if (eb) {
874 for (int ch: {12,4,0}) {
875 m_cabling->h2s_cell_id_index(ros,drawer,ch,index,pmt);
876 if (index == -2) {
877 chMBTS = ch;
878 break;
879 }
880 }
881 }
882
883 HWIdentifier ch_id = m_tileHWID->channel_id(ros,drawer,0);
884 m_tileHWID->get_hash(ch_id, hash, &chan_context);
885 int hashNext = index = (int)hash + 48; // hash ID of the channel after current drawer
886
887 // all error words contains information in last 16 bits only
888 // but they are stored in collection as 32 bit numbers
889 uint32_t RODBCID = rawChannelCollection->getRODBCID();
890 uint32_t DSPBCID = rawChannelCollection->getFragDSPBCID();
891 uint32_t GlobalCRCErr = rawChannelCollection->getFragGlobalCRC() & 0x1;
892 uint32_t FE_DMUmask = rawChannelCollection->getFragFEChipMask();
893 uint32_t ROD_DMUmask = rawChannelCollection->getFragRODChipMask();
894 uint32_t BCIDErr = rawChannelCollection->getFragBCID();
895 uint32_t MemoryParityErr = rawChannelCollection->getFragMemoryPar();
896 uint32_t HeaderFormatErr = rawChannelCollection->getFragHeaderBit();
897 uint32_t HeaderParityErr = rawChannelCollection->getFragHeaderPar();
898 uint32_t SampleFormatErr = rawChannelCollection->getFragSampleBit();
899 uint32_t SampleParityErr = rawChannelCollection->getFragSamplePar();
900 uint32_t SingleStrobeErr = rawChannelCollection->getFragSstrobe();
901 uint32_t DoubleStrobeErr = rawChannelCollection->getFragDstrobe();
902
903 if (RODBCID!=0 && RODBCID != m_evtBCID ) {
904 if (m_nDrawerOff[drawerIdx] < m_maxVerboseCnt) {
905 ATH_MSG_VERBOSE( evtnum.str()
906 << " drw " << drwname(rawChannelCollection->identify())
907 << " ROD BCID " << RODBCID << " is wrong - skipping");
908
909 if (++m_nDrawerOff[drawerIdx] == m_maxVerboseCnt)
910 ATH_MSG_VERBOSE( nevtnum.str()
911 << " suppressing further messages about drawer 0x" << std::hex << rawChannelCollection->identify()
912 << std::dec << " being bad");
913 }
914 someDQerrors = true;
915 continue;
916 }
917
918 if (DSPBCID >= 0x7FFF
919 && GlobalCRCErr
920 && FE_DMUmask == 0xFFFF
921 && ROD_DMUmask == 0xFFFF
922 && BCIDErr == 0xFFFF
923 && MemoryParityErr == 0xFFFF
924 && HeaderFormatErr == 0xFFFF
925 && HeaderParityErr == 0xFFFF
926 && SampleFormatErr == 0xFFFF
927 && SampleParityErr == 0xFFFF
928 && SingleStrobeErr == 0xFFFF
929 && DoubleStrobeErr == 0xFFFF) {
930
931 if (m_nDrawerOff[drawerIdx] < m_maxVerboseCnt) {
932 ATH_MSG_VERBOSE( evtnum.str()
933 << " drw " << drwname(rawChannelCollection->identify())
934 << " is OFF - skipping");
935
936 if (++m_nDrawerOff[drawerIdx] == m_maxVerboseCnt)
937 ATH_MSG_VERBOSE( nevtnum.str()
938 << " suppressing further messages about drawer 0x" << std::hex
939 << rawChannelCollection->identify()
940 << std::dec << " being bad");
941 }
942 continue;
943 }
944
945 if (DSPBCID == 0
946 && GlobalCRCErr == 0
947 && FE_DMUmask == 0
948 && ROD_DMUmask == 0
949 && BCIDErr == 0
950 && MemoryParityErr == 0
951 && HeaderFormatErr == 0
952 && HeaderParityErr == 0
953 && SampleFormatErr == 0
954 && SampleParityErr == 0
955 && SingleStrobeErr == 0
956 && DoubleStrobeErr == 0) {
957
958 if (m_nDrawerOff[drawerIdx] < m_maxVerboseCnt) {
959 ATH_MSG_VERBOSE( evtnum.str()
960 << " drw " << drwname(rawChannelCollection->identify())
961 << " is MISSING - skipping");
962
963 if (++m_nDrawerOff[drawerIdx] == m_maxVerboseCnt)
964 ATH_MSG_VERBOSE( nevtnum.str()
965 << " suppressing further messages about drawer 0x" << std::hex
966 << rawChannelCollection->identify() << std::dec << " being bad");
967 }
968 continue;
969 }
970
971 if (GlobalCRCErr) {
972 GlobalCRCErr = 0xFFFF; // global error - all wrong
973 if (m_maxBadDMU<16) {
974 if (m_nDrawerOff[drawerIdx] < m_maxVerboseCnt) {
975 ATH_MSG_VERBOSE( evtnum.str()
976 << " drw " << drwname(rawChannelCollection->identify())
977 << " global CRC error - skipping");
978
979 if (++m_nDrawerOff[drawerIdx] == m_maxVerboseCnt)
980 ATH_MSG_VERBOSE( nevtnum.str()
981 << " suppressing further messages about drawer 0x" << std::hex
982 << rawChannelCollection->identify() << std::dec << " being bad");
983 }
984 someDQerrors = true;
985 continue;
986 }
987 }
988
989 if (HeaderFormatErr || HeaderParityErr || SampleFormatErr || SampleParityErr ) {
990 FE_DMUmask = 0xFFFF; // can not trust FE mask, assume that all DMUs are good
991 } else {
992 if (eb) { // extended barrel
993 if (ebsp) FE_DMUmask<<=1; // shift by one DMU in EBA15 EBC18
994 FE_DMUmask = (FE_DMUmask & 0xFF) | ((FE_DMUmask & 0xF00)<<2); // shift upper half by two DMUs
995 }
996 }
997
998 FE_DMUmask = ~FE_DMUmask & 0xFFFF; // inversion for FE CRC
999 ROD_DMUmask = ~ROD_DMUmask & 0xFFFF; // inversion for ROD CRC
1000
1001 if (BCIDErr & 0x2) { // DMU1 (second DMU) is bad - can not trust others
1002 BCIDErr = 0xFFFF; // assume that all DMUs are bad
1003 if (m_maxBadDMU < 16) {
1004 if (m_nDrawerOff[drawerIdx] < m_maxVerboseCnt) {
1005 ATH_MSG_VERBOSE( evtnum.str()
1006 << " drw " << drwname(rawChannelCollection->identify())
1007 << " BCID in DMU1 is bad - skipping");
1008
1009 if (++m_nDrawerOff[drawerIdx] == m_maxVerboseCnt)
1010 ATH_MSG_VERBOSE( nevtnum.str()
1011 << " suppressing further messages about drawer 0x"
1012 << std::hex << rawChannelCollection->identify() << std::dec << " being bad");
1013 }
1014 someDQerrors = true;
1015 continue;
1016 }
1017
1018 } else {
1019 // additional check if DQ frag BCID is the same as event BCID
1020 if ( DSPBCID!=0xDEAD && DSPBCID!=m_evtBCID ) { // DSP BCID doesn't match! all wrong
1021 BCIDErr = 0xFFFF;
1022 if (m_maxBadDMU < 16) {
1023 if (m_nDrawerOff[drawerIdx] < m_maxVerboseCnt) {
1024 ATH_MSG_VERBOSE( evtnum.str()
1025 << " drw " << drwname(rawChannelCollection->identify())
1026 << " DSP BCID is wrong - skipping");
1027
1028 if (++m_nDrawerOff[drawerIdx] == m_maxVerboseCnt)
1029 ATH_MSG_VERBOSE( nevtnum.str()
1030 << " suppressing further messages about drawer 0x"
1031 << std::hex << rawChannelCollection->identify() << std::dec << " being bad");
1032 }
1033 someDQerrors = true;
1034 continue;
1035 }
1036 }
1037 }
1038
1039 uint32_t error = GlobalCRCErr | FE_DMUmask | ROD_DMUmask | BCIDErr | MemoryParityErr |
1040 HeaderFormatErr | HeaderParityErr | SampleFormatErr | SampleParityErr;
1041
1042 if (error==0xFFFF && m_maxBadDMU<16) {
1043 if (m_nDrawerOff[drawerIdx] < m_maxVerboseCnt) {
1044 ATH_MSG_VERBOSE( evtnum.str()
1045 << " drw " << drwname(rawChannelCollection->identify())
1046 << " whole drawer is bad - skipping");
1047
1048 if (++m_nDrawerOff[drawerIdx] == m_maxVerboseCnt)
1049 ATH_MSG_VERBOSE( nevtnum.str()
1050 << " suppressing further messages about drawer 0x"
1051 << std::hex << rawChannelCollection->identify() << std::dec << " being bad");
1052 }
1053 someDQerrors = true;
1054 continue;
1055 }
1056
1057 // no global error detected - wait m_max_verbose_cnt good events and eventually enable error messages again
1058 if (m_nDrawerOff[drawerIdx]>=m_maxVerboseCnt) {
1059 if (++m_nDrawerOff[drawerIdx] == 2*m_maxVerboseCnt) {
1060 m_nDrawerOff[drawerIdx] = 0;
1061 ATH_MSG_VERBOSE( nevtnum.str()
1062 << " enabling messages about drawer 0x" << std::hex
1063 << rawChannelCollection->identify()
1064 << std::dec << " being bad after " << m_maxVerboseCnt.value() << " good events");
1065 }
1066 }
1067
1068 uint32_t errMB = BCIDErr;
1069 if (eb) { // do not count non-existing DMUs in EB
1070 if (ebsp) {
1071 errMB &= 0x3cfe;
1072 } else {
1073 errMB &= 0x3cff;
1074 }
1075 }
1076 int nbadMB = 0;
1077 while (errMB) {
1078 if (errMB & 0xF) ++nbadMB;
1079 errMB >>= 4;
1080 }
1081 someDQerrors = (nbadMB >= m_minBadMB);
1082 if (nbadMB > nbadMBMax) {
1083 nbadMBMax = nbadMB;
1084 collMBMax = rawChannelCollection;
1085 }
1086
1087 int nerr = 0;
1088 for (uint32_t i = 0x8000; i != 0; i >>= 1) {
1089 if (error&i) {
1090 ++nerr;
1091 index-=3;
1092 } else {
1093 if (emptyBad && nbadMB < 4) {
1094 m_chanBad[--index] = false;
1095 m_chanBad[--index] = false;
1096 m_chanBad[--index] = false;
1097 } else {
1098 index -= 3;
1099 }
1100 }
1101 }
1102 //if (chMBTS>=0) m_chanBad[index+chMBTS] = true; // ignore completely MBTS channel
1103 int nbad = ((ebsp) ? nerr-5 : ((eb) ? nerr-4 : nerr));
1104
1105 if (nbad >= m_minBadDMU && nerr <= m_maxBadDMU) {
1106 someDQerrors = true;
1107 if (nbad > nbadMax) {
1108 nbadMax = nbad;
1109 collMax = rawChannelCollection;
1110 }
1111 }
1112 if (someDQerrors) { // will print later samples for all channels in a drawer
1113 for ( ; index<hashNext; ++index) { // but if drawer was completely bad, this loop will be skipped
1114 m_chanSel[index] = true;
1115 }
1116 }
1117
1118 if (allowAmpCheck || emptyBad) {
1119
1120 for (const TileRawChannel* rawChannel : *rawChannelCollection) {
1121
1122 HWIdentifier adcId = rawChannel->adc_HWID();
1123 HWIdentifier chId = m_tileHWID->channel_id(adcId);
1124 m_tileHWID->get_hash(chId, hash, &chan_context);
1125 if ( m_chanToSkip[hash] ) continue;
1126 int adc = m_tileHWID->adc(adcId);
1127 int channel = m_tileHWID->channel(adcId);
1128 int ch_type = 0;
1129 if (channel == chMBTS) {
1130 ch_type = 2;
1131 } else if ( (ebsp && (channel == 18 || channel == 19 || channel == 12 || channel == 13) )
1132 || (eb && (channel == 0 || channel == 1 || channel == 12 || channel == 13) ) ) {
1133 ch_type = 1;
1134 }
1135 if (emptyBad && !m_chanBad[hash] ) {
1136 m_chanBad[hash] = m_tileBadChanTool->getAdcStatus(drawerIdx,channel,adc,ctx).isBad() ||
1137 (DQstatus && !DQstatus->isAdcDQgood(ros,drawer,channel,adc)) ||
1138 (m_checkDCS && m_tileDCS->getDCSStatus(ros, drawer, channel) > TileDCSState::WARNING);
1139 }
1140
1141 if (allowAmpCheck) {
1142
1143 float amp = rawChannel->amplitude();
1144 float time = rawChannel->time();
1145 if (fillChanEne) {
1146 m_chanEne[hash] = amp;
1147 m_chanTime[hash] = time;
1148 m_chanQua[hash] = rawChannel->quality();
1149 } else {
1150 m_chanDsp[hash] = amp;
1151 m_chanTDsp[hash] = time;
1152 }
1153
1154 if ( (m_skipMasked && m_chanBad[hash]) ||
1155 (m_skipMBTS && channel == chMBTS) ||
1156 (m_skipEmpty && TileDQstatus::isChEmpty(ros, drawer, channel) > 0) ||
1157 m_skipGain[adc] )
1158 continue;
1159
1160 bool ampOk = false;
1161 if (amp < m_minEneChan[ch_type] ) {
1162 ampOk = m_bitEneChan[ch_type][0];
1163 } else if (amp > m_maxEneChan[ch_type] ) {
1164 ampOk = m_bitEneChan[ch_type][2];
1165 } else {
1166 ampOk = m_bitEneChan[ch_type][1];
1167 }
1168
1169 bool timeOk = false;
1170 if (time < m_minTimeChan[ch_type] ) {
1171 timeOk = m_bitTimeChan[ch_type][0];
1172 } else if (time > m_maxTimeChan[ch_type] ) {
1173 timeOk = m_bitTimeChan[ch_type][2];
1174 } else {
1175 timeOk = m_bitTimeChan[ch_type][1];
1176 }
1177
1178 if (ampOk && timeOk) {
1179
1180 ATH_MSG_VERBOSE(evtnum.str()
1181 << " chan " << std::left << std::setw(14) << m_tileHWID->to_string(adcId)
1182 << " ch_ene = " << amp << " ch_t = " << time);
1183
1184 m_chanSel[hash] = true;
1185
1186 if (amp < chmin) {
1187 chmin = amp;
1188 minCh = rawChannel;
1189 } else if (amp > chmax) {
1190 chmax = amp;
1191 maxCh = rawChannel;
1192 }
1193
1194 if (time<tcmin) {
1195 tcmin = time;
1196 tminCh = rawChannel;
1197 }
1198 else if (time>tcmax) {
1199 tcmax = time;
1200 tmaxCh = rawChannel;
1201 }
1202 }
1203 }
1204 }
1205 }
1206
1207 for (index = hashNext - 48; index < hashNext; ++index) {
1208 if ((m_chanSel[index] && rawdata) || someDQerrors) {
1209 ATH_MSG_VERBOSE(evtnum.str()
1210 << " drw " << drwname(rawChannelCollection->identify())
1211 << " nBadMB = " << nbadMB
1212 << " nBadDMU = " << nbad
1213 << " EvtBCID = " << m_evtBCID
1214 << " DSPBCID = " << rawChannelCollection->getFragDSPBCID()
1215 << " GlobCRC = " << rawChannelCollection->getFragGlobalCRC() << " " << GlobalCRCErr
1216 << " error = 0x" << std::hex << error
1217 << " FE_CRC = 0x" << rawChannelCollection->getFragFEChipMask() << " 0x" << FE_DMUmask
1218 << " ROD_CRC = 0x" << rawChannelCollection->getFragRODChipMask() << " 0x" << ROD_DMUmask
1219 << " BCIDErr = 0x" << rawChannelCollection->getFragBCID() << " 0x" << BCIDErr
1220 << " MemPar = 0x" << rawChannelCollection->getFragMemoryPar()
1221 << " HeadForm = 0x"<< rawChannelCollection->getFragHeaderBit()
1222 << " HeadPar = 0x" << rawChannelCollection->getFragHeaderPar()
1223 << " SampForm = 0x"<< rawChannelCollection->getFragSampleBit()
1224 << " SampPar = 0x" << rawChannelCollection->getFragSamplePar()
1225 << std::dec);
1226 break;
1227 }
1228 }
1229 }
1230
1231 if (nbadMBMax >= m_minBadMB) {
1232 ++m_dqerr;
1233 statusOk = true;
1234 ATH_MSG_DEBUG( nevtnum.str()
1235 << " drw " << drwname((collMBMax) ? collMBMax->identify() : 0)
1236 << " nBadMB = " << nbadMBMax
1237 << " accepted");
1238
1239 } else if (nbadMax >= m_minBadDMU && nbadMax <= m_maxBadDMU) {
1240 ++m_dqerr;
1241 statusOk = true;
1242 ATH_MSG_DEBUG( nevtnum.str()
1243 << " drw " << drwname((collMax)?collMax->identify():0)
1244 << " nBadDMU = " << nbadMax
1245 << " accepted");
1246 }
1247
1248 if (tminCh && tminCh != minCh && tminCh != maxCh) {
1249 ATH_MSG_DEBUG(nevtnum.str()
1250 << " chan " << std::left << std::setw(14) << m_tileHWID->to_string(tminCh->adc_HWID())
1251 << " ch_e = " << tminCh->amplitude()
1252 << " tmin =" << tminCh->time());
1253 }
1254
1255 if (tmaxCh && tmaxCh != minCh && tmaxCh != maxCh) {
1256 ATH_MSG_DEBUG(nevtnum.str()
1257 << " chan " << std::left << std::setw(14) << m_tileHWID->to_string(tmaxCh->adc_HWID())
1258 << " ch_e = " << tmaxCh->amplitude()
1259 << " tmax = " << tmaxCh->time());
1260 }
1261
1262 if (minCh) {
1263 if (!cellminCh) ++m_minChan;
1264 statusOk = true;
1265 const char * tit = (tminCh == minCh) ? " tmin = ": ((tmaxCh == minCh) ? " tmax = ": " t = ");
1266 ATH_MSG_DEBUG(nevtnum.str()
1267 << " chan " << std::left << std::setw(14) << m_tileHWID->to_string(minCh->adc_HWID())
1268 << " ch_emin = " << chmin
1269 << tit << minCh->time()
1270 << " accepted");
1271 }
1272 if (maxCh) {
1273 if (!cellmaxCh) ++m_maxChan;
1274 statusOk = true;
1275 const char * tit = (tminCh == maxCh) ? " tmin = ": ((tmaxCh == maxCh) ? " tmax = ": " t = ");
1276 ATH_MSG_DEBUG(nevtnum.str()
1277 << " chan " << std::left << std::setw(14) << m_tileHWID->to_string(maxCh->adc_HWID())
1278 << " ch_emax = " << chmax
1279 << tit << maxCh->time()
1280 << " accepted");
1281 }
1282 emptyBad = false;
1283 }
1284 }
1285
1286
1287 if (m_readDigits) {
1288
1289 // Pointer to a Tile digits container
1290 SG::ReadHandle<TileDigitsContainer> digitsContainer(m_digitsContainerKey, ctx);
1291
1292 if (!digitsContainer.isValid()) {
1293 ATH_MSG_WARNING("Unable to read TileDigitsContainer from EventStore, disable reading of this container");
1294 m_readDigits = false;
1295
1296 } else {
1297
1298 IdContext chan_context = m_tileHWID->channel_context();
1299 IdentifierHash hash;
1300 int index,pmt;
1301 int nConst = 0;
1302 int nJump = 0;
1303 int nDmuErr = 0;
1304 int nOverLG = 0;
1305 int nOverHG = 0;
1306 int nUnderLG = 0;
1307 int nUnderHG = 0;
1308
1309 for (const TileDigitsCollection * digitsCollection : *digitsContainer) {
1310
1311 int frag = digitsCollection->identify();
1312 bool eb = (frag > 0x2ff);
1313 bool ebsp = (frag == 0x30e || frag == 0x411);
1314
1315 int ros = frag >> 8;
1316 int drawer = frag & 0x3F;
1317 unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros,drawer);
1318 if ( m_drawerToSkip[drawerIdx] ) continue;
1319
1320 int chMBTS = -1;
1321 if (eb) {
1322 for (int ch: {12,4,0}) {
1323 m_cabling->h2s_cell_id_index(ros,drawer,ch,index,pmt);
1324 if (index == -2) {
1325 chMBTS = ch;
1326 break;
1327 }
1328 }
1329 }
1330
1331 int nChBadDB = 0;
1332 int nChBadNC = 0;
1333 int nChBad = 0;
1334 int nChTot = 0;
1335 int nChDmu[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
1336 int nChBadDmu[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
1337
1338 for (const TileDigits* tile_digits : *digitsCollection) {
1339
1340 ++nChTot;
1341
1342 HWIdentifier adcId = tile_digits->adc_HWID();
1343 HWIdentifier chId = m_tileHWID->channel_id(adcId);
1344 m_tileHWID->get_hash(chId, hash, &chan_context);
1345 if ( m_chanToSkip[hash] ) continue;
1346 int channel = m_tileHWID->channel(adcId);
1347 int dmu = channel/3;
1348 ++nChDmu[dmu];
1349 int chEmpty = TileDQstatus::isChEmpty(ros, drawer, channel);
1350 bool isConnected = (chEmpty < 2);
1351 if (!isConnected) ++nChBadNC;
1352 int adc = m_tileHWID->adc(adcId);
1353 const char *cellname = "";
1354 int ch_type = 0;
1355 if (channel == chMBTS) {
1356 cellname = " MBTS";
1357 ch_type = 2;
1358 } else if ( (ebsp && (channel == 18 || channel == 19 || channel == 12 || channel == 13) )
1359 || (eb && (channel == 0 || channel == 1 || channel == 12 || channel == 13) ) ) {
1360 cellname = " GAP";
1361 ch_type = 1;
1362 } else if (chEmpty > 0) {
1363 cellname = " EMPTY";
1364 }
1365
1366 const char *badname = "";
1367 if (DQstatus && !DQstatus->isAdcDQgood(ros,drawer,channel,adc)) {
1368 badname = " BADDQ";
1369 if (isConnected) {
1370 ++nChBad;
1371 ++nChBadDmu[dmu];
1372 }
1373 } else if (m_checkDCS && m_tileDCS->getDCSStatus(ros, drawer, channel) > TileDCSState::WARNING) {
1374 badname = " BADDCS";
1375 } else if (m_tileBadChanTool->getAdcStatus(drawerIdx,channel,adc,ctx).isBad()) {
1376 badname = " BADDB";
1377 if (isConnected) {
1378 ++nChBadDB;
1379 }
1380 } else if (m_chanBad[hash]) {
1381 if (badFromCell) {
1382 if (ch_type != 2) badname = " BADQUAL";
1383 m_chanQua[hash] = 999;
1384 if (isConnected && ch_type!=2) {
1385 ++nChBad;
1386 ++nChBadDmu[dmu];
1387 }
1388 } else {
1389 badname = " BADUNKN"; // should never see this
1390 }
1391 } else if (badFromCell && m_chanEne[hash] == 0.0) {
1392 badname = " BADDIGI"; // temporary fix, (for May-2012 ESD), should never get this
1393 if (isConnected) {
1394 ++nChBad;
1395 ++nChBadDmu[dmu];
1396 }
1397 }
1398 const char *enename = " ene = ";
1399 const char *timename = " time = ";
1400 const char *qualname = " qual = ";
1401 if (badFromCell && badname[0] != 0) {
1402 enename = " BAD = ";
1403 if (m_chanDsp.size()) {
1404 qualname = " eDSP = ";
1406 }
1407 if (m_chanTDsp.size()) {
1408 timename = " tDSP = ";
1410 }
1411 }
1412
1413 char badnm[30];
1414 sprintf(badnm," BADDIGIEX%s",badname);
1415 float dmin,dmax;
1416
1417 std::vector<float> samples = tile_digits->samples();
1418 int nSamp = samples.size();
1419 if (nSamp > 6) {
1420
1421 bool useCh= !( (m_skipMBTS && channel == chMBTS) ||
1422 (m_skipEmpty && chEmpty > 0) );
1423 bool checkCh = !( (m_skipMasked && m_chanBad[hash]) ) && useCh && m_checkJumps;
1424
1425 int err = TileRawChannelBuilder::CorruptedData(ros,drawer,channel,adc,samples,dmin,dmax,m_ADCmaxMinusEps,m_ADCmaskValueMinusEps);
1426
1427 if (badname[0]==0) {
1428 if (err && err>-3) { // do not consider all zeros in empty samples as error
1429 if (isConnected || err != -2) {
1430 if (checkCh) m_chanSel[hash] = true;
1431 badname = badnm;
1432 ++nChBad;
1433 ++nChBadDmu[dmu];
1434 if (!isConnected) --nChBadNC;
1435 }
1436 if (err > 0) {
1437 if (err < 10) {
1438 badnm[9] = 48+err;
1439 } else if (err < 36) {
1440 badnm[9] = 55+err;
1441 }
1442 } else {
1443 badnm[9] = 48;
1444 }
1445 } else {
1446 // old error types, used for tests in August 2012
1447 // expect to see only warningE7 and warningE8 for gap/crack
1448 int warn = Are3FF(samples, adc, ch_type);
1449 if (warn) {
1450 if (checkCh) m_chanSel[hash] = true;
1451 sprintf(badnm," warningE%d%s",warn,badname);
1452 badname = badnm;
1453 }
1454 }
1455 }
1456
1457 if ((!err) // channel without bad patterns
1458 && (useCh) // normal connected channel
1459 && (badname[0] == 0 || badname[1] == 'w' // no digital error
1460 || (badname[4] == 'Q' && !m_skipMasked))) { // error from TileCell but it is ignored
1461
1462 if (adc) { // HG
1463
1464 if (dmax > m_overflowHG) {
1465 m_chanSel[hash] = true; // always print overflows
1466 if (m_checkOverHG){
1467 ++nOverHG;
1468 }
1469 }
1470 if (dmin < m_underflowHG) {
1471 m_chanSel[hash] = true; // always print underflows
1472 if (m_checkUnderHG){
1473 ++nUnderHG;
1474 }
1475 }
1476
1477 } else { // LG
1478
1479 if (dmax > m_overflowLG) {
1480 m_chanSel[hash] = true; // always print overflows
1481 if (m_checkOverLG){
1482 ++nOverLG;
1483 }
1484 }
1485 if (dmin < m_underflowLG) {
1486 m_chanSel[hash] = true; // always print underflows
1487 if (m_checkUnderLG){
1488 ++nUnderLG;
1489 }
1490 }
1491 }
1492 }
1493
1494 bool someSampErrors = false;
1495
1496 if (m_checkJumps && (checkCh || m_chanSel[hash])) {
1497
1498 float pedDelta = (adc ? m_pedDeltaHG : m_pedDeltaLG);
1499 float jumpDelta = (adc ? m_jumpDeltaHG : m_jumpDeltaLG);
1500
1501 float ped = samples[0];
1502 float dmin = ped;
1503 float dmax = ped;
1504 int nped = 1;
1505 int npedmax = 1;
1506 bool cnstPed = true;
1507 bool cnstPedmax = true;
1508 for (int i = 1; i < nSamp; ++i) {
1509 float smp = samples[i];
1510 float dped = smp - ped;
1511 if (fabs(dped) < pedDelta) {
1512 ++nped;
1513 if (dped != 0.0) {
1514 cnstPed = false;
1515 ped += dped/nped;
1516 }
1517 } else {
1518 if (nped>npedmax) {
1519 npedmax=nped;
1520 cnstPedmax = cnstPed;
1521 }
1522 cnstPed = true;
1523 ped = smp;
1524 nped = 1;
1525 }
1526 if (smp<dmin) {
1527 dmin = smp;
1528 } else if (smp>dmax) {
1529 dmax = smp;
1530 }
1531 }
1532 if (nped>npedmax) {
1533 npedmax=nped;
1534 cnstPedmax = cnstPed;
1535 }
1536
1537 if (dmax - dmin >= jumpDelta) {
1538 bool accEmin = (m_chanEne[hash]<m_minEneChan[ch_type]);
1539 bool accEmax = (m_chanEne[hash]>m_maxEneChan[ch_type]);
1540 bool accCnst = false;
1541 bool accJump = false;
1542 bool cnstMin = true;
1543 bool cnstMax = true;
1544 bool jumpNeg = false;
1545 bool jumpPos = false;
1546 bool jumpEnd = false;
1547 bool jumpZer = false;
1548 bool jumpOve = false;
1549 bool narrowUp = false;
1550 bool narrowDown = false;
1551 if (npedmax >= m_constLength && ((dmax-ped) >= jumpDelta || (ped-dmin) >= jumpDelta) ) {
1552 ++nConst;
1553 accCnst = true;
1554 }
1555 int nmin = 0;
1556 int nmax = 0;
1557 int pmin = -1;
1558 int pmax = -1;
1559 float abovemin = dmax;
1560 float belowmax = dmin;
1561 for (int i = 0; i < nSamp; ++i) {
1562 float smp = samples[i];
1563 if (smp - dmin < pedDelta) {
1564 ++nmin;
1565 pmin = i;
1566 if (smp != dmin) cnstMin = false;
1567 }
1568 if (dmax - smp < pedDelta) {
1569 ++nmax;
1570 pmax = i;
1571 if (smp != dmax) cnstMax = false;
1572 }
1573 if (smp < abovemin && smp > dmin) {
1574 abovemin = smp;
1575 }
1576 if (smp > belowmax && smp < dmax) {
1577 belowmax = smp;
1578 }
1579 }
1580 if (nmax + nmin == nSamp) {
1581 if (nmax > 1 && nmin > 1) {
1582 ++nJump;
1583 accJump = true;
1584 } else if (nmax == 1) {
1585 if (pmax < nSamp - 1) { // ignore jump in last sample
1586 ++nJump;
1587 accJump = true;
1588 jumpPos = true;
1589 cnstMax = false;
1590 }
1591 if (pmax == 0 || pmax == nSamp - 1) {
1592 jumpEnd = true;
1593 }
1594 } else if (nmin == 1) {
1595 ++nJump;
1596 accJump = true;
1597 jumpNeg = true;
1598 cnstMin = false;
1599 if (pmin == 0 || pmin == nSamp - 1) {
1600 jumpEnd = true;
1601 }
1602 }
1603 }
1604 if (dmin == 0.0) {
1605 if (!accJump) {
1606 ++nJump;
1607 accJump = true;
1608 cnstMin = false;
1609 cnstMax = false;
1610 }
1611 jumpZer = true;
1612 }
1613 if (dmax > m_ADCmaxMinusEps) {
1614 if (!accJump) {
1615 ++nJump;
1616 accJump = true;
1617 cnstMin = false;
1618 cnstMax = false;
1619 }
1620 jumpOve = true;
1621 }
1622 float secondMax = (dmax-dmin)*m_secondMaxLevel;
1623 if (pmax > 0 && pmax < nSamp-1 && std::max(samples[pmax-1], samples[pmax+1]) < dmin+secondMax) {
1624 if (!accJump) {
1625 ++nJump;
1626 accJump = true;
1627 cnstMax = false;
1628 if (nmin + nmax != nSamp) {
1629 cnstMin = false;
1630 }
1631 }
1632 narrowUp = true;
1633 }
1634 if (pmin > 0 && pmin < nSamp - 1 && std::min(samples[pmin - 1], samples[pmin + 1]) > dmax - secondMax) {
1635 if (!accJump) {
1636 ++nJump;
1637 accJump = true;
1638 cnstMin = false;
1639 if (nmin + nmax != nSamp) {
1640 cnstMax = false;
1641 }
1642 }
1643 narrowDown = true;
1644 }
1645
1646 if (accEmin || accEmax || accCnst || accJump) {
1647 someSampErrors = true;
1648 ATH_MSG_VERBOSE (evtnum.str()
1649 << " chan " << std::left << std::setw(14) << m_tileHWID->to_string(adcId)
1650 << enename << m_chanEne[hash] << " samp = " << samples[0]
1651 << " " << samples[1] << " " << samples[2] << " " << samples[3]
1652 << " " << samples[4] << " " << samples[5] << " " << samples[6]
1653 << timename << m_chanTime[hash]
1654 << qualname << m_chanQua[hash]
1655 << cellname << badname
1656 << ((accEmin) ? " neg_e" : "")
1657 << ((accEmax) ? " pos_e" : "")
1658 << ((accCnst) ? " const" : "")
1659 << ((accCnst&&cnstPedmax) ? "Const" : "")
1660 << ((accJump) ? " jump" : "")
1661 << ((accJump&&jumpZer) ? "Zero" : "")
1662 << ((accJump&&jumpOve) ? "Over" : "")
1663 << ((accJump&&jumpPos) ? "SingleUp" : ((narrowUp) ? "NarrowUp" : "") )
1664 << ((accJump&&jumpNeg) ? "SingleDown" : ((narrowDown) ? "NarrowDown" : "") )
1665 << ((accJump&&jumpEnd) ? "AtEdge" : "")
1666 << ((accJump&&cnstMin) ? "ConstMin" : "")
1667 << ((accJump&&cnstMax) ? "ConstMax" : "")
1668 << " " << dmax-dmin);
1669 }
1670 }
1671 }
1672
1673 if (someSampErrors) {
1674 m_chanSel[hash] = true;
1675 } else if (m_chanSel[hash]) {
1676 bool accEmin = (m_chanEne[hash] < m_minEneChan[ch_type]);
1677 bool accEmax = (m_chanEne[hash] > m_maxEneChan[ch_type]);
1678 bool jumpOve = (dmax>m_ADCmaxMinusEps);
1679 bool jumpZer = (dmin < 0.01);
1680 ATH_MSG_VERBOSE(evtnum.str()
1681 << " chan " << std::left << std::setw(14) << m_tileHWID->to_string(adcId)
1682 << enename << m_chanEne[hash] << " samp = " << samples[0]
1683 << " " << samples[1] << " " << samples[2] << " " << samples[3]
1684 << " " << samples[4] << " " << samples[5] << " " << samples[6]
1685 << timename << m_chanTime[hash]
1686 << qualname << m_chanQua[hash]
1687 << cellname << badname
1688 << ((accEmin) ? " neg_e" : "")
1689 << ((accEmax) ? " pos_e" : "")
1690 <<((jumpZer) ? " underflow" : "")
1691 <<((jumpOve) ? " overflow" : "") );
1692 }
1693
1694 }
1695 }
1696 if (m_checkDMUs && nChBad > 1 && nChBad + nChBadDB + nChBadNC < nChTot) {
1697 int nChBad1 = 0;
1698 int nChBad2 = 0;
1699 int nDmuBad1 = 0;
1700 int nDmuBad2 = 0;
1701 int nDmuBad = 0;
1702 int nDmuTot = 0;
1703 bool has23 = false;
1704 for (int dmu = 0; dmu < 16; ++dmu) {
1705 if (nChDmu[dmu] > 0) {
1706 ++nDmuTot;
1707 if (nChBadDmu[dmu] > 0) {
1708 ++nDmuBad;
1709 if (dmu < 8) {
1710 nChBad1 += nChBadDmu[dmu];
1711 ++nDmuBad1;
1712 } else {
1713 nChBad2 += nChBadDmu[dmu];
1714 ++nDmuBad2;
1715 }
1716 if (nChBadDmu[dmu] == 2 && nChDmu[dmu] == 3) has23 = true;
1717 }
1718 }
1719 }
1720 if (nDmuBad == 1 /* && (!has23) */ ) continue;
1721 if (nDmuBad == 2 && nChBad < 3) continue;
1722
1723 if (nDmuBad>2 || nChBad > 9 || nChTot > 19 || has23) {
1724
1725 ++nDmuErr;
1726
1727 for (const TileDigits* tile_digits : *digitsCollection) {
1728
1729 HWIdentifier adcId = tile_digits->adc_HWID();
1730 HWIdentifier chId = m_tileHWID->channel_id(adcId);
1731 m_tileHWID->get_hash(chId, hash, &chan_context);
1732 if ( m_chanToSkip[hash] ) continue;
1733 std::vector<float> samples = tile_digits->samples();
1734
1735 if (!m_chanSel[hash] && samples.size()>6) {
1736 int channel = m_tileHWID->channel(adcId);
1737 int adc = m_tileHWID->adc(adcId);
1738 int chEmpty = TileDQstatus::isChEmpty(ros, drawer, channel);
1739 const char *cellname = "";
1740 int ch_type = 0;
1741 if (channel == chMBTS) {
1742 cellname = " MBTS";
1743 ch_type = 2;
1744 } else if ( (ebsp && (channel == 18 || channel == 19 || channel == 12 || channel == 13) )
1745 || (eb && (channel == 0 || channel == 1 || channel == 12 || channel == 13) ) ) {
1746 cellname = " GAP";
1747 ch_type = 1;
1748 } else if (chEmpty > 0) {
1749 cellname = " EMPTY";
1750 }
1751 const char *badname = "";
1752 if (m_tileBadChanTool->getAdcStatus(drawerIdx, channel, adc, ctx).isBad()) {
1753 badname = " BADDB";
1754 } else if (DQstatus && !DQstatus->isAdcDQgood(ros, drawer, channel, adc)) {
1755 badname = " BADDQ";
1756 } else if (m_checkDCS && m_tileDCS->getDCSStatus(ros, drawer, channel) > TileDCSState::WARNING) {
1757 badname = " BADDCS";
1758 } else if (m_chanBad[hash]) {
1759 if (badFromCell) {
1760 if (ch_type != 2) badname = " BADQUAL";
1761 m_chanQua[hash] = 999;
1762 } else {
1763 badname = " BADUNKN"; // should never see this
1764 }
1765 } else if (badFromCell && m_chanEne[hash] == 0.0) {
1766 badname = " BADDIGI"; // temporary fix, (for May-2012 ESD), should never get this
1767 }
1768
1769 char badnm[30];
1770 sprintf(badnm, " BADDIGIEX%s", badname);
1771 float dmin, dmax;
1772
1773 int err = TileRawChannelBuilder::CorruptedData(ros, drawer,
1774 channel, adc, samples, dmin, dmax, m_ADCmaxMinusEps,m_ADCmaskValueMinusEps);
1775 if (err) {
1776 bool isConnected = (chEmpty < 2);
1777 if (isConnected || err != -2) {
1778 badname = badnm;
1779 }
1780 if (err > 0) {
1781 if (err < 10) {
1782 badnm[9] = 48 + err;
1783 } else if (err < 36) {
1784 badnm[9] = 55 + err;
1785 }
1786 } else {
1787 badnm[9] = 48;
1788 }
1789 }
1790
1791 const char *enename = " ene = ";
1792 const char *timename = " time = ";
1793 const char *qualname = " qual = ";
1794 if (badFromCell && badname[0] != 0) {
1795 enename = " BAD = ";
1796 if (m_chanDsp.size()) {
1797 qualname = " eDSP = ";
1799 }
1800 if (m_chanTDsp.size()) {
1801 timename = " tDSP = ";
1803 }
1804 }
1805
1806 bool accEmin = (m_chanEne[hash]<m_minEneChan[ch_type]);
1807 bool accEmax = (m_chanEne[hash]>m_maxEneChan[ch_type]);
1808 bool jumpOve = (dmax > m_ADCmaxMinusEps);
1809 bool jumpZer = (dmin < 0.01);
1810
1811 ATH_MSG_VERBOSE(evtnum.str()
1812 << " chan " << std::left << std::setw(14) << m_tileHWID->to_string(adcId)
1813 << enename << m_chanEne[hash] << " samp = " << samples[0]
1814 << " " << samples[1] << " " << samples[2] << " " << samples[3]
1815 << " " << samples[4] << " " << samples[5] << " " << samples[6]
1816 << timename << m_chanTime[hash]
1817 << qualname << m_chanQua[hash]
1818 << cellname << badname
1819 << ((accEmin) ? " neg_e" : "")
1820 << ((accEmax) ? " pos_e" : "")
1821 << ((jumpZer) ? " underflow" : "")
1822 << ((jumpOve) ? " overflow" : "") );
1823
1824 }
1825 }
1826 }
1827
1828 std::ostringstream badstr;
1829 badstr << " ch: " << nChBad1 << " + " << nChBad2 << " = " << nChBad << " / " << nChTot << " = " << 100*nChBad/nChTot
1830 << " % dmu: " << nDmuBad1 << " + " << nDmuBad2 << " = " << nDmuBad << " / " << nDmuTot << " ";
1831 for (int dmu=0; dmu<16; ++dmu) {
1832 if (nChDmu[dmu]>0) {
1833 badstr << " " << std::hex << dmu << "=" << nChBadDmu[dmu] << "/" << nChDmu[dmu];
1834 }
1835 }
1836 ATH_MSG_VERBOSE (evtnum.str()
1837 << " drw " << drwname(digitsCollection->identify()) << badstr.str());
1838 }
1839 }
1840
1841 if (nConst) {
1842 ++m_const;
1843 statusOk = true;
1844 ATH_MSG_DEBUG( nevtnum.str()
1845 << " n_const_sample_errors = " << nConst
1846 << " accepted");
1847 }
1848 if (nJump) {
1849 ++m_jump;
1850 statusOk = true;
1851 ATH_MSG_DEBUG( nevtnum.str()
1852 << " n_jump_sample_errors = " << nJump
1853 << " accepted");
1854 }
1855 if (nOverLG) {
1856 ++m_overLG;
1857 statusOk = true;
1858 ATH_MSG_DEBUG( nevtnum.str()
1859 << " n_overflow_LG = " << nOverLG
1860 << " accepted");
1861 }
1862 if (nOverHG) {
1863 ++m_overHG;
1864 statusOk = true;
1865 ATH_MSG_DEBUG(nevtnum.str()
1866 << " n_overflow_HG = " << nOverHG
1867 << " accepted");
1868 }
1869 if (nUnderLG) {
1870 ++m_underLG;
1871 statusOk = true;
1872 ATH_MSG_DEBUG( nevtnum.str()
1873 << " n_underflow_LG = " << nUnderLG
1874 << " accepted");
1875 }
1876 if (nUnderHG) {
1877 ++m_underHG;
1878 statusOk = true;
1879 ATH_MSG_DEBUG(nevtnum.str()
1880 << " n_underflow_HG = " << nUnderHG
1881 << " accepted");
1882 }
1883 if (nDmuErr) {
1884 ++m_dmuerr;
1885 statusOk = true;
1886 ATH_MSG_DEBUG( nevtnum.str()
1887 << " n_DMU_errors = " << nDmuErr
1888 << " accepted");
1889 }
1890 }
1891 }
1892
1893 if (m_printOnly)
1894 this->setFilterPassed (false, ctx);
1895 else
1896 this->setFilterPassed (statusOk, ctx);
1897
1898 if (statusOk) {
1899 ++m_accept;
1900 //ATH_MSG_VERBOSE (nevtnum.str() << " accepted");
1901 } else {
1902 //ATH_MSG_VERBOSE (nevtnum.str() << " rejected");
1903 }
1904
1905 return StatusCode::SUCCESS;
1906}
const std::regex rr(r_r)
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
size_t size() const
Number of registered mappings.
static std::string drwname(int id)
static const Attributes_t empty
virtual void setFilterPassed(bool state, const EventContext &ctx) const
float time() const
get time (data member)
Definition CaloCell.h:368
double energy() const
get energy (data member)
Definition CaloCell.h:327
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition CaloCell.h:295
IdentifierHash onl2() const
cell online identifier 2
IdentifierHash onl1() const
cell online identifier 1
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Gaudi::Property< bool > m_checkOverHG
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]
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
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
Gaudi::Property< float > m_jumpDeltaLG
unsigned int m_underLG
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
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< float > m_maxTimeCell
Gaudi::Property< bool > m_checkError
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
unsigned int m_overLG
const TileHWID * m_tileHWID
Gaudi::Property< float > m_maxEneChan[3]
std::vector< int > m_nDrawerOff
Gaudi::Property< int > m_minBadDMU
Gaudi::Property< bool > m_checkWarning
std::vector< float > m_chanTime
unsigned int m_maxChan
unsigned int m_minChan
Gaudi::Property< float > m_jumpDeltaHG
std::vector< bool > m_drawerToSkip
Gaudi::Property< float > m_overflowHG
unsigned int m_overHG
const TileID * m_tileID
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< bool > m_skipMBTS
unsigned int m_dqerr
bool m_bitEneCell[ptnlength]
Gaudi::Property< bool > m_checkDCS
uint8_t qual1(void) const
get quality of first PMT (data member)
Definition TileCell.h:197
float time1(void) const
get time of first PMT
Definition TileCell.h:192
int gain2(void) const
get gain of second PMT
Definition TileCell.cxx:175
bool badch1(void) const
check if first PMT is in bad channel list and masked
Definition TileCell.h:209
uint8_t qbit2(void) const
get quality bits of second PMT (data member)
Definition TileCell.h:206
int gain1(void) const
get gain of first PMT
Definition TileCell.cxx:168
uint8_t qual2(void) const
get quality of second PMT (data member)
Definition TileCell.h:200
float ene1(void) const
get energy of first PMT
Definition TileCell.h:187
bool badch2(void) const
check if second PMT is in bad channel list and masked
Definition TileCell.h:212
float time2(void) const
get time of second PMT
Definition TileCell.h:194
@ MASK_OVER
Definition TileCell.h:64
@ MASK_CMPC
Definition TileCell.h:66
uint8_t qbit1(void) const
get quality bits of first PMT (data member)
Definition TileCell.h:203
float ene2(void) const
get energy of second PMT
Definition TileCell.h:189
static int isChEmpty(int partition, int drawer, int ch)
True if channel is not fully implemented.
@ NOT_VALID_HASH
Definition TileHWID.h:314
static int CorruptedData(int ros, int drawer, int channel, int gain, const std::vector< float > &digits, float &dmin, float &dmax, float ADCmaxMinusEps, float ADCmaskValueMinusEps)
float time(int ind=0) const
float amplitude(int ind=0) const
HWIdentifier adc_HWID(void) const
Definition TileRawData.h:53
@ Tile
The Tile calorimeter.
@ Warning
The sub-detector issued a warning.
@ Error
The sub-detector issued an error.
time(flags, cells_name, *args, **kw)
str index
Definition DeMoScan.py:362
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
setEventNumber uint32_t

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode TileCellSelector::finalize ( )
overridevirtual

Definition at line 1986 of file TileCellSelector.cxx.

1986 {
1987 //ATH_MSG_DEBUG ("finalize()");
1988
1989 ATH_MSG_INFO ("Processed " << m_counter << " events, accepted " << m_accept
1990 << " (" << m_minCell << "/" << m_minChan
1991 << "," << m_maxCell << "/" << m_maxChan
1992 << "," << m_jump << "/" << m_const
1993 << "," << m_overLG << "/" << m_overHG
1994 << "," << m_underLG << "/" << m_underHG
1995 << "," << m_dqerr << "/" << m_dmuerr
1996 << "," << m_warnerr << ") events.");
1997
1998 //ATH_MSG_DEBUG ("finalize() successful");
1999
2000 return StatusCode::SUCCESS;
2001}
#define ATH_MSG_INFO(x,...)

◆ initialize()

StatusCode TileCellSelector::initialize ( )
overridevirtual

Definition at line 47 of file TileCellSelector.cxx.

47 {
48 //ATH_MSG_DEBUG("in initialize()");
49
50 ATH_CHECK( m_eventInfoKey.initialize() );
51
52 ATH_CHECK(detStore()->retrieve(m_tileID, "TileID"));
53 ATH_CHECK(detStore()->retrieve(m_tileHWID, "TileHWID"));
54
55 ATH_CHECK(detStore()->retrieve(m_tileInfo, m_infoName.value()));
56 m_ADCmaxMinusEps = m_tileInfo->ADCmax() - 0.01;
57 m_ADCmaskValueMinusEps = m_tileInfo->ADCmaskValue() - 0.01; // indicates channels which were masked in background dataset
58
60
61 ATH_CHECK(m_tileBadChanTool.retrieve());
62
63 if (m_checkDCS) {
64 ATH_CHECK(m_tileDCS.retrieve());
65 } else {
66 m_tileDCS.disable();
67 }
68
69 ATH_MSG_INFO( "Cell container "
70 << ((m_cellContainerKey.key().empty()) ? "NOT SET" : m_cellContainerKey.key()) );
71 ATH_MSG_INFO( "Digits container "
72 << ((m_digitsContainerKey.key().empty()) ? "NOT SET" : m_digitsContainerKey.key()));
73 ATH_MSG_INFO( "RawChannel container "
74 << ((m_rawChannelContainerKey.key().empty()) ? "NOT SET" : m_rawChannelContainerKey.key()));
75
76 ATH_MSG_INFO( "CheckJumps " << ((m_checkJumps) ? "true" : "false"));
77 ATH_MSG_INFO( "CheckDMUs " << ((m_checkDMUs) ? "true" : "false"));
78 ATH_MSG_INFO( "CheckOverLG " << ((m_checkOverLG) ? "true" : "false"));
79 ATH_MSG_INFO( "CheckOverHG " << ((m_checkOverHG) ? "true" : "false"));
80 ATH_MSG_INFO( "CheckUnderLG " << ((m_checkUnderLG) ? "true" : "false"));
81 ATH_MSG_INFO( "CheckUnderHG " << ((m_checkUnderHG) ? "true" : "false"));
82
83 if (m_overflowLG < 0) m_overflowLG += m_tileInfo->ADCmax();
84 if (m_overflowHG < 0) m_overflowHG += m_tileInfo->ADCmax();
85 ATH_MSG_INFO( "OverflowLG " << m_overflowLG.value());
86 ATH_MSG_INFO( "OverflowHG " << m_overflowHG.value());
87 ATH_MSG_INFO( "UnderflowLG " << m_underflowLG.value());
88 ATH_MSG_INFO( "UnderflowHG " << m_underflowHG.value());
89
90 ATH_MSG_INFO( "SkipEmpty " << ((m_skipEmpty) ? "true" : "false"));
91 ATH_MSG_INFO( "SkipMasked " << ((m_skipMasked) ? "true" : "false"));
92 ATH_MSG_INFO( "SkipMBTS " << ((m_skipMBTS) ? "true" : "false"));
93 ATH_MSG_INFO( "CheckDCS " << ((m_checkDCS) ? "true" : "false"));
94
95
96 m_readCells = !m_cellContainerKey.key().empty();
98 m_readDigits = !m_digitsContainerKey.key().empty();
99
100 if (m_readCells) {
101 ATH_MSG_INFO( "MinEnergyCell < " << m_minEneCell.value());
102 ATH_MSG_INFO( "MaxEnergyCell > " << m_maxEneCell.value());
103 ATH_MSG_INFO( "PtnEnergyCell = " << m_ptnEneCell.value());
104 ATH_MSG_INFO( "MinTimeCell < " << m_minTimeCell.value());
105 ATH_MSG_INFO( "MaxTimeCell > " << m_maxTimeCell.value());
106 ATH_MSG_INFO( "PtnTimeCell = " << m_ptnTimeCell.value());
107
108 ATH_CHECK( m_cellContainerKey.initialize() );
109 }
110
112 ATH_MSG_INFO( "MinEnergyChan < " << m_minEneChan[0].value());
113 ATH_MSG_INFO( "MaxEnergyChan > " << m_maxEneChan[0].value());
114 ATH_MSG_INFO( "PtnEnergyChan = " << m_ptnEneChan[0].value());
115 ATH_MSG_INFO( "MinEnergyGap < " << m_minEneChan[1].value());
116 ATH_MSG_INFO( "MaxEnergyGap > " << m_maxEneChan[1].value());
117 ATH_MSG_INFO( "PtnEnergyGap = " << m_ptnEneChan[1].value());
118 ATH_MSG_INFO( "MinTimeChan < " << m_minTimeChan[0].value());
119 ATH_MSG_INFO( "MaxTimeChan > " << m_maxTimeChan[0].value());
120 ATH_MSG_INFO( "PtnTimeChan = " << m_ptnTimeChan[0].value());
121 ATH_MSG_INFO( "MinTimeGap < " << m_minTimeChan[1].value());
122 ATH_MSG_INFO( "MaxTimeGap > " << m_maxTimeChan[1].value());
123 ATH_MSG_INFO( "PtnTimeGap = " << m_ptnTimeChan[1].value());
124 }
125
126 if (m_readRawChannels) {
127 ATH_MSG_INFO( "MinEnergyMBTS < " << m_minEneChan[2].value());
128 ATH_MSG_INFO( "MaxEnergyMBTS > " << m_maxEneChan[2].value());
129 ATH_MSG_INFO( "PtnEnergyMBTS = " << m_ptnEneChan[2].value());
130 ATH_MSG_INFO( "MinTimeMBTS < " << m_minTimeChan[2].value());
131 ATH_MSG_INFO( "MaxTimeMBTS > " << m_maxTimeChan[2].value());
132 ATH_MSG_INFO( "PtnTimeMBTS = " << m_ptnTimeChan[2].value());
133
134 ATH_CHECK( m_rawChannelContainerKey.initialize() );
135 }
136
137 switch (m_selectGain.value()) {
138 case 0:
139 ATH_MSG_INFO( "Select Low gain channels only");
142 break;
143 case 1:
144 ATH_MSG_INFO( "Select High gain channels only");
147 break;
148 default:
149 ATH_MSG_INFO( "Select both gains");
150 break;
151 }
152
153 if (!m_digitsContainerKey.key().empty()) {
154 if (m_checkJumps) {
155 ATH_MSG_INFO( "JumpDeltaHG " << m_jumpDeltaHG.value());
156 ATH_MSG_INFO( "JumpDeltaLG " << m_jumpDeltaLG.value());
157 ATH_MSG_INFO( "PedDetlaHG " << m_pedDeltaHG.value());
158 ATH_MSG_INFO( "PedDetlaLG " << m_pedDeltaLG.value());
159 ATH_MSG_INFO( "ConstLength " << m_constLength.value());
160 }
161
162 ATH_CHECK( m_digitsContainerKey.initialize() );
163
164 }
165
166 if (!m_rawChannelContainerKey.key().empty()) {
167 if (m_checkDMUs) {
168 ATH_MSG_INFO( "MinBadDMU " << m_minBadDMU.value());
169 ATH_MSG_INFO( "MaxBadDMU " << m_maxBadDMU.value());
170 ATH_MSG_INFO( "MinBadMB " << m_minBadMB.value());
171 } else {
172 m_minBadDMU = 99;
173 m_maxBadDMU = -1;
174 m_minBadMB = 99;
175 }
176 ATH_MSG_INFO( "MaxVerboseCnt " << m_maxVerboseCnt.value());
177 }
178
179 ATH_MSG_INFO( "CheckWarning " << ((m_checkWarning)? "true" : "false"));
180 ATH_MSG_INFO( "CheckError " << ((m_checkError) ? "true" : "false"));
181 ATH_MSG_INFO( "PrintOnly " << ((m_printOnly) ? "true" : "false"));
182
183 if (m_drawer.value().size()>0) {
184 msg(MSG::INFO) << "Drawers which will be always printed:" << MSG::hex;
185 for (int frag: m_drawer) msg(MSG::INFO) << " 0x" << frag;
186 msg(MSG::INFO) << MSG::dec << endmsg;
187 }
188
189 if (m_drawerToCheck.value().size()>0) {
190 msg(MSG::INFO) << "Only those drawers will be checked:" << MSG::hex;
191 for (int frag: m_drawerToCheck) msg(MSG::INFO) << " 0x" << frag;
192 msg(MSG::INFO) << MSG::dec << endmsg;
193 }
194
195 if (m_chanToCheck.value().size()>0) {
196 msg(MSG::INFO) << "Only those channels will be checked:";
197 for (int ch: m_chanToCheck) msg(MSG::INFO) << " " << ch;
198 msg(MSG::INFO) << endmsg;
199 }
200
202
203 //ATH_MSG_DEBUG ("initialize() successful");
204
205 // convert patterns fo bolean arrays
206
207 int digit=1;
208 int scale=10;
209 for (int i=0; i<ptnlength; ++i) {
210
211 int bit=(m_ptnEneCell/digit)%scale;
212 m_bitEneCell[i] = (bit!=0);
213
214 bit=(m_ptnTimeCell/digit)%scale;
215 m_bitTimeCell[i] = (bit!=0);
216
217 for (int j=0; j<3; ++j) {
218
219 int bit=(m_ptnEneChan[j]/digit)%scale;
220 m_bitEneChan[j][i] = (bit!=0);
221
222 bit=(m_ptnTimeChan[j]/digit)%scale;
223 m_bitTimeChan[j][i] = (bit!=0);
224 }
225
226 digit *= scale;
227 }
228
229 m_chanToSkip.clear();
230 m_drawerToSkip.clear();
231 if (m_drawerToCheck.value().size()>0 || m_chanToCheck.value().size()>0 ) {
232 if (m_drawerToCheck.value().size()==0) {
233 m_drawerToCheck.value().resize(256);
234 auto itr = m_drawerToCheck.value().begin();
235 for (int frag : {0x100,0x200,0x300,0x400}) {
236 auto itr1 = itr+64;
237 std::iota(itr, itr1, frag);
238 itr = itr1;
239 }
240 } else if (m_chanToCheck.value().size()==0) {
241 m_chanToCheck.value().resize(48);
242 std::iota(m_chanToCheck.value().begin(), m_chanToCheck.value().end(), 0);
243 }
245 m_drawerToSkip.resize(1+TileCalibUtils::getDrawerIdx(4,63),true);
246 IdContext chan_context = m_tileHWID->channel_context();
247 IdentifierHash hash;
248 for (int frag : m_drawerToCheck) {
249 int ros = frag >> 8;
250 int drawer = frag & 0x3F;
251 unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros,drawer);
252 m_drawerToSkip[drawerIdx] = false;
253 HWIdentifier ch_id = m_tileHWID->channel_id(ros,drawer,0);
254 m_tileHWID->get_hash(ch_id, hash, &chan_context);
255 for (int chan: m_chanToCheck)
256 m_chanToSkip[hash+chan] = false;
257 }
258 } else {
261 m_drawerToSkip.resize(1+TileCalibUtils::getDrawerIdx(4,63),false);
262 }
263
264 ATH_CHECK( m_dqStatusKey.initialize() );
265
266 return StatusCode::SUCCESS;
267}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ptnlength
const ServiceHandle< StoreGateSvc > & detStore() const
static const TileCablingService * getInstance()
get pointer to service instance
Gaudi::Property< int > m_ptnEneChan[3]
Gaudi::Property< int > m_ptnTimeCell
Gaudi::Property< int > m_selectGain
Gaudi::Property< std::vector< int > > m_chanToCheck
Gaudi::Property< std::vector< int > > m_drawerToCheck
Gaudi::Property< std::string > m_infoName
Gaudi::Property< int > m_ptnTimeChan[3]
const TileInfo * m_tileInfo
Gaudi::Property< int > m_ptnEneCell
constexpr unsigned int bit(int n)
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ printCell()

void TileCellSelector::printCell ( const TileCell * cell)
private

Definition at line 1910 of file TileCellSelector.cxx.

1910 {
1911 if (tile_cell==0) return;
1912
1913 // int drw = 0; // drawer number, range 0-63, the same for both channels
1914 // int ch1 = -1, ch2 = -1; // channel number, range 0-47 or -1 for unknown
1915 int ros1 = 0, ros2 = 0;
1916
1917 const CaloDetDescrElement * caloDDE = tile_cell->caloDDE();
1918 //Identifier id = tile_cell->ID();
1919
1920 IdentifierHash hash1 = caloDDE->onl1();
1921 if (hash1 != TileHWID::NOT_VALID_HASH) {
1922 HWIdentifier hw1 = m_tileHWID->channel_id(hash1);
1923 //ch1 = m_tileHWID->channel(hw1);
1924 //drw = m_tileHWID->drawer(hw1);
1925 ros1 = m_tileHWID->ros(hw1);
1926 }
1927
1928 IdentifierHash hash2 = caloDDE->onl2();
1929 if (hash2 != TileHWID::NOT_VALID_HASH) {
1930 HWIdentifier hw2 = m_tileHWID->channel_id(hash2);
1931 //ch2 = m_tileHWID->channel(hw2);
1932 //drw = m_tileHWID->drawer(hw2);
1933 ros2 = m_tileHWID->ros(hw2);
1934 if (ros1 == 0) ros1=ros2;
1935 } else {
1936 ros2 = ros1;
1937 }
1938
1939 // something is wrong
1940 if (ros1 == 0) return;
1941 /*
1942 int module = m_tileID->module(id);
1943
1944 int samp = m_tileID->sample(id);
1945
1946 bool single_PMT_scin = (samp == TileID::SAMP_E);
1947 bool single_PMT_C10 = (m_tileID->section(id) == TileID::GAPDET &&
1948 samp == TileID::SAMP_C &&
1949 (! m_cabling->C10_connected(m_tileID->module(id))) );
1950
1951 // distinguish cells with one or two PMTs
1952 bool single_PMT = single_PMT_C10 || single_PMT_scin;
1953
1954 // distinguish normal cells and fantoms (e.g. non-existing D4 in EBA15, EBC18
1955 // or non-existing E3/E4 - they might appear in CaloCellContainer)
1956 bool real_cell = single_PMT_C10 || m_cabling->TileGap_connected(id);
1957
1958 // note that in single PMT cell both badch1() and badch2() are changed together
1959 bool badch1 = (tile_cell->badch1());
1960 bool badch2 = (tile_cell->badch2());
1961
1962 // 0 = both PMTs are good; 1= 1 PMT is bad; 2= both PMTs are bad, or PMT is bad for single PMT cell
1963 int cell_isbad = (int)badch1 + (int)badch2;
1964
1965 int gn1 = tile_cell->gain1(); // gain of first PMT
1966 int gn2 = tile_cell->gain2(); // gain of second PMT
1967
1968 bool ch1Ok = (ch1>-1 && gn1 != CaloGain::INVALIDGAIN);
1969 bool ch2Ok = (ch2>-1 && gn2 != CaloGain::INVALIDGAIN);
1970
1971 // get the cell energy, time and position info
1972 double energy = tile_cell->energy();
1973 double time = tile_cell->time();
1974 double eta = tile_cell->eta();
1975 double phi = tile_cell->phi();
1976 double ene1 = tile_cell->ene1();
1977 double ene2 = tile_cell->ene2();
1978 double ediff = (single_PMT) ? 0.0 : tile_cell->eneDiff();
1979 double eratio = (energy!=0.0) ? ediff/energy : 0.0;
1980 double t1 = tile_cell->time1();
1981 double t2 = tile_cell->time2();
1982 double tdiff = (single_PMT) ? 0.0 : tile_cell->timeDiff();
1983 */
1984}

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_ERROR(x,...)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

Member Data Documentation

◆ m_accept

unsigned int TileCellSelector::m_accept {0}
private

Definition at line 56 of file TileCellSelector.h.

56{0};

◆ m_ADCmaskValueMinusEps

float TileCellSelector::m_ADCmaskValueMinusEps = 0.0F
private

Definition at line 202 of file TileCellSelector.h.

◆ m_ADCmaxMinusEps

float TileCellSelector::m_ADCmaxMinusEps = 0.0F
private

Definition at line 201 of file TileCellSelector.h.

◆ m_bitEneCell

bool TileCellSelector::m_bitEneCell[ptnlength] {}
private

Definition at line 161 of file TileCellSelector.h.

161{};

◆ m_bitEneChan

bool TileCellSelector::m_bitEneChan[3][ptnlength] {}
private

Definition at line 163 of file TileCellSelector.h.

163{};

◆ m_bitTimeCell

bool TileCellSelector::m_bitTimeCell[ptnlength] {}
private

Definition at line 162 of file TileCellSelector.h.

162{};

◆ m_bitTimeChan

bool TileCellSelector::m_bitTimeChan[3][ptnlength] {}
private

Definition at line 164 of file TileCellSelector.h.

164{};

◆ m_cabling

const TileCablingService* TileCellSelector::m_cabling {nullptr}
private

Definition at line 73 of file TileCellSelector.h.

73{nullptr};

◆ m_cellContainerKey

SG::ReadHandleKey<CaloCellContainer> TileCellSelector::m_cellContainerKey
private
Initial value:
{this,"CellContainerName",
"AllCalo", "Input Calo cell container key"}

Definition at line 112 of file TileCellSelector.h.

112 {this,"CellContainerName",
113 "AllCalo", "Input Calo cell container key"};

◆ m_chanBad

std::vector<bool> TileCellSelector::m_chanBad
private

Definition at line 98 of file TileCellSelector.h.

◆ m_chanDsp

std::vector<float> TileCellSelector::m_chanDsp
private

Definition at line 101 of file TileCellSelector.h.

◆ m_chanEne

std::vector<float> TileCellSelector::m_chanEne
private

Definition at line 99 of file TileCellSelector.h.

◆ m_chanQua

std::vector<float> TileCellSelector::m_chanQua
private

Definition at line 103 of file TileCellSelector.h.

◆ m_chanSel

std::vector<bool> TileCellSelector::m_chanSel
private

Definition at line 104 of file TileCellSelector.h.

◆ m_chanTDsp

std::vector<float> TileCellSelector::m_chanTDsp
private

Definition at line 102 of file TileCellSelector.h.

◆ m_chanTime

std::vector<float> TileCellSelector::m_chanTime
private

Definition at line 100 of file TileCellSelector.h.

◆ m_chanToCheck

Gaudi::Property<std::vector<int> > TileCellSelector::m_chanToCheck {this, "ChannelToCheck", {}, "Channels for which all checks should be performed"}
private

Definition at line 194 of file TileCellSelector.h.

194{this, "ChannelToCheck", {}, "Channels for which all checks should be performed"};

◆ m_chanToSkip

std::vector<bool> TileCellSelector::m_chanToSkip
private

Definition at line 105 of file TileCellSelector.h.

◆ m_checkDCS

Gaudi::Property<bool> TileCellSelector::m_checkDCS {this, "CheckDCS", true, "Additional check for DCS status"}
private

Definition at line 177 of file TileCellSelector.h.

177{this, "CheckDCS", true, "Additional check for DCS status"};

◆ m_checkDMUs

Gaudi::Property<bool> TileCellSelector::m_checkDMUs {this, "CheckDMUs", true, "Global flag which allows to switch on/off DMU checks"}
private

Definition at line 179 of file TileCellSelector.h.

179{this, "CheckDMUs", true, "Global flag which allows to switch on/off DMU checks"};

◆ m_checkError

Gaudi::Property<bool> TileCellSelector::m_checkError {this, "CheckError", false, "Select events with error status in TileCal status word"}
private

Definition at line 189 of file TileCellSelector.h.

189{this, "CheckError", false, "Select events with error status in TileCal status word"};

◆ m_checkJumps

Gaudi::Property<bool> TileCellSelector::m_checkJumps {this, "CheckJumps", true, "Global flag which allows to switch on/off all checks in digits"}
private

Definition at line 178 of file TileCellSelector.h.

178{this, "CheckJumps", true, "Global flag which allows to switch on/off all checks in digits"};

◆ m_checkOverHG

Gaudi::Property<bool> TileCellSelector::m_checkOverHG {this, "CheckOverHG", false, "Select events with overflow in high gain"}
private

Definition at line 181 of file TileCellSelector.h.

181{this, "CheckOverHG", false, "Select events with overflow in high gain"};

◆ m_checkOverLG

Gaudi::Property<bool> TileCellSelector::m_checkOverLG {this, "CheckOverLG", true, "Select events with overflow in low gain"}
private

Definition at line 180 of file TileCellSelector.h.

180{this, "CheckOverLG", true, "Select events with overflow in low gain"};

◆ m_checkUnderHG

Gaudi::Property<bool> TileCellSelector::m_checkUnderHG {this, "CheckUnderHG", false, "Select events with underflow in high gain"}
private

Definition at line 183 of file TileCellSelector.h.

183{this, "CheckUnderHG", false, "Select events with underflow in high gain"};

◆ m_checkUnderLG

Gaudi::Property<bool> TileCellSelector::m_checkUnderLG {this, "CheckUnderLG", false, "Select events with underflow in low gain"}
private

Definition at line 182 of file TileCellSelector.h.

182{this, "CheckUnderLG", false, "Select events with underflow in low gain"};

◆ m_checkWarning

Gaudi::Property<bool> TileCellSelector::m_checkWarning {this, "CheckWarning", false, "Select events with warning status in TileCal status word"}
private

Definition at line 188 of file TileCellSelector.h.

188{this, "CheckWarning", false, "Select events with warning status in TileCal status word"};

◆ m_const

unsigned int TileCellSelector::m_const {0}
private

Definition at line 62 of file TileCellSelector.h.

62{0};

◆ m_constLength

Gaudi::Property<int> TileCellSelector::m_constLength {this, "ConstLength", 6, "Min number of consecutive samples of the same value"}
private

Definition at line 170 of file TileCellSelector.h.

170{this, "ConstLength", 6, "Min number of consecutive samples of the same value"};

◆ m_counter

unsigned int TileCellSelector::m_counter {0}
private

Definition at line 55 of file TileCellSelector.h.

55{0};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_digitsContainerKey

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

Definition at line 115 of file TileCellSelector.h.

115 {this,"DigitsContainerName",
116 "TileDigitsFlt", "Input Tile digits container key"};

◆ m_dmuerr

unsigned int TileCellSelector::m_dmuerr {0}
private

Definition at line 68 of file TileCellSelector.h.

68{0};

◆ m_dqerr

unsigned int TileCellSelector::m_dqerr {0}
private

Definition at line 67 of file TileCellSelector.h.

67{0};

◆ m_dqStatusKey

SG::ReadHandleKey<TileDQstatus> TileCellSelector::m_dqStatusKey {this, "TileDQstatus", "TileDQstatus", "TileDQstatus key"}
private

Definition at line 75 of file TileCellSelector.h.

75{this, "TileDQstatus", "TileDQstatus", "TileDQstatus key"};

◆ m_drawer

Gaudi::Property<std::vector<int> > TileCellSelector::m_drawer {this, "DrawerToDump", {}, "Drawers for which all channels should be printed"}
private

Definition at line 192 of file TileCellSelector.h.

192{this, "DrawerToDump", {}, "Drawers for which all channels should be printed"};

◆ m_drawerToCheck

Gaudi::Property<std::vector<int> > TileCellSelector::m_drawerToCheck {this, "DrawerToCheck", {}, "Drawers for which all checks should be performed"}
private

Definition at line 193 of file TileCellSelector.h.

193{this, "DrawerToCheck", {}, "Drawers for which all checks should be performed"};

◆ m_drawerToSkip

std::vector<bool> TileCellSelector::m_drawerToSkip
private

Definition at line 106 of file TileCellSelector.h.

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> TileCellSelector::m_eventInfoKey
private
Initial value:
{this,"EventInfo",
"EventInfo", "Input event info key"}

Definition at line 122 of file TileCellSelector.h.

122 {this,"EventInfo",
123 "EventInfo", "Input event info key"};

◆ m_evtBCID

unsigned int TileCellSelector::m_evtBCID {0}
private

Definition at line 81 of file TileCellSelector.h.

81{0};

◆ m_evtNum

unsigned int TileCellSelector::m_evtNum {0}
private

Definition at line 80 of file TileCellSelector.h.

80{0};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_infoName

Gaudi::Property<std::string> TileCellSelector::m_infoName {this, "TileInfoName", "TileInfo", "Name of TileInfo object in DetectorStore"}
private

Definition at line 199 of file TileCellSelector.h.

199{this, "TileInfoName", "TileInfo", "Name of TileInfo object in DetectorStore"};

◆ m_jump

unsigned int TileCellSelector::m_jump {0}
private

Definition at line 61 of file TileCellSelector.h.

61{0};

◆ m_jumpDeltaHG

Gaudi::Property<float> TileCellSelector::m_jumpDeltaHG {this, "JumpDeltaHG", 50.0, "Minimal jump in high gain"}
private

Definition at line 166 of file TileCellSelector.h.

166{this, "JumpDeltaHG", 50.0, "Minimal jump in high gain"};

◆ m_jumpDeltaLG

Gaudi::Property<float> TileCellSelector::m_jumpDeltaLG {this, "JumpDeltaLG", 10.0, "Minimal jump in low gain"}
private

Definition at line 167 of file TileCellSelector.h.

167{this, "JumpDeltaLG", 10.0, "Minimal jump in low gain"};

◆ m_lumiBlock

unsigned int TileCellSelector::m_lumiBlock {0}
private

Definition at line 79 of file TileCellSelector.h.

79{0};

◆ m_maxBadDMU

Gaudi::Property<int> TileCellSelector::m_maxBadDMU {this, "MaxBadDMU", 15, "Max number of bad DMUs to accept event"}
private

Definition at line 172 of file TileCellSelector.h.

172{this, "MaxBadDMU", 15, "Max number of bad DMUs to accept event"};

◆ m_maxCell

unsigned int TileCellSelector::m_maxCell {0}
private

Definition at line 58 of file TileCellSelector.h.

58{0};

◆ m_maxChan

unsigned int TileCellSelector::m_maxChan {0}
private

Definition at line 60 of file TileCellSelector.h.

60{0};

◆ m_maxEneCell

Gaudi::Property<float> TileCellSelector::m_maxEneCell {this, "MaxEnergyCell", 1000000., "Cut on cell energy"}
private

Definition at line 126 of file TileCellSelector.h.

126{this, "MaxEnergyCell", 1000000., "Cut on cell energy"};

◆ m_maxEneChan

Gaudi::Property<float> TileCellSelector::m_maxEneChan[3]
private
Initial value:
{{this, "MaxEnergyChan", 500000., "Cut on channel energy for normal channels"},
{this, "MaxEnergyGap", 500000., "Cut on channel energy for gap/crack scintillators"},
{this, "MaxEnergyMBTS", 500000., "Cut on channel energy for MBTS"}}

Definition at line 130 of file TileCellSelector.h.

130 {{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"}};

◆ m_maxTimeCell

Gaudi::Property<float> TileCellSelector::m_maxTimeCell {this, "MaxTimeCell", 100., "Cut on cell time"}
private

Definition at line 134 of file TileCellSelector.h.

134{this, "MaxTimeCell", 100., "Cut on cell time"};

◆ m_maxTimeChan

Gaudi::Property<float> TileCellSelector::m_maxTimeChan[3]
private
Initial value:
{{this, "MaxTimeChan", 100., "Cut on channel time for normal channels"},
{this, "MaxTimeGap", 100., "Cut on channel time for gap/crack scintillators"},
{this, "MaxTimeMBTS", 100., "Cut on channel time for MBTS"}}

Definition at line 138 of file TileCellSelector.h.

138 {{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"}};

◆ m_maxVerboseCnt

Gaudi::Property<int> TileCellSelector::m_maxVerboseCnt {this, "MaxVerboseCnt", 20, "Max number of verbose output lines about drawer off"}
private

Definition at line 196 of file TileCellSelector.h.

196{this, "MaxVerboseCnt", 20, "Max number of verbose output lines about drawer off"};

◆ m_minBadDMU

Gaudi::Property<int> TileCellSelector::m_minBadDMU {this, "MinBadDMU", 4, "Min number of bad DMUs to accept event"}
private

Definition at line 171 of file TileCellSelector.h.

171{this, "MinBadDMU", 4, "Min number of bad DMUs to accept event"};

◆ m_minBadMB

Gaudi::Property<int> TileCellSelector::m_minBadMB {this, "MinBadMB", 4, "Min number of bad motherboards in a drawer to accept event"}
private

Definition at line 173 of file TileCellSelector.h.

173{this, "MinBadMB", 4, "Min number of bad motherboards in a drawer to accept event"};

◆ m_minCell

unsigned int TileCellSelector::m_minCell {0}
private

Definition at line 57 of file TileCellSelector.h.

57{0};

◆ m_minChan

unsigned int TileCellSelector::m_minChan {0}
private

Definition at line 59 of file TileCellSelector.h.

59{0};

◆ m_minEneCell

Gaudi::Property<float> TileCellSelector::m_minEneCell {this, "MinEnergyCell", -5000., "Cut on cell energy"}
private

Definition at line 125 of file TileCellSelector.h.

125{this, "MinEnergyCell", -5000., "Cut on cell energy"};

◆ m_minEneChan

Gaudi::Property<float> TileCellSelector::m_minEneChan[3]
private
Initial value:
{{this, "MinEnergyChan", -5000., "Cut on channel energy for normal channels"},
{this, "MinEnergyGap", -10000., "Cut on channel energy for gap/crack scintillators"},
{this, "MinEnergyMBTS", -10000., "Cut on channel energy for MBTS"}}

Definition at line 127 of file TileCellSelector.h.

127 {{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"}};

◆ m_minTimeCell

Gaudi::Property<float> TileCellSelector::m_minTimeCell {this, "MinTimeCell", -100., "Cut on cell time"}
private

Definition at line 133 of file TileCellSelector.h.

133{this, "MinTimeCell", -100., "Cut on cell time"};

◆ m_minTimeChan

Gaudi::Property<float> TileCellSelector::m_minTimeChan[3]
private
Initial value:
{{this, "MinTimeChan", -100., "Cut on channel time for normal channels"},
{this, "MinTimeGap", -100., "Cut on channel time for gap/crack scintillators"},
{this, "MinTimeMBTS", -100., "Cut on channel time for MBTS"}}

Definition at line 135 of file TileCellSelector.h.

135 {{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"}};

◆ m_nDrawerOff

std::vector<int> TileCellSelector::m_nDrawerOff
private

Definition at line 197 of file TileCellSelector.h.

◆ m_overflowHG

Gaudi::Property<float> TileCellSelector::m_overflowHG {this, "OverflowHG", -1.1, "Threshold for overflow in high gain (smaller than ADCmax by this value)"}
private

Definition at line 185 of file TileCellSelector.h.

185{this, "OverflowHG", -1.1, "Threshold for overflow in high gain (smaller than ADCmax by this value)"};

◆ m_overflowLG

Gaudi::Property<float> TileCellSelector::m_overflowLG {this, "OverflowLG", -0.1, "Threshold for overflow in low gain (smaller than ADCmax by this value)"}
private

Definition at line 184 of file TileCellSelector.h.

184{this, "OverflowLG", -0.1, "Threshold for overflow in low gain (smaller than ADCmax by this value)"};

◆ m_overHG

unsigned int TileCellSelector::m_overHG {0}
private

Definition at line 64 of file TileCellSelector.h.

64{0};

◆ m_overLG

unsigned int TileCellSelector::m_overLG {0}
private

Definition at line 63 of file TileCellSelector.h.

63{0};

◆ m_pedDeltaHG

Gaudi::Property<float> TileCellSelector::m_pedDeltaHG {this, "PedDetlaHG", 4.1, "Max variation of \"const\" value in high gain"}
private

Definition at line 168 of file TileCellSelector.h.

168{this, "PedDetlaHG", 4.1, "Max variation of \"const\" value in high gain"};

◆ m_pedDeltaLG

Gaudi::Property<float> TileCellSelector::m_pedDeltaLG {this, "PedDetlaLG", 4.1, "Max variation of \"const\" value in low gain"}
private

Definition at line 169 of file TileCellSelector.h.

169{this, "PedDetlaLG", 4.1, "Max variation of \"const\" value in low gain"};

◆ m_printOnly

Gaudi::Property<bool> TileCellSelector::m_printOnly {this, "PrintOnly", false, "Only print accepted events, but do not accept anything"}
private

Definition at line 190 of file TileCellSelector.h.

190{this, "PrintOnly", false, "Only print accepted events, but do not accept anything"};

◆ m_ptnEneCell

Gaudi::Property<int> TileCellSelector::m_ptnEneCell {this, "PtnEnergyCell", 101, "Cell energy pattern, accept events only below min (+1), between min-max (+10), above max (+100)"}
private

Definition at line 150 of file TileCellSelector.h.

150{this, "PtnEnergyCell", 101, "Cell energy pattern, accept events only below min (+1), between min-max (+10), above max (+100)"};

◆ m_ptnEneChan

Gaudi::Property<int> TileCellSelector::m_ptnEneChan[3]
private
Initial value:
{{this, "PtnEnergyChan", 101, "Channel energy pattern for normal channels"},
{this, "PtnEnergyGap", 101, "Channel energy pattern for gap/crack scintillators"},
{this, "PtnEnergyMBTS", 101, "Channel energy pattern for MBTS"}}

Definition at line 151 of file TileCellSelector.h.

151 {{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"}};

◆ m_ptnTimeCell

Gaudi::Property<int> TileCellSelector::m_ptnTimeCell {this, "PtnTimeCell", 10, "Cell time pattern, accept events only below min (+1), between min-max (+10), above max (+100)"}
private

Definition at line 154 of file TileCellSelector.h.

154{this, "PtnTimeCell", 10, "Cell time pattern, accept events only below min (+1), between min-max (+10), above max (+100)"};

◆ m_ptnTimeChan

Gaudi::Property<int> TileCellSelector::m_ptnTimeChan[3]
private
Initial value:
{{this, "PtnTimeChan", 10, "Channel time pattern for normal channels"},
{this, "PtnTimeGap", 10, "Channel time pattern for gap/crack scintillators"},
{this, "PtnTimeMBTS", 10, "Channel time pattern for MBTS"}}

Definition at line 155 of file TileCellSelector.h.

155 {{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"}};

◆ m_rawChannelContainerKey

SG::ReadHandleKey<TileRawChannelContainer> TileCellSelector::m_rawChannelContainerKey
private
Initial value:
{this,"RawChannelContainerName",
"TileRawChannelCnt",
"Input Tile raw channel container key"}

Definition at line 118 of file TileCellSelector.h.

118 {this,"RawChannelContainerName",
119 "TileRawChannelCnt",
120 "Input Tile raw channel container key"};

◆ m_readCells

bool TileCellSelector::m_readCells {true}
private

Definition at line 108 of file TileCellSelector.h.

108{true};

◆ m_readDigits

bool TileCellSelector::m_readDigits {true}
private

Definition at line 110 of file TileCellSelector.h.

110{true};

◆ m_readRawChannels

bool TileCellSelector::m_readRawChannels {true}
private

Definition at line 109 of file TileCellSelector.h.

109{true};

◆ m_runNum

unsigned int TileCellSelector::m_runNum {0}
private

Definition at line 78 of file TileCellSelector.h.

78{0};

◆ m_secondMaxLevel

Gaudi::Property<float> TileCellSelector::m_secondMaxLevel {this, "SecondMaxLevel", 0.3, "Sample below max should be above (max-min)*SecondMaxLevel"}
private

Definition at line 165 of file TileCellSelector.h.

165{this, "SecondMaxLevel", 0.3, "Sample below max should be above (max-min)*SecondMaxLevel"};

◆ m_selectGain

Gaudi::Property<int> TileCellSelector::m_selectGain {this, "SelectGain", 2, "0 - select LG only, 1 - HG only, 2 - both gains"}
private

Definition at line 158 of file TileCellSelector.h.

158{this, "SelectGain", 2, "0 - select LG only, 1 - HG only, 2 - both gains"};

◆ m_skipEmpty

Gaudi::Property<bool> TileCellSelector::m_skipEmpty {this, "SkipEmpty", true, "Ignore empty channels in selection or not"}
private

Definition at line 174 of file TileCellSelector.h.

174{this, "SkipEmpty", true, "Ignore empty channels in selection or not"};

◆ m_skipGain

bool TileCellSelector::m_skipGain[2] {}
private

Definition at line 159 of file TileCellSelector.h.

159{};

◆ m_skipMasked

Gaudi::Property<bool> TileCellSelector::m_skipMasked {this, "SkipMasked", true, "Ignore masked channels in selection or not"}
private

Definition at line 175 of file TileCellSelector.h.

175{this, "SkipMasked", true, "Ignore masked channels in selection or not"};

◆ m_skipMBTS

Gaudi::Property<bool> TileCellSelector::m_skipMBTS {this, "SkipMBTS", true, "Ignore MBTS channels in selection or not"}
private

Definition at line 176 of file TileCellSelector.h.

176{this, "SkipMBTS", true, "Ignore MBTS channels in selection or not"};

◆ m_tileBadChanTool

ToolHandle<ITileBadChanTool> TileCellSelector::m_tileBadChanTool {this, "TileBadChanTool", "TileBadChanTool", "Tile bad channel tool"}
private

Definition at line 74 of file TileCellSelector.h.

74{this, "TileBadChanTool", "TileBadChanTool", "Tile bad channel tool"};

◆ m_tileDCS

ToolHandle<ITileDCSTool> TileCellSelector::m_tileDCS {this, "TileDCSTool", "TileDCSTool", "Tile DCS tool"}
private

Definition at line 76 of file TileCellSelector.h.

76{this, "TileDCSTool", "TileDCSTool", "Tile DCS tool"};

◆ m_tileError

unsigned int TileCellSelector::m_tileError {0}
private

Definition at line 96 of file TileCellSelector.h.

96{0};

◆ m_tileFlag

unsigned int TileCellSelector::m_tileFlag {0}
private

Definition at line 94 of file TileCellSelector.h.

94{0};

◆ m_tileHWID

const TileHWID* TileCellSelector::m_tileHWID {nullptr}
private

Definition at line 72 of file TileCellSelector.h.

72{nullptr};

◆ m_tileID

const TileID* TileCellSelector::m_tileID {nullptr}
private

Definition at line 71 of file TileCellSelector.h.

71{nullptr};

◆ m_tileInfo

const TileInfo* TileCellSelector::m_tileInfo {nullptr}
private

Definition at line 200 of file TileCellSelector.h.

200{nullptr};

◆ m_underflowHG

Gaudi::Property<float> TileCellSelector::m_underflowHG {this, "UnderflowHG", 2.1, "Threshold for underflow in high gain"}
private

Definition at line 187 of file TileCellSelector.h.

187{this, "UnderflowHG", 2.1, "Threshold for underflow in high gain"};

◆ m_underflowLG

Gaudi::Property<float> TileCellSelector::m_underflowLG {this, "UnderflowLG", 0.1, "Threshold for underflow in low gain"}
private

Definition at line 186 of file TileCellSelector.h.

186{this, "UnderflowLG", 0.1, "Threshold for underflow in low gain"};

◆ m_underHG

unsigned int TileCellSelector::m_underHG {0}
private

Definition at line 66 of file TileCellSelector.h.

66{0};

◆ m_underLG

unsigned int TileCellSelector::m_underLG {0}
private

Definition at line 65 of file TileCellSelector.h.

65{0};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.

◆ m_warnerr

unsigned int TileCellSelector::m_warnerr {0}
private

Definition at line 69 of file TileCellSelector.h.

69{0};

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