ATLAS Offline Software
Loading...
Searching...
No Matches
TrigCaloDataAccessSvc Class Reference

#include <TrigCaloDataAccessSvc.h>

Inheritance diagram for TrigCaloDataAccessSvc:

Classes

struct  HLTCaloEventCache
 convience structure to keep together a collection and auxiliar full collection selectors More...

Public Member Functions

virtual StatusCode initialize () override
virtual StatusCode finalize () override
virtual StatusCode loadCollections (const EventContext &context, const IRoiDescriptor &roi, const DETID detID, const int sampling, LArTT_Selector< LArCellCont > &loadedCells) override
virtual StatusCode loadCollections (const EventContext &context, const IRoiDescriptor &roi, std::vector< const TileCell * > &loadedCells) override
virtual StatusCode loadMBTS (const EventContext &context, std::vector< const TileCell * > &loadedCells) override
virtual StatusCode loadFullCollections (const EventContext &context, CaloConstCellContainer &cont) override

Private Member Functions

void reset_LArCol (LArCellCollection *coll)
void reset_TileCol (TileCellCollection *col)
void lateInit (const EventContext &context)
void convertROBs (const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &robFrags, LArCellCont *larcell, LArRodBlockStructure *&larRodBlockStructure, uint16_t rodMinorVersion, uint32_t robBlockType, const LArDeadOTXFromSC *dead)
void convertROBs (const EventContext &context, const std::vector< IdentifierHash > &rIds, TileCellCont *tilecell, TileROD_Decoder::D0CellsHLT *d0cells)
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
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
StatusCode prepareLArCollections (const EventContext &context, const IRoiDescriptor &roi, const int sampling, DETID detector)
 LAr TT collections preparation code.
StatusCode prepareTileCollections (const EventContext &context, const IRoiDescriptor &roi)
StatusCode prepareMBTSCollections (const EventContext &context)
StatusCode prepareLArFullCollections (const EventContext &context)
StatusCode prepareTileFullCollections (const EventContext &context)

Private Attributes

PublicToolHandle< LArRodDecoderm_larDecoder { this, "LArDecoderTool", "LArRodDecoder/LArRodDecoder", "Tool to decode LAr raw data" }
PublicToolHandle< TileROD_Decoderm_tileDecoder { this, "TileDecoderTool", "TileROD_Decoder/TileROD_Decoder", "Tool to decode Tile raw data" }
ToolHandle< GenericMonitoringToolm_monTool { this, "MonTool", "", "Tool to monitor performance of the service" }
ServiceHandle< IROBDataProviderSvcm_robDataProvider { this, "ROBDataProvider", "ROBDataProviderSvc/ROBDataProviderSvc", ""}
ToolHandle< IRegSelToolm_regionSelector_TTEM { this, "RegSelToolEM", "RegSelTool/RegSelTool_TTEM" }
ToolHandle< IRegSelToolm_regionSelector_TTHEC { this, "RegSelToolHEC", "RegSelTool/RegSelTool_TTHEC" }
ToolHandle< IRegSelToolm_regionSelector_FCALEM { this, "RegSelToolFCALEM", "RegSelTool/RegSelTool_FCALEM" }
ToolHandle< IRegSelToolm_regionSelector_FCALHAD { this, "RegSelToolFCALHAD", "RegSelTool/RegSelTool_FCALHAD" }
ToolHandle< IRegSelToolm_regionSelector_TILE { this, "RegSelToolTILE", "RegSelTool/RegSelTool_TILE" }
Gaudi::Property< bool > m_applyOffsetCorrection { this, "ApplyOffsetCorrection", true, "Enable offset correction" }
SG::ReadHandleKey< CaloBCIDAveragem_bcidAvgKey {this, "BCIDAvgKey", "CaloBCIDAverage", "SG Key of CaloBCIDAverage object"}
SG::ReadCondHandleKey< LArMCSymm_mcsymKey {this, "MCSymKey", "LArMCSym", "SG Key of LArMCSym object"}
SG::ReadCondHandleKey< LArOnOffIdMappingm_onOffIdMappingKey {this, "CablingKey", "LArOnOffIdMap", "SG Key for LArOnOffIdMapping"}
SG::ReadCondHandleKey< LArFebRodMappingm_febRodMappingKey {this, "RodFebKey", "LArFebRodMap", "SG Key for LArFebRodMapping"}
SG::ReadCondHandleKey< LArBadChannelContm_bcContKey {this, "LArBadChannelKey", "LArBadChannel", "Key of the LArBadChannelCont CDO" }
SG::ReadCondHandleKey< LArRoIMapm_larRoIMapKey {this, "LArRoIMapKey", "LArRoIMap", "Key of the LArRoIMap CDO" }
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey {this, "CaloDetDescrManager", "CaloDetDescrManager", "SG Key for CaloDetDescrManager in the Condition Store" }
SG::ReadCondHandleKey< TileHid2RESrcIDm_tileHid2RESrcIDKey {this, "TileHid2RESrcID", "TileHid2RESrcIDHLT", "SG Key of TileHid2RESrcID object"}
SG::ReadHandleKey< LArDeadOTXFromSCm_deadOTXFromSCKey {this, "LArDeadOTXFromSC", "DeadOTXFromSC", "Key of the DeadOTXFromSC CDO" }
bool m_correctDead {false}
std::vector< unsigned int > m_insertedCells
SG::SlotSpecificObj< HLTCaloEventCachem_hLTCaloSlot
std::mutex m_getCollMutex
std::mutex m_lardecoderProtect
std::mutex m_tiledecoderProtect
std::once_flag m_lateInitFlag
std::vector< uint32_t > m_vrodid32fullDet
std::vector< uint32_t > m_vrodid32tile
std::vector< unsigned int > m_mbts_add_rods
std::vector< IdentifierHashm_rIdstile
std::vector< std::vector< uint32_t > > m_vrodid32fullDetHG

Detailed Description

Definition at line 46 of file TrigCaloDataAccessSvc.h.

Member Function Documentation

◆ clearMissing()

void TrigCaloDataAccessSvc::clearMissing ( const std::vector< uint32_t > & request,
const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > & response,
LArCellCont * larcell )
private

clear fragments of the collection for which ROBs were not available

Definition at line 594 of file TrigCaloDataAccessSvc.cxx.

596 {
597 std::set<uint32_t> missing;
598 missingROBs( request, response, missing );
599 for ( uint32_t robID : missing ) {
600 const auto it = larcell->find( robID );
601 if ( it != larcell->end() && not (*it)->empty() ) { // Already decoded collection
602 reset_LArCol ( *it );
603 }
604 }
605}
MDT_Response response
const std::vector< LArCellCollection * >::const_iterator find(const HWIdentifier &id) const
Finds a collection by its LArReadoutModuleID.
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
void reset_LArCol(LArCellCollection *coll)

◆ convertROBs() [1/2]

void TrigCaloDataAccessSvc::convertROBs ( const EventContext & context,
const std::vector< IdentifierHash > & rIds,
TileCellCont * tilecell,
TileROD_Decoder::D0CellsHLT * d0cells )
private

Definition at line 533 of file TrigCaloDataAccessSvc.cxx.

