ATLAS Offline Software
Loading...
Searching...
No Matches
DataContainer.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5
8#include "TMath.h"
9
10#include <iostream>
11using std::cout;
12using std::endl;
13
14using namespace LArSamples;
15
16
25
26
28 float energy, float time, float quality,
29 int eventIndex,
30 LArVectorProxy autoCorrs, float noise,
31 float pedestal, float pedestalRMS,
32 int status, float adcMax)
37{
39 m_corrs.reserve( autoCorrs.size());
40 m_corrs.push_back(noise*noise);
41 for (unsigned int i = 0; i < autoCorrs.size() && i < nSamples() - 1; ++i)
42 m_corrs.push_back(autoCorrs[i]*noise*noise);
43}
44
45
47 const std::vector<float>& corrs,
48 int eventIndex,
49 float energy, float time, float quality,
50 float pedestal, float pedestalRMS,
51 int status, float adcMax)
56{
58}
59
60
61DataContainer::DataContainer(const DataContainer& other, double adcMax, double time)
62 : m_gain(other.m_gain), m_samples(other.m_samples), m_corrs(other.m_corrs),
64 m_energy(other.m_energy), m_time(adcMax > 0 ? time : other.m_time), m_quality(other.m_quality),
66 m_status(other.m_status), m_adcMax(adcMax > 0 ? adcMax : other.m_adcMax)
67{
69}
70
71
76
77
79{
80 //if (gain() == CaloGain::UNKNOWNGAIN) return false;
81 if (eventIndex() < 0) return false;
82 if (Definitions::isNone(energy())) return false;
83 //FIXME: not filled for SC
84 //if (Definitions::isNone(ofcTime())) return false;
85 //if (Definitions::isNone(quality())) return false;
86 //if (Definitions::isNone(pedestal())) return false;
87 //if (m_corrs.size() == 0) return false; temporary
88 if (status() < 0) return false;
89
90 return true;
91}
CaloGain::CaloGain gain() const
const std::vector< short > & samples() const
unsigned int nSamples() const
std::vector< short > m_samples
vector of ADC samples
CaloGain::CaloGain m_gain
gain
const std::vector< float > & corrs() const
virtual ~DataContainer()
Destructor.
std::vector< float > m_corrs
noise + correlations in MeV
Proxy for accessing a range of float values like a vector.