190 const string myname =
"SimWireDUNE::produce: ";
196 std::vector<const sim::SimChannel*> chanHandle;
197 std::vector<const sim::SimChannel*> simChannels(
m_pgeo->
Nchannels(),
nullptr);
199 for (
size_t c=0;
c<chanHandle.size(); ++
c ) {
200 simChannels[chanHandle[
c]->Channel()] = chanHandle[
c];
204 std::vector<const raw::RawDigit*> inputDigitsHandle;
205 std::vector<const raw::RawDigit*> inputDigits(
m_pgeo->
Nchannels(),
nullptr);
208 for (
size_t c=0;
c<inputDigitsHandle.size(); ++
c ) {
210 inputDigits[dig->
Channel()] = dig;
216 std::unique_ptr<std::vector<raw::RawDigit>> digcol(
new std::vector<raw::RawDigit>);
221 unsigned int nTickReadout = detProp.ReadOutWindowSize();
231 std::vector<AdcSignal> fChargeWork;
235 fChargeWork.insert(fChargeWork.end(), dig->
ADCs().begin(), dig->
ADCs().end());
251 cout << myname <<
"Signals after noise:" <<
endl;
252 for (
unsigned int itck=0; itck<fChargeWork.size(); ++itck ) {
253 if(fChargeWork[itck] > 0 )
254 cout << myname <<
" " << itck <<
": chg=" << fChargeWork[itck] <<
endl;
266 std::vector<short> adcvec(fChargeWork.size(), 0);
267 const short adcmax = 4095;
268 for (
unsigned int itck=0; itck<fChargeWork.size(); ++itck ) {
271 bool useOldAdc =
false;
276 adc =
m_pads->count(adcin, chan);
284 if ( adcin > 0 ) adc1 = (short) (adcin + 0.5);
285 if ( adc1 > adcmax ) adc1 = adcmax;
288 static int ndump = 1000;
289 if ( ndump && show ) {
290 cout << myname <<
" ADC: " << adc1 <<
" --> " << adc <<
" (" << adcin <<
")" <<
endl;
299 adcvec.resize(nTickReadout);
312 for (
bool kept : acs.filter )
if ( kept ) ++nkeep;
323 rd.SetPedestal(pedval, pedrms);
324 digcol->push_back(rd);
art::ServiceHandle< PedestalAdditionService > m_ppad
art::ServiceHandle< SimChannelExtractService > m_pscx
bool fKeepEmptyChannels
Write out empty channels iff true.
const ADCvector_t & ADCs() const
Reference to the compressed ADC count vector.
enum raw::_compress Compress_t
Collection of charge vs time digitized from a single readout channel.
virtual int modify(Channel chan, AdcCountVector &adcvec) const =0
Energy deposited on a readout channel by simulated tracks.
art::ServiceHandle< AdcSuppressService > m_pzs
virtual int addNoise(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, Channel chan, AdcSignalVector &sigs) const =0
bool fNoiseOn
noise turned on or off for debugging; default is on
std::unique_ptr< AdcSimulator > m_pads
ChannelID_t Channel() const
DAQ channel this raw data was read from.
art::ServiceHandle< geo::Geometry > m_pgeo
art::ServiceHandle< ChannelNoiseService > m_pcns
unsigned int Nchannels() const
Returns the number of TPC readout channels in the detector.
bool fUseRawDigitInput
Use (presumably noise-free) RawDigits for input instead of SimChannels.
std::string fRawDigitInputLabel
The module label for the RawDigits to read in.
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
bool fPedestalOn
switch for simulation of nonzero pedestals
art::ServiceHandle< AdcDistortionService > m_pdis
virtual int addPedestal(Channel chan, AdcSignalVector &sigs, float &ped, float &pedrms) const =0
virtual int filter(const AdcCountVector &sigs, Channel chan, AdcPedestal ped, AdcFilterVector &keep) const =0
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
art::ServiceHandle< AdcCompressService > m_pcmp
std::string fSimChannelLabel
Data product holding the ionization electrons.
virtual int compress(AdcCountVector &sigs, const AdcFilterVector &keep, AdcCount offset, raw::Compress_t &comp) const =0
bool fSuppressOn
switch for simulation of zero suppression
QTextStream & endl(QTextStream &s)
bool fDistortOn
switch for simulation of stuck bits