DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
dd4hep::align::GlobalAlignmentCache Class Reference

Class caching all known alignment operations for one Detector instance. More...

#include <GlobalAlignmentCache.h>

Public Types

typedef GlobalAlignmentStack Stack
 
typedef Stack::StackEntry Entry
 
typedef std::map< unsigned int, TGeoPhysicalNode * > Cache
 
typedef std::map< std::string, GlobalAlignmentCache * > SubdetectorAlignments
 

Public Member Functions

int addRef ()
 Add reference count. More...
 
int release ()
 Release object. If reference count goes to NULL, automatic deletion is triggered. More...
 
const std::string & name () const
 Access the section name. More...
 
void commit (GlobalAlignmentStack &stack)
 Close existing transaction stack and apply all alignments. More...
 
GlobalAlignmentCachesection (const std::string &path_name) const
 Retrieve the cache section corresponding to the path of an entry. More...
 
GlobalAlignment get (const std::string &path) const
 Retrieve an alignment entry by its placement path. More...
 
std::vector< GlobalAlignmentmatches (const std::string &path_match, bool exclude_exact=false) const
 Return all entries matching a given path. Careful: Expensive operaton! More...
 

Static Public Member Functions

static GlobalAlignmentCacheinstall (Detector &description)
 Create and install a new instance tree. More...
 
static void uninstall (Detector &description)
 Unregister and delete a tree instance. More...
 

Protected Member Functions

 GlobalAlignmentCache (Detector &description, const std::string &sdPath, bool top)
 Default constructor initializing variables. More...
 
virtual ~GlobalAlignmentCache ()
 Default destructor. More...
 
GlobalAlignmentCachesubdetectorAlignments (const std::string &name)
 Retrieve branch cache by name. If not present it will be created. More...
 
void apply (GlobalAlignmentStack &stack)
 Population entry: Apply a complete stack of ordered alignments to the geometry structure. More...
 
void apply (const std::vector< Entry * > &changes)
 Apply a vector of SD entries of ordered alignments to the geometry structure. More...
 
bool insert (GlobalAlignment alignment)
 Add a new entry to the cache. The key is the placement path. More...
 

Protected Attributes

Detectorm_detDesc
 
SubdetectorAlignments m_detectors
 Cache of subdetectors. More...
 
Cache m_cache
 The subdetector specific map of alignments caches. More...
 
std::string m_sdPath
 
size_t m_sdPathLen
 The length of the branch name to optimize lookups.... More...
 
int m_refCount
 Reference count. More...
 
bool m_top
 Flag to indicate the top instance. More...
 

Friends

class dd4hep::Detector
 
class GlobalAlignmentOperator
 
class dd4hep::detail::DeleteExtension< GlobalAlignmentCache, GlobalAlignmentCache >
 

Detailed Description

Class caching all known alignment operations for one Detector instance.

Internaly the instances are fragmented to subdetectors defined by the next-to-top level detector elements.

Author
M.Frank
Version
1.0

Definition at line 41 of file GlobalAlignmentCache.h.

Member Typedef Documentation

◆ Cache

typedef std::map<unsigned int, TGeoPhysicalNode*> dd4hep::align::GlobalAlignmentCache::Cache

Definition at line 49 of file GlobalAlignmentCache.h.

◆ Entry

Definition at line 48 of file GlobalAlignmentCache.h.

◆ Stack

Definition at line 47 of file GlobalAlignmentCache.h.

◆ SubdetectorAlignments

Definition at line 50 of file GlobalAlignmentCache.h.

Constructor & Destructor Documentation

◆ GlobalAlignmentCache()

GlobalAlignmentCache::GlobalAlignmentCache ( Detector description,
const std::string &  sdPath,
bool  top 
)
protected

Default constructor initializing variables.

Default constructor.

Definition at line 41 of file GlobalAlignmentCache.cpp.

◆ ~GlobalAlignmentCache()

GlobalAlignmentCache::~GlobalAlignmentCache ( )
protectedvirtual

Default destructor.

Definition at line 47 of file GlobalAlignmentCache.cpp.

Member Function Documentation

◆ addRef()

int GlobalAlignmentCache::addRef ( )

Add reference count.

Definition at line 58 of file GlobalAlignmentCache.cpp.

◆ apply() [1/2]

void GlobalAlignmentCache::apply ( const std::vector< Entry * > &  changes)
protected

Apply a vector of SD entries of ordered alignments to the geometry structure.

Definition at line 239 of file GlobalAlignmentCache.cpp.

◆ apply() [2/2]

