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

#include <TilePulseForTileMuonReceiver.h>

Inheritance diagram for TilePulseForTileMuonReceiver:

Public Member Functions

 TilePulseForTileMuonReceiver (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~TilePulseForTileMuonReceiver ()
virtual StatusCode initialize () override
 initialize method
virtual StatusCode execute () override
 execute method
virtual StatusCode finalize () override
 finalize method
virtual bool isClonable () const override final
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
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

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

Private Attributes

SG::ReadHandleKey< TileDigitsContainerm_inputDigitContainerKey {this, "InputTileDigitContainer","",""}
std::string m_inputDigitContainerName {""}
SG::ReadHandleKey< TileHitContainerm_hitContainerKey
SG::WriteHandleKey< TileDigitsContainerm_muRcvDigitsContainerKey
SG::WriteHandleKey< TileRawChannelContainerm_muRcvRawChannelContainerKey
SG::ReadCondHandleKey< TileSamplingFractionm_samplingFractionKey
 Name of TileSamplingFraction in condition store.
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_PulseForTileMuonReceiver", ""}
 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< TileBadChannelsm_badChannelsKey
 Name of TileBadChannels in condition store.
ToolHandle< TileRawChannelBuilderMFm_MuRcvBuildTool
Gaudi::Property< std::string > m_infoName {this, "TileInfoName", "TileInfo", "TileInfo object name"}
Gaudi::Property< bool > m_integerDigits {this, "IntegerDigits", false, "Round digits (default=false)"}
Gaudi::Property< bool > m_maskBadChannels {this, "MaskBadChannels", false, "Remove channels tagged bad (default=false)"}
Gaudi::Property< bool > m_useCoolPulseShapes {this, "UseCoolPulseShapes", false, "Pulse shapes from database (default=false)"}
Gaudi::Property< bool > m_tileNoise {this, "UseCoolNoise", false, "Noise from database (default=false)"}
Gaudi::Property< bool > m_tilePedestal {this, "UseCoolPedestal", false, "Pedestal from database (default=false)"}
Gaudi::Property< bool > m_rndmEvtOverlay {this, "RndmEvtOverlay", false, "Pileup and/or noise added by overlaying random events (default=false)"}
Gaudi::Property< bool > m_onlyUseContainerName {this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."}
const TileIDm_tileID
const TileHWIDm_tileHWID
const TileInfom_tileInfo
const TileCablingServicem_cablingService
 TileCabling instance.
int m_nSamples
 Number of time slices for each channel.
int m_iTrig
 Index of the triggering time slice.
int m_adcMax
 ADC saturation value.
double m_tileThresh
 Actual threshold value.
int m_nShape
 Number of bins in pulse shape.
int m_nBinsPerX
 Number of bins per bunch crossing in pulse shape.
int m_binTime0
 Index of time=0 bin for pulse shape.
double m_timeStep
 Time step in pulse shape: 25.0 / nBinsPerX.
ServiceHandle< PileUpMergeSvcm_mergeSvc {this, "PileUpMergeSvc", "PileUpMergeSvc"}
std::vector< double > m_shapeMuonReceiver
 Muon receiver pulse shape.
int m_runPeriod
DataObjIDColl m_extendedExtraObjects
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

Definition at line 80 of file TilePulseForTileMuonReceiver.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TilePulseForTileMuonReceiver()

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

Definition at line 70 of file TilePulseForTileMuonReceiver.cxx.

71 : AthAlgorithm(name, pSvcLocator)
72 , m_tileID(nullptr)
73 , m_tileHWID(nullptr)
74 , m_tileInfo(nullptr)
75 , m_cablingService(nullptr)
76 , m_nSamples(0)
77 , m_iTrig(0)
78 , m_adcMax(0)
79 , m_tileThresh(0.0)
80 , m_nShape(0)
81 , m_nBinsPerX(0)
82 , m_binTime0(0)
83 , m_timeStep(0.0)
84 , m_runPeriod(0)
85{
86}
AthAlgorithm()
Default constructor:
int m_iTrig
Index of the triggering time slice.
double m_tileThresh
Actual threshold value.
double m_timeStep
Time step in pulse shape: 25.0 / nBinsPerX.
int m_nShape
Number of bins in pulse shape.
const TileCablingService * m_cablingService
TileCabling instance.
int m_binTime0
Index of time=0 bin for pulse shape.
int m_nBinsPerX
Number of bins per bunch crossing in pulse shape.
int m_nSamples
Number of time slices for each channel.

◆ ~TilePulseForTileMuonReceiver()

TilePulseForTileMuonReceiver::~TilePulseForTileMuonReceiver ( )
virtual

Definition at line 90 of file TilePulseForTileMuonReceiver.cxx.

90 {
91}

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< 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< 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< 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< 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 TilePulseForTileMuonReceiver::execute ( )
overridevirtual

execute method

Definition at line 191 of file TilePulseForTileMuonReceiver.cxx.

191 {
192
193 if (m_runPeriod==0) {
194 ATH_MSG_VERBOSE( "ATT: RUN1 settings TilePulseForTileMuonReceiver will end now" );
195 return StatusCode::SUCCESS;
196 } else {
197 ATH_MSG_DEBUG( "Executing TilePulseForTileMuonReceiver" );
198 }
199
200 const EventContext& ctx = Gaudi::Hive::currentContext();
201
202 // Conversion from TMDB channel number to channel number in a drawer: EB (0-3) LB (0-8)
203 // Including the cells used in the "The potential of using the ATLAS Tile calorimeter in Phase-II for the
204 // Level-0 muon trigger" (ATL-COM-TILECAL-2015-007.pdf): ALL D-layer + BC-8.
205 //
206#define nEBchan 6
207#define nLBchan 9
208 // EB: D5(L,R),D6(L,R),D4(L,R)
209 int EBchan[nEBchan]={17,16,37,38,3,2};
210 // LB: D0,D1(L,R),D2(L,R),D3(L,R),BC8(L,R)
211 int LBchan[nLBchan]={0,13,14,25,24,41,44,39,40};
212 // Set to maximum possible index
213#if (nEBchan > nLBchan)
214 double pDigitSamplesArray[nEBchan][7];
215 double pDigitSamplesRndmArray[nEBchan][7];
216#else
217 double pDigitSamplesArray[nLBchan][7];
218 double pDigitSamplesRndmArray[nLBchan][7];
219#endif
220
221 // PULSE
222
223 // Random generators output arrays
224 //
225 double Rndm[16];
226 double Rndm_dG[1];
227
228 // Noise and pedestal from db
229 //
230 double pedSim = 0.;
231 double sigma_Hfn1 = 0.;
232 double sigma_Hfn2 = 0.;
233 double sigma_Norm = 0.;
234 double sigmaSim(0.0);
235
236 // Measured parameters: noise, pedestal and calibration
237 //
238 double muRcv_NoiseSigma;
239 double muRcv_Ped;
240 double muRcv_Calib;
241 double muRcv_Max;
242
243 SG::ReadCondHandle<TileEMScale> emScale(m_emScaleKey, ctx);
244 ATH_CHECK( emScale.isValid() );
245
246 const TileBadChannels* badChannels = nullptr;
247 if (m_maskBadChannels) {
248 SG::ReadCondHandle<TileBadChannels> badChannelsHandle(m_badChannelsKey, ctx);
249 ATH_CHECK( badChannelsHandle.isValid() );
250 badChannels = *badChannelsHandle;
251 }
252
253 const TilePulse* pulse = nullptr;
255 SG::ReadCondHandle<TilePulse> pulseShape(m_pulseShapeKey, ctx);
256 ATH_CHECK( pulseShape.isValid() );
257 pulse = pulseShape.retrieve();
258 }
259
260 const TileSampleNoise* sampleNoise = nullptr;
262 SG::ReadCondHandle<TileSampleNoise> sampleNoiseHandle(m_sampleNoiseKey, ctx);
263 ATH_CHECK( sampleNoiseHandle.isValid() );
264 sampleNoise = sampleNoiseHandle.retrieve();
265 }
266
267 // Get hit container from TES
268 //
269 SG::ReadHandle<TileHitContainer> hitContainer(m_hitContainerKey, ctx);
270 ATH_CHECK( hitContainer.isValid() );
271
272 // Set up buffers for handling information in a single collection.
273 //
274 IdentifierHash idhash;
275 IdContext drawer_context = m_tileHWID->drawer_context();
276
277 // Get a container for the digits
278 //
279 auto muRcvDigitsContainer = std::make_unique<TileMutableDigitsContainer>(true,
282 ATH_CHECK( muRcvDigitsContainer->status() );
283
284 // Get a container for the raw channels
285 //
286 auto muRcvRawChannelContainer = std::make_unique<TileMutableRawChannelContainer>(true,
290 ATH_CHECK( muRcvRawChannelContainer->status() );
291
292 // Prepare container for MC Overlay procedure
293 //
294 TileDigitsContainer::const_iterator collItrRndm;
295 TileDigitsContainer::const_iterator lastCollRndm;
296 std::unique_ptr<TileMutableDigitsContainer> backgroundDigitContainer{};
297
298 if (m_rndmEvtOverlay) {
299
300 ATH_MSG_DEBUG("Prepare background container for MC Overlay procedure");
301
302 backgroundDigitContainer = std::make_unique<TileMutableDigitsContainer>(true,
305 ATH_CHECK( backgroundDigitContainer->status() );
306
309 TimedDigitContList digitContList;
310 ATH_CHECK( m_mergeSvc->retrieveSubEvtsData(m_inputDigitContainerName, digitContList));
311 ATH_MSG_DEBUG( "TileDigitsCnt successfully retrieved ");
312
313 if (digitContList.size() == 0) {
314 ATH_MSG_WARNING( "No overlay done ... ");
315 return StatusCode::SUCCESS;
316 }
317
318 TimedDigitContList::iterator iTzeroDigitCont(digitContList.begin());
319 for (const auto* digitCollection : *(iTzeroDigitCont->second)) {
320 for (const auto* digit : *digitCollection) {
321 auto pDigits = std::make_unique<TileDigits>(*digit);
322 ATH_CHECK(backgroundDigitContainer->push_back(std::move(pDigits)));
323 }
324 }
325 } else {
326 SG::ReadHandle<TileDigitsContainer> tileDigitsContainerHandle(m_inputDigitContainerKey, ctx);
327 if (tileDigitsContainerHandle.isValid()) {
328 for (const auto* digitCollection : *tileDigitsContainerHandle) {
329 for (const auto* digit : *digitCollection) {
330 auto pDigits = std::make_unique<TileDigits>(*digit);
331 ATH_CHECK(backgroundDigitContainer->push_back(std::move(pDigits)));
332 }
333 }
334 } else {
335 ATH_MSG_ERROR("ReadHandle to Background Digits is invalid.");
336 return StatusCode::FAILURE;
337 }
338 }
339
340 collItrRndm = backgroundDigitContainer->begin();
341 lastCollRndm = backgroundDigitContainer->end();
342 }
343
344 // Vector of digits to set into the container
345 //
346 std::vector<float> digitsBuffer(m_nSamples);
347
348 // Vector(s) for MC Overlay procedure
349 //
350 std::vector<float> digitsBuffer_rndm(m_nSamples);
351 std::vector<bool> good_bkg( 9 , false );
352
353 // Prepare RNG service
354 //
355 ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this, m_randomStreamName);
356 rngWrapper->setSeed( m_randomStreamName, ctx );
357 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->getEngine(ctx);
358
360 // (a.0) iterate over collections in the HIT container: access 'ros' and 'drawer'
361 //
362 SG::ReadCondHandle<TileSamplingFraction> samplingFraction(m_samplingFractionKey, ctx);
363 ATH_CHECK( samplingFraction.isValid() );
364
365 for (const TileHitCollection* hitCollection : *hitContainer) {
366
367 // Get array of HWID's for this drawer (stored locally).
368 //
369 HWIdentifier drawer_id = m_tileHWID->drawer_id(hitCollection->identify());
370 int ros = m_tileHWID->ros(drawer_id);
371 int drawer = m_tileHWID->drawer(drawer_id);
372 int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
373 bool eb_ros = ((ros == TileHWID::EXTBAR_POS) || (ros == TileHWID::EXTBAR_NEG));
374 int upperLim = (eb_ros) ? nEBchan : nLBchan;
375
376 ATH_MSG_VERBOSE("(A.00) Looping over all collections for TMDB in the HIT container");
377 memset(pDigitSamplesArray, 0, sizeof(pDigitSamplesArray));
378
379 ATH_MSG_VERBOSE("(A.01) Going through collection ROS/DRAWER : "<< ros <<"/"<< drawer);
380 ATH_MSG_DEBUG(" Going through collection ROS/DRAWER : "<< ros <<"/"<< drawer);
381
382 if (m_cablingService->connected(ros, drawer)) {
383 ATH_MSG_VERBOSE("(A.02) ROS: "<< ros << " drawer: " << drawer << " is connected");
384 } else {
385 ATH_MSG_VERBOSE("(A.02) ROS: "<< ros << " drawer: " << drawer << " is NOT connected");
386 continue;
387 }
388
389 // Get drawer idhash for later access to the database to get ped and noise
390 //
391 m_tileHWID->get_hash(drawer_id, idhash, &drawer_context);
392
393 // **************************************************************
394 //
395 // Prepare buffer for MC Overlay procedure: pileup digits
396 //
397
398 memset(pDigitSamplesRndmArray, 0, sizeof(pDigitSamplesRndmArray));
399
400 if (m_rndmEvtOverlay && collItrRndm != lastCollRndm) {
401
402 const TileDigitsCollection *bkgDigitCollection(*collItrRndm);
403
404 if (hitCollection->identify() != bkgDigitCollection->identify()) {
405 ATH_MSG_ERROR ( "Frag IDs for hit collection and digits overlay collection do not match "
406 << MSG::hex << hitCollection->identify() << " != " << bkgDigitCollection->identify()
407 << MSG::dec );
408 return StatusCode::FAILURE;
409 }
410
411 ATH_MSG_DEBUG("Prepare buffer (digitsBuffer_rndm) for MC Overlay procdure: pileup digits");
412
413 for (const auto* bkgDigit : *bkgDigitCollection) {
414 bool good_channel = true;
415 /* Get digit HWIdentifier (= adc_id) */
416 HWIdentifier adc_id_rndm = (*bkgDigit).adc_HWID();
417 int channel = m_tileHWID->channel(adc_id_rndm);
418 ATH_MSG_VERBOSE ( "check channels from adc id in rndm container (TMDB channel): "<< channel );
419 /* Get digits */
420 digitsBuffer_rndm = (*bkgDigit).samples();
421 /* Get number of sample and compare with nSamples */
422 int nsamp_rndm = digitsBuffer_rndm.size();
423 if (nsamp_rndm != m_nSamples) {
424 digitsBuffer_rndm.resize(m_nSamples);
425 if (nsamp_rndm>0) {
426 for (int js=nsamp_rndm; js<m_nSamples; ++js) {
427 digitsBuffer_rndm[js] = digitsBuffer_rndm[js-1];
428 }
429 }
430 }
431 /* Fill the background digits array for the current channel and set a flag if any digit is NULL */
432 for (int j=0; j< m_nSamples;j++) {
433 pDigitSamplesRndmArray[channel][j] = digitsBuffer_rndm[j];
434 // If any digit is 0 something should be wrong so flag it in order to use during overlay the standard
435 // path to fill the expected background level for that channel
436 if (pDigitSamplesRndmArray[channel][j]==0) good_channel = false;
437 }
438 good_bkg[channel] = good_channel;
439
440 if (msgLvl(MSG::VERBOSE)){
441 msg(MSG::VERBOSE) << " Digits from pileup background " << channel << " " << ros << " " << drawer << " " << m_tileHWID->to_string(adc_id_rndm)<<" | ";
442 for (int j=0; j< (int) digitsBuffer_rndm.size(); j++) msg(MSG::VERBOSE) << digitsBuffer_rndm[j] <<" | ";
443 msg(MSG::VERBOSE) << "---> | ";
444 for (int j=0; j< (int) digitsBuffer_rndm.size(); j++) msg(MSG::VERBOSE) << pDigitSamplesRndmArray[channel][j] << " | ";
445 msg(MSG::VERBOSE) << endmsg;
446 }
447 }
448 ++collItrRndm; // skip to next digi collection
449 }
450
452 // (a.1) Iterate over all hits in a collection : access 'channel'
453 //
454
455 if ( hitCollection->empty() ) ATH_MSG_DEBUG("-- No hits in this drawer! Filling channels with either noise and pedestal or MC pileup overlay. --");
456
457 for (const TileHit* tile_hit : *hitCollection) {
458
459 // Get the pmt ID
460 //
461 Identifier pmt_id = tile_hit->pmt_ID();
462
463 // keep only D-cells and in addition cell BC8
464 //
465 int tower = m_tileID->tower(pmt_id);
466 int sample = m_tileID->sample(pmt_id);
467 if ( ! ((sample == TileID::SAMP_D) || (sample == TileID::SAMP_BC && tower == 7)) ) continue;
468
469 ATH_MSG_VERBOSE("(B.00) ++ Iterate over all the D layer channels with hits");
470
471 // In COOL database data will be organized acoording to TMDB channel (TMDBchan): 0..n with n=5 in EB and n=8 in LB
472 int TMDBchan;
473 // In here we need to access the real TILE HW channel (TILEchan) that it has a correspondance with TMDB chan given by EBchan and LBNchan
474 int TILEchan;
475
476 if (eb_ros) {
477 // cells D5, D6 and then D4 at the end
478 if (m_tileID->side(pmt_id) > 0)
479 TMDBchan = 1 - m_tileID->pmt(pmt_id) + ((tower>9) ? (tower - 10) : 4);
480 else
481 TMDBchan = m_tileID->pmt(pmt_id) + ((tower>9) ? (tower - 10) : 4);
482
483 TILEchan=EBchan[TMDBchan];
484 } else {
485 // Barrel (extension for HL-LHC)
486 if (tower == 0) {
487 TMDBchan = 0; // cell D0, channel 0 always
488 } else {
489 // cells D1. D2, D3 and BC8
490 if (m_tileID->side(pmt_id) > 0)
491 TMDBchan = 1 - m_tileID->pmt(pmt_id) + ((tower<7) ? (tower-1) : 7);
492 else
493 TMDBchan = m_tileID->pmt(pmt_id) + ((tower<7) ? (tower-1) : 7);
494 }
495
496 TILEchan=LBchan[TMDBchan];
497 }
498
499 double* pDigitSamples = pDigitSamplesArray[TMDBchan];
500
501 if (msgLvl(MSG::VERBOSE)){
502 HWIdentifier adc_id = m_tileHWID->adc_id(drawer_id, TMDBchan, TileID::LOWGAIN);
503
504 ATH_MSG_VERBOSE( "(B.01) Correct pmt being transported in XXchan[]: "<<TMDBchan<<" "<<TILEchan<< "=?"
505 << m_tileHWID->channel(m_cablingService->s2h_channel_id(pmt_id))
506 << " For reference get TMDB adc_id: " << m_tileHWID->to_string(adc_id) );
507 ATH_MSG_VERBOSE( "(B.02) New hit in ROS/DRAWER/PMT "<<ros<<"/"<<drawer<<"/"<<TMDBchan<<" ("<<TILEchan<<")"
508 << " pmt_id "<< m_tileID->to_string(pmt_id,-1)
509 << " adc_id "<< m_tileHWID->to_string(adc_id) );
510 }
511
512 // Scintillator Energy -> Cell Energy (uses sampling fraction)
513 //
514 int channel = m_tileHWID->channel(m_cablingService->s2h_channel_id(pmt_id));
515 double hit_calib = samplingFraction->getSamplingFraction(drawerIdx, channel);
516 hit_calib = std::round(hit_calib * 1000) / 1000;
517
518 ATH_MSG_VERBOSE("------ Sampling fraction: " << hit_calib);
519
521 // (a.2) Loop over the hits of this channel
522 // Calibrations are applied per subhit and energy added per subhit of a channel
523 //
524
525 int n_hits = tile_hit->size();
526
527 ATH_MSG_VERBOSE("------ Number of hits in channel: " << n_hits);
528
529 for (int ihit = 0; ihit < n_hits; ++ihit) {
530
531 ATH_MSG_VERBOSE("(C.00) ++ Iterating over the hits of channel " << TILEchan <<": hit " << ihit <<"/"<< n_hits);
532
533 double e_hit = tile_hit->energy(ihit); // [MeV] energy deposited in scintillator
534 double e_pmt = e_hit * hit_calib; // [MeV] true cell energy
535
536 ATH_MSG_VERBOSE("(C.01) Energy in scintillator [MeV]: " << e_hit << " true cell energy [MeV]: " << e_pmt);
537
538 double t_hit = tile_hit->time(ihit);
539
540 ATH_MSG_VERBOSE("(C.02.01) Phase " << t_hit);
541
542 // Load pulse
543 //
544 int k = 0;
545 float phase = 0.0;
546 float y = 0.0;
547 float dy = 0.0;
548 double shape = 0.0;
549
550 int ishift = (int) (t_hit / m_timeStep + 0.5);
551
552 ATH_MSG_VERBOSE( "(C.02.02) ishift :" << t_hit << "/" << m_timeStep << "+0.5 = " << ishift);
553
555 for (int js = 0; js < m_nSamples; ++js) {
556 k = m_binTime0 + (js - m_iTrig) * m_nBinsPerX - ishift;
557 if (k < 0) k = 0;
558 else if (k > m_nShape) k = m_nShape;
559
560 ATH_MSG_VERBOSE( "(C.02.03) k : " << m_binTime0 << "+(" << js << "-" << m_iTrig << ")*" << m_nBinsPerX << "-" << ishift << " = " << k);
561
563
564 ATH_MSG_VERBOSE( "(C.02.04) phase : " << k << "-" << m_binTime0 << "*" << m_timeStep << " = " << phase);
565
566 pulse->getPulseShapeYDY(drawerIdx, TMDBchan, TileID::LOWGAIN, phase, y, dy);
567 shape = (double) y;
568 pDigitSamples[js] += e_pmt * shape; // MeV
569
570 ATH_MSG_VERBOSE( "(C.03.0) Sample no.= " << js
571 << " idx= " << k
572 << " Shape wt. = " << shape
573 << " Amp = " << pDigitSamples[js] << " [MeV]");
574 } //END loop over samples
575 } else {
576 for (int js = 0; js < m_nSamples; ++js) {
577 k = m_binTime0 + (js - m_iTrig) * m_nBinsPerX - ishift;
578 if (k < 0) k = 0;
579 else if (k > m_nShape) k = m_nShape;
580
581 ATH_MSG_VERBOSE( "(C.02.03) k : " << m_binTime0 << "+(" << js << "-" << m_iTrig << ")*" << m_nBinsPerX << "-" << ishift << " = " << k);
582
583 pDigitSamples[js] += e_pmt * m_shapeMuonReceiver[k]; // MeV
584
585 ATH_MSG_VERBOSE( "(C.03.0) Sample no.= " << js
586 << " idx= " << k
587 << " Shape wt. = " << m_shapeMuonReceiver[k]
588 << " Amp = " << pDigitSamples[js]
589 << "[MeV] Energy: " << e_pmt << " LOGAIN from TileInfo");
590 } //END loop over samples
591 } // END if (m_useCoolPulseShapes)
592 } // END loop over sub-HITS
593
594 ATH_MSG_VERBOSE("++ ENDED Loop over hits for a channel");
595 ATH_MSG_DEBUG("(C.04) Went over " << n_hits << " hits for channel"
596 << m_tileHWID->to_string(drawer_id,-2) << "/" << TMDBchan << " (" << TILEchan << ")"
597 << " digits [MeV] "<< pDigitSamples[0]
598 << "/" << pDigitSamples[1]
599 << "/" << pDigitSamples[2]
600 << "/" << pDigitSamples[3]
601 << "/" << pDigitSamples[4]
602 << "/" << pDigitSamples[5]
603 << "/" << pDigitSamples[6]);
604 ATH_MSG_VERBOSE("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
605 } // END loop over a HIT collection
606
607 ATH_MSG_VERBOSE("++ END loop over a HIT collection");
608
610 // (a.3) The pulse has a shape and a amplitude in MeV now it is converted into ADC
611 // counts and either add NOISE and PEDESTAL or the OVERLAY digits
612 //
613 // PEDESTAL [ADC counts] and NOISE [ADC counts] as stored in Tile
614 // Conditions (FIXED values but also flag for collection from COOL)
615 //
616 // Keep containers for each module (each partition) the same size
617 // between events i.e. ALL channels are filled even with ZERO energy
618 //
619
620 ATH_MSG_VERBOSE("++ START filling of channels with background either noise+pedestal or overlay");
621
622 for (int TMDBchan = 0; TMDBchan < upperLim; ++TMDBchan) {
623
624 double* pDigitSamples=pDigitSamplesArray[TMDBchan];
625 int TILEchan = (eb_ros) ? EBchan[TMDBchan] : LBchan[TMDBchan];
626
627 HWIdentifier adc_id = m_tileHWID->adc_id(drawer_id, TMDBchan, TileID::LOWGAIN);
628
629 ATH_MSG_DEBUG( "(D.) Going now to channel " << " TMDBchan: " << TMDBchan << " TILEchan: " << TILEchan);
630 ATH_MSG_DEBUG( "(D.00) Add noise and pedestal in "
631 << " TMDBchan: " << TMDBchan << " TILEchan: " << TILEchan
632 << " ROS: " << ros
633 << " drawer: " << drawer
634 << " drawer idx: " << drawerIdx
635 << " drawer_id: " << m_tileHWID->to_string(drawer_id,-2)
636 << " channel: " << m_tileHWID->to_string(adc_id,-1));
637 // adc/pCb / MeV/pCb = adc/MeV
638 //
639 muRcv_Max = m_tileInfo->MuRcvMax(adc_id); // [adc]
640 muRcv_Calib = m_tileInfo->MuRcvCalib(adc_id); // pCb->[adc]
641 double mev2ADC_factor = muRcv_Calib / emScale->calibrateChannel(drawerIdx,TILEchan,TileID::LOWGAIN, 1.
644 ATH_MSG_VERBOSE( "(D.01) Channel: "<<ros<<'/'<<drawer<<'/'<< TMDBchan
645 << " adc/pCb: "<< muRcv_Calib
646 << " Mev/pCb: "<< emScale->calibrateChannel( drawerIdx,
647 TILEchan,
649 1.,
652 << " final calibration factor adc/MeV: "<< mev2ADC_factor);
653
654 ATH_MSG_VERBOSE( "(D.02) Pulse digits [MeV]:"
655 << " " << pDigitSamples[0]
656 << " " << pDigitSamples[1]
657 << " " << pDigitSamples[2]
658 << " " << pDigitSamples[3]
659 << " " << pDigitSamples[4]
660 << " " << pDigitSamples[5]
661 << " " << pDigitSamples[6]
662 << " [All ZERO if there is no hit in channel.] ");
663
664 if ( good_bkg[TMDBchan] ) {
665 // Collecting digits for MC Overlay procedure from overlay container
666 // IF good digits ere collected (no ZEROS <> good_bkg[TMDBchan]==true) then add the background to the simulated digits
667 // ELSE bad digits (any ZEROS <> good_bkg[TMDBchan]==false) then follow the standard path adding muRcv_Ped and muRvc_NoiseSigma
668
669 ATH_MSG_DEBUG("++ Adding to signal digits -- The MC PILE-UP OVERLAY digits " << m_rndmEvtOverlay << " " << m_integerDigits);
670
671 for (int js = 0; js < m_nSamples; ++js) {
672 // Signal
673 //
674 ATH_MSG_VERBOSE( "(D.02.0"<< js+1 <<") sample "<< js+1 <<" E_{Signal} [adc]: "<< pDigitSamples[js] * mev2ADC_factor <<" -- Overlay");
675 digitsBuffer[js] = pDigitSamples[js] * mev2ADC_factor;
676 // Pileup
677 //
678 ATH_MSG_VERBOSE( "(D.02.0"<< js+1 <<") sample "<< js+1 <<" E_{PileUp} [adc]: "<< pDigitSamplesRndmArray[TMDBchan][js] <<" -- Overlay");
679 digitsBuffer[js] += pDigitSamplesRndmArray[TMDBchan][js];
680 // Simulated pulse above allowed maximum
681 //
682 if (digitsBuffer[js] > muRcv_Max) digitsBuffer[js] = muRcv_Max;
683 // Rounding the ADC counts
684 //
685 if (m_integerDigits) digitsBuffer[js] = round(digitsBuffer[js]);
686 ATH_MSG_VERBOSE( "(D.02.0"<< js+1 <<") sample "<< js+1 <<" calibration [adc/MeV] "<< mev2ADC_factor <<"-> E_{Signal+PileUp} [adc]: "<< digitsBuffer[js] <<" -- Overlay");
687 }
688 } else {
689 if (m_rndmEvtOverlay) ATH_MSG_INFO("At least one digit is zero in background file using the stadart path to fill pedestal and noise in digits");
690 // Different for each channel_id might be the case in the future (now a const. in TileInfoLoader.cxx)
691 //
692 muRcv_NoiseSigma = m_tileInfo->MuRcvNoiseSigma(adc_id); // [adc]
693 muRcv_Ped = m_tileInfo->MuRcvPed(adc_id); // [adc]
694
695 ATH_MSG_VERBOSE( "(D.03) Tile Muon Receiver parameters:"
696 << " noi " << muRcv_NoiseSigma
697 << " ped " << muRcv_Ped
698 << " cal " << muRcv_Calib
699 << " max " << muRcv_Max);
700
701 // Collecting digits for standard procedure NO OVERLAY: pedestal+noise
702 // ADD digitsBuffer[m_nSamples] WITH Ped and Noise from COOLDB/ATHENA
703 //
704 ATH_MSG_DEBUG("++ Adding to signal digits -- The PEDESTAL + NOISE digits "<< m_tilePedestal <<" "<< m_tileNoise << " " << m_integerDigits);
705 // Collecting pedestal from the database
706 //
707 if (m_tilePedestal) {
708 pedSim = sampleNoise->getPed(idhash, TMDBchan, TileID::LOWGAIN);
709 // As in TileDigitsMaker bug fix for wrong ped value in DB
710 //
711 if (pedSim == 0.0) pedSim = 30.;
712 } else {
713 pedSim = muRcv_Ped;
714 }
715 // Collecting noise from the database
716 //
717 if (m_tileNoise) {
718 // Generate an array to randomize the noise for each digit
719 //
720 RandGaussQ::shootArray(rndmEngine, m_nSamples, Rndm, 0.0, 1.0);
721 RandFlat::shootArray(rndmEngine, 1, Rndm_dG, 0.0, 1.0);
722 sigma_Hfn1 = sampleNoise->getHfn1(idhash, TMDBchan, TileID::LOWGAIN);
723 sigma_Hfn2 = sampleNoise->getHfn2(idhash, TMDBchan, TileID::LOWGAIN);
724 if (sigma_Hfn1 > 0 || sigma_Hfn2) {
725 sigma_Norm = sigma_Hfn1 / (sigma_Hfn1 + sigma_Hfn2 * sampleNoise->getHfnNorm(idhash, TMDBchan, TileID::LOWGAIN));
726 } else {
727 sigma_Hfn1 = sampleNoise->getHfn(idhash, TMDBchan, TileID::LOWGAIN);
728 sigma_Norm = 1.;
729 }
730 if (Rndm_dG[0] < sigma_Norm) sigmaSim = sigma_Hfn1;
731 else sigmaSim = sigma_Hfn2;
732 } else {
733 sigmaSim = muRcv_NoiseSigma;
734 }
735 // Loop over samples and either use noise and ped from db or user location (TileInfoLoader.cxx)
736 //
737 for (int js = 0; js < m_nSamples; ++js) {
738 // Signal
739 //
740 ATH_MSG_VERBOSE( "(D.02.0"<< js+1 <<") sample "<< js+1 <<" E [MeV]: "<< pDigitSamples[js]);
741 digitsBuffer[js] = pDigitSamples[js] * mev2ADC_factor;
742 ATH_MSG_VERBOSE( "(D.02.0"<< js+1 <<") sample "<< js+1 <<" calibration [adc/MeV] "<< mev2ADC_factor <<"-> E [adc]: "<< digitsBuffer[js]);
743 // Pedestal (amp)
744 //
745 digitsBuffer[js] += pedSim;
746 ATH_MSG_VERBOSE( "(D.02.0"<< js+1 <<") sample "<< js+1 <<" adding pedestal "<< pedSim <<"-> E [adc]: "<< digitsBuffer[js]);
747 // Noise (rms)
748 //
749 if (m_tileNoise) {
750 digitsBuffer[js] += sigmaSim * Rndm[js];
751 ATH_MSG_VERBOSE( "(D.02.0"<< js+1 <<") sample "<< js+1 <<" adding noise "<< sigmaSim * Rndm[js] <<"-> E [adc]: "<< digitsBuffer[js]);
752 }
753 // Simulated pulse above allowed maximum
754 //
755 if (digitsBuffer[js] > muRcv_Max) digitsBuffer[js] = muRcv_Max;
756 // Rounding the ADC counts
757 //
758 if (m_integerDigits) digitsBuffer[js] = round(digitsBuffer[js]);
759 }
760 }
761
762 // If channel is good, create TileDigits object and store in container.
763 //
764 bool chanIsBad = false;
765
766 if (m_maskBadChannels) {
767 TileBchStatus status = badChannels->getAdcStatus( m_tileHWID->adc_id(drawer_id, TILEchan, TileID::LOWGAIN) );
768 chanIsBad = status.isBad();
769 }
770
771 if (chanIsBad) {
772 for (int js = 0; js < m_nSamples; ++js) {
773 digitsBuffer[js] = 255;// in TMDB we have 8-bit ADCs
774 }
775 ATH_MSG_VERBOSE( "(D.03) Masking Channel: "<< ros << '/' << drawer << '/' << TILEchan <<" ("<< TMDBchan <<") LowGain" );
776 } else {
777 ATH_MSG_VERBOSE( "(D.03) Good Channel : "<< ros << '/' << drawer << '/' << TILEchan <<" ("<< TMDBchan <<") LowGain" );
778 }
779
780 ATH_MSG_VERBOSE( "++ Changed to TMDB adc_id: " << m_tileHWID->to_string(adc_id) << " and save a TileDigits object into a container." );
781 std::unique_ptr<TileDigits> muonReceiverDigits = std::make_unique<TileDigits>(adc_id, digitsBuffer);
782 ATH_MSG_VERBOSE( "++ Create a TileRawChannelObject object and set it into a container " );
783 TileRawChannel* muRcvRawChannel = m_MuRcvBuildTool->rawChannel(muonReceiverDigits.get(), ctx);
784 ATH_CHECK( muRcvDigitsContainer->push_back(std::move(muonReceiverDigits)) );
785 ATH_CHECK( muRcvRawChannelContainer->push_back(muRcvRawChannel) );
786 if (msgLvl(MSG::DEBUG)){
787 ATH_MSG_DEBUG( "++ Channel " << m_tileHWID->to_string(adc_id,-1)
788 << " Digitized pulse [ADC] "<< digitsBuffer[0]
789 << "/" << digitsBuffer[1]
790 << "/" << digitsBuffer[2]
791 << "/" << digitsBuffer[3]
792 << "/" << digitsBuffer[4]
793 << "/" << digitsBuffer[5]
794 << "/" << digitsBuffer[6] );
795 ATH_MSG_DEBUG( "++ Raw channel reconstruction Ch: "<< m_tileHWID->to_string(adc_id,-1)
796 <<" E [ADC]: "<< muRcvRawChannel->amplitude()
797 <<" Time [ns]: "<< muRcvRawChannel->time()
798 <<" Qf: "<< muRcvRawChannel->quality() );
799 }
800 }
801 } // END loop over all HIT collections in container
802 if (msgLvl(MSG::VERBOSE)) muRcvDigitsContainer->print();
803
805 // (a.4) Register the digits container in the TES
806 //
807
808 ATH_MSG_VERBOSE ( "(A.05) Send to event store all collected objects " );
809
810 SG::WriteHandle<TileDigitsContainer> muRcvDigitsCnt(m_muRcvDigitsContainerKey, ctx);
811 ATH_CHECK( muRcvDigitsCnt.record(std::move(muRcvDigitsContainer)) );
812
813 SG::WriteHandle<TileRawChannelContainer> muRcvRawChannelCnt(m_muRcvRawChannelContainerKey, ctx);
814 ATH_CHECK( muRcvRawChannelCnt.record(std::move(muRcvRawChannelContainer)) );
815
816 ATH_MSG_VERBOSE( "TilePulseForTileMuonReceiver execution completed" );
817
818 return StatusCode::SUCCESS;
819}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define nLBchan
#define nEBchan
#define y
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
MsgStream & msg() const
const TileBchStatus & getAdcStatus(const HWIdentifier adc_id) const
Return Tile ADC status.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
@ EXTBAR_NEG
Definition TileHWID.h:71
@ EXTBAR_POS
Definition TileHWID.h:70
SG::WriteHandleKey< TileDigitsContainer > m_muRcvDigitsContainerKey
SG::ReadHandleKey< TileHitContainer > m_hitContainerKey
ServiceHandle< PileUpMergeSvc > m_mergeSvc
SG::ReadCondHandleKey< TilePulse > m_pulseShapeKey
Name of TilePulseShape in condition store.
ServiceHandle< IAthRNGSvc > m_rndmSvc
Random number service to use.
SG::WriteHandleKey< TileRawChannelContainer > m_muRcvRawChannelContainerKey
ToolHandle< TileRawChannelBuilderMF > m_MuRcvBuildTool
SG::ReadCondHandleKey< TileBadChannels > m_badChannelsKey
Name of TileBadChannels in condition store.
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
Name of TileEMScale in condition store.
Gaudi::Property< std::string > m_randomStreamName
Random Stream Name.
SG::ReadHandleKey< TileDigitsContainer > m_inputDigitContainerKey
SG::ReadCondHandleKey< TileSamplingFraction > m_samplingFractionKey
Name of TileSamplingFraction in condition store.
SG::ReadCondHandleKey< TileSampleNoise > m_sampleNoiseKey
Name of TileSampleNoise in condition store.
std::vector< double > m_shapeMuonReceiver
Muon receiver pulse shape.
bool getPulseShapeYDY(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float time, float &y, float &dy) const
Definition TilePulse.h:35
float time(int ind=0) const
float quality(int ind=0) const
float amplitude(int ind=0) const
float getPed(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
float getHfn2(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
float getHfn1(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
float getHfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
float getHfnNorm(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
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
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
status
Definition merge.py:16
std::list< value_t > type
type of the collection of timed data object

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< 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 & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ finalize()

StatusCode TilePulseForTileMuonReceiver::finalize ( )
overridevirtual

finalize method

Definition at line 823 of file TilePulseForTileMuonReceiver.cxx.

823 {
824 ATH_MSG_VERBOSE("Finalizing TilePulseForTileMuonReceiver");
825
826 ATH_MSG_INFO("TilePulseForTileMuonReceiver finalized successfully");
827 return StatusCode::SUCCESS;
828}

◆ initialize()

StatusCode TilePulseForTileMuonReceiver::initialize ( )
overridevirtual

initialize method

Definition at line 95 of file TilePulseForTileMuonReceiver.cxx.

95 {
96
97 // Check cabling RUN>=RUN2 OK
98 //
99 ATH_CHECK( m_cablingSvc.retrieve() );
100 m_cablingService = m_cablingSvc->cablingService();
101 m_runPeriod = m_cablingService->runPeriod();
102
103 // Handles must always be initialised
104 ATH_CHECK( m_hitContainerKey.initialize(m_runPeriod != 0) );
108 ATH_CHECK( m_samplingFractionKey.initialize(m_runPeriod != 0) );
109 ATH_CHECK( m_emScaleKey.initialize(m_runPeriod != 0) );
111
112 if ( m_runPeriod == 0) {
113 ATH_MSG_INFO("TilePulseForTileMuonReceiver should not be used for RUN1 simulations");
114 return StatusCode::SUCCESS;
115 } else {
116 ATH_MSG_INFO("Initializing TilePulseForTileMuonReceiver");
117 }
118
119 //=== retrieve TileID helper and TileInfo from det store
120 ATH_CHECK(detStore()->retrieve(m_tileID));
121 ATH_CHECK(detStore()->retrieve(m_tileHWID));
123
124 ATH_CHECK(m_MuRcvBuildTool.retrieve());
125
126 m_nSamples = m_tileInfo->NdigitSamples(); // number of time slices for each chan
127 m_iTrig = m_tileInfo->ItrigSample(); // index of the triggering time slice
128 m_adcMax = m_tileInfo->ADCmax(); // adc saturation value
129 m_tileThresh = m_tileInfo->ThresholdDigits(TileID::LOWGAIN);
130
131 ATH_MSG_VERBOSE("Cabling Services: " << m_cablingService
132 << " Number of Samples: " << m_nSamples
133 << " Triggering tile slice: " << m_iTrig
134 << " ADC saturation value: " << m_adcMax
135 << " TileCal Threshold LOW GAIN: " << m_tileThresh);
136
137 ATH_CHECK(m_rndmSvc.retrieve());
138
139 m_nShape = m_tileInfo->MuRcvNBins();
140 m_nBinsPerX = m_tileInfo->MuRcvBinsPerX();
141 m_binTime0 = m_tileInfo->MuRcvTime0Bin();
142 m_timeStep = 25.0 / m_nBinsPerX;
143
144 ATH_MSG_VERBOSE( "Pulse info : "
145 << "shape " << m_nShape
146 <<" nbins " << m_nBinsPerX
147 <<" time " << m_binTime0
148 <<" time step " << m_timeStep
149 <<" Triggering tile sample " << m_iTrig);
150
151 // decrease by 1, now it is the position of lastest element in a vector
152 //
153 --m_nShape;
154
157 ATH_MSG_INFO( "Using pulse from database.");
158 } else {
159 ATH_MSG_INFO( "Using pulse from TileInfo.");
160
161 m_shapeMuonReceiver = m_tileInfo->MuRcvFullShape();
162 m_shapeMuonReceiver.push_back(0.0);
163 }
164
166
167 ATH_MSG_INFO( "Integer digits: \t" << ((m_integerDigits)?"true":"false"));
168 ATH_MSG_INFO( "Tile Pedestal: \t" << ((m_tilePedestal)?"true":"false"));
169 ATH_MSG_INFO( "Tile Noise: \t" << ((m_tileNoise)?"true":"false"));
170 ATH_MSG_INFO( "Event Overlay: \t" << ((m_rndmEvtOverlay)?"true":"false"));
171 ATH_MSG_INFO( "Masking Channels: \t" << ((m_maskBadChannels)?"true":"false"));
172 ATH_MSG_INFO( "Pulse shapes from COOL: \t" << ((m_useCoolPulseShapes)?"true":"false"));
173
175
176 if (m_rndmEvtOverlay) {
177 ATH_MSG_INFO( "Pileup and/or noise added by overlaying digits of random events");
178 // locate the PileUpMergeSvc and initialize our local ptr
180 ATH_CHECK( m_mergeSvc.retrieve() );
181 ATH_MSG_INFO( "PileUpMergeSvc successfully initialized");
182 }
183 }
184
185 ATH_MSG_VERBOSE("TilePulseForTileMuonReceiver initialization completed");
186 return StatusCode::SUCCESS;
187}
const ServiceHandle< StoreGateSvc > & detStore() const
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
Gaudi::Property< std::string > m_infoName

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< 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 TilePulseForTileMuonReceiver::isClonable ( ) const
inlinefinaloverridevirtual

Definition at line 91 of file TilePulseForTileMuonReceiver.h.

91{ return true; }

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< 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< 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< 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< Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

StatusCode AthAlgorithm::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< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
static Double_t sc
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< 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< 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 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_adcMax

int TilePulseForTileMuonReceiver::m_adcMax
private

ADC saturation value.

Definition at line 166 of file TilePulseForTileMuonReceiver.h.

◆ m_badChannelsKey

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

Name of TileBadChannels in condition store.

Definition at line 144 of file TilePulseForTileMuonReceiver.h.

144 {this,
145 "TileBadChannels", "TileBadChannels", "Input Tile bad channel status"};

◆ m_binTime0

int TilePulseForTileMuonReceiver::m_binTime0
private

Index of time=0 bin for pulse shape.

Definition at line 173 of file TilePulseForTileMuonReceiver.h.

◆ m_cablingService

const TileCablingService* TilePulseForTileMuonReceiver::m_cablingService
private

TileCabling instance.

Definition at line 162 of file TilePulseForTileMuonReceiver.h.

◆ m_cablingSvc

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

Name of Tile cabling service.

Definition at line 116 of file TilePulseForTileMuonReceiver.h.

116 { this,
117 "TileCablingSvc", "TileCablingSvc", "The Tile cabling service"};

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_emScaleKey

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

Name of TileEMScale in condition store.

Definition at line 132 of file TilePulseForTileMuonReceiver.h.

132 {this,
133 "TileEMScale", "TileEMScale", "Input Tile EMS calibration constants"};

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_hitContainerKey

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

Definition at line 98 of file TilePulseForTileMuonReceiver.h.

98 {this,
99 "TileHitContainer","TileHitCnt", "Input Tile hit container key"};

◆ m_infoName

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

Definition at line 150 of file TilePulseForTileMuonReceiver.h.

150{this, "TileInfoName", "TileInfo", "TileInfo object name"};

◆ m_inputDigitContainerKey

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

Definition at line 95 of file TilePulseForTileMuonReceiver.h.

95{this, "InputTileDigitContainer","",""};

◆ m_inputDigitContainerName

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

Definition at line 96 of file TilePulseForTileMuonReceiver.h.

96{""};

◆ m_integerDigits

Gaudi::Property<bool> TilePulseForTileMuonReceiver::m_integerDigits {this, "IntegerDigits", false, "Round digits (default=false)"}
private

Definition at line 151 of file TilePulseForTileMuonReceiver.h.

151{this, "IntegerDigits", false, "Round digits (default=false)"};

◆ m_iTrig

int TilePulseForTileMuonReceiver::m_iTrig
private

Index of the triggering time slice.

Definition at line 165 of file TilePulseForTileMuonReceiver.h.

◆ m_maskBadChannels

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

Definition at line 152 of file TilePulseForTileMuonReceiver.h.

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

◆ m_mergeSvc

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

Definition at line 176 of file TilePulseForTileMuonReceiver.h.

176{this, "PileUpMergeSvc", "PileUpMergeSvc"};

◆ m_MuRcvBuildTool

ToolHandle<TileRawChannelBuilderMF> TilePulseForTileMuonReceiver::m_MuRcvBuildTool
private
Initial value:
{this,
"TileRawChannelBuilderMF", "TileRawChannelBuilderMF", "Reconstruction tool, default: the Matched Filter"}

Definition at line 147 of file TilePulseForTileMuonReceiver.h.

147 {this,
148 "TileRawChannelBuilderMF", "TileRawChannelBuilderMF", "Reconstruction tool, default: the Matched Filter"};

◆ m_muRcvDigitsContainerKey

SG::WriteHandleKey<TileDigitsContainer> TilePulseForTileMuonReceiver::m_muRcvDigitsContainerKey
private
Initial value:
{this,
"MuonReceiverDigitsContainer", "MuRcvDigitsCnt", "Output Tile muon receiver digits container key"}

Definition at line 101 of file TilePulseForTileMuonReceiver.h.

101 {this,
102 "MuonReceiverDigitsContainer", "MuRcvDigitsCnt", "Output Tile muon receiver digits container key"};

◆ m_muRcvRawChannelContainerKey

SG::WriteHandleKey<TileRawChannelContainer> TilePulseForTileMuonReceiver::m_muRcvRawChannelContainerKey
private
Initial value:
{this,
"MuonReceiverRawChannelContainer", "MuRcvRawChCnt", "Output Tile muon receiver raw channel container key"}

Definition at line 104 of file TilePulseForTileMuonReceiver.h.

104 {this,
105 "MuonReceiverRawChannelContainer", "MuRcvRawChCnt", "Output Tile muon receiver raw channel container key"};

◆ m_nBinsPerX

int TilePulseForTileMuonReceiver::m_nBinsPerX
private

Number of bins per bunch crossing in pulse shape.

Definition at line 172 of file TilePulseForTileMuonReceiver.h.

◆ m_nSamples

int TilePulseForTileMuonReceiver::m_nSamples
private

Number of time slices for each channel.

Definition at line 164 of file TilePulseForTileMuonReceiver.h.

◆ m_nShape

int TilePulseForTileMuonReceiver::m_nShape
private

Number of bins in pulse shape.

Definition at line 171 of file TilePulseForTileMuonReceiver.h.

◆ m_onlyUseContainerName

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

Definition at line 157 of file TilePulseForTileMuonReceiver.h.

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

◆ m_pulseShapeKey

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

Name of TilePulseShape in condition store.

Definition at line 138 of file TilePulseForTileMuonReceiver.h.

138 {this,
139 "TilePulseShape", "TileMuRcvPulseShape", "Input Tile Muon Receiver pulse shape"};

◆ m_randomStreamName

Gaudi::Property<std::string> TilePulseForTileMuonReceiver::m_randomStreamName {this, "RandomStreamName", "Tile_PulseForTileMuonReceiver", ""}
private

Random Stream Name.

Definition at line 121 of file TilePulseForTileMuonReceiver.h.

121{this, "RandomStreamName", "Tile_PulseForTileMuonReceiver", ""};

◆ m_rndmEvtOverlay

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

Definition at line 156 of file TilePulseForTileMuonReceiver.h.

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

◆ m_rndmSvc

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

Random number service to use.

Definition at line 119 of file TilePulseForTileMuonReceiver.h.

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

◆ m_runPeriod

int TilePulseForTileMuonReceiver::m_runPeriod
private

Definition at line 181 of file TilePulseForTileMuonReceiver.h.

◆ m_sampleNoiseKey

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

Name of TileSampleNoise in condition store.

Definition at line 126 of file TilePulseForTileMuonReceiver.h.

126 {this,
127 "TileSampleNoise", "TileSampleNoise", "Input Tile sample noise"};

◆ m_samplingFractionKey

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

Name of TileSamplingFraction in condition store.

Definition at line 110 of file TilePulseForTileMuonReceiver.h.

110 {this,
111 "TileSamplingFraction", "TileSamplingFraction", "Input Tile sampling fraction"};

◆ m_shapeMuonReceiver

std::vector<double> TilePulseForTileMuonReceiver::m_shapeMuonReceiver
private

Muon receiver pulse shape.

Definition at line 179 of file TilePulseForTileMuonReceiver.h.

◆ m_tileHWID

const TileHWID* TilePulseForTileMuonReceiver::m_tileHWID
private

Definition at line 160 of file TilePulseForTileMuonReceiver.h.

◆ m_tileID

const TileID* TilePulseForTileMuonReceiver::m_tileID
private

Definition at line 159 of file TilePulseForTileMuonReceiver.h.

◆ m_tileInfo

const TileInfo* TilePulseForTileMuonReceiver::m_tileInfo
private

Definition at line 161 of file TilePulseForTileMuonReceiver.h.

◆ m_tileNoise

Gaudi::Property<bool> TilePulseForTileMuonReceiver::m_tileNoise {this, "UseCoolNoise", false, "Noise from database (default=false)"}
private

Definition at line 154 of file TilePulseForTileMuonReceiver.h.

154{this, "UseCoolNoise", false, "Noise from database (default=false)"};

◆ m_tilePedestal

Gaudi::Property<bool> TilePulseForTileMuonReceiver::m_tilePedestal {this, "UseCoolPedestal", false, "Pedestal from database (default=false)"}
private

Definition at line 155 of file TilePulseForTileMuonReceiver.h.

155{this, "UseCoolPedestal", false, "Pedestal from database (default=false)"};

◆ m_tileThresh

double TilePulseForTileMuonReceiver::m_tileThresh
private

Actual threshold value.

Definition at line 167 of file TilePulseForTileMuonReceiver.h.

◆ m_timeStep

double TilePulseForTileMuonReceiver::m_timeStep
private

Time step in pulse shape: 25.0 / nBinsPerX.

Definition at line 174 of file TilePulseForTileMuonReceiver.h.

◆ m_useCoolPulseShapes

Gaudi::Property<bool> TilePulseForTileMuonReceiver::m_useCoolPulseShapes {this, "UseCoolPulseShapes", false, "Pulse shapes from database (default=false)"}
private

Definition at line 153 of file TilePulseForTileMuonReceiver.h.

153{this, "UseCoolPulseShapes", false, "Pulse shapes from database (default=false)"};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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