![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include "GaudiKernel/MsgStream.h"
17 #include "GaudiKernel/Bootstrap.h"
18 #include "GaudiKernel/ISvcLocator.h"
23 #define MYLEVEL (MSG::FATAL)
24 #define LARBSDBG(text) logstr<<MYLEVEL<<text<<endmsg
26 #define LARBSDBG(text)
41 m_onlineHelper(nullptr)
54 ISvcLocator* svcLoc = Gaudi::svcLocator( );
57 std::cout <<
"Unable to locate DetectorStore" << std::endl;
62 std::cout <<
"Could not get LArOnlineID helper !" << std::endl;
102 if ( !(
ns&0
x1) ) radd++;
133 int off1_tmp, dim1_tmp;
134 int off2_tmp, dim2_tmp;
135 int off3_tmp, dim3_tmp;
139 off1_tmp = dim1_tmp = 0;
140 off2_tmp = dim2_tmp = 0;
141 off3_tmp = dim3_tmp = 0;
152 dim1_tmp = 84+(
ns+1)/2+
n1;
153 if ( !(
ns&0
x1) ) dim1_tmp++;
158 off2_tmp = off1_tmp+dim1_tmp;
159 dim2_tmp = (n2*
ns+1)/2;
160 off3_tmp = off2_tmp+dim2_tmp;
162 if(dim2_tmp==0) off2_tmp = 0;
163 if(dim3_tmp==0) off3_tmp = 0;
166 if(off1 != off1_tmp) problem=1;
167 if(dim1 != dim1_tmp) problem=2;
168 if(off2 != off2_tmp) problem=3;
169 if(dim2 != dim2_tmp) problem=4;
170 if(off3 != off3_tmp) problem=5;
171 if(dim3 != dim3_tmp) problem=6;
172 if(
n1 != n1_tmp) problem=7;
173 if(n2 != n2_tmp) problem=8;
181 std::cout <<
"LArByteStreamProblem " << problem << std::endl;
182 std::cout <<
"NSamples = " << std::dec <<
ns << std::endl;
183 std::cout <<
"getHeader32(NGains) = " << std::hex <<
getHeader32(
NGains) << std::endl;
184 std::cout <<
"NWTot: " << std::hex <<
getNumberOfWords() <<
" n1=" <<
n1 <<
" (" << n1_tmp <<
") n2=" << n2 <<
" (" << n2_tmp <<
")" << std::endl;
185 std::cout <<
"Found 1: " << off1 <<
" " << dim1 << std::endl;
186 std::cout <<
"Found 2: " << off2 <<
" " << dim2 << std::endl;
187 std::cout <<
"Found 3: " << off3 <<
" " << dim3 << std::dec << std::endl;
189 if(
n1==n1_tmp && n2==n2_tmp) {
196 std::cout <<
"Recomputed 1: " << std::hex << off1 <<
" " << dim1 << std::endl;
197 std::cout <<
"Recomputed 2: " << off2 <<
" " << dim2 << std::endl;
198 std::cout <<
"Recomputed 3: " << off3 <<
" " << dim3 << std::dec << std::endl;
228 if(off1< off2 && off1 + dim1 > off2) problem = 1;
229 if(off1< off3 && off1 + dim1 > off3) problem = 2;
230 if(off2< off1 && off2 + dim2 > off1) problem = 3;
231 if(off2< off3 && off2 + dim2 > off3) problem = 4;
232 if(off3< off1 && off3 + dim3 > off1) problem = 5;
233 if(off3< off2 && off3 + dim3 > off2) problem = 6;
237 std::cout <<
"LArByteStreamProblem " << problem << std::endl;
238 std::cout <<
"Unrecoverable problem" << std::endl;
304 #ifdef LARBSDBGOUTPUT
307 logstr <<
MYLEVEL <<
"Let s go in getNextRawData..." <<
endmsg;
314 #ifdef LARBSDBGOUTPUT
315 logstr <<
MYLEVEL <<
"Maximum number of channels reached" <<
endmsg;
327 channelNumber=((rodChannelNumber&0xe)<<2) + ((rodChannelNumber&0x1)<<6) + (rodChannelNumber>>4);
333 #ifdef LARBSDBGOUTPUT
335 logstr <<
MYLEVEL <<
"This FEB has " << ngains <<
" gains" <<
endmsg;
338 if(ngains==0 ||
nsamples==0)
return 0;
385 #ifdef LARBSDBGOUTPUT
387 logstr <<
MYLEVEL <<
" ===> FEB Channel = " << channelNumber <<
endmsg;
398 unsigned rearrangeFirstSample=0;
404 if (rearrangeFirstSample && rearrangeFirstSample<
samples.size())
407 for (
unsigned i=1;
i<=rearrangeFirstSample;
i++)
409 samples[rearrangeFirstSample]=movedSample;
411 #ifdef LARBSDBGOUTPUT
420 #ifdef LARBSDBGOUTPUT
423 logstr <<
MYLEVEL <<
"Let s go in getNextDigits..." <<
endmsg;
431 #ifdef LARBSDBGOUTPUT
432 logstr <<
MYLEVEL <<
"Maximum number of channels reached" <<
endmsg;
438 #ifdef LARBSDBGOUTPUT
439 logstr <<
MYLEVEL <<
"No Digits Block in this FEB" <<
endmsg;
444 #ifdef LARBSDBGOUTPUT
445 logstr <<
MYLEVEL <<
"No Mask Digits Block in this FEB" <<
endmsg;
455 while(hasDigits==0) {
458 #ifdef LARBSDBGOUTPUT
459 logstr <<
MYLEVEL <<
"Maximum number of channels reached" <<
endmsg;
468 channelNumber=((rodChannelNumber&0xe)<<2) + ((rodChannelNumber&0x1)<<6) + (rodChannelNumber>>4);
476 }
else gain=0xffffffff;
478 #ifdef LARBSDBGOUTPUT
527 #ifdef LARBSDBGOUTPUT
529 logstr <<
MYLEVEL <<
" ===> FEB Channel = " << channelNumber <<
endmsg;
537 unsigned rearrangeFirstSample=0;
543 if (rearrangeFirstSample && rearrangeFirstSample<
samples.size())
546 for (
unsigned i=1;
i<=rearrangeFirstSample;
i++)
548 samples[rearrangeFirstSample]=movedSample;
550 #ifdef LARBSDBGOUTPUT
573 for(
int j=0;j<32;j++)
583 for(
int j=0;j<32;j++)
625 if(
adc>=8)
return x>>8;
690 unsigned int sizeRead=0;
692 while (sizeRead<fragment.size()) {
694 FebIter=fragment.begin()+sizeRead;
698 if (FebIter+currFebSize>fragment.end()) {
703 m_mFebBlocks[currFEBid].assign(FebIter,FebIter+currFebSize);
770 thequality = (
int16_t) quality;
777 if ((abse>8192)&&(abse<65536))
779 EncodedE=((abse>>3)|0x4000);
781 else if ((abse>65535)&&(abse<524288))
783 EncodedE=((abse>>6)|0x8000);
785 else if ((abse>524288))
787 EncodedE=((abse>>9)|0xc000);
792 if (
sign<0) EncodedE |= 0x2000;
901 for(
unsigned int i=0;
i<
n;
i++){
913 for (
unsigned i=0;
i<
n;
i++){
926 for (
unsigned i=0;
i<
n;
i++){
937 radd_nANC = (radd_nANC<<16);
958 for(
unsigned int i=0;
i<
n/2;
i++) {
972 unsigned int imax =
n/2;
973 for(
unsigned int i=0;
i<
imax;
i++){
987 for(
unsigned int i=0;
i<
imax;
i++){
1000 for(
size_t ii=0;ii<
endtag/2;ii++){
1001 sum+=((*m_vFragment)[ii]);
1018 FEBMAPTYPE::const_iterator feb_it_b=
m_mFebBlocks.begin();
1019 FEBMAPTYPE::const_iterator feb_it_e=
m_mFebBlocks.end();
1020 FEBMAPTYPE::const_iterator feb_it;
1021 for (feb_it=feb_it_b;feb_it!=feb_it_e;++feb_it) {
1022 if (feb_it!=feb_it_b)
1027 feb_it->second.begin(), feb_it->second.end());
1035 template<
class RAWDATA>
1036 bool LArRodBlockPhysicsV6::operator ()
1037 (
const RAWDATA* ch1,
const RAWDATA* ch2)
const
1046 int cId1 = m_onlineHelper->channel(id1);
1047 int cId2 = m_onlineHelper->channel(
id2);
1048 return FebToRodChannel(cId1) < FebToRodChannel(cId2);
1055 #ifdef LARBSDBGOUTPUT
1056 #undef LARBSDBGOUTPUT
JetConstituentVector::iterator iterator
uint16_t getNbSweetCells2FromMask() const
std::vector< uint32_t > * m_vFragment
virtual uint16_t getNbSweetCells1() const
singleton-like access to IMessageSvc via open function and helper
uint32_t getNumberOfWords() const
virtual int getNextEnergy(int &channelNumber, int32_t &energy, int32_t &time, int32_t &quality, uint32_t &gain)
uint16_t getFirstSampleIndex() const
const uint16_t * m_EnergyPointer
virtual uint16_t getResults1Size() const
virtual bool setPointers()
virtual uint16_t getCtrl2(uint32_t adc) const
const uint32_t * m_FebBlock
void setHeader16(const unsigned n, const uint16_t w)
std::vector< uint16_t > m_TimeQualityBlock
virtual uint16_t getCtrl3(uint32_t adc) const
const LArOnlineID * m_onlineHelper
virtual void resetPointers()
const int32_t * m_SumPointer
setScaleOne setStatusOne setSaturated int16_t
std::vector< uint32_t > * m_pRODblock
IMessageSvc * getMessageSvc(bool quiet=false)
uint32_t OfflineToRawGain(const uint32_t gain) const
const uint32_t * m_MaskTimeQualityPointer
virtual uint16_t getRawDataSize() const
void setNextEnergy(const int channel, const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
std::vector< uint32_t > m_SumBlkBlockE2
virtual uint16_t getNbSweetCells2() const
virtual uint16_t getResults2Size() const
unsigned short m_iHeadBlockSize
unsigned int m_rearrangeFirstSample
uint32_t getHeader32(const unsigned n) const
The Athena Transient Store API.
uint16_t m_numberHotCellOffTime
uint32_t RawToOfflineGain(const uint32_t gain) const
const uint16_t * m_RawDataPointer
::StatusCode StatusCode
StatusCode definition for legacy code.
uint16_t m_EnergyThreshold2
const uint32_t * m_GainPointer
virtual uint16_t getCtrl1(uint32_t adc) const
std::vector< uint32_t > m_SumBlkBlockE1
const uint16_t * m_DigitsPointer
virtual int getNextRawData(int &channelNumber, std::vector< short > &samples, uint32_t &gain)
std::vector< uint16_t > m_DigitsEncode
std::vector< uint32_t > m_GainBlock
uint16_t getNbSweetCells1FromMask() const
int32_t m_MiddleHeaderSize
const uint32_t * m_MaskDigitsPointer
uint16_t m_EnergyThreshold1
def time(flags, cells_name, *args, **kw)
virtual uint32_t getNumberOfGains() const
void setRawData(const int, const std::vector< short > &, const uint32_t)
int getNextDigits(int &channelNumber, std::vector< short > &samples, uint32_t &gain)
const uint16_t * m_TimeQualityPointer
std::vector< uint16_t > m_EnergyBlockEncode
virtual uint32_t getNumberOfSamples() const
virtual int FebToRodChannel(int ch) const
virtual uint32_t getRadd(uint32_t adc, uint32_t sample) const
unsigned short m_requiredNSamples
void initializeFEB(const uint32_t id)
virtual uint32_t getStatus() const
uint16_t getHeader16(const unsigned n) const
const uint16_t * m_RaddPointer
void initializeFragment(std::vector< uint32_t > &fragment)
void setHeader32(const unsigned n, const uint32_t w)