#include <R3BDigitizingEngine.h>
|
std::atomic< int > | size_ = 0 |
| size of bars with valid signals in the current event
|
|
std::vector< std::unique_ptr< AbstractPaddle > > | paddles_ |
| main data. This vector should rarely grow in the event loop!
|
|
Definition at line 34 of file R3BDigitizingEngine.h.
◆ EngineInterface() [1/3]
R3B::Digitizing::EngineInterface::EngineInterface |
( |
| ) |
|
|
default |
◆ ~EngineInterface()
virtual R3B::Digitizing::EngineInterface::~EngineInterface |
( |
| ) |
|
|
virtualdefault |
◆ EngineInterface() [2/3]
R3B::Digitizing::EngineInterface::EngineInterface |
( |
const EngineInterface & | other | ) |
|
|
delete |
◆ EngineInterface() [3/3]
R3B::Digitizing::EngineInterface::EngineInterface |
( |
EngineInterface && | other | ) |
|
|
delete |
◆ add_paddle()
auto R3B::Digitizing::EngineInterface::add_paddle |
( |
int | paddle_id | ) |
-> AbstractPaddle&
|
|
inlineprivate |
◆ Construct()
void R3B::Digitizing::EngineInterface::Construct |
( |
| ) |
|
|
inline |
Call the Construct mumber function from each paddle object. This method must be called once per event after all the points are read by the engine.
- See also
- R3B::Digitizing::Paddle::Construct()
Definition at line 115 of file R3BDigitizingEngine.h.
◆ DepositLight()
void R3B::Digitizing::EngineInterface::DepositLight |
( |
int | paddle_id, |
|
|
double | time, |
|
|
double | energy_dep, |
|
|
double | dist ) |
|
inline |
This public interface takes in a light deposition with a certain paddle_id, time, light intensity and distance to the center point. If the paddle corresponding to the light deposition doesn't exist, new paddle will be appended in the engine.
- Parameters
-
paddle_id | ID of the paddle with the light deposition |
time | Time of the light deposition |
energy_dep | Energy of the light deposition (MeV) |
dist | Distance to the center point of the bar |
Definition at line 63 of file R3BDigitizingEngine.h.
◆ DoAllPaddles()
template<typename Unary>
auto R3B::Digitizing::EngineInterface::DoAllPaddles |
( |
Unary | fnt | ) |
const |
|
inline |
Perfrom an action on all paddle objects in the engine. The action is specified by a lambda function, whose input value should a range of const R3B::Digitizing::Paddle&
.
For example:
auto action = [](auto paddles_view)
{
return static_cast<double>(
std::count_if(paddles_view.begin(), paddles_view.end(), [](const auto& paddle) { return
paddle.HasFired(); }));
}
auto val = engine.DoAllPaddles(action);
This get the number of paddles that have actually fired.
- Parameters
-
fnt | A unary functor/lambda |
- See also
- DoEachPaddle()
Definition at line 183 of file R3BDigitizingEngine.h.
◆ DoEachPaddle()
template<typename Unary>
void R3B::Digitizing::EngineInterface::DoEachPaddle |
( |
Unary | fnt | ) |
const |
|
inline |
Perfrom an action on each paddle object in the engine. The action is specified by a lambda function, whose input value should be const R3B::Digitizing::Paddle&
.
For example:
auto action = [](const R3B::Digitizing::Paddle& paddle) {
fmt::println("Paddle ID: {}", paddle.GetPaddleID());
};
engine.DoEachPaddles(action);
This prints out all IDs of the paddles with hits in the current event.
- Parameters
-
fnt | A unary functor/lambda |
- See also
- DoAllPaddles()
Definition at line 151 of file R3BDigitizingEngine.h.
◆ ExtraInit()
virtual void R3B::Digitizing::EngineInterface::ExtraInit |
( |
int | initial_capacity | ) |
|
|
inlineprivatevirtual |
◆ ExtraReset()
virtual void R3B::Digitizing::EngineInterface::ExtraReset |
( |
| ) |
|
|
inlineprivatevirtual |
◆ get_capacity()
auto R3B::Digitizing::EngineInterface::get_capacity |
( |
| ) |
const |
|
inlinenodiscard |
The number of preallocated bar objects in the engine. This should always be smaller than the size of stored bar objects. If the size of stored bar objects grows larger than the capacity. Memeory allocation will occur!
Definition at line 129 of file R3BDigitizingEngine.h.
◆ GetTriggerTime()
auto R3B::Digitizing::EngineInterface::GetTriggerTime |
( |
| ) |
const -> double
|
|
inlinenodiscard |
Get the trigger time value from the paddle objects. The value is the minimal trigger time of each paddle.
Definition at line 74 of file R3BDigitizingEngine.h.
◆ Init()
void R3B::Digitizing::EngineInterface::Init |
( |
int | initial_capacity = 1 | ) |
|
|
inline |
The initialization method should be called in the Init
function of each task. During the initialization, memories for paddle class are allocated with extra initialization from the derived class.
- Parameters
-
initial_capacity | Number of paddle objects to be allocated. |
Definition at line 91 of file R3BDigitizingEngine.h.
◆ make_new_paddle()
virtual auto R3B::Digitizing::EngineInterface::make_new_paddle |
( |
| ) |
const -> std::unique_ptr< AbstractPaddle > |
|
nodiscardprivatepure virtual |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ reserve_additional_paddles()
void R3B::Digitizing::EngineInterface::reserve_additional_paddles |
( |
int | num | ) |
|
|
inlineprivate |
◆ Reset()
void R3B::Digitizing::EngineInterface::Reset |
( |
| ) |
|
|
inline |
Resetting the engine for a new event. This public method should be called in the beginning of each event.
Definition at line 102 of file R3BDigitizingEngine.h.
◆ paddles_
std::vector<std::unique_ptr<AbstractPaddle> > R3B::Digitizing::EngineInterface::paddles_ |
|
private |
◆ size_
std::atomic<int> R3B::Digitizing::EngineInterface::size_ = 0 |
|
private |
The documentation for this class was generated from the following file: