ATLAS Offline Software
LArRodBlockTransparentV0.h
Go to the documentation of this file.
1 //Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef LARBYTESTREAM_LARRODBLOCKTRANSPARENTV0_H
8 #define LARBYTESTREAM_LARRODBLOCKTRANSPARENTV0_H
9 
29 #include <stdint.h>
30 #include <vector>
32 
34 { // ----------------- Header words indexes -----------------
35 public:
36  enum {
37  NWTot, // First words: DSP event header
41  FEB_SN, // FEB serial number
43  RawDataBlkOffset, // Raw FEB event offset
47  endtag
48  };
49 };
50 
51 template<class DSPHEADER>
53 {
54 public:
55  // constructor
57  // ------ Identify RodBlockStructure -------
58  std::string BlockType() { return std::string("RodBlockTransparentV0");}
59  // ----------------- Encoding methods -----------------
60  // Never to be used while decoding!
61  virtual void initializeFragment(std::vector<uint32_t>& fragment);
62  virtual void initializeFEB(const uint32_t id);
63  virtual void setNumberOfSamples(const uint8_t n);
64  virtual void setNumberOfGains(const uint8_t n);
65  virtual void setTDCPhase(const uint8_t n); //useful only TB SW validation
66  virtual void setRawDataFixed(const int channel, const std::vector<short>& samples, const uint32_t gain);
67  virtual void finalizeFEB();
68  // build full ROD fragment
69  virtual void concatinateFEBs( );
70  // declare capabilities of this Rod Block Structure
71 
72  virtual bool canSetRawDataFixed() {return true;}
73  // ----------------- Decoding methods -----------------
74  // Never to be used while encoding!
75  // set full ROD fragment before trying to get anything!
76  // in case there is more than 1 FEB in 1 fragment, jump to next FEB
77  virtual uint8_t getTDCPhase() const;
78  virtual int getNextRawData(int& channelNumber, std::vector<short>& samples, uint32_t& gain);
79  virtual inline int setGain(const int GainValue); // ---------------- Define gain for decoding
80  virtual uint32_t getNumberOfSamples() const;
81  virtual uint32_t getNumberOfGains() const;
83  virtual uint16_t getCtrl1(uint32_t adc) const;
84  virtual uint16_t getCtrl2(uint32_t adc) const;
85  virtual uint16_t getCtrl3(uint32_t adc) const;
86  virtual uint32_t getStatus() const;
87 
88  // ----------------- Printing methods -----------------
89  // print the full ROD fragment
90  //virtual void dumpFragment();
91  virtual inline uint32_t hasRawDataBlock() const {return m_FebBlock[3];} ;
92  virtual inline uint32_t hasControlWords() const {return m_FebBlock[3];} ;
93 
94  private:
95  void clearBlocks();
96  virtual void resetPointers();
97  //Separated blocks for encoding
98 
99  // One raw data block per gain to start with
100  std::vector<uint32_t> m_RawDataBlock;
101  //Counter for channels inside of a FEB
104  unsigned m_BlkOffset; //Offset taken from enum
105  //For fixed gain mode
107  //FIXME, very ugly hack! See explanation in LArRodDecoder.h
108 public:
109 };
110 
111 
112 template<class DSPHEADER>
113 inline int LArRodBlockTransparentV0<DSPHEADER>::setGain(const int GainValue)
114 {//This RodBlockStructure allows only predefined gains
115  /*
116  std::cout << " Set fixed gain Value " << GainValue << std::endl;
117  std::cout << " Number of words in Gain Block " << std::endl;
118  std::cout << "\tHigh (1): " << getHeader16(NWRawData1) << std::endl;
119  std::cout << "\tMedium (2): " << getHeader16(NWRawData2) << std::endl;
120  std::cout << "\tLow (3): " << getHeader16(NWRawData3) << std::endl;
121  */
122  if (GainValue<0 || GainValue>3)
123  return 0;
124  m_fixedGain=GainValue;
125  return 1;
126 }
127 
129 
130 #endif
LArRodBlockStructure
Definition: LArRodBlockStructure.h:48
LArRodBlockHeaderTransparentV0::NGains
@ NGains
Definition: LArRodBlockTransparentV0.h:45
LArRodBlockHeaderTransparentV0::endtag
@ endtag
Definition: LArRodBlockTransparentV0.h:47
LArRodBlockTransparentV0::getCtrl1
virtual uint16_t getCtrl1(uint32_t adc) const
LArRodBlockHeaderTransparentV0::NWTot_h
@ NWTot_h
Definition: LArRodBlockTransparentV0.h:38
LArRodBlockTransparentV0::setNumberOfSamples
virtual void setNumberOfSamples(const uint8_t n)
LArRodBlockHeaderTransparentV0::NWTot
@ NWTot
Definition: LArRodBlockTransparentV0.h:37
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
LArRodBlockTransparentV0::getStatus
virtual uint32_t getStatus() const
LArRodBlockTransparentV0::m_RawDataIndex
int m_RawDataIndex
Definition: LArRodBlockTransparentV0.h:103
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LArRodBlockHeaderTransparentV0::FEBID
@ FEBID
Definition: LArRodBlockTransparentV0.h:39
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArRodBlockTransparentV0::getCtrl3
virtual uint16_t getCtrl3(uint32_t adc) const
LArRodBlockTransparentV0::getCtrl2
virtual uint16_t getCtrl2(uint32_t adc) const
LArRodBlockStructure::m_FebBlock
const uint32_t * m_FebBlock
Definition: LArRodBlockStructure.h:227
LArRodBlockTransparentV0::concatinateFEBs
virtual void concatinateFEBs()
LArRodBlockHeaderTransparentV0::FEB_SN_h
@ FEB_SN_h
Definition: LArRodBlockTransparentV0.h:42
LArRodBlockTransparentV0::setGain
virtual int setGain(const int GainValue)
Definition: LArRodBlockTransparentV0.h:113
LArRodBlockHeaderTransparentV0
This class provides decoding/encoding from/to ROD format.
Definition: LArRodBlockTransparentV0.h:34
LArRodBlockTransparentV0.icc
LArRodBlockHeaderTransparentV0::RawDataBlkOffset
@ RawDataBlkOffset
Definition: LArRodBlockTransparentV0.h:43
LArRodBlockTransparentV0::m_RawDataBlock
std::vector< uint32_t > m_RawDataBlock
Definition: LArRodBlockTransparentV0.h:100
LArRodBlockTransparentV0::setNumberOfGains
virtual void setNumberOfGains(const uint8_t n)
LArRodBlockTransparentV0::getNumberOfSamples
virtual uint32_t getNumberOfSamples() const
LArRodBlockHeaderTransparentV0::NSamples
@ NSamples
Definition: LArRodBlockTransparentV0.h:46
LArRodBlockTransparentV0::resetPointers
virtual void resetPointers()
LArRodBlockTransparentV0::canSetRawDataFixed
virtual bool canSetRawDataFixed()
Definition: LArRodBlockTransparentV0.h:72
LArRodBlockTransparentV0::m_RawDataCounter
int m_RawDataCounter
Definition: LArRodBlockTransparentV0.h:102
LArRodBlockTransparentV0::getTDCPhase
virtual uint8_t getTDCPhase() const
LArRodBlockTransparentV0::m_fixedGain
int m_fixedGain
Definition: LArRodBlockTransparentV0.h:106
LArRodBlockTransparentV0::initializeFEB
virtual void initializeFEB(const uint32_t id)
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:113
beamspotman.n
n
Definition: beamspotman.py:731
LArRodBlockTransparentV0::finalizeFEB
virtual void finalizeFEB()
LArRodBlockTransparentV0::setTDCPhase
virtual void setTDCPhase(const uint8_t n)
LArRodBlockTransparentV0::BlockType
std::string BlockType()
Definition: LArRodBlockTransparentV0.h:58
LArRodBlockTransparentV0::getNumberOfGains
virtual uint32_t getNumberOfGains() const
LArRodBlockTransparentV0::m_BlkOffset
unsigned m_BlkOffset
Definition: LArRodBlockTransparentV0.h:104
LArRodBlockTransparentV0::getRadd
virtual uint32_t getRadd(uint32_t adc, uint32_t sample) const
LArRodBlockTransparentV0::initializeFragment
virtual void initializeFragment(std::vector< uint32_t > &fragment)
LArRodBlockHeaderTransparentV0::FEBID_h
@ FEBID_h
Definition: LArRodBlockTransparentV0.h:40
LArRodBlockStructure.h
LArRodBlockTransparentV0::hasRawDataBlock
virtual uint32_t hasRawDataBlock() const
Definition: LArRodBlockTransparentV0.h:91
LArRodBlockTransparentV0::getNextRawData
virtual int getNextRawData(int &channelNumber, std::vector< short > &samples, uint32_t &gain)
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
LArRodBlockTransparentV0::setRawDataFixed
virtual void setRawDataFixed(const int channel, const std::vector< short > &samples, const uint32_t gain)
LArRodBlockTransparentV0::clearBlocks
void clearBlocks()
LArRodBlockTransparentV0
Definition: LArRodBlockTransparentV0.h:53
LArRodBlockHeaderTransparentV0::FEB_SN
@ FEB_SN
Definition: LArRodBlockTransparentV0.h:41
LArRodBlockTransparentV0::hasControlWords
virtual uint32_t hasControlWords() const
Definition: LArRodBlockTransparentV0.h:92
LArRodBlockHeaderTransparentV0::RawDataBlkOffset_h
@ RawDataBlkOffset_h
Definition: LArRodBlockTransparentV0.h:44
LArRodBlockTransparentV0::LArRodBlockTransparentV0
LArRodBlockTransparentV0()