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
DetectorInterna.h
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 // NOTE:
15 //
16 // This is an internal include file. It should only be included to
17 // instantiate code. Otherwise the Detector include file should be
18 // sufficient for all practical purposes.
19 //
20 //==========================================================================
21 #ifndef DD4HEP_GEOMETRY_DETECTORINTERNA_H
22 #define DD4HEP_GEOMETRY_DETECTORINTERNA_H
23 
24 // Framework include files
25 #include "DD4hep/Callback.h"
26 #include "DD4hep/NamedObject.h"
27 #include "DD4hep/World.h"
28 #include "DD4hep/Objects.h"
29 #include "DD4hep/Detector.h"
30 #include "DD4hep/Alignments.h"
31 #include "DD4hep/Conditions.h"
32 #include "DD4hep/Segmentations.h"
34 
35 // ROOT include files
36 #include "TGeoMatrix.h"
37 
39 namespace DD4hep {
40 
42  namespace Geometry {
43 
44  class LCDD;
45  class WorldObject;
46  class DetElementObject;
47  class SensitiveDetectorObject;
48 
50 
58  public:
59  unsigned int magic;
60  int verbose;
62  double ecut;
66  std::string hitsCollection;
67 
71  SensitiveDetectorObject(const std::string& nam);
73  virtual ~SensitiveDetectorObject();
74  };
75 
77 
85  public:
86  // Type definitions.
87  // The full namespace declaration is required by cint....
88  typedef /* DD4hep::Geometry:: */ DetElement::destruct_t destruct_t;
89  typedef /* DD4hep::Geometry:: */ DetElement::copy_t copy_t;
90 
91  typedef /* DD4hep::Geometry:: */ DetElement::Children Children;
92  typedef /* DD4hep::Geometry:: */ DetElement::Extensions Extensions;
93  typedef std::pair<Callback,unsigned long> UpdateCall;
94  typedef std::vector<UpdateCall> UpdateCallbacks;
99 
100  enum DetFlags {
106  HAVE_OTHER = 1<<31
107  };
108 
110  unsigned int magic;
112  unsigned int flag;
114  int id;
118  unsigned int typeFlag;
120  int level;
122  unsigned int key;
124  std::string path;
126  std::string placementPath;
127 
133 
148 
158 
161 
162  // To be removed!
164  std::vector<Alignment> volume_alignments;
166  std::vector<Alignment> volume_surveys;
168 
169  TGeoHMatrix worldTrafo;
172  TGeoHMatrix parentTrafo;
174  TGeoHMatrix* referenceTrafo;
176 
177  private:
181 
182  public:
184  DetElementObject(const std::string& nam, int ident);
189  virtual ~DetElementObject();
191  virtual DetElementObject* clone(int new_id, int flag) const;
194  { return privateWorld.isValid() ? privateWorld : i_access_world(); }
197  const TGeoHMatrix& worldTransformation();
200  const TGeoHMatrix& parentTransformation();
202  const TGeoHMatrix& referenceTransformation();
204  void removeAtUpdate(unsigned int type, void* pointer);
206  void update(unsigned int tags, void* param);
208  void revalidate(TGeoHMatrix* parent_world_trafo);
209  };
210 
212 
220  public:
229 
232 
235 
238 
241 
244 
245  public:
247  WorldObject();
249 #ifndef __CINT__
250  WorldObject(LCDD& lcdd, const std::string& nam);
252 #endif
253  virtual ~WorldObject();
255  };
256 
259  : DetElementObject(), lcdd(0),
260  conditionsLoader(0), conditionsManager(0), alignmentsLoader(0), alignmentsManager(0)
261  {
262  }
263 
264  } /* End namespace Geometry */
265 } /* End namespace DD4hep */
266 #endif /* DD4HEP_GEOMETRY_DETECTORINTERNA_H */
Alignment nominal
Basic ideal/nominal detector element alignment entry.
LCDD * lcdd
Reference to the LCDD instance object.
PlacedVolume idealPlace
The subdetector placement corresponding to the ideal detector element's volume.
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:135
unsigned int typeFlag
Flag to encode detector types.
The data class behind a alignments container handle.
bool isValid() const
Check the validity of the object held by the handle.
Definition: Handle.h:124
Data class with properties of sensitive detectors.
void(* destruct_t)(void *)
Extensions destructor type.
Definition: Detector.h:200
void update(unsigned int tags, void *param)
Trigger update callbacks.
PlacedVolume placement
The subdetector placement corresponding to the actual detector element's volume.
AlignmentsManagerObject * alignmentsManager
Reference to the alignments manager object.
Handle class to hold the information of the top DetElement object 'world'.
Definition: World.h:35
void removeAtUpdate(unsigned int type, void *pointer)
Remove callback from object.
int combineHits
Flag to process hits.
unsigned int magic
Magic number to ensure data integrity.
Main handle class to hold an alignment object.
Definition: Alignments.h:65
Main condition object handle.
Definition: Conditions.h:70
Ref_t global_alignment
Global alignment data.
DetElementObject()
Default constructor.
Container class for condition handles aggregated by a detector element.
Definition: Conditions.h:206
void *(* copy_t)(const void *, DetElement)
Extensions copy constructor type.
Definition: Detector.h:198
The data class behind a conditions container handle.
const TGeoHMatrix & worldTransformation()
Create cached matrix to transform to world coordinates.
TGeoHMatrix parentTrafo
Intermediate buffer to store the transformation to the parent detector element.
std::map< const std::type_info *, void * > Extensions
Definition: Detector.h:203
Handle to the implementation of the readout structure of a subdetector.
Definition: Readout.h:46
DetElement reference
Reference element for stored transformations.
Implementation of a named object.
Definition: NamedObject.h:31
const TGeoHMatrix & referenceTransformation()
Create cached matrix to transform to reference coordinates.
unsigned int key
Access hash key of this detector element (Only valid once geometry is closed!)
int id
Unique integer identifier of the detector instance.
UpdateCallbacks updateCalls
Placeholder for structure with update callbacks.
Alignments::Container AlignmentsContainer
ConditionsContainer assign_conditions()
void revalidate(TGeoHMatrix *parent_world_trafo)
Revalidate the caches.
Conditions internal namespace declaration.
Alignment survey
Basic detector element alignment entry containing the survey data.
ConditionsContainer conditions
The detector elements conditions access.
AlignmentsLoader * alignmentsLoader
Alignments loader for this LCDD instance.
DetElement::Extensions Extensions
DetElement parent
Reference to the parent element.
std::vector< UpdateCall > UpdateCallbacks
ConditionsLoader * conditionsLoader
Conditions loader for this LCDD instance.
Conditions::ConditionsManagerObject ConditionsManagerObject
Forward type definition of the ConditionsManagerObject type.
World world()
Access to the world object. Only possible once the geometry is closed.
Conditions::Container ConditionsContainer
int level
Hierarchical level within the detector description.
Alignments::AlignmentsLoader AlignmentsLoader
Forward type definition of the AlignmentsLoader type.
TGeoHMatrix * referenceTrafo
Intermediate buffer for the transformation to an arbitrary DetElement.
Handle< NamedObject > Ref_t
Default Ref_t definition describing named objects.
Definition: Handle.h:176
std::string placementPath
The path to the placement of the detector element (if placed)
VolumeID volumeID
The cached VolumeID of this subdetector element.
std::string type
The object type.
Definition: NamedObject.h:36
WorldObject()
Default constructor.
Handle class describing a detector element.
Definition: Detector.h:172
Alignments::AlignmentsManagerObject AlignmentsManagerObject
Forward type definition of the AlignmentsManagerObject type.
Container class for alignment handles aggregated by a detector element.
Definition: Alignments.h:206
const TGeoHMatrix & parentTransformation()
Create cached matrix to transform to parent coordinates.
Handle class describing a set of limits as they are used for simulation.
Definition: Objects.h:475
long long int VolumeID
Definition: Primitives.h:35
Handle class describing a region as used in simulation.
Definition: Objects.h:516
std::pair< Callback, unsigned long > UpdateCall
unsigned int flag
Flag to remember internally calculated quatities.
std::vector< Alignment > volume_surveys
Alignment entries for lower level volumes, which are NOT attached to daughter DetElements.
virtual ~SensitiveDetectorObject()
Internal object destructor: release extension object(s)
The main interface to the DD4hep detector description package.
Definition: LCDD.h:82
World i_access_world()
Resolve the world object. Internal use ONLY.
ConditionsManagerObject * conditionsManager
Reference to the conditions manager object.
virtual ~WorldObject()
Internal object destructor: release extension object(s)
std::map< std::string, DetElement > Children
Definition: Detector.h:202
Conditions::ConditionsLoader ConditionsLoader
Forward type definition of the ConditionsLoader type.
Data class with properties of a detector element.
Data class with properties of a detector element.
World privateWorld
Reference to the parent element.
DetElement::destruct_t destruct_t
Implementation of an object supporting arbitrary user extensions.
Children children
The array of children.
virtual ~DetElementObject()
Internal object destructor: release extension object(s)
TGeoHMatrix worldTrafo
Intermediate buffer to store the transformation to the world coordination system. ...
AlignmentsContainer alignments
The detector elements alignments access.
std::string path
Full path to this detector element. May be invalid.
virtual DetElementObject * clone(int new_id, int flag) const
Deep object copy to replicate DetElement trees e.g. for reflection.
std::vector< Alignment > volume_alignments
Alignment entries for lower level volumes, which are NOT attached to daughter DetElements.