ATLAS Offline Software
LArRodBlockCalibrationV0.h
Go to the documentation of this file.
1 //Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef LARBYTESTREAM_LARRODBLOCKCALIBRATIONV0_H
8 #define LARBYTESTREAM_LARRODBLOCKCALIBRATIONV0_H
9 
21 
23 {
24  public:
25  // ----------------- Header words indexes -----------------
26  enum {
27  NWTot, // First words: DSP event header
31  FEB_SN, // FEB serial number
32  FEB_SN_h, // FEB serial number
33  RawDataBlkOffset, // Raw FEB event offset
37  Dac,
47  endtag //This tag needs to be an odd number, see *) for constructor
48  };
49 };
50 
51 template<class DSPHEADER>
53 {
54 public:
55  // constructor
57  {};
58 
59  public:
60  //void dumpFragment() { dumpFragment(m_FebBlock); }
61  // ----------------- Encoding methods -----------------
62  virtual void setDAC(const uint16_t DacValue);
63  virtual void setDelay(const uint16_t delayValue);
64  virtual void setPulsed(const unsigned channelNumber);
65  // ----------------- Decoding methods -----------------
66  inline uint16_t getDAC() const;
67  inline uint16_t getDelay() const;
68  inline bool getPulsed(const unsigned channelNumber) const;
69 
70  virtual inline uint32_t hasRawDataBlock() const {return 1;}
71 
72  virtual bool canSetCalibration() {return true;}
73 };
74 
75 template<class DSPHEADER>
77 {
78  return this->getHeader16(DSPHEADER::Dac);
79 }
80 
81 template<class DSPHEADER>
83 {
84  return this->getHeader16(DSPHEADER::Delay);
85 }
86 
87 template<class DSPHEADER>
88 inline bool LArRodBlockCalibrationV0<DSPHEADER>::getPulsed(const unsigned channelNumber) const
89 {return this->getBit(this->m_FebBlock+(DSPHEADER::IsPulsed/2),channelNumber);}
90 
91 
92 template<class DSPHEADER>
94 {this->setHeader16(DSPHEADER::Delay,delayValue);}
95 
96 template<class DSPHEADER>
98 {this->setHeader16(DSPHEADER::Dac,dacValue);
99 //std::cout << "Set DAC-Value to " << dacValue << std::endl;
100 }
101 
102 
103 template<class DSPHEADER>
104 inline void LArRodBlockCalibrationV0<DSPHEADER>::setPulsed(const unsigned channelNumber)
105 {
106 #ifdef LARBYTESTREAMRODBLOCK_CHCKBOUNDARIES
107  if (channelNumber>=128) {
108  std::cout << "Error WRITE BEYOND ARRAY BONDARY!" << std::endl;
109  std::abort();
110  }
111 #endif
112  this->setBit((uint32_t*) (&(this->m_vFragment->front())+(DSPHEADER::IsPulsed/2)),channelNumber);
113 }
114 
115 #endif
LArRodBlockHeaderCalibrationV0
This class provides decoding/encoding from/to ROD format.
Definition: LArRodBlockCalibrationV0.h:23
LArRodBlockCalibrationV0::LArRodBlockCalibrationV0
LArRodBlockCalibrationV0()
Definition: LArRodBlockCalibrationV0.h:56
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LArRodBlockHeaderCalibrationV0::FEB_SN
@ FEB_SN
Definition: LArRodBlockCalibrationV0.h:31
LArRodBlockHeaderCalibrationV0::NWTot
@ NWTot
Definition: LArRodBlockCalibrationV0.h:27
LArRodBlockCalibrationV0::setPulsed
virtual void setPulsed(const unsigned channelNumber)
Definition: LArRodBlockCalibrationV0.h:104
LArRodBlockHeaderCalibrationV0::NWTot_h
@ NWTot_h
Definition: LArRodBlockCalibrationV0.h:28
LArRodBlockCalibrationV0::hasRawDataBlock
virtual uint32_t hasRawDataBlock() const
Definition: LArRodBlockCalibrationV0.h:70
LArRodBlockCalibrationV0::getPulsed
bool getPulsed(const unsigned channelNumber) const
Definition: LArRodBlockCalibrationV0.h:88
LArRodBlockHeaderCalibrationV0::IsPulsed2
@ IsPulsed2
Definition: LArRodBlockCalibrationV0.h:41
LArRodBlockHeaderCalibrationV0::endtag
@ endtag
Definition: LArRodBlockCalibrationV0.h:47
LArRodBlockHeaderCalibrationV0::NSamples
@ NSamples
Definition: LArRodBlockCalibrationV0.h:36
LArRodBlockCalibrationV0::setDAC
virtual void setDAC(const uint16_t DacValue)
Definition: LArRodBlockCalibrationV0.h:97
LArRodBlockHeaderCalibrationV0::IsPulsed5
@ IsPulsed5
Definition: LArRodBlockCalibrationV0.h:44
LArRodBlockHeaderCalibrationV0::RawDataBlkOffset
@ RawDataBlkOffset
Definition: LArRodBlockCalibrationV0.h:33
LArRodBlockHeaderCalibrationV0::Dac
@ Dac
Definition: LArRodBlockCalibrationV0.h:37
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
LArRodBlockCalibrationV0::setDelay
virtual void setDelay(const uint16_t delayValue)
Definition: LArRodBlockCalibrationV0.h:93
LArRodBlockHeaderCalibrationV0::FEBID
@ FEBID
Definition: LArRodBlockCalibrationV0.h:29
LArRodBlockHeaderCalibrationV0::RawDataBlkOffset_h
@ RawDataBlkOffset_h
Definition: LArRodBlockCalibrationV0.h:34
LArRodBlockHeaderCalibrationV0::FEB_SN_h
@ FEB_SN_h
Definition: LArRodBlockCalibrationV0.h:32
LArRodBlockHeaderCalibrationV0::IsPulsed4
@ IsPulsed4
Definition: LArRodBlockCalibrationV0.h:43
LArRodBlockHeaderCalibrationV0::IsPulsed3
@ IsPulsed3
Definition: LArRodBlockCalibrationV0.h:42
LArRodBlockHeaderCalibrationV0::IsPulsed7
@ IsPulsed7
Definition: LArRodBlockCalibrationV0.h:46
LArRodBlockTransparentV0.h
LArRodBlockHeaderCalibrationV0::IsPulsed6
@ IsPulsed6
Definition: LArRodBlockCalibrationV0.h:45
LArRodBlockHeaderCalibrationV0::IsPulsed
@ IsPulsed
Definition: LArRodBlockCalibrationV0.h:39
LArRodBlockCalibrationV0
Definition: LArRodBlockCalibrationV0.h:53
LArRodBlockHeaderCalibrationV0::Delay
@ Delay
Definition: LArRodBlockCalibrationV0.h:38
LArRodBlockTransparentV0
Definition: LArRodBlockTransparentV0.h:53
LArRodBlockHeaderCalibrationV0::IsPulsed1
@ IsPulsed1
Definition: LArRodBlockCalibrationV0.h:40
LArRodBlockCalibrationV0::getDelay
uint16_t getDelay() const
Definition: LArRodBlockCalibrationV0.h:82
LArRodBlockCalibrationV0::canSetCalibration
virtual bool canSetCalibration()
Definition: LArRodBlockCalibrationV0.h:72
LArRodBlockHeaderCalibrationV0::NGains
@ NGains
Definition: LArRodBlockCalibrationV0.h:35
LArRodBlockHeaderCalibrationV0::FEBID_h
@ FEBID_h
Definition: LArRodBlockCalibrationV0.h:30
LArRodBlockCalibrationV0::getDAC
uint16_t getDAC() const
Definition: LArRodBlockCalibrationV0.h:76