ATLAS Offline Software
Loading...
Searching...
No Matches
HLT::TypedHolder< TrigRoiDescriptor, TrigRoiDescriptorCollection > Class Reference

#include <FeatureCollectStandalone.h>

Inheritance diagram for HLT::TypedHolder< TrigRoiDescriptor, TrigRoiDescriptorCollection >:
Collaboration diagram for HLT::TypedHolder< TrigRoiDescriptor, TrigRoiDescriptorCollection >:

Public Types

using StatusCode_if
 shorthand for enable_if with returning StatusCode base on comparison with CONTAINER type

Public Member Functions

 TypedHolder (const BaseHolder &baseholder, const asg::EventStoreType *store, const std::string &="")
StatusCode get (const TrigRoiDescriptor *&destination, HLT::TriggerElement::ObjectIndex idx)
const std::string & key () const
 key used to access EventStore
virtual class_id_type typeClid () const
virtual const std::string & label () const
virtual sub_index_type subTypeIndex () const
virtual bool serialize (std::vector< uint32_t > &data) const
void setLevel (MSG::Level lvl)
 Change the current logging level.
Functions providing the same interface as AthMessaging
bool msgLvl (const MSG::Level lvl) const
 Test the output level of the object.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.

Static Public Member Functions

static bool enquireSerialized (std::vector< uint32_t >::const_iterator &fromHere, const std::vector< uint32_t >::const_iterator &end, class_id_type &c, std::string &label, sub_index_type &subtypeIndex)

Protected Attributes

class_id_type m_clid
std::string m_label
sub_index_type m_sub

Private Member Functions

StatusCode syncWithStore ()
 cache container retrieved from StoreGate
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

const asg::EventStoreTypem_store
const TrigRoiDescriptorCollectionm_cont
std::string m_key
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE
 Messaging initialized (initMessaging)

Detailed Description

Definition at line 187 of file FeatureCollectStandalone.h.

Member Typedef Documentation

◆ StatusCode_if

shorthand for enable_if with returning StatusCode base on comparison with CONTAINER type

Definition at line 60 of file TypedHolder.h.

Constructor & Destructor Documentation

◆ TypedHolder()

HLT::TypedHolder< TrigRoiDescriptor, TrigRoiDescriptorCollection >::TypedHolder ( const BaseHolder & baseholder,
const asg::EventStoreType * store,
const std::string & = "" )
inline

Definition at line 189 of file FeatureCollectStandalone.h.

191 asg::AsgMessaging("TypedHolder"),
192 m_store(store){
193 };
doubly templated class interfacing access to feature containers in StoreGate.
Definition TypedHolder.h:55
TypelessHolder(class_id_type clid, const std::string &label, sub_index_type sub)
virtual sub_index_type subTypeIndex() const
virtual class_id_type typeClid() const
virtual const std::string & label() const

Member Function Documentation

◆ enquireSerialized()

bool BaseHolder::enquireSerialized ( std::vector< uint32_t >::const_iterator & fromHere,
const std::vector< uint32_t >::const_iterator & end,
class_id_type & c,
std::string & label,
sub_index_type & subtypeIndex )
static

Definition at line 22 of file BaseHolder.cxx.

15 {
16 using namespace std;
17 if ( fromHere == end ) return false;
18
19 c = *fromHere++;
20 if ( fromHere == end ) return false;
21
23 if ( fromHere == end ) return false;
24
25 unsigned labelSize = *fromHere++;
26 if ( fromHere == end ) return false;
27 if ( fromHere+labelSize > end ) return false;
28
31
32 //advance iterator to end of label
34
35 return true;
36}
std::size_t deserialize(std::vector< uint32_t >::const_iterator first, std::vector< uint32_t >::const_iterator last, std::vector< std::string > &strings)

◆ get()

Definition at line 195 of file FeatureCollectStandalone.h.

