ATLAS Offline Software
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 
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 
25 class 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;
46  LArDigit& operator=(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 
CaloGain::UNKNOWNGAIN
@ UNKNOWNGAIN
Definition: CaloGain.h:20
LArDigit::LArDigit
LArDigit()=default
default constructor for persistency
LArDigit::samples
const std::vector< short > & samples() const
Definition: LArDigit.h:78
LArDigit::hardwareID
const HWIdentifier & hardwareID() const
Definition: LArDigit.h:66
LArDigit::setSamples
void setSamples(const std::vector< short > &samples)
Set new digits in object.
Definition: LArDigit.cxx:8
LArDigit::~LArDigit
virtual ~LArDigit()=default
Destructor.
HWIdentifier
Definition: HWIdentifier.h:13
LArDigit::nsamples
int nsamples() const
Definition: LArDigit.h:75
LArDigit
Liquid Argon digit base class.
Definition: LArDigit.h:25
LArDigit::LArDigit
LArDigit(LArDigit &&)=default
LArDigit::m_gain
CaloGain::CaloGain m_gain
gain
Definition: LArDigit.h:32
LArDigit::LArDigit
LArDigit(const HWIdentifier &channel_value, CaloGain::CaloGain gain_value, std::vector< short > &&sample_values)
Definition: LArDigit.h:59
HWIdentifier.h
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
LArDigit::operator=
LArDigit & operator=(LArDigit &&)=default
LArDigit::gain
CaloGain::CaloGain gain() const
Definition: LArDigit.h:72
LArDigit::m_samples
std::vector< short > m_samples
vector of ADC samples
Definition: LArDigit.h:35
LArDigit::m_hardwareID
HWIdentifier m_hardwareID
Online Identifier.
Definition: LArDigit.h:29
LArDigit::LArDigit
LArDigit(const LArDigit &)=default
default copy/move assignment
LArDigit::operator=
LArDigit & operator=(const LArDigit &)=default
LArDigit::channelID
const HWIdentifier & channelID() const
Definition: LArDigit.h:69
LArDigit::LArDigit
LArDigit(const HWIdentifier &channel_value, CaloGain::CaloGain gain_value, const std::vector< short > &sample_values)
constructor
Definition: LArDigit.h:53
CaloGain.h