ATLAS Offline Software
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 
22 
24 {
25 public:
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{
54  NStep
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();
90 private:
91  void clearBlocks();
92  virtual void resetPointers();
93  //Separated blocks for encoding
94 
95  //Counter for channels inside of a FEB
97  int m_Result1Index = 0;
99  int m_Result2Index = 0;
101  int m_RawDataIndex = 0;
102  //For fixed gain mode
103  unsigned m_fixedGain;
104  //FIXME, very ugly hack! See explanation in LArRodDecoder.h
105 public:
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 
116 inline 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 
137 {
139 }
140 
141 
142 #endif
LArRodBlockStructure
Definition: LArRodBlockStructure.h:48
LArRodBlockAccumulatedV3::StepIndex
@ StepIndex
Definition: LArRodBlockAccumulatedV3.h:53
LArRodBlockAccumulatedV3::hasAccumBlock
virtual uint32_t hasAccumBlock() const
Definition: LArRodBlockAccumulatedV3.h:83
LArRodBlockAccumulatedV3::getStepIndex
uint16_t getStepIndex() const
Definition: LArRodBlockAccumulatedV3.cxx:291
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
LArRodBlockAccumulatedV3::FEBID
@ FEBID
Definition: LArRodBlockAccumulatedV3.h:30
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LArRodBlockAccumulatedV3::getNumberOfGains
virtual uint32_t getNumberOfGains() const
Definition: LArRodBlockAccumulatedV3.cxx:278
LArRodBlockAccumulatedV3::setGain
virtual int setGain(const int GainValue)
Definition: LArRodBlockAccumulatedV3.h:116
LArRodBlockAccumulatedV3::getResults2Size
virtual uint16_t getResults2Size() const
Definition: LArRodBlockAccumulatedV3.cxx:303
LArRodBlockAccumulatedV3::endtag
@ endtag
Definition: LArRodBlockAccumulatedV3.h:48
LArRodBlockAccumulatedV3::m_Result2Counter
int m_Result2Counter
Definition: LArRodBlockAccumulatedV3.h:98
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArRodBlockAccumulatedV3::hasRawDataBlock
virtual uint32_t hasRawDataBlock() const
Definition: LArRodBlockAccumulatedV3.h:84
LArRodBlockAccumulatedV3::getNumberOfSamples
virtual uint32_t getNumberOfSamples() const
Definition: LArRodBlockAccumulatedV3.cxx:273
LArRodBlockAccumulatedV3::ResultsOff1
@ ResultsOff1
Definition: LArRodBlockAccumulatedV3.h:34
LArRodBlockAccumulatedV3::RawDataBlkDim
@ RawDataBlkDim
Definition: LArRodBlockAccumulatedV3.h:39
LArRodBlockAccumulatedV3::NWTot_h
@ NWTot_h
Definition: LArRodBlockAccumulatedV3.h:29
LArRodBlockAccumulatedV3::FebConfig
@ FebConfig
Definition: LArRodBlockAccumulatedV3.h:45
LArRodBlockAccumulatedV3::getResults1Size
virtual uint16_t getResults1Size() const
Definition: LArRodBlockAccumulatedV3.cxx:298
LArRodBlockAccumulatedV3::getCtrl1
virtual uint16_t getCtrl1(uint32_t adc) const
Definition: LArRodBlockAccumulatedV3.cxx:331
LArRodBlockAccumulatedV3::ResultsOff2
@ ResultsOff2
Definition: LArRodBlockAccumulatedV3.h:36
LArRodBlockAccumulatedV3::ResultsDim2
@ ResultsDim2
Definition: LArRodBlockAccumulatedV3.h:37
LArRodBlockAccumulatedV3::NSamples
@ NSamples
Definition: LArRodBlockAccumulatedV3.h:43
LArRodBlockAccumulatedV3::clearBlocks
void clearBlocks()
LArRodBlockAccumulatedV3::canSetAccumulated
virtual bool canSetAccumulated()
Definition: LArRodBlockAccumulatedV3.h:112
LArRodBlockAccumulatedV3::NTrigger_h
@ NTrigger_h
Definition: LArRodBlockAccumulatedV3.h:52
LArRodBlockAccumulatedV3::InFPGAFormat
@ InFPGAFormat
Definition: LArRodBlockAccumulatedV3.h:46
LArRodBlockAccumulatedV3::FirstSampleIndex
@ FirstSampleIndex
Definition: LArRodBlockAccumulatedV3.h:44
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:113
LArRodBlockAccumulatedV3::hasControlWords
virtual uint32_t hasControlWords() const
Definition: LArRodBlockAccumulatedV3.h:85
LArRodBlockAccumulatedV3::InFPGAFormat_h
@ InFPGAFormat_h
Definition: LArRodBlockAccumulatedV3.h:47
LArRodBlockAccumulatedV3::getStatus
virtual uint32_t getStatus() const
Definition: LArRodBlockAccumulatedV3.cxx:383
LArRodBlockAccumulatedV3::getFirstSampleIndex
uint16_t getFirstSampleIndex() const
Definition: LArRodBlockAccumulatedV3.h:136
LArRodBlockAccumulatedV3::resetPointers
virtual void resetPointers()
Definition: LArRodBlockAccumulatedV3.cxx:32
LArRodBlockAccumulatedV3::m_Result1Index
int m_Result1Index
Definition: LArRodBlockAccumulatedV3.h:97
LArRodBlockAccumulatedV3
This class provides decoding/encoding from/to ROD format.
Definition: LArRodBlockAccumulatedV3.h:24
LArRodBlockAccumulatedV3::getRadd
virtual uint32_t getRadd(uint32_t adc, uint32_t sample) const
Definition: LArRodBlockAccumulatedV3.cxx:320
LArRodBlockAccumulatedV3::getCtrl3
virtual uint16_t getCtrl3(uint32_t adc) const
Definition: LArRodBlockAccumulatedV3.cxx:363
LArRodBlockAccumulatedV3::EventStatus
@ EventStatus
Definition: LArRodBlockAccumulatedV3.h:40
LArRodBlockAccumulatedV3::BlockType
std::string BlockType()
Definition: LArRodBlockAccumulatedV3.h:60
LArRodBlockAccumulatedV3::m_Result2Index
int m_Result2Index
Definition: LArRodBlockAccumulatedV3.h:99
LArRodBlockAccumulatedV3::getRawDataSize
virtual uint16_t getRawDataSize() const
Definition: LArRodBlockAccumulatedV3.cxx:308
LArRodBlockAccumulatedV3::EventStatus_h
@ EventStatus_h
Definition: LArRodBlockAccumulatedV3.h:41
LArRodBlockAccumulatedV3::m_RawDataCounter
int m_RawDataCounter
Definition: LArRodBlockAccumulatedV3.h:100
LArRodBlockAccumulatedV3::FEB_SN
@ FEB_SN
Definition: LArRodBlockAccumulatedV3.h:32
LArRodBlockAccumulatedV3::getNTrigger
uint16_t getNTrigger() const
Definition: LArRodBlockAccumulatedV3.cxx:283
LArRodBlockAccumulatedV3::getCtrl2
virtual uint16_t getCtrl2(uint32_t adc) const
Definition: LArRodBlockAccumulatedV3.cxx:347
LArRodBlockAccumulatedV3::m_fixedGain
unsigned m_fixedGain
Definition: LArRodBlockAccumulatedV3.h:103
LArRodBlockAccumulatedV3::getFebConfig
uint16_t getFebConfig() const
Definition: LArRodBlockAccumulatedV3.h:131
LArRodBlockAccumulatedV3::NGains
@ NGains
Definition: LArRodBlockAccumulatedV3.h:42
LArRodBlockAccumulatedV3::m_Result1Counter
int m_Result1Counter
Definition: LArRodBlockAccumulatedV3.h:96
LArRodBlockAccumulatedV3::getNextRawData
virtual int getNextRawData(int &channelNumber, std::vector< short > &samples, uint32_t &gain)
Definition: LArRodBlockAccumulatedV3.cxx:47
LArRodBlockStructure.h
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
LArRodBlockAccumulatedV3::NStep
@ NStep
Definition: LArRodBlockAccumulatedV3.h:54
LArRodBlockAccumulatedV3::LArRodBlockAccumulatedV3
LArRodBlockAccumulatedV3()
Definition: LArRodBlockAccumulatedV3.cxx:25
LArRodBlockAccumulatedV3::getTDCPhase
virtual uint8_t getTDCPhase() const
Definition: LArRodBlockAccumulatedV3.cxx:42
LArRodBlockAccumulatedV3::NTrigger
@ NTrigger
Definition: LArRodBlockAccumulatedV3.h:51
LArRodBlockAccumulatedV3::FEB_SN_h
@ FEB_SN_h
Definition: LArRodBlockAccumulatedV3.h:33
LArRodBlockAccumulatedV3::RawDataBlkOff
@ RawDataBlkOff
Definition: LArRodBlockAccumulatedV3.h:38
LArRodBlockAccumulatedV3::getNStep
uint16_t getNStep() const
Definition: LArRodBlockAccumulatedV3.cxx:313
LArRodBlockAccumulatedV3::ResultsDim1
@ ResultsDim1
Definition: LArRodBlockAccumulatedV3.h:35
CaloGain.h
LArRodBlockAccumulatedV3::m_RawDataIndex
int m_RawDataIndex
Definition: LArRodBlockAccumulatedV3.h:101
LArRodBlockStructure::getHeader16
uint16_t getHeader16(const unsigned n) const
Definition: LArRodBlockStructure.h:355
LArRodBlockAccumulatedV3::NWTot
@ NWTot
Definition: LArRodBlockAccumulatedV3.h:28
LArRodBlockAccumulatedV3::FEBID_h
@ FEBID_h
Definition: LArRodBlockAccumulatedV3.h:31
LArRodBlockAccumulatedV3::getNextAccumulatedDigit
virtual int getNextAccumulatedDigit(int &channelNumber, std::vector< uint64_t > &SamplesSum, std::vector< uint64_t > &corr2Sum, uint32_t &gain)
Definition: LArRodBlockAccumulatedV3.cxx:146