536 {
537
538 TileCellCollection* mbts = tilecell->MBTS_collection();
539 const TileHid2RESrcID* hid2re = tilecell->getHashIdToROD();
540
541 std::vector<unsigned int> tile{0};
542 // Tile likes rob by rob
543 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFrags;
544 for (size_t i = 0; i < rIds.size(); ++i){
545 tile[0] = tilecell->find_rod(rIds[i]);
546 m_robDataProvider->getROBData(context,tile,robFrags);
547 // Find the collection to fill
548 const auto it = tilecell->find(rIds[i]);
549 if (it == tilecell->end()) continue;
550
551 TileCellCollection* col = *it;
552 if ( !robFrags.empty() && col != nullptr ) {
553 const size_t roddatasize = robFrags[0]->rod_ndata();
554 // insert data into vector (to be removed soon)
555 if (roddatasize < 3) {
556 ATH_MSG_WARNING( "Error reading bytestream"<<
557 "event: Empty ROD block (less than 3 words) : 0x"
558 << std::hex << tile[0] << std::dec );
559 if ( !tilecell->cached(rIds[i])){
560 // resets collection
561 reset_TileCol(col);
562 }
563 robFrags.clear();
564 } else {
565 std::scoped_lock decoderLock{m_tiledecoderProtect};
566 if ( !tilecell->cached(rIds[i]) ) {
567 m_tileDecoder->fillCollectionHLT(robFrags[0],*col,*d0cells,mbts,hid2re);
568 }
569 m_tileDecoder->mergeD0cellsHLT(*d0cells,*col);
570 robFrags.clear();
571 }
572 } // end of if robFrags.size
573 } // End of for through RobFrags
574
575 ATH_MSG_DEBUG( "finished decoding" );
576}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
unsigned int find_rod(const unsigned int &id) const
const std::vector< TileCellCollection * >::const_iterator find(const unsigned int &id) const
Finds a collection.
const TileCellCollection * MBTS_collection(void) const
bool cached(const unsigned int &rodid)
const TileHid2RESrcID * getHashIdToROD() const
PublicToolHandle< TileROD_Decoder > m_tileDecoder
void reset_TileCol(TileCellCollection *col)
ServiceHandle< IROBDataProviderSvc > m_robDataProvider

◆ convertROBs() [2/2]

void TrigCaloDataAccessSvc::convertROBs ( const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > & robFrags,
LArCellCont * larcell,
LArRodBlockStructure *& larRodBlockStructure,
uint16_t rodMinorVersion,
uint32_t robBlockType,
const LArDeadOTXFromSC * dead )
private

Definition at line 463 of file TrigCaloDataAccessSvc.cxx.

465 {
466
467 for ( auto rob: robFrags ) {
468 uint32_t sourceID = rob->source_id();
469 const auto it = larcell->find( sourceID );
470 //TB The find also switches the state of the collection to "decoded" so repeated decoding is avoided
471
472 if ( it != larcell->end() && ( *it )->size() != 0 ) { // Already decoded collection
473
474 // TB if we have entered here it means the decoding did not occur yet ( or failed )
475 //
476 LArCellCollection* coll = *it;
477 ATH_MSG_DEBUG( "ROB of ID " << sourceID << " to be decoded" );
478
479 std::scoped_lock decoderLock{m_lardecoderProtect};
480 //TB next two lines seem danger, as they seem to rely on the decoder state
481 const HWIdentifier& feb_id_local = larcell->findsec( sourceID );
482 m_larDecoder->setsecfeb( feb_id_local );
483 if ( ! m_larDecoder->check_valid( rob, msg() ) ){
484 ATH_MSG_WARNING( "Error reading bytestream"<<
485 "event: Bad ROB block ( eformat checks ) : 0x"
486 << std::hex << sourceID << std::dec );
487 // Data seems corrupted
488 reset_LArCol ( coll );
489
490 } else {
491 // Get Rod Data and size of fragment
492 const uint32_t* roddata = 0;
493 rob->rod_data( roddata );
494 const size_t roddatasize = rob->rod_ndata();
495 if ( roddatasize < 3 ) {
496 ATH_MSG_WARNING( "Error reading bytestream"<<
497 "event: Empty ROD block ( less than 3 words ) : 0x"
498 << std::hex << sourceID << std::dec );
499 // Data seems corrupted
500 reset_LArCol ( coll );
501 } else {
502 //TB the converter has state
503 m_larDecoder->fillCollectionHLT( *rob, roddata, roddatasize, *coll, larRodBlockStructure_per_slot, rodMinorVersion, robBlockType );
504 if ( deadHandle ){
505 if ( deadHandle->isThisOTXdead(feb_id_local) ) {
506 const std::vector<float>& corr = deadHandle->correctionFromThisOTXdead(feb_id_local);
507 // The sizes here are guaranteed by construction
508 for(size_t i=0;i<128;i++) {
509 (*coll)[i+128]->set(corr[i],0,0,0x1000,CaloGain::LARHIGHGAIN);
510 }
511 }
512 HWIdentifier feb_id_local2(larRodBlockStructure_per_slot->getFEBID());
513 if ( deadHandle->isThisOTXdead(feb_id_local2) ) {
514 const std::vector<float>& corr = deadHandle->correctionFromThisOTXdead(feb_id_local2);
515 // The sizes here are guaranteed by construction
516 for(size_t i=0;i<128;i++) {
517 (*coll)[i]->set(corr[i],0,0,0x1000,CaloGain::LARHIGHGAIN);
518 }
519 }
520 }
521
522 if ( m_applyOffsetCorrection ) larcell->applyBCIDCorrection( sourceID );
523 }
524
525 }
526 } else {
527 ATH_MSG_VERBOSE( "ROB of ID " << sourceID << " already decoded" );
528 }
529 }
530 ATH_MSG_DEBUG( "finished decoding" );
531}
#define ATH_MSG_VERBOSE(x)
void applyBCIDCorrection(const unsigned int &rodid)
method to apply correction based on the luminosity to the energy
HWIdentifier findsec(const unsigned int &id) const
Each Collection contains data from 2 FEBs.
Gaudi::Property< bool > m_applyOffsetCorrection
PublicToolHandle< LArRodDecoder > m_larDecoder
@ LARHIGHGAIN
Definition CaloGain.h:18
setEventNumber uint32_t
MsgStream & msg
Definition testRead.cxx:32

◆ finalize()

StatusCode TrigCaloDataAccessSvc::finalize ( )
overridevirtual

Definition at line 42 of file TrigCaloDataAccessSvc.cxx.

42 {
43
44 m_vrodid32fullDet.clear();
45 m_vrodid32fullDetHG.clear();
46 for (HLTCaloEventCache& cache : m_hLTCaloSlot) {
47 if (cache.larContainer) ATH_CHECK( cache.larContainer->finalize() );
48 if (cache.tileContainer) ATH_CHECK( cache.tileContainer->finalize() );
49 if (cache.d0cells) cache.d0cells->clear();
50 if (cache.fullcont) {
51 for (unsigned int i : m_insertedCells) delete cache.fullcont->at(i);
52 }
53 }
54
55 return StatusCode::SUCCESS;
56}
#define ATH_CHECK
Evaluate an expression and check for errors.
std::vector< std::vector< uint32_t > > m_vrodid32fullDetHG
SG::SlotSpecificObj< HLTCaloEventCache > m_hLTCaloSlot
std::vector< unsigned int > m_insertedCells
std::vector< uint32_t > m_vrodid32fullDet
convience structure to keep together a collection and auxiliar full collection selectors

◆ initialize()

StatusCode TrigCaloDataAccessSvc::initialize ( )
overridevirtual

Temporary fix

Definition at line 14 of file TrigCaloDataAccessSvc.cxx.

