ATLAS Offline Software
Loading...
Searching...
No Matches
LArWaveCumul.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
15
16#ifndef LARRAWCONDITIONS_LARWAVECUMUL_H
17#define LARRAWCONDITIONS_LARWAVECUMUL_H
25
28#include <vector>
29
30class LArWaveCumul : public LArWave {
31
32 public:
33
35
37
38 LArWaveCumul(const std::vector<double>& theVector,
39 double dt,
40 unsigned flag=0);
41
42 LArWaveCumul(const std::vector<double>& vAmpl,
43 const std::vector<double>& vErr,
44 const std::vector<int>& vTrig,
45 double dt,
46 unsigned flag=0);
47
48 LArWaveCumul(unsigned nSamples,
49 double dt,
50 unsigned flag=0);
51
52 virtual ~LArWaveCumul() = default;
54
56
57
59 const std::vector<double>& getErrors() const;
60
62 double getError(unsigned i) const;
63
65 const std::vector<int>& getTriggers() const;
66
68 int getTrigger(unsigned i) const;
69
71
72
74
75
77 void addEvent( int delay , int step , const std::vector<double>& Samples ) ;
78
80 void addAccumulatedEvent( int delay ,
81 int step ,
82 const std::vector<double>& SamplesSum ,
83 const std::vector<double>& Samples2Sum ,
84 unsigned nTriggers ) ;
86
87 protected:
88
89 std::vector<double> m_errors ;
90 std::vector<int> m_triggers ;
91
92};
93
94
95inline
100
101inline
102LArWaveCumul::LArWaveCumul(const std::vector<double>& theVector,
103 double dt,
104 unsigned flag)
105 :
106 LArWave(theVector,dt,flag)
107{
108 unsigned nSamples = theVector.size();
109 m_errors.resize(nSamples,0);
110 m_triggers.resize(nSamples,0);
111}
112
113inline
114LArWaveCumul::LArWaveCumul(const std::vector<double>& vAmpl,
115 const std::vector<double>& vErr,
116 const std::vector<int>& vTrig,
117 double dt,
118 unsigned flag)
119 :
120 LArWave(vAmpl,dt,flag),
121 m_errors(vErr),
122 m_triggers(vTrig)
123{}
124
125inline
127 double dt,
128 unsigned flag)
129 :
130 LArWave(nSamples,dt,flag)
131{
132 m_errors.resize(nSamples,0) ;
133 m_triggers.resize(nSamples,0) ;
134}
135
136inline
137const std::vector<double>&
139{ return m_errors ; }
140
141inline
142double
143LArWaveCumul::getError(unsigned i) const
144{
145 return (i<getSize()) ? m_errors[i] : -9.9999E+99 ;
146}
147
148inline
149const std::vector<int>&
151{
152 return m_triggers;
153}
154
155inline
156int
158{ return (i<getSize()) ? m_triggers[i] : -999999999; }
159
160
161#endif // LARWAVECUMUL_H
double delay(std::size_t d)
double getError(unsigned i) const
error per time bin
std::vector< int > m_triggers
virtual ~LArWaveCumul()=default
std::vector< double > m_errors
const std::vector< int > & getTriggers() const
trigger vector
const std::vector< double > & getErrors() const
error vector
void addAccumulatedEvent(int delay, int step, const std::vector< double > &SamplesSum, const std::vector< double > &Samples2Sum, unsigned nTriggers)
used when building from LArAccumulatedDigits
int getTrigger(unsigned i) const
trigger per time bin
void addEvent(int delay, int step, const std::vector< double > &Samples)
add in set of channel responses for a given step/delay
size_t getSize() const
number of time samples
Definition LArWave.h:62
LArWave()
Definition LArWave.h:147