ATLAS Offline Software
TileRawChannelBuilderWienerFilter.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 // Gaudi includes
9 #include "Gaudi/Property.h"
11 
12 // Atlas includes
13 #include "AthAllocators/DataPool.h"
16 
17 // Tile includes
20 #include "CLHEP/Matrix/Matrix.h"
23 #include "TileEvent/TileDigits.h"
24 #include "CaloIdentifier/TileID.h"
27 
28 //using namespace std;
29 #include <algorithm>
30 
31 //interface stuff
32 static const InterfaceID IID_ITileRawChannelBuilderWienerFilter("TileRawChannelBuilderWienerFilter", 1, 0);
33 
34 
36  return IID_ITileRawChannelBuilderWienerFilter;
37 }
38 
39 
40 #define TILE_WienerFilterBUILDERVERBOSE false
41 
43  const std::string& name, const IInterface *parent)
45  , m_nSignal(0)
46  , m_nNegative(0)
47  , m_nCenter(0)
48  , m_nConst(0)
49  , m_nSamples(0)
50  , m_t0SamplePosition(0)
51  , m_maxTime(0.0)
52  , m_minTime(0.0)
53  , m_weights(0)
54 {
55  //declare interfaces
56  declareInterface< TileRawChannelBuilder >( this );
57  declareInterface< TileRawChannelBuilderWienerFilter >(this);
58 
59  m_rawChannelContainerKey = "TileRawChannelWiener";
60 
61  //declare properties
62  declareProperty("MaxIterations",m_maxIterations = 5);
63  declareProperty("PedestalMode",m_pedestalMode = 17);
64  declareProperty("TimeForConvergence",m_timeForConvergence = 0.5);
65  declareProperty("ConfTB",m_confTB = false);
66  declareProperty("Minus1Iteration",m_minus1Iter = false);
67  declareProperty("AmplitudeCorrection",m_correctAmplitude = false);
68  declareProperty("TimeCorrection", m_correctTimeNI = false);
69  declareProperty("BestPhase",m_bestPhase = false);
70  declareProperty("EmulateDSP",m_emulateDsp = false);
71  declareProperty("MC",m_isMC = false);
72 }
73 
74 
76 }
77 
79 
80  ATH_MSG_INFO( "initialize()" );
81 
82  m_rChType = TileFragHash::WienerFilterOffline; // type for offline Wiener Filter
83 
84  // init in superclass
86 
87  // get pointer to weights (loaded by the InfoLoader in TileInfo, from TileWienerFilterWeights)
89  ATH_MSG_DEBUG( "Weights loaded" );
90 
91  if (m_maxIterations != 1) m_correctTimeNI = false;
92 
93  // bits 12-15 - various options
94  // if (m_correctTimeNI) m_bsflags |= 0x1000;
95  if (m_correctAmplitude) m_bsflags |= 0x2000;
96  if (m_maxIterations > 1) m_bsflags |= 0x4000;
97  if (m_bestPhase) m_bsflags |= 0x8000;
98 
99  ATH_MSG_DEBUG( " MaxIterations=" << m_maxIterations
100  << " PedestalMode=" << m_pedestalMode
101  << " TimeForConvergence=" << m_timeForConvergence
102  << " ConfTB=" << m_confTB
103  << " Minus1Iteration=" << m_minus1Iter
104  << " AmplitudeCorrection=" << m_correctAmplitude
105  << " TimeCorrection=" << m_correctTimeNI
106  << " Best Phase " << m_bestPhase );
107 
110  m_maxTime = 25 * (m_nSamples - m_t0SamplePosition - 1);
112  ATH_MSG_DEBUG(" NSamples=" << m_nSamples
113  << " T0Sample=" << m_t0SamplePosition
114  << " minTime=" << m_minTime
115  << " maxTime=" << m_maxTime );
116 
117  if (m_pedestalMode % 10 > 2 && m_nSamples != m_pedestalMode % 10) {
118  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Changing PedestalMode from " << m_pedestalMode;
119  m_pedestalMode = (m_pedestalMode / 10) * 10 + m_nSamples;
120  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " to " << m_pedestalMode << endmsg;
121  }
122 
123  if (m_nSamples != 7 && (m_pedestalMode == 71 || m_pedestalMode == 7621)) {
124  ATH_MSG_ERROR( "Incompatable pedestal mode [" << m_pedestalMode
125  << "] and number of samples [" << m_nSamples << "]" );
126  return StatusCode::FAILURE;
127  }
128 
129  m_nSignal = 0;
130  m_nNegative = 0;
131  m_nCenter = 0;
132  m_nConst = 0;
133 
134  //=== get TileCondToolNoiseSample
135  ATH_CHECK( m_tileToolNoiseSample.retrieve() );
136 
137  if (m_bestPhase) {
138  //=== get TileToolTiming
139  // TileToolTiming can be disabled in the TileRawChannelBuilder
140  if (!m_tileToolTiming.isEnabled()) {
141  m_tileToolTiming.enable();
142  }
143  ATH_CHECK( m_tileToolTiming.retrieve() );
144  }
145 
146  //=== get BunchCrossingCondData
148 
149  ATH_MSG_INFO( "initialization completed" );
150 
151  return StatusCode::SUCCESS;
152 }
153 
155 
156  if (msgLvl(MSG::VERBOSE)) {
157  msg(MSG::VERBOSE) << "Counters: Signal=" << m_nSignal
158  << " Constant=" << m_nConst
159  << " Total=" << m_nSignal + m_nConst << endmsg;
160  }
161 
162  ATH_MSG_DEBUG( "Finalizing" );
163 
164  return StatusCode::SUCCESS;
165 }
166 
167 
169 
170  ++m_chCounter;
171 
172  double pedestal = 0.;
173  double energy = 0.;
174  double time = 0.;
175  double chi2 = 0.;
176  m_digits = digits->samples();
177  m_digits.erase(m_digits.begin(),m_digits.begin()+m_firstSample);
178  m_digits.resize(m_nSamples);
179  const HWIdentifier adcId = digits->adc_HWID();
180  int gain = m_tileHWID->adc(adcId);
181 
182  ATH_MSG_VERBOSE( "Building Raw Channel, with WienerFilter, HWID:" << m_tileHWID->to_string(adcId)
183  << " gain=" << gain );
184 
185  int ros = m_tileHWID->ros(adcId);
186  int drawer = m_tileHWID->drawer(adcId);
187  int channel = m_tileHWID->channel(adcId);
188 
189  chi2 = filter(ros, drawer, channel, gain, pedestal, energy, time, ctx);
190 
191  unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
192 
193  if (m_calibrateEnergy) {
194  energy = m_tileToolEmscale->doCalibCis(drawerIdx, channel, gain, energy);
195  }
196 
197  if (msgLvl(MSG::VERBOSE)) {
198  msg(MSG::VERBOSE) << "Creating WienerFilter RawChannel"
199  << " a=" << energy
200  << " t=" << time
201  << " ped=" << pedestal
202  << " q=" << chi2 << endmsg;
203 
204  msg(MSG::VERBOSE) << "digits:";
205 
206  for (unsigned int i = 0; i < m_digits.size(); ++i)
207  msg(MSG::VERBOSE) << " " << m_digits[i];
208 
209  msg(MSG::VERBOSE) << " " << endmsg;
210  }
211 
213  TileRawChannel *rawCh = tileRchPool.nextElementPtr();
214  rawCh->assign (adcId,
215  energy,
216  time,
217  chi2,
218  pedestal);
219 
220  if (m_correctTime
221  && (time != 0
222  && time < m_maxTime
223  && time > m_minTime)) {
224 
225  time -= m_tileToolTiming->getSignalPhase(drawerIdx, channel, gain);
226  rawCh->insertTime(time);
227 
228  ATH_MSG_VERBOSE( "Correcting time, new time=" << rawCh->time() );
229 
230  }
231 
232  if (TileID::HIGHGAIN == gain) {
233  ++m_nChH;
234  m_RChSumH += energy;
235  } else {
236  ++m_nChL;
237  m_RChSumL += energy;
238  }
239 
240  return rawCh;
241 }
242 
243 
245 
246  ATH_MSG_VERBOSE( " findMaxDigitPosition()" );
247 
248  int iMaxDigit = 0;
249  float maxDigit = 0.;
250  bool saturated = false;
251 
252  for (unsigned int i = 0; i < m_digits.size(); i++) {
253  if (m_digits[i] > 1022.99) saturated = true;
254  if (maxDigit < m_digits[i]) {
255  maxDigit = m_digits[i];
256  iMaxDigit = i;
257  }
258  }
259 
260  if (msgLvl(MSG::VERBOSE)) {
261  for (unsigned int i = 0; i < m_digits.size(); i++) {
262  msg(MSG::VERBOSE) << " " << m_digits[i];
263  }
264 
265  msg(MSG::VERBOSE) << "; Max: digit[" << iMaxDigit << "]=" << maxDigit << endmsg;
266 
267  if (saturated) msg(MSG::VERBOSE) << " Samples saturated" << endmsg;
268  }
269 
270  return iMaxDigit;
271 }
272 
273 
274 float TileRawChannelBuilderWienerFilter::getPedestal(int ros, int drawer, int channel, int gain, const EventContext &ctx) {
275  float pedestal = 0.;
276 
277  switch (m_pedestalMode) {
278  case -1:
279  // use pedestal from conditions DB
281  break;
282  case 7:
283  pedestal = m_digits[6];
284  break;
285  case 9:
286  pedestal = m_digits[8];
287  break;
288  case 12:
289  pedestal = .5 * (m_digits[0] + m_digits[1]);
290  break;
291  case 17:
292  pedestal = .5 * (m_digits[0] + m_digits[6]);
293  break;
294  case 19:
295  pedestal = .5 * (m_digits[0] + m_digits[8]);
296  break;
297  case 71:
298  pedestal = std::min(m_digits[0], m_digits[6]);
299  break;
300  case 7621:
301  pedestal = 0.5 * std::min(m_digits[0] + m_digits[1], m_digits[5] + m_digits[6]);
302  break;
303  default:
304  pedestal = m_digits[0];
305  break;
306  }
307 
308  ATH_MSG_VERBOSE("getPedestal(): pedestal=" << pedestal);
309 
310  return pedestal;
311 }
312 
314  int bcidIndex = -1;
315 
316  const xAOD::EventInfo* eventInfo(0);
317 
318  if (evtStore()->retrieve(eventInfo).isSuccess()) {
320  if (bcData.isValid()) {
321  const int bcid = eventInfo->bcid();
322  const int distFront = bcData->distanceFromFront(bcid, BunchCrossingCondData::BunchDistanceType::BunchCrossings);
323  const int distTail = bcData->distanceFromTail(bcid, BunchCrossingCondData::BunchDistanceType::BunchCrossings);
324 
325  ATH_MSG_VERBOSE( "EventInfo loaded: "
326  << " BCID=" << bcid
327  << " DistFront=" << distFront
328  << " DistTail=" << distTail);
329 
330  if (distFront == -1 || distTail == -1) {
331  bcidIndex = -1;
332  } else if (distFront < 3 && distTail > distFront) {
333  bcidIndex = distFront;
334  } else if (distTail < 3 && distTail < distFront) {
335  bcidIndex = 6 - distTail;
336  } else {
337  bcidIndex = 3;
338  }
339  } else {
340  ATH_MSG_VERBOSE("BunchCrossingCondData not available");
341  }
342  } else {
343  ATH_MSG_VERBOSE("EventInfo not available");
344  }
345 
346  ATH_MSG_VERBOSE("getBCIDIndex(): bcidIndex=" << bcidIndex);
347 
348  return bcidIndex;
349 }
350 
351 
353  , int &gain, double &pedestal, double &amplitude, double &time, const EventContext &ctx) {
354 
355  ATH_MSG_VERBOSE( "filter()" );
356 
357  amplitude = 0.;
358  time = 0.;
359  double chi2 = 0.;
360 
361  auto minMaxDigits = std::minmax_element(m_digits.begin(), m_digits.end());
362  float minDigit = *minMaxDigits.first;
363  float maxDigit = *minMaxDigits.second;
364 
365  if (maxDigit - minDigit < 0.01) { // constant value in all samples
366 
367  pedestal = minDigit;
368  chi2 = 0.;
369  ATH_MSG_VERBOSE( "CASE NO SIGNAL: maxdig-mindig = " << maxDigit << "-" << minDigit
370  << " = " << maxDigit - minDigit );
371 
372  m_nConst++;
373 
374  } else {
375  double weights[8];
376  memset(weights, 0, sizeof(weights));
377 
378  int bcidIndex = getBCIDIndex(ctx);
379 
380  // check if it is E3 or E4 cells and if the BCID is available
381  if (ros > 2 && (channel == 0 || channel == 1) && bcidIndex > -1) {
382  ATH_MSG_VERBOSE( "Switch to optimal weights");
383  for (unsigned int i = 0; i < 8; i++) {
384  weights[i] = m_weights->optimalWeights[bcidIndex][i];
385  }
386  } else {
387  ATH_MSG_VERBOSE( "Switch to general weights");
388  for (unsigned int i = 0; i < 8; i++) {
389  weights[i] = m_weights->generalWeights[ros-1][channel][i];
390  }
391  }
392 
393  // apply filter
394  for (unsigned int i = 0; i < m_digits.size(); i++) {
395  amplitude += weights[i] * m_digits[i]; // Wiener coefs
396  }
397  amplitude += weights[7]; // Wiener bias
398 
399  double phase = 0.;
400  pedestal = getPedestal(ros, drawer, channel, gain, ctx);
401 
402  chi2 = compute(ros, drawer, channel, gain, pedestal, amplitude, time, phase);
403 
404  m_nSignal++;
405  }
406 
407  return chi2;
408 }
409 
411  double &pedestal, double &amplitude, double &time, double& phase) {
412 
413  ATH_MSG_VERBOSE( "compute();"
414  << " ros=" << ros
415  << " drawer=" << drawer
416  << " channel=" << channel
417  << " gain=" << gain
418  << " pedestal=" << pedestal
419  << " amplitude=" << amplitude
420  << " time=" << time
421  << " phase=" << phase );
422 
423  double chi2 = 0.;
424  return chi2;
425 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
BunchCrossingCondData::distanceFromTail
int distanceFromTail(const bcid_type bcid, const BunchDistanceType type=NanoSec) const
The distance of the specific bunch crossing from the tail of the train.
Definition: BunchCrossingCondData.cxx:60
ReadOfcFromCool.phase
phase
Definition: ReadOfcFromCool.py:127
TileRawChannelBuilderWienerFilter::m_nConst
int m_nConst
internal counters
Definition: TileRawChannelBuilderWienerFilter.h:99
TileRawChannelBuilder::m_dataPoollSize
int m_dataPoollSize
Definition: TileRawChannelBuilder.h:204
TileRawChannel.h
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
TileRawChannelBuilder::m_tileToolEmscale
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
Definition: TileRawChannelBuilder.h:166
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TileRawChannelBuilder::m_chCounter
unsigned int m_chCounter
Definition: TileRawChannelBuilder.h:196
TileRawChannelBuilderWienerFilter::interfaceID
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
Definition: TileRawChannelBuilderWienerFilter.cxx:35
TileRawChannelBuilderWienerFilter::m_maxTime
double m_maxTime
max allowed time = 25*(m_nSamples-1)/2
Definition: TileRawChannelBuilderWienerFilter.h:103
TileInfo::NdigitSamples
int NdigitSamples() const
Returns the number of sammples (digits) per event.
Definition: TileInfo.h:75
TileRawChannelBuilder::m_calibrateEnergy
bool m_calibrateEnergy
Definition: TileRawChannelBuilder.h:142
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TileRawChannelBuilderWienerFilter::m_minTime
double m_minTime
min allowed time = -25*(m_nSamples-1)/2
Definition: TileRawChannelBuilderWienerFilter.h:104
TileRawChannelBuilder::m_tileHWID
const TileHWID * m_tileHWID
Definition: TileRawChannelBuilder.h:161
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
TileRawChannelBuilderWienerFilter::m_nSamples
int m_nSamples
number of samples in the data
Definition: TileRawChannelBuilderWienerFilter.h:101
SG::ReadCondHandle::isValid
bool isValid()
Definition: ReadCondHandle.h:205
TileRawChannelBuilder::initialize
virtual StatusCode initialize()
Initializer.
Definition: TileRawChannelBuilder.cxx:98
TileRawChannelBuilderWienerFilter::m_isMC
bool m_isMC
bool variable for MC: true=> MC; false=> data
Definition: TileRawChannelBuilderWienerFilter.h:89
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
TileInfo.h
Tile_Base_ID::HIGHGAIN
@ HIGHGAIN
Definition: Tile_Base_ID.h:57
TileCalibUtils.h
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TileRawChannelBuilderWienerFilter::m_timeForConvergence
double m_timeForConvergence
minimum time difference to quit iteration procedure
Definition: TileRawChannelBuilderWienerFilter.h:88
TileRawData::adc_HWID
HWIdentifier adc_HWID(void) const
Definition: TileRawData.h:53
HWIdentifier
Definition: HWIdentifier.h:13
TileRawChannelBuilder::m_tileToolTiming
ToolHandle< TileCondToolTiming > m_tileToolTiming
Definition: TileRawChannelBuilder.h:169
TileRawChannel::time
float time(int ind=0) const
Definition: TileRawChannel.h:103
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
TileHWID::channel
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
Definition: TileHWID.h:189
TileID.h
TileRawChannel::assign
void assign(const HWIdentifier &id, float amplitude, float time, float quality, float ped=0.0)
Definition: TileRawChannel.h:63
TileHWID::ros
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
Definition: TileHWID.h:167
TileInfo::getWienerFilterWeights
const TileWienerFilterWeightsStruct * getWienerFilterWeights() const
Return pointer to TileWienerFilterWeights.
Definition: TileInfo.h:256
TileRawChannelContainer.h
xAOD::saturated
setScaleOne setStatusOne saturated
Definition: gFexGlobalRoI_v1.cxx:51
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
TilePulseShapes.h
TileRawChannelBuilder::m_rChType
TileFragHash::TYPE m_rChType
Definition: TileRawChannelBuilder.h:136
TileHWID::adc
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
Definition: TileHWID.h:193
TileInfo::ItrigSample
int ItrigSample() const
The sample at which the pulse should ideally peak.
Definition: TileInfo.h:77
TileRawChannelBuilder::m_nChL
int m_nChL
Definition: TileRawChannelBuilder.h:198
TileRawChannelBuilderWienerFilter::m_digits
std::vector< float > m_digits
Definition: TileRawChannelBuilderWienerFilter.h:108
TileHWID.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TileWienerFilterWeightsStruct::generalWeights
double generalWeights[4][48][8]
Definition: TileWienerFilterWeights.h:13
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
TileRawChannelBuilderWienerFilter::~TileRawChannelBuilderWienerFilter
~TileRawChannelBuilderWienerFilter()
Destructor.
Definition: TileRawChannelBuilderWienerFilter.cxx:75
lumiFormat.i
int i
Definition: lumiFormat.py:92
TileRawChannelBuilder::m_bsflags
unsigned int m_bsflags
Definition: TileRawChannelBuilder.h:138
TileRawChannelBuilderWienerFilter::m_nCenter
int m_nCenter
internal counters
Definition: TileRawChannelBuilderWienerFilter.h:98
TileDigitsContainer.h
TileRawChannelBuilder::m_rawChannelContainerKey
SG::WriteHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
Definition: TileRawChannelBuilder.h:129
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
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
TileRawChannelBuilderWienerFilter::m_bunchCrossingKey
SG::ReadCondHandleKey< BunchCrossingCondData > m_bunchCrossingKey
Tool to get distance into bunch train.
Definition: TileRawChannelBuilderWienerFilter.h:72
TileRawChannelBuilderWienerFilter::m_nSignal
int m_nSignal
internal counters
Definition: TileRawChannelBuilderWienerFilter.h:96
TileRawChannelBuilder::m_nChH
int m_nChH
Definition: TileRawChannelBuilder.h:199
TileRawChannelBuilderWienerFilter::m_correctAmplitude
bool m_correctAmplitude
If true, resulting amplitude is corrected when using weights for tau=0 without iteration.
Definition: TileRawChannelBuilderWienerFilter.h:91
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
TileRawChannel
Definition: TileRawChannel.h:35
TileRawChannelBuilderWienerFilter::m_correctTimeNI
bool m_correctTimeNI
If true, resulting time is corrected when using method without iteration.
Definition: TileRawChannelBuilderWienerFilter.h:92
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TileRawChannelBuilderWienerFilter::finalize
virtual StatusCode finalize() override
Finalize method.
Definition: TileRawChannelBuilderWienerFilter.cxx:154
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TileRawChannelBuilder::m_RChSumL
double m_RChSumL
Definition: TileRawChannelBuilder.h:200
TileRawChannelBuilderWienerFilter::compute
double compute(int ros, int drawer, int channel, int gain, double &pedestal, double &amplitude, double &time, double &phase)
Gets the BCID index within the train.
Definition: TileRawChannelBuilderWienerFilter.cxx:410
TileRawChannelBuilderWienerFilter::initialize
virtual StatusCode initialize() override
Initialize method.
Definition: TileRawChannelBuilderWienerFilter.cxx:78
TileRawChannelBuilderWienerFilter::m_minus1Iter
bool m_minus1Iter
bool variable for whether to apply -1 iteration (initial phase guess)
Definition: TileRawChannelBuilderWienerFilter.h:90
TileRawChannelBuilder
Definition: TileRawChannelBuilder.h:59
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
TileRawChannelBuilderWienerFilter::m_bestPhase
bool m_bestPhase
Definition: TileRawChannelBuilderWienerFilter.h:94
TileRawChannelBuilderWienerFilter::findMaxDigitPosition
int findMaxDigitPosition()
Finds maximum digit position in the pulse.
Definition: TileRawChannelBuilderWienerFilter.cxx:244
DataPool::nextElementPtr
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
TileDigits::samples
const std::vector< float > & samples() const
Definition: TileDigits.h:58
DataPool.h
TileRawChannelBuilderWienerFilter::m_maxIterations
int m_maxIterations
maximum number of iteration to perform
Definition: TileRawChannelBuilderWienerFilter.h:85
min
#define min(a, b)
Definition: cfImp.cxx:40
TileRawChannelBuilder::m_correctTime
bool m_correctTime
Definition: TileRawChannelBuilder.h:145
BunchCrossingCondData::distanceFromFront
int distanceFromFront(const bcid_type bcid, const BunchDistanceType type=NanoSec) const
The distance of the specific bunch crossing from the front of the train.
Definition: BunchCrossingCondData.cxx:35
TileRawChannelBuilder::m_tileInfo
const TileInfo * m_tileInfo
Definition: TileRawChannelBuilder.h:216
TileRawChannelBuilderWienerFilter.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
TileDigits
Definition: TileDigits.h:30
errorcheck.h
Helpers for checking error return status codes and reporting errors.
TileRawChannel::insertTime
void insertTime(float time)
Definition: TileRawChannel.cxx:76
TileRawChannelBuilderWienerFilter::m_confTB
bool m_confTB
use testbeam configuration
Definition: TileRawChannelBuilderWienerFilter.h:87
TileRawChannelBuilderWienerFilter::TileRawChannelBuilderWienerFilter
TileRawChannelBuilderWienerFilter(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: TileRawChannelBuilderWienerFilter.cxx:42
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
TileFragHash::WienerFilterOffline
@ WienerFilterOffline
Definition: TileFragHash.h:36
EventInfo.h
TileRawChannelBuilderWienerFilter::m_tileToolNoiseSample
ToolHandle< TileCondToolNoiseSample > m_tileToolNoiseSample
Definition: TileRawChannelBuilderWienerFilter.h:69
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
TileRawChannelBuilderWienerFilter::m_pedestalMode
int m_pedestalMode
pedestal mode to use
Definition: TileRawChannelBuilderWienerFilter.h:86
TileRawChannelBuilderWienerFilter::getPedestal
float getPedestal(int ros, int drawer, int channel, int gain, const EventContext &ctx)
Computes A,time,ped using OF.
Definition: TileRawChannelBuilderWienerFilter.cxx:274
TileHWID::drawer
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
Definition: TileHWID.h:171
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
TileRawChannelBuilder::m_RChSumH
double m_RChSumH
Definition: TileRawChannelBuilder.h:201
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
DataPool
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
Definition: DataPool.h:47
TileRawChannelBuilderWienerFilter::m_nNegative
int m_nNegative
internal counters
Definition: TileRawChannelBuilderWienerFilter.h:97
TileRawChannelBuilder::m_firstSample
int m_firstSample
Definition: TileRawChannelBuilder.h:140
TileRawChannelBuilderWienerFilter::filter
double filter(int ros, int drawer, int channel, int &gain, double &pedestal, double &amplitude, double &time, const EventContext &ctx)
Definition: TileRawChannelBuilderWienerFilter.cxx:352
TileRawChannelBuilderWienerFilter::rawChannel
virtual TileRawChannel * rawChannel(const TileDigits *digits, const EventContext &ctx) override
Builder virtual method to be implemented by subclasses.
Definition: TileRawChannelBuilderWienerFilter.cxx:168
TileRawChannelBuilderWienerFilter::m_t0SamplePosition
int m_t0SamplePosition
position of peak sample = (m_nSamples-1)/2
Definition: TileRawChannelBuilderWienerFilter.h:102
TileCalibUtils::getDrawerIdx
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Definition: TileCalibUtils.cxx:60
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
TileHWID::to_string
std::string to_string(const HWIdentifier &id, int level=0) const
extract all fields from HW identifier HWIdentifier get_all_fields ( const HWIdentifier & id,...
Definition: TileHWID.cxx:49
TileRawChannelBuilderWienerFilter::m_emulateDsp
bool m_emulateDsp
Definition: TileRawChannelBuilderWienerFilter.h:95
TileRawChannelBuilderWienerFilter::getBCIDIndex
int getBCIDIndex(const EventContext &ctx)
Definition: TileRawChannelBuilderWienerFilter.cxx:313
xAOD::EventInfo_v1::bcid
uint32_t bcid() const
The bunch crossing ID of the event.
IGeoModelSvc.h
TileDigits.h
TileRawChannelBuilderWienerFilter::m_weights
const TileWienerFilterWeightsStruct * m_weights
structure for Wiener Filter weights
Definition: TileRawChannelBuilderWienerFilter.h:106
TileWienerFilterWeightsStruct::optimalWeights
double optimalWeights[7][8]
Definition: TileWienerFilterWeights.h:14
TileRawChannelUnit::ADCcounts
@ ADCcounts
Definition: TileRawChannelUnit.h:17