ATLAS Offline Software
Loading...
Searching...
No Matches
ArrayBM.h
Go to the documentation of this file.
1/* -*- C++ -*- */
2
3/*
4 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef PILEUPCOMPS_ARRAYBM
8#define PILEUPCOMPS_ARRAYBM 1
16#include "GaudiKernel/ContextSpecificPtr.h"
17#include "GaudiKernel/ServiceHandle.h"
18#include "Gaudi/Property.h"
19
24
25#include <random>
26
27namespace CLHEP
28{
29 class RandGeneral;
30}
31
32class ArrayBM : public extends<AthService, IBeamIntensity>
33{
34public:
36
37 ArrayBM(const std::string& name,ISvcLocator* svc);
38 virtual ~ArrayBM();
40
42 virtual StatusCode initialize() override final;
44
46 virtual float normFactor(int iXing) const override final;
47 virtual float largestElementInPattern() const override final { return m_largestElementInPattern; }
48 virtual void selectT0(const EventContext& ctx) override final;
49 virtual unsigned int getCurrentT0BunchCrossing() const override final { return m_t0Offset; }
50 virtual unsigned int getBeamPatternLength() const override final { return m_ipLength; }
52private:
56 Gaudi::Hive::ContextSpecificData<unsigned int> m_t0Offset;
58 Gaudi::Property<std::uint64_t> m_seed{this, "Seed", 0, "Seed for FastReseededPRNG. Zero seed switches to AthRNGSvc mode."};
60 Gaudi::Property<std::vector<float>> m_intensityPatternProp;
62 unsigned int m_ipLength;
66 CLHEP::RandGeneral* m_biRandom;
68 std::unique_ptr<std::discrete_distribution<unsigned int>> m_t0Dist{nullptr};
70 ServiceHandle<IAthRNGSvc> m_randomSvc{this, "RandomSvc", "AthRNGSvc","The random number service that will be used."};
85};
86#endif
provides the relative beam intensity as a function of the bunch xing.
Define macros for attributes used to control the static checker.
A wrapper class for event-slot-local random engines.
Definition RNGWrapper.h:56
double * m_intensityPattern
normalized intensity pattern. C array to make clhep RandGeneral happy
Definition ArrayBM.h:64
virtual StatusCode initialize() override final
Definition ArrayBM.cxx:45
int m_emptyBunches
Empty bunch option.
Definition ArrayBM.h:81
Gaudi::Property< std::uint64_t > m_seed
seed for FastReseededPRNG. Non-zero switches to using FastReseededPRNG.
Definition ArrayBM.h:58
CLHEP::RandGeneral * m_biRandom
shoot random number proportionally to m_intensityPattern
Definition ArrayBM.h:66
virtual unsigned int getCurrentT0BunchCrossing() const override final
Definition ArrayBM.h:49
float m_largestElementInPattern
The largest value in the pattern assuming that the pattern has mean value 1.0.
Definition ArrayBM.h:76
unsigned int m_maxBunchCrossingPerOrbit
max bunch crossings per orbit
Definition ArrayBM.h:54
virtual float normFactor(int iXing) const override final
Definition ArrayBM.cxx:175
ArrayBM(const std::string &name, ISvcLocator *svc)
Definition ArrayBM.cxx:20
virtual unsigned int getBeamPatternLength() const override final
Definition ArrayBM.h:50
virtual ~ArrayBM()
Definition ArrayBM.cxx:39
Gaudi::Property< std::vector< float > > m_intensityPatternProp
user-defined intensity pattern
Definition ArrayBM.h:60
virtual float largestElementInPattern() const override final
Definition ArrayBM.h:47
ATHRNG::RNGWrapper *m_rngWrapper ATLAS_THREAD_SAFE
Definition ArrayBM.h:71
Gaudi::Hive::ContextSpecificData< unsigned int > m_t0Offset
offset of the t0 wrto our intensity pattern
Definition ArrayBM.h:56
virtual void selectT0(const EventContext &ctx) override final
Definition ArrayBM.cxx:157
unsigned int m_ipLength
length of the intensity pattern
Definition ArrayBM.h:62
std::unique_ptr< std::discrete_distribution< unsigned int > > m_t0Dist
as with m_biRandom, but for FastReseededPRNG
Definition ArrayBM.h:68
double * m_signalPattern
Additional array for keeping the locations we want signal in By default, will match the intensity pat...
Definition ArrayBM.h:84
ServiceHandle< IAthRNGSvc > m_randomSvc
the service managing our random seeds/sequences
Definition ArrayBM.h:70