9 #ifndef SBND_OPDETSIM_DIGIARAPUCASBNDALG_HH
10 #define SBND_OPDETSIM_DIGIARAPUCASBNDALG_HH
12 #include "fhiclcpp/types/Atom.h"
13 #include "messagefacility/MessageLogger/MessageLogger.h"
14 #include "nurandom/RandomUtils/NuRandomService.h"
15 #include "CLHEP/Random/RandFlat.h"
16 #include "CLHEP/Random/RandGaussQ.h"
17 #include "CLHEP/Random/RandGeneral.h"
18 #include "CLHEP/Random/RandPoissonQ.h"
19 #include "CLHEP/Random/RandExponential.h"
27 #include <unordered_map>
69 CLHEP::HepRandomEngine*
engine =
nullptr;
84 std::vector<short unsigned int>& waveform,
91 std::vector<short unsigned int>& waveform,
123 std::vector<double>& wave,
128 std::vector<double>& wave,
132 std::unique_ptr<CLHEP::RandGeneral>& timeHisto,
133 std::vector<double>& wave,
134 std::map<int, int>
const& photonMap,
138 std::vector<double>& wave,
139 std::map<int, int>
const& photonMap,
142 void AddSPE(
size_t time_bin, std::vector<double>& wave,
const std::vector<double>&
fWaveformSP,
int nphotons);
143 void Pulse1PE(std::vector<double>& wave,
const double sampling);
145 void AddDarkNoise(std::vector<double>& wave , std::vector<double>& WaveformSP);
159 Name(
"ArapucaPeakTime"),
160 Comment(
"Single pe: Time of maximum amplitude in the SiPM pulse in ns")
164 Name(
"ArapucaPulseLength"),
165 Comment(
"Single pe: Time length of SiPM pulse")
169 Name(
"ArapucaMeanAmplitude"),
170 Comment(
"Single pe: mean amplitude of SiPM pulse in mV")
174 Name(
"ArapucaRiseTime"),
175 Comment(
"Single pe: Pulse rise time constant (exponential), from 0.1 to 0.9 of maximum amplitude")
179 Name(
"ArapucaFallTime"),
180 Comment(
"Single pe: Pulse decay time constant (exponential), from 0.1 to 0.9 of maximum amplitude")
184 Name(
"ArapucaVoltageToADC"),
185 Comment(
"Voltage to ADC convertion factor")
189 Name(
"ArapucaBaseline"),
190 Comment(
"Waveform baseline in ADC")
194 Name(
"ArapucaBaselineRMS"),
195 Comment(
"RMS of the electronics noise fluctuations in ADC counts")
199 Name(
"ArapucaDarkNoiseRate"),
200 Comment(
"Dark noise rate in Hz")
205 Comment(
"Probability for producing a signal of 2 PE in response to 1 photon")
209 Name(
"ArapucaSaturation"),
210 Comment(
"Saturation in number of p.e.")
214 Name(
"ArapucaVUVEff"),
215 Comment(
"Arapuca VUV efficiency (optical window + cavity)")
219 Name(
"ArapucaVISEff"),
220 Comment(
"Arapuca VIS efficiency (optical window + cavity)")
224 Name(
"XArapucaVUVEff"),
225 Comment(
"XArapuca VUV efficiency (optical window + cavity)")
229 Name(
"XArapucaVISEff"),
230 Comment(
"XArapuca VIS efficiency (optical window + cavity)")
234 Name(
"DecayTXArapucaVIS"),
235 Comment(
"X-Arapuca VIS decay time of EJ280 in ns")
239 Name(
"ArapucaDataFile"),
240 Comment(
"File containing timing distribution for ArapucaVUV (optical window + cavity), ArapucaVIS (optical window + cavity), XArapuca VUV (optical window)")
244 Name(
"ArapucaSinglePEmodel"),
245 Comment(
"Model used for single PE response of PMT. =0 is ideal, =1 is from X-TDBoard data (with overshoot)")
249 Name(
"DaphneFrequency"),
250 Comment(
"Sampling Frequency of the XArapucas with Daphne readouts (SBND Light detection system has 2 readout frequencies). Apsaia readouts read the frec value from LArSoft.")
254 Name(
"MakeAmpFluctuations"),
255 Comment(
"Include amplitude fluctuations to the simulated wvfs. For each PE, roll a rand number(gaussian distributed) with std=AmpFluctuation.")
259 Name(
"AmpFluctuation"),
260 Comment(
"Std of the gaussian fit (from data) to the 1PE distribution. Relative units i.e.: AmpFluctuation=0.1-> Amp(1PE)= 18+-1.8 ADC counts")
268 std::unique_ptr<DigiArapucaSBNDAlg>
operator()(
271 CLHEP::HepRandomEngine* engine
281 #endif // SBND_OPDETSIM_DIGIARAPUCASBNDALG_HH
double FindMinimumTime(sim::SimPhotons const &simphotons)
fhicl::Atom< double > saturation
fhicl::Atom< double > arapucaVUVEff
fhicl::Atom< double > xArapucaVUVEff
fhicl::Atom< double > arapucaVISEff
std::vector< double > fWaveformSP_Daphne
void AddDarkNoise(std::vector< double > &wave, std::vector< double > &WaveformSP)
fhicl::Atom< double > voltageToADC
CLHEP::HepRandomEngine * fEngine
Reference to art-managed random-number engine.
fhicl::Atom< double > baseline
void AddLineNoise(std::vector< double > &wave)
const double fXArapucaVISEff
DigiArapucaSBNDAlg::ConfigurationParameters_t fBaseConfig
Part of the configuration learned from configuration files.
const double fXArapucaVUVEff
std::unique_ptr< CLHEP::RandGeneral > fTimeXArapucaVUV
Simulation objects for optical detectors.
CLHEP::RandExponential fExponentialGen
fhicl::Atom< double > riseTime
fhicl::Atom< bool > makeAmpFluctuations
fhicl::Atom< double > crossTalk
fhicl::Atom< double > xArapucaVISEff
std::vector< double > fWaveformSP
void ConstructWaveformLite(int ch, sim::SimPhotonsLite const &litesimphotons, std::vector< short unsigned int > &waveform, std::string pdtype, bool is_daphne, double start_time, unsigned n_samples)
void AddSPE(size_t time_bin, std::vector< double > &wave, const std::vector< double > &fWaveformSP, int nphotons)
double frequency
Optical-clock frequency.
BEGIN_PROLOG vertical distance to the surface Name
std::unique_ptr< CLHEP::RandGeneral > fTimeTPB
const double fADCSaturation
detinfo::LArProperties const * larProp
LarProperties service provider.
const double fSampling_Daphne
fhicl::Atom< double > ampFluctuation
std::unique_ptr< DigiArapucaSBNDAlg > operator()(detinfo::LArProperties const &larProp, detinfo::DetectorClocksData const &clockData, CLHEP::HepRandomEngine *engine) const
fhicl::Atom< bool > ArapucasinglePEmodel
void CreateSaturation(std::vector< double > &wave)
DigiArapucaSBNDAlgMaker(Config const &config)
Collection of photons which recorded on one channel.
Compact representation of photons on a channel.
then echo fcl sbnd_project sbnd_project sbnd_project sbnd_project production production start_time
void CreatePDWaveform(sim::SimPhotons const &SimPhotons, double t_min, std::vector< double > &wave, std::string pdtype, bool is_daphne)
fhicl::Atom< double > pulseLength
CLHEP::RandPoissonQ fPoissonQGen
void CreatePDWaveformLite(std::map< int, int > const &photonMap, double t_min, std::vector< double > &wave, std::string pdtype, bool is_daphne)
Contains all timing reference information for the detector.
DigiArapucaSBNDAlg(ConfigurationParameters_t const &config)
CLHEP::RandGaussQ fGaussQGen
fhicl::Atom< double > meanAmplitude
CLHEP::HepRandomEngine * engine
void Pulse1PE(std::vector< double > &wave, const double sampling)
fhicl::Atom< double > darkNoiseRate
fhicl::Atom< double > peakTime
fhicl::Atom< double > fallTime
const ConfigurationParameters_t fParams
fhicl::Atom< double > baselineRMS
double frequency_Daphne
Optical-clock frequency for daphne readouts.
bool ArapucaSinglePEmodel
fhicl::Atom< double > DaphneFrequency
void ConstructWaveform(int ch, sim::SimPhotons const &simphotons, std::vector< short unsigned int > &waveform, std::string pdtype, bool is_daphne, double start_time, unsigned n_samples)
void SinglePDWaveformCreatorLite(double effT, std::unique_ptr< CLHEP::RandGeneral > &timeHisto, std::vector< double > &wave, std::map< int, int > const &photonMap, double const &t_min, bool is_daphne)
fhicl::Atom< std::string > arapucaDataFile
std::unordered_map< raw::Channel_t, std::vector< double > > fFullWaveforms
std::string ArapucaDataFile
double FindMinimumTimeLite(std::map< int, int > const &photonMap)
fhicl::Atom< double > decayTXArapucaVIS