ATLAS Offline Software
LArRodBlockStructure.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Implementation of LArRODBlockStructure class
6 
7 #include <cstdio>
8 #include <iostream>
11 #include "LArRawEvent/LArDigit.h"
15 
16 //uint32_t LArRodBlockStructure::FebToOfflineGainMap[3]={2,1,0};
17 //uint32_t LArRodBlockStructure::OfflineToFebGainMap[3]={2,1,0};
18 // uint32_t LArRodBlockStructure::m_RawToOfflineGainMap[4]={0, 0, 1,2};
19 // uint32_t LArRodBlockStructure::m_OfflineToRawGainMap[3]={1,2,3};
23  : m_Ex(0),
24  m_Ey(0),
25  m_Ez(0),
26  m_SumE(0),
27  m_iHeadBlockSize(0),
28  m_error_next_feb(false),
29  m_virtualROBJump(0),
30  m_ROB_to_decode(0)
31 {
32 
33  m_channelsPerFEB=128;
36  m_RodBlock=NULL;
37  m_FebBlock=NULL;
40 #ifndef NDEBUG
41  m_numberOfEx=0;
42  m_numberOfEy=0;
43  m_numberOfEz=0;
45 #endif
46  m_pRODblock=NULL;
47  m_vFragment=NULL;
50 }
51 
53 {
54 }
55 
56 //Error reporting for not implemented methods
58 {
59  std::cout << "Error: Function setDAC not implemented in this instance of LArRodBlockStructure!\n";
60  return;
61 }
62 
64 {
65  std::cout << "Error: Function setDelay not implemented in this instance of LArRodBlockStructure!\n";
66  return;
67 }
68 
69 void LArRodBlockStructure::setPulsed (const unsigned)
70 {
71  std::cout << "Error: Function setPulsed not implemented in this instance of LArRodBlockStructure!\n";
72  return;
73 }
74 
76 {
77  std::cout << "Error: Function setNTrigger not implemented in this instance of LArRodBlockStructure!\n";
78  return;
79 }
80 
82 {
83  std::cout << "Error: Function concatinateFEBs not implemented in this instance of LArRodBlockStructure!\n";
84  return;
85 }
86 
87 
88 int LArRodBlockStructure::getNextRawData(int&, std::vector<short>&, uint32_t&)
89 {
90  std::cout << "Error: Function getNextRawData not implemented in this instance of LArRodBlockStructure!\n";
91  return 0;
92 }
93 
94 int LArRodBlockStructure::getNextAccumulatedCalibDigit(int&, std::vector < uint64_t >&, std::vector < uint64_t >& , uint32_t&, uint32_t&)
95 {
96  std::cout << "Error: Function getNextAccumulatedCalibDigit not implemented in this instance of LArRodBlockStructure!\n";
97  return 0;
98 }
99 
100 int LArRodBlockStructure::getNextAccumulatedDigit(int&, std::vector<uint64_t>&, std::vector < uint64_t >& , uint32_t&)
101 {
102  std::cout << "Error: Function getNextAccumulatedDigit not implemented in this instance of LArRodBlockStructure!\n";
103  return 0;
104 }
105 
106 void LArRodBlockStructure::setNextEnergy(const int, const int32_t, const int32_t, const int32_t, const uint32_t)
107 {
108  std::cout << "Error: Function setNextEnergy not implemented in this instance of LArRodBlockStructure!\n";
109  return;
110 }
111 
112 
113 void LArRodBlockStructure::setRawData(const int , const std::vector<short>& , const uint32_t)
114 {
115  std::cout << "Error: Function setRawData not implemented in this instance of LArRodBlockStructure!\n";
116  return;
117 }
118 
119 
120 void LArRodBlockStructure::setEtQ(const int, const int32_t, const int32_t, const int32_t, const uint32_t)
121 {
122  std::cout << "Error: Function setEtQ not implemented in this instance of LArRodBlockStructure!\n";
123  return;
124 }
125 
126 void LArRodBlockStructure::setRawDataFixed(const int , const std::vector<short>&, const uint32_t )
127 {
128  std::cout << "Error: Function setRawDataFixed not implemented in this instance of LArRodBlockStructure!\n";
129  return;
130 }
131 
133 {
134  std::cout << "Error: Function setNumberOfSamples not implemented in this instance of LArRodBlockStructure!\n";
135  return;
136 }
137 
139 {
140  std::cout << "Error: Function setNumberOfGains not implemented in this instance of LArRodBlockStructure!\n";
141  return;
142 }
143 
145 {
146  std::cout << "Error: Function setTDCPhase not implemented in this instance of LArRodBlockStructure!\n";
147  return;
148 }
150 {
151  std::cout << "Error: Function getTDCPhase not implemented in this instance of LArRodBlockStructure!\n";
152  return 0;
153 }
154 
156 {
157  int offset = getNumberOfWords()-1;
158  if(offset>=m_FebBlockSize) return 0;
159  if(offset<0) return 0;
160  return m_FebBlock[offset];
161 }
162 
164 {
165  int end = getNumberOfWords()-3;
166  int start = 1;
167  uint32_t sum = 0;
169  for(int i=start;i<end;i++) {
170  sum += m_FebBlock[i];
171  }
172  return sum & 0x7fffffff;
173 }
174 
176 {
177  std::cout << "Error: Function dumpFragment() not implemented in this instance of LArRodBlockStructure!\n";
178  return;
179 }
180 
181 
183 {
184  std::cout << "Error: Function initializeFEB not implemented in this instance of LArRodBlockStructure!\n";
185  return;
186 }
187 
188 void LArRodBlockStructure::initializeFragment(std::vector<uint32_t>& )
189 {
190  std::cout << "Error: Function initializeFragment not implemented in this instance of LArRodBlockStructure!\n";
191  return;
192 }
193 
195 {
196  std::cout << "Error: Function finalizeFEB not implemented in this instance of LArRodBlockStructure!\n";
197  return;
198 }
199 
200 void LArRodBlockStructure::setEx(const double)
201 {
202  // Do not set anything
203  return;
204 }
205 
206 void LArRodBlockStructure::setEy(const double)
207 {
208  // Do not set anything
209  return;
210 }
211 
212 void LArRodBlockStructure::setEz(const double)
213 {
214  // Do not set anything
215  return;
216 }
217 
219 {
220  // Do not set anything
221  return;
222 }
223 
225 {
226  return 1;
227 }
228 
229 //Default instances of sort-method. Default is to leave things unsorted.
230 void LArRodBlockStructure::sortDataVector(std::vector<const LArRawChannel*>& )
231 {return;}
232 
233 void LArRodBlockStructure::sortDataVector( std::vector<const LArDigit*>& )
234 {return;}
235 
236 void LArRodBlockStructure::sortDataVector( std::vector<const LArCalibDigit*>& )
237 {return;}
238 
239 void LArRodBlockStructure::sortDataVector( std::vector<const LArAccumulatedCalibDigit*>& )
240 {return;}
241 
242 void LArRodBlockStructure::sortDataVector( std::vector<const LArAccumulatedDigit*>& )
243 {return;}
244 
247 uint32_t LArRodBlockStructure::getRadd(uint32_t /*adc*/, uint32_t /*sample*/) const { return 0; }
257 
259 {
260  int i=getNumberOfWords()-2;
261  return m_FebBlock[i];
262 }
263 
265 {
266  int i=getNumberOfWords()-1;
267  return m_FebBlock[i];
268 }
LArRodBlockStructure::setNTrigger
virtual void setNTrigger(const uint16_t NTrigger)
Definition: LArRodBlockStructure.cxx:75
LArRodBlockStructure::getNbSweetCells1
virtual uint16_t getNbSweetCells1() const
Definition: LArRodBlockStructure.cxx:255
LArRodBlockStructure::getNumberOfSamples
virtual uint32_t getNumberOfSamples() const
Definition: LArRodBlockStructure.cxx:245
LArRodBlockStructure::getRadd
virtual uint32_t getRadd(uint32_t adc, uint32_t sample) const
Definition: LArRodBlockStructure.cxx:247
LArRodBlockStructure::m_vFragment
std::vector< uint32_t > * m_vFragment
Definition: LArRodBlockStructure.h:231
LArRodBlockStructure::setEz
virtual void setEz(double)
Definition: LArRodBlockStructure.cxx:212
LArRodBlockStructure::setGain
virtual int setGain(const int GainValue)
Definition: LArRodBlockStructure.cxx:224
LArRodBlockStructure::getNbSweetCells2
virtual uint16_t getNbSweetCells2() const
Definition: LArRodBlockStructure.cxx:256
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
LArRodBlockStructure::getNextAccumulatedDigit
virtual int getNextAccumulatedDigit(int &channelNumber, std::vector< uint64_t > &SamplesSum, std::vector< uint64_t > &corr2Sum, uint32_t &gain)
Definition: LArRodBlockStructure.cxx:100
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LArRodBlockStructure::LArRodBlockStructure
LArRodBlockStructure()
Definition: LArRodBlockStructure.cxx:22
LArRodBlockStructure::getNumberOfWords
uint32_t getNumberOfWords() const
Definition: LArRodBlockStructure.h:428
LArRodBlockStructure::m_FebBlockSize
int32_t m_FebBlockSize
Definition: LArRodBlockStructure.h:229
LArRodBlockStructure::setNextEnergy
virtual void setNextEnergy(const int channel, const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
Definition: LArRodBlockStructure.cxx:106
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
LArRodBlockStructure::setTDCPhase
virtual void setTDCPhase(const uint8_t n)
Definition: LArRodBlockStructure.cxx:144
LArRodBlockStructure::getRawDataSize
virtual uint16_t getRawDataSize() const
Definition: LArRodBlockStructure.cxx:254
LArRodBlockStructure::concatinateFEBs
virtual void concatinateFEBs()
Definition: LArRodBlockStructure.cxx:81
LArRodBlockStructure::setPulsed
virtual void setPulsed(const unsigned channelNumber)
Definition: LArRodBlockStructure.cxx:69
LArRodBlockStructure::m_FebBlock
const uint32_t * m_FebBlock
Definition: LArRodBlockStructure.h:227
LArAccumulatedDigit.h
LArRodBlockStructure::setEy
virtual void setEy(double)
Definition: LArRodBlockStructure.cxx:206
LArRodBlockStructure::m_pRODblock
std::vector< uint32_t > * m_pRODblock
Definition: LArRodBlockStructure.h:232
LArRodBlockStructure::getCtrl2
virtual uint16_t getCtrl2(uint32_t adc) const
Definition: LArRodBlockStructure.cxx:249
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
LArRodBlockStructure::offlineCheckSum
virtual uint32_t offlineCheckSum() const
Definition: LArRodBlockStructure.cxx:163
LArRodBlockStructure::getDspCodeVersion
virtual uint32_t getDspCodeVersion() const
Definition: LArRodBlockStructure.cxx:258
LArCalibDigit.h
LArRodBlockStructure::dumpFragment
virtual void dumpFragment()
Definition: LArRodBlockStructure.cxx:175
LArRodBlockStructure::m_rearrangeFirstSample
unsigned int m_rearrangeFirstSample
Definition: LArRodBlockStructure.h:241
LArRodBlockStructure::m_numberOfSumE
uint32_t m_numberOfSumE
Definition: LArRodBlockStructure.h:217
LArRodBlockStructure::setDAC
virtual void setDAC(const uint16_t DACValue)
Definition: LArRodBlockStructure.cxx:57
LArRodBlockStructure::initializeFragment
virtual void initializeFragment(std::vector< uint32_t > &fragment)
Definition: LArRodBlockStructure.cxx:188
LArRodBlockStructure::getDspEventCounter
virtual int32_t getDspEventCounter() const
Definition: LArRodBlockStructure.cxx:264
LArDigit.h
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArRodBlockStructure::finalizeFEB
virtual void finalizeFEB()
Definition: LArRodBlockStructure.cxx:194
LArRodBlockStructure::setEtQ
virtual void setEtQ(const int channel, const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
Definition: LArRodBlockStructure.cxx:120
LArRodBlockStructure::setNumberOfSamples
virtual void setNumberOfSamples(const uint8_t n)
Definition: LArRodBlockStructure.cxx:132
LArRodBlockStructure::m_virtualROBPointerLocal
const uint32_t * m_virtualROBPointerLocal
Definition: LArRodBlockStructure.h:248
LArRodBlockStructure::setSumE
virtual void setSumE(double)
Definition: LArRodBlockStructure.cxx:218
LArRodBlockStructure::m_RawToOfflineGainMap
static const uint32_t m_RawToOfflineGainMap[4]
Definition: LArRodBlockStructure.h:237
LArRodBlockStructure::m_numberOfEx
uint32_t m_numberOfEx
Definition: LArRodBlockStructure.h:214
LArAccumulatedCalibDigit.h
LArRawChannel.h
LArRodBlockStructure::~LArRodBlockStructure
virtual ~LArRodBlockStructure()
Definition: LArRodBlockStructure.cxx:52
LArRodBlockStructure::m_virtualROBPointer
const uint32_t * m_virtualROBPointer
Definition: LArRodBlockStructure.h:247
LArRodBlockStructure::setRawDataFixed
virtual void setRawDataFixed(const int channel, const std::vector< short > &samples, const uint32_t gain)
Definition: LArRodBlockStructure.cxx:126
LArRodBlockStructure::getResults2Size
virtual uint16_t getResults2Size() const
Definition: LArRodBlockStructure.cxx:253
LArRodBlockStructure::sortDataVector
virtual void sortDataVector(std::vector< const LArRawChannel * > &)
Definition: LArRodBlockStructure.cxx:230
LArRodBlockStructure::initializeFEB
virtual void initializeFEB(const uint32_t id)
Definition: LArRodBlockStructure.cxx:182
LArRodBlockStructure::m_MiddleHeaderSize
int32_t m_MiddleHeaderSize
Definition: LArRodBlockStructure.h:239
LArRodBlockStructure.h
LArRodBlockStructure::setEx
virtual void setEx(double)
Definition: LArRodBlockStructure.cxx:200
LArRodBlockStructure::getNextRawData
virtual int getNextRawData(int &channelNumber, std::vector< short > &samples, uint32_t &gain)
Definition: LArRodBlockStructure.cxx:88
LArRodBlockStructure::getCtrl3
virtual uint16_t getCtrl3(uint32_t adc) const
Definition: LArRodBlockStructure.cxx:250
LArRodBlockStructure::getStatus
virtual uint32_t getStatus() const
Definition: LArRodBlockStructure.cxx:251
LArRodBlockStructure::getCtrl1
virtual uint16_t getCtrl1(uint32_t adc) const
Definition: LArRodBlockStructure.cxx:248
LArRodBlockStructure::setNumberOfGains
virtual void setNumberOfGains(const uint8_t n)
Definition: LArRodBlockStructure.cxx:138
LArRodBlockStructure::setDelay
virtual void setDelay(const uint16_t DelayValue)
Definition: LArRodBlockStructure.cxx:63
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
LArRodBlockStructure::m_OfflineToRawGainMap
static const uint32_t m_OfflineToRawGainMap[3]
Definition: LArRodBlockStructure.h:238
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
LArRodBlockStructure::getNumberOfGains
virtual uint32_t getNumberOfGains() const
Definition: LArRodBlockStructure.cxx:246
LArRodBlockStructure::m_RodBlockSize
int32_t m_RodBlockSize
Definition: LArRodBlockStructure.h:230
LArRodBlockStructure::onlineCheckSum
virtual uint32_t onlineCheckSum() const
Definition: LArRodBlockStructure.cxx:155
LArRodBlockStructure::m_RodBlock
const uint32_t * m_RodBlock
Definition: LArRodBlockStructure.h:228
LArRodBlockStructure::m_channelsPerFEB
int m_channelsPerFEB
Definition: LArRodBlockStructure.h:225
LArRodBlockStructure::getTDCPhase
virtual uint8_t getTDCPhase() const
Definition: LArRodBlockStructure.cxx:149
LArRodBlockStructure::getResults1Size
virtual uint16_t getResults1Size() const
Definition: LArRodBlockStructure.cxx:252
LArRodBlockStructure::setRawData
virtual void setRawData(const int channel, const std::vector< short > &samples, const uint32_t gain)
Definition: LArRodBlockStructure.cxx:113
LArRodBlockStructure::m_numberOfEz
uint32_t m_numberOfEz
Definition: LArRodBlockStructure.h:216
LArRodBlockStructure::m_numberOfEy
uint32_t m_numberOfEy
Definition: LArRodBlockStructure.h:215