ATLAS Offline Software
LArRodBlockPhysicsV1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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 
36 
38 m_logstr(Athena::getMessageSvc(), BlockType())
39 {
40  // retrieve onlineHelper
41  const LArOnlineID* online_id;
43  ISvcLocator* svcLoc = Gaudi::svcLocator( );
44  StatusCode sc =svcLoc->service( "DetectorStore", detStore );
45  if (sc.isFailure()) {
46  m_logstr << MSG::ERROR << "Unable to locate DetectorStore" << endmsg;
47  std::abort();
48  }
49  sc = detStore->retrieve(online_id, "LArOnlineID");
50  if (sc.isFailure()) {
51  m_logstr << MSG::FATAL << "Could not get LArOnlineID helper !" << endmsg;
52  std::abort();
53  }
54  else {
55  m_onlineHelper=online_id;
56  m_logstr << MSG::DEBUG << " Found the LArOnlineID helper. " << endmsg;
57  }
58 
59  m_iHeadBlockSize=endtag/2; // The implicit cast rounds down to the right size
62  m_vFragment=NULL;
63  m_FebBlock=NULL;
64  m_pRODblock=NULL;
65  m_FlagPtr=NULL;
66  m_HighEPtr=NULL;
67  m_LowEPtr=NULL;
68 }
69 
70 // clear temporary block vectors
72 { m_HighEnergyBlock.clear();
73  m_LowEnergyBlock.clear();
74  m_RawDataBlock.clear();
75 }
76 
78 {m_ECounter=0;
80  m_LowEIndex=0;
82  m_HighEIndex=0;
83  m_EIndex=0;
84 }
85 
86 //For reading (to speed up the process)
88 {//Set pointers to data blocks (pesuming, they exist)
93  }
94  else
95  {//m_FlagPtr=NULL;
96  //m_LowEPtr=NULL;
97  //Bugfix, 9.8.2004, WL: Set pointer to dummy map to read FEB with only high energy block
99  m_LowEPtr=(const int16_t*)m_FlagPtr;
100  }
103  else
104  m_HighEPtr=NULL;
105  }
106  else
107  {m_FlagPtr=NULL;
108  m_LowEPtr=NULL;
109  m_HighEPtr=NULL;
110  }
111 #ifdef LARBSDBGOUTPUT
112  std::cout << "Fragment offsets: (m_NFlaggingWords=" << m_NFlaggingWords << ")" << std::endl;
113  std::cout << "Raw Data: " << getHeader16(RawDataBlkOffset)<< std::endl;
114  if (m_FlagPtr)
115  std::cout << "Flags: " << getHeader16(LowEBlkOffset)<< std::endl;
116  else
117  std::cout << "Flags: not present" << std::endl;
118 
119  if (m_LowEPtr)
120  std::cout << "Low Energy: " << getHeader16(LowEBlkOffset)+m_NFlaggingWords << std::endl;
121  else
122  std::cout << "Low Energy: not present" << std::endl;
123 
124 
125  if (m_HighEPtr)
126  std::cout << "High Energy: " << getHeader16(HighEBlkOffset)<< std::endl;
127  else
128  std::cout << "High Energy: not present" << std::endl;
129 #endif
130  return true;
131 }
132 
135  setHeader16(NGainNSamples,(oldword & 0xFF00) | n);
136 }
137 
140  setHeader16(NGainNSamples,(oldword & 0x00FF) | (n<<8));
141 }
142 
143 
144 void LArRodBlockPhysicsV1::setNextEnergy(const int channel, const int32_t energy,
145  const int32_t time, const int32_t quality, const uint32_t gain) {
146  int rcNb=FebToRodChannel(channel);
147  //rcNb ist supposed to equal or bigger than m_EIndex.
148  //In the latter case, we fill up the missing channels with zero
149  if (rcNb<m_EIndex) {
150  m_logstr << MSG::ERROR << "LArRODBlockStructure ERROR: Internal error. Channels not ordered correctly. rcNb=" << rcNb
151  << " m_EIndex=" << m_EIndex << endmsg;
152  return;
153  }
154  //Fill up missing channels with zeros:
155  while (m_EIndex<rcNb)
156  setNextEnergy(0,0,-1,0);
157  //Add data...
158  setNextEnergy(energy,time,quality,gain);
159  return;
160 }
161 //Private function, expects channel number is rod-style ordering
162 void LArRodBlockPhysicsV1::setNextEnergy(const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
163 {
164  if (m_EIndex>=m_channelsPerFEB) //Use m_EIndex to count total number of channels
165  {m_logstr << MSG::ERROR << "LArRodBlockStructure ERROR: Attempt to write Energy for channel "
166  << m_EIndex << " channels into a FEB!" <<endmsg;
167  return;
168  }
169  LARBSDBG("LArRodBlockStructure: Setting Energy for channel " << m_EIndex << ". E=" << energy);
170  if (quality<0 && energy<0x7FFE && gain==0) { //Write into Low Energy block
171  m_LowEIndex++; //Use m_LowEIndex to count the channels in the Low Energy block
172  ShortLong twoValues{};
173  twoValues.s[0]=0;
174  twoValues.s[1]=0;
175  if (m_LowEIndex%2==1) { //This is an odd number, simply add data at the bottom of the block
176  twoValues.s[0]=(int16_t)energy;
177  }
178  else { //Even number: Merging with previous block
179  uint32_t oneValue=m_LowEnergyBlock[m_LowEnergyBlock.size()-1]; //Take last element of vector
180  m_LowEnergyBlock.pop_back();
181  int16_t* valptr=reinterpret_cast<int16_t*>(&oneValue);
182  twoValues.s[0]=valptr[0];
183  twoValues.s[1]=(int16_t)energy;
184  }
185  LARBSDBG("Writing words: val0= " << twoValues.s[0] << " val1= " << twoValues.s[1]);
186  m_LowEnergyBlock.push_back(twoValues.l);
187  LARBSDBG("Writing Raw data to Low E block. E=" << energy);
188  }
189  else //Write into High Energy block
191  m_HighEnergyBlock.push_back(energy);
192  uint32_t t_sign;
193  uint32_t abs_time;
194  if (time<0)
195  t_sign=1;
196  else
197  t_sign=0;
198  abs_time=abs(time);
199  if (abs_time>0x1fff)
200  abs_time=0x1fff;
201  //uint32_t gtQ = (gain << 30) | ((time & 0x3fff)<<16) | (0xffff & quality);
202  uint32_t gtQ = (gain << 30) | (t_sign<<29) | ((abs_time & 0x1fff)<<16) | (0xffff & quality);
203  m_HighEnergyBlock.push_back(gtQ);
204  LARBSDBG("Writing Raw data to High E block. E=" << energy << " Q=" << quality);
205  }
206  m_EIndex++;
207  // if (energy>0)
208  //m_ECounter++;
209 }
210 
211 
212 void LArRodBlockPhysicsV1::setRawData(const int channel, const std::vector<short>& samples, const uint32_t gain) {
213  //Convert Feb to Rod Channel Number:
214  //int rcNb=(channel>>3) + ((channel&0x7)<<4);
215  int rcNb=FebToRodChannel(channel);
216  if (rcNb>=m_channelsPerFEB)
217  {m_logstr << MSG::ERROR << "Attempt to write Energy for channel " << rcNb << " channels into a FEB!" << endmsg;
218  return;
219  }
220  unsigned int nsamples = getVectorHeader16(NGainNSamples) & 0x00FF;
221  if(samples.size() != nsamples) {
222  m_logstr << MSG::ERROR << "Number of samples mismatch!\n";
223  m_logstr << " nsamples =" << nsamples;
224  m_logstr << " samples.size() =" << samples.size() << endmsg;
225  std::abort();
226  }
227 
228  setBit(&m_RawDataBlock[0],rcNb);
229  //Samples have 12 bit and are shifted to the left by 2 bits.
230  // odd samples in high bits, even samples in low bits
231  if((nsamples/2)*2!=nsamples) { //odd number of samples - gain is alone
232  m_RawDataBlock.push_back((gain<<30) | samples[0]<<2);
233  for (unsigned int i=1;i<nsamples;i+=2)
234  m_RawDataBlock.push_back((samples[i+1]<<18) | samples[i]<<2);
235  }
236  else { //even number of samples - gain is packed with sample 0
237  m_RawDataBlock.push_back((gain<<30) | (samples[1]<<18) | samples[0]<<2);
238  for (unsigned int i=2;i<nsamples;i+=2)
239  m_RawDataBlock.push_back((samples[i+1]<<18) | samples[i]<<2);
240  }
241 }
242 
243 
244 //For writing: takes existing Fragment and splits it into Feb-Blocks
245 void LArRodBlockPhysicsV1::initializeFragment(std::vector<uint32_t>& fragment)
246 {
247  m_pRODblock=&fragment; //remember pointer to fragment
248  if (fragment.size()>m_iHeadBlockSize) { //Got filled fragment
249  unsigned int sizeRead=0;
250  //Store existing data in the FEB-Map
251  while (sizeRead<fragment.size()) {
253  FebIter=fragment.begin()+sizeRead; //Store pointer to current Feb-Header
254  m_FebBlock=&(*FebIter); //Set m_FebBlock in order to use getHeader-functions.
255  uint32_t currFEBid=getHeader32(FEBID); //Get this FEB-ID
256  uint16_t currFebSize=getNumberOfWords(); //Size of this FEB-Block
257  //std::cout << "FebID=" << currFEBid << " FEBSize=" << currFebSize << " Vector size=" << fragment.size() << std::endl;
258  if (FebIter+currFebSize>fragment.end()) {
259  fragment.clear(); //Clear existing vector
260  m_logstr << MSG::ERROR << "Got inconsistent ROD-Fragment!" << endmsg;
261  return;
262  }
263  m_mFebBlocks[currFEBid].assign(FebIter,FebIter+currFebSize); //Copy data from ROD-fragment into FEB-Block
264  sizeRead+=currFebSize+m_MiddleHeaderSize;//6 is the middle header size
265  LARBSDBG("Found FEB-id " << currFEBid << " in existing ROD-Fragment");
266  } // end while
267  }
268  fragment.clear(); //Clear existing vector
269  return;
270 }
271 
272 //For writing: Initalizes a single FEB-Block
275  if (m_vFragment->size()<m_iHeadBlockSize) //Got empty or spoiled fragment
276  {m_vFragment->resize(m_iHeadBlockSize,0); //Initialize FEB-Header
277  setHeader32(FEBID,id); //Set Feb ID
278  }
279 
282  resetPointers();
283 }
284 
286 {
287 //Complete non-complete Energy block
288  while (m_EIndex<m_channelsPerFEB)
289  setNextEnergy(0,0,-1,0);//E=0,t=0,q=-1,G=0
290  // Energies
291  unsigned int n;
292  uint16_t BlockOffset;
293  //Low energy block....
294  n = m_LowEnergyBlock.size();
295  BlockOffset=getVectorHeader16(LowEBlkOffset);
296  //Check if Low Energy Block exists and is not yet part of the fragment
297  LARBSDBG("Checking Low Energy Block n=" << n << "BlockOffset=" << BlockOffset);
298  if (n>m_NFlaggingWords && !BlockOffset)
300  for (unsigned i=0;i<n;i++)
301  m_vFragment->push_back(m_LowEnergyBlock[i]);
302  }
303  //High energy block...
304  n = m_HighEnergyBlock.size();
305  BlockOffset=getVectorHeader16(HighEBlkOffset);
306  LARBSDBG("Checking High Energy Block n=" << n << "BlockOffset=" << BlockOffset);
307  //Check if High Energy-Block exists and is not yet part of the fragment
308  if (n && !BlockOffset)
310  for(unsigned int i=0;i<n;i++)
311  m_vFragment->push_back(m_HighEnergyBlock[i]);
312  }
313 
314  // Raw data
315  LARBSDBG("Checking Raw Data Block");
316  n = m_RawDataBlock.size();
317  BlockOffset=getVectorHeader16(RawDataBlkOffset);
318  LARBSDBG("Checking Raw Data Block. n=" << n << "BlockOffset=" << BlockOffset);
319  //Check if Raw Data block exists and is not yet part of the fragment
320  if (n>m_NFlaggingWords && !BlockOffset)
322  for(unsigned int i=0;i<n;i++)
323  m_vFragment->push_back(m_RawDataBlock[i]);
324  }
325  setHeader32(NWTot,m_vFragment->size());
326  LARBSDBG("Offsets:" << std::endl
327  << "Raw Data: " << getVectorHeader16(RawDataBlkOffset) << std::endl
328  <<"Low Energy: " << getVectorHeader16(LowEBlkOffset)<< std::endl
329  << "High Energy: " << getVectorHeader16(HighEBlkOffset)<< std::endl
330  << "Energy-index:" << m_EIndex << std::endl
331  << "Filled channels: " << m_ECounter << std::endl);
332  clearBlocks();
333  return;
334 }
335 
336 
338 {
339  //std::cout << "Concatinating FEBs. Have "<< m_mFebBlocks.size() <<" febs." << std::endl;
340  FEBMAPTYPE::const_iterator feb_it_b=m_mFebBlocks.begin();
341  FEBMAPTYPE::const_iterator feb_it_e=m_mFebBlocks.end();
342  FEBMAPTYPE::const_iterator feb_it;
343  for (feb_it=feb_it_b;feb_it!=feb_it_e;++feb_it) {
344  if (feb_it!=feb_it_b) //Not first Feb
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 LArRodBlockPhysicsV1::getNextRawData(int& channelNumber, std::vector<short>& samples, uint32_t& gain)
369 {
370  LARBSDBG("in LArRodBlockPhysicsV1::getNextRawData.");
371  LARBSDBG("m_RawDataCounter=" << m_RawDataCounter << " m_RawDataIndex="<< m_RawDataIndex);
372  LARBSDBG("m_channelsPerFEB=" << m_channelsPerFEB);
373  const int flags=(int) getHeader16(RawDataBlkOffset);
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 = 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 LArRodBlockPhysicsV1::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: " << getHeader16(EBlkOffset) << std::endl;
453  std::cout << "tQ Block offset: " << getHeader16(tQBlkOffset) << std::endl;
454  std::cout << "Raw Data Block offset " << getHeader16(RawDataBlkOffset) << std::endl;
455 
456  while (CurrentPosition<getNumberOfWords())
457  {FlagPosition=CurrentPosition;
458  if (CurrentPosition==getHeader16(EBlkOffset))
459  {std::cout << " Found Energy Block at offset = " << 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==getHeader16(tQBlkOffset))
477  {std::cout << " Found tQ Block at position = " << 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==getHeader16(RawDataBlkOffset))
497  {std::cout << "Found Raw Data Block at position = " <<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 = 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 LArRodBlockPhysicsV1::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 LArRodBlockPhysicsV1::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 LArRodBlockPhysicsV1::sortDataVector(std::vector<const LArRawChannel*>& vRC)
578 {std::sort(vRC.begin(),vRC.end(),*this);}
579 
580 void LArRodBlockPhysicsV1::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
LArRodBlockPhysicsV1::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: LArRodBlockPhysicsV1.h:136
LArRodBlockStructure::m_vFragment
std::vector< uint32_t > * m_vFragment
Definition: LArRodBlockStructure.h:231
LArRodBlockPhysicsV1::m_EIndex
int m_EIndex
Definition: LArRodBlockPhysicsV1.h:128
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
LArRodBlockPhysicsV1::m_FlagPtr
const uint32_t * m_FlagPtr
Definition: LArRodBlockPhysicsV1.h:130
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
LArRodBlockPhysicsV1::endtag
@ endtag
Definition: LArRodBlockPhysicsV1.h:72
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
LArRodBlockPhysicsV1::m_LowEnergyBlock
std::vector< uint32_t > m_LowEnergyBlock
Definition: LArRodBlockPhysicsV1.h:119
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
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
LArRodBlockPhysicsV1::setNextEnergy
virtual void setNextEnergy(const int channel, const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
Definition: LArRodBlockPhysicsV1.cxx:144
LArRodBlockPhysicsV1::RawDataBlkOffset
@ RawDataBlkOffset
Definition: LArRodBlockPhysicsV1.h:64
LArRodBlockPhysicsV1::m_LowEIndex
int m_LowEIndex
Definition: LArRodBlockPhysicsV1.h:125
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArRodBlockPhysicsV1::setNumberOfSamples
virtual void setNumberOfSamples(const uint8_t n)
Definition: LArRodBlockPhysicsV1.cxx:133
LArRodBlockPhysicsV1.h
LArRodBlockPhysicsV1::initializeFragment
virtual void initializeFragment(std::vector< uint32_t > &fragment)
Definition: LArRodBlockPhysicsV1.cxx:245
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
LArRodBlockStructure::m_FebBlock
const uint32_t * m_FebBlock
Definition: LArRodBlockStructure.h:227
LArRodBlockStructure::setHeader16
void setHeader16(const unsigned n, const uint16_t w)
Definition: LArRodBlockStructure.h:380
LArRodBlockPhysicsV1::FEBID
@ FEBID
Definition: LArRodBlockPhysicsV1.h:58
HWIdentifier
Definition: HWIdentifier.h:13
LARBSDBG
#define LARBSDBG(text)
Definition: LArRodBlockPhysicsV1.cxx:25
LArRodBlockPhysicsV1::m_LowEPtr
const int16_t * m_LowEPtr
Definition: LArRodBlockPhysicsV1.h:131
x
#define x
LArRodBlockPhysicsV1::m_RawDataCounter
int m_RawDataCounter
Definition: LArRodBlockPhysicsV1.h:124
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
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
LArRodBlockPhysicsV1::HighEBlkOffset
@ HighEBlkOffset
Definition: LArRodBlockPhysicsV1.h:63
LArRodBlockPhysicsV1::m_RawDataBlock
std::vector< uint32_t > m_RawDataBlock
Definition: LArRodBlockPhysicsV1.h:121
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LArRodBlockPhysicsV1::LowEBlkOffset
@ LowEBlkOffset
Definition: LArRodBlockPhysicsV1.h:62
LArRodBlockPhysicsV1::NGainNSamples
@ NGainNSamples
Definition: LArRodBlockPhysicsV1.h:65
LArRodBlockStructure::m_iHeadBlockSize
unsigned short m_iHeadBlockSize
Definition: LArRodBlockStructure.h:221
LArRodBlockPhysicsV1::setPointers
virtual bool setPointers()
Definition: LArRodBlockPhysicsV1.cxx:87
LArRodBlockStructure::getHeader32
uint32_t getHeader32(const unsigned n) const
Definition: LArRodBlockStructure.h:365
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
LArRodBlockPhysicsV1::concatinateFEBs
virtual void concatinateFEBs()
Definition: LArRodBlockPhysicsV1.cxx:337
LArRodBlockStructure::getVectorHeader16
uint16_t getVectorHeader16(const unsigned n) const
Definition: LArRodBlockStructure.h:368
LArDigit.h
LArRodBlockPhysicsV1::setNumberOfGains
virtual void setNumberOfGains(const uint8_t n)
Definition: LArRodBlockPhysicsV1.cxx:138
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
lumiFormat.i
int i
Definition: lumiFormat.py:92
Athena
Some weak symbol referencing magic...
Definition: AthLegacySequence.h:21
id2
HWIdentifier id2
Definition: LArRodBlockPhysicsV1.cxx:562
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
01SubmitToGrid.samples
samples
Definition: 01SubmitToGrid.py:58
LArRodBlockPhysicsV1::m_HighEPtr
const int32_t * m_HighEPtr
Definition: LArRodBlockPhysicsV1.h:129
LArRodBlockPhysicsV1::NWTot
@ NWTot
Definition: LArRodBlockPhysicsV1.h:56
LArRodBlockStructure::getBit
int getBit(const uint32_t *const p, const unsigned chan) const
Definition: LArRodBlockStructure.h:433
LArRodBlockPhysicsV1::m_logstr
MsgStream m_logstr
Definition: LArRodBlockPhysicsV1.h:143
LArRodBlockPhysicsV1::m_RawDataIndex
int m_RawDataIndex
Definition: LArRodBlockPhysicsV1.h:126
LArRawChannel.h
LArRodBlockPhysicsV1::initializeFEB
virtual void initializeFEB(const uint32_t id)
Definition: LArRodBlockPhysicsV1.cxx:273
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
LArRodBlockPhysicsV1::resetPointers
virtual void resetPointers()
Definition: LArRodBlockPhysicsV1.cxx:77
LArRodBlockPhysicsV1::FebToRodChannel
int FebToRodChannel(int ch) const
Definition: LArRodBlockPhysicsV1.h:147
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
LArRodBlockPhysicsV1::m_DummyBitMap
static const uint32_t m_DummyBitMap[4]
Definition: LArRodBlockPhysicsV1.h:137
LArRodBlockPhysicsV1::clearBlocks
void clearBlocks()
Definition: LArRodBlockPhysicsV1.cxx:71
LArOnlineID
Definition: LArOnlineID.h:20
LArRodBlockPhysicsV1::setRawData
virtual void setRawData(const int channel, const std::vector< short > &samples, const uint32_t gain)
Definition: LArRodBlockPhysicsV1.cxx:212
ReadOfcFromCool.nsamples
nsamples
Definition: ReadOfcFromCool.py:115
LArRodBlockStructure::m_MiddleHeaderSize
int32_t m_MiddleHeaderSize
Definition: LArRodBlockStructure.h:239
DeMoScan.index
string index
Definition: DeMoScan.py:362
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
LArRodBlockPhysicsV1::m_HighEnergyBlock
std::vector< uint32_t > m_HighEnergyBlock
Definition: LArRodBlockPhysicsV1.h:120
LArRodBlockPhysicsV1::sortDataVector
virtual void sortDataVector(std::vector< const LArRawChannel * > &)
LArRodBlockPhysicsV1::LArRodBlockPhysicsV1
LArRodBlockPhysicsV1()
Definition: LArRodBlockPhysicsV1.cxx:37
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
LArRodBlockPhysicsV1::m_ECounter
int m_ECounter
Definition: LArRodBlockPhysicsV1.h:123
DEBUG
#define DEBUG
Definition: page_access.h:11
febId1
HWIdentifier febId1
Definition: LArRodBlockPhysicsV1.cxx:564
LArRodBlockStructure::setBit
void setBit(uint32_t *const p, const unsigned chan)
Definition: LArRodBlockStructure.h:444
LArRodBlockPhysicsV1::finalizeFEB
virtual void finalizeFEB()
Definition: LArRodBlockPhysicsV1.cxx:285
LArRodBlockStructure::m_channelsPerFEB
int m_channelsPerFEB
Definition: LArRodBlockStructure.h:225
LArRodBlockPhysicsV1::m_HighEIndex
int m_HighEIndex
Definition: LArRodBlockPhysicsV1.h:127
LArRodBlockStructure::getHeader16
uint16_t getHeader16(const unsigned n) const
Definition: LArRodBlockStructure.h:355
LArRodBlockPhysicsV1::getNextRawData
virtual int getNextRawData(int &channelNumber, std::vector< short > &samples, uint32_t &gain)
Definition: LArRodBlockPhysicsV1.cxx:368
LArRodBlockPhysicsV1::m_NFlaggingWords
unsigned short m_NFlaggingWords
Definition: LArRodBlockPhysicsV1.h:133
LArRodBlockStructure::m_mFebBlocks
FEBMAPTYPE m_mFebBlocks
Definition: LArRodBlockStructure.h:234
LArOnlineID.h
febId2
HWIdentifier febId2
Definition: LArRodBlockPhysicsV1.cxx:565
LArRodBlockStructure::setHeader32
void setHeader32(const unsigned n, const uint32_t w)
Definition: LArRodBlockStructure.h:394