src/core/geometry/DetectorAssembly.hpp
Definition of detector assemblies. More…
Namespaces
Name |
---|
allpix Helper class to hold support layers for a detector model. |
Classes
Name | |
---|---|
class | allpix::DetectorAssembly Helper class to hold information on the detector assembly. |
class | allpix::HybridAssembly |
class | allpix::MonolithicAssembly |
Detailed Description
Definition of detector assemblies.
Copyright: Copyright (c) 2022-2024 CERN and the Allpix Squared authors. This software is distributed under the terms of the MIT License, copied verbatim in the file “LICENSE.md”. In applying this license, CERN does not waive the privileges and immunities granted to it by virtue of its status as an Intergovernmental Organization or submit itself to any jurisdiction. SPDX-License-Identifier: MIT
Source code
#ifndef ALLPIX_DETECTOR_ASSEMBLY_H
#define ALLPIX_DETECTOR_ASSEMBLY_H
#include <Math/Point2D.h>
#include <Math/Point3D.h>
#include <Math/Vector2D.h>
#include <Math/Vector3D.h>
#include "core/config/ConfigReader.hpp"
#include "core/config/exceptions.h"
#include "tools/ROOT.h"
namespace allpix {
class DetectorAssembly {
public:
explicit DetectorAssembly(const Configuration& config) {
// Chip thickness
thickness_ = config.get<double>("chip_thickness", 0);
}
DetectorAssembly() = delete;
virtual ~DetectorAssembly() = default;
double getChipThickness() const { return thickness_; }
ROOT::Math::XYVector getChipExcess() const {
return {(excess_.at(1) + excess_.at(3)), (excess_.at(0) + excess_.at(2))};
}
virtual ROOT::Math::XYZVector getChipOffset() const {
return {(excess_.at(1) - excess_.at(3)), (excess_.at(0) - excess_.at(2)), 0};
}
protected:
std::array<double, 4> excess_{};
private:
double thickness_{};
};
class HybridAssembly : public DetectorAssembly {
public:
explicit HybridAssembly(const Configuration& config) : DetectorAssembly(config) {
// Excess around the chip from the pixel grid
auto default_assembly_excess = config.get<double>("chip_excess", 0);
excess_.at(0) = config.get<double>("chip_excess_top", default_assembly_excess);
excess_.at(1) = config.get<double>("chip_excess_right", default_assembly_excess);
excess_.at(2) = config.get<double>("chip_excess_bottom", default_assembly_excess);
excess_.at(3) = config.get<double>("chip_excess_left", default_assembly_excess);
// Set bump parameters
bump_cylinder_radius_ = config.get<double>("bump_cylinder_radius");
bump_height_ = config.get<double>("bump_height");
bump_sphere_radius_ = config.get<double>("bump_sphere_radius", 0);
auto pitch = config.get<ROOT::Math::XYVector>("pixel_size");
bump_offset_ = config.get<ROOT::Math::XYVector>("bump_offset", {0, 0});
if(std::fabs(bump_offset_.x()) > pitch.x() / 2.0 || std::fabs(bump_offset_.y()) > pitch.y() / 2.0) {
throw InvalidValueError(config, "bump_offset", "bump bond offset cannot be larger than half pixel pitch");
}
}
ROOT::Math::XYZVector getChipOffset() const override {
return {(excess_.at(1) - excess_.at(3)), (excess_.at(0) - excess_.at(2)), bump_height_};
}
ROOT::Math::XYZVector getBumpsOffset() const { return {bump_offset_.x(), bump_offset_.y(), bump_height_ / 2.0}; }
double getBumpSphereRadius() const { return bump_sphere_radius_; }
double getBumpCylinderRadius() const { return bump_cylinder_radius_; }
double getBumpHeight() const { return bump_height_; }
private:
double bump_sphere_radius_{};
double bump_height_{};
ROOT::Math::XYVector bump_offset_;
double bump_cylinder_radius_{};
};
class MonolithicAssembly : public DetectorAssembly {
public:
explicit MonolithicAssembly(const Configuration& config) : DetectorAssembly(config) {
// Excess around the chip is copied from sensor size
auto default_assembly_excess = config.get<double>("sensor_excess", 0);
excess_.at(0) = config.get<double>("sensor_excess_top", default_assembly_excess);
excess_.at(1) = config.get<double>("sensor_excess_right", default_assembly_excess);
excess_.at(2) = config.get<double>("sensor_excess_bottom", default_assembly_excess);
excess_.at(3) = config.get<double>("sensor_excess_left", default_assembly_excess);
}
};
} // namespace allpix
#endif // ALLPIX_SUPPORT_LAYER_H
Updated on 2024-12-13 at 08:31:37 +0000