-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathReadoutWaveforms.h
62 lines (44 loc) · 1.93 KB
/
ReadoutWaveforms.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/// \file ReadoutWaveforms.h
/// \brief Data object that contains the waveforms from each readout channel
// 1-Jun-2024 WGS
#ifndef _grams_readoutwaveforms_h_
#define _grams_readoutwaveforms_h_
// From GramsDataObj
#include "ReadoutID.h"
#include <iostream>
#include <map>
#include <vector>
namespace grams {
// Define the waveforms produced by an individual readout channel,
struct ReadoutWaveform {
// Include the readout ID, to be consistent with how
// ElectronClusters works.
ReadoutID readoutID;
// Note that the lengths of these two vectors are, in general,
// _not_ the same.
// The output analog waveform from a given readout channel.
std::vector<double> analog;
// The output digital waveform from a given readout channel.
std::vector<int> digital;
// Provide accessors to avoid confusion between a C++ struct
// and a C++ class.
const ReadoutID& ID() const { return readoutID; }
const std::vector<double>& Analog() const { return analog; }
const std::vector<int>& Digital() const { return digital; }
}; // ReadoutWaveform
// Define a list of waveforms for the readout channels in the
// event. Note that to backtrack from readout channel to cluster to
// energy deposit, one must read multiple trees and set them up as
// friends.
//
// See GramsElecsim/gramselecsim.cc for an example of how to read
// tree columns that have been distributed among different files.
typedef std::map< ReadoutID, ReadoutWaveform > ReadoutWaveforms;
} // namespace grams
// I prefer to define "write" operators for my custom classes to make
// it easier to examine their contents. For these to work in ROOT's
// dictionary-generation system, they must be located outside of any
// namespace.
std::ostream& operator<< (std::ostream& out, const grams::ReadoutWaveform& rw);
std::ostream& operator<< (std::ostream& out, const grams::ReadoutWaveforms& rws);
#endif // _grams_readoutwaveforms_h_