14 {
15
17 m_autoRetrieveTools = false;
18 m_checkToolDeps = false;
19
20 ATH_CHECK( m_larDecoder.retrieve() );
21 ATH_CHECK( m_tileDecoder.retrieve() );
22 ATH_CHECK( m_robDataProvider.retrieve() );
23 ATH_CHECK( m_bcidAvgKey.initialize() );
24 ATH_CHECK( m_onOffIdMappingKey.initialize() );
25 ATH_CHECK( m_larRoIMapKey.initialize() );
26 ATH_CHECK( m_febRodMappingKey.initialize() );
27 ATH_CHECK( m_regionSelector_TTEM.retrieve() );
28 ATH_CHECK( m_mcsymKey.initialize() );
29 ATH_CHECK( m_bcContKey.initialize() );
30 ATH_CHECK( m_caloMgrKey.initialize());
34 ATH_CHECK( m_regionSelector_TILE.retrieve() );
37 ATH_CHECK( m_tileHid2RESrcIDKey.initialize() );
38
39 return StatusCode::SUCCESS;
40}
ToolHandle< IRegSelTool > m_regionSelector_TTHEC
SG::ReadCondHandleKey< TileHid2RESrcID > m_tileHid2RESrcIDKey
SG::ReadHandleKey< CaloBCIDAverage > m_bcidAvgKey
SG::ReadCondHandleKey< LArFebRodMapping > m_febRodMappingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_onOffIdMappingKey
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
ToolHandle< IRegSelTool > m_regionSelector_FCALEM
SG::ReadHandleKey< LArDeadOTXFromSC > m_deadOTXFromSCKey
SG::ReadCondHandleKey< LArRoIMap > m_larRoIMapKey
ToolHandle< IRegSelTool > m_regionSelector_TTEM
ToolHandle< IRegSelTool > m_regionSelector_FCALHAD
ToolHandle< IRegSelTool > m_regionSelector_TILE
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
SG::ReadCondHandleKey< LArMCSym > m_mcsymKey

◆ lateInit()

void TrigCaloDataAccessSvc::lateInit ( const EventContext & context)
private

Definition at line 264 of file TrigCaloDataAccessSvc.cxx.

