228 return arrayIntObservablesMap;
240 return arrayDoubleObservablesMap;
258 static std::unique_ptr<GDigitizedData>
create(
const std::shared_ptr<GOptions>& gopts) {
260 auto digi_data = std::make_unique<GDigitizedData>(gopts, hit);
261 auto counter = globalDigitizedDataCounter.fetch_add(1, std::memory_order_relaxed);
267 digi_data->includeVariable(
"adc", counter * 0.1);
273 std::map<std::string, int> intObservablesMap;
276 std::map<std::string, double> doubleObservablesMap;
279 std::map<std::string, std::vector<int>> arrayIntObservablesMap;
282 std::map<std::string, std::vector<double>> arrayDoubleObservablesMap;
285 std::vector<GIdentifier> gidentity;
300 [[nodiscard]]
static bool validVarName(
const std::string& varName,
int which);
303 static std::atomic<int> globalDigitizedDataCounter;
Container for digitized (electronics-level) observables for one hit.
void accumulateVariable(const std::string &vname, int value)
Accumulate an integer observable (run-level integration).
static std::unique_ptr< GDigitizedData > create(const std::shared_ptr< GOptions > &gopts)
Test/example factory: create a digitized hit with deterministic dummy data.
int getIntObservable(const std::string &varName)
Retrieve one integer observable by name.
std::map< std::string, int > getIntObservablesMap(int which) const
Return a filtered copy of the integer observables map.
int getTimeAtElectronics()
Convenience accessor for TIMEATELECTRONICS.
void includeVariable(const std::string &vname, int value)
Store/overwrite an integer observable for this hit (event-level).
std::map< std::string, double > getDblObservablesMap(int which) const
Return a filtered copy of the double observables map.
GDigitizedData(const std::shared_ptr< GOptions > &gopts, const GHit *ghit)
Construct digitized data by copying identity from a hit.
double getDblObservable(const std::string &varName)
Retrieve one double observable by name.
std::string getIdentityString() const
Return a human-readable identity string for debugging and labeling.
std::map< std::string, std::vector< int > > getArrayIntObservablesMap() const
Get the array-valued integer observables map.
std::map< std::string, std::vector< double > > getArrayDblObservablesMap() const
Get the array-valued double observables map.
static GHit * create(const std::shared_ptr< GOptions > &gopts)
constexpr const char * GDIGITIZED_DATA_LOGGER
Logger domain name used by GDigitizedData (controls verbosity/category in GLogger).
Shared constants and error codes for the GData library.
constexpr const char * TIMEATELECTRONICS
Time (or TDC proxy) at electronics stage.
constexpr const char * CRATESTRINGID
Electronics crate index.
constexpr const char * CHANNELSTRINGID
Channel index within a slot/module.
constexpr const char * SLOTSTRINGID
Slot index within a crate (module position).
GOptions defineOptions()
Defines GOptions for the digitized-data logger domain.