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

This algorithm performs digitization in TileCal, obtaining TileDigits from TileHits. More...

#include <TileDigitsMaker.h>

Inheritance diagram for TileDigitsMaker:

Public Member Functions

virtual ~TileDigitsMaker ()=default
virtual StatusCode initialize () override
 initialize method
virtual StatusCode execute (const EventContext &ctx) const 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 unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
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
virtual void setFilterPassed (bool state, const EventContext &ctx) const
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

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< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode overlayBackgroundDigits (const TileDigitsCollection *bkgDigitCollection, const TileHitCollection *hitCollection, std::vector< std::vector< double > > &drawerBufferLo, std::vector< std::vector< double > > &drawerBufferHi, std::vector< int > &igain, int ros, int drawer, int drawerIdx, std::vector< int > &over_gain, const TileEMScale *emScale, const TileSampleNoise *sampleNoise, const TileDQstatus *dqStatus, const TileBadChannels *badChannels) const
StatusCode fillDigitCollection (const TileHitCollection *hitCollection, std::vector< std::vector< double > > &drawerBufferLo, std::vector< std::vector< double > > &drawerBufferHi, std::vector< int > &igain, std::vector< int > &overgain, std::vector< double > &ech_int, std::vector< bool > &signal_in_channel, const TileEMScale *emScale, const TileSamplingFraction *samplingFraction, const TilePulse *pulse) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< TileHitContainerm_hitContainerKey
SG::ReadHandleKey< TileHitContainerm_hitContainer_DigiHSTruthKey
Gaudi::Property< bool > m_onlyUseContainerName
SG::ReadHandleKey< TileDigitsContainerm_inputDigitContainerKey {this, "InputTileDigitContainer","",""}
std::string m_inputDigitContainerName {""}
SG::WriteHandleKey< TileDigitsContainerm_digitsContainerKey
SG::WriteHandleKey< TileDigitsContainerm_digitsContainer_DigiHSTruthKey
SG::WriteHandleKey< TileDigitsContainerm_filteredDigitsContainerKey
Gaudi::Property< double > m_filterThreshold
Gaudi::Property< double > m_filterThresholdMBTS
Gaudi::Property< std::string > m_infoName
Gaudi::Property< bool > m_integerDigits
Gaudi::Property< bool > m_calibRun
Gaudi::Property< bool > m_rndmEvtOverlay
Gaudi::Property< bool > m_useCoolPulseShapes
Gaudi::Property< bool > m_maskBadChannels
Gaudi::Property< bool > m_doDigiTruth
Gaudi::Property< int > m_allChannels
ServiceHandle< PileUpMergeSvcm_mergeSvc {this, "PileUpMergeSvc", "PileUpMergeSvc"}
const TileIDm_tileID {nullptr}
const TileTBIDm_tileTBID {nullptr}
const TileHWIDm_tileHWID {nullptr}
const TileInfom_tileInfo {nullptr}
const TileCablingServicem_cabling {nullptr}
 TileCabling instance.
std::vector< std::unique_ptr< HWIdentifier[]> > m_all_ids
int m_nSamples {0}
 Number of time slices for each channel.
int m_iTrig {0}
 Index of the triggering time slice.
int m_i_ADCmax {0}
 ADC saturation value.
float m_f_ADCmax {0.0F}
 ADC saturation value.
float m_f_ADCmaxHG {0.0F}
 ADC saturation value - 0.5.
float m_ADCmaxMinusEps {0.0F}
 ADC saturation value - 0.01 or something small.
float m_ADCmaxPlusEps {0.0F}
 ADC saturation value + 0.01 or something small.
float m_f_ADCmaskValue {0.0F}
 indicates channels which were masked in background dataset
bool m_tileNoise {false}
 If true => generate noise in TileDigits.
bool m_tileCoherNoise {false}
 If true => generate coherent noise in TileDigits.
bool m_tileThresh {false}
 If true => apply threshold to Digits.
double m_tileThreshHi {0.0}
 Actual threshold value for high gain.
double m_tileThreshLo {0.0}
 Actual threshold value for low gain.
std::vector< double > m_digitShapeHi
 High gain pulse shape.
int m_nShapeHi {0}
 Number of bins in high gain pulse shape.
int m_nBinsPerXHi {0}
 Number of bins per bunch crossing in high gain pulse shape.
int m_binTime0Hi {0}
 Index of time=0 bin for high gain pulse shape.
double m_timeStepHi {0.}
 Time step in high gain pulse shape: 25.0 / nBinsPerXHi.
std::vector< double > m_digitShapeLo
 Low gain pulse shape.
int m_nShapeLo {0}
 Number of bins in low gain pulse shape.
int m_nBinsPerXLo {0}
 Number of bins per bunch crossing in low gain pulse shape.
int m_binTime0Lo {0}
 Index of time=0 bin for low gain pulse shape.
double m_timeStepLo {0.}
 Time step in low gain pulse shape: 25.0 / nBinsPerXLo.
ServiceHandle< TileCablingSvcm_cablingSvc
 Name of Tile cabling service.
ServiceHandle< IAthRNGSvcm_rndmSvc {this, "RndmSvc", "AthRNGSvc", ""}
 Random number service to use.
Gaudi::Property< std::string > m_randomStreamName {this, "RandomStreamName", "Tile_DigitsMaker", ""}
 Random Stream Name.
SG::ReadCondHandleKey< TileSampleNoisem_sampleNoiseKey
 Name of TileSampleNoise in condition store.
SG::ReadCondHandleKey< TileEMScalem_emScaleKey
 Name of TileEMScale in condition store.
SG::ReadCondHandleKey< TilePulsem_pulseShapeKey
 Name of TilePulseShape in condition store.
SG::ReadCondHandleKey< TileSamplingFractionm_samplingFractionKey
 Name of TileSamplingFraction in condition store.
SG::ReadCondHandleKey< TileBadChannelsm_badChannelsKey
 Name of TileBadChannels in condition store.
SG::ReadHandleKey< TileDQstatusm_DQstatusKey
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 performs digitization in TileCal, obtaining TileDigits from TileHits.

Hits from the PMTs in the cell are merged and calibration constants applied to obtained cell energy, time and quality. Starting from hits, pulse shapes are applied and the resulting pulses are digitized. Depending on the options selected, electronic noise and photoelectron statistical fluctuations are simulated in this procedure.

Definition at line 79 of file TileDigitsMaker.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ~TileDigitsMaker()

virtual TileDigitsMaker::~TileDigitsMaker ( )
virtualdefault

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ 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 TileDigitsMaker::execute ( const EventContext & ctx) const
overridevirtual

execute method

Definition at line 262 of file TileDigitsMaker.cxx.