264 { // non-const this thing
265
266 ATH_MSG_DEBUG( "Performing late init" );
267
268 // preparing full container list of ROBs - tile will be included soon
269 std::vector<uint32_t> vrodid32lar;
270 std::vector<uint32_t> vrodid32em;
271 std::vector<uint32_t> vrodid32hec;
272 std::vector<uint32_t> vrodid32hec0;
273 std::vector<uint32_t> vrodid32hec1;
274 std::vector<uint32_t> vrodid32hec2;
275 std::vector<uint32_t> vrodid32hec3;
276 std::vector<uint32_t> vrodid32fcalem;
277 std::vector<uint32_t> vrodid32fcalhad;
278
279 TrigRoiDescriptor tmproi(true);
280 std::vector<uint32_t> vrodid32tile;
281 std::vector<IdentifierHash> rIdstile;
282 // TTEM
283 m_regionSelector_TTEM->lookup(context)->ROBIDList(-1,tmproi,vrodid32em);
284 // TTHEC
285 m_regionSelector_TTHEC->lookup(context)->ROBIDList(0,tmproi,vrodid32hec0);
286 m_regionSelector_TTHEC->lookup(context)->ROBIDList(1,tmproi,vrodid32hec1);
287 m_regionSelector_TTHEC->lookup(context)->ROBIDList(2,tmproi,vrodid32hec2);
288 m_regionSelector_TTHEC->lookup(context)->ROBIDList(3,tmproi,vrodid32hec3);
289 // FCALHAD
290 m_regionSelector_FCALEM->lookup(context)->ROBIDList(-1,tmproi,vrodid32fcalem);
291 m_regionSelector_FCALHAD->lookup(context)->ROBIDList(-1,tmproi,vrodid32fcalhad);
292 m_regionSelector_TILE->lookup(context)->ROBIDList(tmproi,vrodid32tile);
293 m_regionSelector_TILE->lookup(context)->HashIDList(tmproi,rIdstile);
294
295 m_vrodid32tile.resize( vrodid32tile.size() );
296 m_rIdstile.resize(rIdstile.size() );
297 // Tile RODs and ID coming from the Tile tables are not unique
298 // iii and iij are local variables helping to clear non-unique IDs
299 auto iii = std::unique_copy(vrodid32tile.begin(),vrodid32tile.end(),m_vrodid32tile.begin());
300 auto iij = std::unique_copy(rIdstile.begin(),rIdstile.end(),m_rIdstile.begin());
301 std::sort( m_vrodid32tile.begin(), iii );
302 std::sort( m_rIdstile.begin(), iij );
303 iii = std::unique_copy(m_vrodid32tile.begin(),iii,m_vrodid32tile.begin());
304 iij = std::unique_copy(m_rIdstile.begin(),iij,m_rIdstile.begin());
305 m_vrodid32tile.resize( std::distance(m_vrodid32tile.begin(), iii) );
306 m_rIdstile.resize( std::distance(m_rIdstile.begin(), iij) );
307
308 vrodid32lar.insert(vrodid32lar.end(),vrodid32em.begin(),vrodid32em.end());
309 vrodid32hec.insert(vrodid32hec.end(),vrodid32hec0.begin(),vrodid32hec0.end());
310 vrodid32lar.insert(vrodid32lar.end(),vrodid32hec.begin(),vrodid32hec.end());
311 vrodid32lar.insert(vrodid32lar.end(),vrodid32fcalhad.begin(),vrodid32fcalhad.end());
312 vrodid32lar.insert(vrodid32lar.end(),vrodid32fcalem.begin(),vrodid32fcalem.end());
313 m_vrodid32fullDet.insert(m_vrodid32fullDet.end(), vrodid32lar.begin(), vrodid32lar.end() );
314
315
316 SG::ReadCondHandle<LArMCSym> mcsym (m_mcsymKey, context);
317 SG::ReadCondHandle<LArFebRodMapping> febrod(m_febRodMappingKey, context);
318 SG::ReadCondHandle<LArBadChannelCont> larBadChan{ m_bcContKey, context };
319 SG::ReadCondHandle<LArOnOffIdMapping> onoff ( m_onOffIdMappingKey, context);
320 SG::ReadCondHandle<LArRoIMap> roimap ( m_larRoIMapKey, context);
321 SG::ReadCondHandle<TileHid2RESrcID> tileHid2RESrcID ( m_tileHid2RESrcIDKey, context);
322
323 const unsigned int nFebs=70;
324 const unsigned int high_granu = (unsigned int)ceilf(m_vrodid32fullDet.size()/((float)nFebs) );
325 unsigned int jj=0;
326 unsigned int kk=0;
327 m_vrodid32fullDetHG.resize(high_granu);
328 for( unsigned int ii=0; ii<m_vrodid32fullDet.size();ii++){
329 if ( kk >= nFebs ) {
330 kk-=nFebs;
331 jj++;
332 }
333 m_vrodid32fullDetHG[jj].push_back(m_vrodid32fullDet[ii]);
334 kk++;
335 }
336 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey, context};
337 const CaloDetDescrManager* theCaloDDM = *caloMgrHandle;
338 const CaloCell_ID* theCaloCCIDM = theCaloDDM->getCaloCell_ID();
339 const unsigned int hashMax = theCaloCCIDM->calo_cell_hash_max();
340
341 // Prepare cache containers to be used for LAr unpacking.
342 size_t slot = 0;
343 for (HLTCaloEventCache& cache : m_hLTCaloSlot) {
344 cache.larContainer = std::make_unique<LArCellCont>();
345 cache.larRodBlockStructure_per_slot = nullptr;
346
347 cache.larContainer->initialize(**roimap, **onoff, **mcsym, **febrod, **larBadChan, *theCaloDDM).
348 orThrow("Cannot initialize LAr container", name());
349
350 std::vector<CaloCell*> local_cell_copy;
351 local_cell_copy.reserve(200000);
352 const LArCellCont* larcell = cache.larContainer.get();
353 const LArBadChannelCont& badchannel = **larBadChan;
354
355 cache.lastFSEvent = 0xFFFFFFFF;
356 auto cachefullcont = std::make_unique<CaloCellContainer>(SG::VIEW_ELEMENTS);
357 cachefullcont->reserve(190000);
358
359 for(unsigned int lcidx=0; lcidx < larcell->size(); lcidx++){
360 LArCellCollection* lcc = larcell->at(lcidx);
361 for(unsigned int lccidx=0; lccidx<lcc->size(); lccidx++){
362 CaloCell* cell = lcc->at(lccidx);
363 if ( cell && cell->caloDDE() ) {
364 const LArBadChannel& bc = badchannel.offlineStatus(cell->ID());
365 const bool bad = !bc.good() &&
366 // only consider specific problems
367 (bc.deadReadout() || bc.deadPhys() || bc.highNoiseHG() ||
369
370 if ( !bad ) local_cell_copy.push_back( cell );
371 }
372 } // end of loop over cells
373 } // end of loop over collection
374
375 // This should stay here as this will be enabled when tile is ready to be decoded as well
376
377 auto tilecell = std::make_unique<TileCellCont>();
378 tilecell->setHashIdToROD( *tileHid2RESrcID );
379 tilecell->initialize().orThrow("Cannot initialize Tile container", name());
380
381 for (unsigned int i=0; i<4; i++) {
382 m_tileDecoder->loadRw2Cell ( i, tilecell->Rw2CellMap(i) );
383 m_tileDecoder->loadRw2Pmt ( i, tilecell->Rw2PmtMap (i) );
384 }
385 m_tileDecoder->loadMBTS( tilecell->MBTS_map(), tilecell->MBTS_channel() );
386
387 const std::vector<unsigned int>* mbts_rods = tilecell->MBTS_RODs();
388 for(size_t i = 0 ; i < mbts_rods->size(); i++) {
389 m_mbts_add_rods.insert(m_mbts_add_rods.end(), mbts_rods->begin(), mbts_rods->end());
390 }
391 sort(m_mbts_add_rods.begin(),m_mbts_add_rods.end());
393
394 auto d0cellsp = std::make_unique<TileROD_Decoder::D0CellsHLT>();
395 for (unsigned int lcidx=0; lcidx < tilecell->size(); lcidx++){
396 TileCellCollection* lcc = tilecell->at(lcidx);
397 for (unsigned int lccidx=0; lccidx<lcc->size(); lccidx++){
398 CaloCell* cell = lcc->at(lccidx);
399 if ( cell ) local_cell_copy.push_back( cell );
400 } // end of loop over cells
401
402 TileRawChannelCollection::ID frag_id = ((*lcc).identify() & 0x0FFF);
403 const int ros = (frag_id >> 8);
404 if ( ros == 1 ) { //treatment for d0Cells in barrel
405 const int drawer = (frag_id & 0xFF);
406 TileCellCollection::iterator pCell = lcc->begin();
407 pCell+=2;
408 d0cellsp->m_cells[drawer] = *pCell;
409 }
410 } // end of loop over collection
411 cache.tileContainer = std::move(tilecell);
412
413 // d0merge cells
414 cache.d0cells = std::move(d0cellsp);
415
416 // For the moment the container has to be completed by hand (again, because of tile)
417 for(unsigned int i=0; i<hashMax; i++){
418 cachefullcont->push_back_fast(nullptr);
419 }
420
421 for(unsigned int i=0; i<local_cell_copy.size(); i++){
422 unsigned int j = local_cell_copy.at(i)->caloDDE()->calo_hash();
423 if ( j < hashMax ) {
424 cachefullcont->at(j) = local_cell_copy.at(i);
425 }
426 }
427 for(unsigned int i=0;i<hashMax;i++)
428 if ( cachefullcont->at(i) == nullptr ){
429 Identifier id = theCaloCCIDM->cell_id(i);
430 if ( id!=0 ){
431 const CaloDetDescrElement* el = theCaloDDM->get_element(id);
432 if ( el->is_tile() ) {
433 cachefullcont->at(i) = new TileCell(el,0,0,0,0,CaloGain::TILEHIGHHIGH);
434 } else {
435 cachefullcont->at(i) = new LArCell(el,0,0,0,CaloGain::LARHIGHGAIN);
436 }
437
438 if (slot==0) m_insertedCells.push_back(i);
439 }
440 }
441
442 cachefullcont->setHasCalo(CaloCell_ID::LAREM);
443 cachefullcont->setHasCalo(CaloCell_ID::LARHEC);
444 cachefullcont->setHasCalo(CaloCell_ID::LARFCAL);
445 cachefullcont->setHasCalo(CaloCell_ID::TILE); //lying... But this needs to be checked later
446
447 // make sure this "map" container has a good hashID
448 cachefullcont->order();
449
450 if ( hashMax != cachefullcont->size() ) {
451 ATH_MSG_ERROR("Problem in the size of the full container");
452 }
453
454 cachefullcont->setIsOrdered(true);
455 cachefullcont->setIsOrderedAndComplete(true);
456 cache.fullcont = std::move(cachefullcont);
457
458 local_cell_copy.clear();
459 ++slot;
460 }
461}
#define ATH_MSG_ERROR(x)
LArBadXCont< LArBadChannel > LArBadChannelCont
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Athena::TPCnvVers::Current TrigRoiDescriptor
size_type calo_cell_hash_max() const
cell 'global' hash table max size
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,...
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
const CaloCell_ID * getCaloCell_ID() const
get calo cell ID helper
const T * at(size_type n) const
Access an element, as an rvalue.
DataModel_detail::iterator< DataVector > iterator
Standard iterator.
Definition DataVector.h:842
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
bool deadReadout() const
bool highNoiseHG() const
bool problematicForUnknownReason() const
bool highNoiseMG() const
bool highNoiseLG() const
bool deadPhys() const
bool good() const
Returns true if no problems at all (all bits at zero)
LArBC_t offlineStatus(const Identifier id) const
Query the status of a particular channel by offline ID This is the main client access method.
std::vector< unsigned int > m_mbts_add_rods
std::vector< uint32_t > m_vrodid32tile
std::vector< IdentifierHash > m_rIdstile
@ TILEHIGHHIGH
Definition CaloGain.h:15
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ loadCollections() [1/2]

StatusCode TrigCaloDataAccessSvc::loadCollections ( const EventContext & context,
const IRoiDescriptor & roi,
const DETID detID,
const int sampling,
LArTT_Selector< LArCellCont > & loadedCells )
overridevirtual

Definition at line 73 of file TrigCaloDataAccessSvc.cxx.

