ATLAS Offline Software
TrigCaloDataAccessSvc.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
9 
10 #include <sstream>
11 #include <type_traits>
12 
13 TrigCaloDataAccessSvc::TrigCaloDataAccessSvc( const std::string& name, ISvcLocator* pSvcLocator )
14  : base_class( name, pSvcLocator ),
15  m_bcidAvgKey("CaloBCIDAverage"),
16  m_lateInitDone(false), m_nSlots(0)
17 {
18 }
19 
21 
23  m_autoRetrieveTools = false;
24  m_checkToolDeps = false;
25 
26  CHECK( m_larDecoder.retrieve() );
27  CHECK( m_tileDecoder.retrieve() );
28  CHECK( m_robDataProvider.retrieve() );
33  CHECK( m_regionSelector_TTEM.retrieve() );
35  CHECK( m_bcContKey.initialize() );
37  CHECK( m_regionSelector_TTHEC.retrieve() );
38  CHECK( m_regionSelector_FCALEM.retrieve() );
39  CHECK( m_regionSelector_FCALHAD.retrieve() );
40  CHECK( m_regionSelector_TILE.retrieve() );
42 
43  return StatusCode::SUCCESS;
44 }
45 
47 
48  std::lock_guard<std::mutex> lock( m_initMutex ); // use the initMutex to finalize
49  if ( m_lateInitDone ) { // otherwise nothing to delete
50  m_vrodid32fullDet.clear();
51  for( size_t ii=0;ii<m_vrodid32fullDetHG.size();ii++) { m_vrodid32fullDetHG[ii].clear(); }
52  m_vrodid32fullDetHG.clear();
53  for ( size_t slot = 0; slot < m_nSlots; ++ slot ) {
54  EventContext ec;
55  ec.setSlot( slot );
56  HLTCaloEventCache *cache = m_hLTCaloSlot.get( ec );
57  CHECK( cache->larContainer->finalize() );
58  delete cache->larContainer;
59  CHECK( cache->tileContainer->finalize() );
60  delete cache->tileContainer;
61  cache->d0cells->clear();
62  delete cache->d0cells;
63  cache->lastFSEvent = 0xFFFFFFFF;
64  delete cache->fullcont;
65  } // end of for slots
66  } // end of m_lateInitDone
67  m_lateInitDone=false;
68  return StatusCode::SUCCESS;
69 }
70 
71 
72 unsigned int TrigCaloDataAccessSvc::prepareFullCollections( const EventContext& context ) {
73 
74  return prepareLArFullCollections( context );
75 
76 }
77 
78 
79 StatusCode TrigCaloDataAccessSvc::loadCollections ( const EventContext& context,
80  const IRoiDescriptor& roi,
81  const DETID detID,
82  const int sampling,
83  LArTT_Selector<LArCellCont>& loadedCells ) {
84 
85  std::vector<IdentifierHash> requestHashIDs;
86 
87  ATH_MSG_DEBUG( "LArTT requested for event " << context << " and RoI " << roi );
88  unsigned int sc = prepareLArCollections( context, roi, sampling, detID );
89 
90  if ( sc ) return StatusCode::FAILURE;
91 
92  {
93  // this has to be guarded because getTT called on the LArCollection bu other threads updates internal map
94  std::lock_guard<std::mutex> getCollClock{ m_hLTCaloSlot.get( context )->mutex };
95  switch ( detID ) {
96  case TTEM: {m_regionSelector_TTEM->HashIDList( sampling, roi, requestHashIDs ); break; }
97  case TTHEC: {m_regionSelector_TTHEC->HashIDList( sampling, roi, requestHashIDs ); break; }
98  case FCALEM: {m_regionSelector_FCALEM->HashIDList( sampling, roi, requestHashIDs ); break; }
99  case FCALHAD: {m_regionSelector_FCALHAD->HashIDList( sampling, roi, requestHashIDs ); break; }
100  default: break;
101  }
102  }
103 
104  ATH_MSG_DEBUG( "requestHashIDs.size() in LoadColl = " << requestHashIDs.size() << " hash checksum "
105  << std::accumulate( requestHashIDs.begin(), requestHashIDs.end(), IdentifierHash( 0 ),
106  []( IdentifierHash h1, IdentifierHash h2 ){ return h1+h2; } ) );
107  if ( msgLvl( MSG::VERBOSE ) ) {
108  for( unsigned int i = 0 ; i < requestHashIDs.size() ; i++ )
109  ATH_MSG_VERBOSE( "m_rIds[" << i << "]=" << requestHashIDs[i] );
110  }
112  loadedCells.setContainer( ( m_hLTCaloSlot.get( context )->larContainer ) );
113  loadedCells.setMap( *roimap );
114 
115  {
116  // this has to be guarded because getTT called on the LArCollection bu other threads updates internal map
117  std::lock_guard<std::mutex> getCollClock{ m_hLTCaloSlot.get( context )->mutex };
118  loadedCells.setRoIs( requestHashIDs );
119  }
120  if ( sc ) return StatusCode::FAILURE;
121  else return StatusCode::SUCCESS;
122 }
123 
125  const IRoiDescriptor& roi,
126  std::vector<const TileCell*>& loadedCells ) {
127  std::vector<IdentifierHash> requestHashIDs;
128 
129  ATH_MSG_DEBUG( "Tile requested for event " << context << " and RoI " << roi );
130  unsigned int sc = prepareTileCollections( context, roi );
131 
132  if ( sc ) return StatusCode::FAILURE;
133 
134  {
135  // this has to be guarded because getTT called on the LArCollection bu other threads updates internal map
136  std::lock_guard<std::mutex> getCollClock{ m_hLTCaloSlot.get( context )->mutex };
137  m_regionSelector_TILE->HashIDList( roi, requestHashIDs );
138  }
139  ATH_MSG_DEBUG( "requestHashIDs.size() in LoadColl = " << requestHashIDs.size() << " hash checksum "
140  << std::accumulate( requestHashIDs.begin(), requestHashIDs.end(), IdentifierHash( 0 ),
141  []( IdentifierHash h1, IdentifierHash h2 ){ return h1+h2; } ) );
142  if ( msgLvl( MSG::VERBOSE ) ) {
143  for( unsigned int i = 0 ; i < requestHashIDs.size() ; i++ )
144  ATH_MSG_VERBOSE( "requestHashIDs[" << i << "]=" << requestHashIDs[i] );
145  }
146  size_t listIDsize = requestHashIDs.size();
147  HLTCaloEventCache* cache = m_hLTCaloSlot.get( context );
148  TileCellCont* tilecell = cache->tileContainer;
149  std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFrags;
150  loadedCells.clear(); // should reserve
151  for (size_t i = 0; i < listIDsize; ++i){
152  // Find the collection to dump
153  const std::vector<TileCellCollection*>::const_iterator it =
154  (tilecell->find(requestHashIDs[i]));
156  if ( col == NULL ) continue;
157  TileCellCollection::const_iterator itt = (*it)->begin();
158  TileCellCollection::const_iterator End = (*it)->end();
159  for (;itt!=End;++itt){
160  const TileCell* cell = (const TileCell*)*itt;
161  loadedCells.push_back( cell );
162  } // End of for printout cells
163  }
164 
165  return StatusCode::SUCCESS;
166 }
167 
168 
170  CaloConstCellContainer& cont ) {
171 
172  // Gets all data
173  {
174  std::lock_guard<std::mutex> dataPrepLock { m_dataPrepMutex };
175  m_robDataProvider->addROBData( context, m_vrodid32fullDet );
176  }
177  {
178  std::lock_guard<std::mutex> dataPrepLock { m_dataPrepMutex };
179  m_robDataProvider->addROBData( context, m_vrodid32tile );
180  }
181 
182  unsigned int sc = prepareLArFullCollections( context );
183  ATH_CHECK( sc == 0 );
184 
185  sc = prepareTileFullCollections( context );
186  ATH_CHECK( sc == 0 );
187 
188  m_hLTCaloSlot.get(context)->lastFSEvent = context.evt();
189 
190  std::lock_guard<std::mutex> getCollClock{ m_getCollMutex };
191  CaloCellContainer* cont_to_copy = m_hLTCaloSlot.get(context)->fullcont ;
192  cont.clear();
193  cont.reserve( cont_to_copy->size() );
194  for( const CaloCell* c : *cont_to_copy ) cont.push_back_fast( c );
195  cont.setIsOrdered(true);
196  cont.setIsOrderedAndComplete(true);
197 
198  ATH_CHECK( sc == 0 );
199 
200  return StatusCode::SUCCESS;
201 }
202 
203 
204 unsigned int TrigCaloDataAccessSvc::prepareLArFullCollections( const EventContext& context) {
205 
206  ATH_MSG_DEBUG( "Full Col " << " requested for event " << context );
207  if ( !m_lateInitDone && lateInit(context) ) {
208  ATH_MSG_ERROR("Could not execute late init");
209  return 0x1; // dummy code
210  }
211 
212  HLTCaloEventCache* cache = m_hLTCaloSlot.get( context );
213 
214  auto lockTime = Monitored::Timer ( "TIME_locking_LAr_FullDet" );
215  std::lock_guard<std::mutex> collectionLock { cache->mutex };
216  lockTime.stop();
217 
218  if ( cache->lastFSEvent == context.evt() ) return 0x0; // dummy code
219  cache->larContainer->eventNumber( context.evt() ) ;
220  if ( m_applyOffsetCorrection && cache->larContainer->lumiBCIDCheck( context ) ) {
223  const CaloBCIDAverage* avgPtr = avg.cptr();
224  const LArOnOffIdMapping* onoffPtr = onoff.cptr();
225  if ( avgPtr && onoffPtr ) cache->larContainer->updateBCID( *avgPtr, *onoffPtr );
226  }
227 
228  unsigned int status(0);
229 
230  for( size_t ii=0;ii<m_vrodid32fullDetHG.size();ii++) {
231  std::vector<uint32_t>& vrodid32fullDet = m_vrodid32fullDetHG[ii];
232  std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFrags;
233  {
234  std::lock_guard<std::mutex> dataPrepLock { m_dataPrepMutex };
235  // To be confirmed whether we need this or not
236  m_robDataProvider->addROBData( context, vrodid32fullDet );
237  m_robDataProvider->getROBData( context, vrodid32fullDet, robFrags );
238  }
239 
240  status |= convertROBs( robFrags, ( cache->larContainer ), (cache->larRodBlockStructure_per_slot), cache->rodMinorVersion, cache->robBlockType );
241 
242  if ( vrodid32fullDet.size() != robFrags.size() ) {
243  ATH_MSG_DEBUG( "Missing ROBs, requested " << vrodid32fullDet.size() << " obtained " << robFrags.size() );
244  //status |= 0x1; // dummy code
245  clearMissing( vrodid32fullDet, robFrags, ( cache->larContainer ) );
246  }
247  } // end of for m_vrodid32fullDetHG.size()
248 
249  int detid(0);
250  auto detidMon = Monitored::Scalar<int>( "det", detid );
251 
252  Monitored::Group( m_monTool, lockTime, detidMon );
253  return status;
254 }
255 
256 unsigned int TrigCaloDataAccessSvc::prepareTileFullCollections( const EventContext& context) {
257 
258  ATH_MSG_DEBUG( "Full Col " << " requested for event " << context );
259  if ( !m_lateInitDone && lateInit(context) ) {
260  ATH_MSG_ERROR("Could not execute late init");
261  return 0x1; // dummy code
262  }
263 
264  HLTCaloEventCache* cache = m_hLTCaloSlot.get( context );
265 
266  auto lockTime = Monitored::Timer ( "TIME_locking_LAr_FullDet" );
267  std::lock_guard<std::mutex> collectionLock { cache->mutex };
268  lockTime.stop();
269 
270  if ( cache->lastFSEvent == context.evt() ) return 0x0;
271  if ( cache->tileContainer->eventNumber() != context.evt() )
272  cache->d0cells->clear();
273  cache->tileContainer->eventNumber( context.evt() );
274 
275  unsigned int status(0);
276  convertROBs( context, m_rIdstile, cache->tileContainer, cache->d0cells );
277 
278  int detid(0);
279  auto detidMon = Monitored::Scalar<int>( "det", detid );
280 
281  Monitored::Group( m_monTool, lockTime, detidMon );
282  return status;
283 }
284 
285 unsigned int TrigCaloDataAccessSvc::lateInit(const EventContext& context) { // non-const this thing
286 
287  std::lock_guard<std::mutex> lock( m_initMutex );
288  if ( m_lateInitDone )
289  return 0x0; // dummy code
290 
291  ATH_MSG_DEBUG( "Performing late init" );
292 
293  // allocate collections
295 
296  // preparing full container list of ROBs - tile will be included soon
297  std::vector<uint32_t> vrodid32lar;
298  std::vector<uint32_t> vrodid32em;
299  std::vector<uint32_t> vrodid32hec;
300  std::vector<uint32_t> vrodid32hec0;
301  std::vector<uint32_t> vrodid32hec1;
302  std::vector<uint32_t> vrodid32hec2;
303  std::vector<uint32_t> vrodid32hec3;
304  std::vector<uint32_t> vrodid32fcalem;
305  std::vector<uint32_t> vrodid32fcalhad;
306 
307  TrigRoiDescriptor tmproi(true);
308  std::vector<uint32_t> vrodid32tile;
309  std::vector<IdentifierHash> rIdstile;
310  // TTEM
311  m_regionSelector_TTEM->ROBIDList(-1,tmproi,vrodid32em);
312  // TTHEC
313  m_regionSelector_TTHEC->ROBIDList(0,tmproi,vrodid32hec0);
314  m_regionSelector_TTHEC->ROBIDList(1,tmproi,vrodid32hec1);
315  m_regionSelector_TTHEC->ROBIDList(2,tmproi,vrodid32hec2);
316  m_regionSelector_TTHEC->ROBIDList(3,tmproi,vrodid32hec3);
317  // FCALHAD
318  m_regionSelector_FCALEM->ROBIDList(-1,tmproi,vrodid32fcalem);
319  m_regionSelector_FCALHAD->ROBIDList(-1,tmproi,vrodid32fcalhad);
320  m_regionSelector_TILE->ROBIDList(tmproi,vrodid32tile);
321  m_regionSelector_TILE->HashIDList(tmproi,rIdstile);
322 
323  m_vrodid32tile.resize( vrodid32tile.size() );
324  m_rIdstile.resize(rIdstile.size() );
325  // Tile RODs and ID coming from the Tile tables are not unique
326  // iii and iij are local variables helping to clear non-unique IDs
327  auto iii = std::unique_copy(vrodid32tile.begin(),vrodid32tile.end(),m_vrodid32tile.begin());
328  auto iij = std::unique_copy(rIdstile.begin(),rIdstile.end(),m_rIdstile.begin());
329  std::sort( m_vrodid32tile.begin(), iii );
330  std::sort( m_rIdstile.begin(), iij );
331  iii = std::unique_copy(m_vrodid32tile.begin(),iii,m_vrodid32tile.begin());
332  iij = std::unique_copy(m_rIdstile.begin(),iij,m_rIdstile.begin());
333  m_vrodid32tile.resize( std::distance(m_vrodid32tile.begin(), iii) );
334  m_rIdstile.resize( std::distance(m_rIdstile.begin(), iij) );
335 
336  vrodid32lar.insert(vrodid32lar.end(),vrodid32em.begin(),vrodid32em.end());
337  vrodid32hec.insert(vrodid32hec.end(),vrodid32hec0.begin(),vrodid32hec0.end());
338  vrodid32lar.insert(vrodid32lar.end(),vrodid32hec.begin(),vrodid32hec.end());
339  vrodid32lar.insert(vrodid32lar.end(),vrodid32fcalhad.begin(),vrodid32fcalhad.end());
340  vrodid32lar.insert(vrodid32lar.end(),vrodid32fcalem.begin(),vrodid32fcalem.end());
341  m_vrodid32fullDet.insert(m_vrodid32fullDet.end(), vrodid32lar.begin(), vrodid32lar.end() );
342 
343 
344  SG::ReadCondHandle<LArMCSym> mcsym (m_mcsymKey, context);
346  SG::ReadCondHandle<LArBadChannelCont> larBadChan{ m_bcContKey, context };
349  SG::ReadCondHandle<TileHid2RESrcID> tileHid2RESrcID ( m_tileHid2RESrcIDKey, context);
350 
351  unsigned int nFebs=70;
352  unsigned int high_granu = (unsigned int)ceilf(m_vrodid32fullDet.size()/((float)nFebs) );
353  unsigned int jj=0;
354  unsigned int kk=0;
355  m_vrodid32fullDetHG.resize(high_granu);
356  for( unsigned int ii=0; ii<m_vrodid32fullDet.size();ii++){
357  if ( kk >= nFebs ) {
358  kk-=nFebs;
359  jj++;
360  }
361  std::vector<uint32_t> & vec = m_vrodid32fullDetHG.at(jj);
362  vec.push_back(m_vrodid32fullDet[ii]);
363  kk++;
364  }
366  const CaloDetDescrManager* theCaloDDM = *caloMgrHandle;
367  const CaloCell_ID* theCaloCCIDM = theCaloDDM->getCaloCell_ID();
368  unsigned int hashMax = theCaloCCIDM->calo_cell_hash_max();
369 
370  // Prepare cache containers to be used for LAr unpacking.
371  for ( size_t slot = 0; slot < m_nSlots; ++ slot ) {
372  EventContext ec;
373  ec.setSlot( slot );
374  HLTCaloEventCache *cache = m_hLTCaloSlot.get( ec );
375  cache->larContainer = new LArCellCont();
376  cache->larRodBlockStructure_per_slot = nullptr;
377  if ( cache->larContainer->initialize( **roimap, **onoff, **mcsym, **febrod, **larBadChan, *theCaloDDM).isFailure() )
378  return 0x1; // dummy code
379  std::vector<CaloCell*> local_cell_copy;
380  local_cell_copy.reserve(200000);
381  LArCellCont* larcell = cache->larContainer;
382  cache->lastFSEvent = 0xFFFFFFFF;
384  cachefullcont->reserve(190000);
385  const LArBadChannelCont& badchannel = **larBadChan;
386  for(unsigned int lcidx=0; lcidx < larcell->size(); lcidx++){
387  LArCellCollection* lcc = larcell->at(lcidx);
388  unsigned int lccsize = lcc->size();
389  for(unsigned int lccidx=0; lccidx<lccsize; lccidx++){
390  CaloCell* cell = ((*lcc).at(lccidx));
391  if ( cell && cell->caloDDE() ) {
392  LArBadChannel bc = badchannel.offlineStatus(cell->ID());
393  bool good(true);
394  if (! bc.good() ){
395  // cell has some specific problems
396  if ( bc.unstable() ) good=false;
397  if ( bc.highNoiseHG() ) good=false;
398  if ( bc.highNoiseMG() ) good=false;
399  if ( bc.highNoiseLG() ) good=false;
400  if ( bc.problematicForUnknownReason() ) good=false;
401  }
402  if ( good ) local_cell_copy.push_back( cell );
403  }
404  } // end of loop over cells
405  } // end of loop over collection
406 
407 // This should stay here as this will be enabled when tile is ready to be decoded as well
408  TileCellCont* tilecell = new TileCellCont();
409  cache->tileContainer = tilecell;
410  tilecell->setHashIdToROD( *tileHid2RESrcID );
411  if( tilecell->initialize().isFailure() ) return 0x1; //dummy code
412  for (unsigned int i=0;i<4;i++) {
413  m_tileDecoder->loadRw2Cell ( i, tilecell->Rw2CellMap(i) );
414  m_tileDecoder->loadRw2Pmt ( i, tilecell->Rw2PmtMap (i) );
415  }
416  m_tileDecoder->loadMBTS( tilecell->MBTS_map(), tilecell->MBTS_channel() );
417  m_mbts_rods = tilecell->MBTS_RODs();
418  for(size_t i = 0 ; i < m_mbts_rods->size(); i++)
419  m_mbts_add_rods.insert(m_mbts_add_rods.end(),(*m_mbts_rods).begin(),(*m_mbts_rods).end());
420  sort(m_mbts_add_rods.begin(),m_mbts_add_rods.end());
421  m_mbts_add_rods.erase(std::unique(m_mbts_add_rods.begin(),m_mbts_add_rods.end()),m_mbts_add_rods.end());
423  for(unsigned int lcidx=0; lcidx < tilecell->size(); lcidx++){
424  TileCellCollection* lcc = tilecell->at(lcidx);
425  unsigned int lccsize = lcc->size();
426  for(unsigned int lccidx=0; lccidx<lccsize; lccidx++){
427  CaloCell* cell = ((*lcc).at(lccidx));
428  if ( cell ) local_cell_copy.push_back( cell );
429  } // end of loop over cells
430  TileRawChannelCollection::ID frag_id = ((*lcc).identify() & 0x0FFF);
431  int ros = (frag_id >> 8);
432  if ( ros == 1 ) { //treatment for d0Cells in barrel
433  int drawer = (frag_id & 0xFF);
434  TileCellCollection::iterator pCell = lcc->begin();
435  pCell+=2;
436  d0cellsp->m_cells[drawer] = *pCell;
437  }
438  } // end of loop over collection
439 
440  // d0merge cells
441  cache->d0cells = d0cellsp;
442 
443  // For the moment the container has to be completed by hand (again, because of tile)
444  for(unsigned int i=0;i<hashMax;i++){
445  cachefullcont->push_back_fast(nullptr);
446  }
447 
448  unsigned int localcellMax = local_cell_copy.size();
449  for(unsigned int i=0;i<localcellMax;i++){
450  unsigned int j = local_cell_copy.at(i)->caloDDE()->calo_hash();
451  if ( j < hashMax ) {
452  cachefullcont->at(j) = local_cell_copy.at(i);
453  }
454  }
455  for(unsigned int i=0;i<hashMax;i++)
456  if ( cachefullcont->at(i) == nullptr ){
457  Identifier id = theCaloCCIDM->cell_id(i);
458  if ( id!=0 ){
459  const CaloDetDescrElement* el = theCaloDDM->get_element(id);
460  if ( el->is_tile() ) {
461  cachefullcont->at(i) = new TileCell(el,0,0,0,0,CaloGain::TILEHIGHHIGH);
462  } else {
463  cachefullcont->at(i) = new LArCell(el,0,0,0,(CaloGain::CaloGain)0);
464  }
465  }
466  }
467 
468  cachefullcont->setHasCalo(CaloCell_ID::LAREM);
469  cachefullcont->setHasCalo(CaloCell_ID::LARHEC);
470  cachefullcont->setHasCalo(CaloCell_ID::LARFCAL);
471  cachefullcont->setHasCalo(CaloCell_ID::TILE); //lying... But this needs to be checked later
472 
473  // make sure this "map" container has a good hashID
474  cachefullcont->order();
475 
476  if ( hashMax != cachefullcont->size() )
477  ATH_MSG_ERROR("Problem in the size of the full container");
478  cachefullcont->setIsOrdered(true);
479  cachefullcont->setIsOrderedAndComplete(true);
480  cache->fullcont = cachefullcont;
481 
482  local_cell_copy.clear();
483  }
484  m_lateInitDone = true;
485  return 0x0;
486 }
487 
488 unsigned int TrigCaloDataAccessSvc::convertROBs( const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& robFrags,
489  LArCellCont* larcell, LArRodBlockStructure*& larRodBlockStructure_per_slot,
490  uint16_t rodMinorVersion, uint32_t robBlockType ) {
491 
492  unsigned int status(0);
493  for ( auto rob: robFrags ) {
494  uint32_t sourceID = rob->source_id();
495  const std::vector<LArCellCollection*>::const_iterator it = larcell->find( sourceID );
496  //TB The find also switches the state of the collection to "decoded" so repeated decoding is avoided
497 
498  if ( it != larcell->end() && ( *it )->size() != 0 ) { // Already decoded collection
499 
500  // TB if we have entered here it means the decoding did not occur yet ( or failed )
501  //
502  LArCellCollection* coll = *it;
503  ATH_MSG_DEBUG( "ROB of ID " << sourceID << " to be decoded" );
504 
505  std::lock_guard<std::mutex> decoderLock( m_lardecoderProtect );
506  //TB next two lines seem danger, as they seem to rely on the decoder state
507  m_larDecoder->setsecfeb( larcell->findsec( sourceID ) );
508  if ( ! m_larDecoder->check_valid( rob, msg() ) ){
509  ATH_MSG_WARNING( "Error reading bytestream"<<
510  "event: Bad ROB block ( eformat checks ) : 0x"
511  << std::hex << sourceID << std::dec );
512  // Data seems corrupted
513  //status |= 0x1; // dummy code
514  reset_LArCol ( coll );
515 
516  } else {
517  // Get Rod Data and size of fragment
518  const uint32_t* roddata = 0;
519  rob->rod_data( roddata );
520  size_t roddatasize = rob->rod_ndata();
521  if ( roddatasize < 3 ) {
522  ATH_MSG_WARNING( "Error reading bytestream"<<
523  "event: Empty ROD block ( less than 3 words ) : 0x"
524  << std::hex << sourceID << std::dec );
525  // Data seems corrupted
526  //status |= 0x1; // dummy code
527  reset_LArCol ( coll );
528  } else { // End of if small size
529  //TB the converter has state
530  m_larDecoder->fillCollectionHLT( *rob, roddata, roddatasize, *coll, larRodBlockStructure_per_slot, rodMinorVersion, robBlockType );
531 
532  // Accumulates inferior byte from ROD Decoder
533  // TB the converter has state
534  //status |= (m_larDecoder->report_error());
535 
536  if ( m_applyOffsetCorrection ) larcell->applyBCIDCorrection( sourceID );
537  }
538 
539  }
540  } else {
541  ATH_MSG_VERBOSE( "ROB of ID " << sourceID << " already decoded" );
542  }
543  }
544  ATH_MSG_DEBUG( "finished decoding" );
545  return status;
546 }
547 
548 unsigned int TrigCaloDataAccessSvc::convertROBs( const EventContext& context,
549  const std::vector<IdentifierHash>& rIds,
550  TileCellCont* tilecell,
551  TileROD_Decoder::D0CellsHLT* d0cells) {
552  unsigned int status(0);
553  TileCellCollection* mbts = tilecell->MBTS_collection();
554  const TileHid2RESrcID* hid2re = tilecell->getHashIdToROD();
555 
556  size_t listIDsize = rIds.size();
557  std::vector<unsigned int> tile; tile.push_back(0);
558  // Tile likes rob by rob
559  std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFrags1;
560  for (size_t i = 0; i < listIDsize; ++i){
561  tile[0] = tilecell->find_rod(rIds[i]);
562  m_robDataProvider->getROBData(context,tile,robFrags1);
563  // Number of ROBs smaller than requested is below
564  //if ( robFrags1.empty() ) m_error|=0x10000000;
565  // Find the collection to fill
566  const std::vector<TileCellCollection*>::const_iterator it =
567  (tilecell->find(rIds[i]));
569  if ( robFrags1.size()!=0 && col != NULL ) {
570  size_t roddatasize = robFrags1[0]->rod_ndata();
571  // insert data into vector (to be removed soon)
572  if (roddatasize < 3) {
573  ATH_MSG_WARNING( "Error reading bytestream"<<
574  "event: Empty ROD block (less than 3 words) : 0x"
575  << std::hex << tile[0] << std::dec );
576  msg(MSG::WARNING) << "Error reading bytestream "
577  << "event: Empty ROD block (less than 3 words) : 0x"
578  << std::hex << tile[0] << std::dec << endmsg;
579  // Data seems corrupted
580  //m_error|=0x20000000;
581  if ( !tilecell->cached(rIds[i])){
582  // resets collection
584  }
585  robFrags1.clear();
586  } else {// End of if small size
587  std::lock_guard<std::mutex> decoderLock { m_tiledecoderProtect };
588  if ( !tilecell->cached(rIds[i]))
589  m_tileDecoder->fillCollectionHLT(robFrags1[0],*col,*d0cells,mbts,hid2re);
590  m_tileDecoder->mergeD0cellsHLT(*d0cells,*col);
591  // Accumulates superior byte from ROD Decoder
592  //m_error|=m_tileDecoder->report_error();
593  robFrags1.clear();
594  } // end of else
595  } // end of if robFrags1.size
596  } // End of for through RobFrags
597 
598  ATH_MSG_DEBUG( "finished decoding" );
599  return status;
600 }
601 
602 void TrigCaloDataAccessSvc::missingROBs( const std::vector<uint32_t>& request,
603  const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& response,
604  std::set<uint32_t>& missing ) const {
605 
606  std::set<uint32_t> receivedROBsSet;
607  for ( auto rob: response )
608  receivedROBsSet.insert( rob->source_id() );
609  std::set<uint32_t> requestedROBsSet( request.begin(), request.end() );
610 
611  std::set_difference( requestedROBsSet.begin(), requestedROBsSet.end(),
612  receivedROBsSet.begin(), receivedROBsSet.end(),
613  std::inserter( missing, missing.begin() ) );
614 }
615 
616 
617 void TrigCaloDataAccessSvc::clearMissing( const std::vector<uint32_t>& request,
618  const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& response,
619  LArCellCont* larcell ) {
620  std::set<uint32_t> missing;
621  missingROBs( request, response, missing );
622  for ( uint32_t robID : missing ) {
623  const std::vector<LArCellCollection*>::const_iterator it = larcell->find( robID );
624  if ( it != larcell->end() && ( *it )->size()!=0 ) { // Already decoded collection
625  reset_LArCol ( *it );
626  }
627  }
628 }
629 
630 
631 unsigned int TrigCaloDataAccessSvc::prepareLArCollections( const EventContext& context,
632  const IRoiDescriptor& roi,
633  const int sampling,
634  DETID detector ) {
635 
636  // If the full event was already unpacked, don't need to unpack RoI
637  if ( !m_lateInitDone && lateInit(context) ) {
638  return 0x1; // dummy code
639  }
640  HLTCaloEventCache* cache = m_hLTCaloSlot.get( context );
641  if ( cache->lastFSEvent == context.evt() ) return 0x0;
642 
643  std::vector<uint32_t> requestROBs;
644 
645  std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFrags;
646  {
647  std::lock_guard<std::mutex> dataPrepLock { m_dataPrepMutex };
648  switch ( detector ) {
649  case TTEM: {m_regionSelector_TTEM->ROBIDList( sampling, roi, requestROBs ); break; }
650  case TTHEC: {m_regionSelector_TTHEC->ROBIDList( sampling, roi, requestROBs ); break; }
651  case FCALEM: {m_regionSelector_FCALEM->ROBIDList( sampling, roi, requestROBs ); break; }
652  case FCALHAD: {m_regionSelector_FCALHAD->ROBIDList( sampling, roi, requestROBs ); break; }
653  default: break;
654  }
655 
656  m_robDataProvider->addROBData( context, requestROBs );
657  m_robDataProvider->getROBData( context, requestROBs, robFrags );
658  }
659  if ( robFrags.empty() && (!requestROBs.empty()) ) {
660  return 0x0; // dummy code
661  }
662 
663  auto lockTime = Monitored::Timer ( "TIME_locking_LAr_RoI" );
664  std::lock_guard<std::mutex> collectionLock { cache->mutex };
665  lockTime.stop();
666 
667  // TB, what would happen from now inside the collection unapcking
668  // if this event number is different than the one for each collection the unpacking will happen,
669  // if it is the same the unpacking will not be repeated
670  // same in prepareLArFullCollections
671  cache->larContainer->eventNumber( context.evt() );
672  if ( m_applyOffsetCorrection && cache->larContainer->lumiBCIDCheck( context ) ) {
675  const CaloBCIDAverage* avgPtr = avg.cptr();
676  const LArOnOffIdMapping* onoffPtr = onoff.cptr();
677  if ( avgPtr && onoffPtr ) cache->larContainer->updateBCID( *avgPtr, *onoffPtr );
678  }
679 
680  unsigned int status = convertROBs( robFrags, ( cache->larContainer ), (cache->larRodBlockStructure_per_slot), cache->rodMinorVersion, cache->robBlockType );
681 
682  if ( requestROBs.size() != robFrags.size() ) {
683  ATH_MSG_DEBUG( "Missing ROBs, requested " << requestROBs.size() << " obtained " << robFrags.size() );
684  //status |= 0x1; // dummy code
685  clearMissing( requestROBs, robFrags, ( cache->larContainer ) );
686  }
687  auto roiROBs = Monitored::Scalar( "roiROBs_LAr", robFrags.size() );
688  auto roiEta = Monitored::Scalar( "roiEta_LAr", roi.eta() );
689  auto roiPhi = Monitored::Scalar( "roiPhi_LAr", roi.phi() );
690 
691  Monitored::Group( m_monTool, lockTime, roiEta, roiPhi, roiROBs );
692  return status;
693 }
694 
695 unsigned int TrigCaloDataAccessSvc::prepareTileCollections( const EventContext& context,
696  const IRoiDescriptor& roi) {
697 
698  // If the full event was already unpacked, don't need to unpack RoI
699  if ( !m_lateInitDone && lateInit(context) ) {
700  return 0x1; // dummy code
701  }
702  HLTCaloEventCache* cache = m_hLTCaloSlot.get( context );
703  if ( cache->lastFSEvent == context.evt() ) return 0x0;
704 
705  std::vector<uint32_t> requestROBs;
706  std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFrags;
707  std::vector<IdentifierHash> rIds;
708  {
709  std::lock_guard<std::mutex> dataPrepLock { m_dataPrepMutex };
710  m_regionSelector_TILE->ROBIDList( 0, roi, requestROBs );
711  m_regionSelector_TILE->HashIDList(roi, rIds);
712  m_robDataProvider->addROBData( context, requestROBs );
713  }
714 
715 
716  std::lock_guard<std::mutex> collectionLock { cache->mutex };
717  if ( cache->tileContainer->eventNumber() != context.evt() )
718  cache->d0cells->clear();
719  cache->tileContainer->eventNumber( context.evt() );
720 
721  unsigned int status = convertROBs( context, rIds, cache->tileContainer, cache->d0cells );
722 
723  return status;
724 }
725 
726 unsigned int TrigCaloDataAccessSvc::prepareMBTSCollections( const EventContext& context) {
727 
728  // If the full event was already unpacked, don't need to unpack RoI
729  if ( !m_lateInitDone && lateInit(context) ) {
730  return 0x0; // dummy code
731  }
732  HLTCaloEventCache* cache = m_hLTCaloSlot.get( context );
733  if ( cache->lastFSEvent == context.evt() ) return 0x0;
734 
735  std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFrags;
736  {
737  std::lock_guard<std::mutex> dataPrepLock { m_dataPrepMutex };
738  m_robDataProvider->addROBData( context, m_mbts_add_rods );
739  }
740  std::lock_guard<std::mutex> collectionLock { cache->mutex };
741  TileCellCont* tilecell = cache->tileContainer;
742  if ( cache->tileContainer->eventNumber() != context.evt() )
743  cache->d0cells->clear();
744  cache->tileContainer->eventNumber( context.evt() );
745 
746  const std::vector<unsigned int>* ids = tilecell->MBTS_IDs();
747  std::vector<IdentifierHash> tileIds;
748  for(size_t i=0;i<ids->size(); i++) tileIds.push_back( (*ids)[i] );
749  unsigned int status = convertROBs( context, tileIds, cache->tileContainer, cache->d0cells );
750 
751  return status;
752 }
753 
754 
755 
756 StatusCode TrigCaloDataAccessSvc::loadMBTS ( const EventContext& context,
757  std::vector<const TileCell*>& loadedCells ) {
758 
759  ATH_MSG_DEBUG( "MBTS requested for event " << context );
760  unsigned int sc = prepareMBTSCollections(context);
761 
762  if ( sc ) return StatusCode::FAILURE;
763 
764  HLTCaloEventCache* cache = m_hLTCaloSlot.get( context );
765  std::lock_guard<std::mutex> collectionLock { cache->mutex };
766  TileCellCont* tilecell = cache->tileContainer;
767  TileCellCollection* mbts = tilecell->MBTS_collection();
768  loadedCells.reserve(mbts->size());
769  for (size_t i=0;i<mbts->size(); ++i)
770  loadedCells.push_back(mbts->at(i));
771  return StatusCode::SUCCESS;
772 
773 }
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
LArRodBlockStructure
Definition: LArRodBlockStructure.h:48
TileCellCont::find_rod
unsigned int find_rod(const unsigned int &id) const
Definition: TileCellCont.cxx:221
TileCell
Definition: TileCell.h:57
IRoiDescriptor::phi
virtual double phi() const =0
Methods to retrieve data members.
TrigCaloDataAccessSvc::reset_TileCol
void reset_TileCol(TileCellCollection *col)
Definition: TrigCaloDataAccessSvc.h:98
TrigCaloDataAccessSvc::HLTCaloEventCache::mutex
std::mutex mutex
Definition: TrigCaloDataAccessSvc.h:128
TrigCaloDataAccessSvc::m_onOffIdMappingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_onOffIdMappingKey
Definition: TrigCaloDataAccessSvc.h:82
TTHEC
@ TTHEC
Definition: RegSelEnums.h:29
CaloCell_Base_ID::LARFCAL
@ LARFCAL
Definition: CaloCell_Base_ID.h:46
TrigCaloDataAccessSvc::m_regionSelector_TILE
ToolHandle< IRegSelTool > m_regionSelector_TILE
Definition: TrigCaloDataAccessSvc.h:74
TrigCaloDataAccessSvc::m_regionSelector_TTEM
ToolHandle< IRegSelTool > m_regionSelector_TTEM
Definition: TrigCaloDataAccessSvc.h:70
LArBadChannel::good
bool good() const
Returns true if no problems at all (all bits at zero)
Definition: LArBadChannel.h:89
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TileCellCont::MBTS_RODs
const std::vector< unsigned int > * MBTS_RODs()
Definition: TileCellCont.h:56
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
TrigCaloDataAccessSvc::m_tileHid2RESrcIDKey
SG::ReadCondHandleKey< TileHid2RESrcID > m_tileHid2RESrcIDKey
Definition: TrigCaloDataAccessSvc.h:92
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
TileCellCollection
Definition: TileCellCollection.h:12
HLTSeedingRoIToolDefs::roiPhi
constexpr float roiPhi(const AnyRoIPointer &roi)
Definition: HLTSeedingRoIToolDefs.h:167
TrigCaloDataAccessSvc::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigCaloDataAccessSvc.h:67
TrigCaloDataAccessSvc::HLTCaloEventCache::larContainer
LArCellCont * larContainer
Definition: TrigCaloDataAccessSvc.h:129
LArTT_Selector::setContainer
void setContainer(const CONTAINER *c)
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
TrigCaloDataAccessSvc::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: TrigCaloDataAccessSvc.h:90
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TrigCaloDataAccessSvc::clearMissing
void clearMissing(const std::vector< uint32_t > &request, const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &response, LArCellCont *larcell)
clear fragments of the collection for which ROBs were not available
Definition: TrigCaloDataAccessSvc.cxx:617
TrigCaloDataAccessSvc::m_lardecoderProtect
std::mutex m_lardecoderProtect
Definition: TrigCaloDataAccessSvc.h:145
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
response
MDT_Response response
Definition: MDT_ResponseTest.cxx:28
TrigCaloDataAccessSvc::m_getCollMutex
std::mutex m_getCollMutex
Definition: TrigCaloDataAccessSvc.h:144
TileCellCont::getHashIdToROD
const TileHid2RESrcID * getHashIdToROD() const
Definition: TileCellCont.h:67
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
LArCellCont::lumiBCIDCheck
bool lumiBCIDCheck(const EventContext &context)
Definition: LArCellCont.cxx:297
TrigCaloDataAccessSvc::HLTCaloEventCache::lastFSEvent
unsigned int lastFSEvent
Definition: TrigCaloDataAccessSvc.h:136
LArBadXCont
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
Definition: LArBadChannelCont.h:28
CaloCellContainer::setIsOrdered
void setIsOrdered(const bool ordered)
indicates that the container is ordered
Definition: CaloCellContainer.cxx:204
CaloCellContainer::setHasCalo
void setHasCalo(const CaloCell_ID::SUBCALO caloNum)
set which calo has been filled.
Definition: CaloCellContainer.cxx:213
LArCellCont::find
const std::vector< LArCellCollection * >::const_iterator find(const HWIdentifier &id) const
Finds a collection by its LArReadoutModuleID.
Definition: LArCellCont.cxx:228
FCALEM
@ FCALEM
Definition: RegSelEnums.h:35
TrigCaloDataAccessSvc::m_tiledecoderProtect
std::mutex m_tiledecoderProtect
Definition: TrigCaloDataAccessSvc.h:146
TrigCaloDataAccessSvc::prepareFullCollections
unsigned int prepareFullCollections(const EventContext &context)
Definition: TrigCaloDataAccessSvc.cxx:72
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
TrigCaloDataAccessSvc::HLTCaloEventCache::d0cells
TileROD_Decoder::D0CellsHLT * d0cells
Definition: TrigCaloDataAccessSvc.h:135
TrigCaloDataAccessSvc::initialize
virtual StatusCode initialize() override
Definition: TrigCaloDataAccessSvc.cxx:20
TrigCaloDataAccessSvc::m_febRodMappingKey
SG::ReadCondHandleKey< LArFebRodMapping > m_febRodMappingKey
Definition: TrigCaloDataAccessSvc.h:84
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition: CaloDetDescrManager.cxx:159
skel.it
it
Definition: skel.GENtoEVGEN.py:423
TrigCaloDataAccessSvc::m_nSlots
size_t m_nSlots
Definition: TrigCaloDataAccessSvc.h:193
TrigCaloDataAccessSvc::m_hLTCaloSlot
SG::SlotSpecificObj< HLTCaloEventCache > m_hLTCaloSlot
Definition: TrigCaloDataAccessSvc.h:140
TileCellCont::Rw2PmtMap
const std::vector< int > & Rw2PmtMap(int section)
Definition: TileCellCont.h:79
CaloCell_Base_ID::LARHEC
@ LARHEC
Definition: CaloCell_Base_ID.h:46
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
xAOD::roiEta
setTeId setLumiBlock setRoiId setRoiSubsystem setRoiNumber roiEta
Definition: L2StandAloneMuon_v2.cxx:343
LArCellCont
Class which contains statically allocated LArCellCollections.
Definition: LArCellCont.h:42
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
LArBadChannel::highNoiseHG
bool highNoiseHG() const
Definition: LArBadChannel.h:115
FCALHAD
@ FCALHAD
Definition: RegSelEnums.h:36
TrigCaloDataAccessSvc::m_regionSelector_FCALHAD
ToolHandle< IRegSelTool > m_regionSelector_FCALHAD
Definition: TrigCaloDataAccessSvc.h:73
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
LArCellCont::findsec
HWIdentifier findsec(const unsigned int &id) const
Each Collection contains data from 2 FEBs.
Definition: LArCellCont.cxx:265
TrigCaloDataAccessSvc::TrigCaloDataAccessSvc
TrigCaloDataAccessSvc(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TrigCaloDataAccessSvc.cxx:13
read_hist_ntuple.h1
h1
Definition: read_hist_ntuple.py:21
LArBadXCont::offlineStatus
LArBC_t offlineStatus(const Identifier id) const
Query the status of a particular channel by offline ID This is the main client access method.
TileCellCont::setHashIdToROD
void setHashIdToROD(const TileHid2RESrcID *p)
Definition: TileCellCont.h:64
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
ReadCondHandle.h
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TileHid2RESrcID
This class provides conversion between fragment ID and RESrcID.
Definition: TileHid2RESrcID.h:28
RunTileMonitoring.mbts
mbts
Definition: RunTileMonitoring.py:133
TrigCaloDataAccessSvc::loadMBTS
virtual StatusCode loadMBTS(const EventContext &context, std::vector< const TileCell * > &loadedCells) override
Definition: TrigCaloDataAccessSvc.cxx:756
TileCellCont::find
const std::vector< TileCellCollection * >::const_iterator find(const unsigned int &id) const
Finds a collection.
Definition: TileCellCont.cxx:194
RunTileCalibRec.CaloCellContainer
CaloCellContainer
Definition: RunTileCalibRec.py:403
ReadCellNoiseFromCool.tile
tile
Definition: ReadCellNoiseFromCool.py:92
TRT::Hit::detector
@ detector
Definition: HitInfo.h:78
DETID
DETID
An enum to define subdetector names.
Definition: RegSelEnums.h:23
CaloGain::TILEHIGHHIGH
@ TILEHIGHHIGH
Definition: CaloGain.h:15
CaloConstCellContainer::setIsOrdered
void setIsOrdered(bool ordered)
indicates that the container is ordered
python.changerun.kk
list kk
Definition: changerun.py:41
IRoiDescriptor::eta
virtual double eta() const =0
TileRawChannelCollection::ID
MyBase::ID ID
Definition: TileRawChannelCollection.h:17
LArCellCont::applyBCIDCorrection
void applyBCIDCorrection(const unsigned int &rodid)
method to apply correction based on the luminosity to the energy
Definition: LArCellCont.cxx:246
ConstDataVector::clear
void clear()
Erase all the elements in the collection.
TrigCaloDataAccessSvc::prepareTileCollections
unsigned int prepareTileCollections(const EventContext &context, const IRoiDescriptor &roi)
Definition: TrigCaloDataAccessSvc.cxx:695
TileROD_Decoder::D0CellsHLT::clear
void clear()
Definition: TileROD_Decoder.cxx:4182
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TrigCaloDataAccessSvc::HLTCaloEventCache::robBlockType
uint32_t robBlockType
Definition: TrigCaloDataAccessSvc.h:132
TileROD_Decoder::D0CellsHLT
Definition: TileROD_Decoder.h:123
TTEM
@ TTEM
Definition: RegSelEnums.h:28
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
TileCellCont::eventNumber
void eventNumber(const unsigned int eN)
Definition: TileCellCont.h:70
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:92
TrigCaloDataAccessSvc::m_mbts_add_rods
std::vector< unsigned int > m_mbts_add_rods
Definition: TrigCaloDataAccessSvc.h:189
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
LArBadChannel::problematicForUnknownReason
bool problematicForUnknownReason() const
Definition: LArBadChannel.h:125
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
CaloConstCellContainer::setIsOrderedAndComplete
void setIsOrderedAndComplete(bool ordered)
indicate that the container is complete and in order
Recovery.avg
def avg(a, b)
Definition: Recovery.py:79
IRoiDescriptor
Describes the API of the Region of Ineterest geometry.
Definition: IRoiDescriptor.h:23
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
CaloConstCellContainer::push_back_fast
void push_back_fast(const CaloCell *cell)
reimplementation of push_back to gain speed in readin
TrigCaloDataAccessSvc::m_lateInitDone
bool m_lateInitDone
Definition: TrigCaloDataAccessSvc.h:149
TrigCaloDataAccessSvc::convertROBs
unsigned int convertROBs(const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &robFrags, LArCellCont *larcell, LArRodBlockStructure *&larRodBlockStructure, uint16_t rodMinorVersion, uint32_t robBlockType)
Definition: TrigCaloDataAccessSvc.cxx:488
TileCellCont::Rw2CellMap
const std::vector< int > & Rw2CellMap(int section)
Definition: TileCellCont.h:47
LArBadChannel
Definition: LArBadChannel.h:10
TileCellCont
This class builds the Tile cells.
Definition: TileCellCont.h:25
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
TrigCaloDataAccessSvc::loadCollections
virtual StatusCode loadCollections(const EventContext &context, const IRoiDescriptor &roi, const DETID detID, const int sampling, LArTT_Selector< LArCellCont > &loadedCells) override
Definition: TrigCaloDataAccessSvc.cxx:79
TrigCaloDataAccessSvc::prepareLArFullCollections
unsigned int prepareLArFullCollections(const EventContext &context)
Definition: TrigCaloDataAccessSvc.cxx:204
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloBCIDAverage
Definition: CaloBCIDAverage.h:16
LArTT_Selector::setRoIs
void setRoIs(const VEC_TT_ID &ids)
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
CaloCell_Base_ID::TILE
@ TILE
Definition: CaloCell_Base_ID.h:46
TileCellCont::MBTS_collection
const TileCellCollection * MBTS_collection(void) const
Definition: TileCellCont.h:50
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
TrigCaloDataAccessSvc::prepareTileFullCollections
unsigned int prepareTileFullCollections(const EventContext &context)
Definition: TrigCaloDataAccessSvc.cxx:256
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
TrigCaloDataAccessSvc::HLTCaloEventCache
convience structure to keep together a collection and auxiliar full collection selectors
Definition: TrigCaloDataAccessSvc.h:127
TrigCaloDataAccessSvc::m_robDataProvider
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Definition: TrigCaloDataAccessSvc.h:69
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
TrigCaloDataAccessSvc::finalize
virtual StatusCode finalize() override
Definition: TrigCaloDataAccessSvc.cxx:46
TrigCaloDataAccessSvc::HLTCaloEventCache::fullcont
CaloCellContainer * fullcont
Definition: TrigCaloDataAccessSvc.h:134
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
TrigCaloDataAccessSvc::m_regionSelector_TTHEC
ToolHandle< IRegSelTool > m_regionSelector_TTHEC
Definition: TrigCaloDataAccessSvc.h:71
TrigCaloDataAccessSvc::m_rIdstile
std::vector< IdentifierHash > m_rIdstile
Definition: TrigCaloDataAccessSvc.h:191
TrigCaloDataAccessSvc::m_dataPrepMutex
std::mutex m_dataPrepMutex
Definition: TrigCaloDataAccessSvc.h:143
TrigCaloDataAccessSvc::HLTCaloEventCache::tileContainer
TileCellCont * tileContainer
Definition: TrigCaloDataAccessSvc.h:133
TileCellCont::cached
bool cached(const unsigned int &rodid)
Definition: TileCellCont.h:72
TrigCaloDataAccessSvc::reset_LArCol
void reset_LArCol(LArCellCollection *coll)
Definition: TrigCaloDataAccessSvc.h:94
CaloCellContainer::push_back_fast
void push_back_fast(CaloCell *)
reimplementation of push_back to gain speed in readin
Definition: CaloCellContainer.cxx:102
TrigCaloDataAccessSvc::prepareLArCollections
unsigned int prepareLArCollections(const EventContext &context, const IRoiDescriptor &roi, const int sampling, DETID detector)
LAr TT collections preparation code.
Definition: TrigCaloDataAccessSvc.cxx:631
TileCellCont::MBTS_channel
int MBTS_channel(void)
Definition: TileCellCont.h:60
LArCellCollection
Container Class for LArCell in a ROB used by EF.
Definition: LArCellCollection.h:28
TileROD_Decoder::D0CellsHLT::m_cells
TileCell * m_cells[64]
Definition: TileROD_Decoder.h:133
TrigCaloDataAccessSvc::m_regionSelector_FCALEM
ToolHandle< IRegSelTool > m_regionSelector_FCALEM
Definition: TrigCaloDataAccessSvc.h:72
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
TrigCaloDataAccessSvc::m_applyOffsetCorrection
Gaudi::Property< bool > m_applyOffsetCorrection
Definition: TrigCaloDataAccessSvc.h:76
LArCellCont::initialize
StatusCode initialize(const LArRoIMap &roiMap, const LArOnOffIdMapping &onOffMap, const LArMCSym &mcsym, const LArFebRodMapping &febrod, const LArBadChannelCont &badchannel, const CaloDetDescrManager &ddm)
initialize method.
Definition: LArCellCont.cxx:22
CaloCellContainer::order
void order()
order container
Definition: CaloCellContainer.cxx:474
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
LArCell
Data object for LAr calorimeter readout cell.
Definition: LArCell.h:53
LArBadChannel::highNoiseLG
bool highNoiseLG() const
Definition: LArBadChannel.h:121
LArTT_Selector< LArCellCont >
TrigCaloDataAccessSvc::loadFullCollections
virtual StatusCode loadFullCollections(const EventContext &context, CaloConstCellContainer &cont) override
Definition: TrigCaloDataAccessSvc.cxx:169
LArCellCont::updateBCID
void updateBCID(const CaloBCIDAverage &, const LArOnOffIdMapping &)
update BCID dependent correction table for MT case
Definition: LArCellCont.cxx:280
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
query_example.col
col
Definition: query_example.py:7
CaloCell_Base_ID::cell_id
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
TrigCaloDataAccessSvc::m_vrodid32fullDet
std::vector< uint32_t > m_vrodid32fullDet
Definition: TrigCaloDataAccessSvc.h:187
TileCellCont::MBTS_map
std::map< unsigned int, unsigned int > & MBTS_map(void)
Definition: TileCellCont.h:54
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
TrigCaloDataAccessSvc::m_mcsymKey
SG::ReadCondHandleKey< LArMCSym > m_mcsymKey
Definition: TrigCaloDataAccessSvc.h:80
TrigCaloDataAccessSvc::m_mbts_rods
const std::vector< unsigned int > * m_mbts_rods
Definition: TrigCaloDataAccessSvc.h:190
TrigCaloDataAccessSvc::m_vrodid32fullDetHG
std::vector< std::vector< uint32_t > > m_vrodid32fullDetHG
Definition: TrigCaloDataAccessSvc.h:192
ReadBchFromCool.good
good
Definition: ReadBchFromCool.py:433
TrigCaloDataAccessSvc::m_initMutex
std::mutex m_initMutex
Definition: TrigCaloDataAccessSvc.h:142
TrigCaloDataAccessSvc::m_bcidAvgKey
SG::ReadHandleKey< CaloBCIDAverage > m_bcidAvgKey
Definition: TrigCaloDataAccessSvc.h:78
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
LArBadChannel::unstable
bool unstable() const
Definition: LArBadChannel.h:112
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
TrigCaloDataAccessSvc::m_bcContKey
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
Definition: TrigCaloDataAccessSvc.h:86
CaloConstCellContainer
CaloCellContainer that can accept const cell pointers.
Definition: CaloConstCellContainer.h:45
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TrigCaloDataAccessSvc::prepareMBTSCollections
unsigned int prepareMBTSCollections(const EventContext &context)
Definition: TrigCaloDataAccessSvc.cxx:726
LArTT_Selector::setMap
void setMap(const LArRoIMap *map)
SG::getNSlots
size_t getNSlots()
Return the number of event slots.
Definition: SlotSpecificObj.cxx:64
TileCellCont::initialize
StatusCode initialize(void)
Definition: TileCellCont.cxx:39
LArBadChannel::highNoiseMG
bool highNoiseMG() const
Definition: LArBadChannel.h:118
CaloDetDescrManager::getCaloCell_ID
const CaloCell_ID * getCaloCell_ID() const
get calo cell ID helper
Definition: CaloDetDescrManager.cxx:1590
TrigCaloDataAccessSvc.h
TrigRoiDescriptor.h
merge.status
status
Definition: merge.py:17
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
TrigCaloDataAccessSvc::m_larDecoder
PublicToolHandle< LArRodDecoder > m_larDecoder
Definition: TrigCaloDataAccessSvc.h:64
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
IdentifierHash
Definition: IdentifierHash.h:38
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:46
TrigCaloDataAccessSvc::m_vrodid32tile
std::vector< uint32_t > m_vrodid32tile
Definition: TrigCaloDataAccessSvc.h:188
TrigCaloDataAccessSvc::HLTCaloEventCache::larRodBlockStructure_per_slot
LArRodBlockStructure * larRodBlockStructure_per_slot
Definition: TrigCaloDataAccessSvc.h:130
TileCellCont::MBTS_IDs
const std::vector< unsigned int > * MBTS_IDs()
Definition: TileCellCont.h:58
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
python.compressB64.c
def c
Definition: compressB64.py:93
TrigCaloDataAccessSvc::lateInit
unsigned int lateInit(const EventContext &context)
Definition: TrigCaloDataAccessSvc.cxx:285
TileCellCont::finalize
StatusCode finalize(void)
Definition: TileCellCont.cxx:198
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
CaloCellContainer::setIsOrderedAndComplete
void setIsOrderedAndComplete(const bool ordered)
indicate that the container is complete and in order
Definition: CaloCellContainer.cxx:165
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
TrigCaloDataAccessSvc::HLTCaloEventCache::rodMinorVersion
uint16_t rodMinorVersion
Definition: TrigCaloDataAccessSvc.h:131
readCCLHist.float
float
Definition: readCCLHist.py:83
Monitored::Timer
A monitored timer.
Definition: MonitoredTimer.h:32
TrigCaloDataAccessSvc::missingROBs
void missingROBs(const std::vector< uint32_t > &request, const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &response, std::set< uint32_t > &missing) const
fill the set of missing robs given the request and response from RoBDatProvider
Definition: TrigCaloDataAccessSvc.cxx:602
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
CaloCell_Base_ID::calo_cell_hash_max
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20
TrigCaloDataAccessSvc::m_larRoIMapKey
SG::ReadCondHandleKey< LArRoIMap > m_larRoIMapKey
Definition: TrigCaloDataAccessSvc.h:88
SG::ReadCondHandle::cptr
const_pointer_type cptr()
Definition: ReadCondHandle.h:67
LArCellCont::finalize
StatusCode finalize(void)
finalize method.
Definition: LArCellCont.cxx:208
LArCellCont::eventNumber
void eventNumber(const unsigned int eN)
sets Event Number
Definition: LArCellCont.h:85
TrigCaloDataAccessSvc::m_tileDecoder
PublicToolHandle< TileROD_Decoder > m_tileDecoder
Definition: TrigCaloDataAccessSvc.h:65