ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
TrigSerTPTool Class Reference

#include <TrigSerTPTool.h>

Inheritance diagram for TrigSerTPTool:
Collaboration diagram for TrigSerTPTool:

Public Member Functions

 TrigSerTPTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard AlgTool constructor. More...
 
virtual StatusCode initialize () override
 Function initialising the tool. More...
 
void * convertTP (const std::string &transName, void *trans, std::string &persName) const
 Convert a transient object to its persistent self. More...
 
void * convertPT (const std::string &persName, void *pers, std::string &transName) const
 Convert a persistent object to its transient self. More...
 
const std::string & persClassName (const std::string &transClassName) const
 Get the name of the persistent class belonging to a transient one. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Declare the interface provided by the tool. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

TClass * getClass (const std::string &clname) const
 Get the ROOT dictionary for a type. More...
 
ITPCnvBasegetConverter (const std::string &persistent) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

CxxUtils::ClassName::Rules m_clNameRules
 
std::unique_ptr< MsgStream > m_logTP
 
std::map< std::string, std::string > m_TPmap
 
std::vector< std::string > m_activeClasses
 
ServiceHandle< IMessageSvc > m_msgsvcTP
 
ServiceHandle< IDictLoaderSvcm_dictSvc
 
bool m_useAthDictLoader
 
bool m_online
 
ServiceHandle< ITPCnvSvcm_tpcnvsvc
 
std::mutex m_convertersCacheMutex
 
std::map< std::string, ITPCnvBase * > m_convertesCache ATLAS_THREAD_SAFE
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Author
Jiri Masik Jiri..nosp@m.Masi.nosp@m.k@cer.nosp@m.n.ch based on the code of AthenaROOTAccess by Scott Snyder

Definition at line 32 of file TrigSerTPTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrigSerTPTool()

TrigSerTPTool::TrigSerTPTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Standard AlgTool constructor.

Definition at line 21 of file TrigSerTPTool.cxx.

23  :
25  m_msgsvcTP( "", name ),
26  m_dictSvc( "AthDictLoaderSvc", name ),
27  m_useAthDictLoader( true ),
28  m_online( false ),
29  m_tpcnvsvc( "AthTPCnvSvc", name ) {
30 
31  declareInterface< TrigSerTPTool >( this );
32 
33  declareProperty( "TPMap", m_TPmap, "map of T->P classes" );
34  declareProperty( "ActiveClasses", m_activeClasses,
35  "allows to skip classes not relevant in the current "
36  "trigger level" );
37  declareProperty( "debuggingMsgSvc", m_msgsvcTP,
38  "an instance of the messageSvc for debugging purposes" );
39  declareProperty( "onlineMode", m_online,
40  "simpler setup for running online" );
41  declareProperty( "useAthDictLoader", m_useAthDictLoader,
42  "use AthDictLoaderSvc instead of plain ROOT" );
43 }

Member Function Documentation

◆ convertPT()

void * TrigSerTPTool::convertPT ( const std::string &  persName,
void *  pers,
std::string &  transName 
) const

Convert a persistent object to its transient self.

Definition at line 166 of file TrigSerTPTool.cxx.

168 {
169  // First look for a trigger specific converter:
170  ITPCnvBase* cnvtr =
171  m_tpcnvsvc->p2t_cnv( persName, Athena::TPCnvType::Trigger );
172  if( ! cnvtr ) {
173  // If there is no such thing, try a generic one:
174  cnvtr = m_tpcnvsvc->p2t_cnv( persName );
175  }
176  if( ! cnvtr ) {
177  REPORT_MESSAGE( MSG::ERROR )
178  << "T/P Converter for persistent class "
179  << persName << " could not be retrieved";
180  return 0;
181  }
182 
183  // Get the name of the transient class:
184  transName = m_clNameRules.apply( System::typeinfoName( cnvtr->transientTInfo() ) );
185 
186  // Create the transient object:
187  TClass *transCl = getClass( transName );
188  void *trans( 0 );
189  if( transCl ){
190  trans = transCl->New();
191  ATH_MSG_DEBUG( "trans " << trans );
192  }
193 
194  // Do the conversion:
195  ATH_MSG_DEBUG( "invoking PT for " << transName );
196  try {
197  cnvtr->persToTransWithKeyUntyped( pers, trans, "", m_logTP ? *m_logTP : msg() );
198  ATH_MSG_DEBUG( " succeeded at " << trans );
199  }
200  catch (const std::runtime_error& e){
201  REPORT_MESSAGE( MSG::ERROR ) << "An exception occurred: " << e.what();
202  //it should destruct trans here (is it in a good state?)
203  trans = 0;
204  }
205 
206  // Return the converted object:
207  return trans;
208 }

