Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MicromegasRawHitv1.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MicromegasRawHitv1.h
1 #ifndef FUN4ALLRAW_MICROMEGASRAWTHITV1_H
2 #define FUN4ALLRAW_MICROMEGASRAWTHITV1_H
3 
4 #include "MicromegasRawHit.h"
5 
6 #include <phool/PHObject.h>
7 
8 #include <cassert>
9 #include <limits>
10 
12 {
13 
14 
15  public:
16  MicromegasRawHitv1() = default;
18  ~MicromegasRawHitv1() override = default;
19 
23  void identify(std::ostream &os = std::cout) const override;
24 
25  uint64_t get_bco() const override {return bco;}
26  // cppcheck-suppress virtualCallInConstructor
27  void set_bco(const uint64_t val) override {bco = val;}
28 
29  uint64_t get_gtm_bco() const override {return gtm_bco;}
30  // cppcheck-suppress virtualCallInConstructor
31  void set_gtm_bco(const uint64_t val) override {gtm_bco = val;}
32 
33  int32_t get_packetid() const override {return packetid;}
34  // cppcheck-suppress virtualCallInConstructor
35  void set_packetid(const int32_t val) override {packetid = val;}
36 
37  uint16_t get_fee() const override {return fee;}
38  // cppcheck-suppress virtualCallInConstructor
39  void set_fee(uint16_t const val) override {fee = val;}
40 
41  uint16_t get_channel() const override {return channel;}
42  // cppcheck-suppress virtualCallInConstructor
43  void set_channel(uint16_t const val) override {channel = val;}
44 
45  uint16_t get_sampaaddress() const override {return sampaaddress;}
46  // cppcheck-suppress virtualCallInConstructor
47  void set_sampaaddress(uint16_t const val) override {sampaaddress = val;}
48 
49  uint16_t get_sampachannel() const override {return sampachannel;}
50  // cppcheck-suppress virtualCallInConstructor
51  void set_sampachannel(uint16_t const val) override {sampachannel = val;}
52 
53  uint16_t get_samples() const override {return samples;}
54  // cppcheck-suppress virtualCallInConstructor
55  void set_samples(uint16_t const val) override
56  {
57  // assign
58  samples = val;
59 
60  // resize adc vector
61  adc.resize( val, 0 );
62  }
63 
64  uint16_t get_adc( size_t sample ) const override
65  {
66  assert( sample < adc.size() );
67  return adc[sample];
68  }
69 
70  // cppcheck-suppress virtualCallInConstructor
71  void set_adc( size_t sample, uint16_t val ) override
72  {
73  assert( sample < adc.size() );
74  adc[sample] = val;
75  }
76 
77  private:
78 
79  uint64_t bco = std::numeric_limits<uint64_t>::max();
80  uint64_t gtm_bco = std::numeric_limits<uint64_t>::max();
81  int32_t packetid = std::numeric_limits<int32_t>::max();
82  uint16_t fee = std::numeric_limits<uint16_t>::max();
83  uint16_t channel = std::numeric_limits<uint16_t>::max();
84  uint16_t sampaaddress = std::numeric_limits<uint16_t>::max();
85  uint16_t sampachannel = std::numeric_limits<uint16_t>::max();
86  uint16_t samples = std::numeric_limits<uint16_t>::max();
87 
89  std::vector<uint16_t> adc;
90 
91  ClassDefOverride(MicromegasRawHitv1,1)
92 };
93 
94 #endif