File indexing completed on 2025-08-05 08:16:08
0001 #ifndef FUN4ALLRAW_LL1PACKETV1_H
0002 #define FUN4ALLRAW_LL1PACKETV1_H
0003
0004 #include "LL1Packet.h"
0005
0006 #include <array>
0007 #include <limits>
0008
0009 static const int MAX_NUM_CHANNELS = 672;
0010 static const int MAX_NUM_SAMPLES = 5;
0011
0012 class LL1Packetv1 : public LL1Packet
0013 {
0014 public:
0015 LL1Packetv1();
0016 ~LL1Packetv1() override = default;
0017
0018 void Reset() override;
0019 void identify(std::ostream &os = std::cout) const override;
0020
0021 int getMaxNumChannels() const override { return MAX_NUM_CHANNELS; }
0022 int getMaxNumSamples() const override { return MAX_NUM_SAMPLES; }
0023
0024 void setNrChannels(int i) override { NrChannels = i; }
0025 int getNrChannels() const override { return NrChannels; }
0026 void setNrSamples(int i) override { NrSamples = i; }
0027 int getNrSamples() const override { return NrSamples; }
0028 void setTriggerWords(int i) override { TriggerWords = i; }
0029 int getTriggerWords() const override { return TriggerWords; }
0030 void setSlotNr(int i) override { SlotNr = i; }
0031 int getSlotNr() const override { return SlotNr; }
0032 void setCardNr(int i) override { CardNr = i; }
0033 int getCardNr() const override { return CardNr; }
0034 void setMonitor(int i) override { Monitor = i; }
0035 int getMonitor() const override { return Monitor; }
0036 void setFemWords(int i) override { FemWords = i; }
0037 int getFemWords() const override { return FemWords; }
0038 void setSums(int i) override { Sums = i; }
0039 int getSums() const override { return Sums; }
0040 void setFibers(int i) override { Fibers = i; }
0041 int getFibers() const override { return Fibers; }
0042
0043 void setSample(int ipmt, int isamp, uint32_t val) override { samples.at(isamp).at(ipmt) = val; }
0044 uint32_t getSample(int ipmt, int isamp) const override { return samples.at(isamp).at(ipmt); }
0045 void setPacketEvtSequence(int i) override { PacketEvtSequence = i; }
0046 int getPacketEvtSequence() const override { return PacketEvtSequence; }
0047 int iValue(const int i, const std::string &what) const override;
0048 int iValue(const int channel, const int sample) const override;
0049 void dump(std::ostream &os = std::cout) const override;
0050 void dump_idll1_mbd(std::ostream &os = std::cout) const;
0051 void dump_idll1_emcal_mon3(std::ostream &os = std::cout) const;
0052 void dump_idll1_jet_emcal_mon1(std::ostream &os = std::cout) const;
0053
0054 protected:
0055 int PacketEvtSequence{0};
0056 int NrChannels{0};
0057 int NrSamples{0};
0058 int TriggerWords{0};
0059 int SlotNr{0};
0060 int CardNr{0};
0061 int Monitor{0};
0062 int FemWords{0};
0063 int Sums{0};
0064 int Fibers{0};
0065
0066 std::array<std::array<uint32_t, MAX_NUM_CHANNELS>, MAX_NUM_SAMPLES> samples{};
0067
0068 private:
0069 ClassDefOverride(LL1Packetv1, 2)
0070 };
0071
0072 #endif