26 #include "nurandom/RandomUtils/NuRandomService.h" 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,
93 produces<std::vector< optdata::ChannelDataGroup> >();
115 std::vector<double> &OldPulse,
116 std::vector<double> &NewPulse,
120 if( (time+NewPulse.size()) > OldPulse.size() && extend )
121 OldPulse.resize(time + NewPulse.size());
122 for(
size_t i = 0; i<NewPulse.size() && (time+i)<OldPulse.size(); ++i)
123 OldPulse[time+i] += NewPulse[i] * factor;
132 unsigned int NumberOfPulses =
fPoissonRandom.fire(MeanDarkPulses);
133 for(
size_t i=0; i!=NumberOfPulses; ++i)
157 chData.reserve(rawWF.size());
161 double thisSample = rawWF[
time];
166 if(CLHEP::RandFlat::shoot(1.0) < (thisSample -
int(thisSample)))
172 chData.push_back(thisCount);
177 unsigned int nFluc = CLHEP::RandPoisson::shoot(
fPedFlucRate * timeSpan);
178 for(
size_t i=0; i<nFluc; ++i)
182 if( CLHEP::RandFlat::shoot(0.,1.) > 0.5)
189 chData[pulseTime] = amp;
205 std::unique_ptr< std::vector<optdata::ChannelDataGroup > > StoragePtr (
new std::vector<optdata::ChannelDataGroup>);
212 double timeEnd_ns =
fTimeEnd * 1000;
233 std::vector<std::vector<double> > rawWF_HighGain(
fGeom->
NOpChannels(),std::vector<double>(timeSliceWindow,0.0));
234 std::vector<std::vector<double> > rawWF_LowGain(
fGeom->
NOpChannels(),std::vector<double>(timeSliceWindow,0.0));
259 if( Phot.Time > timeBegin_ns && Phot.Time < timeEnd_ns )
279 for(
unsigned short iCh = 0; iCh < rawWF_LowGain.size(); ++iCh){
280 rawWF_LowGain[iCh].resize((timeEnd_ns - timeBegin_ns) * sampleFreq_ns);
281 rawWF_HighGain[iCh].resize((timeEnd_ns - timeBegin_ns) * sampleFreq_ns);
296 rawWFGroup_HighGain.push_back(chData_HighGain);
297 rawWFGroup_LowGain.push_back(chData_LowGain);
300 StoragePtr->push_back(rawWFGroup_HighGain);
301 StoragePtr->push_back(rawWFGroup_LowGain);
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
art framework interface to geometry description
Simulation objects for optical detectors.
#define DEFINE_ART_MODULE(klass)
optdata::ADC_Count_t fPedFlucAmp
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
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)