ATLAS Offline Software
Loading...
Searching...
No Matches
TileRawChannelBuilderTest.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4/*
5 */
12
13
16
17
24TileRawChannelBuilderTest::rawChannel (const TileDigits* digits, const EventContext& /*ctx*/)
25{
26 const std::vector<float>& samples = digits->samples();
27 float amp = samples.size() > 0 ? samples[0] : 0;
28 float time = samples.size() > 1 ? samples[1] : 0;
29 float qual = samples.size() > 2 ? samples[2] : 0;
30 float ped = samples.size() > 3 ? samples[3] : 0;
31
32 DataPool<TileRawChannel> tileRchPool (100);
33 TileRawChannel *rawCh = tileRchPool.nextElementPtr();
34 rawCh->assign (digits->adc_HWID(), amp, time, qual, ped);
35 return rawCh;
36}
37
a typed memory pool that saves time spent allocation small object.
Definition DataPool.h:63
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
const std::vector< float > & samples() const
Definition TileDigits.h:58
virtual TileRawChannel * rawChannel(const TileDigits *digits, const EventContext &ctx) override
Builder virtual method to be implemented by subclasses.
void assign(const HWIdentifier &id, float amplitude, float time, float quality, float ped=0.0)
HWIdentifier adc_HWID(void) const
Definition TileRawData.h:53
Helper for testing TileRawChannelBuilder.