262 {
263 ATH_MSG_DEBUG( "Executing TileDigitsMaker");
264
265 // Prepare RNG service
266 ATHRNG::RNGWrapper* rngWrapper = nullptr;
267 CLHEP::HepRandomEngine* rngEngine = nullptr;
269 rngWrapper = m_rndmSvc->getEngine(this, m_randomStreamName);
270 rngWrapper->setSeed( m_randomStreamName, ctx );
271 rngEngine = rngWrapper->getEngine(ctx);
272 }
273
274 SG::ReadCondHandle<TileSampleNoise> sampleNoise(m_sampleNoiseKey, ctx);
275 ATH_CHECK( sampleNoise.isValid() );
276
277 bool first = (msgLvl(MSG::VERBOSE) && ctx.evt() == 0 && !m_rndmEvtOverlay );
278 if (first) {
279 ATH_MSG_VERBOSE( "Dumping 2G noise parameters");
280 first = false;
281 IdContext drawer_context = m_tileHWID->drawer_context();
282 int ndrawers = m_tileHWID->drawer_hash_max();
283 const int nchMax = 48; // number of channels per drawer
284 for (int dr = 0; dr < ndrawers; ++dr) {
285 HWIdentifier drawer_id;
286 m_tileHWID->get_id(dr, drawer_id, &drawer_context);
287 int ros = m_tileHWID->ros(drawer_id);
288 int drawer = m_tileHWID->drawer(drawer_id);
289 if (m_cabling->connected(ros, drawer)) {
290 IdentifierHash idhash;
291 m_tileHWID->get_hash(drawer_id, idhash, &drawer_context);
292 for (int ch = 0; ch < nchMax; ++ch) {
293 double pedSimHi = sampleNoise->getPed(idhash, ch, TileID::HIGHGAIN);
294 double sigmaHi_Hfn1 = sampleNoise->getHfn1(idhash, ch, TileID::HIGHGAIN);
295 double sigmaHi_Hfn2 = sampleNoise->getHfn2(idhash, ch, TileID::HIGHGAIN);
296 double sigmaHi_Norm = sampleNoise->getHfnNorm(idhash, ch, TileID::HIGHGAIN);
297 double pedSimLo = sampleNoise->getPed(idhash, ch, TileID::LOWGAIN);
298 double sigmaLo_Hfn1 = sampleNoise->getHfn1(idhash, ch, TileID::LOWGAIN);
299 double sigmaLo_Hfn2 = sampleNoise->getHfn2(idhash, ch, TileID::LOWGAIN);
300 double sigmaLo_Norm = sampleNoise->getHfnNorm(idhash, ch, TileID::LOWGAIN);
301 ATH_MSG_VERBOSE( "Channel " << m_tileHWID->to_string(drawer_id,-2) << "/" << ch
302 << " pedHi="<< pedSimHi
303 << " pedLo="<< pedSimLo
304 << " rmsHi="<< sigmaHi_Hfn1 << "," << sigmaHi_Hfn2 << "," << sigmaHi_Norm
305 << " rmsLo="<< sigmaLo_Hfn1 << "," << sigmaLo_Hfn2 << "," << sigmaLo_Norm);
306
307 }
308 }
309 }
310 }
311
312 // declare array for random number generation
313 double Rndm[16]; // Can't use variable size array,
314 double RndmLo[16]; // Can't use variable size array,
315 double Rndm_dG[1]; // uniform random number for the double gaussian
316 double RndmLo_dG[1]; // uniform random number for the double gaussian
317
318 // step1: Get hit container from TES
319 SG::ReadHandle<TileHitContainer> hitContainer(m_hitContainerKey, ctx);
320 ATH_CHECK( hitContainer.isValid() );
321
322 SG::ReadHandle<TileHitContainer> hitContainer_DigiHSTruth;
323 if(m_doDigiTruth){
324 hitContainer_DigiHSTruth = SG::ReadHandle<TileHitContainer> (m_hitContainer_DigiHSTruthKey, ctx);
325 ATH_CHECK( hitContainer_DigiHSTruth.isValid() );
326 }
327
328 // Zero sums for monitoring.
329 int nChSum = 0;
330 int nChHiSum = 0;
331 int nChLoSum = 0;
332 int nChHiAcc = 0;
333 int nChLoAcc = 0;
334 int nChHiFlt = 0;
335 int nChLoFlt = 0;
336 int nChHiCut = 0;
337 int nChLoCut = 0;
338 double echtot_Acc = 0.;
339 double echint_Acc = 0.;
340 double echtot_Cut = 0.;
341 double echint_Cut = 0.;
342 double HitSum = 0.;
343 double EneSum = 0.;
344 double RChSum = 0.;
345
346 /* step2: Set up Digits container */
347
348 auto digitsContainer = std::make_unique<TileMutableDigitsContainer>(true,
351 ATH_CHECK( digitsContainer->status() );
352
353 std::unique_ptr<TileMutableDigitsContainer> digitsContainer_DigiHSTruth;
354 if(m_doDigiTruth){
355 digitsContainer_DigiHSTruth = std::make_unique<TileMutableDigitsContainer>(true,
358 ATH_CHECK( digitsContainer_DigiHSTruth->status() );
359 }
360
361 std::unique_ptr<TileMutableDigitsContainer> filteredContainer;
362 if (!m_filteredDigitsContainerKey.key().empty()) {
363 filteredContainer = std::make_unique<TileMutableDigitsContainer>(true,
367 ATH_CHECK( filteredContainer->status() );
368 }
369
370 /* Set up buffers for handling information in a single collection. */
371 IdentifierHash idhash;
372 IdContext drawer_context = m_tileHWID->drawer_context();
373 const int nchMax = 48; // number of channels per drawer
374 std::vector<int> igain(nchMax, -1);
375 std::vector<int> ntot_ch(nchMax, 0);
376 std::vector<double> ech_tot(nchMax, 0.0);
377 std::vector<double> ech_int(nchMax, 0);
378 std::vector<double> ech_int_DigiHSTruth(nchMax, 0);
379 std::vector<int> over_gain(nchMax, -1);
380
381 /* Make a vector of digits (to be filled at the end from m_drawerBuffer arrays) */
382 std::vector<float> digitsBuffer(m_nSamples);
383 std::vector<float> digitsBufferLo(m_nSamples); // for calib runs
384 std::vector<float> digitsBuffer_DigiHSTruth(m_nSamples);
385 std::vector<float> digitsBufferLo_DigiHSTruth(m_nSamples); // for calib runs
386
387 std::vector<double> emptyBuffer;
388 std::vector<std::vector<double>> drawerBufferHi(nchMax, std::vector<double>(m_nSamples));
389 std::vector<std::vector<double>> drawerBufferLo(nchMax, std::vector<double>(m_nSamples));
390
391 std::vector<std::vector<double>> drawerBufferHi_DigiHSTruth;
392 std::vector<std::vector<double>> drawerBufferLo_DigiHSTruth;
393 if (m_doDigiTruth) {
394 drawerBufferHi_DigiHSTruth.resize(nchMax, std::vector<double>(m_nSamples));
395 drawerBufferLo_DigiHSTruth.resize(nchMax, std::vector<double>(m_nSamples));
396 }
397
398
399 /* everything for calculation of coherent noise */
400 // booleans for coherent noise
401 Bool_t coherNoiseHi = false;
402 Bool_t coherNoiseLo = false;
403 TMatrixD CorrWeightHi;
404 TMatrixD CorrWeightLo;
405 std::vector<std::unique_ptr<double[]>> CorrRndmVec;
406 std::vector<std::unique_ptr<double[]>> CorrRndmVecLo;
407 if (m_tileCoherNoise) {
408 for (int k = 0; k < m_nSamples; ++k) {
409 CorrRndmVec.push_back(std::make_unique<double[]>(nchMax));
410 }
411 if (m_calibRun) {
412 for (int k = 0; k < m_nSamples; ++k) {
413 CorrRndmVecLo.push_back(std::make_unique<double[]>(nchMax));
414 }
415 }
416 }
417
420 std::unique_ptr<TileMutableDigitsContainer> backgroundDigitContainer{};
421 if (m_rndmEvtOverlay) {
422 backgroundDigitContainer = std::make_unique<TileMutableDigitsContainer>(true,
425 ATH_CHECK( backgroundDigitContainer->status() );
426
429 TimedDigitContList digitContList;
430 ATH_CHECK( m_mergeSvc->retrieveSubEvtsData(m_inputDigitContainerName, digitContList));
431 ATH_MSG_DEBUG( "TileDigitsCnt successfully retrieved ");
432
433
434 if (digitContList.size() == 0) {
435 ATH_MSG_WARNING( "No overlay done ... ");
436 return StatusCode::SUCCESS;
437 }
438
439 TimedDigitContList::iterator iTzeroDigitCont(digitContList.begin());
440 for (const auto* digitCollection : *(iTzeroDigitCont->second)) {
441 for (const auto* digit : *digitCollection) {
442 auto pDigits = std::make_unique<TileDigits>(*digit);
443 ATH_CHECK(backgroundDigitContainer->push_back(std::move(pDigits)));
444 }
445 }
446 }
447 else {
448 SG::ReadHandle<TileDigitsContainer> tileDigitsContainerHandle(m_inputDigitContainerKey, ctx);
449 if (tileDigitsContainerHandle.isValid()) {
450 for (const auto* digitCollection : *tileDigitsContainerHandle) {
451 for (const auto* digit : *digitCollection) {
452 auto pDigits = std::make_unique<TileDigits>(*digit);
453 ATH_CHECK(backgroundDigitContainer->push_back(std::move(pDigits)));
454 }
455 }
456 }
457 else {
458 ATH_MSG_ERROR("ReadHandle to Background Digits is invalid.");
459 return StatusCode::FAILURE;
460 }
461 }
462
463 collItrRndm = backgroundDigitContainer->begin();
464 lastCollRndm = backgroundDigitContainer->end();
465 }
466
467 SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey, ctx);
468 ATH_CHECK( emScale.isValid() );
469
470 const TilePulse* pulse = nullptr;
472 SG::ReadCondHandle<TilePulse> pulseShape(m_pulseShapeKey, ctx);
473 ATH_CHECK( pulseShape.isValid() );
474 pulse = pulseShape.retrieve();
475 }
476
477 SG::ReadCondHandle<TileSamplingFraction> samplingFraction(m_samplingFractionKey, ctx);
478 ATH_CHECK( samplingFraction.isValid() );
479
480 const TileDQstatus* dqStatus = nullptr;
481 if (m_rndmEvtOverlay) {
482 SG::ReadHandle<TileDQstatus> DQstatusHandle(m_DQstatusKey, ctx);
483 ATH_CHECK( DQstatusHandle.isValid() );
484 dqStatus = DQstatusHandle.get();
485 }
486
487 const TileBadChannels* badChannels = nullptr;
489 SG::ReadCondHandle<TileBadChannels> badChannelsHandle(m_badChannelsKey,ctx);
490 ATH_CHECK( badChannelsHandle.isValid() );
491 badChannels = badChannelsHandle.retrieve();
492 }
493
494 // iterate over all collections in a container
495 // Hit Container and signal hit container are the same size (1 entry per channel)
496 TileHitContainer::const_iterator collItr_DigiHSTruth;
497 if(m_doDigiTruth) collItr_DigiHSTruth = hitContainer_DigiHSTruth->begin();
498
499 /* ----------------------------------------------------------------- */
500 /* Begin loop over the Hit collections. All collections are defined */
501 /* (even if they have no hits), and all the digit information */
502 /* including pileup events are contained in the collection. */
503 /*-------------------------------------------------------------------*/
504 for (const TileHitCollection* hitCollection : *hitContainer) {
505 /* Get array of HWID's for this drawer (stored locally). */
506 HWIdentifier drawer_id = m_tileHWID->drawer_id(hitCollection->identify());
507 int ros = m_tileHWID->ros(drawer_id);
508 int drawer = m_tileHWID->drawer(drawer_id);
509 int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
510 if (m_cabling->connected(ros, drawer)) {
511 ATH_MSG_VERBOSE( "ROS "<< ros << " drawer " << drawer << " is connected");
512 } else {
513 if (m_rndmEvtOverlay && collItrRndm != lastCollRndm) {
514 ++collItrRndm; // skip also one drawer in digi overlay container
515 }
516 if (m_doDigiTruth) {
517 ++collItr_DigiHSTruth;
518 } // End DigiHSTruth stuff
519 continue;
520 }
521
522 m_tileHWID->get_hash(drawer_id, idhash, &drawer_context);
523 const std::unique_ptr<HWIdentifier[]>& adc_ids = m_all_ids[idhash];
524
525 /* Initialize gain settings. If noise is requested, all channels are */
526 /* set to be active. If not, set them all to be inactive (gain=-1). */
527 /* Only those which contain actual hits will be set active when the */
528 /* hits are read in. */
529 int igainch = (m_allChannels) ? TileID::HIGHGAIN : -1;
530 if (m_rndmEvtOverlay) {
531 std::fill(over_gain.begin(), over_gain.end(), -1);
532 } else if (m_tileNoise || m_tileCoherNoise) {
533 igainch = TileID::HIGHGAIN;
534 }
535
536 std::fill(ech_tot.begin(), ech_tot.end(), 0.0);
537 std::fill(ech_int.begin(), ech_int.end(), 0.0);
538 std::fill(ntot_ch.begin(), ntot_ch.end(), 0);
539 std::fill(igain.begin(), igain.end(), igainch);
540
541 std::vector<std::reference_wrapper<std::vector<std::vector<double>>>> drawerBuffers{drawerBufferHi, drawerBufferLo};
542 if (m_doDigiTruth) {
543 drawerBuffers.push_back(drawerBufferHi_DigiHSTruth);
544 drawerBuffers.push_back(drawerBufferLo_DigiHSTruth);
545 }
546 for (std::vector<std::vector<double>>& drawerBuffer : drawerBuffers) {
547 for (std::vector<double>& digitsBuffer : drawerBuffer) {
548 std::fill(digitsBuffer.begin(), digitsBuffer.end(), 0);
549 }
550 }
551
552 if (m_rndmEvtOverlay && collItrRndm != lastCollRndm) {
553 const TileDigitsCollection *bkgDigitCollection(*collItrRndm);
554 ATH_CHECK(overlayBackgroundDigits(bkgDigitCollection, hitCollection, drawerBufferLo, drawerBufferHi,
555 igain, ros, drawer, drawerIdx, over_gain, *emScale, *sampleNoise, dqStatus, badChannels));
556 ++collItrRndm; // skip to next digi collection
557 }
558
559 std::vector<bool> signal_in_channel(nchMax, false);
560 std::vector<bool> signal_in_channel_DigiHSTruth(nchMax, false);
561 ATH_CHECK(fillDigitCollection( hitCollection, drawerBufferLo, drawerBufferHi,
562 igain, over_gain, ech_int, signal_in_channel, *emScale, *samplingFraction, pulse));
563 if(m_doDigiTruth){
564 ATH_CHECK(fillDigitCollection( *collItr_DigiHSTruth, drawerBufferLo_DigiHSTruth, drawerBufferHi_DigiHSTruth,
565 igain, over_gain, ech_int_DigiHSTruth, signal_in_channel_DigiHSTruth, *emScale, *samplingFraction, pulse));
566 } // End DigiHSTruth stuff
567
568 /* Now all signals for this collection are stored in m_drawerBuffer,
569 accessed with digitSamplesHi and digitSampleLo. */
570 if (msgLvl(MSG::VERBOSE)) {
571 for (int ich = 0; ich < nchMax; ++ich) {
572 if (igain[ich] > -1) {
573 std::vector<double>& digitSamplesHi = drawerBufferHi[ich];
574 std::vector<double>& digitSamplesLo = drawerBufferLo[ich];
575 msg(MSG::VERBOSE) << "total: ADC " << m_tileHWID->to_string(adc_ids[ich],-1) << "/" << igain[ich]
576 << " nhit=" << ntot_ch[ich]
577 << " e_ch=" << ech_tot[ich]
578 << " AinTHi=" << digitSamplesHi[m_iTrig]
579 << " AinTLo=" << digitSamplesLo[m_iTrig] << endmsg;
580 }
581 }
582 }
583
584 /* --------------------------------------------------------------- */
585 /* Now all signals for this drawer are stored in m_drawerBuffer arrays, */
586 /* and we are finished with TileHits for this collection. Loop over */
587 /* channels to add noise and pedestal. Check for saturation for */
588 /* each channel, and in case of saturation convert to low gain. */
589 /* -------------------------------------------------------------- */
590
591 // =============CORRELATION MODIFICATION (F Spano)==============
592 //
593 // Define CoVariance Matrix corresponding to noise.
594 // TO UPDATE:: Such Matrix will have to be loaded from database in the future; 1 matrix per drawer.
595 // NOW:
596 // a) define one covariance matrix
597 // b) find Cholesky decomposition use for corrlation building
598 // if this is set load the matrix
599 if (m_tileCoherNoise) {
600 ATH_MSG_VERBOSE( "Coherent noise for ROS " << ros
601 << " drawer " << drawer
602 << " with " << nchMax << " channels and "
603 << m_nSamples << "samples ");
604
605 // get decomposed covariance matrix for hi gain
606 coherNoiseHi = 1;
607 if (coherNoiseHi) {
608 CorrWeightHi.ResizeTo(*(m_tileInfo->DecoCovariance(ros, drawer, TileID::HIGHGAIN)));
609 CorrWeightHi = *(m_tileInfo->DecoCovariance(ros, drawer, TileID::HIGHGAIN));
610 }
611
612 // get decomposed covariance matrix for low gain
613 coherNoiseLo = 1;
614 if (coherNoiseLo) {
615 CorrWeightLo.ResizeTo(*(m_tileInfo->DecoCovariance(ros, drawer, TileID::LOWGAIN)));
616 CorrWeightLo = *(m_tileInfo->DecoCovariance(ros, drawer, TileID::LOWGAIN));
617 }
618
619 //NOTE: ShootArray's inputs are : the engine, the size, the vector, the mean, the standard dev
620 for (int k = 0; k < m_nSamples; ++k) {
621 double* RndmVec = CorrRndmVec[k].get();
622 RandGaussQ::shootArray(rngEngine, nchMax, RndmVec, 0.0, 1.0);
623 }
624
625 if (m_calibRun) {
626 for (int k = 0; k < m_nSamples; ++k) {
627 double * RndmVecLo = CorrRndmVecLo[k].get();
628 RandGaussQ::shootArray(rngEngine, nchMax, RndmVecLo, 0.0, 1.0);
629 }
630 }
631 }
632 // =============CORRELATION MODIFICATION (F Spano)============== end
633
634 // looping over channels
635 for (int ich = 0; ich < nchMax; ++ich) {
636 /* If igain<0, channel is inactive => skip it. */
637 if (igain[ich] < 0)
638 continue;
639
640 /* Generate the nSamp Digits for high gain. Check each for saturation. */
641 ++nChHiSum;
642 HWIdentifier adc_id = adc_ids[ich];
643 HWIdentifier adc_id_lo; // for calib runs
644 Identifier pmt_id = m_cabling->h2s_pmt_id(adc_id);
645 ATH_MSG_DEBUG( "Ch " << m_tileHWID->to_string(adc_id,-1)
646 << " PMT " << (pmt_id.is_valid() ? m_tileID->to_string(pmt_id,-1) : (signal_in_channel[ich] ? "fake gap" : "not connected"))
647 << " gain=" << igain[ich]);
648
650 adc_id_lo = m_tileHWID->adc_id(drawer_id, ich, TileID::LOWGAIN);
651 if (m_calibRun) {
652 ++nChLoSum;
653 }
654 }
655
656 bool chanLoIsBad = false;
657 bool chanHiIsBad = false;
658 if (m_maskBadChannels) {
659 TileBchStatus statusLo = badChannels->getAdcStatus(adc_id_lo);
660 TileBchStatus statusHi = badChannels->getAdcStatus(adc_id);
661 chanLoIsBad = statusLo.isBad();
662 chanHiIsBad = statusHi.isBad();
663 }
664
665 /* Get pedestal and noise values */
666 double pedSimHi(0.), sigmaHi_Hfn1(0.), sigmaHi_Hfn2(0.), sigmaHi_Norm(0.), pedSimLo(0.),
667 sigmaLo_Hfn1(0.), sigmaLo_Hfn2(0.), sigmaLo_Norm(0.);
668 bool good_ch = (over_gain[ich]<9);
669 bool overNoiseHG(over_gain[ich]!=TileID::HIGHGAIN && good_ch); // it's always true if no overlay
670 bool overNoiseLG(over_gain[ich]!=TileID::LOWGAIN && good_ch); // it's always true if no overlay
671 bool tileNoiseHG(false),tileNoiseLG(false);
672
673 if (overNoiseHG) {
674 overNoiseHG &= (m_rndmEvtOverlay && m_allChannels>1); // set it to true only for overlay
675 tileNoiseHG = m_tileNoise || overNoiseHG;
676
677 pedSimHi = sampleNoise->getPed(idhash, ich, TileID::HIGHGAIN);
678 // bug fix for wrong ped value in DB
679 if (pedSimHi == 0.0 && (signal_in_channel[ich] || pmt_id.is_valid()))
680 pedSimHi = 50.;
681
682 sigmaHi_Hfn1 = sampleNoise->getHfn1(idhash, ich, TileID::HIGHGAIN);
683 sigmaHi_Hfn2 = sampleNoise->getHfn2(idhash, ich, TileID::HIGHGAIN);
684 if (sigmaHi_Hfn1>0 || sigmaHi_Hfn2) {
685 sigmaHi_Norm = sigmaHi_Hfn1 / (sigmaHi_Hfn1
686 + sigmaHi_Hfn2 * sampleNoise->getHfnNorm(idhash, ich, TileID::HIGHGAIN));
687 } else {
688 sigmaHi_Hfn1 = sampleNoise->getHfn(idhash, ich, TileID::HIGHGAIN);
689 sigmaHi_Norm = 1.;
690 }
691 }
692
693 if (overNoiseLG) {
694 overNoiseLG &= (m_rndmEvtOverlay && m_allChannels>1); // set it to true only for overlay
695 tileNoiseLG = m_tileNoise || overNoiseLG;
696
697 pedSimLo = sampleNoise->getPed(idhash, ich, TileID::LOWGAIN);
698 // bug fix for wrong ped value in DB
699 if (pedSimLo == 0.0 && (signal_in_channel[ich] || pmt_id.is_valid()))
700 pedSimLo = 30.;
701
702 sigmaLo_Hfn1 = sampleNoise->getHfn1(idhash, ich, TileID::LOWGAIN);
703 sigmaLo_Hfn2 = sampleNoise->getHfn2(idhash, ich, TileID::LOWGAIN);
704 if (sigmaLo_Hfn1 > 0 || sigmaLo_Hfn2) {
705 sigmaLo_Norm = sigmaLo_Hfn1 / (sigmaLo_Hfn1
706 + sigmaLo_Hfn2 * sampleNoise->getHfnNorm(idhash, ich, TileID::LOWGAIN));
707 } else {
708 sigmaLo_Hfn1 = sampleNoise->getHfn(idhash, ich, TileID::LOWGAIN);
709 sigmaLo_Norm = 1.;
710 }
711 }
712
713 /* If tileNoise is requested, generate array of random numbers. */
714 if (tileNoiseLG) { // true if tileNoise is set or noise is needed for low gain in overlay
715 RandGaussQ::shootArray(rngEngine, m_nSamples, Rndm, 0.0, 1.0);
716 RandFlat::shootArray(rngEngine, 1, Rndm_dG, 0.0, 1.0);
717 if (m_calibRun) {
718 RandGaussQ::shootArray(rngEngine, m_nSamples, RndmLo, 0.0, 1.0);
719 RandFlat::shootArray(rngEngine, 1, RndmLo_dG, 0.0, 1.0);
720 }
721 }
722
723 std::vector<double>& digitSamplesHi = drawerBufferHi[ich];
724 std::vector<double>& digitSamplesLo = drawerBufferLo[ich];
725 std::vector<double>& digitSamplesHi_DigiHSTruth = (m_doDigiTruth) ? drawerBufferHi_DigiHSTruth[ich] : emptyBuffer;
726 std::vector<double>& digitSamplesLo_DigiHSTruth = (m_doDigiTruth) ? drawerBufferLo_DigiHSTruth[ich] : emptyBuffer;
727
728 ATH_MSG_DEBUG(" Channel " << ros << '/' << drawer << '/' << ich
729 << " sampHi=" << digitSamplesHi[m_iTrig]
730 << " pedHi=" << pedSimHi
731 << " sampLo=" << digitSamplesLo[m_iTrig]
732 << " pedLo=" << pedSimLo);
733
734 // looping over samples
735 for (int js = 0; js < m_nSamples; ++js) {
736
737 digitsBuffer[js] = digitSamplesHi[js] + pedSimHi;
738 if(m_doDigiTruth) {
739 digitsBuffer_DigiHSTruth[js] = digitSamplesHi_DigiHSTruth[js] + pedSimHi;
740 }
741
742 double noiseHi(0.0);
743 // Full noise pattern, including coherent noise has priority over normal noise //F Spano'
744 if (coherNoiseHi) {
745 // get the js-th correct random vector of 48 elements for the jsth sample k //F Spano'
746 std::unique_ptr<double[]>& CorVec = CorrRndmVec[js];
747 // apply Y=C*Z where Z is the random vector of 48 normal indep variables, and C is the Cholesky decomposition //F Spano'
748 for (int i = 0; i < nchMax; ++i) noiseHi += CorrWeightHi(i, ich) * CorVec[i];
749 } else if (tileNoiseHG) {
750 //using the same gaussian(sigma) for all samples in one channel in one event
751 if (Rndm_dG[0] < sigmaHi_Norm) noiseHi = sigmaHi_Hfn1 * Rndm[js];
752 else noiseHi = sigmaHi_Hfn2 * Rndm[js];
753 }
754
755 if (digitsBuffer[js] + noiseHi >= 0.0) {
756 digitsBuffer[js] += noiseHi;
757 if(m_doDigiTruth) digitsBuffer_DigiHSTruth[js] += noiseHi;
758 } else {
759 digitsBuffer[js] -= noiseHi;
760 if(m_doDigiTruth) digitsBuffer_DigiHSTruth[js] -= noiseHi;
761 }
762
763
764 if (m_integerDigits) {
765 digitsBuffer[js] = round(digitsBuffer[js]);
766 if(m_doDigiTruth) digitsBuffer_DigiHSTruth[js] = round(digitsBuffer_DigiHSTruth[js]);
767 }
768
769 if (m_calibRun) { //Calculate also low gain
770 digitsBufferLo[js] = digitSamplesLo[js] + pedSimLo;
771 if(m_doDigiTruth) digitsBufferLo_DigiHSTruth[js] = digitSamplesLo_DigiHSTruth[js] + pedSimLo;
772 double noiseLo(0.0);
773 // Full noise pattern, including coherent noise has priority over normal noise //F Spano'
774 if (coherNoiseLo) {
775 // get the js-th correct random vector of 48 elements for the jsth sample // F Spano'
776 std::unique_ptr<double[]>& CorVecLo = CorrRndmVecLo[js];
777 // apply Y=C*Z where Z is the random vector of 48 normal indep variables, and C is the Cholesky decomposition // F Spano'
778 for (int i = 0; i < nchMax; ++i) noiseLo += CorrWeightLo(i, ich) * CorVecLo[i];
779 } else if (tileNoiseLG) {
780 //using the same gaussian (sigma) for all samples in one channel in one event
781 if (RndmLo_dG[0] < sigmaLo_Norm) noiseLo = sigmaLo_Hfn1 * RndmLo[js];
782 else noiseLo = sigmaLo_Hfn2 * RndmLo[js];
783 }
784
785 if (digitsBufferLo[js] + noiseLo >= 0.0) {
786 digitsBufferLo[js] += noiseLo;
787 if(m_doDigiTruth) digitsBufferLo_DigiHSTruth[js] += noiseLo;
788 } else {
789 digitsBufferLo[js] -= noiseLo;
790 if(m_doDigiTruth) digitsBufferLo_DigiHSTruth[js] -= noiseLo;
791 }
792
793 if (m_integerDigits) {
794 digitsBufferLo[js] = round(digitsBufferLo[js]);
795 if(m_doDigiTruth) digitsBufferLo_DigiHSTruth[js] = round(digitsBufferLo_DigiHSTruth[js]);
796 }
797
798
799 } else if ((digitsBuffer[js] >= m_f_ADCmaxHG && good_ch) || igain[ich] == TileID::LOWGAIN) { // saturation of high gain in non-calib run
800 // or low gain in digi overlay
801 --nChHiSum;
802 ++nChLoSum;
803 igain[ich] = TileID::LOWGAIN;
804 adc_id = m_tileHWID->adc_id(drawer_id, ich, TileID::LOWGAIN);
805
806 // reset all samples in digitsBuffer[] to Low Gain values
807 for (js = 0; js < m_nSamples; ++js) {
808 digitsBuffer[js] = digitSamplesLo[js] + pedSimLo;
809 if(m_doDigiTruth) digitsBuffer_DigiHSTruth[js] = digitSamplesLo_DigiHSTruth[js] + pedSimLo;
810 double noiseLo(0.0);
811 // Full noise pattern, including coherent noise has priority over normal noise //F Spano'
812 if (coherNoiseLo) {
813 // get the js-th correct random vector of 48 elements for the jsth sample // F Spano'
814 double* CorVec = CorrRndmVec[js].get(); // reuse the same rndm as for high gain
815 // apply Y=C*Z where Z is the random vector of 48 normal indep variables, and C is the Cholesky decomposition // F Spano'
816 for (int i = 0; i < nchMax; ++i) noiseLo += CorrWeightLo(i, ich) * CorVec[i];
817 } else if (tileNoiseLG) {
818 //using the same gaussian (sigma) for all samples in one channel in one event
819 // reuse the same rndm as for high gain
820 if (Rndm_dG[0] < sigmaLo_Norm) noiseLo = sigmaLo_Hfn1 * Rndm[js];
821 else noiseLo = sigmaLo_Hfn2 * Rndm[js];
822 }
823
824 if (digitsBuffer[js] + noiseLo >= 0.0) {
825 digitsBuffer[js] += noiseLo;
826 if(m_doDigiTruth) digitsBuffer_DigiHSTruth[js] += noiseLo;
827 } else {
828 digitsBuffer[js] -= noiseLo;
829 if(m_doDigiTruth) digitsBuffer_DigiHSTruth[js] -= noiseLo;
830 }
831
832 if (digitsBuffer[js] > m_f_ADCmax && good_ch) {
833 digitsBuffer[js] = m_f_ADCmax;
834 if(m_doDigiTruth) digitsBuffer_DigiHSTruth[js] = m_f_ADCmax;
835 }
836 if (m_integerDigits) {
837 digitsBuffer[js] = round(digitsBuffer[js]);
838 if(m_doDigiTruth) digitsBuffer_DigiHSTruth[js] = round(digitsBuffer_DigiHSTruth[js]);
839 }
840 }
841
842 overNoiseHG = false;
843
844 if (msgLvl(MSG::VERBOSE)) {
845 msg(MSG::VERBOSE) << "Channel " << ros << '/' << drawer << '/' << ich << "/" << igain[ich]
846 << " Switch to low gain Amp(lo)=" << digitsBuffer[m_iTrig] << endmsg;
847 if (overNoiseLG) {
848 if (sigmaLo_Norm<1.0) {
849 msg(MSG::VERBOSE) << "LG Ped & noise from DB "
850 << pedSimLo << " " << sigmaLo_Hfn1 << " " << sigmaLo_Hfn2 << " " << sigmaLo_Norm
851 << ((Rndm_dG[0] < sigmaLo_Norm)?(" sig1 used"):(" sig2 used")) << endmsg;
852 } else {
853 msg(MSG::VERBOSE) << "LG Ped & noise from DB "
854 << pedSimLo << " " << sigmaLo_Hfn1 << endmsg;
855 }
856 }
857 }
858 break;
859 }
860 }
861 if (msgLvl(MSG::VERBOSE)) {
862 if (overNoiseHG) {
863 if (sigmaHi_Norm<1.0) {
864 msg(MSG::VERBOSE) << "HG Ped & noise from DB "
865 << pedSimHi << " " << sigmaHi_Hfn1 << " " << sigmaHi_Hfn2 << " " << sigmaHi_Norm
866 << ((Rndm_dG[0] < sigmaHi_Norm)?(" sig1 used"):(" sig2 used")) << endmsg;
867 } else {
868 msg(MSG::VERBOSE) << "HG Ped & noise from DB "
869 << pedSimHi << " " << sigmaHi_Hfn1 << endmsg;
870 }
871 }
872 if (m_calibRun && overNoiseLG) {
873 if (sigmaLo_Norm<1.0) {
874 msg(MSG::VERBOSE) << "LG Ped & noise from DB "
875 << pedSimLo << " " << sigmaLo_Hfn1 << " " << sigmaLo_Hfn2 << " " << sigmaLo_Norm
876 << ((RndmLo_dG[0] < sigmaLo_Norm)?(" sig1 used"):(" sig2 used")) << endmsg;
877 } else {
878 msg(MSG::VERBOSE) << "LG Ped & noise from DB "
879 << pedSimLo << " " << sigmaLo_Hfn1 << endmsg;
880 }
881 }
882 }
883
884 if (m_calibRun) { // calib run - keep both low and high gain
885
886 if (chanHiIsBad) {
887 std::fill(digitsBuffer.begin(), digitsBuffer.end(), m_f_ADCmaskValue);
888 if (m_doDigiTruth) {
889 std::fill(digitsBuffer_DigiHSTruth.begin(), digitsBuffer_DigiHSTruth.end(), m_f_ADCmaskValue);
890 }
891 ATH_MSG_DEBUG( "Masking Channel " << ros << '/' << drawer << '/' << ich << "/1 HG" );
892 }
893
894 auto pDigits = std::make_unique<TileDigits>(adc_id, digitsBuffer);
895 ATH_CHECK( digitsContainer->push_back(std::move(pDigits)) );
896
897 if(m_doDigiTruth && digitsContainer_DigiHSTruth){
898 auto digits_DigiHSTruth = std::make_unique<TileDigits>(adc_id, digitsBuffer_DigiHSTruth);
899 ATH_CHECK( digitsContainer_DigiHSTruth->push_back(std::move(digits_DigiHSTruth)) );
900 }
901
902 if (chanLoIsBad) {
903 std::fill(digitsBufferLo.begin(), digitsBufferLo.end(), m_f_ADCmaskValue);
904 if(m_doDigiTruth) {
905 std::fill(digitsBufferLo_DigiHSTruth.begin(), digitsBufferLo_DigiHSTruth.end(), m_f_ADCmaskValue);
906 }
907
908 ATH_MSG_DEBUG( "Masking Channel " << ros << '/' << drawer << '/' << ich << "/0 LG");
909 }
910
911 auto pDigitsLo = std::make_unique<TileDigits>(adc_id_lo, digitsBufferLo);
912 ATH_CHECK( digitsContainer->push_back(std::move(pDigitsLo)) );
913
914 if(m_doDigiTruth && digitsContainer_DigiHSTruth){
915 auto pDigitsLo_DigiHSTruth = std::make_unique<TileDigits>(adc_id_lo, digitsBufferLo_DigiHSTruth);
916 ATH_CHECK( digitsContainer_DigiHSTruth->push_back(std::move(pDigitsLo_DigiHSTruth)) );
917 }
918 } else { //normal run
919
920 bool hiGain = (igain[ich] == TileID::HIGHGAIN);
921
922 // If tileThresh, apply threshold cut to the in-time Digits signal
923 bool isChannelGood = true;
924 if (m_tileThresh) {
925 if (hiGain) { // make threshold only on high gain
926 double ampInTime = digitsBuffer[m_iTrig] - pedSimHi;
927 if (m_integerDigits)
928 ampInTime = round(ampInTime);
929 if (m_tileThreshHi < 0) {
930 if (fabs(ampInTime) < fabs(m_tileThreshHi))
931 isChannelGood = false;
932 } else {
933 if (ampInTime < m_tileThreshHi)
934 isChannelGood = false;
935 }
936 }
937 }
938 // If channel is good, create TileDigits object and store in container.
939 if (isChannelGood) {
940 echtot_Acc += ech_tot[ich];
941 echint_Acc += fabs(ech_int[ich]);
942 if (hiGain) {
943 ++nChHiAcc;
944 } else {
945 ++nChLoAcc;
946 }
947
948 if (hiGain) {
949 //if (m_rndmEvtOverlay // not needed, because DQstatus have been already checked before
950 // && !(theDQstatus->isAdcDQgood(ros, drawer, ich, TileID::HIGHGAIN))) {
951 // chanHiIsBad = true;
952 // ATH_MSG_DEBUG( "BAD DQ Channel " << ros << '/' << drawer << '/' << ich << "/1 HG");
953 //}
954 if (chanHiIsBad) {
955 if (pmt_id.is_valid()) {
956 std::fill(digitsBuffer.begin(), digitsBuffer.end(), m_f_ADCmaskValue);
957 if (m_doDigiTruth) {
958 std::fill(digitsBuffer_DigiHSTruth.begin(), digitsBuffer_DigiHSTruth.end(), m_f_ADCmaskValue);
959 }
960 } else if (good_ch) {
961 ATH_MSG_DEBUG( "Disconnected Channel " << ros << '/' << drawer << '/' << ich);
962 std::fill(digitsBuffer.begin(), digitsBuffer.end(), 0.);
963 if (m_doDigiTruth) {
964 std::fill(digitsBuffer_DigiHSTruth.begin(), digitsBuffer_DigiHSTruth.end(), 0.);
965 }
966 }
967 ATH_MSG_DEBUG( "Masking Channel " << ros << '/' << drawer << '/' << ich << "/1 HG");
968 }
969 } else {
970 //if (m_rndmEvtOverlay // not needed, because DQstatus have been already checked before
971 // && !(theDQstatus->isAdcDQgood(ros, drawer, ich, TileID::LOWGAIN))) {
972 // chanLoIsBad = true;
973 // ATH_MSG_DEBUG( "BAD DQ Channel " << ros << '/' << drawer << '/' << ich << "/0 LG");
974 //}
975 if (chanLoIsBad) {
976 if (pmt_id.is_valid()) {
977 std::fill(digitsBuffer.begin(), digitsBuffer.end(), m_f_ADCmaskValue);
978 if (m_doDigiTruth) {
979 std::fill(digitsBuffer_DigiHSTruth.begin(), digitsBuffer_DigiHSTruth.end(), m_f_ADCmaskValue);
980 }
981 } else if (good_ch) {
982 ATH_MSG_DEBUG( "Disconnected Channel " << ros << '/' << drawer << '/' << ich);
983 std::fill(digitsBuffer.begin(), digitsBuffer.end(), 0.);
984 if (m_doDigiTruth) {
985 std::fill(digitsBuffer_DigiHSTruth.begin(), digitsBuffer_DigiHSTruth.end(), 0.);
986 }
987 }
988 ATH_MSG_DEBUG( "Masking Channel " << ros << '/' << drawer << '/' << ich << "/0 LG");
989 }
990 }
991
992 auto pDigits = std::make_unique<TileDigits>(adc_id, digitsBuffer);
993
994 if (ech_int[ich] > m_filterThreshold || ech_int[ich] < -m_filterThresholdMBTS) {
995 if (filteredContainer) ATH_CHECK( filteredContainer->push_back(pDigits.get()) );
996 if (hiGain) {
997 ++nChHiFlt;
998 } else {
999 ++nChLoFlt;
1000 }
1001 }
1002
1003 ATH_CHECK( digitsContainer->push_back(std::move(pDigits)) );
1004 if(m_doDigiTruth && digitsContainer_DigiHSTruth){
1005 auto pDigits_DigiHSTruth = std::make_unique<TileDigits>(adc_id, digitsBuffer_DigiHSTruth);
1006 ATH_CHECK( digitsContainer_DigiHSTruth->push_back(std::move(pDigits_DigiHSTruth)) );
1007 }
1008
1009 if (msgLvl(MSG::VERBOSE)) {
1010 double pedSim = ((hiGain) ? pedSimHi : pedSimLo);
1011 double ampInTime = digitsBuffer[m_iTrig] - pedSim;
1012 if (m_integerDigits)
1013 ampInTime = round(ampInTime);
1014 msg(MSG::VERBOSE) << ((ech_int[ich] > m_filterThreshold
1015 || ech_int[ich] < -m_filterThresholdMBTS) ? "AccFlt" : "Accept")
1016 << " ADC " << m_tileHWID->to_string(adc_id)
1017 << " AinT=" << ampInTime
1018 << " ped=" << pedSim
1019 << " Ech=" << ech_tot[ich]
1020 << " EinT=" << ech_int[ich] << endmsg;
1021 msg(MSG::VERBOSE) << "digits";
1022 for (unsigned int i = 0; i < digitsBuffer.size(); ++i)
1023 msg(MSG::VERBOSE) << " " << digitsBuffer[i];
1024 msg(MSG::VERBOSE) << endmsg;
1025 }
1026 } else {
1027 echtot_Cut += ech_tot[ich];
1028 echint_Cut += ech_int[ich];
1029 if (hiGain) {
1030 ++nChHiCut;
1031 } else {
1032 ++nChLoCut;
1033 }
1034
1035 if (msgLvl(MSG::VERBOSE)) {
1036 double pedSim = ((hiGain) ? pedSimHi : pedSimLo);
1037 double ampInTime = digitsBuffer[m_iTrig] - pedSim;
1038 if (m_integerDigits)
1039 ampInTime = round(ampInTime);
1040 msg(MSG::VERBOSE) << "Reject. ADC " << m_tileHWID->to_string(adc_id)
1041 << " AinT=" << ampInTime
1042 << " ped=" << pedSim
1043 << " Ech=" << ech_tot[ich]
1044 << " EinT=" << ech_int[ich] << endmsg;
1045 }
1046 }
1047 }
1048 }
1049 if(m_doDigiTruth) ++collItr_DigiHSTruth;
1050 }
1051
1052 if (msgLvl(MSG::DEBUG)) {
1053 msg(MSG::DEBUG) << "TileDigitsMaker execution completed." << endmsg;
1054 msg(MSG::DEBUG) << " nCh=" << nChSum
1055 << " nChH/L=" << nChHiSum << "/" << nChLoSum
1056 << " nFltH/L=" << nChHiFlt << "/" << nChLoFlt
1057 << " Hit=" << HitSum
1058 << " Ene=" << EneSum
1059 << " RChSum=" << RChSum << endmsg;
1060 if (m_tileThresh) {
1061 msg(MSG::DEBUG) << " Accepted: nChLo/Hi=" << nChLoAcc << "/" << nChHiAcc
1062 << " eTot=" << echtot_Acc
1063 << " eInT=" << echint_Acc << endmsg;
1064 msg(MSG::DEBUG) << " Rejected: nChLo/Hi=" << nChLoCut << "/" << nChHiCut
1065 << " eTot=" << echtot_Cut
1066 << " eInT=" << echint_Cut << endmsg;
1067 }
1068 }
1069
1070
1071 // step3: register the Digit container in the TES
1072 SG::WriteHandle<TileDigitsContainer> digitsCnt(m_digitsContainerKey, ctx);
1073 ATH_CHECK( digitsCnt.record(std::move(digitsContainer)) );
1074
1075 if(m_doDigiTruth && digitsContainer_DigiHSTruth){
1076 SG::WriteHandle<TileDigitsContainer> digits_DigiHSTruth(m_digitsContainer_DigiHSTruthKey, ctx);
1077 ATH_CHECK( digits_DigiHSTruth.record(std::move(digitsContainer_DigiHSTruth)) );
1078 }
1079
1080 if (filteredContainer) {
1081 SG::WriteHandle<TileDigitsContainer> filteredDigitsContainer(m_filteredDigitsContainerKey, ctx);
1082 ATH_CHECK( filteredDigitsContainer.record(std::move(filteredContainer)) );
1083 }
1084
1085 return StatusCode::SUCCESS;
1086}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition RNGWrapper.h:169
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition RNGWrapper.h:134
bool msgLvl(const MSG::Level lvl) const
bool is_valid() const
Check if id is in a valid state.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const TileBchStatus & getAdcStatus(const HWIdentifier adc_id) const
Return Tile ADC status.
bool isBad() const
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
int m_nSamples
Number of time slices for each channel.
Gaudi::Property< std::string > m_randomStreamName
Random Stream Name.
SG::WriteHandleKey< TileDigitsContainer > m_digitsContainerKey
Gaudi::Property< int > m_allChannels
SG::ReadHandleKey< TileHitContainer > m_hitContainer_DigiHSTruthKey
SG::ReadCondHandleKey< TileBadChannels > m_badChannelsKey
Name of TileBadChannels in condition store.
Gaudi::Property< bool > m_onlyUseContainerName
SG::ReadHandleKey< TileHitContainer > m_hitContainerKey
float m_f_ADCmax
ADC saturation value.
bool m_tileNoise
If true => generate noise in TileDigits.
SG::ReadCondHandleKey< TilePulse > m_pulseShapeKey
Name of TilePulseShape in condition store.
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
Gaudi::Property< bool > m_rndmEvtOverlay
const TileHWID * m_tileHWID
SG::WriteHandleKey< TileDigitsContainer > m_filteredDigitsContainerKey
Gaudi::Property< bool > m_calibRun
StatusCode fillDigitCollection(const TileHitCollection *hitCollection, std::vector< std::vector< double > > &drawerBufferLo, std::vector< std::vector< double > > &drawerBufferHi, std::vector< int > &igain, std::vector< int > &overgain, std::vector< double > &ech_int, std::vector< bool > &signal_in_channel, const TileEMScale *emScale, const TileSamplingFraction *samplingFraction, const TilePulse *pulse) const
const TileInfo * m_tileInfo
bool m_tileThresh
If true => apply threshold to Digits.
Gaudi::Property< bool > m_useCoolPulseShapes
bool m_tileCoherNoise
If true => generate coherent noise in TileDigits.
ServiceHandle< PileUpMergeSvc > m_mergeSvc
const TileCablingService * m_cabling
TileCabling instance.
int m_iTrig
Index of the triggering time slice.
Gaudi::Property< bool > m_integerDigits
double m_tileThreshHi
Actual threshold value for high gain.
std::string m_inputDigitContainerName
Gaudi::Property< double > m_filterThresholdMBTS
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
Name of TileEMScale in condition store.
SG::ReadCondHandleKey< TileSampleNoise > m_sampleNoiseKey
Name of TileSampleNoise in condition store.
Gaudi::Property< bool > m_doDigiTruth
float m_f_ADCmaskValue
indicates channels which were masked in background dataset
SG::ReadCondHandleKey< TileSamplingFraction > m_samplingFractionKey
Name of TileSamplingFraction in condition store.
Gaudi::Property< double > m_filterThreshold
Gaudi::Property< bool > m_maskBadChannels
ServiceHandle< IAthRNGSvc > m_rndmSvc
Random number service to use.
SG::ReadHandleKey< TileDigitsContainer > m_inputDigitContainerKey
float m_f_ADCmaxHG
ADC saturation value - 0.5.
StatusCode overlayBackgroundDigits(const TileDigitsCollection *bkgDigitCollection, const TileHitCollection *hitCollection, std::vector< std::vector< double > > &drawerBufferLo, std::vector< std::vector< double > > &drawerBufferHi, std::vector< int > &igain, int ros, int drawer, int drawerIdx, std::vector< int > &over_gain, const TileEMScale *emScale, const TileSampleNoise *sampleNoise, const TileDQstatus *dqStatus, const TileBadChannels *badChannels) const
std::vector< std::unique_ptr< HWIdentifier[]> > m_all_ids
SG::WriteHandleKey< TileDigitsContainer > m_digitsContainer_DigiHSTruthKey
const TileID * m_tileID
bool first
Definition DeMoScan.py:534
float round(const float toRound, const unsigned int decimals)
Definition Mdt.cxx:27
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
std::list< value_t > type
type of the collection of timed data object

