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); 
 
  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