#include <CRTDetSimAlg.h>
Public Types | |
using | Parameters = fhicl::Table< CRTDetSimParams > |
Public Member Functions | |
CRTDetSimAlg (const Parameters &p, CLHEP::HepRandomEngine &fRandEngine, double g4RefTime) | |
void | ClearTaggers () |
void | FillTaggers (const uint32_t adid, const uint32_t adsid, std::vector< AuxDetIDE > ides) |
void | CreateData () |
std::vector< std::pair < sbnd::crt::FEBData, std::vector< AuxDetIDE > > > | GetData () |
std::vector< std::vector< int > > | GetAuxData () |
uint32_t | getChannelTriggerTicks (float t0, float npeMean, float r) |
void | ChargeResponse (double eDep, double d0, double d1, double distToReadout, long &npe0, long &npe1, double &q0, double &q1) |
uint16_t | WaveformEmulation (const uint32_t &time_delay, const double &adc) |
const CRTDetSimParams & | Params () |
Private Member Functions | |
void | ConfigureWaveform () |
void | ConfigureTimeOffset () |
void | ProcessStrips (const std::vector< StripData > &strips) |
void | AddADC (sbnd::crt::FEBData &feb_data, const int &sipmID, const uint16_t &adc) |
Private Attributes | |
CRTDetSimParams | fParams |
The table of CRT simulation parameters. More... | |
CLHEP::HepRandomEngine & | fEngine |
The random-number engine. More... | |
double | fG4RefTime |
The G4 reference time that can be used as a time offset. More... | |
double | fTimeOffset |
The time that will be used in the simulation. More... | |
std::unique_ptr < ROOT::Math::Interpolator > | fInterpolator |
The interpolator used to estimate the CRT waveform. More... | |
std::map< std::string, Tagger > | fTaggers |
A list of hit taggers, before any coincidence requirement (name -> tagger) More... | |
std::vector< std::pair < sbnd::crt::FEBData, std::vector< AuxDetIDE > > > | fData |
This member stores the final FEBData for the CRT simulation. More... | |
std::vector< std::vector< int > > | fAuxData |
This member stores the indeces of SiPM per AuxDetIDE. More... | |
Definition at line 119 of file sbndcode/sbndcode/CRT/CRTSimulation/CRTDetSimAlg.h.
using sbnd::crt::CRTDetSimAlg::Parameters = fhicl::Table<CRTDetSimParams> |
Definition at line 123 of file sbndcode/sbndcode/CRT/CRTSimulation/CRTDetSimAlg.h.
sbnd::crt::CRTDetSimAlg::CRTDetSimAlg | ( | const Parameters & | p, |
CLHEP::HepRandomEngine & | fRandEngine, | ||
double | g4RefTime | ||
) |
Definition at line 9 of file CRTDetSimAlg.cxx.
|
private |
Adds ADCs to a certain SiPM in a FEBData object
feb_data | The FEBData object. |
sipmID | The SiPM index (0-31). |
adc | ADC value to be added. |
Definition at line 104 of file CRTDetSimAlg.cxx.
void sbnd::crt::CRTDetSimAlg::ChargeResponse | ( | double | eDep, |
double | d0, | ||
double | d1, | ||
double | distToReadout, | ||
long & | npe0, | ||
long & | npe1, | ||
double & | q0, | ||
double & | q1 | ||
) |
Simulated the CRT charge response. Does not include waveform emulation.
eDep | The simulated energy deposited on the strip from G4 |
d0 | The distance to the optical fiber connected to SiPM 0 |
d1 | The distance to the optical fiber connected to SiPM 1 |
distToReadout | The distance to the readout |
npe0 | The output number of PEs for SiPM 0 |
npe1 | The output number of PEs for SiPM 1 |
q0 | The output ADC simulated value (double) for SiPM 0 |
q1 | The output ADC simulated value (double) for SiPM 1 |
Definition at line 575 of file CRTDetSimAlg.cxx.
void sbnd::crt::CRTDetSimAlg::ClearTaggers | ( | ) |
Function to clear member data at beginning of each art::event
Definition at line 665 of file CRTDetSimAlg.cxx.
|
private |
Configures the time offset to use, either a custom number, of the G4RefTime, depending on user configuration.
Definition at line 43 of file CRTDetSimAlg.cxx.
|
private |
Configures the waveform by reading waveform points from configuration and setting up the interpolator.
Definition at line 23 of file CRTDetSimAlg.cxx.
void sbnd::crt::CRTDetSimAlg::CreateData | ( | ) |
Returns FEBData objects.
This function is called after loop over AuxDetSimChannels where FillTaggers was used to perform first detsim step. This function applies trigger logic, deadtime, and close-in-time signal biasing effects. it produces the "triggered data" products which make it into the event. Use "GetData" to retrieve the result.
A struct to temporarily store information on a CRT Tagger trigger.
Resets this trigger object
Add a strip belonging to a particular trigger
Tells is a tagger is triggering or not
Returns true is the strip is in dead time
Definition at line 198 of file CRTDetSimAlg.cxx.
void sbnd::crt::CRTDetSimAlg::FillTaggers | ( | const uint32_t | adid, |
const uint32_t | adsid, | ||
std::vector< AuxDetIDE > | ides | ||
) |
Filles CRT taggers from AuxDetSimChannels.
Intented to be called within loop over AuxDetChannels and provided the AuxDetChannelID, AuxDetSensitiveChannelID, vector of AuxDetIDEs and the number of ides from the end of the vector to include in the detector sim. It handles deposited energy ti light output at SiPM (including attenuation) and to PEs from the SiPM with associated time stamps.
adid | The AuxDetChannelID |
adsid | The AuxDetSensitiveChannelID |
ides | The vector of AuxDetIDE |
Definition at line 361 of file CRTDetSimAlg.cxx.
std::vector< std::vector< int > > sbnd::crt::CRTDetSimAlg::GetAuxData | ( | ) |
Returns the indeces of SiPMs associated to the AuxDetIDEs
Definition at line 64 of file CRTDetSimAlg.cxx.
uint32_t sbnd::crt::CRTDetSimAlg::getChannelTriggerTicks | ( | float | t0, |
float | npeMean, | ||
float | r | ||
) |
Get the channel trigger time relative to the start of the MC event.
clock | The clock to count ticks on |
t0 | The starting time (which delay is added to) |
npe | Number of observed photoelectrons |
r | Distance between the energy deposit and strip readout end [mm] |
Definition at line 615 of file CRTDetSimAlg.cxx.
std::vector< std::pair< sbnd::crt::FEBData, std::vector< AuxDetIDE > > > sbnd::crt::CRTDetSimAlg::GetData | ( | ) |
Returns the simulated FEBData and AuxDetIDEs
Definition at line 59 of file CRTDetSimAlg.cxx.
|
inline |
Returns the CRT simulation parmeters
Definition at line 222 of file sbndcode/sbndcode/CRT/CRTSimulation/CRTDetSimAlg.h.
|
private |
Proccesses a set of CRT strips that belong to the same trigger. This method takes as input all the strips that belong to a single CRT tagger-level trigger and constructs FEBData objects from them.
strips | The set of strips that belong to the same trigger |
Definition at line 128 of file CRTDetSimAlg.cxx.
uint16_t sbnd::crt::CRTDetSimAlg::WaveformEmulation | ( | const uint32_t & | time_delay, |
const double & | adc | ||
) |
Emulated the CRT slow-shaped waveform. This is not a full waveform simulation, but it tries to encapsulate the main effect of the waveform, which is that the ADC counts are reduced if the signal arrives with a time delay w.r.t. the primary event trigger.
time_delay | The time delay of this SiPM signal w.r.t. the primary event trigger. |
adc | The simulated ADC counts (double) of this SiPM. |
Definition at line 71 of file CRTDetSimAlg.cxx.
|
private |
This member stores the indeces of SiPM per AuxDetIDE.
Definition at line 241 of file sbndcode/sbndcode/CRT/CRTSimulation/CRTDetSimAlg.h.
|
private |
This member stores the final FEBData for the CRT simulation.
Definition at line 239 of file sbndcode/sbndcode/CRT/CRTSimulation/CRTDetSimAlg.h.
|
private |
The random-number engine.
Definition at line 230 of file sbndcode/sbndcode/CRT/CRTSimulation/CRTDetSimAlg.h.
|
private |
The G4 reference time that can be used as a time offset.
Definition at line 232 of file sbndcode/sbndcode/CRT/CRTSimulation/CRTDetSimAlg.h.
|
private |
The interpolator used to estimate the CRT waveform.
Definition at line 235 of file sbndcode/sbndcode/CRT/CRTSimulation/CRTDetSimAlg.h.
|
private |
The table of CRT simulation parameters.
Definition at line 228 of file sbndcode/sbndcode/CRT/CRTSimulation/CRTDetSimAlg.h.
|
private |
A list of hit taggers, before any coincidence requirement (name -> tagger)
Definition at line 237 of file sbndcode/sbndcode/CRT/CRTSimulation/CRTDetSimAlg.h.
|
private |
The time that will be used in the simulation.
Definition at line 233 of file sbndcode/sbndcode/CRT/CRTSimulation/CRTDetSimAlg.h.