Mantid
Loading...
Searching...
No Matches
Detector.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
14#include "MantidKernel/V3D.h"
15#include <string>
16
17namespace Mantid {
18namespace Geometry {
19class Instrument;
20
30class MANTID_GEOMETRY_DLL Detector : public virtual IDetector, public ObjComponent {
31public:
33 std::string type() const override { return "DetectorComponent"; }
34
35 Detector(const std::string &name, int id, IComponent *parent);
36 Detector(const std::string &name, int id, const std::shared_ptr<IObject> &shape, IComponent *parent);
37 // functions inherited from IObjectComponent
38 Component *clone() const override { return new Detector(*this); }
39
40 // IDetector methods
41 Detector *cloneParameterized(const ParameterMap *map) const override { return new Detector(this, map); }
42 detid_t getID() const override;
43 std::size_t nDets() const override { return 1; }
44 double getDistance(const IComponent &comp) const override;
45 double getTwoTheta(const Kernel::V3D &observer, const Kernel::V3D &axis) const override;
46 double getSignedTwoTheta(const Kernel::V3D &observer, const Kernel::V3D &axis,
47 const Kernel::V3D &instrumentUp) const override;
48 double getPhi() const override;
49 double getPhiOffset(const double &offset) const override;
50 // end IDetector methods
55 det_topology getTopology(Kernel::V3D &center) const override;
56
57 const ParameterMap &parameterMap() const override;
58 size_t index() const override;
59
60 virtual size_t registerContents(class ComponentVisitor &componentVisitor) const override;
61
62private:
65
66protected:
68 Detector(const Detector *base, const ParameterMap *map);
69 bool hasDetectorInfo() const;
70};
71
72} // namespace Geometry
73} // namespace Mantid
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
ComponentVisitor : Visitor for IComponents.
Component is a wrapper for a Component which can modify some of its parameters, e....
Definition: Component.h:41
This class represents a detector - i.e.
Definition: Detector.h:30
const detid_t m_id
The detector id.
Definition: Detector.h:64
std::string type() const override
A string representation of the component type.
Definition: Detector.h:33
Component * clone() const override
Clone method Make a copy of the Component.
Definition: Detector.h:38
std::size_t nDets() const override
A Detector object represents a single physical detector.
Definition: Detector.h:43
Detector * cloneParameterized(const ParameterMap *map) const override
Create a cloned instance with a parameter map applied.
Definition: Detector.h:41
base class for Geometric IComponent
Definition: IComponent.h:51
Interface class for detector objects.
Definition: IDetector.h:43
Object Component class, this class brings together the physical attributes of the component to the po...
Definition: ObjComponent.h:33
Class for 3D vectors.
Definition: V3D.h:34
det_topology
Describes the topology of a detectors group used to calculate angular position and angular measures f...
Definition: IDetector.h:31
Helper class which provides the Collimation Length for SANS instruments.
int32_t detid_t
Typedef for a detector ID.
Definition: SpectrumInfo.h:21