ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
LArCellNoiseMaskingTool Class Reference

#include <LArCellNoiseMaskingTool.h>

Inheritance diagram for LArCellNoiseMaskingTool:
Collaboration diagram for LArCellNoiseMaskingTool:

Public Member Functions

 LArCellNoiseMaskingTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 
virtual StatusCode process (CaloCellContainer *theCellContainer, const EventContext &ctx) const override
 

Private Attributes

Gaudi::Property< std::vector< std::string > > m_problemsToMask
 
Gaudi::Property< std::vector< std::string > > m_sporadicProblemsToMask
 
SG::ReadCondHandleKey< LArBadChannelContm_bcContKey
 
LArBadChannelMask m_noiseMask
 
LArBadChannelMask m_sporadicNoiseMask
 
int m_qualityCut
 
std::vector< int > m_caloNums
 
bool m_maskNoise
 
bool m_maskSporadic
 

Detailed Description

Definition at line 14 of file LArCellNoiseMaskingTool.h.

Constructor & Destructor Documentation

◆ LArCellNoiseMaskingTool()

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

Definition at line 27 of file LArCellNoiseMaskingTool.cxx.

31  :base_class (type, name, parent),
32  m_qualityCut(65536),
33  m_maskNoise(true),
34  m_maskSporadic(true)
35 {
36  declareProperty("qualityCut",m_qualityCut,"Quality cut for sporadic noise channel");
37  m_caloNums.clear();
38  m_caloNums.push_back( static_cast<int>(CaloCell_ID::LAREM) );
39  m_caloNums.push_back( static_cast<int>(CaloCell_ID::LARHEC) );
40  m_caloNums.push_back( static_cast<int>(CaloCell_ID::LARFCAL) );
41 
42 }

Member Function Documentation

◆ initialize()

StatusCode LArCellNoiseMaskingTool::initialize ( )
overridevirtual

Definition at line 52 of file LArCellNoiseMaskingTool.cxx.

52  {
53 
54  m_maskNoise= not m_problemsToMask.empty();
56 
58 
61 
62  if (m_maskNoise) {
63  ATH_MSG_INFO (" Cell masking for noise/dead channels activated");
64  }
65  else {
66  ATH_MSG_INFO (" Cell masking for noise/dead channels not activated ");
67  }
68 
69  if (m_maskSporadic) {
70  ATH_MSG_INFO (" Cell masking for sporadic noise activated");
71  }
72  else {
73  ATH_MSG_INFO (" Cell masking for sporadic noise not activated ");
74  }
75 
76  return StatusCode::SUCCESS;
77 }

◆ process()

