ATLAS Offline Software
LArRodBlockPhysicsV0.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Implementation of the LArRODBlockStructure_3 class
6 // This version contains LArRawChannels (=E,t,Q)
7 // and LArDigits (=5 time samples)
8 // See .h file for more details.
9 
12 #include "LArRawEvent/LArDigit.h"
14 #include "GaudiKernel/Bootstrap.h"
15 #include "GaudiKernel/ISvcLocator.h"
16 #include "GaudiKernel/IToolSvc.h"
17 #include <stdlib.h>
18 #include <cstdio>
19 #include <iostream>
20 
21 //#define LARBSDBGOUTPUT
22 #ifdef LARBSDBGOUTPUT
23 #define LARBSDBG(text) m_logstr<<MSG::DEBUG<<text<<endmsg
24 #else
25 #define LARBSDBG(text)
26 #endif
27 
28 namespace {
29 union ShortLong {
30  uint16_t s[2];
31  uint32_t l;
32 };
33 }
34 
35 const uint32_t LArRodBlockPhysicsV0::m_DummyBitMap[4]={0xffffffff,0xffffffff,0xffffffff,0xffffffff};
36 
38 m_logstr(Athena::getMessageSvc(), BlockType())
39 {
40  // retrieve onlineHelper
41  const LArOnlineID* online_id;
42  SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service("DetectorStore")};
43  if (!detStore) {
44  m_logstr << MSG::ERROR << "Unable to locate DetectorStore" << endmsg;
45  std::abort();
46  }
47  StatusCode sc = detStore->retrieve(online_id, "LArOnlineID");
48  if (sc.isFailure()) {
49  m_logstr << MSG::FATAL << "Could not get LArOnlineID helper !" << endmsg;
50  std::abort();
51  }
52  else {
53  m_onlineHelper=online_id;
54  m_logstr << MSG::DEBUG << " Found the LArOnlineID helper. " << endmsg;
55  }
56 
57  m_iHeadBlockSize=endtag/2; // The implicit cast rounds down to the right size
60  m_vFragment=NULL;
61  m_FebBlock=NULL;
62  m_pRODblock=NULL;
63  m_FlagPtr=NULL;
64  m_HighEPtr=NULL;
65  m_LowEPtr=NULL;
66 }
67 
68 // clear temporary block vectors
70 { m_HighEnergyBlock.clear();
71  m_LowEnergyBlock.clear();
72  m_RawDataBlock.clear();
73 }
74 
76 {m_ECounter=0;
78  m_LowEIndex=0;
80  m_HighEIndex=0;
81  m_EIndex=0;
82 }
83 
84 //For reading (to speed up the process)
86 {//Set pointers to data blocks (presuming, they exist)
91  }
92  else
93  {//m_FlagPtr=NULL;
94  //m_LowEPtr=NULL;
95  //Bugfix, 9.8.2004, WL: Set pointer to dummy map to read FEB with only high energy block
97  m_LowEPtr=(const int16_t*)m_FlagPtr;
98  }
101  else
102  m_HighEPtr=NULL;
103  }
104  else
105  {m_FlagPtr=NULL;
106  m_LowEPtr=NULL;
107  m_HighEPtr=NULL;
108  }
109 #ifdef LARBSDBGOUTPUT
110  std::cout << "Fragment offsets: (m_NFlaggingWords=" << m_NFlaggingWords << ")" << std::endl;
111  std::cout << "Raw Data: " << LE_getHeader16(RawDataBlkOffset)<< std::endl;
112  if (m_FlagPtr)
113  std::cout << "Flags: " << LE_getHeader16(LowEBlkOffset)<< std::endl;
114  else
115  std::cout << "Flags: not present" << std::endl;
116 
117  if (m_LowEPtr)
118  std::cout << "Low Energy: " << LE_getHeader16(LowEBlkOffset)+m_NFlaggingWords << std::endl;
119  else
120  std::cout << "Low Energy: not present" << std::endl;
121 
122 
123  if (m_HighEPtr)
124  std::cout << "High Energy: " << LE_getHeader16(HighEBlkOffset)<< std::endl;
125  else
126  std::cout << "High Energy: not present" << std::endl;
127 #endif
128  return true;
129 }
130 
133  LE_setHeader16(NGainNSamples,(oldword & 0xFF00) | n);
134 }
135 
138  LE_setHeader16(NGainNSamples,(oldword & 0x00FF) | (n<<8));
139 }
140 
141 
142 void LArRodBlockPhysicsV0::setNextEnergy(const int channel, const int32_t energy,
143  const int32_t time, const int32_t quality, const uint32_t gain) {
144  int rcNb=FebToRodChannel(channel);
145  //rcNb ist supposed to equal or bigger than m_EIndex.
146  //In the latter case, we fill up the missing channels with zero
147  if (rcNb<m_EIndex) {
148  m_logstr << MSG::ERROR << "LArRODBlockStructure Error: Internal error. Channels not ordered correctly. rcNb=" << rcNb
149  << " m_EIndex=" << m_EIndex << endmsg;
150  return;
151  }
152  //Fill up missing channels with zeros:
153  while (m_EIndex<rcNb)
154  setNextEnergy(0,0,-1,0);
155  //Add data...
156  setNextEnergy(energy,time,quality,gain);
157  //std::cout << "SetNextEnergy " << channel << " : " << energy << std::endl;
158  return;
159 }
160 //Private function, expects channel number is rod-style ordering
161 void LArRodBlockPhysicsV0::setNextEnergy(const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
162 {
163  if (m_EIndex>=m_channelsPerFEB) //Use m_EIndex to count total number of channels
164  {m_logstr << MSG::ERROR << "LArRodBlockStructure Error: Attempt to write Energy for channel "
165  << m_EIndex << " channels into a FEB!" <<endmsg;
166  return;
167  }
168  LARBSDBG("LArRodBlockStructure: Setting Energy for channel " << m_EIndex << ". E=" << energy);
169  if (quality<0 && energy<0x7FFE && gain==0) { //Write into Low Energy block
170  m_LowEIndex++; //Use m_LowEIndex to count the channels in the Low Energy block
171  ShortLong twoValues{};
172  twoValues.s[0]=0;
173  twoValues.s[1]=0;
174  if (m_LowEIndex%2==1) { //This is an odd number, simply add data at the bottom of the block
175  twoValues.s[0]=(int16_t)energy;
176  }
177  else { //Even number: Merging with previous block
178  uint32_t oneValue=m_LowEnergyBlock[m_LowEnergyBlock.size()-1]; //Take last element of vector
179  m_LowEnergyBlock.pop_back();
180  int16_t* valptr=reinterpret_cast<int16_t*>(&oneValue);
181  twoValues.s[0]=valptr[0];
182  twoValues.s[1]=(int16_t)energy;
183  }
184  LARBSDBG("Writing words: val0= " << twoValues.s[0] << " val1= " << twoValues.s[1]);
185  m_LowEnergyBlock.push_back(twoValues.l);
186  LARBSDBG("Writing Raw data to Low E block. E=" << energy);
187  }
188  else //Write into High Energy block
190  m_HighEnergyBlock.push_back(*((uint32_t*)(&energy)));
191  uint32_t t_sign;
192  uint32_t abs_time;
193  if (time<0)
194  t_sign=1;
195  else
196  t_sign=0;
197  abs_time=abs(time);
198  if (abs_time>0x1fff)
199  abs_time=0x1fff;
200  //uint32_t gtQ = (gain << 30) | ((time & 0x3fff)<<16) | (0xffff & quality);
201  uint32_t gtQ = (gain << 30) | (t_sign<<29) | ((abs_time & 0x1fff)<<16) | (0xffff & quality);
202  m_HighEnergyBlock.push_back(gtQ);
203  LARBSDBG("Writing Raw data to High E block. E=" << energy << " Q=" << quality);
204  }
205  m_EIndex++;
206  // if (energy>0)
207  //m_ECounter++;
208 }
209 
210 
211 void LArRodBlockPhysicsV0::setRawData(const int channel, const std::vector<short>& samples, const uint32_t gain) {
212  //Convert Feb to Rod Channel Number:
213  //int rcNb=(channel>>3) + ((channel&0x7)<<4);
214  int rcNb=FebToRodChannel(channel);
215  if (rcNb>=m_channelsPerFEB)
216  {m_logstr << MSG::ERROR << "Attempt to write Energy for channel " << rcNb << " channels into a FEB!" << endmsg;
217  return;
218  }
219  unsigned int nsamples = LE_getVectorHeader16(NGainNSamples) & 0x00FF;
220  if(samples.size() != nsamples) {
221  m_logstr << MSG::ERROR << "Number of samples mismatch!\n";
222  m_logstr << " nsamples =" << nsamples;
223  m_logstr << " samples.size() =" << samples.size() << endmsg;
224  std::abort();
225  }
226 
227  setBit(&m_RawDataBlock[0],rcNb);
228  //Samples have 12 bit and are shifted to the left by 2 bits.
229  // odd samples in high bits, even samples in low bits
230  if((nsamples/2)*2!=nsamples) { //odd number of samples - gain is alone
231  m_RawDataBlock.push_back((gain<<30) | samples[0]<<2);
232  for (unsigned int i=1;i<nsamples;i+=2)
233  m_RawDataBlock.push_back((samples[i+1]<<18) | samples[i]<<2);
234  }
235  else { //even number of samples - gain is packed with sample 0
236  m_RawDataBlock.push_back((gain<<30) | (samples[1]<<18) | samples[0]<<2);
237  for (unsigned int i=2;i<nsamples;i+=2)
238  m_RawDataBlock.push_back((samples[i+1]<<18) | samples[i]<<2);
239  }
240 }
241 
242 
243 //For writing: takes existing Fragment and splits it into Feb-Blocks
244 void LArRodBlockPhysicsV0::initializeFragment(std::vector<uint32_t>& fragment)
245 {
246  m_pRODblock=&fragment; //remember pointer to fragment
247  if (fragment.size()>m_iHeadBlockSize) { //Got filled fragment
248  unsigned int sizeRead=0;
249  //Store existing data in the FEB-Map
250  while (sizeRead<fragment.size()) {
252  FebIter=fragment.begin()+sizeRead; //Store pointer to current Feb-Header
253  m_FebBlock=&(*FebIter); //Set m_FebBlock in order to use getHeader-functions.
254  uint32_t currFEBid=getHeader32(FEBID); //Get this FEB-ID
255  uint16_t currFebSize=getNumberOfWords(); //Size of this FEB-Block
256  //std::cout << "FebID=" << currFEBid << " FEBSize=" << currFebSize << " Vector size=" << fragment.size() << std::endl;
257  if (FebIter+currFebSize>fragment.end()) {
258  fragment.clear(); //Clear existing vector
259  m_logstr << MSG::ERROR << "Got inconsistent ROD-Fragment!" << endmsg;
260  return;
261  }
262  m_mFebBlocks[currFEBid].assign(FebIter,FebIter+currFebSize); //Copy data from ROD-fragment into FEB-Block
263  sizeRead+=currFebSize+m_MiddleHeaderSize;//6 is the middle header size
264  LARBSDBG("Found FEB-id " << currFEBid << " in existing ROD-Fragment");
265  } // end while
266  }
267  fragment.clear(); //Clear existing vector
268  return;
269 }
270 
271 //For writing: Initalizes a single FEB-Block
274  if (m_vFragment->size()<m_iHeadBlockSize) //Got empty or spoiled fragment
275  {m_vFragment->resize(m_iHeadBlockSize,0); //Initialize FEB-Header
276  setHeader32(FEBID,id); //Set Feb ID
277  }
278 
281  resetPointers();
282 }
283 
285 {
286 //Complete non-complete Energy block
287  while (m_EIndex<m_channelsPerFEB)
288  setNextEnergy(0,0,-1,0);//E=0,t=0,q=-1,G=0
289  // Energies
290  unsigned int n;
291  uint16_t BlockOffset;
292  //Low energy block....
293  n = m_LowEnergyBlock.size();
294  BlockOffset=LE_getVectorHeader16(LowEBlkOffset);
295  //Check if Low Energy Block exists and is not yet part of the fragment
296  LARBSDBG("Checking Low Energy Block n=" << n << "BlockOffset=" << BlockOffset);
297  if (n>m_NFlaggingWords && !BlockOffset)
299  for (unsigned i=0;i<n;i++)
300  m_vFragment->push_back(m_LowEnergyBlock[i]);
301  }
302  //High energy block...
303  n = m_HighEnergyBlock.size();
305  LARBSDBG("Checking High Energy Block n=" << n << "BlockOffset=" << BlockOffset);
306  //Check if High Energy-Block exists and is not yet part of the fragment
307  if (n && !BlockOffset)
309  for(unsigned int i=0;i<n;i++)
310  m_vFragment->push_back(m_HighEnergyBlock[i]);
311  }
312 
313  // Raw data
314  LARBSDBG("Checking Raw Data Block");
315  n = m_RawDataBlock.size();
317  LARBSDBG("Checking Raw Data Block. n=" << n << "BlockOffset=" << BlockOffset);
318  //Check if Raw Data block exists and is not yet part of the fragment
319  if (n>m_NFlaggingWords && !BlockOffset)
321  for(unsigned int i=0;i<n;i++)
322  m_vFragment->push_back(m_RawDataBlock[i]);
323  }
324  setHeader32(NWTot,m_vFragment->size());
325  LARBSDBG("Offsets:" << std::endl
326  << "Raw Data: " << LE_getVectorHeader16(RawDataBlkOffset) << std::endl
327  <<"Low Energy: " << LE_getVectorHeader16(LowEBlkOffset)<< std::endl
328  << "High Energy: " << LE_getVectorHeader16(HighEBlkOffset)<< std::endl
329  << "Energy-index:" << m_EIndex << std::endl
330  << "Filled channels: " << m_ECounter << std::endl);
331  clearBlocks();
332  return;
333 }
334 
335 
337 {
338  //std::cout << "Concatinating FEBs. Have "<< m_mFebBlocks.size() <<" febs." << std::endl;
339  FEBMAPTYPE::const_iterator feb_it_b=m_mFebBlocks.begin();
340  FEBMAPTYPE::const_iterator feb_it_e=m_mFebBlocks.end();
341  FEBMAPTYPE::const_iterator feb_it;
342  for (feb_it=feb_it_b;feb_it!=feb_it_e;++feb_it) {
343  if (feb_it!=feb_it_b) //Not first Feb
344 
345 /*
346  if (fullHeader) {//Add middle header
347  m_pRODblock->push_back(fullHeader->version().full());//Format Version number
348  m_pRODblock->push_back(fullHeader->source_id()); //Source identifer
349  m_pRODblock->push_back(fullHeader->run_no());
350  m_pRODblock->push_back(fullHeader->lvl1_id()); //Level 1 identifer
351  m_pRODblock->push_back(fullHeader->bc_id()); //Bunch Crossing identifer
352  m_pRODblock->push_back(fullHeader->lvl1_type()); //Level 1 trigger type
353  m_pRODblock->push_back(fullHeader->detev_type()); //Detector event type
354  }
355  else //No ROD-Header
356 */
357  m_pRODblock->resize( m_pRODblock->size()+m_MiddleHeaderSize);
358 
359  //Add feb data to rod data block
360  m_pRODblock->insert (m_pRODblock->end(),
361  feb_it->second.begin(), feb_it->second.end());
362  } //end for feb_it
363 
364  m_mFebBlocks.clear();
365  return;
366 }
367 
368 int LArRodBlockPhysicsV0::getNextRawData(int& channelNumber, std::vector<short>& samples, uint32_t& gain)
369 {
370  LARBSDBG("in LArRodBlockPhysicsV0::getNextRawData.");
371  LARBSDBG("m_RawDataCounter=" << m_RawDataCounter << " m_RawDataIndex="<< m_RawDataIndex);
372  LARBSDBG("m_channelsPerFEB=" << m_channelsPerFEB);
374  if (!flags)
375  return 0; //Block not existing
376  if (m_RawDataCounter>=m_channelsPerFEB) //Already beyond maximal number of channels
377  return 0;
378 
379  LARBSDBG("Flags="<<flags);
380  while (!getBit(m_FebBlock+flags,m_RawDataCounter)) //Look for next filled channel
381  {++m_RawDataCounter;
382  LARBSDBG("RawDataCounter ist now " << m_RawDataCounter);
383  if (m_RawDataCounter>=m_channelsPerFEB) //No more channel availible
384  return 0;
385  }
386  LARBSDBG("Found filled channel at positon " << m_RawDataCounter);
387  //Found next filled channel
388  channelNumber=(m_RawDataCounter>>4) + ((m_RawDataCounter&0xf)<<3); //Convert ROD to FEB channel ordering
389  unsigned int nsamples = LE_getHeader16(NGainNSamples) & 0x00FF;
390  LARBSDBG("This run has " << nsamples << " samples");
392  LARBSDBG( "index="<<index);
393  ++m_RawDataIndex;
394  LARBSDBG("In getnextRawData(). index= " << index);
395  if((nsamples/2)*2!=nsamples) { //odd number of samples
396  const uint32_t& x = m_FebBlock[index];
397  gain = x >> 30;
398  samples.push_back((short) (x>>2 & 0xfff));
399  for(unsigned int i=1;i<=(nsamples-1)/2;i++) {
400  const uint32_t& x = m_FebBlock[index+i];
401  samples.push_back((short) (x>>2 & 0xfff));
402  samples.push_back((short) (x>>18));
403  }
404  }
405  else { //even number of samples
406  const uint32_t& x = m_FebBlock[index];
407  gain = x >> 30;
408  samples.push_back((short) (x>>2 & 0xfff));
409 
410  samples.push_back((short) ((x>>18) & 0xfff));
411 
412  for (unsigned int i=1;i<nsamples/2;i++) {
413  const uint32_t& x = m_FebBlock[index+i];
414  samples.push_back((short) (x>>2 & 0xfff));
415  samples.push_back((short) (x >> 18));
416  }
417  } //end even numer of sample
419  return 1;
420 }
421 
422 
423 
424 /*
425 void LArRodBlockPhysicsV0::dumpFragment()
426 {
427  if (m_pRODblock)
428  std::cout << "Dump of LArRodFragment. Block Type=3. Size of vector=" << m_pRODblock->size() <<std::endl;
429  else
430  std::cout << "Dumping FEB block" << std::endl;
431  int size_read=0;
432  int size_tot=0;
433  if (m_pRODblock)
434  size_tot=m_pRODblock->size();
435  do {
436  std::cout <<"Begin of do-while loop:" << std::endl;
437  if (m_pRODblock)
438  m_FebBlock=&m_pRODblock->at(size_read);
439  char s[33];
440  int i;
441  int FlagPosition;
442  int CurrentPosition = 0;
443 
444  std::cout << " Head Block size = " << m_iHeadBlockSize << std::endl;
445  for (i=0;i<m_iHeadBlockSize;i++) {
446  sprintf(s,"%8.8x",m_FebBlock[CurrentPosition]);
447  std::cout << " " << CurrentPosition << " " << s
448  << " = " << (m_FebBlock[CurrentPosition]>>16)
449  << " " << (m_FebBlock[CurrentPosition] &0xffff) << std::endl;
450  CurrentPosition++;
451  }
452  std::cout << "Energy Block offset: " << LE_getHeader16(EBlkOffset) << std::endl;
453  std::cout << "tQ Block offset: " << LE_getHeader16(tQBlkOffset) << std::endl;
454  std::cout << "Raw Data Block offset " << LE_getHeader16(RawDataBlkOffset) << std::endl;
455 
456  while (CurrentPosition<getNumberOfWords())
457  {FlagPosition=CurrentPosition;
458  if (CurrentPosition==LE_getHeader16(EBlkOffset))
459  {std::cout << " Found Energy Block at offset = " << LE_getHeader16(EBlkOffset) << std::endl;
460  for (i=0; i<m_NFlaggingWords; i++) {
461  sprintf(s,"%8.8x",m_FebBlock[CurrentPosition]);
462  std::cout << " " << CurrentPosition << " " << s
463  << " Flag word" << std::endl;
464  CurrentPosition++;
465  }
466  for (i=0; i<m_NFlaggingWords*32; i++) {
467  if(getBit(&m_FebBlock[FlagPosition],i)) {
468  sprintf(s,"%8.8x",m_FebBlock[CurrentPosition]);
469  std::cout << " " << CurrentPosition << " " << s
470  << " ROD Channel " << i << " FEB Channel " << RodToFebChannel(i)
471  << " = " << m_FebBlock[CurrentPosition] << std::endl;
472  CurrentPosition++;
473  }
474  }
475  } // end if energy block
476  else if (CurrentPosition==LE_getHeader16(tQBlkOffset))
477  {std::cout << " Found tQ Block at position = " << LE_getHeader16(tQBlkOffset) << std::endl;
478  FlagPosition = CurrentPosition;
479  for (i=0; i<m_NFlaggingWords; i++) {
480  sprintf(s,"%8.8x",m_FebBlock[CurrentPosition]);
481  std::cout << " " << CurrentPosition << " " << s
482  << " Flag word" << std::endl;
483  CurrentPosition++;
484  }
485  for (i=0; i<m_NFlaggingWords*32; i++) {
486  if(getBit(&m_FebBlock[FlagPosition],i)) {
487  sprintf(s,"%8.8x",m_FebBlock[CurrentPosition]);
488  std::cout << " " << CurrentPosition << " " << s
489  << " ROD Channel " << i << " FEB Channel " << RodToFebChannel(i)
490  << " = " << (m_FebBlock[CurrentPosition]>>16)
491  << " " << (m_FebBlock[CurrentPosition] &0xffff) << std::endl;
492  CurrentPosition++;
493  }
494  }
495  }// end if tQ block
496  else if (CurrentPosition==LE_getHeader16(RawDataBlkOffset))
497  {std::cout << "Found Raw Data Block at position = " <<LE_getHeader16(RawDataBlkOffset) << std::endl;
498  FlagPosition = CurrentPosition;
499  for (i=0; i<m_NFlaggingWords; i++) {
500  sprintf(s,"%8.8x",m_FebBlock[CurrentPosition]);
501  std::cout << " " << CurrentPosition << " " << s
502  << " Flag word" << std::endl;
503  CurrentPosition++;
504  }
505  for (i=0; i<m_NFlaggingWords*32; i++) {
506  if(getBit(&m_FebBlock[FlagPosition],i)) {
507  int nsamples = LE_getHeader16(NSamples);
508  for(int j=0;j<nsamples;j+=2) {
509  sprintf(s,"%8.8x",m_FebBlock[CurrentPosition]);
510  std::cout << " " << CurrentPosition << " " << s
511  << " ROD Channel " << i << " FEB Channel " << RodToFebChannel(i)
512  << " samples " << j << " and " << j+1 << " = "
513  << ((m_FebBlock[CurrentPosition]>>16) & 0x3fff) << " " //Mask gain!
514  << (m_FebBlock[CurrentPosition] & 0xffff) << std::endl;
515  CurrentPosition++;
516  }
517  }
518  }
519  }// end if Raw Data block
520  else
521  {std::cout << "UNKNOWN block found at position" << CurrentPosition << std::endl;
522  return;
523  }
524  }// end while
525  size_read+=CurrentPosition+6;
526  std::cout << " ------- End of FEB-Block (size_read=" <<size_read << ", size_tot=" << size_tot << ") -------" << std::endl;
527  } while(size_read<size_tot);
528  std::cout << " ------------------ End Of ROD-Framgent -----------------" << std::endl;
529 }
530 */
531 
532 /*
533 void LArRodBlockPhysicsV0::dumpFragment(const std::vector<uint32_t>& v)
534 {
535  uint32_t size_tot = v.size();
536  uint32_t size_read = 0;
537  std::cout << "LAr ROD vector size = " << size_tot << std::endl;
538 
539  int ifeb=0;
540  while(size_read<size_tot)
541  {
542  m_FebBlock = &(v[0]);
543  m_FebBlock+= size_read;
544  std::cout << "LAr ROD - FEB " << ifeb << std::endl;
545  dumpFragment();
546  // next FEB
547  size_read += getNumberOfWords()+6;
548  ifeb++;
549  }
550  std::cout << "End of ROD-Fragment" << std::endl;
551 }
552 */
553 
554 
555 //Sort functions & ordering relation:
556 template<class RAWDATA>
557 bool LArRodBlockPhysicsV0::operator ()
558  //(const LArRawChannel* ch1, const LArRawChannel* ch2) const
559  (const RAWDATA* ch1, const RAWDATA* ch2) const
560 {
561  HWIdentifier id1 = ch1->channelID();
562  HWIdentifier id2 = ch2->channelID();
563 
564  HWIdentifier febId1= m_onlineHelper->feb_Id(id1);
565  HWIdentifier febId2= m_onlineHelper->feb_Id(id2);
566 
567  if(febId1 == febId2 ){
568  int cId1 = m_onlineHelper->channel(id1);
569  int cId2 = m_onlineHelper->channel(id2);
570  return FebToRodChannel(cId1) < FebToRodChannel(cId2);
571  }
572 
573  return febId1 < febId2 ;
574 }
575 
576 
577 void LArRodBlockPhysicsV0::sortDataVector(std::vector<const LArRawChannel*>& vRC)
578 {std::sort(vRC.begin(),vRC.end(),*this);}
579 
580 void LArRodBlockPhysicsV0::sortDataVector( std::vector<const LArDigit*>& vDigit)
581 {std::sort(vDigit.begin(),vDigit.end(),*this);
582 }
LArRodBlockStructure
Definition: LArRodBlockStructure.h:48
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
febId2
HWIdentifier febId2
Definition: LArRodBlockPhysicsV0.cxx:565
LArRodBlockStructure::m_vFragment
std::vector< uint32_t > * m_vFragment
Definition: LArRodBlockStructure.h:231
LArRodBlockPhysicsV0::NWTot
@ NWTot
Definition: LArRodBlockPhysicsV0.h:56
LArRodBlockPhysicsV0::m_HighEIndex
int m_HighEIndex
Definition: LArRodBlockPhysicsV0.h:126
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
LArRodBlockPhysicsV0::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: LArRodBlockPhysicsV0.h:135
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
LArRodBlockPhysicsV0::RawDataBlkOffset
@ RawDataBlkOffset
Definition: LArRodBlockPhysicsV0.h:64
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LArRodBlockPhysicsV0::setRawData
virtual void setRawData(const int channel, const std::vector< short > &samples, const uint32_t gain)
Definition: LArRodBlockPhysicsV0.cxx:211
LArRodBlockStructure::getNumberOfWords
uint32_t getNumberOfWords() const
Definition: LArRodBlockStructure.h:428
index
Definition: index.py:1
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
LArRodBlockStructure::m_FebBlockSize
int32_t m_FebBlockSize
Definition: LArRodBlockStructure.h:229
LArRodBlockStructure::LE_getVectorHeader16
uint16_t LE_getVectorHeader16(const unsigned n) const
Definition: LArRodBlockStructure.h:410
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArRodBlockPhysicsV0::m_LowEPtr
const int16_t * m_LowEPtr
Definition: LArRodBlockPhysicsV0.h:130
LArRodBlockPhysicsV0::initializeFragment
virtual void initializeFragment(std::vector< uint32_t > &fragment)
Definition: LArRodBlockPhysicsV0.cxx:244
LArRodBlockPhysicsV0::m_RawDataIndex
int m_RawDataIndex
Definition: LArRodBlockPhysicsV0.h:125
LArRodBlockPhysicsV0::getNextRawData
virtual int getNextRawData(int &channelNumber, std::vector< short > &samples, uint32_t &gain)
Definition: LArRodBlockPhysicsV0.cxx:368
LArRodBlockPhysicsV0.h
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
LArRodBlockStructure::m_FebBlock
const uint32_t * m_FebBlock
Definition: LArRodBlockStructure.h:227
LARBSDBG
#define LARBSDBG(text)
Definition: LArRodBlockPhysicsV0.cxx:25
LArRodBlockPhysicsV0::m_ECounter
int m_ECounter
Definition: LArRodBlockPhysicsV0.h:122
HWIdentifier
Definition: HWIdentifier.h:13
LArRodBlockPhysicsV0::setNextEnergy
virtual void setNextEnergy(const int channel, const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
Definition: LArRodBlockPhysicsV0.cxx:142
LArRodBlockPhysicsV0::setPointers
virtual bool setPointers()
Definition: LArRodBlockPhysicsV0.cxx:85
x
#define x
xAOD::int16_t
setScaleOne setStatusOne setSaturated int16_t
Definition: gFexGlobalRoI_v1.cxx:55
LArRodBlockStructure::m_pRODblock
std::vector< uint32_t > * m_pRODblock
Definition: LArRodBlockStructure.h:232
LArRodBlockPhysicsV0::concatinateFEBs
virtual void concatinateFEBs()
Definition: LArRodBlockPhysicsV0.cxx:336
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LArRodBlockPhysicsV0::m_HighEnergyBlock
std::vector< uint32_t > m_HighEnergyBlock
Definition: LArRodBlockPhysicsV0.h:119
LArRodBlockPhysicsV0::finalizeFEB
virtual void finalizeFEB()
Definition: LArRodBlockPhysicsV0.cxx:284
LArRodBlockPhysicsV0::HighEBlkOffset
@ HighEBlkOffset
Definition: LArRodBlockPhysicsV0.h:63
LArRodBlockStructure::m_iHeadBlockSize
unsigned short m_iHeadBlockSize
Definition: LArRodBlockStructure.h:221
LArRodBlockStructure::getHeader32
uint32_t getHeader32(const unsigned n) const
Definition: LArRodBlockStructure.h:365
LArDigit.h
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
LArRodBlockPhysicsV0::m_logstr
MsgStream m_logstr
Definition: LArRodBlockPhysicsV0.h:142
id2
HWIdentifier id2
Definition: LArRodBlockPhysicsV0.cxx:562
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArRodBlockPhysicsV0::LArRodBlockPhysicsV0
LArRodBlockPhysicsV0()
Definition: LArRodBlockPhysicsV0.cxx:37
Athena
Some weak symbol referencing magic...
Definition: AthLegacySequence.h:21
LArRodBlockPhysicsV0::FebToRodChannel
int FebToRodChannel(int ch) const
Definition: LArRodBlockPhysicsV0.h:145
beamspotman.n
n
Definition: beamspotman.py:731
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArRodBlockPhysicsV0::clearBlocks
void clearBlocks()
Definition: LArRodBlockPhysicsV0.cxx:69
LArRodBlockPhysicsV0::setNumberOfSamples
virtual void setNumberOfSamples(const uint8_t n)
Definition: LArRodBlockPhysicsV0.cxx:131
LArRodBlockPhysicsV0::m_DummyBitMap
static const uint32_t m_DummyBitMap[4]
Definition: LArRodBlockPhysicsV0.h:136
LArRodBlockPhysicsV0::m_LowEnergyBlock
std::vector< uint32_t > m_LowEnergyBlock
Definition: LArRodBlockPhysicsV0.h:118
LArRodBlockPhysicsV0::initializeFEB
virtual void initializeFEB(const uint32_t id)
Definition: LArRodBlockPhysicsV0.cxx:272
LArRodBlockStructure::getBit
int getBit(const uint32_t *const p, const unsigned chan) const
Definition: LArRodBlockStructure.h:433
LArRodBlockPhysicsV0::NGainNSamples
@ NGainNSamples
Definition: LArRodBlockPhysicsV0.h:65
LArRodBlockStructure::LE_setHeader16
void LE_setHeader16(const unsigned n, const uint16_t w)
Definition: LArRodBlockStructure.h:417
LArRawChannel.h
LArRodBlockPhysicsV0::resetPointers
virtual void resetPointers()
Definition: LArRodBlockPhysicsV0.cxx:75
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
LArRodBlockPhysicsV0::FEBID
@ FEBID
Definition: LArRodBlockPhysicsV0.h:58
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
LArOnlineID
Definition: LArOnlineID.h:20
LArRodBlockPhysicsV0::endtag
@ endtag
Definition: LArRodBlockPhysicsV0.h:72
LArRodBlockPhysicsV0::m_LowEIndex
int m_LowEIndex
Definition: LArRodBlockPhysicsV0.h:124
LArRodBlockPhysicsV0::setNumberOfGains
virtual void setNumberOfGains(const uint8_t n)
Definition: LArRodBlockPhysicsV0.cxx:136
LArRodBlockPhysicsV0::m_HighEPtr
const int32_t * m_HighEPtr
Definition: LArRodBlockPhysicsV0.h:128
LArRodBlockStructure::LE_getHeader16
uint16_t LE_getHeader16(const unsigned n) const
Definition: LArRodBlockStructure.h:405
ReadOfcFromCool.nsamples
nsamples
Definition: ReadOfcFromCool.py:115
LArRodBlockStructure::m_MiddleHeaderSize
int32_t m_MiddleHeaderSize
Definition: LArRodBlockStructure.h:239
LArRodBlockPhysicsV0::m_NFlaggingWords
unsigned short m_NFlaggingWords
Definition: LArRodBlockPhysicsV0.h:132
DeMoScan.index
string index
Definition: DeMoScan.py:364
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
DEBUG
#define DEBUG
Definition: page_access.h:11
LArRodBlockStructure::setBit
void setBit(uint32_t *const p, const unsigned chan)
Definition: LArRodBlockStructure.h:444
LArRodBlockPhysicsV0::LowEBlkOffset
@ LowEBlkOffset
Definition: LArRodBlockPhysicsV0.h:62
LArRodBlockPhysicsV0::m_FlagPtr
const uint32_t * m_FlagPtr
Definition: LArRodBlockPhysicsV0.h:129
febId1
HWIdentifier febId1
Definition: LArRodBlockPhysicsV0.cxx:564
LArRodBlockPhysicsV0::m_RawDataCounter
int m_RawDataCounter
Definition: LArRodBlockPhysicsV0.h:123
LArRodBlockPhysicsV0::m_EIndex
int m_EIndex
Definition: LArRodBlockPhysicsV0.h:127
LArRodBlockStructure::m_channelsPerFEB
int m_channelsPerFEB
Definition: LArRodBlockStructure.h:225
LArRodBlockPhysicsV0::m_RawDataBlock
std::vector< uint32_t > m_RawDataBlock
Definition: LArRodBlockPhysicsV0.h:120
LArRodBlockPhysicsV0::sortDataVector
virtual void sortDataVector(std::vector< const LArRawChannel * > &)
LArRodBlockStructure::m_mFebBlocks
FEBMAPTYPE m_mFebBlocks
Definition: LArRodBlockStructure.h:234
LArOnlineID.h
LArRodBlockStructure::setHeader32
void setHeader32(const unsigned n, const uint32_t w)
Definition: LArRodBlockStructure.h:394