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