![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
15 #include "CaloDetDescr/CaloDetDescrElement.h"
20 #include "Identifier/Identifier.h"
27 static const InterfaceID IID_ITileCellNoiseFilter(
"TileCellNoiseFilter", 1, 0);
30 return IID_ITileCellNoiseFilter;
36 const std::string&
name,
const IInterface*
parent)
38 , m_truncationThresholdOnAbsEinSigma(4.0)
39 , m_minimumNumberOfTruncatedChannels(0.6)
40 , m_useTwoGaussNoise(false)
43 declareInterface<TileCellNoiseFilter>(
this);
73 return StatusCode::SUCCESS;
79 const EventContext& ctx)
const
85 ATH_MSG_DEBUG(
"No TileCells in the container - nothing to do");
86 return StatusCode::SUCCESS;
93 caloNoise = noiseH.
cptr();
97 sampleNoise = sampleNoiseHandle.
cptr();
106 int ncorr = this->
calcCM(caloNoise, sampleNoise, *emScale, cellcoll, commonMode);
108 ATH_MSG_DEBUG(
"Failed to calculate common-mode shift - no corrections applied");
109 return StatusCode::SUCCESS;
117 for (; cellItr != lastCell; ++cellItr) {
120 if (tilecell == 0)
continue;
121 if (tilecell->
badcell())
continue;
126 return StatusCode::SUCCESS;
132 return StatusCode::SUCCESS;
138 const cmdata_t& commonMode,
141 bool good1 = !tilecell->
badch1();
142 bool good2 = !tilecell->
badch2();
149 float e1 = tilecell->
ene1();
150 float e2 = tilecell->
ene2();
180 }
else if (!good1 && good2) {
183 }
else if (good1 && !good2) {
200 cmdata_t& commonMode)
const
208 for (; cellItr != lastCell; ++cellItr) {
211 if (tilecell == 0)
continue;
212 if (tilecell->
badcell())
continue;
214 float noise_sigma = 1.5, significance = 0.0;
224 significance = (noise_sigma != 0.0) ? fabs(
cell->energy() / noise_sigma) : 999.999;
227 <<
" ene " <<
cell->energy()
228 <<
" noise " << noise_sigma
229 <<
" significance " << significance );
233 bool good1 = !tilecell->
badch1();
234 bool good2 = !tilecell->
badch2();
256 float amp = tilecell->
ene1() / chanCalMeV;
261 amp = tilecell->
ene1() / chanCalMeV;
271 significance = 999.999;
272 if ((noise_sigma != 0.0)
276 significance = fabs(amp / noise_sigma);
280 <<
" calib " << chanCalMeV
282 <<
" noise " << noise_sigma
283 <<
" significance " << significance );
309 float amp = tilecell->
ene2() / chanCalMeV;
314 amp = tilecell->
ene2() / chanCalMeV;
325 significance = 999.999;
326 if ((noise_sigma != 0.0)
330 significance = fabs(amp / noise_sigma);
335 <<
" calib " << chanCalMeV
337 <<
" noise " << noise_sigma
338 <<
" significance " << significance );
355 for (
int mob = 0; mob <
s_maxMOB; mob++) {
360 if (nchmin < 2) nchmin = 2;
367 <<
" drawer " << std::setw(2) <<
drawer
372 <<
" nchmin " << nchmin );
378 <<
" drawer " << std::setw(2) <<
drawer
383 <<
" nchmin " << nchmin
387 <<
" drawer " << std::setw(2) <<
drawer
389 <<
" mean is zero - nothing to correct"
391 <<
" nchmin " << nchmin
def retrieve(aClass, aKey=None)
virtual bool badcell(void) const override final
check if whole cell is bad (i.e.
const TileHWID * m_tileHWID
Pointer to TileHWID.
Condition object to keep calibration factors of TileCal channels.
IdentifierHash onl2() const
cell online identifier 2
static const int s_maxMOB
int indexLastCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of last cell of given calorimeter (-2 if none) Note that it is normally more efficient to use i...
float getEffectiveSigma(const Identifier id, const int gain, const float energy) const
StatusCode finalize() override
AlgTool finalize method.
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
Condition object to keep and provide Tile sample noise.
float ene1(void) const
get energy of first PMT
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
bool badch1(void) const
check if first PMT is in bad channel list and masked
float m_minimumNumberOfTruncatedChannels
float getHfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
float m_truncationThresholdOnAbsEinSigma
#define ATH_MSG_VERBOSE(x)
bool empty() const
Test if the key is blank.
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
TileCellNoiseFilter(const std::string &type, const std::string &name, const IInterface *parent)
AlgTool like constructor.
static const CaloCell_ID::SUBCALO s_caloIndex
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
static const int s_maxChannel
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
IdentifierHash onl1() const
cell online identifier 1
static const int s_maxDrawer
float calibrateChannel(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude, TileRawChannelUnit::UNIT rawDataUnitIn, TileRawChannelUnit::UNIT rawDataUnitOut) const
Calibrate a Tile channel.
int indexFirstCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of first cell of given calorimeter (-1 if none).
StatusCode initialize() override
AlgTool initialize method.
SG::ReadCondHandleKey< TileSampleNoise > m_sampleNoiseKey
Name of TileSampleNoise in condition store.
setRawEt setRawPhi nCells
::StatusCode StatusCode
StatusCode definition for legacy code.
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
bool badch2(void) const
check if second PMT is in bad channel list and masked
int nCellsCalo(const CaloCell_ID::SUBCALO caloNum) const
get number of cels of given calorimeter
void setCMSEnergy(const TileEMScale *emScale, const cmdata_t &commonMode, TileCell *cell) const
int gain1(void) const
get gain of first PMT
float getCMShift(const cmdata_t &commonMode, int partition, int drawer, int channel) const
static const int s_maxPartition
Helpers for checking error return status codes and reporting errors.
SG::ReadCondHandleKey< CaloNoise > m_caloNoiseKey
StatusCode initialize(bool used=true)
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Container class for CaloCell.
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
Name of TileEMScale in condition store.
virtual void setEnergy(float ene) override final
set total energy, reset eneDiff to zero
HWIdentifier adc_id(int ros, int drawer, int channel, int adc) const
adc HWIdentifer
int gain2(void) const
get gain of second PMT
float ene2(void) const
get energy of second PMT
float cmdata_t[s_maxPartition][s_maxDrawer][s_maxMOB]
virtual StatusCode process(CaloCellContainer *cellcoll, const EventContext &ctx) const override
proceed the coherent noise subtraction algorithm and correct Tile cell energies
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
Data object for each calorimeter readout cell.
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
std::string to_string(const Identifier &id, int level=0) const
const TileID * m_tileID
Pointer to TileID.
ToolHandle< ITileBadChanTool > m_tileBadChanTool
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
std::string to_string(const HWIdentifier &id, int level=0) const
extract all fields from HW identifier HWIdentifier get_all_fields ( const HWIdentifier & id,...
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
const_pointer_type cptr()
int calcCM(const CaloNoise *caloNoise, const TileSampleNoise *sampleNoise, const TileEMScale *emScale, const CaloCellContainer *cellcoll, cmdata_t &commonMode) const