Class Detector::Builder

Nested Relationships

This class is a nested type of Class Detector.

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class Builder : public lsst::afw::cameraGeom::DetectorBase

A helper class for Detector that allows amplifiers and most fields to be modified.

Because Detector is immutable, creation and modification always go through Builder, or more precisely, one of its two subclasses:

Detector::Builder itself provides functionality common to these:

  • setters for the simple data fields of Detector;

  • a container of Amplifier::Builders. It is not intended define an interface independent of its subclasses.

The name and ID of a detector (but not its “serial” string) are set at initial construction and are an integral part of the relationship between it and its Camera, and can never be changed, even by Builders.

The fact that Amplifier::Builder inherits from Amplifier does not mean that a container of Amplifier::Builder can inherit from a container of Amplifier, and hence Detector::Builder (which has a container of Amplifer::Builder) cannot inherit directly from Detector (which has a container of Amplifier). But in both Python and templated C++ code, the container interfaces of Detector and Detector::Builder are identical (i.e. they’re “duck type” equivalent), aside from the fact that Detector::Builder also permits addition and removal of amplifiers.

Subclassed by lsst::afw::cameraGeom::Detector::InCameraBuilder, lsst::afw::cameraGeom::Detector::PartialRebuilder

Unnamed Group

auto begin()

An iterator range over amplifers.

Iterators dereference to shared_ptr<Amplifier::Builder>.

auto end()

Public Functions

Builder(Builder const&)
Builder(Builder&&)
Builder &operator=(Builder const&)
Builder &operator=(Builder&&)
~Builder() = 0
void setBBox(lsst::geom::Box2I const &bbox)

Set the bounding box

void setType(DetectorType type)

Set the purpose of this detector.

void setSerial(std::string const &serial)

Set the detector serial “number”.

void setPhysicalType(std::string const &physicalType)

Set the detector’s physical type.

Get the detector’s physical type.

This may mean different things for different cameras; possibilities include the manufacturer (“ITL” vs “E2V”) or fundamental technology (“CCD” vs “HgCdTe”).

void setCrosstalk(CrosstalkMatrix const &crosstalk)

Set the crosstalk coefficients.

The shape of the crosstalk matrix must be consistent with the set of amplifiers, but is not checked until a Detector instance is actually constructed.

Setting with a zero-size matrix is equivalent to calling unsetCrosstalk().

void unsetCrosstalk()

Remove the crosstalk coefficient matrix.

std::vector<std::shared_ptr<Amplifier::Builder>> const &getAmplifiers() const

Return the sequence of Amplifier::Builders directly.

std::shared_ptr<Amplifier::Builder> operator[](size_t i) const

Get the amplifier builder specified by index

Exceptions
  • std::out_of_range: if index is out of range.

std::shared_ptr<Amplifier::Builder> operator[](std::string const &name) const

Get a builder for the amplifier specified by name.

Exceptions
  • lsst::pex::exceptions::InvalidParameterError: if no such amplifier.

void append(std::shared_ptr<Amplifier::Builder> builder)

Append a new amplifier.

void clear()

Remove all amplifiers.

std::size_t size() const

Return the number of amplifiers (renamed to len in Python).

Protected Functions

Builder(std::string const &name, int id)

Construct a Detector::Builder with no amplifiers and the given name and ID.

Builder(Fields fields, std::vector<std::shared_ptr<Amplifier::Builder>> &&amplifiers)

Construct a Detector::Builder with the given field values and amplifiers.

Fields const &getFields() const

Return a reference to a Fields struct.

Must be implemented by all subclasses.

std::vector<std::shared_ptr<Amplifier const>> finishAmplifiers() const

Create a vector of Amplifiers from the Amplifier::Builder sequence.

void setOrientation(Orientation const &orientation)

Set the orientation of the detector in the focal plane.

This is intended for use by InCameraBuilder only; the orientation is used to set the coordinate transform from FOCAL_PLANE to PIXELS, and hence cannot be modified unless the full Camera is being modified.

void setPixelSize(lsst::geom::Extent2D const &pixelSize)

Set the pixel size (in mm).

This is intended for use by InCameraBuilder only; the pixel size is used to set the coordinate transform from FOCAL_PLANE to PIXELS, and hence cannot be modified unless the full Camera is being modified.

Protected Static Functions

static std::vector<std::shared_ptr<Amplifier::Builder>> rebuildAmplifiers(Detector const &detector)

Create a vector of Amplifier::Builders from the Amplifiers in a Detector.