R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BDigitizingChannel.cxx
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2019 Members of R3B Collaboration *
4 * *
5 * This software is distributed under the terms of the *
6 * GNU General Public Licence (GPL) version 3, *
7 * copied verbatim in the file "LICENSE". *
8 * *
9 * In applying this license GSI does not waive the privileges and immunities *
10 * granted to it by virtue of its status as an Intergovernmental Organization *
11 * or submit itself to any jurisdiction. *
12 ******************************************************************************/
13
15#include "R3BShared.h"
16#include <TRandom3.h>
17#include <algorithm>
18
19namespace R3B::Digitizing
20{
22 : has_cal_output_{ has_cal_output }
23 , side_(side)
24
25 {
26 }
27
29 {
30 static auto random3 = TRandom3{};
31 return random3;
32 }
33
47
49 {
50 hits_.clear();
51 cal_signals_.clear();
52 trig_time_ = 0.;
53 signal_size_ = 0;
55 }
56
58 {
59 const auto& signals = GetHits();
60 auto it = std::min_element(signals.begin(),
61 signals.end(),
62 [](const auto& left_v, const auto& right_v) { return left_v.tdc < right_v.tdc; });
63 trig_time_ = it != signals.end() ? it->tdc : MAXTIME;
64 }
65} // namespace R3B::Digitizing
int signal_size_
Size of the signal inputs.
void Reset()
Reset the data in the Channel for the new event.
virtual void construct_hits(Hits &signals)=0
static auto GetDefaultRandomGen() -> TRandom3 &
AbstractChannel(R3B::Side side, bool has_cal_output=false)
bool has_cal_output_
Flag of whether cal output is enabled.
auto GetHits() const -> const Hits &
R3B::Side side_
side of the channel
CalSignals cal_signals_
output cal signals from the channel
Hits hits_
output hits from the channel
double trig_time_
trigger time of the channel
virtual void construct_cal_signals(CalSignals &cal_signals) const