14#ifndef R3BROOT_DIGITIZINGTAMEX_H
15#define R3BROOT_DIGITIZINGTAMEX_H
50 std::reference_wrapper<TRandom3>
fRnd;
53 explicit Params(TRandom3&);
78 [[nodiscard]]
auto GetQDC() const ->
double {
return qdc_; }
79 [[nodiscard]]
auto GetLETime() const ->
double {
return time_; }
94 [[nodiscard]]
auto GetWidth() const ->
double {
return width_; }
95 [[nodiscard]]
auto GetQDC() const ->
double {
return qdc_; }
96 [[nodiscard]]
auto GetLETime() const ->
double {
return leading_edge_time_; }
97 [[nodiscard]]
auto GetTETime() const ->
double {
return trailing_edge_time_; }
101 auto operator-(
const FQTPeak& other)
const ->
double {
return leading_edge_time_ - other.leading_edge_time_; }
102 auto operator-(
double time)
const ->
double {
return leading_edge_time_ - time; };
103 auto operator>(
const FQTPeak& other)
const ->
bool {
return leading_edge_time_ - other.leading_edge_time_ > 0; }
104 auto operator<(
const FQTPeak& other)
const ->
bool {
return leading_edge_time_ - other.leading_edge_time_ < 0; }
108 template <
typename Par>
111 return std::max(1.,
width - par.fPedestal) / par.fEnergyGain;
114 template <
typename Par>
118 if (qdc > par.fQdcMin)
120 width = qdc * par.fEnergyGain + par.fPedestal;
124 width = qdc * par.fEnergyGain * (par.fPedestal + 1);
133 double leading_edge_time_ = 0.0;
134 double trailing_edge_time_ = 0.0;
135 Channel* channel_ptr_ =
nullptr;
172 std::vector<PMTPeak> pmt_peaks_;
173 std::vector<FQTPeak> fqt_peaks_;
184 auto CheckPaddleIDInHitPar() const ->
bool;
185 void SetHitModulePar(
int PaddleId);
186 auto ToQdc(
double) const ->
double;
187 auto ToTdc(
double) const ->
double;
188 auto ToUnSatQdc(
double) const ->
double;
189 template <typename Peak>
190 void ApplyThreshold( std::vector<Peak>&);
191 auto ConstructFQTPeaks(std::vector<
PMTPeak>& pmtPeaks) -> std::vector<
FQTPeak>;
192 template <typename Peak>
193 static
void PeakPileUp( std::vector<Peak>& peaks);
195 static
void PeakPileUpWithDistance( std::vector<
FQTPeak>& peaks,
double distance);
197 void FQTPeakPileUp( std::vector<
FQTPeak>& peaks);
198 auto CalculateTOT(const
double& qdc) const ->
double;
ChannelCalSignal CalSignal
static auto GetDefaultRandomGen() -> TRandom3 &
std::vector< Signal > Signals
std::vector< CalSignal > CalSignals
void SetPileUpStrategy(PeakPileUpStrategy strategy)
auto GetParConstRef() const -> const Tamex::Params &
auto GetFQTPeaks() -> const std::vector< FQTPeak > &
auto GetPMTPeaks() -> const std::vector< PMTPeak > &
void AttachToPaddle(Digitizing::Paddle *paddle) override
Channel(ChannelSide side, PeakPileUpStrategy strategy=PeakPileUpStrategy::width)
auto CreateSignal(const FQTPeak &peak) const -> Signal
auto ConstructCalSignals() -> CalSignals override
void AddHit(Hit) override
auto ConstructSignals() -> Signals override
auto GetCal2HitPar() -> auto *
Channel(ChannelSide, PeakPileUpStrategy strategy, TRandom3 &)
auto GetCalSignals() -> CalSignals override
auto GetPar() -> Tamex::Params &
auto CreateCalSignal(const FQTPeak &peak) const -> CalSignal
FQTPeak(const PMTPeak &pmtPeak, Channel *channel)
auto GetLETime() const -> double
static auto QdcToWidth(double qdc, const Par &par) -> double
auto operator==(const FQTPeak &other) const -> bool
auto GetWidth() const -> double
auto operator<(const FQTPeak &other) const -> bool
auto operator-(double time) const -> double
auto GetQDC() const -> double
auto operator-(const FQTPeak &other) const -> double
auto operator>(const FQTPeak &other) const -> bool
void operator+=(const FQTPeak &other)
auto GetTETime() const -> double
static auto WidthToQdc(double width, const Par &par) -> double
auto operator+=(const PMTPeak &other) -> PMTPeak &
static constexpr double peakWidth
auto GetQDC() const -> double
auto operator<(const PMTPeak &rhs) const -> bool
auto operator==(const PMTPeak &rhs) const -> bool
auto GetLETime() const -> double
auto operator=(Params &&) -> Params &=delete
std::reference_wrapper< TRandom3 > fRnd
auto operator=(const Params &) -> Params &=default
bool fExperimentalDataIsCorrectedForSaturation
Params(const Params &other)=default
double fSaturationCoefficient