195 {
196
197 std::string key = HLTNavDetails::formatSGkey("HLT","xAOD::RoiDescriptorStore",this->label());
199 ASG_CHECK(m_store->retrieve(roistore,key));
200
201 // so what's happening here is a bit hacky since StoreGate stores (and owns)
202 // the RoiDescriptorStore. But the IRoiDescriptor pointers that get created
203 // by RoiUtil::deserialize are new pointers, so we need to manage them
204 // So we deserialize the entire collection, pick the one pointed to by
205 // the object index and mark it as the return value and the delete the rest again
206 // Later the single remaining element will be deleted by the Feature
207 // (which will have the owning flag set for RoIs). Hopefully the performance
208 // penalty is not too large
209
211 RoiUtil::deserialise( roistore->serialised(), rois );
212 if((idx.objectsEnd() - idx.objectsBegin())!=1){
213 ATH_MSG_ERROR("accessing RoI holder with key: is not single element: ");
214 return StatusCode::FAILURE;
215 }
216
217 if(rois.size() < idx.objectsBegin()){
218 ATH_MSG_ERROR("deserialized roi collection too small");
219 return StatusCode::FAILURE;
220 };
221 for (unsigned int index = 0; index < rois.size(); ++index){
222 if(index == idx.objectsBegin()){
223 destination = dynamic_cast<const TrigRoiDescriptor*>(rois.at(index));
224 }
225 else{
226 delete rois.at(index);
227 }
228 }
229 return StatusCode::SUCCESS;
230 }
#define ATH_MSG_ERROR(x)
#define ASG_CHECK(...)
Helper macro for checking the status code returned by a function call.
Definition Check.h:43
std::string formatSGkey(const std::string &prefix, const std::string &containername, const std::string &label)
declaration of formatting function.
Definition Holder.cxx:122
void deserialise(const roiserial_type &s, std::vector< const IRoiDescriptor * > &rois)
deserialise uint32_t vector into a full vector of IRoiDescriptors

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
private

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 121 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
IMessageSvc * getMessageSvc(bool quiet=false)

◆ key()

const std::string & HLT::TypedHolder< TrigRoiDescriptor, TrigRoiDescriptorCollection >::key ( ) const
inline

key used to access EventStore

Definition at line 92 of file TypedHolder.h.

◆ label()

virtual const std::string & HLT::TypelessHolder::label ( ) const
inlinevirtual

◆ msg() [1/2]

MsgStream & asg::AsgMessaging::msg ( ) const

The standard message stream.

Returns
A reference to the default message stream of this object.

Definition at line 62 of file AsgMessaging.cxx.

49 {
50#ifndef XAOD_STANDALONE
52#else // not XAOD_STANDALONE
53 return m_msg;
54#endif // not XAOD_STANDALONE
55 }

◆ msg() [2/2]

MsgStream & asg::AsgMessaging::msg ( const MSG::Level lvl) const

The standard message stream.

Parameters
lvlThe message level to set the stream to
Returns
A reference to the default message stream, set to level "lvl"

Definition at line 69 of file AsgMessaging.cxx.

57 {
58#ifndef XAOD_STANDALONE
60#else // not XAOD_STANDALONE
61 m_msg << lvl;
62 return m_msg;
63#endif // not XAOD_STANDALONE
64 }

◆ msgLvl()

bool asg::AsgMessaging::msgLvl ( const MSG::Level lvl) const

Test the output level of the object.

Parameters
lvlThe message level to test against
Returns
boolean Indicting if messages at given level will be printed
true If messages at level "lvl" will be printed

Definition at line 56 of file AsgMessaging.cxx.

41 {
42#ifndef XAOD_STANDALONE
44#else // not XAOD_STANDALONE
45 return m_msg.msgLevel( lvl );
46#endif // not XAOD_STANDALONE
47 }

◆ serialize()

bool BaseHolder::serialize ( std::vector< uint32_t > & data) const
virtual

Definition at line 27 of file BaseHolder.cxx.

38 {
39 output.push_back( typeClid() );
40 output.push_back( subTypeIndex() );
41
42 const size_t labelSizeIndex = output.size();
43 output.push_back( 0 );
44 const size_t beforeSS = output.size();
47 return true;
48}
void serialize(const std::vector< std::string > &strings, std::vector< uint32_t > &storage)

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 108 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

◆ subTypeIndex()

virtual sub_index_type HLT::TypelessHolder::subTypeIndex ( ) const
inlinevirtual

Definition at line 16 of file TypelessHolder.h.

◆ syncWithStore()

StatusCode HLT::TypedHolder< TrigRoiDescriptor, TrigRoiDescriptorCollection >::syncWithStore ( )
inlineprivate

cache container retrieved from StoreGate

Definition at line 159 of file TypedHolder.h.

159 {
160 if(m_cont) return StatusCode::SUCCESS;
161
162 StatusCode sc = m_store->retrieve(m_cont,key());
163
164 //sanity checks
165 if(sc.isFailure()) return StatusCode::FAILURE;
166 if(!m_cont) return StatusCode::FAILURE;
167
168 return StatusCode::SUCCESS;
169 }

◆ typeClid()

virtual class_id_type HLT::TypelessHolder::typeClid ( ) const
inlinevirtual

Definition at line 14 of file TypelessHolder.h.

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE
mutableprivate

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_clid

class_id_type HLT::TypelessHolder::m_clid
protected

Definition at line 19 of file TypelessHolder.h.

◆ m_cont

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg
mutableprivate

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_key

Definition at line 174 of file TypedHolder.h.

◆ m_label

std::string HLT::TypelessHolder::m_label
protected

Definition at line 20 of file TypelessHolder.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl
mutableprivate

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivate

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
private

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_store

◆ m_sub

sub_index_type HLT::TypelessHolder::m_sub
protected

Definition at line 21 of file TypelessHolder.h.


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