77 {
78
79 std::vector<IdentifierHash> requestHashIDs;
80
81 ATH_MSG_DEBUG( "LArTT requested for event " << context << " and RoI " << roi );
82 ATH_CHECK( prepareLArCollections(context, roi, sampling, detID) );
83
84 {
85 // this has to be guarded because getTT called on the LArCollection bu other threads updates internal map
86 std::scoped_lock lock{m_hLTCaloSlot.get( context )->mutex};
87 switch ( detID ) {
88 case TTEM: {m_regionSelector_TTEM->lookup(context)->HashIDList( sampling, roi, requestHashIDs ); break; }
89 case TTHEC: {m_regionSelector_TTHEC->lookup(context)->HashIDList( sampling, roi, requestHashIDs ); break; }
90 case FCALEM: {m_regionSelector_FCALEM->lookup(context)->HashIDList( sampling, roi, requestHashIDs ); break; }
91 case FCALHAD: {m_regionSelector_FCALHAD->lookup(context)->HashIDList( sampling, roi, requestHashIDs ); break; }
92 default: break;
93 }
94 }
95
96 ATH_MSG_DEBUG( "requestHashIDs.size() in LoadColl = " << requestHashIDs.size() << " hash checksum "
97 << std::accumulate( requestHashIDs.begin(), requestHashIDs.end(), IdentifierHash( 0 ),
98 []( IdentifierHash h1, IdentifierHash h2 ){ return h1+h2; } ) );
99 if ( msgLvl( MSG::VERBOSE ) ) {
100 for( unsigned int i = 0 ; i < requestHashIDs.size() ; i++ )
101 ATH_MSG_VERBOSE( "m_rIds[" << i << "]=" << requestHashIDs[i] );
102 }
103 SG::ReadCondHandle<LArRoIMap> roimap ( m_larRoIMapKey, context);
104 loadedCells.setContainer( m_hLTCaloSlot.get( context )->larContainer.get() );
105 loadedCells.setMap( *roimap );
106
107 {
108 // this has to be guarded because getTT called on the LArCollection bu other threads updates internal map
109 std::scoped_lock lock{m_hLTCaloSlot.get( context )->mutex};
110 loadedCells.setRoIs( requestHashIDs );
111 }
112 return StatusCode::SUCCESS;
113}
@ FCALEM
Definition RegSelEnums.h:35
@ TTHEC
Definition RegSelEnums.h:29
@ FCALHAD
Definition RegSelEnums.h:36
@ TTEM
Definition RegSelEnums.h:28
void setRoIs(const VEC_TT_ID &ids)
void setMap(const LArRoIMap *map)
void setContainer(const CONTAINER *c)
StatusCode prepareLArCollections(const EventContext &context, const IRoiDescriptor &roi, const int sampling, DETID detector)
LAr TT collections preparation code.

◆ loadCollections() [2/2]

StatusCode TrigCaloDataAccessSvc::loadCollections ( const EventContext & context,
const IRoiDescriptor & roi,
std::vector< const TileCell * > & loadedCells )
overridevirtual

Definition at line 115 of file TrigCaloDataAccessSvc.cxx.

117 {
118 std::vector<IdentifierHash> requestHashIDs;
119
120 ATH_MSG_DEBUG( "Tile requested for event " << context << " and RoI " << roi );
121 ATH_CHECK( prepareTileCollections(context, roi) );
122
123 {
124 // this has to be guarded because getTT called on the LArCollection bu other threads updates internal map
125 std::scoped_lock lock{m_hLTCaloSlot.get( context )->mutex};
126
127 m_regionSelector_TILE->lookup(context)->HashIDList( roi, requestHashIDs );
128 }
129 ATH_MSG_DEBUG( "requestHashIDs.size() in LoadColl = " << requestHashIDs.size() << " hash checksum "
130 << std::accumulate( requestHashIDs.begin(), requestHashIDs.end(), IdentifierHash( 0 ),
131 []( IdentifierHash h1, IdentifierHash h2 ){ return h1+h2; } ) );
132 if ( msgLvl( MSG::VERBOSE ) ) {
133 for( unsigned int i = 0 ; i < requestHashIDs.size() ; i++ )
134 ATH_MSG_VERBOSE( "requestHashIDs[" << i << "]=" << requestHashIDs[i] );
135 }
136
137 HLTCaloEventCache* cache = m_hLTCaloSlot.get( context );
138 const TileCellCont* tilecell = cache->tileContainer.get();
139
140 loadedCells.clear();
141 for (size_t i = 0; i < requestHashIDs.size(); ++i){
142 // Find the collection to dump
143 const auto it = tilecell->find(requestHashIDs[i]);
144 if (it == tilecell->end()) continue;
145
146 TileCellCollection* col = *it;
147 if ( col == nullptr ) continue;
148
149 for (const TileCell* cell : *col) {
150 loadedCells.push_back( cell );
151 }
152 }
153
154 return StatusCode::SUCCESS;
155}
StatusCode prepareTileCollections(const EventContext &context, const IRoiDescriptor &roi)

◆ loadFullCollections()

StatusCode TrigCaloDataAccessSvc::loadFullCollections ( const EventContext & context,
CaloConstCellContainer & cont )
overridevirtual

Definition at line 158 of file TrigCaloDataAccessSvc.cxx.

159 {
160
161 // Gets all data
162 m_robDataProvider->addROBData( context, m_vrodid32fullDet );
163 m_robDataProvider->addROBData( context, m_vrodid32tile );
164
166
168
169 m_hLTCaloSlot.get(context)->lastFSEvent = context.evt();
170
171 std::scoped_lock lock{m_getCollMutex};
172
173 const CaloCellContainer* cont_to_copy = m_hLTCaloSlot.get(context)->fullcont.get() ;
174 cont.clear();
175 cont.reserve( cont_to_copy->size() );
176 for( const CaloCell* c : *cont_to_copy ) {
177 cont.push_back_fast( c );
178 }
179 cont.setIsOrdered(true);
180 cont.setIsOrderedAndComplete(true);
181
182 return StatusCode::SUCCESS;
183}
void setIsOrderedAndComplete(bool ordered)
indicate that the container is complete and in order
void setIsOrdered(bool ordered)
indicates that the container is ordered
void push_back_fast(const CaloCell *cell)
reimplementation of push_back to gain speed in readin
void clear()
Erase all the elements in the collection.
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
StatusCode prepareLArFullCollections(const EventContext &context)
StatusCode prepareTileFullCollections(const EventContext &context)

◆ loadMBTS()

StatusCode TrigCaloDataAccessSvc::loadMBTS ( const EventContext & context,
std::vector< const TileCell * > & loadedCells )
overridevirtual

Definition at line 733 of file TrigCaloDataAccessSvc.cxx.

734 {
735
736 ATH_MSG_DEBUG( "MBTS requested for event " << context );
738
739 HLTCaloEventCache* cache = m_hLTCaloSlot.get( context );
740 {
741 std::scoped_lock lock{cache->mutex};
742 TileCellCollection* mbts = cache->tileContainer->MBTS_collection();
743 loadedCells.reserve(mbts->size());
744 for (size_t i=0; i<mbts->size(); ++i) {
745 loadedCells.push_back(mbts->at(i));
746 }
747 }
748 return StatusCode::SUCCESS;
749
750}
StatusCode prepareMBTSCollections(const EventContext &context)

◆ missingROBs()

void TrigCaloDataAccessSvc::missingROBs ( const std::vector< uint32_t > & request,
const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > & response,
std::set< uint32_t > & missing ) const
private

fill the set of missing robs given the request and response from RoBDatProvider

Definition at line 578 of file TrigCaloDataAccessSvc.cxx.

580 {
581
582 std::set<uint32_t> receivedROBsSet;
583 for ( auto rob: response ) {
584 receivedROBsSet.insert( rob->source_id() );
585 }
586
587 std::set<uint32_t> requestedROBsSet( request.begin(), request.end() );
588 std::set_difference( requestedROBsSet.begin(), requestedROBsSet.end(),
589 receivedROBsSet.begin(), receivedROBsSet.end(),
590 std::inserter( missing, missing.begin() ) );
591}

◆ prepareLArCollections()

StatusCode TrigCaloDataAccessSvc::prepareLArCollections ( const EventContext & context,
const IRoiDescriptor & roi,
const int sampling,
DETID detector )
private

