ATLAS Offline Software
Classes | Public Types | Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
xAOD::TAuxStore Class Referenceabstract

"ROOT implementation" of IAuxStore More...

#include <TAuxStore.h>

Inheritance diagram for xAOD::TAuxStore:
Collaboration diagram for xAOD::TAuxStore:

Classes

class  TBranchHandle
 Class used internally to implement just-in-time reading. More...
 

Public Types

enum  EStructMode { kUndefinedStore = 0, kContainerStore = 1, kObjectStore = 2 }
 "Structural" modes of the object More...
 
typedef SG::auxid_t auxid_t
 Convenience type declaration. More...
 
typedef SG::auxid_set_t auxid_set_t
 Convenience type declaration. More...
 

Public Member Functions

 TAuxStore (const char *prefix="", Bool_t topStore=kTRUE, EStructMode mode=kUndefinedStore, Int_t basketSize=2048, Int_t splitLevel=0)
 Default constructor. More...
 
 ~TAuxStore ()
 Destructor. More...
 
EStructMode structMode () const
 Get what structure mode the object was constructed with. More...
 
StatusCode setStructMode (EStructMode mode)
 Set the structure mode of the object to a new value. More...
 
const charprefix () const
 Get the currently configured branch name prefix. More...
 
void setPrefix (const char *prefix)
 Set the branch name prefix. More...
 
Bool_t isTopStore () const
 Check if the object is a "top store", or not. More...
 
void setTopStore (Bool_t value=kTRUE)
 Set whether the object should behave as a "top store" or not. More...
 
Int_t basketSize () const
 Get the size of the baskets created for the output branches. More...
 
void setBasketSize (Int_t value)
 Set the size of the baskets created for the output branches. More...
 
Int_t splitLevel () const
 Get the split level of the output branches. More...
 
void setSplitLevel (Int_t value)
 Set the split level of the output branches. More...
 
StatusCode readFrom (::TTree *tree, ::Bool_t printWarnings=kTRUE)
 Connect the object to an input TTree. More...
 
StatusCode writeTo (::TTree *tree)
 Connect the object to an output TTree. More...
 
Int_t getEntry (Int_t getall=0)
 Read the values from the TTree entry that was loaded with TTree::LoadTree() More...
 
void reset ()
 Tell the object that all branches will need to be re-read. More...
 
virtual const void * getData (SG::auxid_t auxid) const=0
 Pick up the const version from the base class. More...
 
virtual bool insertMove (size_t pos, IAuxStore &other, const SG::auxid_set_t &ignore=SG::auxid_set_t())=0
 Move all elements from other to this store. More...
 
virtual bool setOption (auxid_t, const AuxDataOption &)
 Set an option for a given auxiliary variable. More...
 
Functions implementing the SG::IConstAuxStore interface
virtual const void * getData (auxid_t auxid) const override
 Get a pointer to a given array. More...
 
virtual const auxid_set_tgetAuxIDs () const override
 Get the types(names) of variables handled by this container. More...
 
virtual void * getDecoration (auxid_t auxid, size_t size, size_t capacity) override
 Get a pointer to a given array, creating the array if necessary. More...
 
virtual bool isDecoration (auxid_t auxid) const override
 Test if a variable is a decoration. More...
 
virtual void lock () override
 Lock the object, and don't let decorations be added. More...
 
virtual bool clearDecorations () override
 Remove the decorations added so far. More...
 
virtual void lockDecoration (SG::auxid_t auxid) override
 Lock a decoration. More...
 
virtual size_t size () const override
 Return the number of elements in the store. More...
 
Functions implementing the SG::IAuxStore interface
virtual void * getData (auxid_t auxid, size_t size, size_t capacity) override
 Get a pointer to a given array, creating the array if necessary. More...
 
virtual const auxid_set_tgetWritableAuxIDs () const override
 Return a set of writable data identifiers. More...
 
virtual bool resize (size_t size) override
 Resize the arrays to a given size. More...
 
virtual void reserve (size_t size) override
 Reserve a given size for the arrays. More...
 
virtual void shift (size_t pos, ptrdiff_t offs) override
 Shift the contents of the stored arrays. More...
 
virtual bool insertMove (size_t pos, IAuxStore &other, const SG::auxid_set_t &ignore) override
 Insert contents of another store via move. More...
 
Functions implementing the SG::IAuxStoreIO interface
virtual const void * getIOData (auxid_t auxid) const override
 Get a pointer to the data being stored for one aux data item. More...
 
virtual const std::type_info * getIOType (auxid_t auxid) const override
 Return the type of the data to be stored for one aux data item. More...
 
virtual const auxid_set_tgetDynamicAuxIDs () const override
 Get the types(names) of variables created dynamically. More...
 
virtual void selectAux (const std::set< std::string > &attributes)
 Select dynamic auxiliary attributes for writing. More...
 
virtual auxid_set_t getSelectedAuxIDs () const override
 Get the IDs of the selected aux variables. More...
 

Static Public Attributes

static constexpr bool supportsThinning = true
 Mark that this type supports thinning operations. More...
 

Private Types

typedef AthContainers_detail::mutex mutex_t
 Mutex type for multithread synchronization. More...
 
typedef AthContainers_detail::lock_guard< mutex_tguard_t
 Guard type for multithreaded synchronisation. More...
 

Private Member Functions

StatusCode initStats (::TTree *tree)
 Function used for setting up the statistics info about the managed branches. More...
 
StatusCode setupInputData (auxid_t auxid)
 Connect a variable to the input tree. More...
 
StatusCode setupOutputData (auxid_t auxid)
 Connect a variable to the output tree. More...
 
StatusCode scanInputTree ()
 Scan the input TTree for auxiliary branches. More...
 
StatusCode setupAuxBranch (::TBranch *br, const char *auxName, ::Bool_t staticBranch)
 Register one input branch as an available auxiliary variable. More...
 
::Bool_t isAuxIDSelected (auxid_t auxid) const
 Check if this auxiliary variable needs to go to the output. More...
 

Static Private Member Functions

::Bool_t isPrimitiveBranch (TBranch *br)
 Check if a branch holds a primitive variable or not. More...
 
::Bool_t isContainerBranch (TBranch *br, auxid_t auxid)
 Check if a branch describes a container or a single object. More...
 
::Bool_t isRegisteredType (auxid_t auxid)
 Check if the auxiliary variable has a registered type. More...
 

Private Attributes

std::string m_prefix
 Static prefix for the branch names. More...
 
std::string m_dynPrefix
 Dynamic prefix for the branch names. More...
 
::Bool_t m_topStore
 Flag stating whether this is a "top store". More...
 
EStructMode m_structMode
 The "structural" mode of the object. More...
 
::Int_t m_basketSize
 The basket size for the output branches. More...
 
::Int_t m_splitLevel
 The split level for the output branches. More...
 
::TTree * m_inTree
 The TTree being read from. More...
 
::TTree * m_outTree
 The TTree being written to. More...
 
::Bool_t m_inputScanned
 "Scan status" of the input TTree More...
 
AuxSelection m_selection
 Object helping to select which auxiliary variables to write. More...
 
SG::AuxStoreInternalm_transientStore
 Store for the in-memory-only variables. More...
 
auxid_set_t m_auxIDs
 Internal list of variable IDs handled currently by the object. More...
 
std::vector< SG::IAuxTypeVector * > m_vecs
 Variables handled currently by the object. More...
 
std::size_t m_size
 The current size of the container being described. More...
 
::Bool_t m_locked
 Is this container locked? More...
 
std::vector< ::Bool_t > m_isDecoration
 Flags items as decorations. More...
 
mutex_t m_mutex1
 Mutexes object used for multithreaded synchronisation. More...
 
mutex_t m_mutex2
 
std::vector< TBranchHandle * > m_branches
 Branches reading the various auxiliary variables. More...
 
std::vector< boolm_branchesWritten
 "Write status" of the different variables More...
 
std::vector< boolm_missingBranches
 Mark branches we've found to be missing. More...
 

Friends

class TEvent
 Make TEvent a friend of this class. More...
 

Detailed Description

"ROOT implementation" of IAuxStore

This is a "D3PDReader-like" implementation for the auxiliary store interface. It is meant to provide very efficient access to a relatively small number of auxiliary variables.

Author
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h

Definition at line 45 of file TAuxStore.h.

Member Typedef Documentation

◆ auxid_set_t

Convenience type declaration.

Definition at line 61 of file TAuxStore.h.

◆ auxid_t

Convenience type declaration.

Definition at line 59 of file TAuxStore.h.

◆ guard_t

typedef AthContainers_detail::lock_guard< mutex_t > xAOD::TAuxStore::guard_t
private

Guard type for multithreaded synchronisation.

Definition at line 244 of file TAuxStore.h.

◆ mutex_t

typedef AthContainers_detail::mutex xAOD::TAuxStore::mutex_t
private

Mutex type for multithread synchronization.

Definition at line 242 of file TAuxStore.h.

Member Enumeration Documentation

◆ EStructMode

"Structural" modes of the object

Enumerator
kUndefinedStore 

The structure mode is not defined.

kContainerStore 

The object describes an entire container.

kObjectStore 

The object describes a single object.

Definition at line 53 of file TAuxStore.h.

53  {
54  kUndefinedStore = 0,
55  kContainerStore = 1,
56  kObjectStore = 2
57  };

Constructor & Destructor Documentation

◆ TAuxStore()

xAOD::TAuxStore::TAuxStore ( const char prefix = "",
Bool_t  topStore = kTRUE,
EStructMode  mode = kUndefinedStore,
Int_t  basketSize = 2048,
Int_t  splitLevel = 0 
)

Default constructor.

Definition at line 56 of file TAuxStore.cxx.

◆ ~TAuxStore()

xAOD::TAuxStore::~TAuxStore ( )

Destructor.

Definition at line 70 of file TAuxStore.cxx.

70  {
71 
74  for( ; vitr != vend; ++vitr ) {
75  if( *vitr ) delete *vitr;
76  }
77 
80  for( ; bitr != bend; ++bitr ) {
81  if( *bitr ) delete *bitr;
82  }
83 
85  }

Member Function Documentation

◆ basketSize()

Int_t xAOD::TAuxStore::basketSize ( ) const

Get the size of the baskets created for the output branches.

Definition at line 139 of file TAuxStore.cxx.

139  {
140 
141  return m_basketSize;
142  }

◆ clearDecorations()

bool xAOD::TAuxStore::clearDecorations ( )
overridevirtual

Remove the decorations added so far.

Only works for transient decorations.

Implements SG::IConstAuxStore.

Definition at line 426 of file TAuxStore.cxx.

426  {
427 
428  // Guard against multi-threaded execution:
429  guard_t guard( m_mutex1 );
430 
431  // Clear the transient decorations:
432  bool anycleared = false;
433  if( m_transientStore ) {
435 
436  // Clear the decorations from the transient store:
437  anycleared = m_transientStore->clearDecorations();
438 
439  // Now remove ids that were cleared.
440  if (anycleared) {
441  old_id_set -= m_transientStore->getAuxIDs();
442  // old_id_set is now the set of ids that were cleared.
443  m_auxIDs -= old_id_set;
444  }
445  }
446 
447  // The decorations which are going into the output file, are here to stay.
448  // Removing their IDs from the internal set would just cause more problems
449  // in my mind than just leaving them be.
450 
451  return anycleared;
452  }

◆ getAuxIDs()

const TAuxStore::auxid_set_t & xAOD::TAuxStore::getAuxIDs ( ) const
overridevirtual

Get the types(names) of variables handled by this container.

Implements SG::IConstAuxStore.

Definition at line 321 of file TAuxStore.cxx.

321  {
322 
323  return m_auxIDs;
324  }

◆ getData() [1/3]

const void * xAOD::TAuxStore::getData ( auxid_t  auxid) const
overridevirtual

Get a pointer to a given array.

Implements SG::IConstAuxStore.

Definition at line 286 of file TAuxStore.cxx.

286  {
287 
288  // Guard against multi-threaded execution:
289  guard_t guard( m_mutex1 );
290 
291  // Check if the transient store already handles this variable:
292  if( m_transientStore &&
293  ( m_transientStore->getAuxIDs().test( auxid ) ) ) {
294  return m_transientStore->getData( auxid );
295  }
296 
297  // Connect this auxiliary variable both to the input and output
298  // if needed:
299  if( ( auxid >= m_vecs.size() ) || ( ! m_vecs[ auxid ] ) ||
300  ( auxid >= m_branches.size() ) || ( ! m_branches[ auxid ] ) ) {
301  auto this_nc ATLAS_THREAD_SAFE = const_cast<TAuxStore*>(this); // locked above
302  if( ( ! this_nc->setupInputData( auxid ).isSuccess() ) ||
303  ( ! this_nc->setupOutputData( auxid ).isSuccess() ) ) {
304  return 0;
305  }
306  }
307 
308  // Make sure the variable is up to date:
309  const ::Int_t readBytes = m_branches[ auxid ]->getEntry();
310  if( readBytes < 0 ) {
311  ::Error( "xAOD::TAuxStore::getData",
312  XAOD_MESSAGE( "Couldn't read in variable %s" ),
313  SG::AuxTypeRegistry::instance().getName( auxid ).c_str() );
314  return 0;
315  }
316 
317  // Return the pointer to the object:
318  return m_vecs[ auxid ]->toPtr();
319  }

