ATLAS Offline Software
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
9 
17 #include "GaudiKernel/ContextSpecificPtr.h"
18 #include "GaudiKernel/ServiceHandle.h"
19 #include "Gaudi/Property.h"
20 
25 
26 #include <boost/random.hpp>
27 
28 namespace CLHEP
29 {
30  class RandGeneral;
31 }
32 
33 class ArrayBM : public extends<AthService, IBeamIntensity>
34 {
35 public:
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; }
53 private:
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<const boost::random::discrete_distribution<unsigned int>> m_t0Dist{nullptr};
71  ServiceHandle<IAthRNGSvc> m_randomSvc{this, "RandomSvc", "AthRNGSvc","The random number service that will be used."};
85  double* m_signalPattern;
86 };
87 #endif
ArrayBM::initialize
virtual StatusCode initialize() override final
Definition: ArrayBM.cxx:45
ArrayBM::m_seed
Gaudi::Property< std::uint64_t > m_seed
seed for FastReseededPRNG. Non-zero switches to using FastReseededPRNG.
Definition: ArrayBM.h:59
ArrayBM::m_maxBunchCrossingPerOrbit
unsigned int m_maxBunchCrossingPerOrbit
max bunch crossings per orbit
Definition: ArrayBM.h:55
ArrayBM::m_t0Offset
Gaudi::Hive::ContextSpecificData< unsigned int > m_t0Offset
offset of the t0 wrto our intensity pattern
Definition: ArrayBM.h:57
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
ArrayBM::m_emptyBunches
int m_emptyBunches
Empty bunch option.
Definition: ArrayBM.h:82
ArrayBM::m_signalPattern
double * m_signalPattern
Additional array for keeping the locations we want signal in By default, will match the intensity pat...
Definition: ArrayBM.h:85
ArrayBM::largestElementInPattern
virtual float largestElementInPattern() const override final
Definition: ArrayBM.h:48
ArrayBM::getBeamPatternLength
virtual unsigned int getBeamPatternLength() const override final
Definition: ArrayBM.h:51
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
run
Definition: run.py:1
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
ArrayBM::m_intensityPatternProp
Gaudi::Property< std::vector< float > > m_intensityPatternProp
user-defined intensity pattern
Definition: ArrayBM.h:61
ArrayBM::m_randomSvc
ServiceHandle< IAthRNGSvc > m_randomSvc
the service managing our random seeds/sequences
Definition: ArrayBM.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
ArrayBM::m_t0Dist
std::unique_ptr< const boost::random::discrete_distribution< unsigned int > > m_t0Dist
as with m_biRandom, but for FastReseededPRNG
Definition: ArrayBM.h:69
ArrayBM::m_ipLength
unsigned int m_ipLength
length of the intensity pattern
Definition: ArrayBM.h:63
ArrayBM::m_largestElementInPattern
float m_largestElementInPattern
The largest value in the pattern assuming that the pattern has mean value 1.0.
Definition: ArrayBM.h:77
ArrayBM::normFactor
virtual float normFactor(int iXing) const override final
Definition: ArrayBM.cxx:177
ArrayBM::ArrayBM
ArrayBM(const std::string &name, ISvcLocator *svc)
Definition: ArrayBM.cxx:20
ArrayBM::getCurrentT0BunchCrossing
virtual unsigned int getCurrentT0BunchCrossing() const override final
Definition: ArrayBM.h:50
IBeamIntensity.h
provides the relative beam intensity as a function of the bunch xing.
ArrayBM::m_intensityPattern
double * m_intensityPattern
normalized intensity pattern. C array to make clhep RandGeneral happy
Definition: ArrayBM.h:65
ArrayBM::ATLAS_THREAD_SAFE
ATHRNG::RNGWrapper *m_rngWrapper ATLAS_THREAD_SAFE
Definition: ArrayBM.h:72
AthService.h
ArrayBM::selectT0
virtual void selectT0(unsigned int run, unsigned long long event) override final
Definition: ArrayBM.cxx:155
ArrayBM::m_biRandom
CLHEP::RandGeneral * m_biRandom
shoot random number proportionally to m_intensityPattern
Definition: ArrayBM.h:67
checker_macros.h
Define macros for attributes used to control the static checker.
ArrayBM::~ArrayBM
virtual ~ArrayBM()
Definition: ArrayBM.cxx:39
IAthRNGSvc.h
ServiceHandle< IAthRNGSvc >
ArrayBM
Definition: ArrayBM.h:34