ATLAS Offline Software
Loading...
Searching...
No Matches
LArRodBlockAccumulatedV3.h
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef LARBYTESTREAM_LARRODBLOCKACCUMULATEDV3_H
8#define LARBYTESTREAM_LARRODBLOCKACCUMULATEDV3_H
9
19
22
24{
25public:
26 // ----------------- Header words indexes -----------------
27 enum {
28 NWTot, // First words: DSP event header
32 FEB_SN, // FEB serial number
33 FEB_SN_h, // FEB serial number
34 ResultsOff1, // Size of results (Accumulated averages in DSP)
35 ResultsDim1, // Offset to results
36 ResultsOff2, // Size of times (in physics)
37 ResultsDim2, // Offset to times (in physics)
39 RawDataBlkDim, // Raw FEB event offset
40 EventStatus, // Bits describing the event
46 InFPGAFormat, // added 08.09.2005 - wrong 28.09.2005?
48 endtag //This tag needs to be an odd number, see *) for constructor
49 };
50 enum{
55 };
56 // constructor
57 LArRodBlockAccumulatedV3(IMessageSvc* msgSvc);
58
59 // ------ Identify RodBlockStructure -------
60 static std::string BlockType() { return std::string("RodBlockAccumulatedV3");}
61 public:
62 // ----------------- Encoding methods -----------------
63 // Never to be used while decoding!
64 // ----------------- Decoding methods -----------------
65 // Never to be used while encoding!
66 // set full ROD fragment before trying to get anything!
67 // in case there is more than 1 FEB in 1 fragment, jump to next FEB
68 virtual uint8_t getTDCPhase() const;
69 virtual int getNextRawData(int& channelNumber, std::vector<short>& samples, uint32_t& gain);
70 virtual int getNextAccumulatedDigit(int& channelNumber, std::vector<uint64_t>& SamplesSum, std::vector < uint64_t >& corr2Sum, uint32_t& gain);
71 virtual uint32_t getNumberOfSamples() const;
72 virtual uint32_t getNumberOfGains() const;
73 virtual uint32_t getRadd(uint32_t adc, uint32_t sample) const;
74 virtual uint16_t getResults1Size() const;
75 virtual uint16_t getResults2Size() const;
76 virtual uint16_t getRawDataSize() const;
77 virtual uint16_t getCtrl1(uint32_t adc) const;
78 virtual uint16_t getCtrl2(uint32_t adc) const;
79 virtual uint16_t getCtrl3(uint32_t adc) const;
80 virtual uint32_t getStatus() const;
81
82 virtual inline int setGain(const int GainValue); // ---------------- Define gain for decoding
83 virtual inline uint32_t hasAccumBlock() const {return getHeader16(ResultsOff1);} ;
84 virtual inline uint32_t hasRawDataBlock() const {return getHeader16(RawDataBlkOff);} ;
85 virtual inline uint32_t hasControlWords() const {return getHeader16(RawDataBlkOff);} ;
86
87private:
89 virtual void resetPointers();
90 //Separated blocks for encoding
91
92 //Counter for channels inside of a FEB
99 //For fixed gain mode
100 unsigned m_fixedGain;
101 //FIXME, very ugly hack! See explanation in LArRodDecoder.h
102public:
103 inline uint16_t getNTrigger() const;
104 inline uint16_t getStepIndex() const;
105 inline uint16_t getNStep() const;
106 inline uint16_t getFebConfig() const;
107 inline uint16_t getFirstSampleIndex() const;
108
109 virtual bool canSetAccumulated() {return false;}
110};
111
112
113inline int LArRodBlockAccumulatedV3::setGain(const int GainValue)
114{//This RodBlockStructure allows only predefined gains
115 if (GainValue<0 || GainValue>3)
116 return 0;
117 m_fixedGain=GainValue;
118 return 1;
119}
120
122{
123 return getHeader16(FebConfig);
124}
125
130
131
132#endif
virtual uint32_t hasRawDataBlock() const
virtual uint8_t getTDCPhase() const
virtual uint16_t getCtrl2(uint32_t adc) const
virtual uint32_t getRadd(uint32_t adc, uint32_t sample) const
virtual int getNextAccumulatedDigit(int &channelNumber, std::vector< uint64_t > &SamplesSum, std::vector< uint64_t > &corr2Sum, uint32_t &gain)
virtual uint32_t getNumberOfGains() const
virtual uint16_t getResults1Size() const
virtual uint16_t getRawDataSize() const
virtual uint32_t getStatus() const
virtual int getNextRawData(int &channelNumber, std::vector< short > &samples, uint32_t &gain)
virtual uint16_t getCtrl3(uint32_t adc) const
virtual uint32_t hasAccumBlock() const
virtual int setGain(const int GainValue)
LArRodBlockAccumulatedV3(IMessageSvc *msgSvc)
virtual uint16_t getCtrl1(uint32_t adc) const
virtual uint16_t getResults2Size() const
virtual uint32_t hasControlWords() const
virtual uint32_t getNumberOfSamples() const
uint16_t getHeader16(const unsigned n) const
LArRodBlockStructure(IMessageSvc *msgSvc, const std::string &blockType)