src/modules/CSADigitizer/CSADigitizerModule.hpp
Definition of charge-sensitive amplifier digitization module. More…
Namespaces
Name |
---|
allpix Helper class to hold support layers for a detector model. |
Classes
Name | |
---|---|
class | allpix::CSADigitizerModule Module to simulate digitization of collected charges. |
Detailed Description
Definition of charge-sensitive amplifier digitization module.
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
Source code
#ifndef ALLPIX_CSA_DIGITIZER_MODULE_H
#define ALLPIX_CSA_DIGITIZER_MODULE_H
#include <memory>
#include <string>
#include "core/config/Configuration.hpp"
#include "core/messenger/Messenger.hpp"
#include "core/module/Module.hpp"
#include "objects/PixelCharge.hpp"
#include <TFormula.h>
#include <TH1D.h>
#include <TH2D.h>
namespace allpix {
class CSADigitizerModule : public Module {
enum class DigitizerType {
SIMPLE,
CSA,
CUSTOM,
};
public:
CSADigitizerModule(Configuration& config, Messenger* messenger, std::shared_ptr<Detector> detector);
void initialize() override;
void run(Event* event) override;
void finalize() override;
private:
// Control of module output settings
bool output_plots_{}, output_pulsegraphs_{};
bool store_tot_{false}, store_toa_{false}, ignore_polarity_{};
Messenger* messenger_;
DigitizerType model_;
// Function to calculate impulse response
std::unique_ptr<TFormula> calculate_impulse_response_;
// Parameters of the electronics: Noise, time-over-threshold logic
double sigmaNoise_{}, clockToT_{}, clockToA_{}, threshold_{};
// Helper variables for transfer function
double integration_time_{};
std::vector<double> impulse_response_function_;
std::once_flag first_event_flag_;
// Output histograms
Histogram<TH1D> h_tot{}, h_toa{};
Histogram<TH2D> h_pxq_vs_tot{};
std::tuple<bool, unsigned int, double> get_toa(double timestep, const std::vector<double>& pulse) const;
unsigned int get_tot(double timestep, double arrival_time, const std::vector<double>& pulse) const;
void create_output_pulsegraphs(const std::string& s_event_num,
const std::string& s_pixel_index,
const std::string& s_name,
const std::string& s_title,
double timestep,
const std::vector<double>& plot_pulse_vec);
};
} // namespace allpix
#endif /* ALLPIX_CSA_DIGITIZER_MODULE_H */
Updated on 2025-02-27 at 14:14:46 +0000