ATLAS Offline Software
Loading...
Searching...
No Matches
LArDigit.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef LARDIGIT_H
6#define LARDIGIT_H
7#include <vector>
8
9#include "Identifier/Identifier.h"
12
19
20/* modifications : */
21/* 11/05/2002 : channelID transformed into a const method */
22/* 09/19/2002 : move to DataVector, remove ContainedObject, clid, etc*/
23/* 10/02/2004 : Migrate for new HWIdentifier. Old interface is removed. (Walter Lampl) */
24
25class LArDigit {
26
27 private:
30
33
35 std::vector<short> m_samples;
36
37 public:
39 virtual ~LArDigit() = default;
41 LArDigit() = default;
43 LArDigit(const LArDigit&) = default;
44 LArDigit(LArDigit&&) = default;
45 LArDigit& operator=(const LArDigit&) = default;
47
53 LArDigit(const HWIdentifier& channel_value, CaloGain::CaloGain gain_value,
54 const std::vector<short>& sample_values)
55 : m_hardwareID(channel_value),
56 m_gain(gain_value),
57 m_samples(sample_values) {}
58
59 LArDigit(const HWIdentifier& channel_value, CaloGain::CaloGain gain_value,
60 std::vector<short>&& sample_values)
61 : m_hardwareID(channel_value),
62 m_gain(gain_value),
63 m_samples(std::move(sample_values)) {}
64
66 const HWIdentifier& hardwareID() const { return m_hardwareID; }
67
69 const HWIdentifier& channelID() const { return m_hardwareID; }
70
72 CaloGain::CaloGain gain() const { return m_gain; }
73
75 int nsamples() const { return m_samples.size(); }
76
78 const std::vector<short>& samples() const { return m_samples; }
79
83 void setSamples(const std::vector<short>& samples);
84
85};
86
87#endif //LARDIGIT_H
88
LArDigit & operator=(const LArDigit &)=default
CaloGain::CaloGain gain() const
Definition LArDigit.h:72
HWIdentifier m_hardwareID
Online Identifier.
Definition LArDigit.h:29
LArDigit(const HWIdentifier &channel_value, CaloGain::CaloGain gain_value, std::vector< short > &&sample_values)
Definition LArDigit.h:59
const HWIdentifier & hardwareID() const
Definition LArDigit.h:66
int nsamples() const
Definition LArDigit.h:75
const std::vector< short > & samples() const
Definition LArDigit.h:78
LArDigit(LArDigit &&)=default
CaloGain::CaloGain m_gain
gain
Definition LArDigit.h:32
LArDigit(const LArDigit &)=default
default copy/move assignment
virtual ~LArDigit()=default
Destructor.
const HWIdentifier & channelID() const
Definition LArDigit.h:69
LArDigit(const HWIdentifier &channel_value, CaloGain::CaloGain gain_value, const std::vector< short > &sample_values)
constructor
Definition LArDigit.h:53
LArDigit()=default
default constructor for persistency
LArDigit & operator=(LArDigit &&)=default
std::vector< short > m_samples
vector of ADC samples
Definition LArDigit.h:35
void setSamples(const std::vector< short > &samples)
Set new digits in object.
Definition LArDigit.cxx:8
@ UNKNOWNGAIN
Definition CaloGain.h:20
STL namespace.