LAr TT collections preparation code.

Definition at line 608 of file TrigCaloDataAccessSvc.cxx.

611 {
612
613 std::call_once(m_lateInitFlag, &TrigCaloDataAccessSvc::lateInit, this, context);
614
615 // If the full event was already unpacked, don't need to unpack RoI
616 HLTCaloEventCache* cache = m_hLTCaloSlot.get( context );
617 if ( cache->lastFSEvent == context.evt() ) return StatusCode::SUCCESS;
618
619 std::vector<uint32_t> requestROBs;
620
621 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFrags;
622 switch ( detector ) {
623 case TTEM: {m_regionSelector_TTEM->lookup(context)->ROBIDList( sampling, roi, requestROBs ); break; }
624 case TTHEC: {m_regionSelector_TTHEC->lookup(context)->ROBIDList( sampling, roi, requestROBs ); break; }
625 case FCALEM: {m_regionSelector_FCALEM->lookup(context)->ROBIDList( sampling, roi, requestROBs ); break; }
626 case FCALHAD: {m_regionSelector_FCALHAD->lookup(context)->ROBIDList( sampling, roi, requestROBs ); break; }
627 default: break;
628 }
629
630 m_robDataProvider->addROBData( context, requestROBs );
631 m_robDataProvider->getROBData( context, requestROBs, robFrags );
632 if ( robFrags.empty() && !requestROBs.empty() ) {
633 return StatusCode::SUCCESS;
634 }
635
636 auto lockTime = Monitored::Timer ( "TIME_locking_LAr_RoI" );
637 std::scoped_lock lock{cache->mutex};
638 lockTime.stop();
639
640 // TB, what would happen from now inside the collection unapcking
641 // if this event number is different than the one for each collection the unpacking will happen,
642 // if it is the same the unpacking will not be repeated
643 // same in prepareLArFullCollections
644 cache->larContainer->eventNumber( context.evt() );
645 if ( m_applyOffsetCorrection && cache->larContainer->lumiBCIDCheck( context ) ) {
646 SG::ReadHandle<CaloBCIDAverage> avg (m_bcidAvgKey, context);
647 SG::ReadCondHandle<LArOnOffIdMapping> onoff ( m_onOffIdMappingKey, context);
648 if ( avg.cptr() && onoff.cptr() ) cache->larContainer->updateBCID( *avg, **onoff );
649 }
650
651 const LArDeadOTXFromSC* deadHandle = nullptr;
652 if ( m_correctDead ){
653 SG::ReadHandle<LArDeadOTXFromSC> deadHdl(m_deadOTXFromSCKey, context);
654 if ( !deadHdl.isValid() ){
655 ATH_MSG_WARNING("Should not try to use LArDEADOTXFromSC" );
656 } else {
657 deadHandle = deadHdl.cptr();
658 }
659 }
660
661 convertROBs( robFrags, cache->larContainer.get(), cache->larRodBlockStructure_per_slot,
662 cache->rodMinorVersion, cache->robBlockType, deadHandle );
663
664 if ( requestROBs.size() != robFrags.size() ) {
665 ATH_MSG_DEBUG( "Missing ROBs, requested " << requestROBs.size() << " obtained " << robFrags.size() );
666 clearMissing( requestROBs, robFrags, cache->larContainer.get() );
667 }
668 auto roiROBs = Monitored::Scalar( "roiROBs_LAr", robFrags.size() );
669 auto roiEta = Monitored::Scalar( "roiEta_LAr", roi.eta() );
670 auto roiPhi = Monitored::Scalar( "roiPhi_LAr", roi.phi() );
671
672 Monitored::Group( m_monTool, lockTime, roiEta, roiPhi, roiROBs );
673 return StatusCode::SUCCESS;
674}
virtual double eta() const =0
virtual double phi() const =0
Methods to retrieve data members.
void lateInit(const EventContext &context)
void convertROBs(const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &robFrags, LArCellCont *larcell, LArRodBlockStructure *&larRodBlockStructure, uint16_t rodMinorVersion, uint32_t robBlockType, const LArDeadOTXFromSC *dead)
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
ToolHandle< GenericMonitoringTool > m_monTool
constexpr float roiPhi(const AnyRoIPointer &roi)
avg(a, b)
Definition Recovery.py:79
setTeId setLumiBlock setRoiId setRoiSubsystem setRoiNumber roiEta

◆ prepareLArFullCollections()

StatusCode TrigCaloDataAccessSvc::prepareLArFullCollections ( const EventContext & context)
private

Definition at line 186 of file TrigCaloDataAccessSvc.cxx.

186 {
187
188 std::call_once(m_lateInitFlag, &TrigCaloDataAccessSvc::lateInit, this, context);
189
190 ATH_MSG_DEBUG( "Full Col " << " requested for event " << context );
191
192 HLTCaloEventCache* cache = m_hLTCaloSlot.get( context );
193
194 auto lockTime = Monitored::Timer ( "TIME_locking_LAr_FullDet" );
195 std::scoped_lock lock{cache->mutex};
196
197 lockTime.stop();
198
199 // If the full event was already unpacked, don't need to unpack RoI
200 if ( cache->lastFSEvent == context.evt() ) return StatusCode::SUCCESS;
201 cache->larContainer->eventNumber( context.evt() ) ;
202
203 if ( m_applyOffsetCorrection && cache->larContainer->lumiBCIDCheck( context ) ) {
204 SG::ReadHandle<CaloBCIDAverage> avg (m_bcidAvgKey, context);
205 SG::ReadCondHandle<LArOnOffIdMapping> onoff (m_onOffIdMappingKey, context);
206 if ( avg.cptr() && onoff.cptr() ) {
207 cache->larContainer->updateBCID( *avg, **onoff );
208 }
209 }
210
211 const LArDeadOTXFromSC* deadHandle = nullptr;
212 if ( m_correctDead ){
213 SG::ReadHandle<LArDeadOTXFromSC> deadHdl(m_deadOTXFromSCKey, context);
214 if ( !deadHdl.isValid() ){
215 ATH_MSG_WARNING("Should not try to use LArDEADOTXFromSC" );
216 } else {
217 deadHandle = deadHdl.cptr();
218 }
219 }
220
221 for(std::vector<uint32_t>& vrodid32fullDet : m_vrodid32fullDetHG) {
222 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFrags;
223 m_robDataProvider->addROBData( context, vrodid32fullDet );
224 m_robDataProvider->getROBData( context, vrodid32fullDet, robFrags );
225
226 convertROBs( robFrags, cache->larContainer.get(), cache->larRodBlockStructure_per_slot,
227 cache->rodMinorVersion, cache->robBlockType, deadHandle );
228
229 if ( vrodid32fullDet.size() != robFrags.size() ) {
230 ATH_MSG_DEBUG( "Missing ROBs, requested " << vrodid32fullDet.size() << " obtained " << robFrags.size() );
231 clearMissing( vrodid32fullDet, robFrags, cache->larContainer.get() );
232 }
233 } // end of for m_vrodid32fullDetHG.size()
234
235 Monitored::Group( m_monTool, lockTime );
236 return StatusCode::SUCCESS;
237}

◆ prepareMBTSCollections()

StatusCode TrigCaloDataAccessSvc::prepareMBTSCollections ( const EventContext & context)
private

Definition at line 703 of file TrigCaloDataAccessSvc.cxx.