◆ 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 & AthCommonReentrantAlgorithm< 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 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ fillDigitCollection()

StatusCode TileDigitsMaker::fillDigitCollection ( const TileHitCollection * hitCollection,
std::vector< std::vector< double > > & drawerBufferLo,
std::vector< std::vector< double > > & drawerBufferHi,
std::vector< int > & igain,
std::vector< int > & overgain,
std::vector< double > & ech_int,
std::vector< bool > & signal_in_channel,
const TileEMScale * emScale,
const TileSamplingFraction * samplingFraction,
const TilePulse * pulse ) const
private

Definition at line 1094 of file TileDigitsMaker.cxx.

1099 {
1100
1101 constexpr int nchMax = 48; // number of channels per drawer
1102 std::array<int, nchMax> ntot_ch; ntot_ch.fill(0);
1103 std::array<double, nchMax> ech_tot; ech_tot.fill(0.0);
1104 //double ech_int[nchMax];
1105
1106 IdContext drawer_context = m_tileHWID->drawer_context();
1107
1108 /* Set up buffers for handling information in a single collection. */
1109 HWIdentifier drawer_id = m_tileHWID->drawer_id(hitCollection->identify());
1110 int ros = m_tileHWID->ros(drawer_id);
1111 int drawer = m_tileHWID->drawer(drawer_id);
1112 int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
1113
1114
1115 // iterate over all hits in a collection
1116 for (const TileHit* tileHit : *hitCollection) {
1117
1118 /* Get hit Identifier (= pmt_ID) and needed parameters for this channel */
1119 Identifier pmt_id = tileHit->pmt_ID();
1120 double mbts_extra_factor = (m_tileTBID->is_tiletb(pmt_id)) ? -1.0 : 1.0;
1121 HWIdentifier channel_id = tileHit->pmt_HWID();
1122 int ich = m_tileHWID->channel(channel_id);
1123 signal_in_channel[ich] = true;
1124
1125 if (over_gain[ich] > 9) {
1126 if (msgLvl(MSG::DEBUG)) {
1127 int n_hits = tileHit->size();
1128 double e_hit(0.);
1129 for (int ihit = 0; ihit < n_hits; ++ihit) {
1130 e_hit += tileHit->energy(ihit);
1131 }
1132 e_hit *= std::round(samplingFraction->getSamplingFraction(drawerIdx, ich) * 1000) / 1000;
1133 ech_tot[ich] += e_hit;
1134 ntot_ch[ich] += n_hits;
1135 ATH_MSG_VERBOSE("BAD Overlay digits - skip hit in channel " << m_tileHWID->to_string(channel_id,-1));
1136 }
1137 continue;
1138 } else {
1139 ATH_MSG_VERBOSE("new hit in channel " << m_tileHWID->to_string(channel_id,-1));
1140 }
1141
1142 /* Set gain=high and get digitSamples and calibration for this channel. */
1143 if (igain[ich] < 0)
1144 igain[ich] = TileID::HIGHGAIN;
1145 // conversion from scintillator energy to total cell energy (sampling fraction)
1146 double hit_calib = samplingFraction->getSamplingFraction(drawerIdx, ich);
1147 hit_calib = std::round(hit_calib * 1000) / 1000;
1148
1149 // conversion to ADC counts for high gain
1150 double efactorHi = hit_calib / emScale->calibrateChannel(drawerIdx, ich, TileID::HIGHGAIN, 1.
1152 // conversion to ADC counts for low gain
1153 double efactorLo = hit_calib / emScale->calibrateChannel(drawerIdx, ich, TileID::LOWGAIN, 1.
1155
1156 std::vector<double>& digitSamplesHi = drawerBufferHi[ich];
1157 std::vector<double>& digitSamplesLo = drawerBufferLo[ich];
1158 /* Loop over the subhits for this channel. For each one,
1159 convolute with shaping function and add to digitSamples. */
1160 int n_hits = tileHit->size();
1161 for (int ihit = 0; ihit < n_hits; ++ihit) {
1162 /* Get hit energy and convert to amplitude of high-gain and low-gain channel */
1163 double e_hit = tileHit->energy(ihit);
1164 double amp_ch = e_hit * efactorHi;
1165 double amp_ch_lo = e_hit * efactorLo;
1166 double ech_sub = e_hit * hit_calib;
1167 double t_hit = tileHit->time(ihit);
1168
1169 ech_tot[ich] += ech_sub;
1170 if (fabs(t_hit) < 50.0) // ene within +/- 50 ns, used for filtered digits cut
1171 ech_int[ich] += ech_sub * mbts_extra_factor;
1172 ntot_ch[ich] += 1;
1173
1174 // Assume time is in nanoseconds, use fine-grain shaping:
1175 int ishiftHi = (int) (t_hit / m_timeStepHi + 0.5);
1176 for (int js = 0; js < m_nSamples; ++js) {
1177 int k = m_binTime0Hi + (js - m_iTrig) * m_nBinsPerXHi - ishiftHi;
1178 if (k < 0)
1179 k = 0;
1180 else if (k > m_nShapeHi)
1181 k = m_nShapeHi;
1182
1184 float phase = (k - m_binTime0Hi) * m_timeStepHi;
1185 float y, dy;
1186 pulse->getPulseShapeYDY(drawerIdx, ich, 1, phase, y, dy);
1187 double ampl = (double) y;
1188 digitSamplesHi[js] += amp_ch * ampl;
1189 ATH_MSG_VERBOSE( "Sample no.=" << js
1190 << " Pulse index=" << k
1191 << " Shape wt. =" << ampl
1192 << " HIGAIN from COOL");
1193
1194 } else {
1195 digitSamplesHi[js] += amp_ch * m_digitShapeHi[k];
1196 ATH_MSG_VERBOSE( "Sample no.=" << js
1197 << " Pulse index=" << k
1198 << " Shape wt. =" << m_digitShapeHi[k]
1199 << " HIGAIN from TileInfo");
1200 }
1201
1202 }
1203 int ishiftLo = (int) (t_hit / m_timeStepLo + 0.5);
1204 for (int js = 0; js < m_nSamples; ++js) {
1205 int k = m_binTime0Lo + (js - m_iTrig) * m_nBinsPerXLo - ishiftLo;
1206 if (k < 0)
1207 k = 0;
1208 else if (k > m_nShapeLo)
1209 k = m_nShapeLo;
1210
1212 float phase = (k - m_binTime0Lo) * m_timeStepLo;
1213 float y, dy;
1214 pulse->getPulseShapeYDY(drawerIdx, ich, 0, phase, y, dy);
1215 double ampl = (double) y;
1216 digitSamplesLo[js] += amp_ch_lo * ampl;
1217 ATH_MSG_VERBOSE( "Sample no.=" << js
1218 << " Pulse index=" << k
1219 << " Shape wt. =" << ampl
1220 << " LOGAIN from COOL");
1221 } else {
1222 digitSamplesLo[js] += amp_ch_lo * m_digitShapeLo[k];
1223 ATH_MSG_VERBOSE( "Sample no.=" << js
1224 << " Pulse index=" << k
1225 << " Shape wt. =" << m_digitShapeLo[k]
1226 << " LOGAIN from TileInfo");
1227 }
1228
1229 }
1230
1231 if (msgLvl(MSG::VERBOSE)) {
1232 msg(MSG::VERBOSE) << "subHit: ch=" << ich
1233 << " e_hit=" << e_hit
1234 << " t_hit=" << t_hit
1235 << " SamplesHi[" << m_iTrig << "]=" << digitSamplesHi[m_iTrig]
1236 << " SamplesLo[" << m_iTrig << "]=" << digitSamplesLo[m_iTrig] << endmsg;
1237 }
1238 } /* end loop over sub-hits */
1239 } /* end loop over hits for this collection. */
1240
1241
1242 return StatusCode::SUCCESS;
1243
1244}
#define y
int m_binTime0Lo
Index of time=0 bin for low gain pulse shape.
int m_nShapeLo
Number of bins in low gain pulse shape.
int m_nBinsPerXHi
Number of bins per bunch crossing in high gain pulse shape.
int m_nBinsPerXLo
Number of bins per bunch crossing in low gain pulse shape.
double m_timeStepHi
Time step in high gain pulse shape: 25.0 / nBinsPerXHi.
std::vector< double > m_digitShapeHi
High gain pulse shape.
std::vector< double > m_digitShapeLo
Low gain pulse shape.
double m_timeStepLo
Time step in low gain pulse shape: 25.0 / nBinsPerXLo.
int m_nShapeHi
Number of bins in high gain pulse shape.
int m_binTime0Hi
Index of time=0 bin for high gain pulse shape.
const TileTBID * m_tileTBID
float calibrateChannel(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude, TileRawChannelUnit::UNIT rawDataUnitIn, TileRawChannelUnit::UNIT rawDataUnitOut) const
Calibrate a Tile channel.
bool getPulseShapeYDY(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float time, float &y, float &dy) const
Definition TilePulse.h:35
float getSamplingFraction(unsigned int drawerIdx, unsigned int channel) const
Return Tile Calorimeter sampling fraction.

