ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
HLT::TypedHolder< TrigRoiDescriptor, TrigRoiDescriptorCollection > Class Reference

#include <FeatureCollectStandalone.h>

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

Public Member Functions

 TypedHolder (const BaseHolder &baseholder, const asg::EventStoreType *store, const std::string &="")
 
StatusCode get (const TrigRoiDescriptor *&destination, HLT::TriggerElement::ObjectIndex idx)
 
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. More...
 

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

void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

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

Detailed Description

Definition at line 187 of file FeatureCollectStandalone.h.

Constructor & Destructor Documentation

◆ TypedHolder()

Definition at line 189 of file FeatureCollectStandalone.h.

190  : TypelessHolder(baseholder.typeClid(),baseholder.label(),baseholder.subTypeIndex()),
191  asg::AsgMessaging("TypedHolder"),
192  m_store(store){
193  };

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 
)
staticinherited

Definition at line 12 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 
22  subtypeIndex = *fromHere++;
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 
29  std::vector<uint32_t>::const_iterator stringEnd = fromHere+labelSize;
30  HLT::StringSerializer::deserialize(fromHere, stringEnd, label);
31 
32  //advance iterator to end of label
33  std::advance(fromHere,labelSize);
34 
35  return true;
36 }

◆ get()

Definition at line 195 of file FeatureCollectStandalone.h.

195  {
196 
197  std::string key = HLTNavDetails::formatSGkey("HLT","xAOD::RoiDescriptorStore",this->label());
198  const xAOD::RoiDescriptorStore* roistore = 0;
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 
210  std::vector<const IRoiDescriptor*> rois;
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  }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ label()

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

Implements HLT::BaseHolder.

Definition at line 15 of file TypelessHolder.h.

15 { return m_label; }

◆ msg() [1/2]

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

The standard message stream.

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

Definition at line 49 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
inherited

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 57 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
inherited

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 41 of file AsgMessaging.cxx.

41  {
42 #ifndef XAOD_STANDALONE
43  return ::AthMessaging::msgLvl( lvl );
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
virtualinherited

Reimplemented in HLTNavDetails::IHolder.

Definition at line 38 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();
46  output[labelSizeIndex] = output.size() - beforeSS;
47  return true;
48 }

◆ setLevel()

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

Change the current logging level.

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

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

◆ subTypeIndex()

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

Implements HLT::BaseHolder.

Definition at line 16 of file TypelessHolder.h.

16 { return m_sub; }

◆ typeClid()

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

Implements HLT::BaseHolder.

Definition at line 14 of file TypelessHolder.h.

14 { return m_clid; }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_clid

class_id_type HLT::TypelessHolder::m_clid
protectedinherited

Definition at line 19 of file TypelessHolder.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_label

std::string HLT::TypelessHolder::m_label
protectedinherited

Definition at line 20 of file TypelessHolder.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_msg_tls

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

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
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_store

Definition at line 232 of file FeatureCollectStandalone.h.

◆ m_sub

sub_index_type HLT::TypelessHolder::m_sub
protectedinherited

Definition at line 21 of file TypelessHolder.h.


The documentation for this class was generated from the following file:
HLT::TypelessHolder::m_clid
class_id_type m_clid
Definition: TypelessHolder.h:19
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
SGTest::store
TestStore store
Definition: TestStore.cxx:23
ASG_CHECK
#define ASG_CHECK(...)
Helper macro for checking the status code returned by a function call.
Definition: Check.h:43
HLT::BaseHolder::label
virtual const std::string & label() const =0
HLT::BaseHolder::typeClid
virtual class_id_type typeClid() const =0
index
Definition: index.py:1
HLT::TypelessHolder::TypelessHolder
TypelessHolder(class_id_type clid, const std::string &label, sub_index_type sub)
Definition: TypelessHolder.cxx:7
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
HLTNavDetails::formatSGkey
std::string formatSGkey(const std::string &prefix, const std::string &containername, const std::string &label)
declaration of formatting function.
Definition: Holder.cxx:122
HLT::TypelessHolder::label
virtual const std::string & label() const
Definition: TypelessHolder.h:15
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
StringSerializer::serialize
void serialize(const std::vector< std::string > &strings, std::vector< uint32_t > &storage)
Serializes vector of strings into vector of integers.
Definition: TrigDataAccess/TrigSerializeResult/src/StringSerializer.cxx:10
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
xAOD::RoiDescriptorStore_v1
Definition: RoiDescriptorStore_v1.h:29
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::RoiDescriptorStore_v1::serialised
const std::vector< std::vector< uint32_t > > & serialised() const
expose the navigation information (in serialised form)
HLT::BaseHolder::subTypeIndex
virtual sub_index_type subTypeIndex() const =0
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
merge.output
output
Definition: merge.py:17
HLT::StringSerializer::deserialize
std::size_t deserialize(std::vector< uint32_t >::const_iterator first, std::vector< uint32_t >::const_iterator last, std::vector< std::string > &strings)
Definition: TrigEvent/TrigNavStructure/Root/StringSerializer.cxx:66
asg::AsgMessaging
Class mimicking the AthMessaging class from the offline software.
Definition: AsgMessaging.h:40
DeMoScan.index
string index
Definition: DeMoScan.py:364
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
TriggerTest.rois
rois
Definition: TriggerTest.py:23
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
HLT::TypedHolder< TrigRoiDescriptor, TrigRoiDescriptorCollection >::m_store
const asg::EventStoreType * m_store
Definition: FeatureCollectStandalone.h:232
python.compressB64.c
def c
Definition: compressB64.py:93
HLT::TypelessHolder::m_sub
sub_index_type m_sub
Definition: TypelessHolder.h:21
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
HLT::TypelessHolder::m_label
std::string m_label
Definition: TypelessHolder.h:20
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37