◆ getData() [2/3]

void * xAOD::TAuxStore::getData ( auxid_t  auxid,
size_t  size,
size_t  capacity 
)
overridevirtual

Get a pointer to a given array, creating the array if necessary.

Implements SG::IAuxStore.

Definition at line 488 of file TAuxStore.cxx.

489  {
490 
491  // Guard against multi-threaded execution:
492  guard_t guard( m_mutex2 );
493 
494  // Remember the size:
495  m_size = size;
496 
497  // Check if we want to write this variable to the output:
498  if( ( ! m_outTree ) || ( ! isAuxIDSelected( auxid ) ) ) {
499  // Create the store only when necessary:
500  if( ! m_transientStore ) {
503  if( m_locked ) {
505  }
506  }
507  // Let the transient store create the variable:
508  size_t nids = m_transientStore->getAuxIDs().size();
509  void* result = m_transientStore->getData( auxid, size, capacity );
510  if( result && ( nids != m_transientStore->getAuxIDs().size() ) ) {
511  m_auxIDs.insert( auxid );
512  }
513  // Return the address in the transient memory:
514  return result;
515  }
516 
517  // If the variable exists already, and this is a locked store, then
518  // we are in trouble.
519  if( m_locked && ( auxid < m_vecs.size() ) && m_vecs[ auxid ] ) {
520  if( ! ( ( auxid < m_isDecoration.size() ) &&
521  m_isDecoration[ auxid ] ) ) {
522  throw SG::ExcStoreLocked( auxid );
523  }
524  }
525 
526  // Connect this auxiliary variable just to the output:
527  if( setupOutputData( auxid ).isFailure() ) {
528  ::Error( "xAOD::TAuxStore::getData",
529  XAOD_MESSAGE( "Failed to set up variable %s" ),
530  SG::AuxTypeRegistry::instance().getName( auxid ).c_str() );
531  return 0;
532  }
533 
534  // Check whether things make sense:
535  if( ( m_structMode == kObjectStore ) && ( size != 1 ) ) {
536  ::Error( "xAOD::TAuxStore::getData",
537  XAOD_MESSAGE( "Branch creation requested with:" ) );
538  ::Error( "xAOD::TAuxStore::getData",
539  XAOD_MESSAGE( " name = %s" ),
540  SG::AuxTypeRegistry::instance().getName( auxid ).c_str() );
541  ::Error( "xAOD::TAuxStore::getData",
542  XAOD_MESSAGE( " size = %i" ),
543  static_cast< int >( size ) );
544  ::Error( "xAOD::TAuxStore::getData",
545  XAOD_MESSAGE( " m_structMode = kObjectStore" ) );
546  return 0;
547  }
548 
549  // Make sure the variable is of the right size:
550  m_vecs[ auxid ]->reserve( capacity );
551  m_vecs[ auxid ]->resize( size );
552 
553  // Return the object:
554  return m_vecs[ auxid ]->toPtr();
555  }

◆ getData() [3/3]

virtual const void* SG::IConstAuxStore::getData
inherited

Pick up the const version from the base class.

◆ getDecoration()

void * xAOD::TAuxStore::getDecoration ( auxid_t  auxid,
size_t  size,
size_t  capacity 
)
overridevirtual

Get a pointer to a given array, creating the array if necessary.

Implements SG::IConstAuxStore.

Definition at line 326 of file TAuxStore.cxx.

327  {
328 
329  // Guard against multi-threaded execution:
330  guard_t guard( m_mutex1 );
331 
332  // Remember the requested size:
333  m_size = size;
334 
335  // If this is a locked object, deal with it correctly:
336  if( m_locked ) {
337  // If the variable exists already and it's a decoration, then let's
338  // give it back.
339  if( ( auxid < m_vecs.size() ) && m_vecs[ auxid ] &&
340  ( auxid < m_isDecoration.size() && m_isDecoration[ auxid ] ) ) {
341  // Things look okay...
342  m_vecs[ auxid ]->reserve( capacity );
343  m_vecs[ auxid ]->resize( size );
344  return m_vecs[ auxid ]->toPtr();
345  }
346  // If it's in the transient store already, return it from there.
347  // Since in a locked store *everything* is a decoration in the
348  // transient store.
349  if( m_transientStore &&
350  m_transientStore->getAuxIDs().test( auxid ) ) {
351  return m_transientStore->getDecoration( auxid, size, capacity );
352  }
353  // If we know this auxiliary ID, but it was not found as a decoration
354  // by the previous checks, then we're in trouble.
355  if( m_auxIDs.test( auxid ) ) {
356  // It may still be a decoration in a transient store. If such
357  // a store exists, leave it up to that store to
358  throw SG::ExcStoreLocked( auxid );
359  }
360  }
361 
362  // Check if we want to write this variable to the output:
363  if( ( ! isAuxIDSelected( auxid ) ) || ( ! m_outTree ) ) {
364 
365  // Create the store only when necessary:
366  if( ! m_transientStore ) {
369  if( m_locked ) {
371  }
372  }
373  // Let the transient store create the decoration:
374  const size_t nids = m_transientStore->getAuxIDs().size();
375  void* result = m_transientStore->getDecoration( auxid, size,
376  capacity );
377  if( result && ( nids != m_transientStore->getAuxIDs().size() ) ) {
378  m_auxIDs.insert( auxid );
379  }
380  // Return the memory address from the transient store:
381  return result;
382  }
383 
384  // Doesn't exist yet. So let's make it:
385  void* result = getData( auxid, size, capacity );
386  if( m_locked ) {
387  // If the container is locked, remember that this is a decoration:
388  if( m_isDecoration.size() <= auxid ) {
389  m_isDecoration.resize( auxid + 1 );
390  }
391  m_isDecoration[ auxid ] = ::kTRUE;
392  }
393 
394  // Return the pointer made by getData(...):
395  return result;
396  }

◆ getDynamicAuxIDs()

const TAuxStore::auxid_set_t & xAOD::TAuxStore::getDynamicAuxIDs ( ) const
overridevirtual

Get the types(names) of variables created dynamically.

Implements SG::IAuxStoreIO.

Definition at line 789 of file TAuxStore.cxx.

789  {
790 
791  // All the auxiliary decorations handled by this object are considered
792  // dynamic:
793  return getAuxIDs();
794  }

◆ getEntry()

Int_t xAOD::TAuxStore::getEntry ( Int_t  getall = 0)

Read the values from the TTree entry that was loaded with TTree::LoadTree()

Definition at line 227 of file TAuxStore.cxx.

227  {
228 
229  // Guard against multi-threaded execution:
230  guard_t guard( m_mutex1 );
231 
232  // Reset the transient store. TEvent::fill() calls this function with
233  // getall==99. When that is happening, we need to keep the transient
234  // store still around. Since the user may want to interact with the
235  // object after it was written out. (And since TEvent::fill() asks for
236  // the transient decorations after calling getEntry(...).)
237  if( m_transientStore && ( getall != 99 ) ) {
238  // Remove the transient auxiliary IDs from the internal list:
240  // Delete the object:
241  delete m_transientStore;
242  m_transientStore = 0;
243  }
244 
245  // Now remove the IDs of the decorations that are getting persistified:
246  if( getall != 99 ) {
247  for( auxid_t auxid = 0; auxid < m_isDecoration.size(); ++auxid ) {
248  if( ! m_isDecoration[ auxid ] ) {
249  continue;
250  }
251  m_auxIDs.erase( auxid );
252  }
253  }
254 
255  // If we don't need everything loaded, return now:
256  if( ! getall ) return 0;
257 
258  // Get all the variables at once:
259  ::Int_t bytesRead = 0;
262  for( ; itr != end; ++itr ) {
263  if( *itr ) {
264  bytesRead += ( *itr )->getEntry();
265  }
266  }
267 
268  return bytesRead;
269  }

◆ getIOData()

const void * xAOD::TAuxStore::getIOData ( auxid_t  auxid) const
overridevirtual

Get a pointer to the data being stored for one aux data item.

Implements SG::IAuxStoreIO.

Definition at line 705 of file TAuxStore.cxx.

705  {
706 
707  // Guard against multi-threaded execution:
708  guard_t guard( m_mutex1 );
709 
710  // If the variable is connected to already:
711  if( ( auxid < m_branches.size() ) && m_branches[ auxid ] ) {
712  // Make sure that the right payload is in memory:
713  m_branches[ auxid ]->getEntry();
714  // Return the pointer:
715  return m_branches[ auxid ]->objectPtr();
716  }
717 
718  // Check if it's in the transient store:
719  if( m_transientStore && m_transientStore->getAuxIDs().test( auxid ) ) {
720  return m_transientStore->getIOData( auxid );
721  }
722 
723  // If not, try connecting to it now:
724  auto this_nc ATLAS_THREAD_SAFE = const_cast<TAuxStore*>(this); // locked above
725  if( ! this_nc->setupInputData( auxid ).isSuccess() ) {
726  // This is not actually an error condition anymore. We can end up here
727  // when we decorate constant objects coming from the input file, but
728  // on one event we can't set any decorations. For instance when the
729  // input container is empty. In that case the object will still list
730  // the auxiliary ID belonging to that decoration as being available,
731  // but it really isn't.
732  //
733  // Later on it might be needed to tweak the logic of all of this, but
734  // for now just silently returning 0 seems to do the right thing.
735  return 0;
736  }
737 
738  // Now we should know this variable:
739  if( ( auxid >= m_branches.size() ) || ( ! m_branches[ auxid ] ) ) {
740  ::Fatal( "xAOD::TAuxStore::getIOData",
741  XAOD_MESSAGE( "Internal logic error detected" ) );
742  return 0;
743  }
744 
745  // Make sure that the right payload is in memory:
746  m_branches[ auxid ]->getEntry();
747 
748  // Return the pointer:
749  return m_branches[ auxid ]->objectPtr();
750  }

◆ getIOType()

const std::type_info * xAOD::TAuxStore::getIOType ( auxid_t  auxid) const
overridevirtual

Return the type of the data to be stored for one aux data item.

Implements SG::IAuxStoreIO.

Definition at line 752 of file TAuxStore.cxx.

752  {
753 
754  // Guard against multi-threaded execution:
755  guard_t guard( m_mutex1 );
756 
757  // If the variable is connected to already:
758  if( ( auxid < m_branches.size() ) && m_branches[ auxid ] ) {
759  return m_branches[ auxid ]->typeInfo();
760  }
761 
762  // Check if it's in the transient store:
763  if( m_transientStore && m_transientStore->getAuxIDs().test( auxid ) ) {
764  return m_transientStore->getIOType( auxid );
765  }
766 
767  // If not, try connecting to it now:
768  auto this_nc ATLAS_THREAD_SAFE = const_cast<TAuxStore*>(this); // locked above
769  if( ! this_nc->setupInputData( auxid ).isSuccess() ) {
770  ::Error( "xAOD::TAuxStore::getIOType",
771  XAOD_MESSAGE( "Couldn't connect to auxiliary variable "
772  "%i %s" ),
773  static_cast< int >( auxid ),
774  SG::AuxTypeRegistry::instance().getName( auxid ).c_str() );
775  return 0;
776  }
777 
778  // Now we should know this variable:
779  if( ( auxid >= m_branches.size() ) || ( ! m_branches[ auxid ] ) ) {
780  ::Fatal( "xAOD::TAuxStore::getIOType",
781  XAOD_MESSAGE( "Internal logic error detected" ) );
782  return 0;
783  }
784 
785  // Return the type info:
786  return m_branches[ auxid ]->typeInfo();
787  }

◆ getSelectedAuxIDs()

TAuxStore::auxid_set_t xAOD::TAuxStore::getSelectedAuxIDs ( ) const
overridevirtual

Get the IDs of the selected aux variables.

Reimplemented from SG::IAuxStoreIO.

Definition at line 805 of file TAuxStore.cxx.

805  {
806 
807  // Guard against multi-threaded execution:
808  guard_t guard( m_mutex1 );
809 
810  // Leave the calculation up to the internal object:
812  }

◆ getWritableAuxIDs()

const TAuxStore::auxid_set_t & xAOD::TAuxStore::getWritableAuxIDs ( ) const
overridevirtual

Return a set of writable data identifiers.

Implements SG::IAuxStore.

Definition at line 557 of file TAuxStore.cxx.

557  {
558 
559  return getAuxIDs();
560  }

◆ initStats()

StatusCode xAOD::TAuxStore::initStats ( ::TTree *  tree)
private

Function used for setting up the statistics info about the managed branches.

This function is used to initialise the statistics registry with information about the branches managed by this object.

It is used by TEvent when connecting to new input files/chains.

Parameters
treeThe tree to collect the information from
Returns
StatusCode::SUCCESS if the function was successful, something else otherwise

Definition at line 822 of file TAuxStore.cxx.