703 {
704
705 std::call_once(m_lateInitFlag, &TrigCaloDataAccessSvc::lateInit, this, context);
706
707 // If the full event was already unpacked, don't need to unpack RoI
708 HLTCaloEventCache* cache = m_hLTCaloSlot.get( context );
709 if ( cache->lastFSEvent == context.evt() ) return StatusCode::SUCCESS;
710
711 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFrags;
712 m_robDataProvider->addROBData( context, m_mbts_add_rods );
713
714 std::scoped_lock lock{cache->mutex};
715 if ( cache->tileContainer->eventNumber() != context.evt() ) {
716 cache->d0cells->clear();
717 }
718 cache->tileContainer->eventNumber( context.evt() );
719
720 const std::vector<unsigned int>* ids = cache->tileContainer->MBTS_IDs();
721 std::vector<IdentifierHash> tileIds;
722 tileIds.reserve(ids->size());
723 for (size_t i=0; i<ids->size(); i++) {
724 tileIds.push_back( (*ids)[i] );
725 }
726 convertROBs( context, tileIds, cache->tileContainer.get(), cache->d0cells.get() );
727
728 return StatusCode::SUCCESS;
729}

◆ prepareTileCollections()

StatusCode TrigCaloDataAccessSvc::prepareTileCollections ( const EventContext & context,
const IRoiDescriptor & roi )
private

Definition at line 676 of file TrigCaloDataAccessSvc.cxx.

677 {
678
679 std::call_once(m_lateInitFlag, &TrigCaloDataAccessSvc::lateInit, this, context);
680
681 // If the full event was already unpacked, don't need to unpack RoI
682 HLTCaloEventCache* cache = m_hLTCaloSlot.get( context );
683 if ( cache->lastFSEvent == context.evt() ) return StatusCode::SUCCESS;
684
685 std::vector<uint32_t> requestROBs;
686 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFrags;
687 std::vector<IdentifierHash> rIds;
688 m_regionSelector_TILE->lookup(context)->ROBIDList( 0, roi, requestROBs );
689 m_regionSelector_TILE->lookup(context)->HashIDList(roi, rIds);
690 m_robDataProvider->addROBData( context, requestROBs );
691
692 std::scoped_lock lock{cache->mutex};
693 if ( cache->tileContainer->eventNumber() != context.evt() ) {
694 cache->d0cells->clear();
695 }
696 cache->tileContainer->eventNumber( context.evt() );
697
698 convertROBs( context, rIds, cache->tileContainer.get(), cache->d0cells.get() );
699
700 return StatusCode::SUCCESS;
701}

◆ prepareTileFullCollections()

StatusCode TrigCaloDataAccessSvc::prepareTileFullCollections ( const EventContext & context)
private

Definition at line 239 of file TrigCaloDataAccessSvc.cxx.

239 {
240
241 std::call_once(m_lateInitFlag, &TrigCaloDataAccessSvc::lateInit, this, context);
242
243 ATH_MSG_DEBUG( "Full Col " << " requested for event " << context );
244
245 HLTCaloEventCache* cache = m_hLTCaloSlot.get( context );
246
247 auto lockTime = Monitored::Timer ( "TIME_locking_LAr_FullDet" );
248 std::scoped_lock lock{cache->mutex};
249 lockTime.stop();
250
251 // If the full event was already unpacked, don't need to unpack RoI
252 if ( cache->lastFSEvent == context.evt() ) return StatusCode::SUCCESS;
253 if ( cache->tileContainer->eventNumber() != context.evt() ) {
254 cache->d0cells->clear();
255 }
256 cache->tileContainer->eventNumber( context.evt() );
257
258 convertROBs( context, m_rIdstile, cache->tileContainer.get(), cache->d0cells.get() );
259
260 Monitored::Group( m_monTool, lockTime );
261 return StatusCode::SUCCESS;
262}

◆ reset_LArCol()

void TrigCaloDataAccessSvc::reset_LArCol ( LArCellCollection * coll)
private

Definition at line 58 of file TrigCaloDataAccessSvc.cxx.

58 {
59 for (LArCell* cell : *coll) {
60 cell->setEnergyFast(0.0);
61 }
62}

◆ reset_TileCol()

void TrigCaloDataAccessSvc::reset_TileCol ( TileCellCollection * col)
private

Definition at line 64 of file TrigCaloDataAccessSvc.cxx.

64 {
65 for (TileCell* cell: *col) {
66 cell->setEnergy_nonvirt(0.0F, 0.0F, 0, CaloGain::INVALIDGAIN);
67 cell->setTime_nonvirt(-100.0F);
68 cell->setQuality_nonvirt(static_cast<unsigned char>(255), 0, 0);
69 cell->setQuality_nonvirt(static_cast<unsigned char>(255), 0, 1);
70 }
71}
@ INVALIDGAIN
Definition CaloGain.h:18

Member Data Documentation

◆ m_applyOffsetCorrection

Gaudi::Property<bool> TrigCaloDataAccessSvc::m_applyOffsetCorrection { this, "ApplyOffsetCorrection", true, "Enable offset correction" }
private

Definition at line 87 of file TrigCaloDataAccessSvc.h.

87{ this, "ApplyOffsetCorrection", true, "Enable offset correction" };

◆ m_bcContKey

SG::ReadCondHandleKey<LArBadChannelCont> TrigCaloDataAccessSvc::m_bcContKey {this, "LArBadChannelKey", "LArBadChannel", "Key of the LArBadChannelCont CDO" }
private

Definition at line 97 of file TrigCaloDataAccessSvc.h.

98{this, "LArBadChannelKey", "LArBadChannel", "Key of the LArBadChannelCont CDO" };

◆ m_bcidAvgKey

SG::ReadHandleKey<CaloBCIDAverage> TrigCaloDataAccessSvc::m_bcidAvgKey {this, "BCIDAvgKey", "CaloBCIDAverage", "SG Key of CaloBCIDAverage object"}
private

Definition at line 89 of file TrigCaloDataAccessSvc.h.

90{this, "BCIDAvgKey", "CaloBCIDAverage", "SG Key of CaloBCIDAverage object"} ;

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> TrigCaloDataAccessSvc::m_caloMgrKey {this, "CaloDetDescrManager", "CaloDetDescrManager", "SG Key for CaloDetDescrManager in the Condition Store" }
private

Definition at line 101 of file TrigCaloDataAccessSvc.h.

102{this, "CaloDetDescrManager", "CaloDetDescrManager", "SG Key for CaloDetDescrManager in the Condition Store" };

◆ m_correctDead

bool TrigCaloDataAccessSvc::m_correctDead {false}
private

Definition at line 107 of file TrigCaloDataAccessSvc.h.

107{false};

◆ m_deadOTXFromSCKey

SG::ReadHandleKey<LArDeadOTXFromSC> TrigCaloDataAccessSvc::m_deadOTXFromSCKey {this, "LArDeadOTXFromSC", "DeadOTXFromSC", "Key of the DeadOTXFromSC CDO" }
private

Definition at line 105 of file TrigCaloDataAccessSvc.h.

106{this, "LArDeadOTXFromSC", "DeadOTXFromSC", "Key of the DeadOTXFromSC CDO" };

◆ m_febRodMappingKey

SG::ReadCondHandleKey<LArFebRodMapping> TrigCaloDataAccessSvc::m_febRodMappingKey {this, "RodFebKey", "LArFebRodMap", "SG Key for LArFebRodMapping"}
private

Definition at line 95 of file TrigCaloDataAccessSvc.h.

96{this, "RodFebKey", "LArFebRodMap", "SG Key for LArFebRodMapping"} ;

◆ m_getCollMutex

std::mutex TrigCaloDataAccessSvc::m_getCollMutex
private

