ATLAS Offline Software
Loading...
Searching...
No Matches
TileSampleBuffer.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include "TArrayD.h"
8#include "TMath.h"
9
10#include <iostream>
11
15
17{
18 unsigned int nSamples = xValues->GetSize();
19 m_x.resize(nSamples,0.);
20 m_y.resize(nSamples,0.);
21 for(unsigned int i=0; i<nSamples; ++i){
22 m_x[i] = xValues->At(i);
23 }
24}
25
26TileSampleBuffer::TileSampleBuffer(unsigned int nSamples, double sampleStart, double stepLength)
27{
28 m_x.resize(nSamples,0.);
29 m_y.resize(nSamples,0.);
30 m_noiseVector.resize(nSamples,0.);
31 for(unsigned int i=0; i<nSamples; ++i){
32 m_x[i] = sampleStart + i*stepLength;
33 }
34}
35
39
41{
42 unsigned int iMax(0);
43 double max(-1e100);
44 for(unsigned int i=0; i<m_y.size(); ++i){
45 if(m_y[i]>max) {
46 max=m_y[i];
47 iMax = i;
48 }
49 }
50 return iMax;
51}
52
54 std::cout << "Content of TileSampleBuffer: " << std::endl;
55 for(unsigned int i=0; i<m_y.size(); ++i){
56 std::cout << m_x[i] << "\t" << m_y[i] << std::endl;
57 }
58}
#define max(a, b)
Definition cfImp.cxx:41
std::vector< double > m_x
std::vector< float > m_y
std::vector< float > m_noiseVector
unsigned int getMaxValueIndex()