ATLAS Offline Software
LArRodBlockPhysicsV1.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 
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 (pesuming, 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: " << getHeader16(RawDataBlkOffset)<< std::endl;
112  if (m_FlagPtr)
113  std::cout << "Flags: " << getHeader16(LowEBlkOffset)<< std::endl;
114  else
115  std::cout << "Flags: not present" << std::endl;
116 
117  if (m_LowEPtr)
118  std::cout << "Low Energy: " << 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: " << getHeader16(HighEBlkOffset)<< std::endl;
125  else
126  std::cout << "High Energy: not present" << std::endl;
127 #endif
128  return true;
129 }
130 
133  setHeader16(NGainNSamples,(oldword & 0xFF00) | n);
134 }
135 
138  setHeader16(NGainNSamples,(oldword & 0x00FF) | (n<<8));
139 }
140 
141 
142 void LArRodBlockPhysicsV1::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  return;
158 }
159 //Private function, expects channel number is rod-style ordering
160 void LArRodBlockPhysicsV1::setNextEnergy(const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
161 {
162  if (m_EIndex>=m_channelsPerFEB) //Use m_EIndex to count total number of channels
163  {m_logstr << MSG::ERROR << "LArRodBlockStructure Error: Attempt to write Energy for channel "
164  << m_EIndex << " channels into a FEB!" <<endmsg;
165  return;
166  }
167  LARBSDBG("LArRodBlockStructure: Setting Energy for channel " << m_EIndex << ". E=" << energy);
168  if (quality<0 && energy<0x7FFE && gain==0) { //Write into Low Energy block
169  m_LowEIndex++; //Use m_LowEIndex to count the channels in the Low Energy block
170  ShortLong twoValues{};
171  twoValues.s[0]=0;
172  twoValues.s[1]=0;
173  if (m_LowEIndex%2==1) { //This is an odd number, simply add data at the bottom of the block
174  twoValues.s[0]=(int16_t)energy;
175  }
176  else { //Even number: Merging with previous block
177  uint32_t oneValue=m_LowEnergyBlock[m_LowEnergyBlock.size()-1]; //Take last element of vector
178  m_LowEnergyBlock.pop_back();
179  int16_t* valptr=reinterpret_cast<int16_t*>(&oneValue);
180  twoValues.s[0]=valptr[0];
181  twoValues.s[1]=(int16_t)energy;
182  }
183  LARBSDBG("Writing words: val0= " << twoValues.s[0] << " val1= " << twoValues.s[1]);
184  m_LowEnergyBlock.push_back(twoValues.l);
185  LARBSDBG("Writing Raw data to Low E block. E=" << energy);
186  }
187  else //Write into High Energy block
189  m_HighEnergyBlock.push_back(energy);
190  uint32_t t_sign;
191  uint32_t abs_time;
192  if (time<0)
193  t_sign=1;
194  else
195  t_sign=0;
196  abs_time=abs(time);
197  if (abs_time>0x1fff)
198  abs_time=0x1fff;
199  //uint32_t gtQ = (gain << 30) | ((time & 0x3fff)<<16) | (0xffff & quality);
200  uint32_t gtQ = (gain << 30) | (t_sign<<29) | ((abs_time & 0x1fff)<<16) | (0xffff & quality);
201  m_HighEnergyBlock.push_back(gtQ);
202  LARBSDBG("Writing Raw data to High E block. E=" << energy << " Q=" << quality);
203  }
204  m_EIndex++;
205  // if (energy>0)
206  //m_ECounter++;
207 }
208 
209 
210 void LArRodBlockPhysicsV1::setRawData(const int channel, const std::vector<short>& samples, const uint32_t gain) {
211  //Convert Feb to Rod Channel Number:
212  //int rcNb=(channel>>3) + ((channel&0x7)<<4);
213  int rcNb=FebToRodChannel(channel);
214  if (rcNb>=m_channelsPerFEB)
215  {m_logstr << MSG::ERROR << "Attempt to write Energy for channel " << rcNb << " channels into a FEB!" << endmsg;
216  return;
217  }
218  unsigned int nsamples = getVectorHeader16(NGainNSamples) & 0x00FF;
219  if(samples.size() != nsamples) {
220  m_logstr << MSG::ERROR << "Number of samples mismatch!\n";
221  m_logstr << " nsamples =" << nsamples;
222  m_logstr << " samples.size() =" << samples.size() << endmsg;
223  std::abort();
224  }
225 
226  setBit(&m_RawDataBlock[0],rcNb);
227  //Samples have 12 bit and are shifted to the left by 2 bits.
228  // odd samples in high bits, even samples in low bits
229  if((nsamples/2)*2!=nsamples) { //odd number of samples - gain is alone
230  m_RawDataBlock.push_back((gain<<30) | samples[0]<<2);
231  for (unsigned int i=1;i<nsamples;i+=2)
232  m_RawDataBlock.push_back((samples[i+1]<<18) | samples[i]<<2);
233  }
234  else { //even number of samples - gain is packed with sample 0
235  m_RawDataBlock.push_back((gain<<30) | (samples[1]<<18) | samples[0]<<2);
236  for (unsigned int i=2;i<nsamples;i+=2)
237  m_RawDataBlock.push_back((samples[i+1]<<18) | samples[i]<<2);
238  }
239 }
240 
241 
242 //For writing: takes existing Fragment and splits it into Feb-Blocks
243 void LArRodBlockPhysicsV1::initializeFragment(std::vector<uint32_t>& fragment)
244 {
245  m_pRODblock=&fragment; //remember pointer to fragment
246  if (fragment.size()>m_iHeadBlockSize) { //Got filled fragment
247  unsigned int sizeRead=0;
248  //Store existing data in the FEB-Map
249  while (sizeRead<fragment.size()) {
251  FebIter=fragment.begin()+sizeRead; //Store pointer to current Feb-Header
252  m_FebBlock=&(*FebIter); //Set m_FebBlock in order to use getHeader-functions.
253  uint32_t currFEBid=getHeader32(FEBID); //Get this FEB-ID
254  uint16_t currFebSize=getNumberOfWords(); //Size of this FEB-Block
255  //std::cout << "FebID=" << currFEBid << " FEBSize=" << currFebSize << " Vector size=" << fragment.size() << std::endl;
256  if (FebIter+currFebSize>fragment.end()) {
257  fragment.clear(); //Clear existing vector
258  m_logstr << MSG::ERROR << "Got inconsistent ROD-Fragment!" << endmsg;
259  return;
260  }
261  m_mFebBlocks[currFEBid].assign(FebIter,FebIter+currFebSize); //Copy data from ROD-fragment into FEB-Block
262  sizeRead+=currFebSize+m_MiddleHeaderSize;//6 is the middle header size
263  LARBSDBG("Found FEB-id " << currFEBid << " in existing ROD-Fragment");
264  } // end while
265  }
266  fragment.clear(); //Clear existing vector
267  return;
268 }
269 
270 //For writing: Initalizes a single FEB-Block
273  if (m_vFragment->size()<m_iHeadBlockSize) //Got empty or spoiled fragment
274  {m_vFragment->resize(m_iHeadBlockSize,0); //Initialize FEB-Header
275  setHeader32(FEBID,id); //Set Feb ID
276  }
277 
280  resetPointers();
281 }
282 
284 {
285 //Complete non-complete Energy block
286  while (m_EIndex<m_channelsPerFEB)
287  setNextEnergy(0,0,-1,0);//E=0,t=0,q=-1,G=0
288  // Energies
289  unsigned int n;
290  uint16_t BlockOffset;
291  //Low energy block....
292  n = m_LowEnergyBlock.size();
293  BlockOffset=getVectorHeader16(LowEBlkOffset);
294  //Check if Low Energy Block exists and is not yet part of the fragment
295  LARBSDBG("Checking Low Energy Block n=" << n << "BlockOffset=" << BlockOffset);
296  if (n>m_NFlaggingWords && !BlockOffset)
298  for (unsigned i=0;i<n;i++)
299  m_vFragment->push_back(m_LowEnergyBlock[i]);
300  }
301  //High energy block...
302  n = m_HighEnergyBlock.size();
303  BlockOffset=getVectorHeader16(HighEBlkOffset);
304  LARBSDBG("Checking High Energy Block n=" << n << "BlockOffset=" << BlockOffset);
305  //Check if High Energy-Block exists and is not yet part of the fragment
306  if (n && !BlockOffset)
308  for(unsigned int i=0;i<n;i++)
309  m_vFragment->push_back(m_HighEnergyBlock[i]);
310  }
311 
312  // Raw data
313  LARBSDBG("Checking Raw Data Block");
314  n = m_RawDataBlock.size();
315  BlockOffset=getVectorHeader16(RawDataBlkOffset);
316  LARBSDBG("Checking Raw Data Block. n=" << n << "BlockOffset=" << BlockOffset);
317  //Check if Raw Data block exists and is not yet part of the fragment
318  if (n>m_NFlaggingWords && !BlockOffset)
320  for(unsigned int i=0;i<n;i++)
321  m_vFragment->push_back(m_RawDataBlock[i]);
322  }
323  setHeader32(NWTot,m_vFragment->size());
324  LARBSDBG("Offsets:" << std::endl
325  << "Raw Data: " << getVectorHeader16(RawDataBlkOffset) << std::endl
326  <<"Low Energy: " << getVectorHeader16(LowEBlkOffset)<< std::endl
327  << "High Energy: " << getVectorHeader16(HighEBlkOffset)<< std::endl
328  << "Energy-index:" << m_EIndex << std::endl
329  << "Filled channels: " << m_ECounter << std::endl);
330  clearBlocks();
331  return;
332 }
333 
334 
336 {
337  //std::cout << "Concatinating FEBs. Have "<< m_mFebBlocks.size() <<" febs." << std::endl;
338  FEBMAPTYPE::const_iterator feb_it_b=m_mFebBlocks.begin();
339  FEBMAPTYPE::const_iterator feb_it_e=m_mFebBlocks.end();
340  FEBMAPTYPE::const_iterator feb_it;
341  for (feb_it=feb_it_b;feb_it!=feb_it_e;++feb_it) {
342  if (feb_it!=feb_it_b) //Not first Feb
343 /*
344  if (fullHeader) {//Add middle header
345  m_pRODblock->push_back(fullHeader->version().full());//Format Version number
346  m_pRODblock->push_back(fullHeader->source_id()); //Source identifer
347  m_pRODblock->push_back(fullHeader->run_no());
348  m_pRODblock->push_back(fullHeader->lvl1_id()); //Level 1 identifer
349  m_pRODblock->push_back(fullHeader->bc_id()); //Bunch Crossing identifer
350  m_pRODblock->push_back(fullHeader->lvl1_type()); //Level 1 trigger type
351  m_pRODblock->push_back(fullHeader->detev_type()); //Detector event type
352  }
353  else //No ROD-Header
354 */
355  m_pRODblock->resize( m_pRODblock->size()+m_MiddleHeaderSize);
356 
357  //Add feb data to rod data block
358  m_pRODblock->insert (m_pRODblock->end(),
359  feb_it->second.begin(), feb_it->second.end());
360  } //end for feb_it
361 
362  m_mFebBlocks.clear();
363  return;
364 }
365 
366 int LArRodBlockPhysicsV1::getNextRawData(int& channelNumber, std::vector<short>& samples, uint32_t& gain)
367 {
368  LARBSDBG("in LArRodBlockPhysicsV1::getNextRawData.");
369  LARBSDBG("m_RawDataCounter=" << m_RawDataCounter << " m_RawDataIndex="<< m_RawDataIndex);
370  LARBSDBG("m_channelsPerFEB=" << m_channelsPerFEB);
371  const int flags=(int) getHeader16(RawDataBlkOffset);
372  if (!flags)
373  return 0; //Block not existing
374  if (m_RawDataCounter>=m_channelsPerFEB) //Already beyond maximal number of channels
375  return 0;
376 
377  LARBSDBG("Flags="<<flags);
378  while (!getBit(m_FebBlock+flags,m_RawDataCounter)) //Look for next filled channel
379  {++m_RawDataCounter;
380  LARBSDBG("RawDataCounter ist now " << m_RawDataCounter);
381  if (m_RawDataCounter>=m_channelsPerFEB) //No more channel availible
382  return 0;
383  }
384  LARBSDBG("Found filled channel at positon " << m_RawDataCounter);
385  //Found next filled channel
386  channelNumber=(m_RawDataCounter>>4) + ((m_RawDataCounter&0xf)<<3); //Convert ROD to FEB channel ordering
387  unsigned int nsamples = getHeader16(NGainNSamples) & 0x00FF;
388  LARBSDBG("This run has " << nsamples << " samples");
390  LARBSDBG( "index="<<index);
391  ++m_RawDataIndex;
392  LARBSDBG("In getnextRawData(). index= " << index);
393  if((nsamples/2)*2!=nsamples) { //odd number of samples
394  const uint32_t& x = m_FebBlock[index];
395  gain = x >> 30;
396  samples.push_back((short) (x>>2 & 0xfff));
397  for(unsigned int i=1;i<=(nsamples-1)/2;i++) {
398  const uint32_t& x = m_FebBlock[index+i];
399  samples.push_back((short) (x>>2 & 0xfff));
400  samples.push_back((short) (x>>18));
401  }
402  }
403  else { //even number of samples
404  const uint32_t& x = m_FebBlock[index];
405  gain = x >> 30;
406  samples.push_back((short) (x>>2 & 0xfff));
407 
408  samples.push_back((short) ((x>>18) & 0xfff));
409 
410  for (unsigned int i=1;i<nsamples/2;i++) {
411  const uint32_t& x = m_FebBlock[index+i];
412  samples.push_back((short) (x>>2 & 0xfff));
413  samples.push_back((short) (x >> 18));
414  }
415  } //end even numer of sample
417  return 1;
418 }
419 
420 
421 
422 /*
423 void LArRodBlockPhysicsV1::dumpFragment()
424 {
425  if (m_pRODblock)
426  std::cout << "Dump of LArRodFragment. Block Type=3. Size of vector=" << m_pRODblock->size() <<std::endl;
427  else
428  std::cout << "Dumping FEB block" << std::endl;
429  int size_read=0;
430  int size_tot=0;
431  if (m_pRODblock)
432  size_tot=m_pRODblock->size();
433  do {
434  std::cout <<"Begin of do-while loop:" << std::endl;
435  if (m_pRODblock)
436  m_FebBlock=&m_pRODblock->at(size_read);
437  char s[33];
438  int i;
439  int FlagPosition;
440  int CurrentPosition = 0;
441 
442  std::cout << " Head Block size = " << m_iHeadBlockSize << std::endl;
443  for (i=0;i<m_iHeadBlockSize;i++) {
444  sprintf(s,"%8.8x",m_FebBlock[CurrentPosition]);
445  std::cout << " " << CurrentPosition << " " << s
446  << " = " << (m_FebBlock[CurrentPosition]>>16)
447  << " " << (m_FebBlock[CurrentPosition] &0xffff) << std::endl;
448  CurrentPosition++;
449  }
450  std::cout << "Energy Block offset: " << getHeader16(EBlkOffset) << std::endl;
451  std::cout << "tQ Block offset: " << getHeader16(tQBlkOffset) << std::endl;
452  std::cout << "Raw Data Block offset " << getHeader16(RawDataBlkOffset) << std::endl;
453 
454  while (CurrentPosition<getNumberOfWords())
455  {FlagPosition=CurrentPosition;
456  if (CurrentPosition==getHeader16(EBlkOffset))
457  {std::cout << " Found Energy Block at offset = " << getHeader16(EBlkOffset) << std::endl;
458  for (i=0; i<m_NFlaggingWords; i++) {
459  sprintf(s,"%8.8x",m_FebBlock[CurrentPosition]);
460  std::cout << " " << CurrentPosition << " " << s
461  << " Flag word" << std::endl;
462  CurrentPosition++;
463  }
464  for (i=0; i<m_NFlaggingWords*32; i++) {
465  if(getBit(&m_FebBlock[FlagPosition],i)) {
466  sprintf(s,"%8.8x",m_FebBlock[CurrentPosition]);
467  std::cout << " " << CurrentPosition << " " << s
468  << " ROD Channel " << i << " FEB Channel " << RodToFebChannel(i)
469  << " = " << m_FebBlock[CurrentPosition] << std::endl;
470  CurrentPosition++;
471  }
472  }
473  } // end if energy block
474  else if (CurrentPosition==getHeader16(tQBlkOffset))
475  {std::cout << " Found tQ Block at position = " << getHeader16(tQBlkOffset) << std::endl;
476  FlagPosition = CurrentPosition;
477  for (i=0; i<m_NFlaggingWords; i++) {
478  sprintf(s,"%8.8x",m_FebBlock[CurrentPosition]);
479  std::cout << " " << CurrentPosition << " " << s
480  << " Flag word" << std::endl;
481  CurrentPosition++;
482  }
483  for (i=0; i<m_NFlaggingWords*32; i++) {
484  if(getBit(&m_FebBlock[FlagPosition],i)) {
485  sprintf(s,"%8.8x",m_FebBlock[CurrentPosition]);
486  std::cout << " " << CurrentPosition << " " << s
487  << " ROD Channel " << i << " FEB Channel " << RodToFebChannel(i)
488  << " = " << (m_FebBlock[CurrentPosition]>>16)
489  << " " << (m_FebBlock[CurrentPosition] &0xffff) << std::endl;
490  CurrentPosition++;
491  }
492  }
493  }// end if tQ block
494  else if (CurrentPosition==getHeader16(RawDataBlkOffset))
495  {std::cout << "Found Raw Data Block at position = " <<getHeader16(RawDataBlkOffset) << std::endl;
496  FlagPosition = CurrentPosition;
497  for (i=0; i<m_NFlaggingWords; i++) {
498  sprintf(s,"%8.8x",m_FebBlock[CurrentPosition]);
499  std::cout << " " << CurrentPosition << " " << s
500  << " Flag word" << std::endl;
501  CurrentPosition++;
502  }
503  for (i=0; i<m_NFlaggingWords*32; i++) {
504  if(getBit(&m_FebBlock[FlagPosition],i)) {
505  int nsamples = getHeader16(NSamples);
506  for(int j=0;j<nsamples;j+=2) {
507  sprintf(s,"%8.8x",m_FebBlock[CurrentPosition]);
508  std::cout << " " << CurrentPosition << " " << s
509  << " ROD Channel " << i << " FEB Channel " << RodToFebChannel(i)
510  << " samples " << j << " and " << j+1 << " = "
511  << ((m_FebBlock[CurrentPosition]>>16) & 0x3fff) << " " //Mask gain!
512  << (m_FebBlock[CurrentPosition] & 0xffff) << std::endl;
513  CurrentPosition++;
514  }
515  }
516  }
517  }// end if Raw Data block
518  else
519  {std::cout << "UNKNOWN block found at position" << CurrentPosition << std::endl;
520  return;
521  }
522  }// end while
523  size_read+=CurrentPosition+6;
524  std::cout << " ------- End of FEB-Block (size_read=" <<size_read << ", size_tot=" << size_tot << ") -------" << std::endl;
525  } while(size_read<size_tot);
526  std::cout << " ------------------ End Of ROD-Framgent -----------------" << std::endl;
527 }
528 */
529 
530 /*
531 void LArRodBlockPhysicsV1::dumpFragment(const std::vector<uint32_t>& v)
532 {
533  uint32_t size_tot = v.size();
534  uint32_t size_read = 0;
535  std::cout << "LAr ROD vector size = " << size_tot << std::endl;
536 
537  int ifeb=0;
538  while(size_read<size_tot)
539  {
540  m_FebBlock = &(v[0]);
541  m_FebBlock+= size_read;
542  std::cout << "LAr ROD - FEB " << ifeb << std::endl;
543  dumpFragment();
544  // next FEB
545  size_read += getNumberOfWords()+6;
546  ifeb++;
547  }
548  std::cout << "End of ROD-Fragment" << std::endl;
549 }
550 */
551 
552 
553 //Sort functions & ordering relation:
554 template<class RAWDATA>
555 bool LArRodBlockPhysicsV1::operator ()
556  //(const LArRawChannel* ch1, const LArRawChannel* ch2) const
557  (const RAWDATA* ch1, const RAWDATA* ch2) const
558 {
559  HWIdentifier id1 = ch1->channelID();
560  HWIdentifier id2 = ch2->channelID();
561 
562  HWIdentifier febId1= m_onlineHelper->feb_Id(id1);
563  HWIdentifier febId2= m_onlineHelper->feb_Id(id2);
564 
565  if(febId1 == febId2 ){
566  int cId1 = m_onlineHelper->channel(id1);
567  int cId2 = m_onlineHelper->channel(id2);
568  return FebToRodChannel(cId1) < FebToRodChannel(cId2);
569  }
570 
571  return febId1 < febId2 ;
572 }
573 
574 
575 void LArRodBlockPhysicsV1::sortDataVector(std::vector<const LArRawChannel*>& vRC)
576 {std::sort(vRC.begin(),vRC.end(),*this);}
577 
578 void LArRodBlockPhysicsV1::sortDataVector( std::vector<const LArDigit*>& vDigit)
579 {std::sort(vDigit.begin(),vDigit.end(),*this);
580 }
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: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
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:142
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:131
LArRodBlockPhysicsV1.h
LArRodBlockPhysicsV1::initializeFragment
virtual void initializeFragment(std::vector< uint32_t > &fragment)
Definition: LArRodBlockPhysicsV1.cxx:243
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::endtag
@ endtag
Definition: LArRodBlockPhysicsV1.h:72
LArRodBlockPhysicsV1::HighEBlkOffset
@ HighEBlkOffset
Definition: LArRodBlockPhysicsV1.h:63
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::m_RawDataBlock
std::vector< uint32_t > m_RawDataBlock
Definition: LArRodBlockPhysicsV1.h:121
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LArRodBlockStructure::m_iHeadBlockSize
unsigned short m_iHeadBlockSize
Definition: LArRodBlockStructure.h:221
LArRodBlockPhysicsV1::setPointers
virtual bool setPointers()
Definition: LArRodBlockPhysicsV1.cxx:85
LArRodBlockStructure::getHeader32
uint32_t getHeader32(const unsigned n) const
Definition: LArRodBlockStructure.h:365
LArRodBlockPhysicsV1::concatinateFEBs
virtual void concatinateFEBs()
Definition: LArRodBlockPhysicsV1.cxx:335
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:136
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
LArRodBlockPhysicsV1::RawDataBlkOffset
@ RawDataBlkOffset
Definition: LArRodBlockPhysicsV1.h:64
lumiFormat.i
int i
Definition: lumiFormat.py:85
Athena
Some weak symbol referencing magic...
Definition: AthLegacySequence.h:21
id2
HWIdentifier id2
Definition: LArRodBlockPhysicsV1.cxx:560
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
LArRodBlockPhysicsV1::m_HighEPtr
const int32_t * m_HighEPtr
Definition: LArRodBlockPhysicsV1.h:129
LArRodBlockPhysicsV1::NGainNSamples
@ NGainNSamples
Definition: LArRodBlockPhysicsV1.h:65
LArRodBlockPhysicsV1::LowEBlkOffset
@ LowEBlkOffset
Definition: LArRodBlockPhysicsV1.h:62
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:271
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
LArRodBlockPhysicsV1::resetPointers
virtual void resetPointers()
Definition: LArRodBlockPhysicsV1.cxx:75
LArRodBlockPhysicsV1::FebToRodChannel
int FebToRodChannel(int ch) const
Definition: LArRodBlockPhysicsV1.h:147
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
LArRodBlockPhysicsV1::m_DummyBitMap
static const uint32_t m_DummyBitMap[4]
Definition: LArRodBlockPhysicsV1.h:137
LArRodBlockPhysicsV1::clearBlocks
void clearBlocks()
Definition: LArRodBlockPhysicsV1.cxx:69
LArRodBlockPhysicsV1::FEBID
@ FEBID
Definition: LArRodBlockPhysicsV1.h:58
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:210
ReadOfcFromCool.nsamples
nsamples
Definition: ReadOfcFromCool.py:115
LArRodBlockStructure::m_MiddleHeaderSize
int32_t m_MiddleHeaderSize
Definition: LArRodBlockStructure.h:239
LArRodBlockPhysicsV1::NWTot
@ NWTot
Definition: LArRodBlockPhysicsV1.h:56
DeMoScan.index
string index
Definition: DeMoScan.py:364
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:562
LArRodBlockStructure::setBit
void setBit(uint32_t *const p, const unsigned chan)
Definition: LArRodBlockStructure.h:444
LArRodBlockPhysicsV1::finalizeFEB
virtual void finalizeFEB()
Definition: LArRodBlockPhysicsV1.cxx:283
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:366
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:563
LArRodBlockStructure::setHeader32
void setHeader32(const unsigned n, const uint32_t w)
Definition: LArRodBlockStructure.h:394