ATLAS Offline Software
Loading...
Searching...
No Matches
NestedContainer.h File Reference

'Nested' template container for storing TRT conditions data. More...

#include <vector>
#include <map>
#include <functional>
#include <algorithm>
#include "TRT_ConditionsData/ExpandedIdentifier.h"
#include "AthenaKernel/getMessageSvc.h"
#include "GaudiKernel/MsgStream.h"
Include dependency graph for NestedContainer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TRTCond::NestedContainerDaughterAccessor< Daughter, T, Trait >
struct  TRTCond::NestedContainerDaughterAccessor< T, T, Trait >
 NestedContainerDaugtherAccessor
specialization if the daughter is not a container, but an atomic object ('STRAW' level) More...
class  TRTCond::NestedContainerBase< NestingLevel, Daughter, T, Trait >
 Base class for nested containers. More...
class  TRTCond::NestedContainer< NestingLevel, T, Trait >
 Nested container class, ie a base class at level l with daugthers at level l+1. More...
class  TRTCond::NestedContainer< ExpandedIdentifier::STRAWLAYER, T, Trait >
 Template specialization for the lowest level ('STRAWLAYER') to truncate the nesting loop. More...
class  TRTCond::NestedContainerPointerTrait< T >
 Default trait class if T is an owned pointer. More...

Namespaces

namespace  TRTCond

Detailed Description

'Nested' template container for storing TRT conditions data.

Entries are accessed via an identifier (TRTCond::ExpandedIdentifier), which specifies barrel, layer, sector, strawlayer and straw. At each level it stores a 'default' value which is returned in case the specified entry does not exist or is 'invalid' (not-calibrated). The identifier can also specify a 'level' which allows to access the constants at a particular granularity. For example, to access the t0 of a straw 'bec=1, layer=2, sector=3, strawlayer=4, straw=5', one uses

StrawT0Container * strawt0container = ... ; ExpandedIdentifier id(3,2,3,4,5,ExpandedIdentifier::STRAW) ; const StrawT0& strawt0 = strawt0container->get( id ) ;

To retrieve the corresponding entry an module level, one would use

ExpandedIdentifier id(3,2,3,4,5,ExpandedIdentifier::MODULE) ;

The NestedContainer is implement via two classes

  • NestedContainerBase is a base class that stores a vector objects of template type 'Daughter' as well as a 'default' object of type T. It contains all the functionality of the NestedContainer, for example setting and retrieving values, printing the contents of the container and 'crunching', reducing to a minimal size by using the fact that stores daughter objects are the same. One of the template argments is the 'NestingLevel' which tells the NestedContainerBase which index in an ExpandedIdentifier to use to pick the Daughter.
  • NestedContainer is the derived class. It specifies the Daughter and NestingLevel of the base class. By default the Daughter is a NestedContainer with level 'NestingLevel+1', which creates a template loop. The loop is truncated with a template specialization at the 'STRAWLAYER' level: The NestedContainer at strawlayer level stores objects of type T rather than another nested container.
  • The NestedContainer is created with a template specialization like class StrawT0Container : public NestedContainer<ExpandedIdentifier::DETECTOR, StrawT0,StrawT0Trait> In this example 'StrawT0' is the object stored and 'StrawT0Trait' is a trait class that provides functionality that the NestedContainerBase needs to deal with a class of type StrawT0, like how to initialize, delete and copy it.
Author
Wouter Hulsbergen woute.nosp@m.r.hu.nosp@m.lsber.nosp@m.gen@.nosp@m.cern..nosp@m.ch

Definition in file NestedContainer.h.