src/modules/DepositionPointCharge/DepositionPointChargeModule.hpp

Definition of a module to deposit charges at a specific point. More…

Namespaces

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

Classes

Name
class allpix::DepositionPointChargeModule
Module to deposit charges at predefined positions in the sensor volume.

Detailed Description

Definition of a module to deposit charges at a specific point.

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


#include <string>

#include <TH2D.h>

#include "core/module/Module.hpp"

namespace allpix {
    class DepositionPointChargeModule : public Module {
        enum class DepositionModel {
            FIXED, 
            SCAN,  
            SPOT,  
        };

        enum class SourceType {
            POINT, 
            MIP,   
        };

    public:
        DepositionPointChargeModule(Configuration& config, Messenger* messenger, std::shared_ptr<Detector> detector);

        void initialize() override;

        void run(Event*) override;

        void finalize() override;

    private:
        void DepositPoint(Event*, const ROOT::Math::XYZPoint& position);

        void DepositLine(Event*, const ROOT::Math::XYZPoint& position);

        std::tuple<ROOT::Math::XYZPoint, ROOT::Math::XYZPoint>
        SensorIntersection(const ROOT::Math::XYZPoint& line_origin) const;

        Messenger* messenger_;

        std::shared_ptr<Detector> detector_;
        std::shared_ptr<allpix::DetectorModel> detector_model_;

        DepositionModel model_;
        SourceType type_;
        double spot_size_{};
        ROOT::Math::XYZVector voxel_;
        double step_size_{};
        unsigned int root_{}, carriers_{};
        ROOT::Math::XYZVector position_{};
        ROOT::Math::XYZVector mip_direction_{};
        std::vector<std::string> scan_coordinates_{};
        size_t no_of_coordinates_;

        bool scan_x_;
        bool scan_y_;
        bool scan_z_;

        // Output plot parameters
        bool output_plots_{};
        int output_plots_bins_per_um_{};

        Histogram<TH2D> deposition_position_xy;
        Histogram<TH2D> deposition_position_xz;
        Histogram<TH2D> deposition_position_yz;
    };
} // namespace allpix

Updated on 2025-02-27 at 14:14:46 +0000