void GlobalAlignmentCache::apply ( GlobalAlignmentStack stack)
protected

Population entry: Apply a complete stack of ordered alignments to the geometry structure.

Apply a complete stack of ordered alignments to the geometry structure.

Definition at line 186 of file GlobalAlignmentCache.cpp.

◆ commit()

void GlobalAlignmentCache::commit ( GlobalAlignmentStack stack)

Close existing transaction stack and apply all alignments.

Definition at line 167 of file GlobalAlignmentCache.cpp.

◆ get()

GlobalAlignment GlobalAlignmentCache::get ( const std::string &  path) const

Retrieve an alignment entry by its placement path.

Definition at line 122 of file GlobalAlignmentCache.cpp.

◆ insert()

bool GlobalAlignmentCache::insert ( GlobalAlignment  alignment)
protected

Add a new entry to the cache. The key is the placement path.

Definition at line 90 of file GlobalAlignmentCache.cpp.

◆ install()

GlobalAlignmentCache * GlobalAlignmentCache::install ( Detector description)
static

Create and install a new instance tree.

Definition at line 72 of file GlobalAlignmentCache.cpp.

◆ matches()

std::vector< GlobalAlignment > GlobalAlignmentCache::matches ( const std::string &  path_match,
bool  exclude_exact = false 
) const

Return all entries matching a given path. Careful: Expensive operaton!

Return all entries matching a given path.

Definition at line 148 of file GlobalAlignmentCache.cpp.

◆ name()

const std::string& dd4hep::align::GlobalAlignmentCache::name ( ) const
inline

Access the section name.

Definition at line 94 of file GlobalAlignmentCache.h.

◆ release()

int GlobalAlignmentCache::release ( )

Release object. If reference count goes to NULL, automatic deletion is triggered.

Definition at line 63 of file GlobalAlignmentCache.cpp.

◆ section()

GlobalAlignmentCache * GlobalAlignmentCache::section ( const std::string &  path_name) const

Retrieve the cache section corresponding to the path of an entry.

Definition at line 104 of file GlobalAlignmentCache.cpp.

◆ subdetectorAlignments()

GlobalAlignmentCache * GlobalAlignmentCache::subdetectorAlignments ( const std::string &  name)
protected

Retrieve branch cache by name. If not present it will be created.

Definition at line 175 of file GlobalAlignmentCache.cpp.

◆ uninstall()

void GlobalAlignmentCache::uninstall ( Detector description)
static

Unregister and delete a tree instance.

Definition at line 83 of file GlobalAlignmentCache.cpp.

Friends And Related Function Documentation

◆ dd4hep::detail::DeleteExtension< GlobalAlignmentCache, GlobalAlignmentCache >

Definition at line 43 of file GlobalAlignmentCache.h.

◆ dd4hep::Detector

friend class dd4hep::Detector
friend

Definition at line 42 of file GlobalAlignmentCache.h.

◆ GlobalAlignmentOperator

friend class GlobalAlignmentOperator
friend

Definition at line 43 of file GlobalAlignmentCache.h.

Member Data Documentation

◆ m_cache

Cache dd4hep::align::GlobalAlignmentCache::m_cache
protected

The subdetector specific map of alignments caches.

Definition at line 57 of file GlobalAlignmentCache.h.

◆ m_detDesc

Detector& dd4hep::align::GlobalAlignmentCache::m_detDesc
protected

Definition at line 53 of file GlobalAlignmentCache.h.

◆ m_detectors

SubdetectorAlignments dd4hep::align::GlobalAlignmentCache::m_detectors
protected

Cache of subdetectors.

Definition at line 55 of file GlobalAlignmentCache.h.

◆ m_refCount

int dd4hep::align::GlobalAlignmentCache::m_refCount
protected

Reference count.

Definition at line 64 of file GlobalAlignmentCache.h.

◆ m_sdPath

std::string dd4hep::align::GlobalAlignmentCache::m_sdPath
protected

Branchg name: If it is not the main tree instance, the name of the subdetector

Definition at line 60 of file GlobalAlignmentCache.h.

◆ m_sdPathLen

size_t dd4hep::align::GlobalAlignmentCache::m_sdPathLen
protected

The length of the branch name to optimize lookups....

Definition at line 62 of file GlobalAlignmentCache.h.

◆ m_top

bool dd4hep::align::GlobalAlignmentCache::m_top
protected

Flag to indicate the top instance.

Definition at line 66 of file GlobalAlignmentCache.h.


The documentation for this class was generated from the following files: