ATLAS Offline Software
Loading...
Searching...
No Matches
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
Gaudi::Property< std::vector< std::string > > m_problemsToMask
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
LArBadChannelMask m_sporadicNoiseMask
Gaudi::Property< std::vector< std::string > > m_sporadicProblemsToMask
MsgStream & msg
Definition testRead.cxx:32

◆ 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
87 SG::ReadCondHandle<LArBadChannelCont> bcContHdl{m_bcContKey,ctx};
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}
#define ATH_MSG_DEBUG(x)
LArBadXCont< LArBadChannel > LArBadChannelCont
CaloCell_Base_ID::SUBCALO SUBCALO
Definition CaloCell_ID.h:50
float time() const
get time (data member)
Definition CaloCell.h:368
virtual void setTime(float time)
set time
Definition CaloCell.h:484
double energy() const
get energy (data member)
Definition CaloCell.h:327
uint16_t provenance() const
get provenance (data member)
Definition CaloCell.h:354
uint16_t quality() const
get quality (data member)
Definition CaloCell.h:348
virtual void setEnergy(float energy)
set energy
Definition CaloCell.h:472
void setQuality(uint16_t quality)
set quality
Definition CaloCell.h:460
void setProvenance(uint16_t prov)
set Provenance
Definition CaloCell.h:490
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition CaloCell.h:295
DataModel_detail::iterator< DataVector > iterator
Definition DataVector.h:842
::StatusCode StatusCode
StatusCode definition for legacy code.
setWord1 uint16_t

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.

35 {this, "BadChanKey", "LArBadChannel",
36 "SG key for LArBadChan object"};

◆ 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.

31 {this,"ProblemsToMask",{},
32 "Bad-Channel categories to mask entirly"};

◆ 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.

33 {this,"SporadicProblemsToMask",{},
34 "Bad-Channel categories to mask in case of sporadic noise"};

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