File indexing completed on 2025-08-06 08:17:15
0001 #ifndef FUN4ALLRAW_TPCDIODEV1_H
0002 #define FUN4ALLRAW_TPCDIODEV1_H
0003
0004 #include "TpcDiode.h"
0005
0006 #include <phool/PHObject.h>
0007
0008 #include <cassert>
0009 #include <limits>
0010
0011 class TpcDiodev1 : public TpcDiode
0012 {
0013 public:
0014 TpcDiodev1() = default;
0015 TpcDiodev1(TpcDiode* tpcdiode);
0016 ~TpcDiodev1() override = default;
0017
0018
0019
0020
0021 void identify(std::ostream& os = std::cout) const override;
0022
0023 void Clear(Option_t*) override;
0024
0025
0026
0027
0028
0029
0030
0031
0032 int32_t get_packetid() const override { return packetid; }
0033 void set_packetid(const int32_t val) override { packetid = val; }
0034
0035
0036
0037
0038 uint16_t get_channel() const override { return channel; }
0039 void set_channel(const uint16_t val) override { channel = val; }
0040
0041 uint16_t get_maxadc() const override { return maxadc; }
0042 void set_maxadc(const uint16_t val) override { maxadc = val; }
0043
0044 uint16_t get_maxbin() const override { return maxbin; }
0045 void set_maxbin(const uint16_t val) override { maxbin = val; }
0046
0047 double get_integral() const override { return integral; }
0048 void set_integral(const double val) override { integral = val; }
0049
0050 double get_pulsewidth() const override { return pulsewidth; }
0051 void set_pulsewidth(const double val) override { pulsewidth = val; }
0052
0053 uint16_t get_nabovethreshold() const override { return nabovethreshold; }
0054 void set_nabovethreshold(const uint16_t val) override { nabovethreshold = val; }
0055
0056
0057
0058
0059
0060
0061
0062 uint16_t get_samples() const override { return samples; }
0063 void set_samples(const uint16_t val) override
0064 {
0065
0066 samples = val;
0067
0068
0069 adc.resize(val, 0);
0070 }
0071
0072 uint16_t get_adc(uint16_t sample) const override
0073 {
0074 assert(sample < adc.size());
0075 return adc[sample];
0076 }
0077
0078 void set_adc(uint16_t sample, uint16_t val) override
0079 {
0080 assert(sample < adc.size());
0081 adc[sample] = val;
0082 }
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118 private:
0119
0120
0121 int32_t packetid = std::numeric_limits<int32_t>::max();
0122
0123 uint16_t channel = std::numeric_limits<uint16_t>::max();
0124
0125
0126 uint16_t samples = std::numeric_limits<uint16_t>::max();
0127 uint16_t maxadc = std::numeric_limits<uint16_t>::max();
0128 uint16_t maxbin = std::numeric_limits<uint16_t>::max();
0129 double integral = std::numeric_limits<uint16_t>::max();
0130 double pulsewidth = std::numeric_limits<uint16_t>::max();
0131 uint16_t nabovethreshold = std::numeric_limits<uint16_t>::max();
0132
0133
0134 std::vector<uint16_t> adc;
0135
0136 ClassDefOverride(TpcDiodev1, 1)
0137 };
0138
0139 #endif