ATLAS Offline Software
PixelRawContByteStreamTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // PixelRawContByteStreamTool.cxx
7 // Implementation file for class PixelRawContByteStreamTool
9 // (c) ATLAS Pixel Detector software
12 // Version 00-00-39 05/03/2007 Daniel Dobos
14 
18 #include "PixelByteStreamModuleMask.h" //for PRB_LINKHEADER, PRB_BCIDmask, PRB_BCIDskip etc.
19 
20 
21 //#define PIXEL_DEBUG ;
22 //#define PLOTS ;
23 
25 // constructor
27 PixelRawContByteStreamTool::PixelRawContByteStreamTool(const std::string& type,const std::string& name,const IInterface* parent) :
29 {
30  declareInterface<PixelRawContByteStreamTool>(this);
31  declareProperty("RodBlockVersion",m_RodBlockVersion=0);
32  declareProperty("BCs_per_LVL1ID",m_BCs_per_LVL1ID=1);
33 }
34 
36 // destructor
39 }
40 
42 // initialize
45 
46  ATH_CHECK(m_pixelReadout.retrieve());
47 
48  ATH_CHECK(detStore()->retrieve(m_PixelID, "PixelID"));
49 
51 
54 
55  ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
56 
57  return StatusCode::SUCCESS;
58 }
59 
61 // finalize
64  return StatusCode::SUCCESS;
65 }
66 
68 // convert -
71  FullEventAssembler<SrcIdMap>* fea = nullptr;
72  ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
73  "PixelRawCont") );
75 
76  // set ROD Minor version
78  ATH_MSG_DEBUG("Setting ROD Minor Version Number to: " << m_RodBlockVersion);
79 
80  //loop over the Pixel modules
81  PixelRDO_Container::const_iterator it_coll = cont->begin();
82  PixelRDO_Container::const_iterator it_coll_end = cont->end();
83  ATH_MSG_DEBUG("Found " << cont->size() << " Pixel modules");
84 
86  if (not pixCabling.isValid()){
87  ATH_MSG_ERROR("The pixel cabling could not be retrieved in PixelRawContByteStreamTool::convert");
88  return StatusCode::FAILURE;
89  }
90  for( ; it_coll!=it_coll_end;++it_coll) {
91  const InDetRawDataCollection<PixelRDORawData>* coll = (*it_coll) ;
92 
93  // get OfflineId and RODID
94  if (coll != nullptr){
95  Identifier offlineId = coll->identify();
96  uint32_t rodId = pixCabling->find_entry_offrob(offlineId);
97  if (rodId<1) {
98  ATH_MSG_ERROR("Didn't found ROBID for OfflineID: 0x" << std::hex << offlineId << std::dec);
99  }
100 
101  // loop over the HITS
104 
105  std::vector<const PixelRDORawData*> RDOs;
106  for(; it_b!=it_e; ++it_b){ RDOs.push_back((*it_b)); }
107 
108  theROD = fea->getRodData(rodId);
109  fillROD( *theROD, RDOs, m_BCs_per_LVL1ID);
110 
111  }
112  else {
113  ATH_MSG_WARNING("IDC contains NULLpointer to collection, skipping collection");
114  }
115  }
116  return StatusCode::SUCCESS;
117 }
118 
119 static const InterfaceID IID_IPixelRawContByteStreamTool("PixelRawContByteStreamTool", 1, 0);
120 
122  return IID_IPixelRawContByteStreamTool;
123 }
124 
125 
127 // fillROD() - convert Pixel RDO to a vector of 32bit words
128 // RDOs parameter will be sorted here, so cannot be const ref
129 //cppcheck-suppress passedByValue
130 void PixelRawContByteStreamTool::fillROD(std::vector<uint32_t>& v32rod, std::vector<const PixelRDORawData*> RDOs, int BCs_per_LVL1ID) const {
131  ATH_MSG_DEBUG("#####################################################################################");
132  ATH_MSG_DEBUG("Entering PixelRodEncoder");
133 
134  // Loop over the Hits in a ROD
135  std::vector<const PixelRDORawData*>::iterator rdo_it = RDOs.begin();
136  std::vector<const PixelRDORawData*>::iterator rdo_it_end = RDOs.end();
137 
138  bool is_ibl_present = false;
139 
140  const InDetDD::SiNumerology& pixSiNum = m_pixelManager->numerology();
141  is_ibl_present = (pixSiNum.numLayers() == 4);
142  ATH_MSG_DEBUG("is_ibl_present = " << is_ibl_present);
143  ATH_MSG_DEBUG("pixSiNum.numLayers() = " << pixSiNum.numLayers());
144 
145  bool is_ibl_module = false;
146  bool is_dbm_module = false;
147  ATH_MSG_DEBUG("in fillROD with " << BCs_per_LVL1ID << " LVL1As");
148  ATH_MSG_DEBUG("Dimension of the RDO vector: " << RDOs.size());
149 
150  int hitDiscCnfg = 2;
151 
153  std::unique_ptr<SG::ReadCondHandle<PixelHitDiscCnfgData> > pixHitDiscCnfg;
154 
155  // ordering of the elements of the RDOs vector by offlineId, n5
156  if (rdo_it != rdo_it_end) {
157  OrderInitialRdos orderInitialRdos(m_pixelReadout, m_PixelID, pixCabling);
158  std::sort(rdo_it, rdo_it_end, orderInitialRdos);
159  }
160  // end of ordering of the elements of the RDOs vector by offlineId, n5
161  // NOW the RDOs should be ordered following (1) the offlineId, (2) the FE number
162 
163  rdo_it = RDOs.begin();
164  if (rdo_it!=rdo_it_end) {
165  const PixelRDORawData* rawdata;
166  Identifier offlineId;
167  Identifier prev_offlineId(0x0);
168  Identifier pixelId;
169  bool timing_error = false;
170  bool condensedMode = false;
171  bool linkMasked = false;
172  uint32_t linknumber(0);
173  uint32_t FE(0);
174  uint32_t sLink(0);
175  uint32_t n5(0);
176  uint32_t prev_n5(0);
177 
178  int last_BCID = 0; // needed for encoding of timing information
179  while (rdo_it!=rdo_it_end) {
180  ATH_MSG_DEBUG("Inside cycle on the rdo_it");
181 
182  rawdata = (*rdo_it);
183  pixelId = rawdata->identify();
184  offlineId = m_PixelID->wafer_id(pixelId);
185 
186  uint32_t robId = pixCabling->find_entry_offrob(offlineId);
187  uint64_t onlineId = pixCabling->find_entry_offon(offlineId); // (32bit) working on modules, not on single pixels
188 
189  linknumber = (onlineId >> 24) & 0xFFFF;
190 
191  // All these functions below are methods of the class PixelRDORawData, InnerDetector/InDetRawEvent/InDetRawData
192  int TOT = rawdata->getToT(); // it returns a 8 bits "word"
193  int BCID = rawdata->getBCID();
194  int LVL1ID = rawdata->getLVL1ID();
195  int LVL1A = rawdata->getLVL1A();
196 
197  if (m_pixelReadout->getModuleType(offlineId) == InDetDD::PixelModuleType::IBL_PLANAR || m_pixelReadout->getModuleType(offlineId) == InDetDD::PixelModuleType::IBL_3D) {
198  is_ibl_module = true;
199  }
200  if (m_pixelReadout->getModuleType(offlineId) == InDetDD::PixelModuleType::DBM) {
201  is_dbm_module = true;
202  }
203 
204  ATH_MSG_DEBUG(" ********************* robId retrieved: 0x" << std::hex << robId << std::dec);
205  ATH_MSG_DEBUG("offlineId retrieved: " << offlineId);
206  ATH_MSG_DEBUG("onlineId retrieved: 0x" << std::hex << onlineId << ", linknumber retrieved: 0x" << linknumber << std::dec
207  << ", ToT: " << TOT << ", BCID: " << BCID << ", LVL1ID: " << LVL1ID << ", LVL1A: " << LVL1A);
208  ATH_MSG_DEBUG("Is IBL = " << is_ibl_module << " or is DBM = " << is_dbm_module);
209 
210  //*************************************************************************************************
211  // ************************************* PIXEL CASE *****************************************
212  //*************************************************************************************************
213  if (!(is_ibl_module||is_dbm_module)) {
214  ATH_MSG_DEBUG("This is the PixelCase of the PixelRodEncoder");
215  //----------------------------------------------------------------------------------------------
216  //- Fill the data
217  //----------------------------------------------------------------------------------------------
218  if (prev_offlineId!=offlineId) {
219  int fake_BCID;
220  timing_error = false;
221  if (BCs_per_LVL1ID<LVL1A) { // That must not happen, if LVL1A > BCs_per_LVL1ID, BCs_perLVL1ID is wrongly set in the joboptions
222  ATH_MSG_DEBUG("LVL1A > BCs_per_LVL1ID, timing corrupt, ignoring timing." << " Set BCs per LVL1ID: " << BCs_per_LVL1ID);
223  timing_error = true;
224  }
225  if (prev_offlineId!=0x0) {
226  v32rod.push_back(packLinkTrailer(0x0));
227  ATH_MSG_DEBUG("Pixel module trailer");
228  ATH_MSG_DEBUG(" ------------------------------------------------------------------------------------------");
229 
230  //------------------------------------------------------------------------------------
231  //- Write empty Header/Trailer pairs after the level1 accept
232  //------------------------------------------------------------------------------------
233  fake_BCID = last_BCID;
234  int max_BCID = fake_BCID+BCs_per_LVL1ID-LVL1A-1;
235 
236  while ((fake_BCID<max_BCID) && !timing_error) {
237  fake_BCID++;
238  v32rod.push_back(packLinkHeader(linknumber, fake_BCID, LVL1ID, (LVL1ID>>4), 0x0));
239  v32rod.push_back(packLinkTrailer(0x0));
240  ATH_MSG_DEBUG("(after) empty Pixel Module header/trailer pair written for BCID " << fake_BCID);
241  } // end while cycle "while ((fake_BCID < max_BCID) && !timing_error)"
242  } // end if "if (prev_offlineId != 0x0) "
243 
244  //--------------------------------------------------------------------------------------
245  //- Write empty Header/Trailer pairs before the level1 accept
246  //--------------------------------------------------------------------------------------
247  fake_BCID = BCID-LVL1A;
248 
249  while ((fake_BCID<BCID) && !timing_error) {
250  v32rod.push_back(packLinkHeader(linknumber, fake_BCID, LVL1ID, (LVL1ID>>4), 0x0));
251  v32rod.push_back(packLinkTrailer(0x0));
252  ATH_MSG_DEBUG("(before) empty Pixel Module header/trailer pair written for BCID " << fake_BCID);
253  fake_BCID++;
254  } // end while cycle "while ((fake_BCID < BCID) && !timing_error)"
255 
256  v32rod.push_back(packLinkHeader(linknumber, BCID, LVL1ID, (LVL1ID>>4), 0x0));
257  ATH_MSG_DEBUG("Pixel module header");
258  } // end if "if (prev_offlineId != offlineId) "
259 
260  //--------------------------------------------------------------------------------------
261  //- Write RawDataWord
262  //--------------------------------------------------------------------------------------
263  FE = m_pixelReadout->getFE(pixelId, offlineId);
264  uint32_t row = m_pixelReadout->getRow(pixelId, offlineId);
265  uint32_t column = m_pixelReadout->getColumn(pixelId, offlineId);
266  v32rod.push_back(packRawDataWord(FE, row, column, TOT));
267 
268  // The following was used for running a validation scrip and making validation plots
269 #ifdef PLOTS
270  int eta_i = m_PixelID->eta_index(pixelId);
271  int phi_i = m_PixelID->phi_index(pixelId);
272  std::cout << "[PlotB]: " << robId << " " << eta_i << " " << phi_i << " " << TOT << std::endl;
273  std::cout << "[PlotC]: " << robId << " " << column << " " << row << " " << TOT << std::endl;
274 
275  std::cout << "[VAL] " << std::hex << pixelId << " 0x" << robId << " 0x" << onlineId // << " " << offlineId
276  << std::dec << " " << m_PixelID->eta_module(pixelId) << " " << m_PixelID->phi_module(pixelId)
277  << " " << m_PixelID->eta_index(pixelId) << " " << m_PixelID->phi_index(pixelId) << std::endl;
278 #endif
279 
280  ++rdo_it;
281  last_BCID = BCID;
282 
283  ATH_MSG_DEBUG("Found hit in PIXEL with PixelID: 0x" << std::hex << pixelId << std::dec << " FE: " << FE << " Row: " << row << " Column: " << column
284  << " TOT: " << TOT << " BCID: " << BCID << " LVL1ID: " << LVL1ID << " LVL1A: " << LVL1A);
285  ATH_MSG_DEBUG("Encoded Pixel OfflineID: 0x" << std::hex << offlineId << " OnlineID: 0x" << onlineId << " -> Linknumber: 0x" << linknumber << std::dec);
286 
287  prev_offlineId = offlineId;
288  } // end Pixel Case
289  //*************************************************************************************************
290  // ************************************* IBL CASE *****************************************
291  //*************************************************************************************************
292  else {
293  ATH_MSG_DEBUG("Inside the IBL/DBM case of the PixelRodEncoder");
294 
295  uint32_t linkNum = (onlineId>>24) & 0xFFFF;
296  unsigned int localFE = m_pixelReadout->getFE(pixelId, m_PixelID->wafer_id(pixelId));
297  FE = (linkNum>>(localFE*8)) & 0xF;
298 
299  sLink = onlineId & 0xF; // extract the LSB 4 bits from the onlineId
300  if (sLink > 0x3) {
301  ATH_MSG_WARNING("The SLink is not in the correct range [0,3]. This is due to the non-correct onlineId/ROBID definition. Skipping this RDO");
302  continue; // skipping this rdo, because it gives wrong onlineID (and, possibly, other pieces of information are wrong too)
303  }
304  n5 = ((sLink & 0x3)<<3) | (FE & 0x7); // this variable contains the 5 "nnnnn" bits, the 2 MSB ones representing the copy of the S-Link number (0 to 3) and the 2 LSBs representing the FE number over the S-Link
305  ATH_MSG_DEBUG("FE (w.r.t. SLink) = 0x" << std::hex << FE << " sLink: 0x" << sLink << " => n5: 0x" << n5 << std::dec);
306 
307  if (!pixHitDiscCnfg) {
308  pixHitDiscCnfg = std::make_unique<SG::ReadCondHandle<PixelHitDiscCnfgData> >(m_condHitDiscCnfgKey);
309  }
310  if (m_pixelReadout->getModuleType(offlineId) == InDetDD::PixelModuleType::IBL_PLANAR || m_pixelReadout->getModuleType(offlineId) == InDetDD::PixelModuleType::DBM) {
311  hitDiscCnfg = (*pixHitDiscCnfg)->getHitDiscCnfgPL();
312  }
313  else if (m_pixelReadout->getModuleType(offlineId) == InDetDD::PixelModuleType::IBL_3D) {
314  hitDiscCnfg = (*pixHitDiscCnfg)->getHitDiscCnfg3D();
315  }
316 
317  //----------------------------------------------------------------------------------------------
318  //- Fill the data
319  //----------------------------------------------------------------------------------------------
320  ATH_MSG_DEBUG("(prev_offlineId != offlineId) = " << (prev_offlineId != offlineId) << " (prev_n5 != n5) = " << (prev_n5 != n5) << " ");
321  ATH_MSG_DEBUG("prev_offlineId = " << prev_offlineId);
322 
323  if ((prev_offlineId!=offlineId) || (prev_n5!=n5)) {
324  int fake_BCID;
325  timing_error = false;
326  if (BCs_per_LVL1ID < LVL1A) { // That must not happen, if LVL1A > BCs_per_LVL1ID, BCs_perLVL1ID is wrongly set in the joboptions
327  ATH_MSG_DEBUG("LVL1A > BCs_per_LVL1ID, timing corrupt, ignoring timing." << " Set BCs per LVL1ID: " << BCs_per_LVL1ID);
328  timing_error = true;
329  }
330 
331  if (prev_offlineId != 0x0) {
332  v32rod.push_back(packLinkTrailer_IBL(prev_n5, timing_error, condensedMode, linkMasked)); // Trailer for IBL
333  condensedMode = false;
334  ATH_MSG_DEBUG("IBL Module trailer (because prev_offlineId != 0x0)");
335 
336  //------------------------------------------------------------------------------------
337  //- Write empty Header/Trailer pairs after the level1 accept
338  //------------------------------------------------------------------------------------
339  fake_BCID = last_BCID;
340  int max_BCID = fake_BCID+BCs_per_LVL1ID-LVL1A-1;
341 
342  while ((fake_BCID < max_BCID) && !timing_error) {
343  fake_BCID++;
344  v32rod.push_back(packLinkHeader_IBL(n5, fake_BCID, LVL1ID, 0x0)); // Header for IBL
345  v32rod.push_back(packLinkTrailer_IBL(n5, timing_error, condensedMode, linkMasked)); // Trailer for IBL
346 
347  ATH_MSG_DEBUG("(after) empty IBL Module header/trailer pair written for BCID " << fake_BCID);
348  } // end while cycle "while ((fake_BCID < max_BCID) && !timing_error)"
349  } // end if "if (prev_offlineId != 0x0) "
350 
351  //--------------------------------------------------------------------------------------
352  //- Write empty Header/Trailer pairs before the level1 accept
353  //--------------------------------------------------------------------------------------
354  fake_BCID = BCID-LVL1A;
355 
356  while ((fake_BCID<BCID) && !timing_error) {
357  v32rod.push_back(packLinkHeader_IBL(n5, fake_BCID, LVL1ID, 0x0)); // Header for IBL
358  v32rod.push_back(packLinkTrailer_IBL(n5, timing_error, condensedMode, linkMasked)); // Trailer for IBL
359  ATH_MSG_DEBUG("(before) empty IBL Module header/trailer pair written for BCID " << fake_BCID);
360  fake_BCID++;
361  } // end while cycle "while ((fake_BCID < BCID) && !timing_error)"
362 
363  v32rod.push_back(packLinkHeader_IBL(n5, BCID, LVL1ID, 0x0)); // Header for IBL
364  ATH_MSG_DEBUG("IBL Module header");
365  } // end if "if (prev_offlineId != offlineId) "
366 
367  //--------------------------------------------------------------------------------------
368  //- Write RawData word
369  //--------------------------------------------------------------------------------------
370  std::vector<const PixelRDORawData*> rdos_sameIBL_offlineId; // vector containing all the rdos with the same offlineId => belonging to the same IBL FE-I4 chip
371 
372  // This loop fills the rdo_sameIBL_offlineId vector with all the RDOs that have the same offlineId and same FEw.r.t.SLink => all RDOs coming from the same FE
373  for (; (rdo_it!=rdo_it_end) && ((((m_pixelReadout->getModuleType((*rdo_it)->identify())==InDetDD::PixelModuleType::IBL_PLANAR)
374  || (m_pixelReadout->getModuleType((*rdo_it)->identify())==InDetDD::PixelModuleType::IBL_3D)) && is_ibl_module)
375  || (m_pixelReadout->getModuleType((*rdo_it)->identify())==InDetDD::PixelModuleType::DBM && is_dbm_module)); ++rdo_it) {
376 
377  Identifier pixelId_probe = (*rdo_it)->identify();
378  Identifier offlineId_probe = m_PixelID->wafer_id(pixelId_probe);
379 
380  uint32_t linkNum = (onlineId>>24) & 0xFFFF;
381  unsigned int localFE = m_pixelReadout->getFE(pixelId_probe, offlineId_probe);
382  uint32_t fe_probe = (linkNum>>(localFE*8)) & 0xF;
383 
384 
385  ATH_MSG_DEBUG("offlineId: " << offlineId << " offlineId_probe: " << offlineId_probe << ", fe: " << FE << " fe_probe: " << fe_probe);
386 
387  if ((offlineId_probe == offlineId) && (FE == fe_probe)) {
388  ATH_MSG_DEBUG("=======> IN ");
389  rdos_sameIBL_offlineId.push_back((*rdo_it));
390  }
391  else {
392  ATH_MSG_DEBUG("=======> OUT.");
393  break;
394  }
395  }
396 
397  std::vector<const PixelRDORawData*>::iterator rdo_same_it = rdos_sameIBL_offlineId.begin();
398  std::vector<const PixelRDORawData*>::iterator rdo_same_it_end = rdos_sameIBL_offlineId.end();
399 
400 #ifdef PIXEL_DEBUG
401  //check: list of all the rdos with same offlineId, listing also the column, the row and the Tot
402  for (; rdo_same_it != rdo_same_it_end; ++rdo_same_it) {
403  Identifier pixelId_probe = (*rdo_same_it)->identify();
404  uint32_t col = m_pixelReadout->getColumn(pixelId_probe, offlineId); // offlineId of rdos in rdos_sameIBL_offlineId vector are, of course, all equal
405  uint32_t row = m_pixelReadout->getRow(pixelId_probe, offlineId);
406  int tot = (*rdo_same_it)->getToT();
407  ATH_MSG_DEBUG("col: " << col << " (0x" << std::hex << col << std::dec << ")\trow: "<< row << " (0x" << std::hex << row << std::dec << ")\ttot: " << tot << "(0x" <<std::hex << tot << std::dec << ")");
408  }
409 
410  rdo_same_it = rdos_sameIBL_offlineId.begin();
411  rdo_same_it_end = rdos_sameIBL_offlineId.end();
412 #endif
413 
414  // Order the RDOs within the vector rdos_sameIBL_offlineId, following the ordering rules of orderRdos
415  OrderRdos orderRdos(offlineId, m_pixelReadout);
416  std::sort(rdo_same_it, rdo_same_it_end, orderRdos);
417 
418  //check:
419 #ifdef PIXEL_DEBUG
420  rdo_same_it = rdos_sameIBL_offlineId.begin();
421  rdo_same_it_end = rdos_sameIBL_offlineId.end();
422 
423  ATH_MSG_DEBUG("Re-ordered RDOs with Same offlineId:");
424  for (; rdo_same_it != rdo_same_it_end; ++rdo_same_it) {
425  Identifier pixelId_probe = (*rdo_same_it)->identify();
426  uint32_t col = m_pixelReadout->getColumn(pixelId_probe, offlineId);
427  uint32_t row = m_pixelReadout->getRow(pixelId_probe, offlineId);
428  int tot = (*rdo_same_it)->getToT();
429  int eta_i = m_PixelID->eta_index(pixelId_probe);
430  int phi_i = m_PixelID->phi_index(pixelId_probe);
431  int eta_m = m_PixelID->eta_module(pixelId_probe);
432  int phi_m = m_PixelID->phi_module(pixelId_probe);
433  ATH_MSG_DEBUG("pixelId: " << pixelId_probe << ", eta_i: " << eta_i << ", phi_i: " << phi_i << ", eta_m: " << eta_m << ", phi_m: ");
434  ATH_MSG_DEBUG("col: 0x" << std::hex << col << std::dec << ", row: 0x" <<std::hex << row << std::dec << ", tot = 0x" << std::hex << tot << std::dec);
435  }
436  ATH_MSG_DEBUG("rdos_sameIBL_offlineId.size() = " << rdos_sameIBL_offlineId.size());
437 #endif
438 #ifdef PLOTS
439  rdo_same_it = rdos_sameIBL_offlineId.begin();
440  rdo_same_it_end = rdos_sameIBL_offlineId.end();
441  for (; rdo_same_it != rdo_same_it_end; ++rdo_same_it) {
442  Identifier pixelId_probe = (*rdo_same_it)->identify();
443  uint32_t col = m_pixelReadout->getColumn(pixelId_probe, offlineId);
444  uint32_t row = m_pixelReadout->getRow(pixelId_probe, offlineId);
445  int tot = (*rdo_same_it)->getToT();
446  int eta_i = m_PixelID->eta_index(pixelId_probe);
447  int phi_i = m_PixelID->phi_index(pixelId_probe);
448  std::cout << "[Plot2]: " << robId << " " << eta_i << " " << phi_i << " " << tot << std::endl;
449  std::cout << "[Plot3]: " << robId << " " << col << " " << row << " " << tot << std::endl;
450  }
451 #endif
452 
454  // look for adjacent cell that can allow the "compression" of the two hit info in one:
455  // instead of having two hits (= 2 columns, 2 rows and 2 tots), in fact,
456  // if two adjacent pixels ([col, row] and [col, row+1]) have fired (respectively tot([col, row]) and tot([col, (row+1)])
457  // then
458  // the row in the hit will be the row with lower number, the column in the hit will be the common column number
459  // and the tot will be = (tot [(col, row)] << 4) | tot[(col, row+1)]
461 
462  std::vector <uint32_t> vRows;
463  std::vector <uint32_t> vCols;
464  std::vector <int> vTots;
465  bool doubleHit = false;
466  static const uint32_t rowsPerFE = 336;// FIXME: this is a hardcoded variable, would be better to get it from somewhere
467 
468  rdo_same_it = rdos_sameIBL_offlineId.begin();
469  rdo_same_it_end = rdos_sameIBL_offlineId.end();
470 
471  std::vector<const PixelRDORawData*>::iterator rdo_test_it = rdos_sameIBL_offlineId.begin();
472  ATH_MSG_DEBUG("Looking for adjacent pixels and saving col, row and tot information.");
473 
474  for (; rdo_same_it!=rdo_same_it_end; ++rdo_same_it) {
475  doubleHit = false;
476  Identifier pixelId_probe = (*rdo_same_it)->identify();
477  uint32_t col0 = m_pixelReadout->getColumn(pixelId_probe, offlineId);
478  uint32_t row0 = m_pixelReadout->getRow(pixelId_probe, offlineId);
479  int totInHitWord (0);
480 #ifdef PLOTS
481  std::cout << "[VAL] " << std::hex << pixelId_probe << " 0x" << robId << " 0x" << onlineId // << " " << offlineId
482  << std::dec << " " << m_PixelID->eta_module(pixelId_probe) << " " << m_PixelID->phi_module(pixelId_probe)
483  << " " << m_PixelID->eta_index(pixelId_probe) << " " << m_PixelID->phi_index(pixelId_probe) << std::endl;
484 #endif
485 
486  if (row0==rowsPerFE) {
487  ATH_MSG_DEBUG("Hit in the last row (== 336) of the IBL FE.");
488  }
489  else {
490  if ((rdo_same_it+1)!=rdo_same_it_end) {
491  rdo_test_it = rdo_same_it + 1;
492  Identifier pixelId_probe = (*rdo_test_it)->identify();
493  uint32_t col1 = m_pixelReadout->getColumn(pixelId_probe, offlineId);
494  uint32_t row1 = m_pixelReadout->getRow(pixelId_probe, offlineId);
495 #ifdef PLOTS
496  std::cout << "[VAL] " << std::hex << pixelId_probe << " 0x" << robId << " 0x" << onlineId // << " " << offlineId
497  << std::dec << " " << m_PixelID->eta_module(pixelId_probe) << " " << m_PixelID->phi_module(pixelId_probe)
498  << " " << m_PixelID->eta_index(pixelId_probe) << " " << m_PixelID->phi_index(pixelId_probe) << std::endl;
499 #endif
500 
501  ATH_MSG_DEBUG("Comparing rdo[i] = " << (*rdo_same_it) << " with rdo[i+1] = " << (*rdo_test_it));
502  ATH_MSG_DEBUG(" col0 = 0x" << std::hex << col0 << " col1 = 0x" << col1 << " row0 = 0x" << row0 << "\t row1 = 0x" << row1 << std::dec);
503 
504  if ((col1==col0) && (row1==(row0+1))) {
505  doubleHit = true;
506  ATH_MSG_DEBUG("Two adjacent hits found");
507 
508  int tot0 = (*rdo_same_it)->getToT();
509  int tot1 = (*rdo_test_it)->getToT();
510 
511  // Adjust ToT according to hitdisccnfg setting
512  if (hitDiscCnfg==2 && tot0==16) { tot0=2; }
513  if (hitDiscCnfg==2 && tot1==16) { tot1=2; }
514 
515  int overflow = 14;
516  if (hitDiscCnfg==1) { overflow=15; }
517  if (hitDiscCnfg==2) { overflow=16; }
518 
519  if (tot0>overflow) { tot0=overflow; }
520  if (tot1>overflow) { tot1=overflow; }
521 
522  totInHitWord = (tot0<<4) | tot1;
523 
524  ATH_MSG_DEBUG("doubleHit = " << std::boolalpha << doubleHit << std::noboolalpha << " ===> (col0 == col1) : 0x" << std::hex << col0 << " = 0x" << col1
525  << "; (row0 = row1 - 1) : 0x" << row0 << " => 0x" << row1 <<"; (tot0) : 0x" << tot0 << ", (tot1) : 0x" << tot1 << " => totInHitWord: 0x" << totInHitWord << std::dec);
526  ++rdo_same_it;
527  } // end if "(col1==col0) && (row1 == (row0+1))"
528  } // end if "(rdo_same_it + 1) != rdo_same_it_end"
529  else {
530  ATH_MSG_DEBUG("last rdo with same Offline Id");
531  } // end if it's the last rdo with same offlineId
532  } // end if "row0 == rowsPerFE" (== 336)
533 
534  if (!doubleHit) {
535  int tot0 = (*rdo_same_it)->getToT();
536 
537  // Adjust ToT according to hitdisccnfg setting
538  if (hitDiscCnfg==2 && tot0==16) { tot0=2; }
539 
540  int overflow = 14;
541  if (hitDiscCnfg==1) { overflow=15; }
542  if (hitDiscCnfg==2) { overflow=16; }
543  if (tot0>overflow) { tot0=overflow; }
544 
545  totInHitWord = (tot0<<4) | 0x0;
546 
547  ATH_MSG_DEBUG("doubleHit = " << std::boolalpha << doubleHit << std::noboolalpha << " ===> col0: 0x" << std::hex << col0 << std::dec << "; row0: 0x" << std::hex << row0 << std::dec << " totInHitWord: 0x" << std::hex << totInHitWord << std::dec);
548  }
549  vCols.push_back(col0);
550  vRows.push_back(row0);
551  vTots.push_back(totInHitWord);
552  } // end loop over the rdos with the same offlineId
553 
554  //check:
555 #ifdef PIXEL_DEBUG
556  ATH_MSG_DEBUG("CHECKs over the vectors storing columns, rows, ToTs of IBL/DBM hits:");
557  ATH_MSG_DEBUG(" vCols: ");
558  std::vector<uint32_t>::iterator vCols_it = vCols.begin();
559  std::vector<uint32_t>::iterator vCols_it_end = vCols.end();
560  for (; vCols_it != vCols_it_end; ++vCols_it) {
561  ATH_MSG_DEBUG("0x" << std::hex << *vCols_it << std::dec << " ");
562  }
563  ATH_MSG_DEBUG("vRows: ");
564  std::vector<uint32_t>::iterator vRows_it = vRows.begin();
565  std::vector<uint32_t>::iterator vRows_it_end = vRows.end();
566  for (; vRows_it != vRows_it_end; ++vRows_it) {
567  ATH_MSG_DEBUG("0x" << std::hex << *vRows_it << std::dec <<" ");
568  }
569  ATH_MSG_DEBUG("vTots: ");
570  std::vector<int>::iterator vTots_it = vTots.begin();
571  std::vector<int>::iterator vTots_it_end = vTots.end();
572  for (; vTots_it != vTots_it_end; ++vTots_it) {
573  ATH_MSG_DEBUG("0x" << std::hex << *vTots_it << std::dec << " ");
574  }
575  ATH_MSG_DEBUG("rdos_sameIBL_offlineId.size() = " << rdos_sameIBL_offlineId.size() << " vRows.size() = " << vRows.size() << " vCols.size() = " << vCols.size() << " vTots.size() = " << vTots.size());
576 #endif
577 
578  //Packing of the IBL hits
579  if (vRows.size() >= 5) {
580  ATH_MSG_DEBUG("5 (or more) IBL hits have been consequently found. They can be written as condensed hits");
581  while (vRows.size()>=5) {
582  packIBLcondensed(v32rod, vRows, vCols, vTots);
583  condensedMode= true;
584  }
585  }
586  if (vRows.size()!=0) { // packing remaining non-condensed IBL hit words
587  // int cycleCounter(0);
588  for (; vRows.size() != 0; ) {
589  v32rod.push_back(packRawDataWord_IBL(vRows.at(0), vCols.at(0), vTots.at(0), n5));
590  vRows.erase(vRows.begin());
591  vCols.erase(vCols.begin());
592  vTots.erase(vTots.begin());
593  }
594  }
595  last_BCID = BCID;
596 
597  ATH_MSG_DEBUG("Encoded IBL OfflineID: " << std::hex << offlineId << " OnlineID: 0x" << onlineId << std::dec);
598 
599  prev_offlineId = offlineId;
600  prev_n5 = n5;
601  // prev_FE = FE;
602  } // end of the IBL case
603  } // end WHILE cycle " while (rdo_it!=rdo_it_end) "
604 
605  if (is_ibl_module || is_dbm_module) {
606  v32rod.push_back(packLinkTrailer_IBL(n5, timing_error, condensedMode, linkMasked));
607  condensedMode = false;
608  ATH_MSG_DEBUG("Module IBL/DBM trailer (at end of the loop)");
609  }
610  else {
611  v32rod.push_back(packLinkTrailer(0x0));
612  ATH_MSG_DEBUG("Pixel module trailer");
613  }
614  } // end if "if (rdo_it != rdo_it_end)"
615  else {
616  ATH_MSG_DEBUG("rdo_it == rdo_it_end");
617  }
618  return;
619 }
620 
622 // encode module Header for Pixels
623 // Pixel Header: 001PtlbxxnnnnnnnMMMMLLLLBBBBBBBB,
626  lvl1idskip = 0; // FIXME LVL1IDskip hardcoded as 0
627  uint32_t result = 0;
628  result = PRB_LINKHEADER | ((bcid & PRB_BCIDmask) << PRB_BCIDskip) | ((lvl1id & PRB_L1IDmask) << PRB_L1IDskip) | ((lvl1idskip & PRB_L1IDSKIPmask) << PRB_L1IDSKIPskip) | ((module & PRB_MODULEmask) << PRB_MODULEskip) | ((errors & PRB_HEADERERRORSmask) << PRB_HEADERERRORSskip);
629 #ifdef PLOTS
630  std::cout << "[PlotA]:0x " << std::hex << result << std::dec << std::endl;
631  std::cout << "[PlotA]:(dec) " << result << std::endl;
632 #endif
633  return result;
634 }
635 
636 
638 // encode module Header for IBL
639 // IBL Header: 001nnnnnFLLLLLLLLLLLLLBBBBBBBBBB
642  uint32_t result = 0;
643  result = PRB_LINKHEADER | ((bcid & PRB_BCIDmask_IBL) << PRB_BCIDskip_IBL) | ((lvl1id & PRB_L1IDmask_IBL) << PRB_L1IDskip_IBL) | ((module & PRB_MODULEmask_IBL) << PRB_MODULEskip_IBL) | ((feFlag & PRB_FeI4BFLAGmask_IBL) << PRB_FeI4BFLAGskip_IBL);
644 #ifdef PIXEL_DEBUG
645  // std::cout << "IBL HEADER: linkNum (=n): 0x" << std::hex << module << std::dec << ", bcid: " << bcid << ", lvl1id: " << lvl1id << ", feFlag: " << feFlag << "====> Result: 0x" << std::hex << result << std::dec << std::endl;
646 #endif
647 #ifdef PLOTS
648  std::cout << "[Plot1]:0x " << std::hex << result << std::dec << std::endl;
649  std::cout << "[Plot1]:(dec) " << result << std::endl;
650 #endif
651  return result;
652 }
653 
654 
656 // encode IBL non-condensed hit word: 0-8: row,9-15: column, 16-23:TOT, 24-28: nLink ----> 100xxnnnTTTTTTTTCCCCCCCRRRRRRRRR
659  uint32_t result = 0;
660  result = PRB_DATAWORD | ((row & PRB_ROWmask_IBL) << PRB_ROWskip_IBL) | ((column & PRB_COLUMNmask_IBL) << PRB_COLUMNskip_IBL) | ((ToT & PRB_TOTmask) << PRB_TOTskip) | ((nLink & PRB_LINKNUMHITmask_IBL) << PRB_LINKNUMHITskip_IBL);
661 #ifdef PIXEL_DEBUG
662  // std::cout << "IBL NON-CONDENSED HIT: nLink: 0x" << std::hex << nLink << ", row: 0x" << row << ", col: 0x" << column << ", tot: 0x" << ToT << " ===> encoded IBL word: 0x" << result << std::dec << std::endl;
663 #endif
664 #ifdef PLOTS
665  std::cout << "[Plot1]:0x " << std::hex << result << std::dec << std::endl;
666  std::cout << "[Plot1]:(dec) " << result << std::endl;
667 #endif
668  return result;
669 }
670 
672 // encode PIXEL hit word: bits 0-7:row,8-12:column,16-23:TOT,24-27:FE ----> 100xFFFFTTTTTTTTxxxCCCCCRRRRRRRR
675 
676  uint32_t result = 0;
677  result = PRB_DATAWORD | ((row & PRB_ROWmask) << PRB_ROWskip) | ((column & PRB_COLUMNmask) << PRB_COLUMNskip) | ((ToT & PRB_TOTmask) << PRB_TOTskip) | ((FE & PRB_FEmask) << PRB_FEskip);
678 #ifdef PLOTS
679  std::cout << "[PlotA]:0x " << std::hex << result << std::dec << std::endl;
680  std::cout << "[PlotA]:(dec) " << result << std::endl;
681 #endif
682  return result;
683 }
684 
685 
687 // encode PIXEL module trailer (bits 26-28:trailer errors)
690  uint32_t result = PRB_LINKTRAILER | ((errors & PRB_TRAILERERRORSmask) << PRB_TRAILERERRORSskip);
691 #ifdef PLOTS
692  std::cout << "[PlotA]:0x " << std::hex << result << std::dec << std::endl;
693  std::cout << "[PlotA]:(dec) " << result << std::endl;
694 #endif
695  return result;
696 }
697 
698 
700 // encode IBL module trailer (bits 26-28:trailer errors)
702 uint32_t PixelRawContByteStreamTool::packLinkTrailer_IBL(uint32_t linknum, bool timeOutErrorBit, bool condensedModeBit, bool linkMasked) const {
703  // return PRB_LINKTRAILER |((timeOutErrorBit & PRB_TIMEOUTERRORmask_IBL) << PRB_TIMEOUTERRORskip_IBL) | ((condensedModeBit & PRB_CONDENSEDMODEmask_IBL) << PRB_CONDENSEDMODEskip_IBL) | ((linkMasked & PRB_LINKMASKEDmask_IBL) << PRB_LINKMASKEDskip_IBL) | ((linknum & PRB_LINKNUMTRAILERmask_IBL) << PRB_LINKNUMTRAILERskip_IBL);
705  result = PRB_LINKTRAILER | (timeOutErrorBit << PRB_TIMEOUTERRORskip_IBL) | (condensedModeBit << PRB_CONDENSEDMODEskip_IBL) | (linkMasked << PRB_LINKMASKEDskip_IBL) | ((linknum & PRB_LINKNUMTRAILERmask_IBL) << PRB_LINKNUMTRAILERskip_IBL);
706 #ifdef PIXEL_DEBUG
707  // std::cout << "IBL TRAILER: linknum = 0x" << std::hex << linknum << ", timeOutErrorBit: 0x" << timeOutErrorBit << ", condensedModeBit: 0x" << condensedModeBit << ", linkMasked: 0x" << linkMasked << ", ===> Result: 0x" << result << std::dec << std::endl;
708 #endif
709 #ifdef PLOTS
710  std::cout << "[Plot1]:0x " << std::hex << result << std::dec << std::endl;
711  std::cout << "[Plot1]:(dec) " << result << std::endl;
712 #endif
713  return result;
714 }
715 
716 
718 // Encode IBL Condensed hit words:
719 // for IBL condensed word: (R = row, C = column, T = TOT)
720 // 1st word: 101 RRRRRTTTTTTTTCCCCCCCRRRRRRRRR
721 // 2nd word: 1 CCCRRRRRRRRRTTTTTTTTCCCCCCCRRRR
722 // 3rd word: 1 TTTCCCCCCCRRRRRRRRRTTTTTTTTCCCC
723 // 4th word: 111 TTTTTTTTCCCCCCCRRRRRRRRRTTTTT
725 
726 void PixelRawContByteStreamTool::packIBLcondensed(std::vector <uint32_t> & v32rod, std::vector <uint32_t> & vRows, std::vector <uint32_t> & vCols, std::vector<int> & vTots) const {
727  unsigned int condWord[nCondensedWords];
728  condWord[0] = PRB_FIRSTHITCONDENSEDWORD | vRows[0] | (vCols[0] << skipRow) | (vTots[0] << (skipRow + skipCol) | ((vRows[1] & mask5) << (skipRow + skipCol + skipTOT)));
729 
730  condWord[1] = PRB_MIDDLEHITCONDENSEDWORD | (vRows[1] >> skip5) | (vCols[1] << skip4) | (vTots[1] << (skip4 + skipCol)) | (vRows[2] << (skip4+skipCol+skipTOT)) | ((vCols[2] & mask3) << (skip4+skipCol+skipTOT+skipRow));
731 
732  condWord[2] = PRB_MIDDLEHITCONDENSEDWORD | (vCols[2] >> skip3) | (vTots[2] << skip4) | (vRows[3] << (skip4+skipTOT)) | (vCols[3] << (skip4+skipTOT+skipRow)) | ((vTots[3] & mask3) << (skip4+skipTOT+skipRow+skipCol));
733 
734  condWord[3] = PRB_DATAMASK | (vTots[3] >> skip3) | (vRows[4] << skip5) | (vCols[4] << (skip5+skipRow)) | (vTots[4] << (skip5+skipRow+skipCol));
735 
736  for (int j(0); j < 4; ++j) {
737  v32rod.push_back(condWord[j]); // Filling the ROD vector here
738 #ifdef PLOTS
739  std::cout << "[Plot1]:0x " << std::hex << condWord[j] << std::dec << std::endl;
740  std::cout << "[Plot1]:(dec) " << condWord[j] << std::endl;
741 #endif
742  }
743 
744  vRows.erase (vRows.begin(), vRows.begin() + 5);
745  vCols.erase (vCols.begin(), vCols.begin() + 5);
746  vTots.erase (vTots.begin(), vTots.begin() + 5);
747  return;
748 }
749 
751 // function used by std::sort to order the RDO vector that contains RDOs with the same offlineId
752 // It orders the rdos_sameIBL_offlineId by //column (ascending order), row (ascending order, once the column is the same)
753 // example: coordinates (col, row): (1,1), (3,6), (1,2), (4,82), (4,81) become: (1,1), (1,2), (3,6), (4,81), (4,82).
755 bool OrderRdos::operator () (const PixelRDORawData* rdo0, const PixelRDORawData* rdo1) //, const Identifier & offlineId
756 {
757  // const uint32_t halfCols = 40; // this is the number of the FE-I4 columns / 2, because the two tokens in the FE-I4 run from the double column 0 to 19, and then from 39 to 20.
758  // This corresponds to column 1 to 40, and 79-80, 77-78, ... to 41-42.
759  Identifier pixelId0 = rdo0->identify();
760  uint32_t col0 = m_pixelReadout->getColumn(pixelId0, m_offlineId);
761  uint32_t row0 = m_pixelReadout->getRow(pixelId0, m_offlineId);
762  Identifier pixelId1 = rdo1->identify();
763  uint32_t col1 = m_pixelReadout->getColumn(pixelId1, m_offlineId);
764  uint32_t row1 = m_pixelReadout->getRow(pixelId1, m_offlineId);
765 
766  // Decide if (col0, row0) should be inserted in front of (col1, row1):
767 
768  // Check if both hits are in same column
769  if (col0 == col1) return (row0 < row1);
770 
771  // If not, check if they are in same double column
772  else if (((col0 == col1-1) && (col1%2 == 0)) || ((col1 == col0-1) && (col0%2 == 0))) {
773 
774  // If rows are equal, sort by ascending column
775  if (row0 == row1) return (col0 < col1);
776  // If rows are unequal, sort by ascending row
777  else return (row0 < row1);
778  }
779 
780  // Not in same double column: Separate between FE halfs
781  else {
782 
783  // If both hits are in second FE half: Sort by descending col
784  if (col0 > 40 && col1 > 40) return (col0 > col1);
785 
786  // Otherwise, sort by ascending col
787  else return (col0 < col1);
788  }
789 }
790 
792 {
793  Identifier pixelId0 = rdo0->identify();
794  Identifier offlineId0 = m_PixelID->wafer_id(pixelId0);
795  Identifier pixelId1 = rdo1->identify();
796  Identifier offlineId1 = m_PixelID->wafer_id(pixelId1);
797  if (offlineId0 < offlineId1) {
798  return true;
799  }
800  if (offlineId0 == offlineId1) {
801  if ( m_pixelReadout->getModuleType(pixelId0) == InDetDD::PixelModuleType::IBL_PLANAR
802  || m_pixelReadout->getModuleType(pixelId0) == InDetDD::PixelModuleType::IBL_3D
803  || m_pixelReadout->getModuleType(pixelId0) == InDetDD::PixelModuleType::DBM) { // IBL and DBM
804 
805  uint64_t onlineId0 = m_pixCabling->find_entry_offon(offlineId0);
806  uint32_t linkNum0 = (onlineId0>>24) & 0xFFFF;
807  unsigned int localFE0 = m_pixelReadout->getFE(pixelId0, offlineId0);
808  uint32_t fe0= (linkNum0>>(localFE0*8)) & 0xF;
809 
810  uint64_t onlineId1 = m_pixCabling->find_entry_offon(offlineId1);
811  uint32_t linkNum1 = (onlineId1>>24) & 0xFFFF;
812  unsigned int localFE1 = m_pixelReadout->getFE(pixelId1, offlineId1);
813  uint32_t fe1= (linkNum1>>(localFE1*8)) & 0xF;
814 
815  return (fe0 < fe1);
816  }
817  else { // PixelCase
818  uint32_t fe0 = m_pixelReadout->getFE(pixelId0, offlineId0);
819  uint32_t fe1 = m_pixelReadout->getFE(pixelId1, offlineId1);
820  return (fe0 < fe1);
821 
822  // return false;
823  }
824  }
825  else {return false; }
826 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
query_example.row
row
Definition: query_example.py:24
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
PixelRawContByteStreamTool::initialize
virtual StatusCode initialize() override
Definition: PixelRawContByteStreamTool.cxx:44
PixelID::phi_index
int phi_index(const Identifier &id) const
Definition: PixelID.h:658
PixelRawContByteStreamTool::m_condHitDiscCnfgKey
SG::ReadCondHandleKey< PixelHitDiscCnfgData > m_condHitDiscCnfgKey
Definition: PixelRawContByteStreamTool.h:86
PixelRawContByteStreamTool::interfaceID
static const InterfaceID & interfaceID()
Definition: PixelRawContByteStreamTool.cxx:121
InDetDD::SiDetectorManager::numerology
const SiNumerology & numerology() const
Access Numerology.
Definition: SiDetectorManager.h:126
get_generator_info.result
result
Definition: get_generator_info.py:21
PixelRawContByteStreamTool::packRawDataWord_IBL
uint32_t packRawDataWord_IBL(uint32_t row, uint32_t column, int ToT, uint32_t nLink) const
Definition: PixelRawContByteStreamTool.cxx:658
OrderRdos::m_offlineId
Identifier m_offlineId
Definition: PixelRawContByteStreamTool.h:93
PixelRawContByteStreamTool::fillROD
void fillROD(std::vector< uint32_t > &v32rod, std::vector< const PixelRDORawData * > RDOs, int BCs_per_LVL1ID) const
Definition: PixelRawContByteStreamTool.cxx:130
OrderInitialRdos::m_pixCabling
SG::ReadCondHandle< PixelCablingCondData > m_pixCabling
Definition: PixelRawContByteStreamTool.h:107
SG::ReadCondHandle< PixelCablingCondData >
FullEventAssembler< SrcIdMap >
InDetDD::PixelModuleType::DBM
@ DBM
PixelRawContByteStreamTool::packLinkTrailer_IBL
uint32_t packLinkTrailer_IBL(uint32_t FEonSLink, bool timeOutErrorBit, bool condensedModeBit, bool linkMasked) const
Definition: PixelRawContByteStreamTool.cxx:702
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
PixelRawContByteStreamTool::m_pixelReadout
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
Definition: PixelRawContByteStreamTool.h:73
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
PixelRDORawData::getLVL1ID
virtual int getLVL1ID() const =0
PixelRawContByteStreamTool::m_RodBlockVersion
unsigned short m_RodBlockVersion
Definition: PixelRawContByteStreamTool.h:79
InDetRawDataCollection::identify
virtual Identifier identify() const override final
IdentifiableContainerMT::size
size_t size() const
Duplicate of fullSize for backwards compatability.
Definition: IdentifiableContainerMT.h:206
SG::ReadCondHandle::isValid
bool isValid()
Definition: ReadCondHandle.h:206
PixelRawContByteStreamTool::convert
StatusCode convert(PixelRDO_Container *cont) const
Definition: PixelRawContByteStreamTool.cxx:70
DeMoUpdate.column
dictionary column
Definition: DeMoUpdate.py:1110
PixelCablingCondData::find_entry_offrob
uint32_t find_entry_offrob(Identifier offlineId) const
Definition: PixelCablingCondData.cxx:114
OrderInitialRdos::m_PixelID
const PixelID * m_PixelID
Definition: PixelRawContByteStreamTool.h:106
OrderRdos::operator()
bool operator()(const PixelRDORawData *rdo0, const PixelRDORawData *rdo1)
Definition: PixelRawContByteStreamTool.cxx:755
PixelRawContByteStreamTool::finalize
virtual StatusCode finalize() override
Definition: PixelRawContByteStreamTool.cxx:63
InDetRawDataContainer
Definition: InDetRawDataContainer.h:27
PixelRawContByteStreamTool::packLinkHeader_IBL
uint32_t packLinkHeader_IBL(uint32_t module, uint32_t bcid, uint32_t lvl1id, uint32_t feFlag) const
Definition: PixelRawContByteStreamTool.cxx:641
PixelRDORawData::getLVL1A
virtual int getLVL1A() const =0
PixelID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition: PixelID.h:364
OrderInitialRdos::operator()
bool operator()(const PixelRDORawData *rdo0, const PixelRDORawData *rdo1)
Definition: PixelRawContByteStreamTool.cxx:791
PixelRawContByteStreamTool::~PixelRawContByteStreamTool
virtual ~PixelRawContByteStreamTool()
Definition: PixelRawContByteStreamTool.cxx:38
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
PixelByteStreamErrors::BCID
@ BCID
Definition: PixelByteStreamErrors.h:13
python.PyAthena.module
module
Definition: PyAthena.py:131
OrderRdos
Definition: PixelRawContByteStreamTool.h:89
OrderInitialRdos
Definition: PixelRawContByteStreamTool.h:102
PixelRawContByteStreamTool::m_byteStreamCnvSvc
ServiceHandle< IByteStreamCnvSvc > m_byteStreamCnvSvc
Definition: PixelRawContByteStreamTool.h:70
PixelDetectorManager.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PixelCablingCondData::find_entry_offon
uint64_t find_entry_offon(const Identifier) const
Definition: PixelCablingCondData.cxx:102
InDetRawDataCollection
Definition: InDetRawDataCollection.h:31
test_pyathena.parent
parent
Definition: test_pyathena.py:15
PixelID::eta_index
int eta_index(const Identifier &id) const
Definition: PixelID.h:664
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IdentifiableContainerMT::end
const_iterator end() const
return const_iterator for end of container
Definition: IdentifiableContainerMT.h:239
PixelRDORawData::getToT
virtual int getToT() const =0
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:79
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition: IdentifiableContainerMT.h:233
InDetDD::SiNumerology::numLayers
int numLayers() const
Number of layers.
PixelRawContByteStreamTool::m_condCablingKey
SG::ReadCondHandleKey< PixelCablingCondData > m_condCablingKey
Definition: PixelRawContByteStreamTool.h:83
PixelRawContByteStreamTool::m_pixelManager
const InDetDD::PixelDetectorManager * m_pixelManager
Definition: PixelRawContByteStreamTool.h:77
PixelRDORawData::getBCID
virtual int getBCID() const =0
mergePhysValFiles.errors
list errors
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:43
PixelRawContByteStreamTool::packIBLcondensed
void packIBLcondensed(std::vector< uint32_t > &v32rod, std::vector< uint32_t > &vRows, std::vector< uint32_t > &vCols, std::vector< int > &vTots) const
Definition: PixelRawContByteStreamTool.cxx:726
PixelID::eta_module
int eta_module(const Identifier &id) const
Definition: PixelID.h:651
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
PixelByteStreamModuleMask.h
PixelRawContByteStreamTool::PixelRawContByteStreamTool
PixelRawContByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PixelRawContByteStreamTool.cxx:27
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
InDetDD::SiNumerology
Definition: SiNumerology.h:27
query_example.col
col
Definition: query_example.py:7
InDetDD::PixelModuleType::IBL_PLANAR
@ IBL_PLANAR
OrderInitialRdos::m_pixelReadout
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
Definition: PixelRawContByteStreamTool.h:105
DataVector< RawDataT >::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
PixelRawContByteStreamTool::m_BCs_per_LVL1ID
int m_BCs_per_LVL1ID
Definition: PixelRawContByteStreamTool.h:80
PixelRawContByteStreamTool::packRawDataWord
uint32_t packRawDataWord(uint32_t FE, uint32_t row, uint32_t column, uint32_t ToT) const
Definition: PixelRawContByteStreamTool.cxx:674
FullEventAssembler::setRodMinorVersion
void setRodMinorVersion(uint16_t m)
change the ROD minor version
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
PixelRawContByteStreamTool::packLinkTrailer
uint32_t packLinkTrailer(uint32_t errors) const
Definition: PixelRawContByteStreamTool.cxx:689
PixelRawContByteStreamTool::m_PixelID
const PixelID * m_PixelID
Definition: PixelRawContByteStreamTool.h:75
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
PixelRawContByteStreamTool.h
PixelRDORawData
Definition: PixelRDORawData.h:23
InDetRawData::identify
virtual Identifier identify() const override final
Definition: InDetRawData.h:41
PixelRawContByteStreamTool::packLinkHeader
uint32_t packLinkHeader(uint32_t module, uint32_t bcid, uint32_t lvl1id, uint32_t lvl1idskip, uint32_t errors) const
Definition: PixelRawContByteStreamTool.cxx:625
AthAlgTool
Definition: AthAlgTool.h:26
PixelID::phi_module
int phi_module(const Identifier &id) const
Definition: PixelID.h:644
InDetDD::PixelModuleType::IBL_3D
@ IBL_3D
FullEventAssembler::getRodData
RODDATA * getRodData(uint32_t id)
get a block of ROD data
DataVector< RawDataT >::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
PixelByteStreamErrors::LVL1ID
@ LVL1ID
Definition: PixelByteStreamErrors.h:13
OrderRdos::m_pixelReadout
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
Definition: PixelRawContByteStreamTool.h:92
Identifier
Definition: IdentifierFieldParser.cxx:14