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-2021 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
58
59 // ------ Identify RodBlockStructure -------
60 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
87 // ----------------- Printing methods -----------------
88 // print the full ROD fragment
89 //virtual void dumpFragment();
90private:
92 virtual void resetPointers();
93 //Separated blocks for encoding
94
95 //Counter for channels inside of a FEB
102 //For fixed gain mode
103 unsigned m_fixedGain;
104 //FIXME, very ugly hack! See explanation in LArRodDecoder.h
105public:
106 inline uint16_t getNTrigger() const;
107 inline uint16_t getStepIndex() const;
108 inline uint16_t getNStep() const;
109 inline uint16_t getFebConfig() const;
110 inline uint16_t getFirstSampleIndex() const;
111
112 virtual bool canSetAccumulated() {return false;}
113};
114
115
116inline int LArRodBlockAccumulatedV3::setGain(const int GainValue)
117{//This RodBlockStructure allows only predefined gains
118 /*
119 std::cout << " Set fixed gain Value " << GainValue << std::endl;
120 std::cout << " Number of words in Gain Block " << std::endl;
121 std::cout << "\tHigh (1): " << getHeader16(NWRawData1) << std::endl;
122 std::cout << "\tMedium (2): " << getHeader16(NWRawData2) << std::endl;
123 std::cout << "\tLow (3): " << getHeader16(NWRawData3) << std::endl;
124 */
125 if (GainValue<0 || GainValue>3)
126 return 0;
127 m_fixedGain=GainValue;
128 return 1;
129}
130
132{
133 return getHeader16(FebConfig);
134}
135
140
141
142#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)
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