ATLAS Offline Software
RoiReader.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 //
5 // @file RoiReader.cxx
6 //
7 //
8 // @author M.Sutton
9 //
10 //
11 
12 
14 #include "RoiReader.h"
15 
19 
22 
23 
24 RoiReader::RoiReader( const std::string& name ) : asg::AsgTool( name ) { }
25 
26 
27 
28 void RoiReader::execute( std::vector<std::string>& keys ) {
29 
30  ATH_MSG_DEBUG( "RoiReader::execute() in" );
31 
33 
34  // std::vector<std::string> keys;
35  // evtStore()->keys<xAOD::RoiDescriptorStore>( keys );
36 
39 
40  for ( unsigned ik=0 ; ik<keys.size() ; ik++ ) {
41 
42  std::string collectionname = "RoiDescriptorStore";
43 
44  std::string keybase = keys[ik];
45  keybase.erase( 0, keybase.find(collectionname)+collectionname.size() );
46 
47  std::string newkey = "HLT_TrigRoiDescriptorCollection" + keybase;
48 
50 
51  deserialiser( *roicollection, keys[ik] );
52 
53  if ( evtStore()->overwrite( roicollection, newkey, false ).isFailure() ) {
54  ATH_MSG_INFO( "RoiReader::execute() could not write " << newkey );
55  }
56 
57  }
58 
59  ATH_MSG_DEBUG( "RoiReader::execute() out " );
60 
61 }
62 
63 
64 
65 
66 void RoiReader::deserialiser( TrigRoiDescriptorCollection& collection, const std::string& key ) const {
67  xAOD::RoiDescriptorStore* fetchedstore = 0;
68  if ( evtStore()->retrieve( fetchedstore, key ).isSuccess() && fetchedstore!=0 ) {
69  RoiUtil::deserialise( fetchedstore->serialised(), collection );
70  }
71 }
72 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
RoiReader::deserialiser
void deserialiser(TrigRoiDescriptorCollection &collection, const std::string &key) const
Definition: RoiReader.cxx:66
asg
Definition: DataHandleTestTool.h:28
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
xAOD::RoiDescriptorStore_v1
Definition: RoiDescriptorStore_v1.h:29
xAOD::RoiDescriptorStore_v1::serialised
const std::vector< std::vector< uint32_t > > & serialised() const
expose the navigation information (in serialised form)
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrigRoiDescriptorCollection
Athena::TPCnvVers::Current Athena::TPCnvVers::Old TrigRoiDescriptorCollection
Definition: TrigSteeringEventTPCnv.cxx:78
RoiReader::execute
virtual void execute(std::vector< std::string > &keys) override
Definition: RoiReader.cxx:28
RoiUtil::deserialise
void deserialise(const roiserial_type &s, std::vector< const IRoiDescriptor * > &rois)
deserialise uint32_t vector into a full vector of IRoiDescriptors
Definition: RoiSerialise.cxx:62
RoiReader::RoiReader
RoiReader(const std::string &name)
class header
Definition: RoiReader.cxx:24
RoiReader.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
RoiDescriptorStore.h
TrigRoiDescriptorCollection
Definition: TrigRoiDescriptorCollection.h:21
RoiSerialise.h
RoiDescriptorStoreAuxInfo.h
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37