ATLAS Offline Software
Public Member Functions | Public Attributes | Private Attributes | List of all members
CyclicSeqSampler Class Reference

#include <Samplers.h>

Inheritance diagram for CyclicSeqSampler:
Collaboration diagram for CyclicSeqSampler:

Public Member Functions

 ~CyclicSeqSampler ()
 
 CyclicSeqSampler (const CyclicSeqSampler &orig)
 
 CyclicSeqSampler (std::string s)
 
float shoot ()
 

Public Attributes

float m_val {}
 
TRandom m_random
 

Private Attributes

std::vector< int > m_sequence
 
int m_index {}
 

Detailed Description

Definition at line 184 of file Samplers.h.

Constructor & Destructor Documentation

◆ ~CyclicSeqSampler()

CyclicSeqSampler::~CyclicSeqSampler ( )
inline

Definition at line 186 of file Samplers.h.

186 {};

◆ CyclicSeqSampler() [1/2]

CyclicSeqSampler::CyclicSeqSampler ( const CyclicSeqSampler orig)
inline

Definition at line 187 of file Samplers.h.

187 : Sampler(), m_sequence(orig.m_sequence) , m_index(0){};

◆ CyclicSeqSampler() [2/2]

CyclicSeqSampler::CyclicSeqSampler ( std::string  s)
inline

Definition at line 188 of file Samplers.h.

188  {
189  size_t pos = 0;
190  std::string token;
191  std::cout << "Initializing CyclicSeqSampler..." << std::endl;
192  while ((pos = s.find(',')) != std::string::npos) {
193  token = s.substr(0, pos);
194  m_sequence.push_back(std::stoi(token));
195  s.erase(0, pos + 1);
196  std::cout << " adding " << m_sequence[m_sequence.size()-1] << " from " << token.c_str() << std::endl;
197  }
198  m_index = 0;
199  };

Member Function Documentation

◆ shoot()

float CyclicSeqSampler::shoot ( )
inlinevirtual

Reimplemented from Sampler.

Definition at line 200 of file Samplers.h.

200  {
201  m_index = (m_index + 1) % m_sequence.size();
202  std::cout << "CyclicSeqSampler returning " << m_sequence[m_index] << std::endl;
203  return m_sequence[m_index];
204  };

Member Data Documentation

◆ m_index

int CyclicSeqSampler::m_index {}
private

Definition at line 207 of file Samplers.h.

◆ m_random

TRandom Sampler::m_random
inherited

Definition at line 25 of file Samplers.h.

◆ m_sequence

std::vector<int> CyclicSeqSampler::m_sequence
private

Definition at line 206 of file Samplers.h.

◆ m_val

float Sampler::m_val {}
inherited

Definition at line 24 of file Samplers.h.


The documentation for this class was generated from the following file:
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Sampler::Sampler
Sampler()=default
CyclicSeqSampler::m_index
int m_index
Definition: Samplers.h:207
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
CyclicSeqSampler::m_sequence
std::vector< int > m_sequence
Definition: Samplers.h:204