DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VolumeManagerInterna.cpp
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation for LCD
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
14 // Framework include files
15 #include "DD4hep/Printout.h"
16 #include "DD4hep/Handle.inl"
18 
19 using namespace DD4hep;
20 using namespace DD4hep::Geometry;
21 
23 
26  : identifier(0), mask(~0x0ULL) {
27 }
28 
31 }
32 
35  : top(0), system(0), sysID(0), detMask(~0x0ULL), flags(VolumeManager::NONE) {
36 }
37 
44  managers.clear();
45  subdetectors.clear();
46 }
47 
49 void VolumeManagerObject::update(unsigned long tags, DetElement& det, void* param) {
51  printout(DEBUG,"VolumeManager","+++ Conditions update %s param:%p",det.path().c_str(),param);
53  printout(DEBUG,"VolumeManager","+++ Alignment update %s param:%p",det.path().c_str(),param);
54 
55  for(Volumes::iterator i=volumes.begin(); i != volumes.end(); ++i) {
56  Context* c = (*i).second;
57  printout(DEBUG,"VolumeManager","+++ Alignment update %s",c->placement.name());
58 
59  }
60 }
61 
64  Context* context = 0;
65  VolumeID volume_id(vol_id);
66  volume_id &= detMask;
67  Volumes::const_iterator i = volumes.find(volume_id);
68  if (i != volumes.end()) {
69  context = (*i).second;
70  }
71  return context;
72 }
Detectors subdetectors
The container of subdetector elements.
const char * name() const
Access the object name (or "" if not supported by the object)
Definition: Handle.inl:36
virtual ~VolumeManagerContext()
Default destructor.
Volumes volumes
The container of placements managed by this instance.
This structure describes the cached data for one placement held by the volume manager.
DD4HEP_INSTANTIATE_HANDLE_NAMED(VolumeManagerObject)
void update(unsigned long tags, DetElement &det, void *param)
Update callback when alignment has changed (called only for subdetectors....)
Context * search(const VolumeID &id) const
Search the locally cached volumes for a matching ID.
This structure describes the internal data of the volume manager object.
void destroyObjects(M &m)
Definition: Primitives.h:293
const std::string & path() const
Path of the detector element (not necessarily identical to placement path!)
Definition: Detector.cpp:160
Handle class describing a detector element.
Definition: Detector.h:172
Class to support the retrieval of detector elements and volumes given a valid identifier.
Definition: VolumeManager.h:70
virtual ~VolumeManagerObject()
Default destructor.
void destroyHandles(M &m)
Functional created of map destruction functors.
Definition: Handle.h:199
long long int VolumeID
Definition: Primitives.h:35
int printout(PrintLevel severity, const char *src, const char *fmt,...)
Calls the display action with a given severity level.
Definition: Printout.cpp:111
Managers managers
The volume managers for the individual subdetector elements.