ATLAS Offline Software
Loading...
Searching...
No Matches
TileHitToRawChannel Class Reference

This algorithm builds TileRawChannels from TileHits. More...

#include <TileHitToRawChannel.h>

Inheritance diagram for TileHitToRawChannel:

Public Member Functions

 TileHitToRawChannel (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor.
virtual ~TileHitToRawChannel ()
 Destructor.
virtual StatusCode initialize () override
 initialize method
virtual StatusCode execute (const EventContext &ctx) override
 execute method
virtual StatusCode finalize () override
 finalize method
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< TileHitContainer > m_hitContainerKey
SG::WriteHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
SG::ReadCondHandleKey< TileSamplingFraction > m_samplingFractionKey
 Name of TileSamplingFraction in condition store.
Gaudi::Property< std::string > m_infoName {this, "TileInfoName", "TileInfo"}
 name of the TileInfo object
Gaudi::Property< double > m_deltaT {this, "DeltaT", -1.0}
 if true, keep only hits in deltaT range
Gaudi::Property< bool > m_calibrateEnergy {this, "calibrateEnergy", false}
 if true, amplitude is converted to pCb
TileRawChannelUnit::UNIT m_rChUnit {TileRawChannelUnit::ADCcounts}
 Units used for the TileRawChannels (ADC, pCb, etc.)(see TileInfo.h).
TileFragHash::TYPE m_rChType {TileFragHash::Default}
 Type of TileRawChannels (Digitizar, OF1, OF2, Fit, etc.)(see TileFragHash.h).
const TileID * m_tileID {nullptr}
 Pointer to TileID helper.
const TileTBID * m_tileTBID {nullptr}
 Pointer to TileID helper.
const TileHWID * m_tileHWID {nullptr}
 Pointer to TileHWID helper.
const TileInfo * m_tileInfo {nullptr}
 Pointer to TileInfo.
const TileCablingService * m_cabling {nullptr}
 Pointer to the TileCablingService instance.
std::vector< HWIdentifier * > m_all_ids
 Vector to store all the drawer ids.
bool m_tileNoise {false}
 If true => generate noise for the TileRawChannel creation.
bool m_tileThresh {false}
 If true => apply threshold on the conversion to raw channels.
double m_threshHi {0.0}
 Value of the mimimal amplitude required to do the conversion to raw channel in high gain (not used for low gain).
double m_ampMaxHi {0.0}
 Value of the maximum amplitude to be stored as a high gain channel.
ServiceHandle< TileCablingSvc > m_cablingSvc
 Name of Tile cabling service.
ServiceHandle< IAthRNGSvc > m_atRndmGenSvc {this, "RndmSvc", "AthRNGSvc", ""}
 Random number generator engine to use.
Gaudi::Property< std::string > m_randomStreamName {this, "RandomStreamName", "Tile_DigitsMaker", ""}
 Random Stream Name.
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
 Name of TileEMScale in condition store.
ToolHandle< TileCondToolNoiseSample > m_tileToolNoiseSample
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

This algorithm builds TileRawChannels from TileHits.

TileRawChannel amplitude, time and quality are obtianed from the TileHits. Noise is applied to the amplitude.

TileHitToRawChannell takes as input the TileRawChanels in a TileRawChannel container and combine them in order to create TileCells (For barrel and ext.barrel, two RawChanels feed into each cell; for the Gap cells, there is only one PMT.) Calibrations constants are applied, and the total energy in the cell, the mean time of the energy deposition, and the quality of the measurement are returned.

Definition at line 78 of file TileHitToRawChannel.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TileHitToRawChannel()

TileHitToRawChannel::TileHitToRawChannel ( const std::string & name,
ISvcLocator * pSvcLocator )

Constructor.

Definition at line 51 of file TileHitToRawChannel.cxx.

52 : AthAlgorithm(name, pSvcLocator)
53{
54}
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.

◆ ~TileHitToRawChannel()

TileHitToRawChannel::~TileHitToRawChannel ( )
virtual

Destructor.

Definition at line 56 of file TileHitToRawChannel.cxx.

56 {
57 std::vector<HWIdentifier *>::iterator itr = m_all_ids.begin();
58 std::vector<HWIdentifier *>::iterator last = m_all_ids.end();
59
60 for (; itr != last; ++itr) {
61 delete[] (*itr);
62 }
63}
std::vector< HWIdentifier * > m_all_ids
Vector to store all the drawer ids.

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode TileHitToRawChannel::execute ( const EventContext & ctx)
overridevirtual

execute method

Implements AthAlgorithm.

Definition at line 150 of file TileHitToRawChannel.cxx.

150 {
151
152 ATH_MSG_DEBUG( "Executing TileHitToRawChannel" );
153
154
155 ATHRNG::RNGWrapper* rngWrapper = m_atRndmGenSvc->getEngine(this, m_randomStreamName);
156 rngWrapper->setSeed( m_randomStreamName, ctx );
157 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->getEngine(ctx);
158
159 SG::ReadCondHandle<TileSamplingFraction> samplingFraction(m_samplingFractionKey, ctx);
160 ATH_CHECK( samplingFraction.isValid() );
161
162 SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey, ctx);
163 ATH_CHECK( emScale.isValid() );
164
165 // step1: read hits from TES
166 SG::ReadHandle<TileHitContainer> hitContainer(m_hitContainerKey, ctx);
167 ATH_CHECK( hitContainer.isValid() );
168
169 //Zero sums for monitoring.
170 int nChan = 0;
171 int nChLG = 0;
172 int nChHG = 0;
173 double eHitTot = 0.;
174 double eCh = 0.;
175 double eChLG = 0.;
176 double eChHG = 0.;
177
178 // prepare arrays for all channels in one drawer (collection)
179 const int nChMax = 48;
180 double random[nChMax];
181 memset(random, 0, sizeof(random));
182 HWIdentifier * adc_ids;
183 int adc_gain[nChMax];
184 double adc_ampl[nChMax];
185 double adc_time[nChMax];
186 double adc_qual[nChMax];
187
188 IdContext drawer_context = m_tileHWID->drawer_context();
189
190 // step2: form raw channels, and put them in container
191 auto rawChannelContainer = std::make_unique<TileMutableRawChannelContainer>(true, m_rChType, m_rChUnit);
192 ATH_CHECK( rawChannelContainer->status() );
193
194 // iterate over all collections in a container
195 for (const TileHitCollection* hitCollection : *hitContainer) {
196
197 HWIdentifier drawer_id = m_tileHWID->drawer_id(hitCollection->identify());
198 int ros = m_tileHWID->ros(drawer_id);
199 int drawer = m_tileHWID->drawer(drawer_id);
200 int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
201 if (m_cabling->connected(ros, drawer)) {
202 ATH_MSG_VERBOSE( "ROS " << ros
203 << " drawer " << drawer
204 << " is connected" );
205 } else {
206 continue;
207 }
208 int ch;
209
210 ATH_MSG_VERBOSE( MSG::hex
211 << "Collection = 0x" << hitCollection->identify() << MSG::dec
212 << " : ROS=" << ros
213 << ", drawer=" << drawer );
214
215 IdentifierHash idhash;
216 /* int result = */m_tileHWID->get_hash(drawer_id, idhash, &drawer_context);
217 adc_ids = m_all_ids[idhash];
218
219 // If tileNoise is requested, generate random numbers to give noise
220 if (m_tileNoise) {
221
222 RandGaussQ::shootArray(rndmEngine, nChMax, random, 0.0, 1.0);
223
224 for (ch = 0; ch < nChMax; ++ch) {
225 adc_gain[ch] = TileID::HIGHGAIN;
226 adc_ampl[ch] = random[ch] * m_tileToolNoiseSample->getHfn(drawerIdx, ch, TileID::HIGHGAIN, TileRawChannelUnit::ADCcounts, ctx)
227 * m_tileInfo->getNoiseScaleFactor();
228
229 }
230 } else {
231 memset(adc_gain, -1, sizeof(adc_gain)); /* TileID::INVALID */
232 memset(adc_ampl, 0, sizeof(adc_ampl));
233 }
234
235 memset(adc_time, 0, sizeof(adc_time));
236 memset(adc_qual, 0, sizeof(adc_qual));
237
238 // iterate over all hits in a collection
239 for (const TileHit* tile_hit : *hitCollection) {
240
241 // Get hit Identifier (= identifier of pmt)
242 Identifier pmt_id = tile_hit->pmt_ID();
243 HWIdentifier channel_id = tile_hit->pmt_HWID();
244
245 // index for array is the channel number
246 ch = m_tileHWID->channel(channel_id);
247
248 /* Get hit amplitude and convert to energy (cell-dependent) */
249 double e_hit = tile_hit->energy();
250 double time = tile_hit->time();
251 if (m_deltaT > 0.0) {
252 if (fabs(time) >= m_deltaT) { // reset first hit if it's outside deltaT window
253 e_hit = 0.0;
254 time = 0.0;
255 }
256 double etime = e_hit * time;
257 for (int i = tile_hit->size() - 1; i > 0; --i) { // don't use first hit (i=0)
258 double en = tile_hit->energy(i);
259 double ti = tile_hit->time(i);
260 if (fabs(ti) < m_deltaT && en > 0.0) {
261 e_hit += en;
262 etime += en * ti;
263 }
264 }
265 if (e_hit > 0.0)
266 time = etime / e_hit;
267 else
268 continue; // go to next hit, do not create channels with zero energy
269 }
270 adc_time[ch] = time;
271 double hit_calib = samplingFraction->getSamplingFraction(drawerIdx, ch);
272 double e_ch = e_hit * hit_calib;
273
274 /* Convert to amplitude of channel (assuming high gain) */
275 /* need to divide here, because "calib" converts amp to energy */
277 double amp_ch = e_ch / emScale->calibrateChannel(drawerIdx, ch, gain, 1., m_rChUnit
279 double noise;
280 // If high saturates, convert adc_id to low-gain value and recalculate.
281 if (adc_ampl[ch] + amp_ch + m_tileToolNoiseSample->getPed(drawerIdx, ch, gain, TileRawChannelUnit::ADCcounts, ctx) > m_ampMaxHi) {
282
284 amp_ch = e_ch / emScale->calibrateChannel(drawerIdx, ch, gain, 1., m_rChUnit
286
287 // If Noise is requested,
288 // recalculate noise using the SAME random number as for high.
289 if (m_tileNoise) {
290 adc_ampl[ch] = random[ch] * m_tileToolNoiseSample->getHfn(drawerIdx, ch, TileID::LOWGAIN, TileRawChannelUnit::ADCcounts, ctx)
291 * m_tileInfo->getNoiseScaleFactor();
292 }
293 }
294
295 adc_gain[ch] = gain;
296 noise = adc_ampl[ch];
297 adc_ampl[ch] += amp_ch; // add real amplitude to the noise
298
299 ATH_MSG_VERBOSE( "ch=" << ch << ((gain == TileID::HIGHGAIN) ? " Hi" :" Lo")
300 << " pmt=" << m_tileID->to_string(pmt_id, -1)
301 << " adc=" << m_tileHWID->to_string(channel_id, -1) << "/" << gain
302 << " noise=" << noise
303 << " amp=" << amp_ch
304 << " tot=" << adc_ampl[ch]);
305
306 ++nChan;
307 eHitTot += e_hit;
308 eCh += e_ch;
309 }
310
311 // store raw channels for one drawer
312
313 for (int ch = 0; ch < nChMax; ++ch) {
314
315 int gain = adc_gain[ch];
316
317 // without noise most of channels do not exist
318 // select only valid channels
319 if (gain != -1) {
320
321 HWIdentifier adc_id = adc_ids[ch];
322 double amp = adc_ampl[ch];
323
324 bool lrcGood = true;
325 double thresh = -99999;
326
327 if (TileID::HIGHGAIN != gain) {
328 // change ADC ID (channel switched to low gain)
329 adc_id = m_tileHWID->adc_id(m_tileHWID->channel_id(adc_id), gain);
330
331 } else {
332 // Apply threshold cut to small signals (always high gain)
333 if (m_tileThresh) {
335 if (thresh < 0) {
336 if (fabs(amp) < fabs(thresh))
337 lrcGood = false;
338 } else {
339 if (amp < thresh)
340 lrcGood = false;
341 }
342 }
343 }
344
345 if (lrcGood) {
346
347 auto rawChannel = std::make_unique<TileRawChannel>(adc_id, amp, adc_time[ch], adc_qual[ch]);
348 ATH_CHECK( rawChannelContainer->push_back(std::move(rawChannel)) );
349
350 if (TileID::HIGHGAIN == gain) {
351 ++nChHG;
352 eChHG += amp;
353 } else {
354 ++nChLG;
355 eChLG += amp;
356 }
357
358 ATH_MSG_VERBOSE( "Accept RC thr=" << ((thresh < 0) ? "+" : "" ) << thresh
359 << ", id=" << m_tileHWID->to_string(adc_id)
360 << ", amp=" << amp );
361
362 } else {
363
364 ATH_MSG_VERBOSE( "Reject RC thr=" << ((thresh < 0) ? "+" : "") << thresh
365 << ", id=" << m_tileHWID->to_string(adc_id)
366 << ", amp=" << amp );
367 }
368 }
369 }
370 }
371
372
373 // Execution completed.
374 if (msgLvl(MSG::DEBUG)) {
375 msg(MSG::DEBUG) << "TileHitToRawChannel execution completed." << endmsg;
376 msg(MSG::DEBUG) << " nChan=" << nChan
377 << " eHitTot=" << eHitTot
378 << " eneTot=" << eCh
379 << " nchLG=" << nChLG
380 << " eChLG=" << eChLG
381 << " nchHG=" << nChHG
382 << " eChHG=" << eChHG << endmsg;
383 }
384
385
386 SG::WriteHandle<TileRawChannelContainer> rawChannelCnt(m_rawChannelContainerKey, ctx);
387 ATH_CHECK( rawChannelCnt.record(std::move(rawChannelContainer)) );
388
389 return StatusCode::SUCCESS;
390}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_VERBOSE(x,...)
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition RNGWrapper.h:154
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition RNGWrapper.h:108
bool msgLvl(const MSG::Level lvl) const
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
bool m_tileThresh
If true => apply threshold on the conversion to raw channels.
ServiceHandle< IAthRNGSvc > m_atRndmGenSvc
Random number generator engine to use.
double m_ampMaxHi
Value of the maximum amplitude to be stored as a high gain channel.
double m_threshHi
Value of the mimimal amplitude required to do the conversion to raw channel in high gain (not used fo...
SG::ReadCondHandleKey< TileSamplingFraction > m_samplingFractionKey
Name of TileSamplingFraction in condition store.
SG::WriteHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
TileFragHash::TYPE m_rChType
Type of TileRawChannels (Digitizar, OF1, OF2, Fit, etc.)(see TileFragHash.h).
SG::ReadHandleKey< TileHitContainer > m_hitContainerKey
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
Name of TileEMScale in condition store.
const TileCablingService * m_cabling
Pointer to the TileCablingService instance.
const TileInfo * m_tileInfo
Pointer to TileInfo.
Gaudi::Property< std::string > m_randomStreamName
Random Stream Name.
const TileID * m_tileID
Pointer to TileID helper.
ToolHandle< TileCondToolNoiseSample > m_tileToolNoiseSample
bool m_tileNoise
If true => generate noise for the TileRawChannel creation.
const TileHWID * m_tileHWID
Pointer to TileHWID helper.
TileRawChannelUnit::UNIT m_rChUnit
Units used for the TileRawChannels (ADC, pCb, etc.)(see TileInfo.h).
Gaudi::Property< double > m_deltaT
if true, keep only hits in deltaT range
time(flags, cells_name, *args, **kw)

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode TileHitToRawChannel::finalize ( )
overridevirtual

finalize method

Definition at line 392 of file TileHitToRawChannel.cxx.

392 {
393
394 ATH_MSG_INFO( "TileHitToRawChannel::finalize() end." );
395
396 return StatusCode::SUCCESS;
397}
#define ATH_MSG_INFO(x,...)

◆ initialize()

StatusCode TileHitToRawChannel::initialize ( )
overridevirtual

initialize method

Definition at line 68 of file TileHitToRawChannel.cxx.

68 {
71 : TileRawChannelUnit::PicoCoulombs;
72
73 // retrieve TileID helper and TileInfo from det store
74
75 ATH_CHECK( detStore()->retrieve(m_tileID) );
76
77 ATH_CHECK( detStore()->retrieve(m_tileTBID) );
78
79 ATH_CHECK( detStore()->retrieve(m_tileHWID) );
80
81 ATH_CHECK( detStore()->retrieve(m_tileInfo, m_infoName.value()) );
82
83 ATH_CHECK( m_samplingFractionKey.initialize() );
84 ATH_CHECK( m_emScaleKey.initialize() );
85
86 ATH_CHECK( m_tileToolNoiseSample.retrieve() );
87
88 if (m_tileNoise) {
89 ATH_CHECK(m_atRndmGenSvc.retrieve());
90 }
91
92 ATH_CHECK( m_cablingSvc.retrieve() );
93 m_cabling = m_cablingSvc->cablingService();
94
95 // Get needed parameters from TileInfo
96 m_ampMaxHi = m_tileInfo->ADCmax();
97
98 /* Get TileNoise flag from TileInfo
99 (true => generate noise in RC's). */
100 m_tileNoise = m_tileInfo->TileNoise();
101
102 /* Get TileZeroSuppress flag from TileInfo
103 (true => apply threshold cut for RC's). */
104 m_tileThresh = m_tileInfo->TileZeroSuppress();
105
106 m_threshHi = m_tileInfo->ThresholdRawChannel(TileID::HIGHGAIN);
107
108 if (m_tileThresh) {
109 ATH_MSG_INFO( "ampMaxHi=" << m_ampMaxHi
110 << ", tileNoise=" << ((m_tileNoise) ? "true" : "false")
111 << ", tileThresh=" << "true, thresh_hi=" << m_threshHi );
112 } else {
113 ATH_MSG_INFO( "ampMaxHi=" << m_ampMaxHi
114 << ", tileNoise=" << ((m_tileNoise) ? "true" : "false")
115 << ", tileThresh=" << "false" );
116 }
117
118
119 IdContext drawer_context = m_tileHWID->drawer_context();
120 int ndrawers = m_tileHWID->drawer_hash_max();
121 int nchannels = 48;
122
123 m_all_ids.reserve(ndrawers);
124
125 for (int dr = 0; dr < ndrawers; ++dr) {
126
127 HWIdentifier drawer_id;
128 /* int result = */m_tileHWID->get_id(dr, drawer_id, &drawer_context);
129
130 HWIdentifier * adc_ids = new HWIdentifier[nchannels];
131 if (m_tileHWID->ros(drawer_id) > 0) { // protection against BEAM ROD
132 for (int ch = 0; ch < nchannels; ++ch) {
133 adc_ids[ch] = m_tileHWID->adc_id(drawer_id, ch, TileID::HIGHGAIN);
134 }
135 }
136 m_all_ids.push_back(adc_ids);
137 }
138
139 ATH_CHECK( m_hitContainerKey.initialize() );
140 ATH_CHECK( m_rawChannelContainerKey.initialize() );
141
142 ATH_MSG_INFO( "TileHitToRawChannel initialization completed" );
143
144 return StatusCode::SUCCESS;
145}
const ServiceHandle< StoreGateSvc > & detStore() const
Gaudi::Property< std::string > m_infoName
name of the TileInfo object
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
Gaudi::Property< bool > m_calibrateEnergy
if true, amplitude is converted to pCb
const TileTBID * m_tileTBID
Pointer to TileID helper.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

Member Data Documentation

◆ m_all_ids

std::vector<HWIdentifier *> TileHitToRawChannel::m_all_ids
private

Vector to store all the drawer ids.

Definition at line 117 of file TileHitToRawChannel.h.

◆ m_ampMaxHi

double TileHitToRawChannel::m_ampMaxHi {0.0}
private

Value of the maximum amplitude to be stored as a high gain channel.

For larger amplitudes, the channel is converted to low gain

Definition at line 122 of file TileHitToRawChannel.h.

122{0.0};

◆ m_atRndmGenSvc

ServiceHandle<IAthRNGSvc> TileHitToRawChannel::m_atRndmGenSvc {this, "RndmSvc", "AthRNGSvc", ""}
private

Random number generator engine to use.

Definition at line 130 of file TileHitToRawChannel.h.

130{this, "RndmSvc", "AthRNGSvc", ""};

◆ m_cabling

const TileCablingService* TileHitToRawChannel::m_cabling {nullptr}
private

Pointer to the TileCablingService instance.

Definition at line 115 of file TileHitToRawChannel.h.

115{nullptr};

◆ m_cablingSvc

ServiceHandle<TileCablingSvc> TileHitToRawChannel::m_cablingSvc
private
Initial value:
{ this,
"TileCablingSvc", "TileCablingSvc", "The Tile cabling service"}

Name of Tile cabling service.

Definition at line 127 of file TileHitToRawChannel.h.

127 { this,
128 "TileCablingSvc", "TileCablingSvc", "The Tile cabling service"};

◆ m_calibrateEnergy

Gaudi::Property<bool> TileHitToRawChannel::m_calibrateEnergy {this, "calibrateEnergy", false}
private

if true, amplitude is converted to pCb

Definition at line 106 of file TileHitToRawChannel.h.

106{this, "calibrateEnergy", false};

◆ m_deltaT

Gaudi::Property<double> TileHitToRawChannel::m_deltaT {this, "DeltaT", -1.0}
private

if true, keep only hits in deltaT range

Definition at line 105 of file TileHitToRawChannel.h.

105{this, "DeltaT", -1.0};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_emScaleKey

SG::ReadCondHandleKey<TileEMScale> TileHitToRawChannel::m_emScaleKey
private
Initial value:
{this,
"TileEMScale", "TileEMScale", "Input Tile EMS calibration constants"}

Name of TileEMScale in condition store.

Definition at line 137 of file TileHitToRawChannel.h.

137 {this,
138 "TileEMScale", "TileEMScale", "Input Tile EMS calibration constants"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_hitContainerKey

SG::ReadHandleKey<TileHitContainer> TileHitToRawChannel::m_hitContainerKey
private
Initial value:
{this,"TileHitContainer","TileHitCnt",
"input Tile hit container key"}

Definition at line 91 of file TileHitToRawChannel.h.

91 {this,"TileHitContainer","TileHitCnt",
92 "input Tile hit container key"};

◆ m_infoName

Gaudi::Property<std::string> TileHitToRawChannel::m_infoName {this, "TileInfoName", "TileInfo"}
private

name of the TileInfo object

Definition at line 104 of file TileHitToRawChannel.h.

104{this, "TileInfoName", "TileInfo"};

◆ m_randomStreamName

Gaudi::Property<std::string> TileHitToRawChannel::m_randomStreamName {this, "RandomStreamName", "Tile_DigitsMaker", ""}
private

Random Stream Name.

Definition at line 132 of file TileHitToRawChannel.h.

132{this, "RandomStreamName", "Tile_DigitsMaker", ""};

◆ m_rawChannelContainerKey

SG::WriteHandleKey<TileRawChannelContainer> TileHitToRawChannel::m_rawChannelContainerKey
private
Initial value:
{this,"TileRawChannelContainer",
"TileRawChannelCnt",
"Output Tile raw channel container key"}

Definition at line 94 of file TileHitToRawChannel.h.

94 {this,"TileRawChannelContainer",
95 "TileRawChannelCnt",
96 "Output Tile raw channel container key"};

◆ m_rChType

TileFragHash::TYPE TileHitToRawChannel::m_rChType {TileFragHash::Default}
private

Type of TileRawChannels (Digitizar, OF1, OF2, Fit, etc.)(see TileFragHash.h).

Definition at line 109 of file TileHitToRawChannel.h.

◆ m_rChUnit

TileRawChannelUnit::UNIT TileHitToRawChannel::m_rChUnit {TileRawChannelUnit::ADCcounts}
private

Units used for the TileRawChannels (ADC, pCb, etc.)(see TileInfo.h).

Definition at line 108 of file TileHitToRawChannel.h.

◆ m_samplingFractionKey

SG::ReadCondHandleKey<TileSamplingFraction> TileHitToRawChannel::m_samplingFractionKey
private
Initial value:
{this,
"TileSamplingFraction", "TileSamplingFraction", "Input Tile sampling fraction"}

Name of TileSamplingFraction in condition store.

Definition at line 100 of file TileHitToRawChannel.h.

100 {this,
101 "TileSamplingFraction", "TileSamplingFraction", "Input Tile sampling fraction"};

◆ m_threshHi

double TileHitToRawChannel::m_threshHi {0.0}
private

Value of the mimimal amplitude required to do the conversion to raw channel in high gain (not used for low gain).

Definition at line 121 of file TileHitToRawChannel.h.

121{0.0};

◆ m_tileHWID

const TileHWID* TileHitToRawChannel::m_tileHWID {nullptr}
private

Pointer to TileHWID helper.

Definition at line 113 of file TileHitToRawChannel.h.

113{nullptr};

◆ m_tileID

const TileID* TileHitToRawChannel::m_tileID {nullptr}
private

Pointer to TileID helper.

Definition at line 111 of file TileHitToRawChannel.h.

111{nullptr};

◆ m_tileInfo

const TileInfo* TileHitToRawChannel::m_tileInfo {nullptr}
private

Pointer to TileInfo.

Definition at line 114 of file TileHitToRawChannel.h.

114{nullptr};

◆ m_tileNoise

bool TileHitToRawChannel::m_tileNoise {false}
private

If true => generate noise for the TileRawChannel creation.

Definition at line 119 of file TileHitToRawChannel.h.

119{false};

◆ m_tileTBID

const TileTBID* TileHitToRawChannel::m_tileTBID {nullptr}
private

Pointer to TileID helper.

Definition at line 112 of file TileHitToRawChannel.h.

112{nullptr};

◆ m_tileThresh

bool TileHitToRawChannel::m_tileThresh {false}
private

If true => apply threshold on the conversion to raw channels.

Definition at line 120 of file TileHitToRawChannel.h.

120{false};

◆ m_tileToolNoiseSample

ToolHandle<TileCondToolNoiseSample> TileHitToRawChannel::m_tileToolNoiseSample
private
Initial value:
{this,
"TileCondToolNoiseSample", "TileCondToolNoiseSample", "Tile sample noise tool"}

Definition at line 140 of file TileHitToRawChannel.h.

140 {this,
141 "TileCondToolNoiseSample", "TileCondToolNoiseSample", "Tile sample noise tool"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.


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