822  {
823 
824  // Connect the object to this input tree:
825  RETURN_CHECK( "initStats", readFrom( tree, kFALSE ) );
826 
827  // Conveninence variable:
828  ReadStats& stats = IOStats::instance().stats();
829 
830  // Teach the cache about all the branches:
831  size_t nbranch = 0;
832  for (SG::auxid_t id : m_auxIDs) {
833  stats.branch( m_prefix, id );
834  ++nbranch;
835  }
836 
837  // Increment the number of known branches:
838  stats.setBranchNum( stats.branchNum() + nbranch );
839 
840  // Return gracefully:
841  return StatusCode::SUCCESS;
842  }

◆ insertMove() [1/2]

bool xAOD::TAuxStore::insertMove ( size_t  pos,
IAuxStore &  other,
const SG::auxid_set_t ignore 
)
overridevirtual

Insert contents of another store via move.

Definition at line 651 of file TAuxStore.cxx.

654  {
655  // Guard against multi-threaded execution:
656  guard_t guard( m_mutex1 );
657 
658  // A sanity check:
659  if( m_structMode == kObjectStore ) {
660  ::Error( "xAOD::TAuxStore::insertMove",
661  XAOD_MESSAGE( "Should not have been called for single-object "
662  "store" ) );
663  return false;
664  }
665 
667  bool nomove = true;
668  size_t other_size = other.size();
669 
670  SG::auxid_set_t ignore = ignore_in;
671 
672  for (SG::auxid_t id : m_auxIDs) {
673  SG::IAuxTypeVector* v_dst = nullptr;
674  if (id < m_vecs.size())
675  v_dst = m_vecs[id];
676  if (v_dst) {
677  ignore.insert (id);
678  if (other.getData (id)) {
679  void* src_ptr = other.getData (id, other_size, other_size);
680  if (src_ptr) {
681  if (!v_dst->insertMove (pos, src_ptr,
682  reinterpret_cast<char*>(src_ptr) + other_size*r.getEltSize(id),
683  other))
684  nomove = false;
685  }
686  }
687  else {
688  const void* orig = v_dst->toPtr();
689  v_dst->shift (pos, other_size);
690  if (orig != v_dst->toPtr())
691  nomove = false;
692  }
693  }
694  }
695 
696  if( m_transientStore ) {
698  nomove = false;
699  }
700 
701  return nomove;
702  }

◆ insertMove() [2/2]

virtual bool SG::IAuxStore::insertMove ( size_t  pos,
IAuxStore other,
const SG::auxid_set_t ignore = SG::auxid_set_t() 
)
pure virtualinherited

Move all elements from other to this store.

Parameters
posThe starting index of the insertion.
otherStore from which to do the move.
ignoreSet of variables that should not be added to the store.

Let len be the size of other. The store will be increased in size by len elements, with the elements at pos being copied to pos+len. Then, for each auxiliary variable, the entire contents of that variable for other will be moved to this store at index pos. This will be done via move semantics if possible; otherwise, it will be done with a copy. Variables present in this store but not in other will have the corresponding elements default-initialized. Variables in other but not in this store will be added unless they are in ignore.

Returns true if it is known that none of the vectors' memory moved, false otherwise.

Implemented in SG::AuxStoreInternal.

◆ isAuxIDSelected()

Bool_t xAOD::TAuxStore::isAuxIDSelected ( auxid_t  auxid) const
private

Check if this auxiliary variable needs to go to the output.

This is a tricky one.

The function can't just rely on getSelectedAuxIDs, as the aux ID received here may be a new ID that the object doesn't yet know about. So we have no other choice but to check this ID explicitly.

@apram auxid The auxiliary ID that should be checked

Returns
kTRUE if the variable needs to be written out, kFALSE if not

Definition at line 1660 of file TAuxStore.cxx.

1660  {
1661 
1662  // A temporary object:
1663  auxid_set_t auxids; auxids.insert( auxid );
1664 
1665  // Check if the auxid is returned as a selected ID:
1666  return m_selection.getSelectedAuxIDs( auxids ).size();
1667  }

◆ isContainerBranch()

Bool_t xAOD::TAuxStore::isContainerBranch ( TBranch *  br,
auxid_t  auxid 
)
staticprivate

Check if a branch describes a container or a single object.

The code needs to know if a given branch describes a single object, or a container of objects.

This function decides about this.

In case the function encounters a problem it returns kFALSE, as that is more likely to cause a crash a little later...

The function should probably be a bit optimisied in the future, as it makes a lot of security checks at the moment.

Parameters
brThe branch whose type we're interested in
auxidThe auxiliary ID of the variable described by the branch
Returns
kTRUE if the branch describes a container, kFALSE if it describes a single object

Definition at line 1711 of file TAuxStore.cxx.

1711  {
1712 
1713  // For unknown types it doesn't matter if the branch describes a
1714  // container or a single element.
1715  if( ! isRegisteredType( auxid ) ) return kTRUE;
1716 
1717  // The variables needed for the check:
1718  ::TClass* cl = 0;
1719  ::EDataType dType = kOther_t;
1720 
1721  // Get the variable type from the branch:
1722  if( br->GetExpectedType( cl, dType ) ) {
1723  ::Error( "xAOD::TAuxStore::isContainerBranch",
1724  XAOD_MESSAGE( "Couldn't determine the type of branch "
1725  "\"%s\"" ), br->GetName() );
1726  return kFALSE;
1727  }
1728 
1729  // If there is no class associated with the branch then it should be
1730  // a branch describing a standalone object. (As it should be a
1731  // "primitive" branch in this case.)
1732  if( ! cl ) {
1733  return kFALSE;
1734  }
1735 
1736  // If there is a class, ask for the type_info of its type:
1737  const std::type_info* root_ti = cl->GetTypeInfo();
1738  if( ! root_ti ) {
1739  // This may be an emulated class. One known case is when the type name
1740  // is saved as "basic_string<char>" rather than "string" by Athena I/O.
1741  // (It's not fully understood why this happens for dynamic branches...)
1742  // So, let's see if we can get a functional TClass by massaging the
1743  // type name a bit.
1744  ::TString typeName( cl->GetName() );
1745  typeName.ReplaceAll( "basic_string<char>", "string" );
1746  ::TClass* newCl = ::TClass::GetClass( typeName );
1747  if( newCl ) {
1748  root_ti = newCl->GetTypeInfo();
1749  }
1750  }
1751  if( ! root_ti ) {
1752  ::Error( "xAOD::TAuxStore::isContainerBranch",
1753  XAOD_MESSAGE( "Couldn't get an std::type_info object out of "
1754  "branch \"%s\" of type \"%s\"" ),
1755  br->GetName(), cl->GetName() );
1756  return kFALSE;
1757  }
1758 
1759  // Ask for the auxiliary type infos:
1760  const std::type_info* aux_obj_ti =
1762  if( ! aux_obj_ti ) {
1763  ::Error( "xAOD::TAuxStore::isContainerBranch",
1764  XAOD_MESSAGE( "Couldn't get std::type_info object for "
1765  "auxiliary id: %i" ),
1766  static_cast< int >( auxid ) );
1767  return kFALSE;
1768  }
1769  const std::type_info* aux_vec_ti =
1771  if( ! aux_vec_ti ) {
1772  ::Error( "xAOD::TAuxStore::isContainerBranch",
1773  XAOD_MESSAGE( "Couldn't get std::type_info object for "
1774  "auxiliary id: %i" ),
1775  static_cast< int >( auxid ) );
1776  return kFALSE;
1777  }
1778 
1779  // Check which one the ROOT type info agrees with:
1780  if( *root_ti == *aux_obj_ti ) {
1781  // This branch describes a single object:
1782  return kFALSE;
1783  } else if( *root_ti == *aux_vec_ti ) {
1784  // This branch describes a container of objects:
1785  return kTRUE;
1786  }
1787 
1788  // For enum and vector<enum> types (PFO...) the type given by
1789  // the aux type registry is vector<int>. We have to take it into account
1790  // here...
1791  if( cl->GetCollectionProxy() &&
1792  ( *aux_vec_ti == typeid( std::vector< int > ) ) ) {
1793  return kTRUE;
1794  }
1795 
1796  TClass* cl2 = lookupVectorType (cl);
1797  if (cl2) {
1798  if (*cl2->GetTypeInfo() == *aux_vec_ti)
1799  return kTRUE;
1800  }
1801 
1802  // If we got this far, the branch may have undergone schema evolution. If
1803  // it's one that ROOT can deal with itself, then we should still be able
1804  // to read the branch with this code.
1805  //
1806  // Note that even after looking at the ROOT source code, I'm still not
1807  // 100% sure whether we would need to delete the objects returned by
1808  // TClass::GetConversionStreamerInfo(...) in this code. :-( But based on
1809  // general experience with the ROOT code, I'm going to say no...
1810  TClass* aux_vec_cl =
1811  TClass::GetClass( Utils::getTypeName( *aux_vec_ti ).c_str() );
1812  if( aux_vec_cl && aux_vec_cl->GetConversionStreamerInfo( cl, cl->GetClassVersion() ) ) {
1813  return kTRUE;
1814  }
1815  TClass* aux_obj_cl =
1816  TClass::GetClass( Utils::getTypeName( *aux_obj_ti ).c_str() );
1817  if( aux_obj_cl && aux_obj_cl->GetConversionStreamerInfo( cl, cl->GetClassVersion() ) ) {
1818  return kFALSE;
1819  }
1820 
1821  // If neither, then something went wrong...
1822  ::Error( "xAOD::TAuxStore::isContainerBranch",
1823  XAOD_MESSAGE( "Couldn't determine if branch describes a single "
1824  "object or a container" ) );
1825  ::Error( "xAOD::TAuxStore::isContainerBranch",
1826  XAOD_MESSAGE( "ROOT type : %s" ),
1827  Utils::getTypeName( *root_ti ).c_str() );
1828  ::Error( "xAOD::TAuxStore::isContainerBranch",
1829  XAOD_MESSAGE( "Object type: %s" ),
1830  Utils::getTypeName( *aux_obj_ti ).c_str() );
1831  ::Error( "xAOD::TAuxStore::isContainerBranch",
1832  XAOD_MESSAGE( "Vector type: %s" ),
1833  Utils::getTypeName( *aux_vec_ti ).c_str() );
1834  return kFALSE;
1835  }

◆ isDecoration()

bool xAOD::TAuxStore::isDecoration ( SG::auxid_t  auxid) const
overridevirtual

Test if a variable is a decoration.

Implements SG::IConstAuxStore.

Definition at line 399 of file TAuxStore.cxx.

400  {
401  if (m_locked) {
402  if (auxid < m_isDecoration.size() && m_isDecoration[auxid]) {
403  return true;
404  }
405  if (m_transientStore) {
406  return m_transientStore->isDecoration (auxid);
407  }
408  }
409  return false;
410  }

◆ isPrimitiveBranch()

Bool_t xAOD::TAuxStore::isPrimitiveBranch ( TBranch *  br)
staticprivate

Check if a branch holds a primitive variable or not.

The code needs to be fairly smart to figure out whether a branch is a primitive one, or an std::vector<T> one.

The check is done in this function.

Parameters
brThe branch that should be checked
Returns
kTRUE if the branch describes a primitive variable, kFALSE otherwise

Definition at line 1677 of file TAuxStore.cxx.

1677  {
1678 
1679  // The variables needed for the check:
1680  ::TClass* cl = 0;
1681  ::EDataType dType = kOther_t;
1682 
1683  // Get the variable type from the branch:
1684  if( br->GetExpectedType( cl, dType ) ) {
1685  ::Error( "xAOD::TAuxStore::isPrimitiveBranch",
1686  XAOD_MESSAGE( "Couldn't determine the type of branch "
1687  "\"%s\"" ), br->GetName() );
1688  return kFALSE;
1689  }
1690 
1691  // The check is made using the data type variable:
1692  return ( ( dType != kOther_t ) && ( dType != kNoType_t ) &&
1693  ( dType != kVoid_t ) );
1694  }

◆ isRegisteredType()

Bool_t xAOD::TAuxStore::isRegisteredType ( auxid_t  auxid)
staticprivate

Check if the auxiliary variable has a registered type.

This function is used to test if a given auxiliary variable is known in the registry with a proper type.

Returns
kTRUE if the full type of the auxiliary property is known, kFALSE otherwise

Definition at line 1843 of file TAuxStore.cxx.

1843  {
1844 
1845  // Cache some data:
1848  static const auxid_t sauxid =
1849  registry.getAuxID< SG::AuxTypePlaceholder >( "AuxTypePlaceholder" );
1850  static const std::type_info* const sti = registry.getVecType( sauxid );
1851 
1852  // Check if the types match:
1853  return ( *sti != *( registry.getVecType( auxid ) ) );
1854  }

◆ isTopStore()

Bool_t xAOD::TAuxStore::isTopStore ( ) const

Check if the object is a "top store", or not.

Definition at line 127 of file TAuxStore.cxx.

127  {
128 
129  return m_topStore;
130  }

◆ lock()

void xAOD::TAuxStore::lock ( )
overridevirtual

