ATLAS Offline Software
Loading...
Searching...
No Matches
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
24RoiReader::RoiReader( const std::string& name ) : asg::AsgTool( name ) { }
25
26
27
28void 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
66void 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
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
Athena::TPCnvVers::Current Athena::TPCnvVers::Old TrigRoiDescriptorCollection
ServiceHandle< StoreGateSvc > & evtStore()
virtual void execute(std::vector< std::string > &keys) override
Definition RoiReader.cxx:28
RoiReader(const std::string &name)
class header
Definition RoiReader.cxx:24
void deserialiser(TrigRoiDescriptorCollection &collection, const std::string &key) const
Definition RoiReader.cxx:66
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
const std::vector< std::vector< uint32_t > > & serialised() const
expose the navigation information (in serialised form)
void deserialise(const roiserial_type &s, std::vector< const IRoiDescriptor * > &rois)
deserialise uint32_t vector into a full vector of IRoiDescriptors
RoiDescriptorStore_v1 RoiDescriptorStore
Define the latest version of the serialised RoiDescriptor storage.