File: VLevelLocator.h

package info (click to toggle)
vecgeom 1.2.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 23,928 kB
  • sloc: cpp: 88,717; ansic: 6,894; python: 1,035; sh: 582; sql: 538; makefile: 29
file content (97 lines) | stat: -rw-r--r-- 4,909 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#pragma once

#include "VecGeom/base/Global.h"
#include "VecGeom/base/Vector3D.h"
#include "VecGeom/navigation/NavStateFwd.h"

namespace vecgeom {
inline namespace VECGEOM_IMPL_NAMESPACE {

class LogicalVolume;
class VPlacedVolume;
// class NavigationState;

//! Pure virtual base class for LevelLocators

//! Pure abstract base class for LevelLocators
//! which are classes providing functions
//! to locate a track in a logical volume; Via the virtual
//! interface it is possible to write custom locators which are specialized for
//! a given logical volume and its content
class VLevelLocator {

public:
  /**
   * Function which takes a logical volume and a local point in the reference frame of the logical volume
   * and which determines in which daughter (or the logical volume itself) the given point is located
   *
   *
   * @param  lvol is a logical volume
   * @param  localpoint is a point in the coordinate frame of the logical volume and should be contained within it
   * @param  daughterpvol is the placed volume in which the localpoint is contained (result of the computation)
   * @param  daughterlocalpoint is the local point in the next pvol (result of the computation)
   * @return true if point is in a daughter; false otherwise
   */
  VECCORE_ATT_HOST_DEVICE
  virtual bool LevelLocate(LogicalVolume const * /*lvol*/, Vector3D<Precision> const & /*localpoint*/,
                           VPlacedVolume const *& /*pvol*/, Vector3D<Precision> & /*daughterlocalpoint*/) const = 0;

  /**
   * Function which takes a logical volume and a local point in the reference frame of the logical volume
   * and which determines in which daughter (or the logical volume itself) the given point is located
   *
   *
   * @param  lvol is a logical volume
   * @param  localpoint is a point in the coordinate frame of the logical volume and should be contained within it
   * @param  outstate is a navigationstate which gets modified to point to the correct volume within this level (result
   * of the computation)
   * @param  daughterlocalpoint is the local point in the next pvol (result of the computation)
   * @return true if point is in a daughter; false otherwise
   */
  VECCORE_ATT_HOST_DEVICE
  virtual bool LevelLocate(LogicalVolume const * /*lvol*/, Vector3D<Precision> const & /*localpoint*/,
                           NavigationState & /*outstate*/, Vector3D<Precision> & /*daughterlocalpoint*/) const = 0;

  /**
   * Function which takes a logical volume and a local point in the reference frame of the logical volume
   * and which determines in which daughter ( or the logical volume ) itself the given point is located
   *
   *
   * @param  lvol is a logical volume
   * @param  pvol a physical volume to be excluded
   * @param  localpoint is a point in the coordinate frame of the logical volume and should be contained within it
   * @param  daughterpvol is the placed volume in which the localpoint is contained (result of the computation)
   * @param  daughterlocalpoint is the local point in the next pvol (result of the computation)
   * @return true of point is in a daughter; false otherwise
   */
  VECCORE_ATT_HOST_DEVICE
  virtual bool LevelLocateExclVol(LogicalVolume const * /*lvol*/, VPlacedVolume const * /*pvol excl*/,
                                  Vector3D<Precision> const & /*localpoint*/, VPlacedVolume const *& /*pvol*/,
                                  Vector3D<Precision> & /*daughterlocalpoint*/) const = 0;

  /**
   * Function which takes a logical volume and a ray (local point + local direction) in the reference frame of the
   * logical volume and which determines in which daughter ( or the logical volume ) itself the given point is located.
   * This version resembles the logic done in Geant4.
   *
   * @param  lvol is a logical volume
   * @param  pvol a physical volume to be excluded
   * @param  localpoint is a point in the coordinate frame of the logical volume and should be contained within it
   * @param  localdir is a direction in the coordinate frame of the logical volume
   * @param  daughterpvol is the placed volume in which the localpoint is contained (result of the computation)
   * @param  daughterlocalpoint is the local point in the next pvol (result of the computation)
   * @return true if point is in a daughter; false otherwise
   */
  VECCORE_ATT_HOST_DEVICE
  virtual bool LevelLocateExclVol(LogicalVolume const * /*lvol*/, VPlacedVolume const * /*pvol excl*/,
                                  Vector3D<Precision> const & /*localpoint*/, Vector3D<Precision> const & /*localdir*/,
                                  VPlacedVolume const *& /*pvol*/,
                                  Vector3D<Precision> & /*daughterlocalpoint*/) const = 0;

  virtual std::string GetName() const = 0;

  virtual ~VLevelLocator() {}

}; // end class declaration
} // namespace VECGEOM_IMPL_NAMESPACE
} // namespace vecgeom