|
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;
129 int off1_tmp, dim1_tmp;
130 int off2_tmp, dim2_tmp;
131 int off3_tmp, dim3_tmp;
135 off1_tmp = dim1_tmp = 0;
136 off2_tmp = dim2_tmp = 0;
137 off3_tmp = dim3_tmp = 0;
148 dim1_tmp = 83+(
ns+1)/2+
n1;
151 off2_tmp = off1_tmp+dim1_tmp;
152 dim2_tmp = (n2*
ns+1)/2;
153 off3_tmp = off2_tmp+dim2_tmp;
155 if(dim2_tmp==0) off2_tmp = 0;
156 if(dim3_tmp==0) off3_tmp = 0;
159 if(off1 != off1_tmp) problem=1;
160 if(dim1 != dim1_tmp) problem=2;
161 if(off2 != off2_tmp) problem=3;
162 if(dim2 != dim2_tmp) problem=4;
163 if(off3 != off3_tmp) problem=5;
164 if(dim3 != dim3_tmp) problem=6;
165 if(
n1 != n1_tmp) problem=7;
166 if(n2 != n2_tmp) problem=8;
174 std::cout <<
"LArByteStreamProblem " << problem << std::endl;
175 std::cout <<
"NSamples = " << std::dec <<
ns << std::endl;
176 std::cout <<
"getHeader32(NGains) = " << std::hex <<
getHeader32(
NGains) << std::endl;
177 std::cout <<
"NWTot: " << std::hex <<
getNumberOfWords() <<
" n1=" <<
n1 <<
" (" << n1_tmp <<
") n2=" << n2 <<
" (" << n2_tmp <<
")" << std::endl;
178 std::cout <<
"Found 1: " << off1 <<
" " << dim1 << std::endl;
179 std::cout <<
"Found 2: " << off2 <<
" " << dim2 << std::endl;
180 std::cout <<
"Found 3: " << off3 <<
" " << dim3 << std::dec << std::endl;
182 if(
n1==n1_tmp && n2==n2_tmp) {
189 std::cout <<
"Recomputed 1: " << std::hex << off1 <<
" " << dim1 << std::endl;
190 std::cout <<
"Recomputed 2: " << off2 <<
" " << dim2 << std::endl;
191 std::cout <<
"Recomputed 3: " << off3 <<
" " << dim3 << std::dec << std::endl;
221 if(off1< off2 && off1 + dim1 > off2) problem = 1;
222 if(off1< off3 && off1 + dim1 > off3) problem = 2;
223 if(off2< off1 && off2 + dim2 > off1) problem = 3;
224 if(off2< off3 && off2 + dim2 > off3) problem = 4;
225 if(off3< off1 && off3 + dim3 > off1) problem = 5;
226 if(off3< off2 && off3 + dim3 > off2) problem = 6;
230 std::cout <<
"LArByteStreamProblem " << problem << std::endl;
231 std::cout <<
"Unrecoverable problem" << std::endl;
297 #ifdef LARBSDBGOUTPUT
300 logstr <<
MYLEVEL <<
"Let s go in getNextRawData..." <<
endmsg;
307 #ifdef LARBSDBGOUTPUT
308 logstr <<
MYLEVEL <<
"Maximum number of channels reached" <<
endmsg;
320 channelNumber=((rodChannelNumber&0xe)<<2) + ((rodChannelNumber&0x1)<<6) + (rodChannelNumber>>4);
326 #ifdef LARBSDBGOUTPUT
328 logstr <<
MYLEVEL <<
"This FEB has " << ngains <<
" gains" <<
endmsg;
331 if(ngains==0 ||
nsamples==0)
return 0;
345 samples.push_back(
s[0]);
349 samples.push_back(
s[0]);
350 samples.push_back(
s[1]);
357 samples.push_back(
s[0]);
361 samples.push_back(
s[0]);
362 samples.push_back(
s[1]);
368 samples.push_back(
s[0]);
369 samples.push_back(
s[1]);
373 samples.push_back(
s[0]);
378 #ifdef LARBSDBGOUTPUT
380 logstr <<
MYLEVEL <<
" ===> FEB Channel = " << channelNumber <<
endmsg;
383 logstr <<
MYLEVEL <<
" ===> sample " <<
i <<
" = " << samples[
i] <<
endmsg;
391 unsigned rearrangeFirstSample=0;
397 if (rearrangeFirstSample && rearrangeFirstSample<samples.size())
399 short movedSample=samples[0];
400 for (
unsigned i=1;
i<=rearrangeFirstSample;
i++)
401 samples[
i-1]=samples[
i];
402 samples[rearrangeFirstSample]=movedSample;
404 #ifdef LARBSDBGOUTPUT
413 #ifdef LARBSDBGOUTPUT
416 logstr <<
MYLEVEL <<
"Let s go in getNextDigits..." <<
endmsg;
424 #ifdef LARBSDBGOUTPUT
425 logstr <<
MYLEVEL <<
"Maximum number of channels reached" <<
endmsg;
431 #ifdef LARBSDBGOUTPUT
432 logstr <<
MYLEVEL <<
"No Digits Block in this FEB" <<
endmsg;
437 #ifdef LARBSDBGOUTPUT
438 logstr <<
MYLEVEL <<
"No Mask Digits Block in this FEB" <<
endmsg;
448 while(hasDigits==0) {
451 #ifdef LARBSDBGOUTPUT
452 logstr <<
MYLEVEL <<
"Maximum number of channels reached" <<
endmsg;
461 channelNumber=((rodChannelNumber&0xe)<<2) + ((rodChannelNumber&0x1)<<6) + (rodChannelNumber>>4);
469 }
else gain=0xffffffff;
471 #ifdef LARBSDBGOUTPUT
513 #ifdef LARBSDBGOUTPUT
515 logstr <<
MYLEVEL <<
" ===> FEB Channel = " << channelNumber <<
endmsg;
518 logstr <<
MYLEVEL <<
" ===> sample " <<
i <<
" = " << samples[
i] <<
endmsg;
523 unsigned rearrangeFirstSample=0;
529 if (rearrangeFirstSample && rearrangeFirstSample<samples.size())
531 short movedSample=samples[0];
532 for (
unsigned i=1;
i<=rearrangeFirstSample;
i++)
533 samples[
i-1]=samples[
i];
534 samples[rearrangeFirstSample]=movedSample;
536 #ifdef LARBSDBGOUTPUT
559 for(
int j=0;j<32;j++)
569 for(
int j=0;j<32;j++)
611 if(
adc>=8)
return x>>8;
676 unsigned int sizeRead=0;
678 while (sizeRead<fragment.size()) {
680 FebIter=fragment.begin()+sizeRead;
684 if (FebIter+currFebSize>fragment.end()) {
689 m_mFebBlocks[currFEBid].assign(FebIter,FebIter+currFebSize);
756 thequality = (
int16_t) quality;
763 if ((abse>8192)&&(abse<65536))
765 EncodedE=((abse>>3)|0x4000);
767 else if ((abse>65535)&&(abse<524288))
769 EncodedE=((abse>>6)|0x8000);
771 else if ((abse>524288))
773 EncodedE=((abse>>9)|0xc000);
778 if (
sign<0) EncodedE |= 0x2000;
852 for(std::vector<short>::const_iterator
i=samples.begin();
i!=samples.end();++
i){
887 for(
unsigned int i=0;
i<
n;
i++){
899 for (
unsigned i=0;
i<
n;
i++){
912 for (
unsigned i=0;
i<
n;
i++){
923 radd_nANC = (radd_nANC<<16);
944 for(
unsigned int i=0;
i<
n/2;
i++) {
958 unsigned int imax =
n/2;
959 for(
unsigned int i=0;
i<
imax;
i++){
973 for(
unsigned int i=0;
i<
imax;
i++){
986 for(
size_t ii=0;ii<
endtag/2;ii++){
987 sum+=((*m_vFragment)[ii]);
1003 FEBMAPTYPE::const_iterator feb_it_b=
m_mFebBlocks.begin();
1004 FEBMAPTYPE::const_iterator feb_it_e=
m_mFebBlocks.end();
1005 FEBMAPTYPE::const_iterator feb_it;
1006 for (feb_it=feb_it_b;feb_it!=feb_it_e;++feb_it) {
1007 if (feb_it!=feb_it_b)
1012 feb_it->second.begin(), feb_it->second.end());
1020 template<
class RAWDATA>
1021 bool LArRodBlockPhysicsV5::operator ()
1022 (
const RAWDATA* ch1,
const RAWDATA* ch2)
const
1031 int cId1 = m_onlineHelper->channel(id1);
1032 int cId2 = m_onlineHelper->channel(
id2);
1033 return FebToRodChannel(cId1) < FebToRodChannel(cId2);
1040 #ifdef LARBSDBGOUTPUT
1041 #undef LARBSDBGOUTPUT
JetConstituentVector::iterator iterator
virtual uint16_t getRawDataSize() const
virtual uint16_t getNbSweetCells2() const
std::vector< uint32_t > m_SumBlkBlockE2
std::vector< uint32_t > * m_vFragment
void setRawData(const int, const std::vector< short > &, const uint32_t)
virtual uint32_t getNumberOfSamples() const
singleton-like access to IMessageSvc via open function and helper
const LArOnlineID * m_onlineHelper
uint32_t getNumberOfWords() const
const uint32_t * m_GainPointer
const uint16_t * m_DigitsPointer
uint16_t m_EnergyThreshold2
virtual uint16_t getCtrl2(uint32_t adc) const
const uint32_t * m_FebBlock
void setHeader16(const unsigned n, const uint16_t w)
virtual int getNextRawData(int &channelNumber, std::vector< short > &samples, uint32_t &gain)
virtual uint32_t getNumberOfGains() const
setScaleOne setStatusOne setSaturated int16_t
std::vector< uint32_t > * m_pRODblock
IMessageSvc * getMessageSvc(bool quiet=false)
uint32_t OfflineToRawGain(const uint32_t gain) const
void setNextEnergy(const int channel, const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
std::vector< uint16_t > m_DigitsEncode
const uint16_t * m_TimeQualityPointer
void initializeFragment(std::vector< uint32_t > &fragment)
unsigned short m_iHeadBlockSize
unsigned int m_rearrangeFirstSample
const int32_t * m_SumPointer
uint32_t getHeader32(const unsigned n) const
virtual uint16_t getResults1Size() const
uint32_t RawToOfflineGain(const uint32_t gain) const
std::vector< uint32_t > m_GainBlock
virtual void resetPointers()
::StatusCode StatusCode
StatusCode definition for legacy code.
int getNextDigits(int &channelNumber, std::vector< short > &samples, uint32_t &gain)
const uint16_t * m_EnergyPointer
unsigned short m_requiredNSamples
const uint32_t * m_MaskDigitsPointer
const uint32_t * m_MaskTimeQualityPointer
uint16_t m_numberHotCellOffTime
std::vector< uint16_t > m_TimeQualityBlock
uint16_t getNbSweetCells2FromMask() const
const uint16_t * m_RawDataPointer
uint16_t getFirstSampleIndex() const
virtual int getNextEnergy(int &channelNumber, int32_t &energy, int32_t &time, int32_t &quality, uint32_t &gain)
virtual uint32_t getRadd(uint32_t adc, uint32_t sample) const
virtual uint32_t getStatus() const
virtual uint16_t getCtrl1(uint32_t adc) const
virtual uint16_t getCtrl3(uint32_t adc) const
int32_t m_MiddleHeaderSize
def time(flags, cells_name, *args, **kw)
const uint16_t * m_RaddPointer
std::vector< uint16_t > m_EnergyBlockEncode
void initializeFEB(const uint32_t id)
uint16_t m_EnergyThreshold1
virtual uint16_t getNbSweetCells1() const
std::vector< uint32_t > m_SumBlkBlockE1
uint16_t getNbSweetCells1FromMask() const
virtual int FebToRodChannel(int ch) const
uint16_t getHeader16(const unsigned n) const
virtual bool setPointers()
void setHeader32(const unsigned n, const uint32_t w)
virtual uint16_t getResults2Size() const