Definition at line 129 of file TrigCaloDataAccessSvc.h.

◆ m_hLTCaloSlot

SG::SlotSpecificObj< HLTCaloEventCache > TrigCaloDataAccessSvc::m_hLTCaloSlot
private

Definition at line 127 of file TrigCaloDataAccessSvc.h.

◆ m_insertedCells

std::vector<unsigned int> TrigCaloDataAccessSvc::m_insertedCells
private

Definition at line 125 of file TrigCaloDataAccessSvc.h.

◆ m_larDecoder

PublicToolHandle<LArRodDecoder> TrigCaloDataAccessSvc::m_larDecoder { this, "LArDecoderTool", "LArRodDecoder/LArRodDecoder", "Tool to decode LAr raw data" }
private

Definition at line 75 of file TrigCaloDataAccessSvc.h.

75{ this, "LArDecoderTool", "LArRodDecoder/LArRodDecoder", "Tool to decode LAr raw data" };

◆ m_lardecoderProtect

std::mutex TrigCaloDataAccessSvc::m_lardecoderProtect
private

Definition at line 130 of file TrigCaloDataAccessSvc.h.

◆ m_larRoIMapKey

SG::ReadCondHandleKey<LArRoIMap> TrigCaloDataAccessSvc::m_larRoIMapKey {this, "LArRoIMapKey", "LArRoIMap", "Key of the LArRoIMap CDO" }
private

Definition at line 99 of file TrigCaloDataAccessSvc.h.

100{this, "LArRoIMapKey", "LArRoIMap", "Key of the LArRoIMap CDO" };

◆ m_lateInitFlag

std::once_flag TrigCaloDataAccessSvc::m_lateInitFlag
private

Definition at line 137 of file TrigCaloDataAccessSvc.h.

◆ m_mbts_add_rods

std::vector<unsigned int> TrigCaloDataAccessSvc::m_mbts_add_rods
private

Definition at line 176 of file TrigCaloDataAccessSvc.h.

◆ m_mcsymKey

SG::ReadCondHandleKey<LArMCSym> TrigCaloDataAccessSvc::m_mcsymKey {this, "MCSymKey", "LArMCSym", "SG Key of LArMCSym object"}
private

Definition at line 91 of file TrigCaloDataAccessSvc.h.

92{this, "MCSymKey", "LArMCSym", "SG Key of LArMCSym object"} ;

◆ m_monTool

ToolHandle<GenericMonitoringTool> TrigCaloDataAccessSvc::m_monTool { this, "MonTool", "", "Tool to monitor performance of the service" }
private

Definition at line 78 of file TrigCaloDataAccessSvc.h.

78{ this, "MonTool", "", "Tool to monitor performance of the service" };

◆ m_onOffIdMappingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> TrigCaloDataAccessSvc::m_onOffIdMappingKey {this, "CablingKey", "LArOnOffIdMap", "SG Key for LArOnOffIdMapping"}
private

Definition at line 93 of file TrigCaloDataAccessSvc.h.

94{this, "CablingKey", "LArOnOffIdMap", "SG Key for LArOnOffIdMapping"} ;

◆ m_regionSelector_FCALEM

ToolHandle<IRegSelTool> TrigCaloDataAccessSvc::m_regionSelector_FCALEM { this, "RegSelToolFCALEM", "RegSelTool/RegSelTool_FCALEM" }
private

Definition at line 83 of file TrigCaloDataAccessSvc.h.

83{ this, "RegSelToolFCALEM", "RegSelTool/RegSelTool_FCALEM" };

◆ m_regionSelector_FCALHAD

ToolHandle<IRegSelTool> TrigCaloDataAccessSvc::m_regionSelector_FCALHAD { this, "RegSelToolFCALHAD", "RegSelTool/RegSelTool_FCALHAD" }
private

Definition at line 84 of file TrigCaloDataAccessSvc.h.

84{ this, "RegSelToolFCALHAD", "RegSelTool/RegSelTool_FCALHAD" };

◆ m_regionSelector_TILE

ToolHandle<IRegSelTool> TrigCaloDataAccessSvc::m_regionSelector_TILE { this, "RegSelToolTILE", "RegSelTool/RegSelTool_TILE" }
private

Definition at line 85 of file TrigCaloDataAccessSvc.h.

85{ this, "RegSelToolTILE", "RegSelTool/RegSelTool_TILE" };

◆ m_regionSelector_TTEM

ToolHandle<IRegSelTool> TrigCaloDataAccessSvc::m_regionSelector_TTEM { this, "RegSelToolEM", "RegSelTool/RegSelTool_TTEM" }
private

Definition at line 81 of file TrigCaloDataAccessSvc.h.

81{ this, "RegSelToolEM", "RegSelTool/RegSelTool_TTEM" };

◆ m_regionSelector_TTHEC

ToolHandle<IRegSelTool> TrigCaloDataAccessSvc::m_regionSelector_TTHEC { this, "RegSelToolHEC", "RegSelTool/RegSelTool_TTHEC" }
private

Definition at line 82 of file TrigCaloDataAccessSvc.h.

82{ this, "RegSelToolHEC", "RegSelTool/RegSelTool_TTHEC" };

◆ m_rIdstile

std::vector<IdentifierHash> TrigCaloDataAccessSvc::m_rIdstile
private

Definition at line 177 of file TrigCaloDataAccessSvc.h.

◆ m_robDataProvider

ServiceHandle<IROBDataProviderSvc> TrigCaloDataAccessSvc::m_robDataProvider { this, "ROBDataProvider", "ROBDataProviderSvc/ROBDataProviderSvc", ""}
private

Definition at line 80 of file TrigCaloDataAccessSvc.h.

80{ this, "ROBDataProvider", "ROBDataProviderSvc/ROBDataProviderSvc", ""};

◆ m_tileDecoder

PublicToolHandle<TileROD_Decoder> TrigCaloDataAccessSvc::m_tileDecoder { this, "TileDecoderTool", "TileROD_Decoder/TileROD_Decoder", "Tool to decode Tile raw data" }
private

Definition at line 76 of file TrigCaloDataAccessSvc.h.

76{ this, "TileDecoderTool", "TileROD_Decoder/TileROD_Decoder", "Tool to decode Tile raw data" };

◆ m_tiledecoderProtect

std::mutex TrigCaloDataAccessSvc::m_tiledecoderProtect
private

Definition at line 131 of file TrigCaloDataAccessSvc.h.

◆ m_tileHid2RESrcIDKey

SG::ReadCondHandleKey<TileHid2RESrcID> TrigCaloDataAccessSvc::m_tileHid2RESrcIDKey {this, "TileHid2RESrcID", "TileHid2RESrcIDHLT", "SG Key of TileHid2RESrcID object"}
private

Definition at line 103 of file TrigCaloDataAccessSvc.h.

104{this, "TileHid2RESrcID", "TileHid2RESrcIDHLT", "SG Key of TileHid2RESrcID object"} ;

◆ m_vrodid32fullDet

std::vector<uint32_t> TrigCaloDataAccessSvc::m_vrodid32fullDet
private

Definition at line 174 of file TrigCaloDataAccessSvc.h.

◆ m_vrodid32fullDetHG

std::vector<std::vector<uint32_t> > TrigCaloDataAccessSvc::m_vrodid32fullDetHG
private

Definition at line 178 of file TrigCaloDataAccessSvc.h.

◆ m_vrodid32tile

std::vector<uint32_t> TrigCaloDataAccessSvc::m_vrodid32tile
private

Definition at line 175 of file TrigCaloDataAccessSvc.h.


The documentation for this class was generated from the following files: