ATLAS Offline Software
Classes | Static Public Member Functions | Static Private Member Functions | List of all members
xAOD::AddDVProxy Class Reference

Set up collection proxy for a DataVector class. More...

#include <AddDVProxy.h>

Collaboration diagram for xAOD::AddDVProxy:

Classes

struct  Helper
 Helper structure implementing the resize(...) function. More...
 

Static Public Member Functions

template<typename T >
static void add (ROOT::TGenericClassInfo *clInfo)
 Set up collection proxy for a DataVector class. More...
 

Static Private Member Functions

static void loadDictionaries ()
 Helper function force-loading all the needed dictionaries. More...
 

Detailed Description

Set up collection proxy for a DataVector class.

If cl is a DataVector class, or derives from one, then we attach an appropriate Root collection proxy to it. This is required for Root to recognize the class as a collection in, eg, TTree::Draw.

Definition at line 87 of file AddDVProxy.h.

Member Function Documentation

◆ add()

template<typename T >
static void xAOD::AddDVProxy::add ( ROOT::TGenericClassInfo *  clInfo)
inlinestatic

Set up collection proxy for a DataVector class.

If cl is a DataVector class, or derives from one, then we attach an appropriate Root collection proxy to it. This is required for Root to recognize the class as a collection in, eg, TTree::Draw.

Definition at line 147 of file AddDVProxy.h.

147  {
148 
149  // Load the minimal amount of required dictionaries:
151 
152  // Create the collection proxy instance:
153  TDVCollectionProxy* proxy =
154  new TDVCollectionProxy( ClassName< T >::name().c_str() );
155  proxy->SetResize( Helper< T >::resize );
156 
157  // Add it to the class info:
158  clInfo->AdoptCollectionProxy( proxy );
159 
160  return;
161  }

◆ loadDictionaries()

void xAOD::AddDVProxy::loadDictionaries ( )
staticprivate

Helper function force-loading all the needed dictionaries.

The constructor of TDVCollectionProxy needs the dictionary of DataVector<xAOD::TDVCollectionProxyDummy> to be loaded already.

This function makes sure that this is the case.

Definition at line 104 of file AddDVProxy.cxx.

104  {
105 
106  // Enable library auto-loading. Only once per job.
107  static std::once_flag libLoadFlag;
108  std::call_once( libLoadFlag, []( TInterpreter& interpreter ) {
109 
110  // Enable library auto-loading.
111  TClass::ReadRules();
112  interpreter.LoadLibraryMap();
113  interpreter.SetClassAutoloading( true );
114 
115  // Make sure that the minimal set of dictionaries are loaded:
116  if( ! TClass::GetClass( "DataVector<xAOD::TDVCollectionProxyDummy>" ) ) {
117  ::Error( "xAOD::AddDVProxy::loadDictionaries",
118  "Couldn't load the dictionary for "
119  "DataVector<xAOD::TDVCollectionProxyDummy>" );
120  }
121 
122  // Install the cling workaround (see above).
123  gROOT->AddClassGenerator (&generator);
124 
125  }, *gInterpreter );
126 
127  return;
128  }

The documentation for this class was generated from the following files:
xAOD::AddDVProxy::Helper::resize
static void resize(void *obj, size_t size)
Function taking care of resizing DataVector<T> objects in memory.
Definition: AddDVProxy.h:111
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
xAOD::AddDVProxy::loadDictionaries
static void loadDictionaries()
Helper function force-loading all the needed dictionaries.
Definition: AddDVProxy.cxx:104
ClassName
An interface for getting the name of a class as a string.
Definition: AthenaKernel/AthenaKernel/ClassName.h:33
mc.generator
generator
Configure Herwig7 These are the commands corresponding to what would go into the regular Herwig infil...
Definition: mc.MGH7_FxFx_H71-DEFAULT_test.py:18