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
GlobalAlignment.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 #ifndef DD4HEP_ALIGNMENT_GLOBALALIGNMENT_H
14 #define DD4HEP_ALIGNMENT_GLOBALALIGNMENT_H
15 
16 // Framework include files
17 #include "DD4hep/Objects.h"
18 #include "DD4hep/Volumes.h"
19 #include "DD4hep/Alignments.h"
20 #include "TGeoPhysicalNode.h"
21 
23 namespace DD4hep {
24 
26  namespace Alignments {
27 
29 
38  class GlobalAlignment : public Handle<TGeoPhysicalNode> {
39 
43 
44  public:
48  GlobalAlignment(TGeoPhysicalNode* p)
49  : Handle<TGeoPhysicalNode>(p) {
50  }
54  template <typename Q> GlobalAlignment(const Handle<Q>& e)
55  : Handle<TGeoPhysicalNode>(e) {
56  }
58  GlobalAlignment(const std::string& path);
62  int numNodes() const;
64  PlacedVolume placement() const;
66  PlacedVolume motherPlacement(int level_up = 1) const;
68 
73  PlacedVolume nodePlacement(int level=-1) const;
75  Transform3D toGlobal(int level=-1) const;
77  Position toGlobal(const Position& localPoint, int level=-1) const;
79  Position globalToLocal(const Position& globalPoint, int level=-1) const;
80 
82  Transform3D toMother(int level=-1) const;
83 
85  Transform3D nominal() const;
87  Transform3D delta() const;
89  Transform3D invDelta() const;
90 
91  };
92 
93  } /* End namespace Alignments */
94 } /* End namespace DD4hep */
95 #endif /* DD4HEP_ALIGNMENT_GLOBALALIGNMENT_H */
Transform3D toMother(int level=-1) const
Access the currently applied alignment/placement matrix with respect to mother volume.
Transform3D delta() const
Access the currently applied correction matrix (delta) (mother to daughter)
Transform3D toGlobal(int level=-1) const
Access the currently applied alignment/placement matrix with respect to the world.
Transform3D nominal() const
Access the currently applied alignment/placement matrix (mother to daughter)
Main handle class to hold a TGeo alignment object of type TGeoPhysicalNode.
GlobalAlignment(TGeoPhysicalNode *p)
Default constructor.
int numNodes() const
Number of nodes in this branch (=depth of the placement hierarchy from the top level volume) ...
GlobalAlignment(const Handle< Q > &e)
Constructor to be used when reading the already parsed object.
return e
Definition: Volumes.cpp:297
PlacedVolume motherPlacement(int level_up=1) const
Access the placement of the mother of this node.
Transform3D invDelta() const
Access the inverse of the currently applied correction matrix (delta) (mother to daughter) ...
ROOT::Math::RotationZYX RotationZYX
Definition: Objects.h:98
ROOT::Math::XYZVector Position
Definition: Objects.h:75
GlobalAlignment()
Default constructor.
PlacedVolume placement() const
Access the placement of this node.
Handle: a templated class like a shared pointer, which allows specialized access to tgeometry objects...
Definition: Handle.h:87
GlobalAlignment & operator=(const GlobalAlignment &c)
Assignment operator.
Position globalToLocal(const Position &globalPoint, int level=-1) const
Transform a point from global coordinates to local coordinates of a given level.
PlacedVolume nodePlacement(int level=-1) const
Access the placement of a node in the chain of placements for this branch.
ROOT::Math::Transform3D Transform3D
Definition: Objects.h:110