276 return arrayIntObservablesMap;
289 return arrayDoubleObservablesMap;
308 static std::unique_ptr<GDigitizedData>
create(
const std::shared_ptr<GOptions>& gopts) {
310 auto digi_data = std::make_unique<GDigitizedData>(gopts, hit);
311 auto counter = globalDigitizedDataCounter.fetch_add(1, std::memory_order_relaxed);
317 digi_data->includeVariable(
"adc", counter * 0.1);
323 std::map<std::string, int> intObservablesMap;
326 std::map<std::string, double> doubleObservablesMap;
329 std::map<std::string, std::vector<int>> arrayIntObservablesMap;
332 std::map<std::string, std::vector<double>> arrayDoubleObservablesMap;
335 std::vector<GIdentifier> gidentity;
351 [[nodiscard]]
static bool validVarName(
const std::string& varName,
int which);
359 static std::atomic<int> globalDigitizedDataCounter;
Stores digitized, electronics-level observables for one hit.
void accumulateVariable(const std::string &vname, int value)
Accumulates one integer observable into the current object.
static std::unique_ptr< GDigitizedData > create(const std::shared_ptr< GOptions > &gopts)
Creates deterministic example data for tests and examples.
int getIntObservable(const std::string &varName)
Returns one integer observable by key.
std::map< std::string, int > getIntObservablesMap(int which) const
Returns a filtered copy of the integer observables map.
int getTimeAtElectronics()
Returns the conventional timeAtElectronics integer observable when present.
void includeVariable(const std::string &vname, int value)
Stores or overwrites one integer observable for this hit.
friend std::ostream & operator<<(std::ostream &os, const GDigitizedData &data)
std::map< std::string, double > getDblObservablesMap(int which) const
Returns a filtered copy of the floating-point observables map.
GDigitizedData(const std::shared_ptr< GOptions > &gopts, const GHit *ghit)
Constructs the object and copies the hit identity from the source hit.
double getDblObservable(const std::string &varName)
Returns one floating-point observable by key.
std::string getIdentityString() const
Builds a readable identity string from the stored hit identifiers.
std::map< std::string, std::vector< int > > getArrayIntObservablesMap() const
Returns a copy of the array-valued integer observables.
std::map< std::string, std::vector< double > > getArrayDblObservablesMap() const
Returns a copy of the array-valued floating-point observables.
static GHit * create(const std::shared_ptr< GOptions > &gopts)
constexpr const char * GDIGITIZED_DATA_LOGGER
Logger domain name used by GDigitizedData.
Shared constants, schema keys, and error codes for the GData module.
constexpr const char * TIMEATELECTRONICS
Electronics-stage time or TDC proxy.
constexpr const char * CRATESTRINGID
Electronics crate identifier.
constexpr const char * CHANNELSTRINGID
Channel index within the slot or module.
constexpr const char * SLOTSTRINGID
Slot index within the crate.
GOptions defineOptions()
Defines the options subtree used by the digitized-data logger domain.