ATLAS Offline Software
LArRodBlockCalibrationV2.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_LARRODBLOCKCALIBRATIONV2_H
8 #define LARBYTESTREAM_LARRODBLOCKCALIBRATIONV2_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 (Calibration 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  };
49  enum{
52  Dac,
74  endtag //This tag needs to be an odd number, see *) for constructor
75  };
76  // constructor
78 
79  // ------ Identify RodBlockStructure -------
80  std::string BlockType() { return std::string("RodBlockCalibrationV2");}
81  public:
82  //void dumpFragment() { dumpFragment(m_FebBlock); }
83  // ----------------- Encoding methods -----------------
84  // Never to be used while decoding!
85  // ----------------- Decoding methods -----------------
86  // Never to be used while encoding!
87  // set full ROD fragment before trying to get anything!
88  // in case there is more than 1 FEB in 1 fragment, jump to next FEB
89  virtual uint8_t getTDCPhase() const;
90  virtual int getNextRawData(int& channelNumber, std::vector<short>& samples, uint32_t& gain);
92  virtual int getNextAccumulatedCalibDigit(int& channelNumber, std::vector< std::vector < uint32_t > >& samplesSum, std::vector< std::vector < uint32_t > >& samples2Sum, uint32_t& iStepTrigger, uint32_t& gain);
93  virtual uint32_t getNumberOfSamples() const;
94  virtual uint32_t getNumberOfGains() const;
95  virtual uint32_t getRadd(uint32_t adc, uint32_t sample) const;
96  virtual uint16_t getCtrl1(uint32_t adc) const;
97  virtual uint16_t getCtrl2(uint32_t adc) const;
98  virtual uint16_t getCtrl3(uint32_t adc) const;
99  virtual uint32_t getStatus() const;
100 
101  virtual inline uint32_t hasCalibBlock() const {return getHeader16(ResultsOff1);} ;
102  virtual inline uint32_t hasPhysicsBlock() const {return getHeader16(ResultsOff2);} ;
103  virtual inline uint32_t hasRawDataBlock() const {return getHeader16(RawDataBlkOff);} ;
104  virtual inline uint32_t hasControlWords() const {return getHeader16(RawDataBlkOff);} ;
105 
106  // ----------------- Printing methods -----------------
107  // print the full ROD fragment
108  //virtual void dumpFragment();
109 private:
110  void clearBlocks();
111  virtual void resetPointers();
112  //Separated blocks for encoding
113 
114  // One raw data block per gain to start with
115  std::vector<uint32_t> m_RawDataBlock;
116  //Counter for channels inside of a FEB
118  int m_Result1Index = 0;
120  int m_Result2Index = 0;
122  int m_RawDataIndex = 0;
123  //For fixed gain mode
125  //FIXME, very ugly hack! See explanation in LArRodDecoder.h
126 public:
127  inline uint16_t getNTrigger() const;
128  inline uint16_t getDAC() const;
129  inline uint16_t getDelay() const;
130  inline uint32_t getFebConfig() const;
131  inline bool getPulsed(const unsigned channelNumber) const;
132 
133  virtual bool canSetCalibration() {return false;}
134 };
135 
136 
138 {
139  return getHeader32(FebConfig);
140 }
141 
142 inline bool LArRodBlockCalibrationV2::getPulsed(const unsigned channelNumber) const
143 {
145  //std::cout << " ===> in getPulsed " << std::hex << (m_FebBlock[index+IsPulsed/2]) << " " << (m_FebBlock[index+(IsPulsed/2+1)]) << " " << (m_FebBlock[index+(IsPulsed/2+2)]) << " " << (m_FebBlock[index+(IsPulsed/2+3)]) << " " << std::dec << channelNumber << " i=" << i << " ii=" << ii << std::endl;
146  return getBit(m_FebBlock+index+IsPulsed/2,channelNumber);
147 }
148 
149 
150 
151 #endif
LArRodBlockStructure
Definition: LArRodBlockStructure.h:48
LArRodBlockCalibrationV2::RawDataBlkDim
@ RawDataBlkDim
Definition: LArRodBlockCalibrationV2.h:39
LArRodBlockCalibrationV2::IsPulsed1
@ IsPulsed1
Definition: LArRodBlockCalibrationV2.h:57
LArRodBlockCalibrationV2::getTDCPhase
virtual uint8_t getTDCPhase() const
Definition: LArRodBlockCalibrationV2.cxx:50
LArRodBlockCalibrationV2::EventStatus
@ EventStatus
Definition: LArRodBlockCalibrationV2.h:40
LArRodBlockCalibrationV2::FebConfig_h
@ FebConfig_h
Definition: LArRodBlockCalibrationV2.h:45
LArRodBlockCalibrationV2::InFPGAFormat_h
@ InFPGAFormat_h
Definition: LArRodBlockCalibrationV2.h:47
LArRodBlockCalibrationV2::IsPulsed6
@ IsPulsed6
Definition: LArRodBlockCalibrationV2.h:62
LArRodBlockCalibrationV2::getNTrigger
uint16_t getNTrigger() const
Definition: LArRodBlockCalibrationV2.cxx:280
LArRodBlockCalibrationV2::IsPulsed3
@ IsPulsed3
Definition: LArRodBlockCalibrationV2.h:59
LArRodBlockCalibrationV2::getNextAccumulatedCalibDigit
virtual int getNextAccumulatedCalibDigit(int &channelNumber, std::vector< std::vector< uint32_t > > &samplesSum, std::vector< std::vector< uint32_t > > &samples2Sum, uint32_t &iStepTrigger, uint32_t &gain)
Definition: LArRodBlockCalibrationV2.cxx:149
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
LArRodBlockCalibrationV2::LArRodBlockCalibrationV2
LArRodBlockCalibrationV2()
Definition: LArRodBlockCalibrationV2.cxx:25
LArRodBlockCalibrationV2::IsPulsed2
@ IsPulsed2
Definition: LArRodBlockCalibrationV2.h:58
LArRodBlockCalibrationV2::feb_ssw3
@ feb_ssw3
Definition: LArRodBlockCalibrationV2.h:69
LArRodBlockCalibrationV2::FEBID_h
@ FEBID_h
Definition: LArRodBlockCalibrationV2.h:31
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
index
Definition: index.py:1
LArRodBlockCalibrationV2::resetPointers
virtual void resetPointers()
Definition: LArRodBlockCalibrationV2.cxx:38
LArRodBlockCalibrationV2::ResultsOff1
@ ResultsOff1
Definition: LArRodBlockCalibrationV2.h:34
LArRodBlockCalibrationV2::feb_ssw1
@ feb_ssw1
Definition: LArRodBlockCalibrationV2.h:67
LArRodBlockCalibrationV2::m_Result1Index
int m_Result1Index
Definition: LArRodBlockCalibrationV2.h:118
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArRodBlockCalibrationV2::feb_ssw7
@ feb_ssw7
Definition: LArRodBlockCalibrationV2.h:73
LArRodBlockCalibrationV2::ResultsOff2
@ ResultsOff2
Definition: LArRodBlockCalibrationV2.h:36
LArRodBlockCalibrationV2::getFebConfig
uint32_t getFebConfig() const
Definition: LArRodBlockCalibrationV2.h:137
LArRodBlockCalibrationV2::IsPulsed5
@ IsPulsed5
Definition: LArRodBlockCalibrationV2.h:61
LArRodBlockCalibrationV2
This class provides decoding/encoding from/to ROD format.
Definition: LArRodBlockCalibrationV2.h:24
LArRodBlockStructure::m_FebBlock
const uint32_t * m_FebBlock
Definition: LArRodBlockStructure.h:227
LArRodBlockCalibrationV2::getNumberOfGains
virtual uint32_t getNumberOfGains() const
Definition: LArRodBlockCalibrationV2.cxx:275
LArRodBlockCalibrationV2::feb_ssw4
@ feb_ssw4
Definition: LArRodBlockCalibrationV2.h:70
LArRodBlockCalibrationV2::RawDataBlkOff
@ RawDataBlkOff
Definition: LArRodBlockCalibrationV2.h:38
LArRodBlockCalibrationV2::getRadd
virtual uint32_t getRadd(uint32_t adc, uint32_t sample) const
Definition: LArRodBlockCalibrationV2.cxx:309
LArRodBlockCalibrationV2::NTrigger
@ NTrigger
Definition: LArRodBlockCalibrationV2.h:50
LArRodBlockCalibrationV2::m_Result2Counter
int m_Result2Counter
Definition: LArRodBlockCalibrationV2.h:119
LArRodBlockCalibrationV2::getDelay
uint16_t getDelay() const
Definition: LArRodBlockCalibrationV2.cxx:295
LArRodBlockCalibrationV2::ResultsDim2
@ ResultsDim2
Definition: LArRodBlockCalibrationV2.h:37
LArRodBlockCalibrationV2::IsPulsed7
@ IsPulsed7
Definition: LArRodBlockCalibrationV2.h:63
LArRodBlockCalibrationV2::feb_ssw
@ feb_ssw
Definition: LArRodBlockCalibrationV2.h:66
LArRodBlockStructure::getHeader32
uint32_t getHeader32(const unsigned n) const
Definition: LArRodBlockStructure.h:365
LArRodBlockCalibrationV2::Dac_h
@ Dac_h
Definition: LArRodBlockCalibrationV2.h:53
LArRodBlockCalibrationV2::getCtrl3
virtual uint16_t getCtrl3(uint32_t adc) const
Definition: LArRodBlockCalibrationV2.cxx:352
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:113
LArRodBlockCalibrationV2::m_RawDataBlock
std::vector< uint32_t > m_RawDataBlock
Definition: LArRodBlockCalibrationV2.h:115
LArRodBlockCalibrationV2::m_Result2Index
int m_Result2Index
Definition: LArRodBlockCalibrationV2.h:120
LArRodBlockCalibrationV2::BlockType
std::string BlockType()
Definition: LArRodBlockCalibrationV2.h:80
LArRodBlockCalibrationV2::IsPulsed4
@ IsPulsed4
Definition: LArRodBlockCalibrationV2.h:60
LArRodBlockCalibrationV2::getNextRawData
virtual int getNextRawData(int &channelNumber, std::vector< short > &samples, uint32_t &gain)
Definition: LArRodBlockCalibrationV2.cxx:58
LArRodBlockCalibrationV2::EventStatus_h
@ EventStatus_h
Definition: LArRodBlockCalibrationV2.h:41
LArRodBlockCalibrationV2::endtag
@ endtag
Definition: LArRodBlockCalibrationV2.h:74
LArRodBlockStructure::getBit
int getBit(const uint32_t *const p, const unsigned chan) const
Definition: LArRodBlockStructure.h:433
LArRodBlockCalibrationV2::hasCalibBlock
virtual uint32_t hasCalibBlock() const
Definition: LArRodBlockCalibrationV2.h:101
LArRodBlockCalibrationV2::getStatus
virtual uint32_t getStatus() const
Definition: LArRodBlockCalibrationV2.cxx:372
LArRodBlockCalibrationV2::NWTot
@ NWTot
Definition: LArRodBlockCalibrationV2.h:28
LArRodBlockCalibrationV2::feb_ssw6
@ feb_ssw6
Definition: LArRodBlockCalibrationV2.h:72
LArRodBlockCalibrationV2::ResultsDim1
@ ResultsDim1
Definition: LArRodBlockCalibrationV2.h:35
LArRodBlockCalibrationV2::Dac
@ Dac
Definition: LArRodBlockCalibrationV2.h:52
LArRodBlockCalibrationV2::getDAC
uint16_t getDAC() const
Definition: LArRodBlockCalibrationV2.cxx:288
LArRodBlockStructure.h
LArRodBlockCalibrationV2::FEB_SN
@ FEB_SN
Definition: LArRodBlockCalibrationV2.h:32
LArRodBlockCalibrationV2::StepIndex_h
@ StepIndex_h
Definition: LArRodBlockCalibrationV2.h:65
LArRodBlockCalibrationV2::FebConfig
@ FebConfig
Definition: LArRodBlockCalibrationV2.h:44
LArRodBlockCalibrationV2::m_RawDataIndex
int m_RawDataIndex
Definition: LArRodBlockCalibrationV2.h:122
LArRodBlockCalibrationV2::feb_ssw2
@ feb_ssw2
Definition: LArRodBlockCalibrationV2.h:68
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
LArRodBlockCalibrationV2::Delay_h
@ Delay_h
Definition: LArRodBlockCalibrationV2.h:55
LArRodBlockCalibrationV2::m_Result1Counter
int m_Result1Counter
Definition: LArRodBlockCalibrationV2.h:117
LArRodBlockCalibrationV2::NSamples
@ NSamples
Definition: LArRodBlockCalibrationV2.h:43
LArRodBlockCalibrationV2::FEBID
@ FEBID
Definition: LArRodBlockCalibrationV2.h:30
LArRodBlockCalibrationV2::StepIndex
@ StepIndex
Definition: LArRodBlockCalibrationV2.h:64
LArRodBlockCalibrationV2::NTrigger_h
@ NTrigger_h
Definition: LArRodBlockCalibrationV2.h:51
LArRodBlockCalibrationV2::getCtrl2
virtual uint16_t getCtrl2(uint32_t adc) const
Definition: LArRodBlockCalibrationV2.cxx:336
LArRodBlockCalibrationV2::Delay
@ Delay
Definition: LArRodBlockCalibrationV2.h:54
LArRodBlockStructure::getNextAccumulatedCalibDigit
virtual int getNextAccumulatedCalibDigit(int &channelNumber, std::vector< uint64_t > &SamplesSum, std::vector< uint64_t > &Samples2Sum, uint32_t &nStepTriggers, uint32_t &gain)
Definition: LArRodBlockStructure.cxx:94
LArRodBlockCalibrationV2::getPulsed
bool getPulsed(const unsigned channelNumber) const
Definition: LArRodBlockCalibrationV2.h:142
LArRodBlockCalibrationV2::canSetCalibration
virtual bool canSetCalibration()
Definition: LArRodBlockCalibrationV2.h:133
LArRodBlockCalibrationV2::hasRawDataBlock
virtual uint32_t hasRawDataBlock() const
Definition: LArRodBlockCalibrationV2.h:103
LArRodBlockCalibrationV2::hasPhysicsBlock
virtual uint32_t hasPhysicsBlock() const
Definition: LArRodBlockCalibrationV2.h:102
LArRodBlockCalibrationV2::getNumberOfSamples
virtual uint32_t getNumberOfSamples() const
Definition: LArRodBlockCalibrationV2.cxx:270
LArRodBlockCalibrationV2::getCtrl1
virtual uint16_t getCtrl1(uint32_t adc) const
Definition: LArRodBlockCalibrationV2.cxx:320
CaloGain.h
LArRodBlockCalibrationV2::feb_ssw5
@ feb_ssw5
Definition: LArRodBlockCalibrationV2.h:71
LArRodBlockCalibrationV2::NGains
@ NGains
Definition: LArRodBlockCalibrationV2.h:42
LArRodBlockCalibrationV2::NWTot_h
@ NWTot_h
Definition: LArRodBlockCalibrationV2.h:29
LArRodBlockCalibrationV2::FEB_SN_h
@ FEB_SN_h
Definition: LArRodBlockCalibrationV2.h:33
LArRodBlockStructure::getHeader16
uint16_t getHeader16(const unsigned n) const
Definition: LArRodBlockStructure.h:355
LArRodBlockCalibrationV2::clearBlocks
void clearBlocks()
Definition: LArRodBlockCalibrationV2.cxx:33
LArRodBlockCalibrationV2::hasControlWords
virtual uint32_t hasControlWords() const
Definition: LArRodBlockCalibrationV2.h:104
LArRodBlockCalibrationV2::IsPulsed
@ IsPulsed
Definition: LArRodBlockCalibrationV2.h:56
LArRodBlockCalibrationV2::m_RawDataCounter
int m_RawDataCounter
Definition: LArRodBlockCalibrationV2.h:121
LArRodBlockCalibrationV2::m_fixedGain
int m_fixedGain
Definition: LArRodBlockCalibrationV2.h:124
LArRodBlockCalibrationV2::InFPGAFormat
@ InFPGAFormat
Definition: LArRodBlockCalibrationV2.h:46