DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Alignments.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
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_ALIGNMENTS_H
14 #define DD4HEP_ALIGNMENTS_H
15 
16 // Framework include files
17 #include <DD4hep/IOV.h>
18 #include <DD4hep/Volumes.h>
19 #include <DD4hep/Conditions.h>
20 
22 namespace dd4hep {
23 
25  class IOV;
26  class AlignmentData;
27  class Alignment;
28  class Delta;
29  class ConditionsMap;
30 
32  namespace detail {
34  class ConditionObject;
35  class AlignmentObject;
36  }
37 
39  namespace align {
41 
47  class Keys {
48  public:
50  static const std::string deltaName;
54  static const std::string alignmentName;
57  };
58  }
59 
60 
62 
68  class AlignmentCondition : public Handle<detail::AlignmentObject> {
69  public:
71  typedef unsigned long long int key_type;
72 
73  public:
81  template <typename Q> AlignmentCondition(const Handle<Q>& e) : Handle<Object>(e) {}
83  AlignmentCondition(const std::string& name);
85  const IOVType& iovType() const;
88  const IOV& iov() const;
90  key_type key() const;
91 
96  const AlignmentData& data() const;
98  const Delta& delta() const;
100  const TGeoHMatrix& worldTransformation() const;
102  const TGeoHMatrix& detectorTransformation() const;
104  bool is_bound() const;
105  };
106 
108 
115  class Alignment : public Handle<detail::AlignmentObject> {
116  public:
118 
123  class Processor {
124  public:
126  Processor();
128  virtual ~Processor() = default;
130  virtual int operator()(Alignment alignment) const = 0;
131  };
132 
133  public:
135  Alignment() = default;
139  template <typename Q> Alignment(const Handle<Q>& e) : Handle<Object>(e) {}
141  Alignment(const std::string& name) ;
143  AlignmentData& data();
145  const AlignmentData& data() const;
147  const Delta& delta() const;
149  const TGeoHMatrix& worldTransformation() const;
151  const TGeoHMatrix& detectorTransformation() const;
153  const std::vector<PlacedVolume>& nodes() const;
154 
156  void localToWorld(const Position& local, Position& global) const;
159  void localToWorld(const Double_t local[3], Double_t global[3]) const;
161  Position localToWorld(const Position& local) const;
163  Position localToWorld(const Double_t local[3]) const
164  { return localToWorld({local[0],local[1],local[2]}); }
165 
167  void worldToLocal(const Position& global, Position& local) const;
170  void worldToLocal(const Double_t global[3], Double_t local[3]) const;
172  Position worldToLocal(const Position& global) const;
174  Position worldToLocal(const Double_t global[3]) const
175  { return worldToLocal({global[0],global[1],global[2]}); }
176 
178  void localToDetector(const Position& local, Position& detector) const;
181  void localToDetector(const Double_t local[3], Double_t detector[3]) const;
183  Position localToDetector(const Position& local) const;
185  Position localToDetector(const Double_t local[3]) const
186  { return localToDetector({local[0],local[1],local[2]}); }
187 
189  void detectorToLocal(const Position& detector, Position& local) const;
192  void detectorToLocal(const Double_t detector[3], Double_t local[3]) const;
194  Position detectorToLocal(const Position& detector) const;
196  Position detectorToLocal(const Double_t det[3]) const
197  { return detectorToLocal({det[0],det[1],det[2]}); }
198  };
199 } /* End namespace dd4hep */
200 #endif // DD4HEP_ALIGNMENTS_H
dd4hep::Alignment::localToWorld
Position localToWorld(const Double_t local[3]) const
Transformation from local coordinates of the placed volume to the world system.
Definition: Alignments.h:163
Volumes.h
dd4hep::Alignment::detectorTransformation
const TGeoHMatrix & detectorTransformation() const
Access the alignment/placement matrix with respect to the world.
Definition: Alignments.cpp:73
dd4hep::AlignmentCondition::AlignmentCondition
AlignmentCondition(const Handle< Q > &e)
Constructor to be used when reading the already parsed object.
Definition: Alignments.h:81
dd4hep::Handle< detail::AlignmentObject >::Object
detail::AlignmentObject Object
Extern accessible definition of the contained element type.
Definition: Handle.h:88
dd4hep::AlignmentCondition::AlignmentCondition
AlignmentCondition(detail::ConditionObject *p)
Assignment constructor from condition object.
Definition: Alignments.h:79
dd4hep::Alignment::Processor
Abstract base for processing callbacks to container objects.
Definition: Alignments.h:123
dd4hep::Alignment::data
AlignmentData & data()
Data accessor for the use of decorators.
Definition: Alignments.cpp:53
dd4hep::AlignmentCondition
Main handle class to hold an alignment conditions object.
Definition: Alignments.h:68
IOV.h
dd4hep::Alignment::Processor::~Processor
virtual ~Processor()=default
Default destructor.
dd4hep::Alignment::Alignment
Alignment(const Handle< Q > &e)
Constructor to be used when reading the already parsed object.
Definition: Alignments.h:139
dd4hep::Alignment::nodes
const std::vector< PlacedVolume > & nodes() const
Access to the node list.
Definition: Alignments.cpp:78
dd4hep::Handle
Handle: a templated class like a shared pointer, which allows specialized access to tgeometry objects...
Definition: Handle.h:84
dd4hep::align::Keys
Alignment and Delta item key.
Definition: Alignments.h:47
dd4hep::Alignment::Processor::Processor
Processor()
Default constructor.
Definition: Alignments.cpp:33
dd4hep::Handle< detail::AlignmentObject >::name
const char * name() const
Access the object name (or "" if not supported by the object)
dd4hep::AlignmentCondition::is_bound
bool is_bound() const
Check if object is already bound....
Definition: Alignments.cpp:172
dd4hep::Alignment::delta
const Delta & delta() const
Access the delta value of the object.
Definition: Alignments.cpp:63
dd4hep::IOVType
Class describing the interval of validty type.
Definition: IOV.h:37
dd4hep::Alignment::detectorToLocal
Position detectorToLocal(const Double_t det[3]) const
Transformation from detector element coordinates to the local placed volume coordinates.
Definition: Alignments.h:196
dd4hep::Alignment::localToWorld
void localToWorld(const Position &local, Position &global) const
Transformation from local coordinates of the placed volume to the world system.
Definition: Alignments.cpp:83
dd4hep::Delta
Class describing an condition to re-adjust an alignment.
Definition: AlignmentData.h:38
dd4hep::Alignment::worldToLocal
void worldToLocal(const Position &global, Position &local) const
Transformation from world coordinates of the local placed volume coordinates.
Definition: Alignments.cpp:97
dd4hep::IOV
Class describing the interval of validty.
Definition: IOV.h:67
dd4hep::align::Keys::alignmentKey
static const Condition::itemkey_type alignmentKey
Key value of an alignment condition object "alignment".
Definition: Alignments.h:56
dd4hep::AlignmentCondition::data
AlignmentData & data()
Data accessor for the use of decorators.
Definition: Alignments.cpp:157
dd4hep::align::Keys::deltaKey
static const Condition::itemkey_type deltaKey
Key value of a delta condition "alignment_delta".
Definition: Alignments.h:52
dd4hep::AlignmentCondition::detectorTransformation
const TGeoHMatrix & detectorTransformation() const
Access the alignment/placement matrix with respect to the world.
Definition: Alignments.cpp:182
dd4hep::align::Keys::deltaName
static const std::string deltaName
Key name of a delta condition "alignment_delta".
Definition: Alignments.h:50
dd4hep::Alignment::worldTransformation
const TGeoHMatrix & worldTransformation() const
Create cached matrix to transform to world coordinates.
Definition: Alignments.cpp:68
dd4hep::align::Keys::alignmentName
static const std::string alignmentName
Key name of an alignment condition object "alignment".
Definition: Alignments.h:54
dd4hep::Alignment::worldToLocal
Position worldToLocal(const Double_t global[3]) const
Transformation from local coordinates of the placed volume to the world system.
Definition: Alignments.h:174
dd4hep::Alignment::Alignment
Alignment(Object *p)
Default constructor.
Definition: Alignments.h:137
dd4hep::Alignment
Main handle class to hold an alignment object.
Definition: Alignments.h:115
dd4hep::AlignmentData
Derived condition data-object definition.
Definition: AlignmentData.h:98
dd4hep::Alignment::detectorToLocal
void detectorToLocal(const Position &detector, Position &local) const
Transformation from detector element coordinates to the local placed volume coordinates.
Definition: Alignments.cpp:127
dd4hep::Alignment::localToDetector
void localToDetector(const Position &local, Position &detector) const
Transformation from local coordinates of the placed volume to the detector system.
Definition: Alignments.cpp:112
dd4hep::AlignmentCondition::key_type
unsigned long long int key_type
Forward definition of the key type.
Definition: Alignments.h:71
dd4hep::Alignment::Alignment
Alignment()=default
Default constructor.
dd4hep::Condition::itemkey_type
unsigned int itemkey_type
Low part of the key identifies the item identifier.
Definition: Conditions.h:58
dd4hep::AlignmentCondition::AlignmentCondition
AlignmentCondition(Object *p)
Default constructor.
Definition: Alignments.h:77
Conditions.h
dd4hep::AlignmentCondition::delta
const Delta & delta() const
Access the delta value of the object.
Definition: Alignments.cpp:167
dd4hep::AlignmentCondition::worldTransformation
const TGeoHMatrix & worldTransformation() const
Create cached matrix to transform to world coordinates.
Definition: Alignments.cpp:177
dd4hep::detail::ConditionObject
The data class behind a conditions handle.
Definition: ConditionsInterna.h:68
dd4hep::Position
ROOT::Math::XYZVector Position
Definition: Objects.h:81
dd4hep::Alignment::Processor::operator()
virtual int operator()(Alignment alignment) const =0
Container callback for object processing.
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
det
DetElement::Object * det
Definition: AlignmentsCalculator.cpp:66
dd4hep::Alignment::localToDetector
Position localToDetector(const Double_t local[3]) const
Transformation from local coordinates of the placed volume to the world system.
Definition: Alignments.h:185
dd4hep::AlignmentCondition::iov
const IOV & iov() const
Access the IOV block.
Definition: Alignments.cpp:147
dd4hep::AlignmentCondition::iovType
const IOVType & iovType() const
Access the IOV type.
Definition: Alignments.cpp:142
dd4hep::AlignmentCondition::AlignmentCondition
AlignmentCondition()
Default constructor.
Definition: Alignments.h:75
dd4hep::detail::AlignmentObject
The data class behind an alignments handle.
Definition: AlignmentsInterna.h:56
dd4hep::AlignmentCondition::key
key_type key() const
Access the hash identifier.
Definition: Alignments.cpp:152