ATLAS Offline Software
Loading...
Searching...
No Matches
ArrayBM.h
Go to the documentation of this file.
1/* -*- C++ -*- */
2
3/*
4 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef PILEUPCOMPS_ARRAYBM
8#define PILEUPCOMPS_ARRAYBM 1
17#include "GaudiKernel/ContextSpecificPtr.h"
18#include "GaudiKernel/ServiceHandle.h"
19#include "Gaudi/Property.h"
20
25
26#include <random>
27
28namespace CLHEP
29{
30 class RandGeneral;
31}
32
33class ArrayBM : public extends<AthService, IBeamIntensity>
34{
35public:
37
38 ArrayBM(const std::string& name,ISvcLocator* svc);
39 virtual ~ArrayBM();
41
43 virtual StatusCode initialize() override final;
45
47 virtual float normFactor(int iXing) const override final;
48 virtual float largestElementInPattern() const override final { return m_largestElementInPattern; }
49 virtual void selectT0(unsigned int run, unsigned long long event) override final;
50 virtual unsigned int getCurrentT0BunchCrossing() const override final { return m_t0Offset; }
51 virtual unsigned int getBeamPatternLength() const override final { return m_ipLength; }
53private:
57 Gaudi::Hive::ContextSpecificData<unsigned int> m_t0Offset;
59 Gaudi::Property<std::uint64_t> m_seed{this, "Seed", 0, "Seed for FastReseededPRNG. Zero seed switches to AthRNGSvc mode."};
61 Gaudi::Property<std::vector<float>> m_intensityPatternProp;
63 unsigned int m_ipLength;
67 CLHEP::RandGeneral* m_biRandom;
69 std::unique_ptr<std::discrete_distribution<unsigned int>> m_t0Dist{nullptr};
71 ServiceHandle<IAthRNGSvc> m_randomSvc{this, "RandomSvc", "AthRNGSvc","The random number service that will be used."};
86};
87#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:65
virtual StatusCode initialize() override final
Definition ArrayBM.cxx:45
int m_emptyBunches
Empty bunch option.
Definition ArrayBM.h:82
Gaudi::Property< std::uint64_t > m_seed
seed for FastReseededPRNG. Non-zero switches to using FastReseededPRNG.
Definition ArrayBM.h:59
CLHEP::RandGeneral * m_biRandom
shoot random number proportionally to m_intensityPattern
Definition ArrayBM.h:67
virtual unsigned int getCurrentT0BunchCrossing() const override final
Definition ArrayBM.h:50
float m_largestElementInPattern
The largest value in the pattern assuming that the pattern has mean value 1.0.
Definition ArrayBM.h:77
unsigned int m_maxBunchCrossingPerOrbit
max bunch crossings per orbit
Definition ArrayBM.h:55
virtual float normFactor(int iXing) const override final
Definition ArrayBM.cxx:179
ArrayBM(const std::string &name, ISvcLocator *svc)
Definition ArrayBM.cxx:20
virtual void selectT0(unsigned int run, unsigned long long event) override final
Definition ArrayBM.cxx:157
virtual unsigned int getBeamPatternLength() const override final
Definition ArrayBM.h:51
virtual ~ArrayBM()
Definition ArrayBM.cxx:39
Gaudi::Property< std::vector< float > > m_intensityPatternProp
user-defined intensity pattern
Definition ArrayBM.h:61
virtual float largestElementInPattern() const override final
Definition ArrayBM.h:48
ATHRNG::RNGWrapper *m_rngWrapper ATLAS_THREAD_SAFE
Definition ArrayBM.h:72
Gaudi::Hive::ContextSpecificData< unsigned int > m_t0Offset
offset of the t0 wrto our intensity pattern
Definition ArrayBM.h:57
unsigned int m_ipLength
length of the intensity pattern
Definition ArrayBM.h:63
std::unique_ptr< std::discrete_distribution< unsigned int > > m_t0Dist
as with m_biRandom, but for FastReseededPRNG
Definition ArrayBM.h:69
double * m_signalPattern
Additional array for keeping the locations we want signal in By default, will match the intensity pat...
Definition ArrayBM.h:85
ServiceHandle< IAthRNGSvc > m_randomSvc
the service managing our random seeds/sequences
Definition ArrayBM.h:71
Definition run.py:1