◆ convertTP()

void * TrigSerTPTool::convertTP ( const std::string &  transName,
void *  trans,
std::string &  persName 
) const

Convert a transient object to its persistent self.

Definition at line 101 of file TrigSerTPTool.cxx.

103 {
104  ATH_MSG_DEBUG( "TrigSerTPTool::convertTP" );
105 
106  //pers and persName set only after successful conversion
107  persName = "";
108  void *pers( 0 );
109 
110  // Start by trying to find the correct persistent class from the TP map
111  // Otherwise, use the internal logic of the TPCnvSvc
112  const auto tpItr = m_TPmap.find( clname );
113  if( tpItr == m_TPmap.end() ) {
114  REPORT_MESSAGE( MSG::ERROR )
115  << "Transient class " << clname
116  << " is not in the T/P Converter map";
117  return 0;
118  }
119  persName = tpItr->second;
120 
121  ITPCnvBase* cnvtr = getConverter( persName );
122  if( ! cnvtr ) {
123  ATH_MSG_ERROR( "T/P Converter for transient class " << tpItr->first
124  << " persistent class " << persName << " could not be retrieved");
125  return nullptr;
126  }
127 
128  // Create a persistent object:
129  const std::string persname =
130  m_clNameRules.apply( System::typeinfoName( cnvtr->persistentTInfo() ) );
131  TClass *persObjCl = getClass( persname );
132  void *persptr( 0 );
133  if( persObjCl ) {
134  persptr = persObjCl->New();
135  ATH_MSG_DEBUG( "created object of " << persptr << " at " << persptr );
136  } else {
137  REPORT_MESSAGE( MSG::ERROR )
138  << "Couldn't find dictionary for type " << persname;
139  return 0;
140  }
141 
142  // Do the conversion:
143  ATH_MSG_DEBUG( "invoking TP for " << clname << " at " << ptr );
144  try {
145  cnvtr->transToPersUntyped( ptr, persptr, m_logTP ? *m_logTP : msg() );
146  persName = persname;
147  pers = persptr;
148  ATH_MSG_DEBUG( "succeeded at " << persptr );
149  }
150  catch( const std::runtime_error& e ){
151 
152  //delete persObjCl->New();
153  const std::string issue = e.what();
154  if( issue.find( "is deprecated" ) != std::string::npos ) {
155  ATH_MSG_INFO( "An exception " << e.what() );
156  } else {
157  pers = 0;
158  REPORT_MESSAGE( MSG::ERROR ) << "An exception occurred: " << e.what();
159  }
160  }
161 
162  // Return the converted object:
163  return pers;
164 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ getClass()

TClass * TrigSerTPTool::getClass ( const std::string &  clname) const
private

Get the ROOT dictionary for a type.

Definition at line 227 of file TrigSerTPTool.cxx.

227  {
228 
229  TClass *cl( 0 );
230  if( m_useAthDictLoader && m_dictSvc ){
231  m_dictSvc->load_type( cname );
232  }
233  cl = TClass::GetClass( cname.c_str() );
234  return cl;
235 }

◆ getConverter()

ITPCnvBase * TrigSerTPTool::getConverter ( const std::string &  persistent) const
private

Definition at line 84 of file TrigSerTPTool.cxx.

85 {
86  std::lock_guard<std::mutex> lock(m_convertersCacheMutex);
87  ITPCnvBase* cnvtr = m_convertesCache[persistent];
88  if ( ATH_LIKELY( cnvtr ) )
89  return cnvtr;
90 
91  // no converter, we need to find it, first the trigger specific one
93  if( ! cnvtr ) {
94  // If there is no such thing, try a generic one:
95  cnvtr = m_tpcnvsvc->p2t_cnv( persistent );
96  }
97  m_convertesCache[persistent] = cnvtr;
98  return cnvtr;
99 }

◆ initialize()

StatusCode TrigSerTPTool::initialize ( )
overridevirtual

Function initialising the tool.

Definition at line 45 of file TrigSerTPTool.cxx.

45  {
46 
47  // Greet the user:
48  ATH_MSG_INFO( "Initializing" );
49 
50  // Retrieve a custom message service:
51  if( ! m_msgsvcTP.empty() ) {
52  if( m_msgsvcTP.retrieve().isFailure() ) {
53  ATH_MSG_INFO( "Could not retrieve a separate MsgSvc for "
54  "the T/P debugging" );
55  } else {
56  ATH_MSG_DEBUG( "Using " << m_msgsvcTP << " for debugging" );
57  IMessageSvc* msvc = m_msgsvcTP.operator->();
58  m_logTP = std::make_unique< MsgStream >( msvc,
59  "TrigSerTPTool-T/P" );
60  }
61  }
62 
63  // Retrieve the used services:
64  ATH_CHECK( m_dictSvc.retrieve() );
65  ATH_CHECK( m_tpcnvsvc.retrieve() );
66 
67  /* When a P<->T conversion is requested, this tool makes a call to TClass::GetClass.
68  * The way it's done here can cause performance issues in some circumstances.
69  * For example, reading data16 RAW files trigger a P->T conversion from
70  * DataVector<xAOD::TauJet_v2> to DataVector<xAOD::TauJet_v3> in RAWtoALL/22.0.62.
71  * The problem is that the converter returns the full class name through
72  * ITPCnvBase::transientTInfo(), which in this case resolves into
73  * DataVector<xAOD::TauJet_v3,DataVector<xAOD::IParticle,DataModel_detail::NoBase> >
74  * Passing this directly to TClass::GetClass causes AutoLoading/HeaderParsing
75  * which notoriously allocates memory and never releases it. Here, we work
76  * around this problem by stripping the base class information from the name
77  * that's passed to TClass::GetClass, in this case simply DataVector<xAOD::TauJet_v3>
78  */
79  m_clNameRules.add("DataVector<$T, $B>", "DataVector<$T>");
80 
81  return StatusCode::SUCCESS;
82 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

static const InterfaceID& TrigSerTPTool::interfaceID ( )
inlinestatic

Declare the interface provided by the tool.

Definition at line 36 of file TrigSerTPTool.h.

36  {
37  static const InterfaceID
38  IID_TrigSerTPTool("TrigSerTPTool", 1, 0);
39  return IID_TrigSerTPTool;
40  }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ persClassName()

const std::string & TrigSerTPTool::persClassName ( const std::string &  transClassName) const

Get the name of the persistent class belonging to a transient one.

Definition at line 211 of file TrigSerTPTool.cxx.

211  {
212 
213  // Try to extract from the TP map
214  const auto tpItr = m_TPmap.find( transClassName );
215  if( tpItr == m_TPmap.end() ) {
216  REPORT_MESSAGE( MSG::ERROR )
217  << "Transient class " << transClassName
218  << " is not in the T/P Converter map";
219  static const std::string dummy( "" );
220  return dummy;
221  }
222 
223  // Return the persistent class name:
224  return tpItr->second;
225 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::map<std::string, ITPCnvBase*> m_convertesCache TrigSerTPTool::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 73 of file TrigSerTPTool.h.

◆ m_activeClasses

std::vector< std::string > TrigSerTPTool::m_activeClasses
private

Definition at line 66 of file TrigSerTPTool.h.

◆ m_clNameRules

CxxUtils::ClassName::Rules TrigSerTPTool::m_clNameRules
private

Definition at line 62 of file TrigSerTPTool.h.

◆ m_convertersCacheMutex

std::mutex TrigSerTPTool::m_convertersCacheMutex
mutableprivate

Definition at line 72 of file TrigSerTPTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_dictSvc

ServiceHandle< IDictLoaderSvc > TrigSerTPTool::m_dictSvc
private

Definition at line 68 of file TrigSerTPTool.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_logTP

std::unique_ptr< MsgStream > TrigSerTPTool::m_logTP
private

Definition at line 64 of file TrigSerTPTool.h.

◆ m_msgsvcTP

ServiceHandle< IMessageSvc > TrigSerTPTool::m_msgsvcTP
private

Definition at line 67 of file TrigSerTPTool.h.

◆ m_online

bool TrigSerTPTool::m_online
private

Definition at line 70 of file TrigSerTPTool.h.

◆ m_tpcnvsvc

ServiceHandle< ITPCnvSvc > TrigSerTPTool::m_tpcnvsvc
private

Definition at line 71 of file TrigSerTPTool.h.

◆ m_TPmap

std::map< std::string, std::string > TrigSerTPTool::m_TPmap
private

Definition at line 65 of file TrigSerTPTool.h.

◆ m_useAthDictLoader

bool TrigSerTPTool::m_useAthDictLoader
private

Definition at line 69 of file TrigSerTPTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
python.TriggerEDMRun3.persistent
def persistent(transient)
Definition: TriggerEDMRun3.py:1150
TrigSerTPTool::m_tpcnvsvc
ServiceHandle< ITPCnvSvc > m_tpcnvsvc
Definition: TrigSerTPTool.h:71
TrigSerTPTool::m_TPmap
std::map< std::string, std::string > m_TPmap
Definition: TrigSerTPTool.h:65
CxxUtils::ClassName::Rules::add
void add(const ClassName &pattern, const ClassName &replacement)
Add a new transformation rule.
Definition: ClassName.cxx:60
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TrigSerTPTool::m_dictSvc
ServiceHandle< IDictLoaderSvc > m_dictSvc
Definition: TrigSerTPTool.h:68
TrigSerTPTool::m_convertersCacheMutex
std::mutex m_convertersCacheMutex
Definition: TrigSerTPTool.h:72
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Athena::TPCnvType::Trigger
@ Trigger
Definition: TPCnvFactory.h:125
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
ITPCnvBase::transientTInfo
virtual const std::type_info & transientTInfo() const =0
return C++ type id of the transient class this converter is for
TrigSerTPTool::getConverter
ITPCnvBase * getConverter(const std::string &persistent) const
Definition: TrigSerTPTool.cxx:84
TrigSerTPTool::m_msgsvcTP
ServiceHandle< IMessageSvc > m_msgsvcTP
Definition: TrigSerTPTool.h:67
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
ITPCnvBase::transToPersUntyped
virtual void transToPersUntyped(const void *trans, void *pers, MsgStream &msg)=0
Convert transient object representation to persistent.
TrigSerTPTool::m_logTP
std::unique_ptr< MsgStream > m_logTP
Definition: TrigSerTPTool.h:64
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CxxUtils::ClassName::Rules::apply
std::string apply(const std::string &name) const
Apply transformations to a class name.
Definition: ClassName.cxx:127
python.xAODType.dummy
dummy
Definition: xAODType.py:4
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
TrigSerTPTool::m_useAthDictLoader
bool m_useAthDictLoader
Definition: TrigSerTPTool.h:69
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
REPORT_MESSAGE
#define REPORT_MESSAGE(LVL)
Report a message.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:365
ITPCnvBase
Definition: ITPCnvBase.h:24
ITPCnvBase::persToTransWithKeyUntyped
virtual void persToTransWithKeyUntyped(const void *pers, void *trans, const std::string &, MsgStream &msg)
Convert persistent object representation to transient.
Definition: ITPCnvBase.h:53
ATH_LIKELY
#define ATH_LIKELY(x)
Definition: AthUnlikelyMacros.h:16
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ITPCnvBase::persistentTInfo
virtual const std::type_info & persistentTInfo() const =0
return C++ type id of the persistent class this converter is for
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
TrigSerTPTool::m_activeClasses
std::vector< std::string > m_activeClasses
Definition: TrigSerTPTool.h:66
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
TrigSerTPTool::getClass
TClass * getClass(const std::string &clname) const
Get the ROOT dictionary for a type.
Definition: TrigSerTPTool.cxx:227
TrigSerTPTool::m_clNameRules
CxxUtils::ClassName::Rules m_clNameRules
Definition: TrigSerTPTool.h:62
TrigSerTPTool::m_online
bool m_online
Definition: TrigSerTPTool.h:70
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528