◆ filterPassed()

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

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode TileDigitsMaker::finalize ( )
overridevirtual

finalize method

Definition at line 1088 of file TileDigitsMaker.cxx.

1088 {
1089 ATH_MSG_DEBUG( "TileDigitsMaker finalized successfully");
1090
1091 return StatusCode::SUCCESS;
1092}

◆ initialize()

StatusCode TileDigitsMaker::initialize ( )
overridevirtual

initialize method

Definition at line 66 of file TileDigitsMaker.cxx.

66 {
67 // retrieve TileID helper and TileInfo from det store
68
70
72
74
76
77 //=== intialize TileEMScale condtion object
78 ATH_CHECK( m_emScaleKey.initialize() );
79
80 //=== initialize TileSampleNoise condition object
81 ATH_CHECK( m_sampleNoiseKey.initialize() );
82
83 ATH_CHECK( m_cablingSvc.retrieve() );
84 m_cabling = m_cablingSvc->cablingService();
85
86 /* Get needed parameters from tileInfo. */
87 m_nSamples = m_tileInfo->NdigitSamples(); // number of time slices for each chan
88 m_iTrig = m_tileInfo->ItrigSample(); // index of the triggering time slice
89 m_i_ADCmax = m_tileInfo->ADCmax(); // adc saturation value used in assignment
90 m_f_ADCmax = m_i_ADCmax; // adc saturation value used in assignment
91 m_f_ADCmaxHG = m_f_ADCmax - 0.5; // value of switch from high to low gain
94 m_f_ADCmaskValue = m_tileInfo->ADCmaskValue(); // indicates channels which were masked in background dataset
95 m_tileNoise = m_tileInfo->TileNoise(); // (true => generate noise in TileDigits)
96 m_tileCoherNoise = m_tileInfo->TileCoherNoise(); // (true => generate coherent noise in TileDigits)
97 m_tileThresh = m_tileInfo->TileZeroSuppress(); // (true => apply threshold to Digits)
98 m_tileThreshHi = m_tileInfo->ThresholdDigits(TileID::HIGHGAIN);
99 m_tileThreshLo = m_tileInfo->ThresholdDigits(TileID::LOWGAIN);
100
102 ATH_CHECK( m_rndmSvc.retrieve());
103 }
104
105 ATH_MSG_DEBUG( "Event Overlay: " << ((m_rndmEvtOverlay)?"true":"false"));
106 ATH_MSG_DEBUG( "Masking Channels: " << ((m_maskBadChannels)?"true":"false"));
107 ATH_MSG_DEBUG( "Using pulse shapes from COOL: " << ((m_useCoolPulseShapes)?"true":"false"));
108
110 ATH_CHECK( m_samplingFractionKey.initialize() );
111
113 ATH_MSG_DEBUG( "Initializing pulse shape conditions object");
114 } else {
115 /* Get fine-grained shaping profile (0.5-ns bins) for both gains*/
116 m_digitShapeHi = m_tileInfo->digitsFullShapeHi();
117 m_digitShapeHi.push_back(0.0);
118 m_digitShapeLo = m_tileInfo->digitsFullShapeLo();
119 m_digitShapeLo.push_back(0.0);
120 }
121
122 //=== Initialize bad channels key
124
125 m_nShapeHi = m_tileInfo->digitsNBinsHi();
126 m_nBinsPerXHi = m_tileInfo->digitsBinsPerXHi();
127 m_binTime0Hi = m_tileInfo->digitsTime0BinHi();
129
130 m_nShapeLo = m_tileInfo->digitsNBinsLo();
131 m_nBinsPerXLo = m_tileInfo->digitsBinsPerXLo();
132 m_binTime0Lo = m_tileInfo->digitsTime0BinLo();
134
137
138 if (m_rndmEvtOverlay) {
139 m_tileNoise = false;
140 m_tileCoherNoise = false;
141 m_tileThresh = false;
142 m_calibRun = false;
143 if (m_allChannels<0) m_allChannels = 2; // create all channels with noise in overlay by default
144
145 ATH_MSG_DEBUG( "Pileup and/or noise added by overlaying digits of random events");
146
147 // locate the PileUpMergeSvc and initialize our local ptr
149 ATH_CHECK( m_mergeSvc.retrieve() );
150 ATH_MSG_DEBUG( "PileUpMergeSvc successfully initialized");
151 }
152
153 ATH_CHECK( m_DQstatusKey.initialize() );
154
155 } else {
156 ATH_CHECK( m_DQstatusKey.initialize(!m_DQstatusKey.empty()) );
157
158 if (m_allChannels<0) m_allChannels = 0; // do not create all channels by default
159 if (m_tileNoise || m_tileCoherNoise) m_allChannels = 2; // unless noise is set to True
160 if (msgLvl(MSG::DEBUG)) {
161 msg(MSG::DEBUG) << "Obtained info from TileInfo" << endmsg;
162 msg(MSG::DEBUG) << "tileNoise=" << ((m_tileNoise) ? "true" : "false")
163 << ", tileCoherNoise=" << ((m_tileCoherNoise) ? "true" : "false")
164 << ", tileThresh=" << ((m_tileThresh) ? "true" : "false");
165 if (m_tileThresh)
166 msg(MSG::DEBUG) << ", thresh(hi,lo)=" << m_tileThreshHi << "," << m_tileThreshLo << endmsg;
167 else
168 msg(MSG::DEBUG) << endmsg;
169 }
170 }
171
172 if (m_allChannels>1)
173 ATH_MSG_DEBUG( "Create all channels with noise: true");
174 else if (m_allChannels>0)
175 ATH_MSG_DEBUG( "Create all channels without noise: true");
176 else
177 ATH_MSG_DEBUG( "Create all channels: false");
178
179 if (m_calibRun) {
181 }
182
183 if (!m_filteredDigitsContainerKey.key().empty()) {
184 ATH_MSG_DEBUG( "Keep digits with hit energy above " << m_filterThreshold / MeV
185 << " MeV in " << m_filteredDigitsContainerKey.key() << " container");
186 ATH_MSG_DEBUG( "Keep digits from MBTS with original G4 hit energy above "
187 << m_filterThresholdMBTS / MeV << " MeV ");
188
190
191 } else {
192 m_filterThreshold = HUGE_VALL;
193 m_filterThresholdMBTS = HUGE_VALL;
194 }
195
196 ATH_MSG_DEBUG( "nShapeHi=" << m_nShapeHi
197 << " nBinsPerXHi=" << m_nBinsPerXHi
198 << " timeStepHi=" << m_timeStepHi
199 << " binTime0Hi=" << m_binTime0Hi);
200
201 ATH_MSG_DEBUG( "nShapeLo=" << m_nShapeLo
202 << " nBinsPerXLo=" << m_nBinsPerXLo
203 << " timeStepLo=" << m_timeStepLo
204 << " binTime0Lo=" << m_binTime0Lo);
205
206 // decrease by 1, now they are indexes of last element in a vector
207 --m_nShapeHi;
208 --m_nShapeLo;
209
210 /* ==================================*/
211 // Store HWID's for all 12288 channels (48 channels in each of 64 drawers).
212 IdContext drawer_context = m_tileHWID->drawer_context();
213 int ndrawers = m_tileHWID->drawer_hash_max();
214 const int nchMax = 48; // number of channels per drawer
215
216 ATH_MSG_DEBUG( "ndrawers=" << ndrawers
217 << " nchMax=" << nchMax
218 << " HIGAIN=" << TileID::HIGHGAIN
219 << " LOWGAIN=" << TileID::LOWGAIN);
220
221 /* Store all (12288) Identifiers for the calorimeter adc's for HIGHAIN */
222 m_all_ids.reserve(ndrawers);
223 for (int dr = 0; dr < ndrawers; ++dr) {
224 HWIdentifier drawer_id;
225 m_tileHWID->get_id(dr, drawer_id, &drawer_context);
226
227 m_all_ids.push_back(std::make_unique<HWIdentifier[]>(nchMax));
228 std::unique_ptr<HWIdentifier[]>& adc_ids = m_all_ids.back();
229
230 int ros = m_tileHWID->ros(drawer_id);
231 if (ros > 0) {
232 int drawer = m_tileHWID->drawer(drawer_id);
233 IdentifierHash idhash;
234 m_tileHWID->get_hash(drawer_id, idhash, &drawer_context);
235 int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
236 if (drawerIdx != (int)idhash) {
237 ATH_MSG_ERROR("drawer " << m_tileHWID->to_string(drawer_id, -2)
238 << " hash " << idhash << " NOT EQUAL to idx " << drawerIdx);
239 } else if (msgLvl(MSG::VERBOSE) && m_cabling->connected(ros, drawer)) {
240 msg(MSG::VERBOSE) << "drawer " << m_tileHWID->to_string(drawer_id, -2)
241 << " hash " << idhash << endmsg;
242 }
243
244 for (int ch = 0; ch < nchMax; ++ch) {
245 adc_ids[ch] = m_tileHWID->adc_id(drawer_id, ch, TileID::HIGHGAIN);
246 }
247 }
248 }
249
252
253 ATH_CHECK( m_hitContainerKey.initialize() );
254 ATH_CHECK( m_digitsContainerKey.initialize() );
255
256 ATH_MSG_DEBUG( "TileDigitsMaker initialization completed");
257
258 return StatusCode::SUCCESS;
259}
const ServiceHandle< StoreGateSvc > & detStore() const
float m_ADCmaxMinusEps
ADC saturation value - 0.01 or something small.
int m_i_ADCmax
ADC saturation value.
float m_ADCmaxPlusEps
ADC saturation value + 0.01 or something small.
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
Gaudi::Property< std::string > m_infoName
double m_tileThreshLo
Actual threshold value for low gain.
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ 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()

