214 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(
evt);
220 art::ServiceHandle<geo::Geometry> geo;
226 std::vector<const sim::SimChannel*> chanHandle;
230 art::ServiceHandle<util::SignalShapingServiceSBND> sss;
236 std::vector<const sim::SimChannel*> channels(geo->Nchannels(),
nullptr);
237 for (
size_t c = 0; c < chanHandle.size(); ++c) {
238 channels.at(chanHandle.at(c)->Channel()) = chanHandle.at(c);
245 std::vector<double> chargeWork(
fNTicks, 0.);
251 std::unique_ptr< std::vector<raw::RawDigit>> digcol(
new std::vector<raw::RawDigit>);
254 unsigned int chan = 0;
255 art::ServiceHandle<util::LArFFT> fFFT;
258 std::map<int, double>::iterator mapIter;
259 for (chan = 0; chan < geo->Nchannels(); chan++) {
261 if (channelStatus.IsBad(chan))
continue;
265 std::fill(chargeWork.begin(), chargeWork.end(), 0.);
269 for (
int t = 0; t < (int)(chargeWork.size()); ++t) {
271 int tdc = clockData.TPCTick2TDC(t);
274 if ( tdc < 0 )
continue;
276 chargeWork.at(t) = sc->
Charge(tdc);
281 sss->Convolute(clockData, chan, chargeWork);
284 std::vector<float> noisetmp(
fNTicks, 0.);
301 ped_mean += rGaussPed.fire();
306 float chargecontrib = chargeWork.at(i);
307 if (chargecontrib>preamp_sat) chargecontrib=preamp_sat;
309 float adcval = noisetmp.at(i) + chargecontrib + ped_mean;
322 adcvec.at(i) = (
unsigned short)(adcval+0.5);
337 rd.SetPedestal(ped_mean);
338 digcol->push_back(rd);
342 evt.put(std::move(digcol));
Collection of charge vs time digitized from a single readout channel.
float fInductionSat
ADC value of pre-amp saturation for induction plane.
Energy deposited on a readout channel by simulated tracks.
std::string fDriftEModuleLabel
module making the ionization electrons
float fCollectionSat
ADC value of pre-amp saturation for collection plane.
bool fGenNoise
if True -> Gen Noise. if False -> Skip noise generation entierly
float fInductionPed
ADC value of baseline for induction plane.
art::ServiceHandle< ChannelNoiseService > noiseserv
static constexpr float adcsaturation
Signal from induction planes.
double Charge(TDC_t tdc) const
Returns the total number of ionization electrons on this channel in the specified TDC...
enum geo::_plane_sigtype SigType_t
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
Class providing information about the quality of channels.
size_t fNTicks
number of ticks of the clock
unsigned int fNTimeSamples
number of ADC readout samples in all readout frames (per event)
float fBaselineRMS
ADC value of baseline RMS within each channel.
CLHEP::HepRandomEngine & fPedestalEngine
TH1D * fNoiseDist
distribution of noise counts
void Compress(std::vector< short > &adc, raw::Compress_t compress)
Compresses a raw data buffer.
raw::Compress_t fCompression
compression type to use
float fCollectionPed
ADC value of baseline for collection plane.