Lock the object, and don't let decorations be added.

Implements SG::IConstAuxStore.

Definition at line 413 of file TAuxStore.cxx.

413  {
414 
415  // Guard against multi-threaded execution:
416  guard_t guard( m_mutex1 );
417 
418  m_locked = true;
419  if( m_transientStore ) {
421  }
422 
423  return;
424  }

◆ lockDecoration()

void xAOD::TAuxStore::lockDecoration ( SG::auxid_t  auxid)
overridevirtual

Lock a decoration.

Implements SG::IConstAuxStore.

Definition at line 455 of file TAuxStore.cxx.

456  {
457  if( m_transientStore ) {
459  }
460  }

◆ prefix()

const char * xAOD::TAuxStore::prefix ( ) const

Get the currently configured branch name prefix.

Definition at line 114 of file TAuxStore.cxx.

114  {
115 
116  return m_prefix.c_str();
117  }

◆ readFrom()

StatusCode xAOD::TAuxStore::readFrom ( ::TTree *  tree,
::Bool_t  printWarnings = kTRUE 
)

Connect the object to an input TTree.

This function is called by the infrastructure to connect the object to an input TTree whenever a new input file is opened.

Parameters
treePointer to the TTree that is being read from

Definition at line 166 of file TAuxStore.cxx.

166  {
167 
168  // Make sure that everything will be re-read after this:
169  reset();
170 
171  // We will need to check again which branches are available:
172  m_missingBranches.clear();
173 
174  // Remember the tree:
175  m_inTree = tree;
176 
177  // Catalogue all the branches:
178  RETURN_CHECK( "xAOD::TAuxStore::readFrom", scanInputTree() );
179 
180  // Check if we'll be likely to be able to read the "static"
181  // variables:
182  assert( m_inTree != nullptr );
183  TBranch* br = m_inTree->GetBranch( m_prefix.c_str() );
184  if( ! br ) {
185  // We might not even have static branches, so this is not an error
186  // by itself...
187  return StatusCode::SUCCESS;
188  }
189  // In order to read complex objects, like smart pointers from an
190  // auxiliary container variable-by-variable, the split level of the
191  // branch must be exactly 1.
192  if( ( br->GetSplitLevel() != 1 ) && m_topStore && printWarnings ) {
193  ::Warning( "xAOD::TAuxStore::readFrom",
194  "Static branch (%s) with split level %i discovered",
195  m_prefix.c_str(), br->GetSplitLevel() );
196  ::Warning( "xAOD::TAuxStore::readFrom",
197  "The reading of complex variables from it may/will fail!" );
198  }
199 
200  return StatusCode::SUCCESS;
201  }

◆ reserve()

void xAOD::TAuxStore::reserve ( size_t  size)
overridevirtual

Reserve a given size for the arrays.

Implements SG::IAuxStore.

Definition at line 593 of file TAuxStore.cxx.

593  {
594 
595  // Guard against multi-threaded execution:
596  guard_t guard( m_mutex1 );
597 
598  // A sanity check:
599  if( ( m_structMode == kObjectStore ) && ( size != 1 ) ) {
600  ::Error( "xAOD::TAuxStore::reserve",
601  XAOD_MESSAGE( "size = %i for single-object store" ),
602  static_cast< int >( size ) );
603  return;
604  }
605 
608  for( ; itr != end; ++itr ) {
609  if( *itr ) ( *itr )->reserve( size );
610  }
611  if( m_transientStore ) {
613  }
614 
615  return;
616  }

◆ reset()

void xAOD::TAuxStore::reset ( )

Tell the object that all branches will need to be re-read.

Definition at line 271 of file TAuxStore.cxx.

271  {
272 
273  // Reset all the branches:
276  for( ; itr != end; ++itr ) {
277  if( *itr ) ( *itr )->reset();
278  }
279 
280  // Remember that the input TTree needs to be re-scanned:
281  m_inputScanned = kFALSE;
282 
283  return;
284  }

◆ resize()

bool xAOD::TAuxStore::resize ( size_t  size)
overridevirtual

Resize the arrays to a given size.

Implements SG::IAuxStore.

Definition at line 562 of file TAuxStore.cxx.

562  {
563 
564  // Guard against multi-threaded execution:
565  guard_t guard( m_mutex1 );
566 
567  // A sanity check:
568  if( ( m_structMode == kObjectStore ) && ( size != 1 ) ) {
569  ::Error( "xAOD::TAuxStore::resize",
570  XAOD_MESSAGE( "size = %i for single-object store" ),
571  static_cast< int >( size ) );
572  return false;
573  }
574 
575  // Remember the new size:
576  m_size = size;
577 
578  bool nomoves = true;
579  for (SG::IAuxTypeVector* v : m_vecs) {
580  if(v) {
581  if (!v->resize( size ))
582  nomoves = false;
583  }
584  }
585  if( m_transientStore ) {
586  if (!m_transientStore->resize( size ))
587  nomoves = false;
588  }
589 
590  return nomoves;
591  }

◆ scanInputTree()

StatusCode xAOD::TAuxStore::scanInputTree ( )
private

Scan the input TTree for auxiliary branches.

When writing an output tree, while reading information from an input tree, it can often happen that we want to copy the contents of some variables that we don't actually need during the event processing of this particular job.

Since the user doesn't ask for all the possible input variables, this function needs to look at the input TTree, and try to figure out which of the branches in the tree belong to this object.

The function creates a "proper" or "virtual" auxiliary ID for each of the branches found, so they can be referenced in the "usual way" in the other parts of the code later on.

Returns
kTRUE if the operation was successful, kFALSE if not

Definition at line 1353 of file TAuxStore.cxx.

1353  {
1354 
1355  // Check if an input tree is even available:
1356  if( ! m_inTree ) {
1357  // It's not an error if it isn't.
1358  return StatusCode::SUCCESS;
1359  }
1360 
1361  // Check if the input was already scanned:
1362  if( m_inputScanned ) {
1363  return StatusCode::SUCCESS;
1364  }
1365 
1366  // Get a list of all branches in the tree:
1367  TObjArray* branches = m_inTree->GetListOfBranches();
1368 
1369  // Check each of them:
1370  for( Int_t i = 0; i < branches->GetEntriesFast(); ++i ) {
1371 
1372  // The name of this top-level branch:
1373  const TString brName = branches->At( i )->GetName();
1374 
1375  // Access the branch pointer:
1376  TBranch* br = dynamic_cast< TBranch* >( branches->At( i ) );
1377  if( ! br ) {
1378  ::Fatal( "xAOD::TAuxStore::scanInputTree",
1379  XAOD_MESSAGE( "Logic error detected" ) );
1380  }
1381 
1382  // For top-level stores let's scan the static branches as well:
1383  if( m_topStore && ( brName == m_prefix ) ) {
1384 
1385  // Get a list of its sub-branches:
1386  TObjArray* sbranches = br->GetListOfBranches();
1387 
1388  // ...and then loop over them:
1389  for( Int_t j = 0; j < sbranches->GetEntriesFast(); ++j ) {
1390 
1391  // The name of the sub-branch:
1392  const TString brName = sbranches->At( j )->GetName();
1393 
1394  // Try to make a variable name out of the branch name:
1395  const TString auxName = brName( brName.Index( "." ) + 1,
1396  brName.Length() );
1397 
1398  // Skip this entry if it refers to a base class:
1399  if( auxName.BeginsWith( "xAOD::" ) ||
1400  auxName.BeginsWith( "SG::" ) ||
1401  ( auxName == "ILockable" ) ) {
1402  continue;
1403  }
1404 
1405  // The sub-branch:
1406  ::TBranch* sbr =
1407  dynamic_cast< ::TBranch* >( sbranches->At( j ) );
1408  if( ! sbr ) {
1409  ::Fatal( "xAOD::TAuxStore::scanInputTree",
1410  XAOD_MESSAGE( "Logic error detected" ) );
1411  }
1412 
1413  // Leave the rest up to the function that is shared with the
1414  // dynamic branches:
1415  RETURN_CHECK( "xAOD::TAuxStore::scanInputTree",
1416  setupAuxBranch( sbr, auxName, kTRUE ) );
1417  }
1418 
1419  // Don't check the rest of the loop's body:
1420  continue;
1421  }
1422 
1423  // Check if it has the right prefix to be a dynamic variable:
1424  if( ! brName.BeginsWith( m_dynPrefix ) ) {
1425  continue;
1426  }
1427  // It's possible to create dynamic variables with an empty name
1428  // as well. Which is a bug. Such variables are just ignored
1429  // for now.
1430  if( brName == m_dynPrefix ) {
1431  ::Warning( "xAOD::TAuxStore::scanInputTree",
1432  "Dynamic branch with empty name found on container: %s",
1433  m_prefix.c_str() );
1434  continue;
1435  }
1436 
1437  // The auxiliary property name:
1438  const TString auxName = brName( brName.Index( "." ) + 1,
1439  brName.Length() );
1440 
1441  // Leave the rest up to the function that is shared with the
1442  // dynamic branches:
1443  RETURN_CHECK( "xAOD::TAuxStore::scanInputTree",
1444  setupAuxBranch( br, auxName, kFALSE ) );
1445  }
1446 
1447  // Okay, the input was successfully scanned:
1448  m_inputScanned = kTRUE;
1449 
1450  // Return gracefully:
1451  return StatusCode::SUCCESS;
1452  }

◆ selectAux()

void xAOD::TAuxStore::selectAux ( const std::set< std::string > &  attributes)
virtual

Select dynamic auxiliary attributes for writing.

Definition at line 796 of file TAuxStore.cxx.

796  {
797 
798  // Guard against multi-threaded execution:
799  guard_t guard( m_mutex1 );
800 
802  return;
803  }

◆ setBasketSize()

void xAOD::TAuxStore::setBasketSize ( Int_t  value)

Set the size of the baskets created for the output branches.

Definition at line 144 of file TAuxStore.cxx.

144  {
145 
147  return;
148  }

◆ setOption()

virtual bool SG::IAuxStore::setOption ( auxid_t  ,
const AuxDataOption  
)
inlinevirtualinherited

Set an option for a given auxiliary variable.

Parameters
auxidThe identifier of the desired aux data item.
optionThe option to set.

The interpretation of the option depends on the particular representation of the variable.

Returns true if the option setting was successful; false otherwise.

Reimplemented in xAOD::AuxContainerBase, xAOD::AuxInfoBase, and SG::AuxStoreInternal.

Definition at line 176 of file IAuxStore.h.

177  { return false; }

◆ setPrefix()

void xAOD::TAuxStore::setPrefix ( const char prefix)

Set the branch name prefix.

Definition at line 119 of file TAuxStore.cxx.

119  {
120 
121  m_prefix = prefix;
123  reset();
124  return;
125  }

◆ setSplitLevel()

void xAOD::TAuxStore::setSplitLevel ( Int_t  value)

Set the split level of the output branches.

Definition at line 155 of file TAuxStore.cxx.

155  {
156 
158  return;
159  }

◆ setStructMode()

StatusCode xAOD::TAuxStore::setStructMode ( EStructMode  mode)

Set the structure mode of the object to a new value.

This function should be used with great care.

It makes it possible for the TEvent code to set the type of the object once the type is known. But user code should probably not fiddle with this function.

Parameters
modeThe structure mode to set
Returns
The usual StatusCode values

Definition at line 99 of file TAuxStore.cxx.

99  {
100 
101  // Only allow this on an uninitialised object:
102  if( m_branches.size() || ( m_structMode != kUndefinedStore ) ) {
103  ::Error( "xAOD::TAuxStore::setStructMode",
104  XAOD_MESSAGE( "Trying to change the structure mode of an "
105  "initialised object" ) );
106  return StatusCode::FAILURE;
107  }
108 
109  // Make the change:
110  m_structMode = mode;
111  return StatusCode::SUCCESS;
112  }

◆ setTopStore()

void xAOD::TAuxStore::setTopStore ( Bool_t  value = kTRUE)

Set whether the object should behave as a "top store" or not.

Definition at line 132 of file TAuxStore.cxx.

132  {
133 
134  m_topStore = value;
135  reset();
136  return;
137  }

◆ setupAuxBranch()

StatusCode xAOD::TAuxStore::setupAuxBranch ( ::TBranch *  br,
const char auxName,
::Bool_t  staticBranch 
)
private

Register one input branch as an available auxiliary variable.

This function takes care of assigning an auxiliary ID to a given branch.

It tries its best to find an auxiliary vector factory for the branch's type, but if it fails, it still falls back to using SG::AuxTypePlaceholder as the type. In which case of course only dumb copying will be possible for the given branch. (And no vector operations on the branch's payload until the variable of the branch is accessed explicitly.)

Parameters
brPointer to the branch under investigation
auxNameThe name of the auxiliary property, extracted from the branch's name
staticBranchkTRUE if this is a "static branch", and kFALSE if it's a dynamic one
Returns
kTRUE if successful, kFALSE if not

Definition at line 1469 of file TAuxStore.cxx.