◆ 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.

◆ overlayBackgroundDigits()

StatusCode TileDigitsMaker::overlayBackgroundDigits ( const TileDigitsCollection * bkgDigitCollection,
const TileHitCollection * hitCollection,
std::vector< std::vector< double > > & drawerBufferLo,
std::vector< std::vector< double > > & drawerBufferHi,
std::vector< int > & igain,
int ros,
int drawer,
int drawerIdx,
std::vector< int > & over_gain,
const TileEMScale * emScale,
const TileSampleNoise * sampleNoise,
const TileDQstatus * dqStatus,
const TileBadChannels * badChannels ) const
private

Definition at line 1246 of file TileDigitsMaker.cxx.

1253 {
1254
1255 if (hitCollection->identify() != bkgDigitCollection->identify()) {
1256 ATH_MSG_ERROR ( "Frag IDs for hit collection and digits overlay collection do not match "
1257 << MSG::hex << hitCollection->identify() << " != " << bkgDigitCollection->identify()
1258 << MSG::dec );
1259 return StatusCode::FAILURE;
1260 }
1261
1262
1263 // iterate over all digits in a collection
1264 for (const auto* bkgDigit : *bkgDigitCollection) {
1265
1266 /* Get digit HWIdentifier (= adc_id) */
1267 HWIdentifier adcId = bkgDigit->adc_HWID();
1268 int channel = m_tileHWID->channel(adcId);
1269 int gain = m_tileHWID->adc(adcId);
1270
1271 igain[channel] = gain;
1272
1273 // get channel status
1274 bool good_dq = dqStatus->isAdcDQgood(ros, drawer, channel, gain);
1275 bool good_ch = (!badChannels->getAdcStatus(adcId).isBad());
1276
1277 // get digits
1278 std::vector<float> digits = bkgDigit->samples();
1279 // get number of time samples & compare with nSamp
1280 int nSamp2 = digits.size();
1281 int goodDigits = nSamp2;
1282 float dig(m_f_ADCmaskValue),digmin(65536.),digmax(-65536.);
1283 if (goodDigits > 0) {
1284 auto minmax = std::minmax_element(digits.begin(), digits.end());
1285 digmin = *minmax.first;
1286 digmax = *minmax.second;
1287 }
1288
1289 if (good_dq) {
1290 if (digmax > m_ADCmaxPlusEps) { // ignore everything in case of invalid digits
1291 dig = m_f_ADCmaskValue;
1292 goodDigits = 0;
1293 } else { // skip zeros or overflows
1294 float ADCmaxMinusEps = m_ADCmaxMinusEps;
1295 int badDigits = std::count_if(digits.begin(), digits.end(), [ADCmaxMinusEps](float dig){
1296 return (dig < 0.01) || (dig > ADCmaxMinusEps);});
1297 goodDigits -= badDigits;
1298 dig = digits.back();
1299 }
1300 } else if (goodDigits>0) {
1301 goodDigits = 0;
1302 dig = digits.back();
1303 }
1304
1305 if (goodDigits>0) {
1306 over_gain[channel] = gain;
1307 if (nSamp2 != m_nSamples) {
1308 float lastDigit = digits.back();
1309 digits.resize(m_nSamples);
1310 // repeat last value in vector (nSamp-nSamp2) times
1311 std::fill(digits.begin() + nSamp2, digits.end(), lastDigit);
1312 }
1313
1314 std::vector<double>& buffer = (gain == TileID::HIGHGAIN) ? drawerBufferHi[channel] : drawerBufferLo[channel];
1315 std::vector<double>& bufferLG = drawerBufferLo[channel];
1316
1317 bool isFilledLG = false;
1318 if (gain == TileID::HIGHGAIN) {
1319 if (digmax - digmin > 5. && good_ch ) {// 5 ADC counts cut - to ignore pure noise in HG (less than 0.1 count effect in LG)
1320 float ratio = emScale->applyOnlineChargeCalibration(drawerIdx, channel, TileID::HIGHGAIN, 1.)
1321 / emScale->applyOnlineChargeCalibration(drawerIdx, channel, TileID::LOWGAIN, 1.); // ratio between low and high gain
1322
1323 dig=std::min(digits[0],std::max(digmin, sampleNoise->getPed(drawerIdx, channel, TileID::HIGHGAIN)));
1324
1325 std::transform(digits.begin(), digits.end(), bufferLG.begin(), [dig,ratio](float digit){return (digit - dig) * ratio;});
1326 isFilledLG = true;
1327 }
1328 }
1329
1330 std::copy(digits.begin(), digits.end(), buffer.begin());
1331
1332 if (msgLvl(MSG::VERBOSE)) {
1333 msg(MSG::VERBOSE) << "RNDM BG ADC " << m_tileHWID->to_string(adcId)
1334 << " samples=";
1335 for (int js = 0; js < m_nSamples; ++js)
1336 msg(MSG::VERBOSE) << " " << buffer[js];
1337 if (!good_ch)
1338 msg(MSG::VERBOSE) << " BCH";
1339 // good_dq should always be true here, but leave in place in case
1340 // things change.
1341 //coverity[DEADCODE]
1342 if (!good_dq) {
1343 msg(MSG::VERBOSE) << " BDQ";
1344 } else if (isFilledLG) {
1345 msg(MSG::VERBOSE) << " LG=";
1346 for (int js = 0; js < m_nSamples; ++js)
1347 msg(MSG::VERBOSE) << " " << int(bufferLG[js]*100)/100.;
1348 }
1349 msg(MSG::VERBOSE) << endmsg;
1350 }
1351
1352 } else if (nSamp2 > 0) {
1353 over_gain[channel] = 10+gain; // flag problematic channel
1354
1355 std::vector<double>& buffer = (gain == TileID::HIGHGAIN) ? drawerBufferHi[channel] : drawerBufferLo[channel];
1356
1357 if (digmin != digmax || (dig!=0. && dig!=m_f_ADCmax)) {
1358 dig = m_f_ADCmaskValue; // keep only 0 or m_f_ADCmax as it is
1359 }
1360 std::fill(buffer.begin(), buffer.end(), dig);
1361
1362 if (msgLvl(MSG::VERBOSE)) {
1363 msg(MSG::VERBOSE) << "BAD BG ADC " << m_tileHWID->to_string(adcId)
1364 << " samples=";
1365 for (int js = 0; js < nSamp2; ++js)
1366 msg(MSG::VERBOSE) << " " << digits[js];
1367 msg(MSG::VERBOSE) << ((good_ch)?"":" BCH") << ((good_dq)?"":" BDQ") << endmsg;
1368 }
1369
1370 } else {
1371 ATH_MSG_VERBOSE( "NO BG ADC " << m_tileHWID->to_string(adcId)
1372 << " samples= 0 0 0 0 0 0 0"
1373 << ((good_ch)?"":" BCH") << ((good_dq)?"":" BDQ") );
1374 }
1375 }
1376 return StatusCode::SUCCESS;
1377}
bool isAdcDQgood(int partition, int drawer, int ch, int gain) const
returns status of single ADC returns False if there are any errors
float applyOnlineChargeCalibration(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude) const
Apply online CIS calibration: ADC counts -> pC.
float getPed(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const

◆ 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 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

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

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< 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.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< 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 HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
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 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_ADCmaxMinusEps

float TileDigitsMaker::m_ADCmaxMinusEps {0.0F}
private

ADC saturation value - 0.01 or something small.

Definition at line 175 of file TileDigitsMaker.h.

175{0.0F};

◆ m_ADCmaxPlusEps

float TileDigitsMaker::m_ADCmaxPlusEps {0.0F}
private

ADC saturation value + 0.01 or something small.

Definition at line 176 of file TileDigitsMaker.h.

176{0.0F};

◆ m_all_ids

std::vector<std::unique_ptr<HWIdentifier[]> > TileDigitsMaker::m_all_ids
private

Definition at line 168 of file TileDigitsMaker.h.

◆ m_allChannels

Gaudi::Property<int> TileDigitsMaker::m_allChannels
private
Initial value:
{this,
"AllChannels", -1, "Create all channels, use 0 or 1 or 2 (default=-1 - unset)"}

Definition at line 157 of file TileDigitsMaker.h.

157 {this,
158 "AllChannels", -1, "Create all channels, use 0 or 1 or 2 (default=-1 - unset)"};

◆ m_badChannelsKey

SG::ReadCondHandleKey<TileBadChannels> TileDigitsMaker::m_badChannelsKey
private
Initial value:
{this,
"TileBadChannels", "TileBadChannels", "Input Tile bad channel status"}

Name of TileBadChannels in condition store.

Definition at line 233 of file TileDigitsMaker.h.

233 {this,
234 "TileBadChannels", "TileBadChannels", "Input Tile bad channel status"};

◆ m_binTime0Hi

int TileDigitsMaker::m_binTime0Hi {0}
private

Index of time=0 bin for high gain pulse shape.

Definition at line 187 of file TileDigitsMaker.h.

187{0};

◆ m_binTime0Lo

int TileDigitsMaker::m_binTime0Lo {0}
private

Index of time=0 bin for low gain pulse shape.

Definition at line 193 of file TileDigitsMaker.h.

193{0};

◆ m_cabling

const TileCablingService* TileDigitsMaker::m_cabling {nullptr}
private

TileCabling instance.

Definition at line 166 of file TileDigitsMaker.h.

166{nullptr};

◆ m_cablingSvc

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

Name of Tile cabling service.

Definition at line 199 of file TileDigitsMaker.h.

199 { this,
200 "TileCablingSvc", "TileCablingSvc", "The Tile cabling service"};

◆ m_calibRun

Gaudi::Property<bool> TileDigitsMaker::m_calibRun
private
Initial value:
{this,
"CalibrationRun", false, "If true -> both high and low gain saved"}

Definition at line 142 of file TileDigitsMaker.h.

142 {this,
143 "CalibrationRun", false, "If true -> both high and low gain saved"};

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_digitsContainer_DigiHSTruthKey

SG::WriteHandleKey<TileDigitsContainer> TileDigitsMaker::m_digitsContainer_DigiHSTruthKey
private
Initial value:
{this,
"TileDigitsContainer_DigiHSTruth", "TileDigitsCnt_DigiHSTruth", "Output DigiHSTruth Tile digits container key"}

Definition at line 124 of file TileDigitsMaker.h.

124 {this,
125 "TileDigitsContainer_DigiHSTruth", "TileDigitsCnt_DigiHSTruth", "Output DigiHSTruth Tile digits container key"};

◆ m_digitsContainerKey

SG::WriteHandleKey<TileDigitsContainer> TileDigitsMaker::m_digitsContainerKey
private
Initial value:
{this,
"TileDigitsContainer", "TileDigitsCnt", "Output Tile digits container key"}

Definition at line 121 of file TileDigitsMaker.h.

121 {this,
122 "TileDigitsContainer", "TileDigitsCnt", "Output Tile digits container key"};

◆ m_digitShapeHi

std::vector<double> TileDigitsMaker::m_digitShapeHi
private

High gain pulse shape.

Definition at line 184 of file TileDigitsMaker.h.

◆ m_digitShapeLo

std::vector<double> TileDigitsMaker::m_digitShapeLo
private

Low gain pulse shape.

Definition at line 190 of file TileDigitsMaker.h.

◆ m_doDigiTruth

Gaudi::Property<bool> TileDigitsMaker::m_doDigiTruth
private
Initial value:
{this,
"DoHSTruthReconstruction", false, ""}

Definition at line 154 of file TileDigitsMaker.h.

154 {this,
155 "DoHSTruthReconstruction", false, ""};

◆ m_DQstatusKey

SG::ReadHandleKey<TileDQstatus> TileDigitsMaker::m_DQstatusKey
private
Initial value:
{this,
"TileDQstatus", "", "Input TileDQstatus key" }

Definition at line 236 of file TileDigitsMaker.h.

236 {this,
237 "TileDQstatus", "", "Input TileDQstatus key" };

◆ m_emScaleKey

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

Name of TileEMScale in condition store.

Definition at line 215 of file TileDigitsMaker.h.

215 {this,
216 "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 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

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

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

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_f_ADCmaskValue

float TileDigitsMaker::m_f_ADCmaskValue {0.0F}
private

indicates channels which were masked in background dataset

Definition at line 177 of file TileDigitsMaker.h.

177{0.0F};

◆ m_f_ADCmax

float TileDigitsMaker::m_f_ADCmax {0.0F}
private

ADC saturation value.

Definition at line 173 of file TileDigitsMaker.h.

173{0.0F};

◆ m_f_ADCmaxHG

float TileDigitsMaker::m_f_ADCmaxHG {0.0F}
private

ADC saturation value - 0.5.

Definition at line 174 of file TileDigitsMaker.h.

174{0.0F};

◆ m_filteredDigitsContainerKey

SG::WriteHandleKey<TileDigitsContainer> TileDigitsMaker::m_filteredDigitsContainerKey
private
Initial value:
{this,
"TileFilteredContainer", "TileDigitsFlt", "Output filtered Tile digits container key"}

Definition at line 127 of file TileDigitsMaker.h.

127 {this,
128 "TileFilteredContainer", "TileDigitsFlt", "Output filtered Tile digits container key"};

◆ m_filterThreshold

Gaudi::Property<double> TileDigitsMaker::m_filterThreshold
private
Initial value:
{this,
"FilterThreshold", 100.0 * Athena::Units::MeV, "Threshold on filtered digits (default - 100 MeV)"}

Definition at line 130 of file TileDigitsMaker.h.

130 {this,
131 "FilterThreshold", 100.0 * Athena::Units::MeV, "Threshold on filtered digits (default - 100 MeV)"};

◆ m_filterThresholdMBTS

Gaudi::Property<double> TileDigitsMaker::m_filterThresholdMBTS
private
Initial value:
{this,
"FilterThresholdMBTS", 0.0 * Athena::Units::MeV, "Threshold on filtered digits of MBTS (default - 0 MeV)"}

Definition at line 133 of file TileDigitsMaker.h.

133 {this,
134 "FilterThresholdMBTS", 0.0 * Athena::Units::MeV, "Threshold on filtered digits of MBTS (default - 0 MeV)"};

◆ m_hitContainer_DigiHSTruthKey

SG::ReadHandleKey<TileHitContainer> TileDigitsMaker::m_hitContainer_DigiHSTruthKey
private
Initial value:
{this,
"TileHitContainer_DigiHSTruth","TileHitCnt_DigiHSTruth", "input Tile hit container key"}

Definition at line 112 of file TileDigitsMaker.h.

112 {this,
113 "TileHitContainer_DigiHSTruth","TileHitCnt_DigiHSTruth", "input Tile hit container key"};

◆ m_hitContainerKey

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

Definition at line 109 of file TileDigitsMaker.h.

109 {this,
110 "TileHitContainer", "TileHitCnt", "input Tile hit container key"};

◆ m_i_ADCmax

int TileDigitsMaker::m_i_ADCmax {0}
private

ADC saturation value.

Definition at line 172 of file TileDigitsMaker.h.

172{0};

◆ m_infoName

Gaudi::Property<std::string> TileDigitsMaker::m_infoName
private
Initial value:
{this,
"TileInfoName", "TileInfo", "TileInfo object name"}

Definition at line 136 of file TileDigitsMaker.h.

136 {this,
137 "TileInfoName", "TileInfo", "TileInfo object name"};

◆ m_inputDigitContainerKey

SG::ReadHandleKey<TileDigitsContainer> TileDigitsMaker::m_inputDigitContainerKey {this, "InputTileDigitContainer","",""}
private

Definition at line 118 of file TileDigitsMaker.h.

118{this, "InputTileDigitContainer","",""};

◆ m_inputDigitContainerName

std::string TileDigitsMaker::m_inputDigitContainerName {""}
private

Definition at line 119 of file TileDigitsMaker.h.

119{""};

◆ m_integerDigits

Gaudi::Property<bool> TileDigitsMaker::m_integerDigits
private
Initial value:
{this,
"IntegerDigits", true, "Round digits to integer"}

Definition at line 139 of file TileDigitsMaker.h.

139 {this,
140 "IntegerDigits", true, "Round digits to integer"};

◆ m_iTrig

int TileDigitsMaker::m_iTrig {0}
private

Index of the triggering time slice.

Definition at line 171 of file TileDigitsMaker.h.

171{0};

◆ m_maskBadChannels

Gaudi::Property<bool> TileDigitsMaker::m_maskBadChannels
private
Initial value:
{this,
"MaskBadChannels", false, "Remove channels tagged bad (default=false)"}

Definition at line 151 of file TileDigitsMaker.h.

151 {this,
152 "MaskBadChannels", false, "Remove channels tagged bad (default=false)"};

◆ m_mergeSvc

ServiceHandle<PileUpMergeSvc> TileDigitsMaker::m_mergeSvc {this, "PileUpMergeSvc", "PileUpMergeSvc"}
private

Definition at line 160 of file TileDigitsMaker.h.

160{this, "PileUpMergeSvc", "PileUpMergeSvc"};

◆ m_nBinsPerXHi

int TileDigitsMaker::m_nBinsPerXHi {0}
private

Number of bins per bunch crossing in high gain pulse shape.

Definition at line 186 of file TileDigitsMaker.h.

186{0};

◆ m_nBinsPerXLo

int TileDigitsMaker::m_nBinsPerXLo {0}
private

Number of bins per bunch crossing in low gain pulse shape.

Definition at line 192 of file TileDigitsMaker.h.

192{0};

◆ m_nSamples

int TileDigitsMaker::m_nSamples {0}
private

Number of time slices for each channel.

Definition at line 170 of file TileDigitsMaker.h.

170{0};

◆ m_nShapeHi

int TileDigitsMaker::m_nShapeHi {0}
private

Number of bins in high gain pulse shape.

Definition at line 185 of file TileDigitsMaker.h.

185{0};

◆ m_nShapeLo

int TileDigitsMaker::m_nShapeLo {0}
private

Number of bins in low gain pulse shape.

Definition at line 191 of file TileDigitsMaker.h.

191{0};

◆ m_onlyUseContainerName

Gaudi::Property<bool> TileDigitsMaker::m_onlyUseContainerName
private
Initial value:
{this,
"OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."}

Definition at line 115 of file TileDigitsMaker.h.

115 {this,
116 "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."};

◆ m_pulseShapeKey

SG::ReadCondHandleKey<TilePulse> TileDigitsMaker::m_pulseShapeKey
private
Initial value:
{this,
"TilePulseShape", "TilePulseShape", "Input Tile pulse shape"}

Name of TilePulseShape in condition store.

Definition at line 221 of file TileDigitsMaker.h.

221 {this,
222 "TilePulseShape", "TilePulseShape", "Input Tile pulse shape"};

◆ m_randomStreamName

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

Random Stream Name.

Definition at line 204 of file TileDigitsMaker.h.

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

◆ m_rndmEvtOverlay

Gaudi::Property<bool> TileDigitsMaker::m_rndmEvtOverlay
private
Initial value:
{this,
"RndmEvtOverlay", false, "Pileup and/or noise added by overlaying random events (default=false)"}

Definition at line 145 of file TileDigitsMaker.h.

145 {this,
146 "RndmEvtOverlay", false, "Pileup and/or noise added by overlaying random events (default=false)"};

◆ m_rndmSvc

ServiceHandle<IAthRNGSvc> TileDigitsMaker::m_rndmSvc {this, "RndmSvc", "AthRNGSvc", ""}
private

Random number service to use.

Definition at line 202 of file TileDigitsMaker.h.

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

◆ m_sampleNoiseKey

SG::ReadCondHandleKey<TileSampleNoise> TileDigitsMaker::m_sampleNoiseKey
private
Initial value:
{this,
"TileSampleNoise", "TileSampleNoise", "Input Tile sample noise"}

Name of TileSampleNoise in condition store.

Definition at line 209 of file TileDigitsMaker.h.

209 {this,
210 "TileSampleNoise", "TileSampleNoise", "Input Tile sample noise"};

◆ m_samplingFractionKey

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

Name of TileSamplingFraction in condition store.

Definition at line 227 of file TileDigitsMaker.h.

227 {this,
228 "TileSamplingFraction", "TileSamplingFraction", "Input Tile sampling fraction"};

◆ m_tileCoherNoise

bool TileDigitsMaker::m_tileCoherNoise {false}
private

If true => generate coherent noise in TileDigits.

Definition at line 179 of file TileDigitsMaker.h.

179{false};

◆ m_tileHWID

const TileHWID* TileDigitsMaker::m_tileHWID {nullptr}
private

Definition at line 164 of file TileDigitsMaker.h.

164{nullptr};

◆ m_tileID

const TileID* TileDigitsMaker::m_tileID {nullptr}
private

Definition at line 162 of file TileDigitsMaker.h.

162{nullptr};

◆ m_tileInfo

const TileInfo* TileDigitsMaker::m_tileInfo {nullptr}
private

Definition at line 165 of file TileDigitsMaker.h.

165{nullptr};

◆ m_tileNoise

bool TileDigitsMaker::m_tileNoise {false}
private

If true => generate noise in TileDigits.

Definition at line 178 of file TileDigitsMaker.h.

178{false};

◆ m_tileTBID

const TileTBID* TileDigitsMaker::m_tileTBID {nullptr}
private

Definition at line 163 of file TileDigitsMaker.h.

163{nullptr};

◆ m_tileThresh

bool TileDigitsMaker::m_tileThresh {false}
private

If true => apply threshold to Digits.

Definition at line 180 of file TileDigitsMaker.h.

180{false};

◆ m_tileThreshHi

double TileDigitsMaker::m_tileThreshHi {0.0}
private

Actual threshold value for high gain.

Definition at line 181 of file TileDigitsMaker.h.

181{0.0};

◆ m_tileThreshLo

double TileDigitsMaker::m_tileThreshLo {0.0}
private

Actual threshold value for low gain.

Definition at line 182 of file TileDigitsMaker.h.

182{0.0};

◆ m_timeStepHi

double TileDigitsMaker::m_timeStepHi {0.}
private

Time step in high gain pulse shape: 25.0 / nBinsPerXHi.

Definition at line 188 of file TileDigitsMaker.h.

188{0.};

◆ m_timeStepLo

double TileDigitsMaker::m_timeStepLo {0.}
private

Time step in low gain pulse shape: 25.0 / nBinsPerXLo.

Definition at line 194 of file TileDigitsMaker.h.

194{0.};

◆ m_useCoolPulseShapes

Gaudi::Property<bool> TileDigitsMaker::m_useCoolPulseShapes
private
Initial value:
{this,
"UseCoolPulseShapes", true, "Pulse shapes from database (default=true)"}

Definition at line 148 of file TileDigitsMaker.h.

148 {this,
149 "UseCoolPulseShapes", true, "Pulse shapes from database (default=true)"};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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