9 #ifndef SBND_OPDETSIM_DIGIPMTSBNDALG_HH
10 #define SBND_OPDETSIM_DIGIPMTSBNDALG_HH
12 #include "fhiclcpp/types/Atom.h"
13 #include "fhiclcpp/types/DelegatedParameter.h"
14 #include "fhiclcpp/types/OptionalDelegatedParameter.h"
15 #include "messagefacility/MessageLogger/MessageLogger.h"
16 #include "nurandom/RandomUtils/NuRandomService.h"
17 #include "CLHEP/Random/RandFlat.h"
18 #include "CLHEP/Random/RandGaussQ.h"
19 #include "CLHEP/Random/RandGeneral.h"
20 #include "CLHEP/Random/RandPoissonQ.h"
21 #include "CLHEP/Random/RandExponential.h"
22 #include "art/Utilities/make_tool.h"
30 #include <unordered_map>
71 CLHEP::HepRandomEngine*
engine =
nullptr;
82 std::vector<short unsigned int>& waveform,
89 std::vector<short unsigned int>& waveform,
90 std::unordered_map<int, sim::SimPhotons>& DirectPhotonsMap,
91 std::unordered_map<int, sim::SimPhotons>& ReflectedPhotonsMap,
98 std::vector<short unsigned int>& waveform,
105 std::vector<short unsigned int>& waveform,
106 std::unordered_map<int, sim::SimPhotonsLite>& DirectPhotonsMap,
107 std::unordered_map<int, sim::SimPhotonsLite>& ReflectedPhotonsMap,
141 void AddSPE(
size_t time_bin, std::vector<double>& wave);
142 void Pulse1PE(std::vector<double>& wave);
152 std::vector<double>& wave,
158 std::vector<double>& wave,
159 std::unordered_map<int, sim::SimPhotons>& DirectPhotonsMap,
160 std::unordered_map<int, sim::SimPhotons>& ReflectedPhotonsMap);
164 std::vector<double>& wave,
170 std::vector<double>& wave,
171 std::unordered_map<int, sim::SimPhotonsLite>& DirectPhotonsMap,
172 std::unordered_map<int, sim::SimPhotonsLite>& ReflectedPhotonsMap);
180 std::unordered_map<int, sim::SimPhotons>& directPhotonsOnPMTS);
185 std::unordered_map<int, sim::SimPhotonsLite>& directPhotonsOnPMTS);
197 Comment(
"Single pe: Time of maximum amplitude in the PMT pulse in ns")
202 Comment(
"Single pe: Transit time spread in ns")
207 Comment(
"Time delay of the 30 m long readout cable in ns")
211 Name(
"PMTMeanAmplitude"),
212 Comment(
"Single pe: mean amplitude of PMT pulse in pC")
217 Comment(
"Single pe: Pulse rise time constant (exponential), from 0.1 to 0.9 of maximum amplitude")
222 Comment(
"Single pe: Pulse decay time constant (exponential), from 0.1 to 0.9 of maximum amplitude")
226 Name(
"PMTChargeToADC"),
227 Comment(
"Charge to ADC convertion factor")
232 Comment(
"Waveform baseline in ADC")
236 Name(
"PMTBaselineRMS"),
237 Comment(
"RMS of the electronics noise fluctuations in ADC counts")
241 Name(
"PMTDarkNoiseRate"),
242 Comment(
"Dark noise rate in Hz")
246 Name(
"PMTSaturation"),
247 Comment(
"Saturation in number of p.e.")
252 Comment(
"PMT quantum efficiency for direct (VUV) light")
257 Comment(
"PMT quantum efficiency for reflected (TPB emitted)light")
261 Name(
"PMTSinglePEmodel"),
262 Comment(
"Model used for single PE response of PMT. =0 is ideal, =1 is testbench")
267 Comment(
"File containing timing emission distribution for TPB and single pe pulse from data")
271 Name(
"MakeGainFluctuations"),
272 Comment(
"Option to fluctuate PMT gain")
276 Name(
"GainFluctuationsParams"),
277 Comment(
"Parameters used for SinglePE response fluctuations")
287 CLHEP::HepRandomEngine* engine
297 #endif //SBND_OPDETSIM_DIGIPMTSBNDALG_HH
std::unique_ptr< CLHEP::RandGeneral > fTimeTPB
void CreatePDWaveformLiteCoatedPMT(int ch, double t_min, std::vector< double > &wave, std::unordered_map< int, sim::SimPhotonsLite > &DirectPhotonsMap, std::unordered_map< int, sim::SimPhotonsLite > &ReflectedPhotonsMap)
void CreatePDWaveformLite(sim::SimPhotonsLite const &litesimphotons, double t_min, std::vector< double > &wave, int ch, std::string pdtype)
ConfigurationParameters_t fParams
void ConstructWaveform(int ch, sim::SimPhotons const &simphotons, std::vector< short unsigned int > &waveform, std::string pdtype, double start_time, unsigned n_sample)
CLHEP::RandExponential fExponentialGen
DigiPMTSBNDAlg::ConfigurationParameters_t fBaseConfig
void ConstructWaveformLiteCoatedPMT(int ch, std::vector< short unsigned int > &waveform, std::unordered_map< int, sim::SimPhotonsLite > &DirectPhotonsMap, std::unordered_map< int, sim::SimPhotonsLite > &ReflectedPhotonsMap, double start_time, unsigned n_sample)
fhicl::Atom< double > transitTime
bool MakeGainFluctuations
void CreateSaturation(std::vector< double > &wave)
fhicl::Atom< double > pmtdarkNoiseRate
std::vector< double > fSinglePEWave
void ConstructWaveformLite(int ch, sim::SimPhotonsLite const &litesimphotons, std::vector< short unsigned int > &waveform, std::string pdtype, double start_time, unsigned n_sample)
fhicl::ParameterSet GainFluctuationsParams
fhicl::Atom< double > pmtfallTime
const double transitTimeSpread_frac
Simulation objects for optical detectors.
void AddDarkNoise(std::vector< double > &wave)
double Transittimespread(double fwhm)
CLHEP::HepRandomEngine * engine
void AddLineNoise(std::vector< double > &wave)
std::unique_ptr< DigiPMTSBNDAlg > operator()(detinfo::LArProperties const &larProp, detinfo::DetectorClocksData const &clockData, CLHEP::HepRandomEngine *engine) const
fhicl::Atom< std::string > pmtDataFile
void CreatePDWaveformCoatedPMT(int ch, double t_min, std::vector< double > &wave, std::unordered_map< int, sim::SimPhotons > &DirectPhotonsMap, std::unordered_map< int, sim::SimPhotons > &ReflectedPhotonsMap)
CLHEP::RandPoissonQ fPoissonQGen
CLHEP::HepRandomEngine * fEngine
Reference to art-managed random-number engine.
void ConstructWaveformCoatedPMT(int ch, std::vector< short unsigned int > &waveform, std::unordered_map< int, sim::SimPhotons > &DirectPhotonsMap, std::unordered_map< int, sim::SimPhotons > &ReflectedPhotonsMap, double start_time, unsigned n_sample)
BEGIN_PROLOG vertical distance to the surface Name
fhicl::Atom< bool > makeGainFluctuations
fhicl::Atom< double > pmtsaturation
std::unique_ptr< opdet::PMTGainFluctuations > fPMTGainFluctuationsPtr
fhicl::Atom< double > qEDirect
DigiPMTSBNDAlg(ConfigurationParameters_t const &config)
fhicl::Atom< double > pmtmeanAmplitude
fhicl::Atom< double > pmtchargeToADC
fhicl::Atom< bool > PMTsinglePEmodel
fhicl::Atom< double > pmtbaselineRMS
void CreatePDWaveform(sim::SimPhotons const &SimPhotons, double t_min, std::vector< double > &wave, int ch, std::string pdtype)
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
fhicl::Atom< double > cableTime
Contains all timing reference information for the detector.
std::unordered_map< raw::Channel_t, std::vector< double > > fFullWaveforms
fhicl::Atom< double > tts
fhicl::Atom< double > pmtriseTime
void Pulse1PE(std::vector< double > &wave)
DigiPMTSBNDAlgMaker(Config const &config)
fhicl::Atom< double > qERefl
double FindMinimumTimeLite(sim::SimPhotonsLite const &litesimphotons, int ch, std::string pdtype, std::unordered_map< int, sim::SimPhotonsLite > &directPhotonsOnPMTS)
void AddSPE(size_t time_bin, std::vector< double > &wave)
fhicl::OptionalDelegatedParameter gainFluctuationsParams
detinfo::LArProperties const * larProp
CLHEP::RandGaussQ fGaussQGen
fhicl::Atom< double > pmtbaseline
double FindMinimumTime(sim::SimPhotons const &, int ch, std::string pdtype, std::unordered_map< int, sim::SimPhotons > &directPhotonsOnPMTS)