src/objects/SensorCharge.hpp

Implementation of object for charges in sensor. More…

Namespaces

Name
allpix
Helper class to hold support layers for a detector model.

Classes

Name
class allpix::SensorCharge
Base object for charge deposits and propagated charges in the sensor.

Types

Name
enum class int8_t CarrierType { ELECTRON = -1, HOLE = 1}
Flags to distinguish between electron and hole charge carriers.

Functions

Name
std::ostream & operator«(std::ostream & os, const CarrierType type)
CarrierType invertCarrierType(const CarrierType & type)
Invert the type of a charge carrier.

Detailed Description

Implementation of object for charges in sensor.

Copyright: Copyright (c) 2017-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

Types Documentation

enum CarrierType

Enumerator Value Description
ELECTRON -1
HOLE 1

Flags to distinguish between electron and hole charge carriers.

Functions Documentation

function operator«

inline std::ostream & operator<<(
    std::ostream & os,
    const CarrierType type
)

function invertCarrierType

inline CarrierType invertCarrierType(
    const CarrierType & type
)

Invert the type of a charge carrier.

Parameters:

  • type Initial type of the charge carrier

Return: Inverted type of the charge carrier

Source code


#ifndef ALLPIX_SENSOR_CHARGE_H
#define ALLPIX_SENSOR_CHARGE_H

#include <Math/Point3D.h>

#include "Object.hpp"

namespace allpix {
    enum class CarrierType : int8_t { ELECTRON = -1, HOLE = 1 };

    inline std::ostream& operator<<(std::ostream& os, const CarrierType type) {
        os << (type == CarrierType::ELECTRON ? "\"e\"" : "\"h\"");
        return os;
    }

    inline CarrierType invertCarrierType(const CarrierType& type) {
        return (type == CarrierType::ELECTRON ? CarrierType::HOLE : CarrierType::ELECTRON);
    }

    class SensorCharge : public Object {
    public:
        SensorCharge(ROOT::Math::XYZPoint local_position,
                     ROOT::Math::XYZPoint global_position,
                     CarrierType type,
                     unsigned int charge,
                     double local_time,
                     double global_time);

        ROOT::Math::XYZPoint getLocalPosition() const;

        ROOT::Math::XYZPoint getGlobalPosition() const;

        CarrierType getType() const;
        unsigned int getCharge() const;

        long getSign() const;

        double getGlobalTime() const;

        double getLocalTime() const;

        void print(std::ostream& out) const override;

        ClassDefOverride(SensorCharge, 3); // NOLINT
        SensorCharge() = default;

    private:
        ROOT::Math::XYZPoint local_position_;
        ROOT::Math::XYZPoint global_position_;

        double local_time_{};
        double global_time_{};

        CarrierType type_{};
        unsigned int charge_{};
    };
} // namespace allpix

#endif /* ALLPIX_SENSOR_CHARGE_H */

Updated on 2024-12-13 at 08:31:37 +0000