|
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)
52 SmartIF<StoreGateSvc>
detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
54 std::cout <<
"Unable to locate DetectorStore" << std::endl;
59 std::cout <<
"Could not get LArOnlineID helper !" << std::endl;
99 if ( !(
ns&0
x1) ) radd++;
130 int off1_tmp, dim1_tmp;
131 int off2_tmp, dim2_tmp;
132 int off3_tmp, dim3_tmp;
136 off1_tmp = dim1_tmp = 0;
137 off2_tmp = dim2_tmp = 0;
138 off3_tmp = dim3_tmp = 0;
149 dim1_tmp = 84+(
ns+1)/2+
n1;
150 if ( !(
ns&0
x1) ) dim1_tmp++;
155 off2_tmp = off1_tmp+dim1_tmp;
156 dim2_tmp = (n2*
ns+1)/2;
157 off3_tmp = off2_tmp+dim2_tmp;
159 if(dim2_tmp==0) off2_tmp = 0;
160 if(dim3_tmp==0) off3_tmp = 0;
163 if(off1 != off1_tmp) problem=1;
164 if(dim1 != dim1_tmp) problem=2;
165 if(off2 != off2_tmp) problem=3;
166 if(dim2 != dim2_tmp) problem=4;
167 if(off3 != off3_tmp) problem=5;
168 if(dim3 != dim3_tmp) problem=6;
169 if(
n1 != n1_tmp) problem=7;
170 if(n2 != n2_tmp) problem=8;
178 std::cout <<
"LArByteStreamProblem " << problem << std::endl;
179 std::cout <<
"NSamples = " << std::dec <<
ns << std::endl;
180 std::cout <<
"getHeader32(NGains) = " << std::hex <<
getHeader32(
NGains) << std::endl;
181 std::cout <<
"NWTot: " << std::hex <<
getNumberOfWords() <<
" n1=" <<
n1 <<
" (" << n1_tmp <<
") n2=" << n2 <<
" (" << n2_tmp <<
")" << std::endl;
182 std::cout <<
"Found 1: " << off1 <<
" " << dim1 << std::endl;
183 std::cout <<
"Found 2: " << off2 <<
" " << dim2 << std::endl;
184 std::cout <<
"Found 3: " << off3 <<
" " << dim3 << std::dec << std::endl;
186 if(
n1==n1_tmp && n2==n2_tmp) {
193 std::cout <<
"Recomputed 1: " << std::hex << off1 <<
" " << dim1 << std::endl;
194 std::cout <<
"Recomputed 2: " << off2 <<
" " << dim2 << std::endl;
195 std::cout <<
"Recomputed 3: " << off3 <<
" " << dim3 << std::dec << std::endl;
225 if(off1< off2 && off1 + dim1 > off2) problem = 1;
226 if(off1< off3 && off1 + dim1 > off3) problem = 2;
227 if(off2< off1 && off2 + dim2 > off1) problem = 3;
228 if(off2< off3 && off2 + dim2 > off3) problem = 4;
229 if(off3< off1 && off3 + dim3 > off1) problem = 5;
230 if(off3< off2 && off3 + dim3 > off2) problem = 6;
234 std::cout <<
"LArByteStreamProblem " << problem << std::endl;
235 std::cout <<
"Unrecoverable problem" << std::endl;
301 #ifdef LARBSDBGOUTPUT
304 logstr <<
MYLEVEL <<
"Let s go in getNextRawData..." <<
endmsg;
311 #ifdef LARBSDBGOUTPUT
312 logstr <<
MYLEVEL <<
"Maximum number of channels reached" <<
endmsg;
324 channelNumber=((rodChannelNumber&0xe)<<2) + ((rodChannelNumber&0x1)<<6) + (rodChannelNumber>>4);
330 #ifdef LARBSDBGOUTPUT
332 logstr <<
MYLEVEL <<
"This FEB has " << ngains <<
" gains" <<
endmsg;
335 if(ngains==0 ||
nsamples==0)
return 0;
349 samples.push_back(
s[0]);
353 samples.push_back(
s[0]);
354 samples.push_back(
s[1]);
361 samples.push_back(
s[0]);
365 samples.push_back(
s[0]);
366 samples.push_back(
s[1]);
372 samples.push_back(
s[0]);
373 samples.push_back(
s[1]);
377 samples.push_back(
s[0]);
382 #ifdef LARBSDBGOUTPUT
384 logstr <<
MYLEVEL <<
" ===> FEB Channel = " << channelNumber <<
endmsg;
387 logstr <<
MYLEVEL <<
" ===> sample " <<
i <<
" = " << samples[
i] <<
endmsg;
395 unsigned rearrangeFirstSample=0;
401 if (rearrangeFirstSample && rearrangeFirstSample<samples.size())
403 short movedSample=samples[0];
404 for (
unsigned i=1;
i<=rearrangeFirstSample;
i++)
405 samples[
i-1]=samples[
i];
406 samples[rearrangeFirstSample]=movedSample;
408 #ifdef LARBSDBGOUTPUT
417 #ifdef LARBSDBGOUTPUT
420 logstr <<
MYLEVEL <<
"Let s go in getNextDigits..." <<
endmsg;
428 #ifdef LARBSDBGOUTPUT
429 logstr <<
MYLEVEL <<
"Maximum number of channels reached" <<
endmsg;
435 #ifdef LARBSDBGOUTPUT
436 logstr <<
MYLEVEL <<
"No Digits Block in this FEB" <<
endmsg;
441 #ifdef LARBSDBGOUTPUT
442 logstr <<
MYLEVEL <<
"No Mask Digits Block in this FEB" <<
endmsg;
452 while(hasDigits==0) {
455 #ifdef LARBSDBGOUTPUT
456 logstr <<
MYLEVEL <<
"Maximum number of channels reached" <<
endmsg;
465 channelNumber=((rodChannelNumber&0xe)<<2) + ((rodChannelNumber&0x1)<<6) + (rodChannelNumber>>4);
473 }
else gain=0xffffffff;
475 #ifdef LARBSDBGOUTPUT
524 #ifdef LARBSDBGOUTPUT
526 logstr <<
MYLEVEL <<
" ===> FEB Channel = " << channelNumber <<
endmsg;
529 logstr <<
MYLEVEL <<
" ===> sample " <<
i <<
" = " << samples[
i] <<
endmsg;
534 unsigned rearrangeFirstSample=0;
540 if (rearrangeFirstSample && rearrangeFirstSample<samples.size())
542 short movedSample=samples[0];
543 for (
unsigned i=1;
i<=rearrangeFirstSample;
i++)
544 samples[
i-1]=samples[
i];
545 samples[rearrangeFirstSample]=movedSample;
547 #ifdef LARBSDBGOUTPUT
570 for(
int j=0;j<32;j++)
580 for(
int j=0;j<32;j++)
622 if(
adc>=8)
return x>>8;
687 unsigned int sizeRead=0;
689 while (sizeRead<fragment.size()) {
691 FebIter=fragment.begin()+sizeRead;
695 if (FebIter+currFebSize>fragment.end()) {
700 m_mFebBlocks[currFEBid].assign(FebIter,FebIter+currFebSize);
767 thequality = (
int16_t) quality;
774 if ((abse>8192)&&(abse<65536))
776 EncodedE=((abse>>3)|0x4000);
778 else if ((abse>65535)&&(abse<524288))
780 EncodedE=((abse>>6)|0x8000);
782 else if ((abse>524288))
784 EncodedE=((abse>>9)|0xc000);
789 if (
sign<0) EncodedE |= 0x2000;
863 for(std::vector<short>::const_iterator
i=samples.begin();
i!=samples.end();++
i){
898 for(
unsigned int i=0;
i<
n;
i++){
910 for (
unsigned i=0;
i<
n;
i++){
923 for (
unsigned i=0;
i<
n;
i++){
934 radd_nANC = (radd_nANC<<16);
955 for(
unsigned int i=0;
i<
n/2;
i++) {
969 unsigned int imax =
n/2;
970 for(
unsigned int i=0;
i<
imax;
i++){
984 for(
unsigned int i=0;
i<
imax;
i++){
997 for(
size_t ii=0;ii<
endtag/2;ii++){
998 sum+=((*m_vFragment)[ii]);
1015 FEBMAPTYPE::const_iterator feb_it_b=
m_mFebBlocks.begin();
1016 FEBMAPTYPE::const_iterator feb_it_e=
m_mFebBlocks.end();
1017 FEBMAPTYPE::const_iterator feb_it;
1018 for (feb_it=feb_it_b;feb_it!=feb_it_e;++feb_it) {
1019 if (feb_it!=feb_it_b)
1024 feb_it->second.begin(), feb_it->second.end());
1032 template<
class RAWDATA>
1033 bool LArRodBlockPhysicsV6::operator ()
1034 (
const RAWDATA* ch1,
const RAWDATA* ch2)
const
1043 int cId1 = m_onlineHelper->channel(id1);
1044 int cId2 = m_onlineHelper->channel(
id2);
1045 return FebToRodChannel(cId1) < FebToRodChannel(cId2);
1052 #ifdef LARBSDBGOUTPUT
1053 #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
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)