|
ATLAS Offline Software
|
Go to the documentation of this file.
16 #include "Identifier/Identifier.h"
19 #include "GaudiKernel/ThreadLocalContext.h"
25 const std::string&
name,
const IInterface*
parent)
28 , m_truncationThresholdOnAbsEinSigma(3.0)
29 , m_minimumNumberOfTruncatedChannels(0.6)
30 , m_useTwoGaussNoise(false)
31 , m_useGapCells(false)
73 return StatusCode::SUCCESS;
84 std::string
units[8] = {
"ADC counts",
"pC",
"CspC",
"MeV",
85 "online ADC counts",
"online pC",
"online CspC",
"online MeV" };
91 ATH_MSG_ERROR(
"Due to non-linear CIS constants noise filter is possible only with ADC counts ");
92 ATH_MSG_ERROR(
"Please, disable CIS calibration in optimal filter " );
94 return StatusCode::FAILURE;
122 bool ebNsp = !ebspD4 && eb;
125 static const int maxChannelDrawer = 48;
126 static const int maxChannel = 12;
127 static const int maxMOB = 4;
129 float calib[maxChannelDrawer];
130 float commonmode[maxMOB];
131 int nemptychan[maxMOB];
132 int ngoodchan[maxMOB];
133 int chanmap[maxChannelDrawer];
135 memset(commonmode, 0,
sizeof(commonmode));
136 memset(nemptychan, 0,
sizeof(nemptychan));
137 memset(ngoodchan, 0,
sizeof(ngoodchan));
138 memset(chanmap, 0,
sizeof(chanmap));
150 int mob =
chan / maxChannel;
154 float ped=rch->pedestal();
162 ( ebspC10 && (
chan==4 ||
chan==5)) ||
167 if (chanmap[
chan] < 2 && usechan) ++ngoodchan[mob];
171 float amp = rch->amplitude();
182 float noise_sigma = 1.5;
194 float significance = 999.999;
195 if ((noise_sigma != 0.0)
199 significance = fabs(amp / noise_sigma);
207 <<
" noise " << noise_sigma
208 <<
" significance " << significance );
212 commonmode[mob] += amp;
220 <<
" channel is not used" );
228 for (
int k = 0;
k < maxMOB;
k++) {
232 if (nchmin < 2) nchmin = 2;
235 if (nemptychan[
k] >= nchmin) {
236 commonmode[
k] /= nemptychan[
k];
240 <<
" drawer " << std::setw(2) <<
drawer
241 <<
" mb " <<
k <<
" mean " << commonmode[
k]
242 <<
" taken from " << nemptychan[
k] <<
" channels"
243 <<
" nchgood " << ngoodchan[
k]
244 <<
" nchmin " << nchmin );
248 if (commonmode[
k] != 0.0) {
250 <<
" drawer " << std::setw(2) <<
drawer
252 <<
" mean is zero instead of " << commonmode[
k] <<
" / " << nemptychan[
k]
253 <<
" nchgood " << ngoodchan[
k]
254 <<
" nchmin " << nchmin
258 <<
ros <<
" drawer " << std::setw(2) <<
drawer
260 <<
" mean is zero - nothing to correct"
261 <<
" nchgood " << ngoodchan[
k]
262 <<
" nchmin " << nchmin
270 if (ncorr == 0)
continue;
281 int mob =
chan/maxChannel;
283 rch->setAmplitude (rch->amplitude() - commonmode[mob] /
calib[
chan]);
285 rch->setAmplitude (rch->amplitude() - commonmode[mob]);
286 rch->setPedestal (rch->pedestal() + commonmode[mob]);
291 return StatusCode::SUCCESS;
297 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
virtual StatusCode finalize() override
AlgTool finalize method.
float m_ADCmaskValueMinusEps
indicates channels which were masked in background dataset
float m_minimumNumberOfTruncatedChannels
SG::ReadCondHandleKey< TileSampleNoise > m_sampleNoiseKey
Name of TileSampleNoise in condition store.
float getHfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
const TileInfo * m_tileInfo
#define ATH_MSG_VERBOSE(x)
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
int ADCmaskValue() const
Returns the overlay magic number that indicates channels which were masked in background dataset.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Class that holds Data Quality fragment information and provides functions to extract the data quality...
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
::StatusCode StatusCode
StatusCode definition for legacy code.
Helper for holding non-const raw data prior to recording in SG.
#define CHECK(...)
Evaluate an expression and check for errors.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
bool isAdcDQgood(int partition, int drawer, int ch, int gain) const
returns status of single ADC returns False if there are any errors
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
Name of TileEMScale in condition store.
virtual StatusCode process(TileMutableRawChannelContainer &rchCont, const EventContext &ctx) const override
process the coherent noise subtruction algorithm and correct TileRawChannel amplitudes
HWIdentifier drawer_id(int frag) const
ROS HWIdentifer.
Collection * indexFindPtr(IdentifierHash hash)
Look up a (non-const) collection via hash.
float m_truncationThresholdOnAbsEinSigma
Helpers for checking error return status codes and reporting errors.
StatusCode initialize(bool used=true)
const TileBchStatus & getAdcStatus(const HWIdentifier adc_id) const
Return Tile ADC status.
float undoOnlineChannelCalibration(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude, TileRawChannelUnit::UNIT onlUnit) const
Undo the calibration applied in ROD signal reconstruction.
virtual StatusCode initialize() override
AlgTool initialize method.
Helper for holding non-const raw data prior to recording in SG.
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
const TileHWID * m_tileHWID
Pointer to TileHWID.
SG::ReadCondHandleKey< TileBadChannels > m_badChannelsKey
Name of TileBadChannels in condition store.
TileRawChannelNoiseFilter(const std::string &type, const std::string &name, const IInterface *parent)
AlgTool like constructor.
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,...
Handle class for reading from StoreGate.