DD4hep  01.18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
CellIDPositionConverter.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 : F.Gaede
11 //
12 //==========================================================================
13 #ifndef DDREC_CELLIDPOSITIONCONVERTER_H
14 #define DDREC_CELLIDPOSITIONCONVERTER_H
15 
16 #include "DD4hep/Detector.h"
17 #include "DD4hep/Readout.h"
18 #include "DD4hep/VolumeManager.h"
19 
20 #include "DDSegmentation/Segmentation.h"
21 
22 #include <set>
23 #include <string>
24 
25 
26 namespace dd4hep {
27  namespace rec {
28 
31 
40 #if defined(G__ROOT)
41  CellIDPositionConverter() = default ;
42 #else
43  CellIDPositionConverter() = delete ;
44 #endif
46  void operator=(const CellIDPositionConverter&) = delete ;
47 
48  public:
49 
51  CellIDPositionConverter( Detector& description ) : _description( &description ) {
52  _volumeManager = VolumeManager::getVolumeManager(description);
53  }
54 
57 
62  Position positionNominal(const CellID& cellID) const;
63 
68  Position position(const CellID& cellID) const;
69 
70 
75  CellID cellID(const Position& global) const;
76 
77 
78 
82  const VolumeManagerContext* findContext(const CellID& cellID) const;
83 
84 
85 
89  DetElement findDetElement(const Position& global,
90  const DetElement& det=DetElement() ) const;
91 
92 
98  PlacedVolume findPlacement(const Position& point, const PlacedVolume& mother, double locPos[3], PlacedVolume::VolIDs& volIDs) const ;
99 
100 
106  Readout findReadout(const DetElement& det) const ;
107 
108 
112  Readout findReadout(const PlacedVolume& pv) const ;
113 
117  std::vector<double> cellDimensions(const CellID& cell) const ;
118 
119  protected:
120  VolumeManager _volumeManager{} ;
121  const Detector* _description ;
122 
123  };
124 
125  } /* namespace rec */
126 } /* namespace dd4hep */
127 
128 
129 
130 
131 
132 
133 
134 #endif // DDREC_CELLIDPOSITIONCONVERTER_H
const VolumeManagerContext * findContext(const CellID &cellID) const
Find the context with DetElement, placements etc for a given cellID of a sensitive volume...
void operator=(const CellIDPositionConverter &)=delete
CellID cellID(const Position &global) const
Return the global cellID for the given global position.
Utility for position to cellID and cellID to position conversions.
PlacedVolume findPlacement(const Position &point, const PlacedVolume &mother, double locPos[3], PlacedVolume::VolIDs &volIDs) const
Find the lowest daughter Placement in the given Placement that contains the point (in the coordinate ...
DetElement findDetElement(const Position &global, const DetElement &det=DetElement()) const
Find the DetElement that contains the given point - if no DetElement is found, an invalid DetElement ...
std::vector< double > cellDimensions(const CellID &cell) const
Returns the segmentation.cellDimensions.
CellIDPositionConverter(Detector &description)
The constructor - takes the main description object.
Position position(const CellID &cellID) const
Return the global position for a given cellID of a sensitive volume.
Readout findReadout(const DetElement &det) const
Find the readout object for the given DetElement.
STL class.
Position positionNominal(const CellID &cellID) const
Return the nominal global position for a given cellID of a sensitive volume.
DDSegmentation::CellID CellID
DDSegmentation::VolumeID VolumeID