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