gdynamicDigitization
Loading...
Searching...
No Matches
greadoutSpecs.h
Go to the documentation of this file.
1#pragma once
2
31#include "ghitConventions.h" // For HitBitSet
32#include "glogger.h"
33
34#include <cmath> // Use <cmath> for std::floor
35
45
46private:
47 double timeWindow;
48 double gridStartTime;
49 HitBitSet hitBitSet;
50
51public:
62 GReadoutSpecs(const double tw, const double gst, const HitBitSet hbs, const std::shared_ptr<GLogger>& log) :
63 timeWindow(tw),
64 gridStartTime(gst),
65 hitBitSet(hbs) {
66 log->info(1, "GReadoutSpecs: timeWindow=", timeWindow, ", gridStartTime=", gridStartTime, ", hitBitSet=",
67 hitBitSet);
68 }
69
70public:
76 [[nodiscard]] inline HitBitSet getHitBitSet() const { return hitBitSet; }
77
90 [[nodiscard]] inline int timeCellIndex(double time) const { return static_cast<int>(std::floor((time - gridStartTime) / timeWindow) + 1); }
91};
92
93
94#include <type_traits>
95
96// At compile time, make sure GReadoutSpecs has trivial destructors,
97static_assert(std::is_trivially_destructible_v<GReadoutSpecs>);
98
Specifies the readout electronics parameters.
int timeCellIndex(double time) const
Computes the time cell index for a given time.
GReadoutSpecs(const double tw, const double gst, const HitBitSet hbs, const std::shared_ptr< GLogger > &log)
Constructs a GReadoutSpecs object.
HitBitSet getHitBitSet() const
Retrieves the hit bitset.