1470  {
1471 
1472  // Get the branch's type:
1473  ::TClass* expectedClass = 0;
1474  ::EDataType expectedType = kOther_t;
1475  if( br->GetExpectedType( expectedClass, expectedType ) &&
1476  ( ( ! staticBranch ) || ( strncmp( auxName, "m_", 2 ) != 0 ) ) ) {
1477  ::Warning( "xAOD::TAuxStore::setupAuxBranch",
1478  "Couldn't get the type of branch \"%s\"",
1479  br->GetName() );
1480  }
1481 
1482  // Check for schema evolution:
1483  // If a branch has automatic schema evolution from one class to another,
1484  // then what we get from GetExpectedType will be the on-disk class.
1485  // What we have in memory is given by GetCurrentClass.
1486  if (expectedClass) {
1487  if (TBranchElement* bre = dynamic_cast<TBranchElement*> (br)) {
1488  TClass* newClass = bre->GetCurrentClass();
1489  if (newClass && newClass != expectedClass) {
1490  expectedClass = newClass;
1491  }
1492  }
1493  }
1494 
1495  // If this is a primitive variable, and we're still not sure whether this
1496  // is a store for an object or a container, the answer is given...
1497  if( ( ! expectedClass ) &&
1498  ( m_structMode == kUndefinedStore ) ) {
1500  }
1501 
1502  // Get the type_info of the branch:
1503  const std::type_info* ti = 0;
1504  if( m_structMode == kObjectStore ) {
1505  if( expectedClass ) {
1506  ti = expectedClass->GetTypeInfo();
1507  } else {
1508  ti = &( Utils::getTypeInfo( expectedType ) );
1509  }
1510  } else {
1511  if( ! expectedClass ) {
1512  if( ( ! staticBranch ) || ( strncmp( auxName, "m_", 2 ) != 0 ) ) {
1513  ::Warning( "xAOD::TAuxStore::setupAuxBranch",
1514  "Couldn't get the type of branch \"%s\"",
1515  br->GetName() );
1516  }
1517  } else {
1518  ::TVirtualCollectionProxy* prox =
1519  expectedClass->GetCollectionProxy();
1520 
1521  if (!prox) {
1522  TClass* cl2 = lookupVectorType (expectedClass);
1523  if (cl2)
1524  prox = cl2->GetCollectionProxy();
1525  }
1526 
1527  if( ! prox ) {
1528  if( ( ! staticBranch ) ||
1529  ( strncmp( auxName, "m_", 2 ) != 0 ) ) {
1530  ::Warning( "xAOD::TAuxStore::setupAuxBranch",
1531  "Couldn't get the type of branch \"%s\"",
1532  br->GetName() );
1533  }
1534  } else {
1535  if( prox->GetValueClass() ) {
1536  ti = prox->GetValueClass()->GetTypeInfo();
1537  } else {
1538  ti = &( Utils::getTypeInfo( prox->GetType() ) );
1539  }
1540  }
1541  }
1542  }
1543 
1544  // Get the registry:
1546 
1547  // Check if the registry already knows this variable name. If yes, let's
1548  // use the type known by the registry. To be able to deal with simple
1549  // schema evolution in dynamic branches.
1550  const auxid_t regAuxid = registry.findAuxID( auxName );
1551  if( regAuxid != SG::null_auxid ) {
1552  m_auxIDs.insert( regAuxid );
1553  return StatusCode::SUCCESS;
1554  }
1555 
1556  // If we didn't find a type_info for the branch, give up now...
1557  if( ! ti ) {
1558  return StatusCode::SUCCESS;
1559  }
1560 
1561  // Check for an auxiliary ID for this branch:
1562  auxid_t auxid = registry.getAuxID( *ti, auxName, "",
1564 
1565  // First try to find a compiled factory for the vector type:
1566  if( auxid == SG::null_auxid ) {
1567 
1568  // Construct the name of the factory's class:
1569  // But be careful --- if we don't exactly match the name
1570  // in TClassTable, then we may trigger autoparsing. Besides the
1571  // resource usage that implies, that can lead to crashes in dbg
1572  // builds due to cling bugs.
1573  std::string tn = Utils::getTypeName( *ti );
1574  if (tn.starts_with("std::vector<"))
1575  tn.erase (0, 5);
1576  std::string fac_class_name = "SG::AuxTypeVectorFactory<" +
1577  tn + ",allocator<" + tn;
1578  if( fac_class_name[ fac_class_name.size() - 1 ] == '>' ) {
1579  fac_class_name += ' ';
1580  }
1581  fac_class_name += "> >";
1582 
1583  // Look for the dictionary of this type:
1584  ::TClass* fac_class = TClass::GetClass( fac_class_name.c_str() );
1585  if( fac_class && fac_class->IsLoaded() ) {
1586  ::TClass* base_class =
1587  ::TClass::GetClass( "SG::IAuxTypeVectorFactory" );
1588  if( base_class && base_class->IsLoaded() ) {
1589  const Int_t offs = fac_class->GetBaseClassOffset( base_class );
1590  if( offs >= 0 ) {
1591  void* fac_vp = fac_class->New();
1592  if( fac_vp ) {
1593  unsigned long tmp =
1594  reinterpret_cast< unsigned long >( fac_vp ) + offs;
1596  reinterpret_cast< SG::IAuxTypeVectorFactory* >( tmp );
1597  registry.addFactory( *ti, *fac->tiAlloc(), std::unique_ptr<SG::IAuxTypeVectorFactory>( fac ) );
1598  auxid = registry.getAuxID( *ti, auxName, "",
1600  }
1601  }
1602  }
1603  }
1604  }
1605 
1606  // If that didn't succeed, let's assign a generic factory to this type:
1607  if( auxid == SG::null_auxid ) {
1608 
1609  // Construct the name of the vector type:
1610  std::string vec_class_name = "std::vector<" +
1611  Utils::getTypeName( *ti );
1612  if( vec_class_name[ vec_class_name.size() - 1 ] == '>' ) {
1613  vec_class_name += ' ';
1614  }
1615  vec_class_name += '>';
1616 
1617  // Get the dictionary for the type:
1618  ::TClass* vec_class = ::TClass::GetClass( vec_class_name.c_str() );
1619  if( vec_class && vec_class->IsLoaded() ) {
1620  auto fac = std::make_unique<TAuxVectorFactory>( vec_class );
1621  if (fac->tiAlloc()) {
1622  const std::type_info* tiAlloc = fac->tiAlloc();
1623  registry.addFactory( *ti, *tiAlloc, std::move( fac ) );
1624  }
1625  else {
1626  std::string tiAllocName = fac->tiAllocName();
1627  registry.addFactory( *ti, tiAllocName, std::move( fac ) );
1628  }
1629  auxid = registry.getAuxID( *ti, auxName, "",
1631  } else {
1632  ::Warning( "xAOD::TAuxStore::setupAuxBranch",
1633  "Couldn't find dictionary for type: %s",
1634  vec_class_name.c_str() );
1635  }
1636  }
1637 
1638  // Check if we succeeded:
1639  if( auxid == SG::null_auxid ) {
1640  ::Error( "xAOD::TAuxStore::setupAuxBranch",
1641  XAOD_MESSAGE( "Couldn't assign auxiliary ID to branch "
1642  "\"%s\"" ),
1643  br->GetName() );
1644  return StatusCode::FAILURE;
1645  }
1646 
1647  // Remember the auxiliary ID:
1648  m_auxIDs.insert( auxid );
1649  return StatusCode::SUCCESS;
1650  }

◆ setupInputData()

StatusCode xAOD::TAuxStore::setupInputData ( auxid_t  auxid)
private

Connect a variable to the input tree.

This internal function takes care of connecting to an individual (sub-)branch in the input file for a given auxiliary variable.

It needs to handle a number of different use cases, so it's a bit long.

Parameters
auxidThe ID of the variable to connect to
Returns
kTRUE if the operation was successful, kFALSE if not

Definition at line 852 of file TAuxStore.cxx.

852  {
853 
854  // Return right away if we already know that the branch is missing:
855  if( ( auxid < m_missingBranches.size() ) && m_missingBranches[ auxid ] ) {
856  return StatusCode::RECOVERABLE;
857  }
858 
859  // Make sure the internal storage is large enough:
860  if( m_vecs.size() <= auxid ) {
861  m_vecs.resize( auxid + 1 );
862  }
863  if( m_branches.size() <= auxid ) {
864  m_branches.resize( auxid + 1 );
865  }
866 
867  // Check if we need to do anything:
868  if( m_vecs[ auxid ] && m_branches[ auxid ] ) {
869  return StatusCode::SUCCESS;
870  }
871 
872  // A little sanity check:
873  if( ! m_inTree ) {
874  ::Error( "xAOD::TAuxStore::setupInputData",
875  XAOD_MESSAGE( "No input TTree set up!" ) );
876  return StatusCode::FAILURE;
877  }
878 
879  // Another sanity check:
880  if( m_vecs[ auxid ] || m_branches[ auxid ] ) {
881  ::Error( "xAOD::TAuxStore::setupInputData",
882  XAOD_MESSAGE( "The internal variables of the object got "
883  "messed up?!?" ) );
884  return StatusCode::FAILURE;
885  }
886 
887  // Get the property name:
888  const TString statBrName = m_prefix +
889  SG::AuxTypeRegistry::instance().getName( auxid ).c_str();
890  const TString dynBrName = m_dynPrefix +
891  SG::AuxTypeRegistry::instance().getName( auxid ).c_str();
892 
893  // Check if the branch exists:
894  Bool_t staticBranch = kTRUE;
895  TString brName = statBrName;
896 
897  TBranch* br = m_inTree->GetBranch( statBrName );
898  if( ! br ) {
899  br = m_inTree->GetBranch( dynBrName );
900  if( ! br ) {
901  // Since TTree::GetBranch / TTObjArray::FindObject is expensive,
902  // remember that we didn't find this branch in this file.
903  if( m_missingBranches.size() <= auxid ) {
904  m_missingBranches.resize( auxid + 1 );
905  }
906  m_missingBranches[ auxid ] = true;
907  // The branch doesn't exist, but this is not an error per se.
908  // The user may just be calling isAvailable(...) on the variable.
909  return StatusCode::RECOVERABLE;
910  }
911  // We have a dynamic branch:
912  staticBranch = kFALSE;
913  brName = dynBrName;
914  }
915 
916  // Check if it's a "primitive branch":
917  const Bool_t primitiveBranch = isPrimitiveBranch( br );
918  // Check if it's a "container branch":
919  const Bool_t containerBranch =
920  ( primitiveBranch ? kFALSE : isContainerBranch( br, auxid ) );
921 
922  // Set the structure mode if it has not been defined externally:
923  if( m_structMode == kUndefinedStore ) {
924  m_structMode = ( containerBranch ? kContainerStore : kObjectStore );
925  }
926 
927  // Check that the branch type makes sense:
928  if( ( containerBranch && ( m_structMode != kContainerStore ) ) ||
929  ( ( ! containerBranch ) && ( m_structMode != kObjectStore ) ) ) {
930  ::Error( "xAOD::TAuxStore::setupInputData",
931  XAOD_MESSAGE( "Branch type and requested structure mode "
932  "differ for branch: %s" ),
933  brName.Data() );
934  return StatusCode::FAILURE;
935  }
936 
937  // Check what variable it is:
938  ::TClass* clDummy = 0;
939  ::EDataType dType = kOther_t;
940  if( br->GetExpectedType( clDummy, dType ) ) {
941  ::Error( "xAOD::TAuxStore::setupInputData",
942  XAOD_MESSAGE( "Couldn't determine the type of branch "
943  "\"%s\"" ), brName.Data() );
944  return StatusCode::FAILURE;
945  }
946 
947  // Get the property type:
948  const std::type_info* brType = 0;
949  if( isRegisteredType( auxid ) ) {
950  // Get the type from the auxiliary type registry:
951  brType =
952  ( containerBranch ?
955  } else {
956  // Get the type from the input branch itself:
957  brType = ( clDummy ? clDummy->GetTypeInfo() :
958  &( Utils::getTypeInfo( dType ) ) );
959  }
960  if( ! brType ) {
961  ::Error( "xAOD::TAuxStore::setupInputData",
962  XAOD_MESSAGE( "Can't read/copy variable %s (%s)" ),
963  brName.Data(), clDummy->GetName() );
964  return StatusCode::RECOVERABLE;
965  }
966  const TString brTypeName = Utils::getTypeName( *brType ).c_str();
967 
968  // Check if we have the needed dictionary for an object branch:
969  ::TClass* brClass = 0;
970  if( ! primitiveBranch ) {
971  // Get the property's class:
972  brClass = ::TClass::GetClass( *brType, kTRUE, kTRUE );
973  if( ! brClass ) {
974  brClass = ::TClass::GetClass( brTypeName );
975  }
976  if( ! brClass ) {
977  ::Error( "xAOD::TAuxStore::setupInputData",
978  XAOD_MESSAGE( "No dictionary available for class \"%s\"" ),
979  brTypeName.Data() );
980  return StatusCode::FAILURE;
981  }
982  }
983 
984  // Create the smart object holding this vector:
985  if( isRegisteredType( auxid ) ) {
986  m_vecs[ auxid ] =
987  SG::AuxTypeRegistry::instance().makeVector( auxid, (size_t)0, (size_t)0 ).release();
988  if( ! containerBranch ) {
989  m_vecs[ auxid ]->resize( 1 );
990  }
991  if (clDummy && strncmp (clDummy->GetName(), "SG::PackedContainer<", 20) == 0) {
992  SG::IAuxTypeVector* packed = m_vecs[ auxid ]->toPacked().release();
993  std::swap (m_vecs[ auxid ], packed);
994  delete packed;
995  }
996  } else {
997  ::Error( "xAOD::TAuxStore::setupInputData",
998  XAOD_MESSAGE( "Couldn't create in-memory vector for "
999  "variable %s (%i)" ),
1000  brName.Data(),
1001  static_cast< int >( auxid ) );
1002  return StatusCode::FAILURE;
1003  }
1004 
1005  // Create a new branch handle:
1006  const std::type_info* objType = brType;
1007  if (containerBranch) {
1008  objType = m_vecs[ auxid ]->objType();
1009  if (!objType)
1010  objType = SG::AuxTypeRegistry::instance().getType( auxid );
1011  }
1012  m_branches[ auxid ] = new TBranchHandle( staticBranch, primitiveBranch,
1013  objType,
1014  ( containerBranch ?
1015  m_vecs[ auxid ]->toVector() :
1016  m_vecs[ auxid ]->toPtr() ),
1017  auxid, &m_prefix );
1018 
1019  // Set the tree/branch in the "right mode":
1020  if( staticBranch ) {
1021  br->SetMakeClass();
1022  }
1023 
1024  // Connect to the branch:
1025  ::Int_t status = 0;
1026  if( clDummy &&
1027  ::TString( clDummy->GetName() ).Contains( "basic_string<char>" ) ) {
1028  // This is pretty much just a hack. As it happens, Athena I/O can
1029  // create dynamic branches that consider themselves to be of type
1030  // "vector<basic_string<char> >" and similar. (Instead of the
1031  // canonical "vector<string>" name.) When we encounter such a branch,
1032  // we just connect to it without performing any compatibility checks.
1033  // Since we don't need to apply any read rules in this case anyway.
1034  status =
1035  m_inTree->SetBranchAddress( brName,
1036  m_branches[ auxid ]->inputObjectPtr(),
1037  m_branches[ auxid ]->branchPtr() );
1038  } else {
1039  status =
1040  m_inTree->SetBranchAddress( brName,
1041  m_branches[ auxid ]->inputObjectPtr(),
1042  m_branches[ auxid ]->branchPtr(),
1043  brClass, dType,
1044  ( ( ! staticBranch ) &&
1045  ( ! primitiveBranch ) ) );
1046  }
1047  if( status < 0 ) {
1048  ::Error( "xAOD::TAuxStore::setupInputData",
1049  XAOD_MESSAGE( "Coulnd't connect to branch \"%s\"" ),
1050  brName.Data() );
1051  ::Error( "xAOD::TAuxStore::setupInputData",
1052  XAOD_MESSAGE( "Return code: %i" ), status );
1053  delete m_vecs[ auxid ];
1054  m_vecs[ auxid ] = 0;
1055  delete m_branches[ auxid ];
1056  m_branches[ auxid ] = 0;
1057  return StatusCode::FAILURE;
1058  }
1059 
1060  // Get the current entry:
1061  m_branches[ auxid ]->getEntry();
1062 
1063  // Remember which variable got created:
1064  m_auxIDs.insert( auxid );
1065 
1066  // Check if we just replaced a generic object:
1067  if( isRegisteredType( auxid ) ) {
1068  // The name of the variable we just created:
1069  const std::string auxname =
1071  // Check if there's another variable with this name already:
1072  for( auxid_t i = 0; i < m_vecs.size(); ++i ) {
1073  // Check if we have this aux ID:
1074  if( ! m_vecs[ i ] ) continue;
1075  // Ingore the object that we *just* created:
1076  if( i == auxid ) continue;
1077  // The name of the variable:
1078  const std::string testname =
1080  // Check if it has the same name:
1081  if( testname != auxname ) continue;
1082  // Check that the other one is a non-registered type:
1083  if( isRegisteredType( i ) ) {
1084  ::Error( "xAOD::TAuxStore::setupInputData",
1085  XAOD_MESSAGE( "Internal logic error!" ) );
1086  continue;
1087  }
1088  // Okay, we do need to remove this object:
1089  delete m_vecs[ i ]; delete m_branches[ i ];
1090  m_vecs[ i ] = 0; m_branches[ i ] = 0;
1091  m_auxIDs.erase( i );
1092  }
1093  }
1094 
1095  // Return gracefully:
1096  return StatusCode::SUCCESS;
1097  }

◆ setupOutputData()

StatusCode xAOD::TAuxStore::setupOutputData ( auxid_t  auxid)
private

Connect a variable to the output tree.

This function is used internally to create a "simple" output branch with the contents of a single auxiliary variable.

Parameters
auxidThe ID of the variable to create an output branch for
Returns
kTRUE if the operation was successful, kFALSE if not

Definition at line 1106 of file TAuxStore.cxx.

1106  {
1107 
1108  // Check whether we need to do anything:
1109  if( ! m_outTree ) return StatusCode::SUCCESS;
1110 
1111  // Check if the variable needs to be written out:
1112  if( ! isAuxIDSelected( auxid ) ) return StatusCode::SUCCESS;
1113 
1114  // Make sure that containers are large enough:
1115  if( m_vecs.size() <= auxid ) {
1116  m_vecs.resize( auxid + 1 );
1117  }
1118  if( m_branches.size() <= auxid ) {
1119  m_branches.resize( auxid + 1 );
1120  }
1121  if( m_branchesWritten.size() <= auxid ) {
1122  m_branchesWritten.resize( auxid + 1 );
1123  }
1124 
1125  // Check if this auxiliary variable is already in the output:
1126  if( m_branchesWritten[ auxid ] ) return StatusCode::SUCCESS;
1127 
1128  // Check if the variable was put into the transient store as a
1129  // decoration, and now needs to be put into the output file:
1130  if( ( ! m_vecs[ auxid ] ) && m_transientStore &&
1131  ( m_transientStore->getAuxIDs().test( auxid ) ) ) {
1132 
1133  // Get the variable from the transient store:
1134  const void* pptr = m_transientStore->getData( auxid );
1135  if( ! pptr ) {
1136  ::Fatal( "xAOD::TAuxStore::setupOutputData",
1137  XAOD_MESSAGE( "Internal logic error detected" ) );
1138  return StatusCode::FAILURE;
1139  }
1140 
1141  // The registry:
1143 
1144  // Create the new object:
1145  m_vecs[ auxid ] = reg.makeVector( auxid, m_size, m_size ).release();
1146  void* ptr = m_vecs[ auxid ]->toPtr();
1147  if( ! ptr ) {
1148  ::Error( "xAOD::TAuxStore::setupOutputData",
1149  XAOD_MESSAGE( "Couldn't create decoration in memory "
1150  "for writing" ) );
1151  return StatusCode::FAILURE;
1152  }
1153 
1154  // Get the type of this variable:
1155  const std::type_info* type = reg.getType( auxid );
1156  if( ! type ) {
1157  ::Error( "xAOD::TAuxStore::setupOutputData",
1158  XAOD_MESSAGE( "Couldn't get the type of transient "
1159  "variable %i" ),
1160  static_cast< int >( auxid ) );
1161  return StatusCode::FAILURE;
1162  }
1163  // Now get the factory for this variable:
1164  const SG::IAuxTypeVectorFactory* factory =
1165  reg.getFactory( auxid );
1166  if( ! factory ) {
1167  ::Error( "xAOD::TAuxStore::setupOutputData",
1168  XAOD_MESSAGE( "No factory found for transient variable "
1169  "%i" ), static_cast< int >( auxid ) );
1170  return StatusCode::FAILURE;
1171  }
1172 
1173  // Finally, do the copy:
1174  factory->copy( auxid,
1175  SG::AuxVectorInterface( *this ), 0,
1177  m_size );
1178 
1179  // And now remember that this is a decoration:
1180  if( m_isDecoration.size() <= auxid ) {
1181  m_isDecoration.resize( auxid + 1 );
1182  }
1183  m_isDecoration[ auxid ] = ::kTRUE;
1184  }
1185 
1186  // Check if we know about this variable to be on the input,
1187  // but haven't connected to it yet:
1188  if( ( m_auxIDs.test( auxid ) ) &&
1189  ( ! m_vecs[ auxid ] ) && ( ! m_branches[ auxid ] ) ) {
1190  RETURN_CHECK( "xAOD::TAuxStore::setupOutputData",
1191  setupInputData( auxid ) );
1192  }
1193 
1194  // Check that we know the store's type:
1195  if( ( m_structMode != kContainerStore ) &&
1196  ( m_structMode != kObjectStore ) ) {
1197  ::Error( "xAOD::TAuxStore::setupOutputData",
1198  XAOD_MESSAGE( "Structure mode unknown for variable %s" ),
1199  SG::AuxTypeRegistry::instance().getName( auxid ).c_str() );
1200  return StatusCode::FAILURE;
1201  }
1202 
1203  // Check if the variable exists already in memory:
1204  if( ! m_vecs[ auxid ] ) {
1205  m_vecs[ auxid ] =
1206  SG::AuxTypeRegistry::instance().makeVector( auxid, (size_t)0, (size_t)0 ).release();
1207  if( m_structMode == kObjectStore ) {
1208  m_vecs[ auxid ]->resize( 1 );
1209  }
1210  }
1211 
1212  // Check if the branch handle exists already:
1213  if( ! m_branches[ auxid ] ) {
1214  // Get the property type:
1215  const std::type_info* brType =
1219  // Create the handle object:
1220  bool primitiveBranch = (strlen( brType->name() ) == 1);
1221  m_branches[ auxid ] =
1222  new TBranchHandle( kFALSE, ( strlen( brType->name() ) == 1 ),
1223  (primitiveBranch ?
1224  brType :
1225  m_vecs[ auxid ]->objType() ),
1226  ( m_structMode == kObjectStore ?
1227  m_vecs[ auxid ]->toPtr() :
1228  m_vecs[ auxid ]->toVector() ),
1229  auxid, &m_prefix );
1230  }
1231 
1232  // Construct a name for the branch:
1233  const TString brName =
1235 
1236  // If the output branch exists already, assume that it was us making
1237  // it:
1238  ::TBranch* br = m_outTree->GetBranch( brName );
1239  if( br ) {
1240  // Apparently a branch that was already set up for copying as a basic
1241  // variable, now got accessed explicitly. So let's update the output
1242  // branch to point to this new location now.
1243  br->SetAddress( m_branches[ auxid ]->outputObjectPtr() );
1244  // Update the cache. Notice that the "write status" of the typeless
1245  // auxiliary ID is not turned off. But it shouldn't matter, as the
1246  // variable will not be accessed in a typeless way anymore.
1247  m_branchesWritten[ auxid ] = true;
1248  // Return gracefully:
1249  return StatusCode::SUCCESS;
1250  }
1251 
1252  // Check that we know the type of the branch:
1253  const std::type_info* brType = m_branches[ auxid ]->typeInfo();
1254  if( ! brType ) {
1255  ::Error( "xAOD::TAuxStore::setupOutputData",
1256  XAOD_MESSAGE( "There's an internal logic error in the "
1257  "code" ) );
1258  return StatusCode::FAILURE;
1259  }
1260  const std::string brTypeName = Utils::getTypeName( *brType );
1261 
1262  // Decide if this is a primitive branch:
1263  const Bool_t primitiveBranch = ( strlen( brType->name() ) == 1 );
1264 
1265  // Let's create the branch now:
1266  if( primitiveBranch ) {
1267 
1268  // Get the "ROOT type" belonging to this primitive:
1269  const char rootType = Utils::rootType( brType->name()[ 0 ] );
1270  if( rootType == '\0' ) {
1271  ::Error( "xAOD::TAuxStore::setupOutputData",
1272  XAOD_MESSAGE( "Type not known for variable \"%s\" "
1273  "of type \"%s\"" ),
1274  brName.Data(), brTypeName.c_str() );
1275  return StatusCode::FAILURE;
1276  }
1277 
1278  // Construct the type description:
1279  std::ostringstream typeDesc;
1280  typeDesc << brName << "/" << rootType;
1281 
1282  // Create the branch:
1283  br = m_outTree->Branch( brName,
1284  m_branches[ auxid ]->outputObjectPtr(),
1285  typeDesc.str().c_str(), m_basketSize );
1286 
1287  } else {
1288 
1289  // Access the dictionary for the type:
1290  TClass* cl = TClass::GetClass( *brType );
1291  if( ! cl ) {
1292  cl = TClass::GetClass( brTypeName.c_str() );
1293  }
1294  if( ! cl ) {
1295  ::Error( "xAOD::TAuxStore::setupOutputData",
1296  XAOD_MESSAGE( "Couldn't find dictionary for type: %s" ),
1297  brTypeName.c_str() );
1298  return StatusCode::FAILURE;
1299  }
1300  if( ! cl->GetStreamerInfo() ) {
1301  ::Error( "xAOD::TAuxStore::setupOutputData",
1302  XAOD_MESSAGE( "No streamer info available for type %s" ),
1303  cl->GetName() );
1304  return StatusCode::FAILURE;
1305  }
1306 
1307  // Create the branch:
1308  br = m_outTree->Branch( brName, cl->GetName(),
1309  m_branches[ auxid ]->outputObjectPtr(),
1311  }
1312 
1313  // Check if we succeeded:
1314  if( ! br ) {
1315  ::Error( "xAOD::TAuxStore::setupOutputData",
1316  XAOD_MESSAGE( "Failed creating branch \"%s\" of type "
1317  "\"%s\"" ),
1318  brName.Data(), brTypeName.c_str() );
1319  return StatusCode::FAILURE;
1320  }
1321 
1322  // If this is not the first event, fill up the branch with dummy
1323  // info:
1324  for( Long64_t i = 0; i < m_outTree->GetEntries(); ++i ) {
1325  br->Fill();
1326  }
1327 
1328  // Update the cache:
1329  m_branchesWritten[ auxid ] = true;
1330 
1331  // Also, remember that we now handle this variable:
1332  m_auxIDs.insert( auxid );
1333 
1334  // We were successful:
1335  return StatusCode::SUCCESS;
1336  }

◆ shift()

void xAOD::TAuxStore::shift ( size_t  pos,
ptrdiff_t  offs 
)
overridevirtual

Shift the contents of the stored arrays.

Implements SG::IAuxStore.

Definition at line 618 of file TAuxStore.cxx.

618  {
619 
620  // Guard against multi-threaded execution:
621  guard_t guard( m_mutex1 );
622 
623  // A sanity check:
624  if( m_structMode == kObjectStore ) {
625  ::Error( "xAOD::TAuxStore::shift",
626  XAOD_MESSAGE( "Should not have been called for single-object "
627  "store" ) );
628  return;
629  }
630 
631  // Adjust the size of the container:
632  if( ( static_cast< std::size_t >( std::abs( offs ) ) > m_size ) &&
633  ( offs < 0 ) ) {
634  m_size = 0;
635  } else {
636  m_size += offs;
637  }
638 
641  for( ; itr != end; ++itr ) {
642  if( *itr ) ( *itr )->shift( pos, offs );
643  }
644  if( m_transientStore ) {
645  m_transientStore->shift( pos, offs );
646  }
647 
648  return;
649  }

◆ size()

size_t xAOD::TAuxStore::size ( ) const
overridevirtual

Return the number of elements in the store.

Implements SG::IConstAuxStore.

Definition at line 463 of file TAuxStore.cxx.

463  {
464 
465  // First, try to find a managed vector in the store:
466  for( SG::auxid_t id : m_auxIDs) {
467  // Make sure that we are still within the bounds of our vector:
468  if( id >= m_vecs.size() ) break;
469  // Skip non-existent objects:
470  if( ! m_vecs[ id ] ) continue;
471  // Ask the vector for its size:
472  const size_t size = m_vecs[ id ]->size();
473  // Only accept a non-zero size. Not sure why...
474  if( size > 0 ) {
475  return size;
476  }
477  }
478 
479  // Check if we have a transient store, and get the size from that:
480  if( m_transientStore ) {
481  return m_transientStore->size();
482  }
483 
484  // Apparently the store is empty:
485  return 0;
486  }

◆ splitLevel()

Int_t xAOD::TAuxStore::splitLevel ( ) const

Get the split level of the output branches.

Definition at line 150 of file TAuxStore.cxx.

150  {
151 
152  return m_splitLevel;
153  }

◆ structMode()

TAuxStore::EStructMode xAOD::TAuxStore::structMode ( ) const

Get what structure mode the object was constructed with.

Definition at line 87 of file TAuxStore.cxx.

87  {
88 
89  return m_structMode;
90  }

◆ writeTo()

StatusCode xAOD::TAuxStore::writeTo ( ::TTree *  tree)

Connect the object to an output TTree.

This function is called by the infrastructure to connect the object to an output TTree.

Parameters
treePointer to the TTree that is being written to

Definition at line 208 of file TAuxStore.cxx.

208  {
209 
210  // Look for any auxiliary branches that have not been connected to yet:
211  RETURN_CHECK( "xAOD::TAuxStore::writeTo", scanInputTree() );
212 
213  // Store the TTree pointer:
214  m_outTree = tree;
215 
216  // Create all the variables that we already know about. Notice that the
217  // code makes a copy of the auxid set on purpose. Because the underlying
218  // AuxSelection object gets modified while doing the for loop.
219  const auxid_set_t selAuxIDs = getSelectedAuxIDs();
220  for (SG::auxid_t id : selAuxIDs) {
221  RETURN_CHECK( "xAOD::TAuxStore::writeTo", setupOutputData( id ) );
222  }
223 
224  return StatusCode::SUCCESS;
225  }

Friends And Related Function Documentation

◆ TEvent

friend class TEvent
friend

Make TEvent a friend of this class.

Definition at line 49 of file TAuxStore.h.

Member Data Documentation

◆ m_auxIDs

auxid_set_t xAOD::TAuxStore::m_auxIDs
private

Internal list of variable IDs handled currently by the object.

Definition at line 230 of file TAuxStore.h.

◆ m_basketSize

::Int_t xAOD::TAuxStore::m_basketSize
private

The basket size for the output branches.

Definition at line 212 of file TAuxStore.h.

◆ m_branches

std::vector< TBranchHandle* > xAOD::TAuxStore::m_branches
private

Branches reading the various auxiliary variables.

Definition at line 299 of file TAuxStore.h.

◆ m_branchesWritten

std::vector< bool > xAOD::TAuxStore::m_branchesWritten
private

"Write status" of the different variables

Definition at line 301 of file TAuxStore.h.

◆ m_dynPrefix

std::string xAOD::TAuxStore::m_dynPrefix
private

Dynamic prefix for the branch names.

Definition at line 204 of file TAuxStore.h.

◆ m_inputScanned

::Bool_t xAOD::TAuxStore::m_inputScanned
private

"Scan status" of the input TTree

Definition at line 222 of file TAuxStore.h.

◆ m_inTree

::TTree* xAOD::TAuxStore::m_inTree
private

The TTree being read from.

Definition at line 217 of file TAuxStore.h.

◆ m_isDecoration

std::vector< ::Bool_t > xAOD::TAuxStore::m_isDecoration
private

Flags items as decorations.

Definition at line 239 of file TAuxStore.h.

◆ m_locked

::Bool_t xAOD::TAuxStore::m_locked
private

Is this container locked?

Definition at line 237 of file TAuxStore.h.

◆ m_missingBranches

std::vector< bool > xAOD::TAuxStore::m_missingBranches
private

Mark branches we've found to be missing.

(Because TTree::GetBranch is very expensive.)

Definition at line 304 of file TAuxStore.h.

◆ m_mutex1

mutex_t xAOD::TAuxStore::m_mutex1
mutableprivate

Mutexes object used for multithreaded synchronisation.

Definition at line 246 of file TAuxStore.h.

◆ m_mutex2

mutex_t xAOD::TAuxStore::m_mutex2
private

Definition at line 246 of file TAuxStore.h.

◆ m_outTree

::TTree* xAOD::TAuxStore::m_outTree
private

The TTree being written to.

Definition at line 219 of file TAuxStore.h.

◆ m_prefix

std::string xAOD::TAuxStore::m_prefix
private

Static prefix for the branch names.

Definition at line 202 of file TAuxStore.h.

◆ m_selection

AuxSelection xAOD::TAuxStore::m_selection
private

Object helping to select which auxiliary variables to write.

Definition at line 225 of file TAuxStore.h.

◆ m_size

std::size_t xAOD::TAuxStore::m_size
private

The current size of the container being described.

Definition at line 234 of file TAuxStore.h.

◆ m_splitLevel

::Int_t xAOD::TAuxStore::m_splitLevel
private

The split level for the output branches.

Definition at line 214 of file TAuxStore.h.

◆ m_structMode

EStructMode xAOD::TAuxStore::m_structMode
private

The "structural" mode of the object.

Definition at line 210 of file TAuxStore.h.

◆ m_topStore

::Bool_t xAOD::TAuxStore::m_topStore
private

Flag stating whether this is a "top store".

Definition at line 207 of file TAuxStore.h.

◆ m_transientStore

SG::AuxStoreInternal* xAOD::TAuxStore::m_transientStore
private

Store for the in-memory-only variables.

Definition at line 227 of file TAuxStore.h.

◆ m_vecs

std::vector< SG::IAuxTypeVector* > xAOD::TAuxStore::m_vecs
private

Variables handled currently by the object.

Definition at line 232 of file TAuxStore.h.

◆ supportsThinning

constexpr bool SG::IAuxStore::supportsThinning = true
staticconstexprinherited

Mark that this type supports thinning operations.

See AthContainers/supportsThinning.h and AthenaPoolCnvSvc/T_AthenaPoolCnv.h. Helps guide which pool converter template will be used. If false, the default pool converter will be used rather than the aux store-specific one. Ordinary xAOD type should not touch this, but may be overridden in a derived class to handle certain special cases.

Definition at line 189 of file IAuxStore.h.


The documentation for this class was generated from the following files:
SG::AuxStoreInternal::reserve
virtual void reserve(size_t sz) override
Change the capacity of all aux data vectors.
Definition: AuxStoreInternal.cxx:239
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
python.Dso.registry
registry
Definition: Control/AthenaServices/python/Dso.py:159
SG::IAuxTypeVector::shift
virtual bool shift(size_t pos, ptrdiff_t offs)=0
Shift the elements of the vector.
beamspotman.r
def r
Definition: beamspotman.py:676
xAOD::TAuxStore::m_missingBranches
std::vector< bool > m_missingBranches
Mark branches we've found to be missing.
Definition: TAuxStore.h:304
xAOD::TAuxStore::getSelectedAuxIDs
virtual auxid_set_t getSelectedAuxIDs() const override
Get the IDs of the selected aux variables.
Definition: TAuxStore.cxx:805
RETURN_CHECK
#define RETURN_CHECK(CONTEXT, EXP)
Helper macro for checking return codes in a compact form in the code.
Definition: ReturnCheck.h:26
xAOD::TAuxStore::getAuxIDs
virtual const auxid_set_t & getAuxIDs() const override
Get the types(names) of variables handled by this container.
Definition: TAuxStore.cxx:321
xAOD::TAuxStore::basketSize
Int_t basketSize() const
Get the size of the baskets created for the output branches.
Definition: TAuxStore.cxx:139
checkxAOD.brName
brName
Definition: Tools/PyUtils/bin/checkxAOD.py:113
get_generator_info.result
result
Definition: get_generator_info.py:21
xAOD::TAuxStore::readFrom
StatusCode readFrom(::TTree *tree, ::Bool_t printWarnings=kTRUE)
Connect the object to an input TTree.
Definition: TAuxStore.cxx:166
SG::AuxStoreInternal::getDecoration
virtual void * getDecoration(auxid_t auxid, size_t size, size_t capacity) override
Return the data vector for one aux data decoration item.
Definition: AuxStoreInternal.cxx:180
SG::SkipNameCheck
@ SkipNameCheck
Definition: AuxTypes.h:74
xAOD::IOStats::stats
ReadStats & stats()
Access the object belonging to the current thread.
Definition: IOStats.cxx:17
SG::AuxStoreInternal::getData
virtual const void * getData(SG::auxid_t auxid) const override
Return the data vector for one aux data item.
Definition: AuxStoreInternal.cxx:83
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition: AuxTypeRegistry.cxx:49
xAOD::TAuxStore::m_isDecoration
std::vector< ::Bool_t > m_isDecoration
Flags items as decorations.
Definition: TAuxStore.h:239
xAOD::TAuxStore::m_prefix
std::string m_prefix
Static prefix for the branch names.
Definition: TAuxStore.h:202
xAOD::TAuxStore::auxid_set_t
SG::auxid_set_t auxid_set_t
Convenience type declaration.
Definition: TAuxStore.h:61
SG::AuxTypeRegistry::getName
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
Definition: AuxTypeRegistry.cxx:262
SG::ExcStoreLocked
Exception — Attempted to modify auxiliary data in a locked store.
Definition: Control/AthContainers/AthContainers/exceptions.h:183
tree
TChain * tree
Definition: tile_monitor.h:30
xAOD::TAuxStore::m_splitLevel
::Int_t m_splitLevel
The split level for the output branches.
Definition: TAuxStore.h:214
xAOD::TAuxStore::m_auxIDs
auxid_set_t m_auxIDs
Internal list of variable IDs handled currently by the object.
Definition: TAuxStore.h:230
xAOD::other
@ other
Definition: TrackingPrimitives.h:509
athena.value
value
Definition: athena.py:122
XAOD_MESSAGE
#define XAOD_MESSAGE(MESSAGE)
Simple macro for printing error/verbose messages.
Definition: Control/xAODRootAccess/xAODRootAccess/tools/Message.h:19
atn_test_sgProducerConsumerDataPool_jobOptions.end
end
Definition: atn_test_sgProducerConsumerDataPool_jobOptions.py:25
xAOD::TAuxStore::m_basketSize
::Int_t m_basketSize
The basket size for the output branches.
Definition: TAuxStore.h:212
trigbs_dumpHLTContentInBS.stats
stats
Definition: trigbs_dumpHLTContentInBS.py:91
xAOD::TAuxStore::m_locked
::Bool_t m_locked
Is this container locked?
Definition: TAuxStore.h:237
python.DomainsRegistry.reg
reg
globals -----------------------------------------------------------------—
Definition: DomainsRegistry.py:343
xAOD::TAuxStore::scanInputTree
StatusCode scanInputTree()
Scan the input TTree for auxiliary branches.
Definition: TAuxStore.cxx:1353
SG::IAuxStoreIO
Interface providing I/O for a generic auxiliary store.
Definition: IAuxStoreIO.h:44
xAOD::Utils::dynBranchPrefix
std::string dynBranchPrefix(const std::string &key)
This function is used to figure out what to name dynamic auxiliary branches coming from a container c...
Definition: Control/xAODRootAccess/Root/Utils.cxx:144
SG::AuxStoreInternal::getAuxIDs
virtual const SG::auxid_set_t & getAuxIDs() const override
Return a set of identifiers for existing data items in this store.
Definition: AuxStoreInternal.cxx:370
SG::AuxTypeRegistry
Handle mappings between names and auxid_t.
Definition: AuxTypeRegistry.h:62
xAOD::TAuxStore::m_inTree
::TTree * m_inTree
The TTree being read from.
Definition: TAuxStore.h:217
xAOD::TAuxStore::m_dynPrefix
std::string m_dynPrefix
Dynamic prefix for the branch names.
Definition: TAuxStore.h:204
xAOD::TAuxStore::guard_t
AthContainers_detail::lock_guard< mutex_t > guard_t
Guard type for multithreaded synchronisation.
Definition: TAuxStore.h:244
xAOD::TAuxStore::reset
void reset()
Tell the object that all branches will need to be re-read.
Definition: TAuxStore.cxx:271
runLayerRecalibration.branches
list branches
Definition: runLayerRecalibration.py:98
DiTauMassTools::ignore
void ignore(T &&)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:54
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::AuxTypeRegistry::getType
const std::type_info * getType(SG::auxid_t auxid) const
Return the type of an aux data item.
Definition: AuxTypeRegistry.cxx:287
H5Utils::internal::packed
H5::CompType packed(H5::CompType in)
Definition: common.cxx:16
CxxUtils::ConcurrentBitset::size
bit_t size() const
Count the number of 1 bits in the set.
xAOD::TAuxStore::m_outTree
::TTree * m_outTree
The TTree being written to.
Definition: TAuxStore.h:219
xAOD::TAuxStore::isRegisteredType
::Bool_t isRegisteredType(auxid_t auxid)
Check if the auxiliary variable has a registered type.
Definition: TAuxStore.cxx:1843
xAOD::Utils::getTypeName
std::string getTypeName(const std::type_info &ti)
This function is necessary in order to create type names that ROOT can understand.
Definition: Control/xAODRootAccess/Root/Utils.cxx:285
lumiFormat.i
int i
Definition: lumiFormat.py:92
CxxUtils::ConcurrentBitset::insert
ConcurrentBitset & insert(bit_t bit, bit_t new_nbits=0)
Set a bit to 1.
SG::AuxStoreInternal::clearDecorations
virtual bool clearDecorations() override
Clear all decorations.
Definition: AuxStoreInternal.cxx:534
SG::IAuxTypeVectorFactory
Interface for factory objects that create vectors.
Definition: IAuxTypeVectorFactory.h:50
xAOD::TAuxStore::kObjectStore
@ kObjectStore
The object describes a single object.
Definition: TAuxStore.h:56
xAOD::TAuxStore::isAuxIDSelected
::Bool_t isAuxIDSelected(auxid_t auxid) const
Check if this auxiliary variable needs to go to the output.
Definition: TAuxStore.cxx:1660
SG::AuxStoreInternal::lock
virtual void lock() override
Lock the container.
Definition: AuxStoreInternal.cxx:517
SG::AuxStoreInternal::lockDecoration
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.
Definition: AuxStoreInternal.cxx:695
SG::IAuxTypeVectorFactory::tiAlloc
virtual const std::type_info * tiAlloc() const =0
Return the type_info of the vector allocator.
xAOD::TAuxStore::isContainerBranch
::Bool_t isContainerBranch(TBranch *br, auxid_t auxid)
Check if a branch describes a container or a single object.
Definition: TAuxStore.cxx:1711
xAOD::TAuxStore::m_mutex1
mutex_t m_mutex1
Mutexes object used for multithreaded synchronisation.
Definition: TAuxStore.h:246
xAOD::TAuxStore::m_mutex2
mutex_t m_mutex2
Definition: TAuxStore.h:246
xAOD::TAuxStore::splitLevel
Int_t splitLevel() const
Get the split level of the output branches.
Definition: TAuxStore.cxx:150
SG::AuxStoreInternal::shift
virtual void shift(size_t pos, ptrdiff_t offs) override
Shift the elements of the container.
Definition: AuxStoreInternal.cxx:273
SG::AuxTypePlaceholder
Used as type_info when we read an aux data item but it doesn't exist in the registry.
Definition: AuxTypes.h:34
Preparation.mode
mode
Definition: Preparation.py:96
SG::AuxStoreInternal::insertMove
virtual bool insertMove(size_t pos, IAuxStore &other, const SG::auxid_set_t &ignore=SG::auxid_set_t(0)) override
Move all elements from other to this store.
Definition: AuxStoreInternal.cxx:304
xAOD::TAuxStore::m_transientStore
SG::AuxStoreInternal * m_transientStore
Store for the in-memory-only variables.
Definition: TAuxStore.h:227
SG::IAuxTypeVectorFactory::copy
virtual void copy(SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const =0
Copy elements between vectors.
SG::AuxTypeRegistry::getVecType
const std::type_info * getVecType(SG::auxid_t auxid) const
Return the type of the STL vector used to hold an aux data item.
Definition: AuxTypeRegistry.cxx:313
SG::AuxStoreInternal::getIOType
virtual const std::type_info * getIOType(SG::auxid_t auxid) const override
Return the type of the data to be stored for one aux data item.
Definition: AuxStoreInternal.cxx:488
SG::AuxStoreInternal::size
virtual size_t size() const override
Return the number of elements in the store.
Definition: AuxStoreInternal.cxx:555
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
xAOD::IOStats::instance
static IOStats & instance()
Singleton object accessor.
Definition: IOStats.cxx:11
xAOD::TAuxStore::getData
virtual const void * getData(auxid_t auxid) const override
Get a pointer to a given array.
Definition: TAuxStore.cxx:286
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
SG::AuxStoreInternal::getIOData
virtual const void * getIOData(SG::auxid_t auxid) const override
Return a pointer to the data to be stored for one aux data item.
Definition: AuxStoreInternal.cxx:471
xAOD::TAuxStore::kContainerStore
@ kContainerStore
The object describes an entire container.
Definition: TAuxStore.h:55
xAOD::TAuxStore::m_structMode
EStructMode m_structMode
The "structural" mode of the object.
Definition: TAuxStore.h:210
xAOD::TAuxStore::m_vecs
std::vector< SG::IAuxTypeVector * > m_vecs
Variables handled currently by the object.
Definition: TAuxStore.h:232
SG::AuxTypeRegistry::makeVector
std::unique_ptr< IAuxTypeVector > makeVector(SG::auxid_t auxid, size_t size, size_t capacity) const
Construct a new vector to hold an aux item.
Definition: AuxTypeRegistry.cxx:206
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:191
xAOD::TAuxStore::m_inputScanned
::Bool_t m_inputScanned
"Scan status" of the input TTree
Definition: TAuxStore.h:222
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
xAOD::Utils::getTypeInfo
const std::type_info & getTypeInfo(EDataType type)
This function is used when reading a primitive branch from an input file without the user explicitly ...
Definition: Control/xAODRootAccess/Root/Utils.cxx:169
SG::IAuxStore
Interface for non-const operations on an auxiliary store.
Definition: IAuxStore.h:51
SG::AuxStoreInternal
An auxiliary data store that holds data internally.
Definition: AuxStoreInternal.h:43
python.PyAthena.v
v
Definition: PyAthena.py:157
SG::AuxVectorInterface
Make an AuxVectorData object from either a raw array or an aux store.
Definition: AuxVectorInterface.h:33
xAOD::TAuxStore::m_topStore
::Bool_t m_topStore
Flag stating whether this is a "top store".
Definition: TAuxStore.h:207
xAOD::TAuxStore::kUndefinedStore
@ kUndefinedStore
The structure mode is not defined.
Definition: TAuxStore.h:54
xAOD::TAuxStore::auxid_t
SG::auxid_t auxid_t
Convenience type declaration.
Definition: TAuxStore.h:59
SG::IAuxTypeVector::insertMove
virtual bool insertMove(size_t pos, void *beg, void *end, IAuxStore &srcStore)=0
Insert elements into the vector via move semantics.
SG::AuxStoreInternal::isDecoration
virtual bool isDecoration(auxid_t auxid) const override
Test if a particular variable is tagged as a decoration.
Definition: AuxStoreInternal.cxx:380
xAOD::TAuxStore::size
virtual size_t size() const override
Return the number of elements in the store.
Definition: TAuxStore.cxx:463
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SG::IAuxTypeVector
Abstract interface for manipulating vectors of arbitrary types.
Definition: IAuxTypeVector.h:40
xAOD::TAuxStore::m_size
std::size_t m_size
The current size of the container being described.
Definition: TAuxStore.h:234
xAOD::TAuxStore::TAuxStore
TAuxStore(const char *prefix="", Bool_t topStore=kTRUE, EStructMode mode=kUndefinedStore, Int_t basketSize=2048, Int_t splitLevel=0)
Default constructor.
Definition: TAuxStore.cxx:56
xAOD::TAuxStore::setupAuxBranch
StatusCode setupAuxBranch(::TBranch *br, const char *auxName, ::Bool_t staticBranch)
Register one input branch as an available auxiliary variable.
Definition: TAuxStore.cxx:1469
xAOD::TAuxStore::m_branches
std::vector< TBranchHandle * > m_branches
Branches reading the various auxiliary variables.
Definition: TAuxStore.h:299
SG::AuxStoreInternal::resize
virtual bool resize(size_t sz) override
Change the size of all aux data vectors.
Definition: AuxStoreInternal.cxx:215
ReadCalibFromCool.typeName
typeName
Definition: ReadCalibFromCool.py:477
collListGuids.attributes
attributes
Definition: collListGuids.py:46
SG::auxid_set_t
A set of aux data identifiers.
Definition: AuxTypes.h:47
merge.status
status
Definition: merge.py:17
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
xAOD::TAuxStore::setupOutputData
StatusCode setupOutputData(auxid_t auxid)
Connect a variable to the output tree.
Definition: TAuxStore.cxx:1106
xAOD::AuxSelection::selectAux
virtual void selectAux(const std::set< std::string > &attributes)
Select which variables should be written out.
Definition: AuxSelection.cxx:47
CxxUtils::ConcurrentBitset::erase
ConcurrentBitset & erase(bit_t bit)
Turn off one bit.
xAOD::AuxSelection::getSelectedAuxIDs
virtual SG::auxid_set_t getSelectedAuxIDs(const SG::auxid_set_t &fullset) const
Return which variables were selected to be written out.
Definition: AuxSelection.cxx:62
xAOD::TAuxStore::isPrimitiveBranch
::Bool_t isPrimitiveBranch(TBranch *br)
Check if a branch holds a primitive variable or not.
Definition: TAuxStore.cxx:1677
xAOD::TAuxStore::setupInputData
StatusCode setupInputData(auxid_t auxid)
Connect a variable to the input tree.
Definition: TAuxStore.cxx:852
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
xAOD::Utils::rootType
char rootType(char typeidType)
This function is used internally in the code when creating primitive dynamic auxiliary branches.
Definition: Control/xAODRootAccess/Root/Utils.cxx:226
SG::IAuxTypeVector::toPtr
virtual void * toPtr()=0
Return a pointer to the start of the vector's data.
xAOD::TAuxStore::m_branchesWritten
std::vector< bool > m_branchesWritten
"Write status" of the different variables
Definition: TAuxStore.h:301
xAOD::TAuxStore::prefix
const char * prefix() const
Get the currently configured branch name prefix.
Definition: TAuxStore.cxx:114
xAOD::TAuxStore::m_selection
AuxSelection m_selection
Object helping to select which auxiliary variables to write.
Definition: TAuxStore.h:225
PlotCalibFromCool.br
br
Definition: PlotCalibFromCool.py:355
CxxUtils::ConcurrentBitset::test
bool test(bit_t bit) const
Test to see if a bit is set.