ATLAS Offline Software
TileSampleBuffer.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TILEPULSESIMULATOR_TILESAMPLEBUFFER_H
6 #define TILEPULSESIMULATOR_TILESAMPLEBUFFER_H
7 
8 #include "TObject.h"
9 #include <vector>
10 
11 class TArrayD;
12 
13 
14 class TileSampleBuffer : public TObject{
15  public:
17  TileSampleBuffer(TArrayD* xValues);
18  TileSampleBuffer(unsigned int nSamples, double sampleStart, double stepLength);
19  virtual ~TileSampleBuffer();
20 
21  inline void setValue(unsigned int i, double val) {if(i<m_y.size()) m_y[i]=(float)val;}
22  float getValue(unsigned int i);
23  double getTime(unsigned int i);
24  inline unsigned int size(){return m_x.size();}
25  unsigned int getMaxValueIndex();
26  void print();
27  inline void setValueNoise(unsigned int i, double val) {if(i<m_noiseVector.size()) m_noiseVector[i]=(float)val;}
28  float getValueNoise(unsigned int i);
29  void getValueVector(std::vector<float> &vec) {vec = m_y;}
30 
31  private:
32  std::vector<double> m_x;
33  std::vector<float> m_y;
34  std::vector<float> m_noiseVector;
35 };
36 
37 
38 inline float TileSampleBuffer::getValue(unsigned int i)
39 {
40  if(i<m_y.size()) return m_y[i];
41  else return -999.;
42 }
43 
44 inline double TileSampleBuffer::getTime(unsigned int i) {
45  if(i<m_x.size()) return m_x[i];
46  else return -999.;
47 }
48 inline float TileSampleBuffer::getValueNoise(unsigned int i)
49 {
50  if(i<m_noiseVector.size()) return m_noiseVector[i];
51  else return -999.;
52 }
53 
54 #endif
TileSampleBuffer::getMaxValueIndex
unsigned int getMaxValueIndex()
Definition: TileSampleBuffer.cxx:40
TileSampleBuffer::getValueVector
void getValueVector(std::vector< float > &vec)
Definition: TileSampleBuffer.h:29
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
TileSampleBuffer
Definition: TileSampleBuffer.h:14
TileSampleBuffer::m_noiseVector
std::vector< float > m_noiseVector
Definition: TileSampleBuffer.h:34
TileSampleBuffer::setValueNoise
void setValueNoise(unsigned int i, double val)
Definition: TileSampleBuffer.h:27
TileSampleBuffer::m_y
std::vector< float > m_y
Definition: TileSampleBuffer.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
TileSampleBuffer::size
unsigned int size()
Definition: TileSampleBuffer.h:24
TileSampleBuffer::~TileSampleBuffer
virtual ~TileSampleBuffer()
Definition: TileSampleBuffer.cxx:36
TileSampleBuffer::TileSampleBuffer
TileSampleBuffer()
Definition: TileSampleBuffer.cxx:12
TileSampleBuffer::getValue
float getValue(unsigned int i)
Definition: TileSampleBuffer.h:38
TileSampleBuffer::setValue
void setValue(unsigned int i, double val)
Definition: TileSampleBuffer.h:21
TileSampleBuffer::getTime
double getTime(unsigned int i)
Definition: TileSampleBuffer.h:44
TileSampleBuffer::getValueNoise
float getValueNoise(unsigned int i)
Definition: TileSampleBuffer.h:48
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
LArDigits2NtupleDumper.nSamples
nSamples
Definition: LArDigits2NtupleDumper.py:70
TileSampleBuffer::print
void print()
Definition: TileSampleBuffer.cxx:53
readCCLHist.float
float
Definition: readCCLHist.py:83
TileSampleBuffer::m_x
std::vector< double > m_x
Definition: TileSampleBuffer.h:32