29 #include "CLHEP/Random/RandFlat.h" 30 #include "CLHEP/Random/RandPoisson.h" 64 void AddDarkNoise(std::vector<double>& RawWF,
double gain);
66 std::vector<double>& OldPulse,
67 std::vector<double>& NewPulse,
94 produces<std::vector<optdata::ChannelDataGroup>>();
116 std::vector<double>& OldPulse,
117 std::vector<double>& NewPulse,
121 if ((time + NewPulse.size()) > OldPulse.size() && extend)
122 OldPulse.resize(time + NewPulse.size());
123 for (
size_t i = 0; i < NewPulse.size() && (time + i) < OldPulse.size(); ++i)
124 OldPulse[time + i] += NewPulse[i] * factor;
134 unsigned int NumberOfPulses =
fPoissonRandom.fire(MeanDarkPulses);
135 for (
size_t i = 0; i != NumberOfPulses; ++i) {
155 chData.reserve(rawWF.size());
158 double thisSample = rawWF[time];
163 if (CLHEP::RandFlat::shoot(1.0) < (thisSample - int(thisSample))) thisCount += 1;
168 chData.push_back(thisCount);
173 unsigned int nFluc = CLHEP::RandPoisson::shoot(
fPedFlucRate * timeSpan);
174 for (
size_t i = 0; i < nFluc; ++i) {
177 if (CLHEP::RandFlat::shoot(0., 1.) > 0.5) {
183 chData[pulseTime] = amp;
199 std::unique_ptr<std::vector<optdata::ChannelDataGroup>> StoragePtr(
200 new std::vector<optdata::ChannelDataGroup>);
208 double timeEnd_ns =
fTimeEnd * 1000;
230 std::vector<double>(timeSliceWindow, 0.0));
232 std::vector<double>(timeSliceWindow, 0.0));
246 itOpDet != ThePhotCollection.end();
256 if (Phot.Time > timeBegin_ns && Phot.Time < timeEnd_ns) {
281 for (
unsigned short iCh = 0; iCh < rawWF_LowGain.size(); ++iCh) {
282 rawWF_LowGain[iCh].resize((timeEnd_ns - timeBegin_ns) * sampleFreq_ns);
283 rawWF_HighGain[iCh].resize((timeEnd_ns - timeBegin_ns) * sampleFreq_ns);
299 rawWFGroup_HighGain.push_back(chData_HighGain);
300 rawWFGroup_LowGain.push_back(chData_LowGain);
303 StoragePtr->push_back(rawWFGroup_HighGain);
304 StoragePtr->push_back(rawWFGroup_LowGain);
306 evt.
put(std::move(StoragePtr));
art::ServiceHandle< geo::Geometry const > fGeom
optdata::ChannelData ApplyDigitization(std::vector< double > const RawWF, optdata::Channel_t const ch) const
base_engine_t & createEngine(seed_t seed)
optdata::ADC_Count_t fSaturationScale
int OpChannel() const
Returns the optical channel number this object is associated to.
CLHEP::RandFlat fFlatRandom
EDProducer(fhicl::ParameterSet const &pset)
All information of a photon entering the sensitive optical detector volume.
OptDetDigitizer(const fhicl::ParameterSet &)
unsigned int NOpChannels() const
Number of electronics channels for all the optical detectors.
void produce(art::Event &) override
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Simulation objects for optical detectors.
#define DEFINE_ART_MODULE(klass)
optdata::ADC_Count_t fPedFlucAmp
An art service to assist in the distribution of guaranteed unique seeds to all engines within an art ...
void AddWaveform(optdata::TimeSlice_t time, std::vector< double > &OldPulse, std::vector< double > &NewPulse, double factor, bool extend=false)
CLHEP::RandPoisson fPoissonRandom
art::ServiceHandle< OpDigiProperties > fOpDigiProperties
Collection of photons which recorded on one channel.
list_type::const_iterator const_iterator
std::vector< double > fSinglePEWaveform
std::vector< optdata::ADC_Count_t > fPedMeanArray
CLHEP::HepRandomEngine & fEngine
Collection of sim::SimPhotons, indexed by channel number.
void AddDarkNoise(std::vector< double > &RawWF, double gain)
static sim::SimPhotonsCollection GetSimPhotonsCollection(const art::Event &evt, std::string moduleLabel)
art framework interface to geometry description