StatusCode LArCellNoiseMaskingTool::process ( CaloCellContainer theCellContainer,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 80 of file LArCellNoiseMaskingTool.cxx.

82 {
83  StatusCode returnSc = StatusCode::SUCCESS ;
84 
85  if (!m_maskNoise && !m_maskSporadic) return returnSc;
86 
88  const LArBadChannelCont* bcCont{*bcContHdl};
89 
90  for (std::vector<int>::const_iterator itrCalo=m_caloNums.begin();itrCalo!=m_caloNums.end();++itrCalo){
91  CaloCell_ID::SUBCALO caloNum=static_cast<CaloCell_ID::SUBCALO>(*itrCalo);
92  CaloCellContainer::iterator itrCell=theCont->beginCalo(caloNum);
93  CaloCellContainer::iterator itrCellEnd=theCont->endCalo(caloNum);
94 
95  for (; itrCell!=itrCellEnd;++itrCell){
96  CaloCell * aCell=*itrCell;
97  Identifier cellId = aCell->ID();
98 
99  bool toMask = false;
100 
101 // sporadic noise masking using quality cut. Logic could be improved using neighbour information...
102  if (m_maskSporadic) {
103  if (aCell->quality() > m_qualityCut) {
104  if (m_sporadicNoiseMask.cellShouldBeMasked(bcCont,cellId)) {
105  toMask=true;
106  ATH_MSG_DEBUG (" Mask sporadic noise cell" << cellId << " E,t,chi2 " << aCell->energy() << " " << aCell->time() << " " << aCell->quality());
107  }
108  }
109  }
110 
111 // high noise / dead channel masking
112  if (m_maskNoise) {
113  if (m_noiseMask.cellShouldBeMasked(bcCont,cellId)) {
114  toMask=true;
115  ATH_MSG_DEBUG (" Mask highNoise/dead cell" << cellId << " E,t,chi2 " << aCell->energy() << " " << aCell->time() << " " << aCell->quality());
116  }
117  }
118 
119 
120  if (toMask) {
121  aCell->setEnergy(0.);
122  aCell->setTime(0.);
123  uint16_t qua=0;
124  aCell->setQuality(qua);
125  uint16_t provenance = (aCell->provenance() | 0x0800);
126  aCell->setProvenance(provenance);
127  }
128 
129  }
130  }
131 
132 
133  return returnSc ;
134 }

Member Data Documentation

◆ m_bcContKey

SG::ReadCondHandleKey<LArBadChannelCont> LArCellNoiseMaskingTool::m_bcContKey
private
Initial value:
{this, "BadChanKey", "LArBadChannel",
"SG key for LArBadChan object"}

Definition at line 35 of file LArCellNoiseMaskingTool.h.

◆ m_caloNums

std::vector<int> LArCellNoiseMaskingTool::m_caloNums
private

Definition at line 43 of file LArCellNoiseMaskingTool.h.

◆ m_maskNoise

bool LArCellNoiseMaskingTool::m_maskNoise
private

Definition at line 44 of file LArCellNoiseMaskingTool.h.

◆ m_maskSporadic

bool LArCellNoiseMaskingTool::m_maskSporadic
private

Definition at line 45 of file LArCellNoiseMaskingTool.h.

◆ m_noiseMask

LArBadChannelMask LArCellNoiseMaskingTool::m_noiseMask
private

Definition at line 39 of file LArCellNoiseMaskingTool.h.

◆ m_problemsToMask

Gaudi::Property<std::vector<std::string> > LArCellNoiseMaskingTool::m_problemsToMask
private
Initial value:
{this,"ProblemsToMask",{},
"Bad-Channel categories to mask entirly"}

Definition at line 31 of file LArCellNoiseMaskingTool.h.

◆ m_qualityCut

int LArCellNoiseMaskingTool::m_qualityCut
private

Definition at line 42 of file LArCellNoiseMaskingTool.h.

◆ m_sporadicNoiseMask

LArBadChannelMask LArCellNoiseMaskingTool::m_sporadicNoiseMask
private

Definition at line 40 of file LArCellNoiseMaskingTool.h.

◆ m_sporadicProblemsToMask

Gaudi::Property<std::vector<std::string> > LArCellNoiseMaskingTool::m_sporadicProblemsToMask
private
Initial value:
{this,"SporadicProblemsToMask",{},
"Bad-Channel categories to mask in case of sporadic noise"}

Definition at line 33 of file LArCellNoiseMaskingTool.h.


The documentation for this class was generated from the following files:
CaloCell_Base_ID::LARFCAL
@ LARFCAL
Definition: CaloCell_Base_ID.h:46
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
LArCellNoiseMaskingTool::m_bcContKey
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
Definition: LArCellNoiseMaskingTool.h:35
CaloCell::setTime
virtual void setTime(float time)
set time
Definition: CaloCell.cxx:151
LArBadXCont
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
Definition: LArBadChannelCont.h:28
LArBadChannelMask::buildBitMask
StatusCode buildBitMask(const std::vector< std::string > &problemsToMask, MsgStream &msg)
Definition: LArBadChannelMask.cxx:10
CaloCell_Base_ID::LARHEC
@ LARHEC
Definition: CaloCell_Base_ID.h:46
CaloCell::provenance
uint16_t provenance() const
get provenance (data member)
Definition: CaloCell.h:338
CaloCell::setEnergy
virtual void setEnergy(float energy)
set energy
Definition: CaloCell.cxx:136
CaloCell::time
float time() const
get time (data member)
Definition: CaloCell.h:352
LArBadChannelMask::cellShouldBeMasked
bool cellShouldBeMasked(const LArBadChannelCont *bcCont, const HWIdentifier &hardwareId) const
Definition: LArBadChannelMask.h:42
LArCellNoiseMaskingTool::m_noiseMask
LArBadChannelMask m_noiseMask
Definition: LArCellNoiseMaskingTool.h:39
CaloCell::energy
double energy() const
get energy (data member)
Definition: CaloCell.h:311
LArCellNoiseMaskingTool::m_maskNoise
bool m_maskNoise
Definition: LArCellNoiseMaskingTool.h:44
LArCellNoiseMaskingTool::m_caloNums
std::vector< int > m_caloNums
Definition: LArCellNoiseMaskingTool.h:43
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
CaloCell::setQuality
virtual void setQuality(uint16_t quality)
set quality
Definition: CaloCell.cxx:156
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
CaloCell_Base_ID::SUBCALO
SUBCALO
enumeration of sub calorimeters
Definition: CaloCell_Base_ID.h:46
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArCellNoiseMaskingTool::m_problemsToMask
Gaudi::Property< std::vector< std::string > > m_problemsToMask
Definition: LArCellNoiseMaskingTool.h:31
CaloCell::setProvenance
void setProvenance(uint16_t prov)
set Provenance
Definition: CaloCell.cxx:167
CaloCell::quality
uint16_t quality() const
get quality (data member)
Definition: CaloCell.h:332
LArCellNoiseMaskingTool::m_sporadicNoiseMask
LArBadChannelMask m_sporadicNoiseMask
Definition: LArCellNoiseMaskingTool.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CaloCell::ID
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition: CaloCell.h:279
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:46
LArCellNoiseMaskingTool::m_qualityCut
int m_qualityCut
Definition: LArCellNoiseMaskingTool.h:42
LArCellNoiseMaskingTool::m_sporadicProblemsToMask
Gaudi::Property< std::vector< std::string > > m_sporadicProblemsToMask
Definition: LArCellNoiseMaskingTool.h:33
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
LArCellNoiseMaskingTool::m_maskSporadic
bool m_maskSporadic
Definition: LArCellNoiseMaskingTool.h:45
Identifier
Definition: IdentifierFieldParser.cxx:14