2#ifndef TOOLS_HGCROCEMULATOR_H
3#define TOOLS_HGCROCEMULATOR_H
5#include "Conditions/SimpleTableCondition.h"
6#include "Framework/Configure/Parameters.h"
7#include "Framework/Logger.h"
9#include "Recon/Event/HgcrocPulseTruth.h"
152 const int& channelID,
153 std::vector<std::pair<double, double>>& arriving_pulses,
154 std::vector<ldmx::HgcrocDigiCollection::Sample>& digiToAdd)
const;
176 std::vector<ldmx::HgcrocDigiCollection::Sample>
noiseDigi(
177 const int& channel,
const double& soi_amplitude = 0)
const;
185 double noise(
const int& channelID)
const {
191 double gain(
const int& channelID)
const {
203 bool save_pulse_truth_info_{
false};
204 ldmx::HgcrocPulseTruthCollection* pulse_truth_coll_;
219 EXCEPTION_RAISE(
"HgcrocCond",
220 "HGC ROC Emulator was not given a conditions table.");
322 enableLogging(
"HgcrocEmulator")
Class that represents a digitized hit in a calorimeter cell readout by an HGCROC.
unsigned int getColumnNumber(const std::string &colname) const
Get a the column number for the given column name.
T get(unsigned int id, unsigned int col) const
Get an entry by DetectorId and number.
Class encapsulating parameters for configuring a processor.
Emulate the digitization procedure performed by the HGCROC.
void condition(const conditions::DoubleTableCondition &table)
Set Conditions.
std::unique_ptr< TRandom3 > noise_injector_
Generates Gaussian noise on top of real hits_.
double readoutThreshold(const int &id) const
Readout Threshold (ADC Counts)
double clock_cycle_
Time interval for chip clock [ns].
void seedGenerator(uint64_t seed)
Seed the emulator for random number generation.
int n_ad_cs_
Depth of ADC buffer.
double noise(const int &channelID) const
Get random noise amplitdue for input channel [mV].
bool hasSeed() const
Check if emulator has been seeded.
double pedestal(const int &id) const
Pedestal [ADC Counts] for input channel.
double timing_jitter_
Jitter of timing mechanism in the chip [ns].
double getCondition(int id, const std::string &name) const
Get condition for input chip ID, condition name, and default value.
double time_up_slope_
Time of Up Slope relative to Pulse Shape Fit [ns].
double hit_merge_ns_
Hit merging time [ns].
std::map< std::string, int > condition_names_to_index_
Map of condition names to column numbers.
double rate_dn_slope_
Rate of Down Slope in Pulse Shape [1/ns].
int i_soi_
Index for the Sample Of Interest in the list of digi samples.
double time_dn_slope_
Time of Down Slope relative to Pulse Shape Fit [ns].
TF1 pulse_func_
Functional shape of signal pulse in time.
bool digitize(const int &channelID, std::vector< std::pair< double, double > > &arriving_pulses, std::vector< ldmx::HgcrocDigiCollection::Sample > &digiToAdd) const
Digitize the signals from the simulated hits_.
double gain(const int &channelID) const
Gain for input channel.
~HgcrocEmulator()
Destructor.
const conditions::DoubleTableCondition * chip_conditions_
Handle to table of chip-dependent conditions.
bool noise_
Put noise in channels, only configure to false if testing.
double time_peak_
Time of Peak relative to pulse shape fit [ns].
std::vector< ldmx::HgcrocDigiCollection::Sample > noiseDigi(const int &channel, const double &soi_amplitude=0) const
Generate a digi of pure noise.
HgcrocEmulator(const framework::config::Parameters &ps)
Constructor.
double ns_
Conversion from time [ns] to counts.
double rate_up_slope_
Rate of Up Slope in Pulse Shape [1/ns].