251 unsigned int signalSize =
fNTicks;
254 std::vector<short> adcvec(signalSize, 0);
255 std::vector<short> adcvecPreSpill(signalSize, 0);
256 std::vector<short> adcvecPostSpill(signalSize, 0);
257 std::vector<const sim::SimChannel*> chanHandle;
268 for(
size_t c = 0;
c < chanHandle.size(); ++
c){
269 channels[chanHandle[
c]->Channel()] = chanHandle[
c];
277 std::unique_ptr< std::vector<raw::RawDigit> > digcol(
new std::vector<raw::RawDigit>);
278 std::unique_ptr< std::vector<raw::RawDigit> > digcolPreSpill(prepost?
new std::vector<raw::RawDigit>:
nullptr);
279 std::unique_ptr< std::vector<raw::RawDigit> > digcolPostSpill(prepost?
new std::vector<raw::RawDigit>:
nullptr);
281 unsigned int chan = 0;
285 std::vector<double> fChargeWorkPreSpill, fChargeWorkPostSpill;
296 digcolPreSpill->reserve(geo->
Nchannels());
297 digcolPostSpill->reserve(geo->
Nchannels());
301 for(chan = 0; chan < geo->
Nchannels(); chan++) {
309 fChargeWorkPreSpill.clear();
310 fChargeWorkPostSpill.clear();
311 fChargeWorkPreSpill.resize(
fNTicks,0);
312 fChargeWorkPostSpill.resize(
fNTicks,0);
335 fChargeWorkPreSpill.resize(
fNTicks,0);
336 fChargeWorkPostSpill.resize(
fNTicks,0);
337 sss->
Convolute(clockData, chan, fChargeWorkPreSpill);
338 sss->
Convolute(clockData, chan, fChargeWorkPostSpill);
366 double *fChargeWork_a=0;
367 double *fChargeWorkPreSpill_a=0;
368 double *fChargeWorkPostSpill_a=0;
370 short *adcvecPreSpill_a=0;
371 short *adcvecPostSpill_a=0;
375 float *noise_a_Upre=0;
376 float *noise_a_Vpre=0;
377 float *noise_a_Zpre=0;
378 float *noise_a_Upost=0;
379 float *noise_a_Vpost=0;
380 float *noise_a_Zpost=0;
384 adcvec_a = adcvec.data();
386 fChargeWorkPreSpill_a = fChargeWorkPreSpill.data();
387 fChargeWorkPostSpill_a = fChargeWorkPostSpill.data();
388 adcvecPreSpill_a = adcvecPreSpill.data();
389 adcvecPostSpill_a = adcvecPostSpill.data();
412 mf::LogError(
"SimWireDUNE10kt") <<
"ERROR: CHANNEL NUMBER " << chan <<
" OUTSIDE OF PLANE";
418 for(
unsigned int i = 0; i < signalSize; ++i){
419 if(view==
geo::kU) { tnoise = noise_a_U[i]; }
420 else if (view==
geo::kV) { tnoise = noise_a_V[i]; }
421 else { tnoise = noise_a_Z[i]; }
422 tmpfv = tnoise + fChargeWork_a[i];
427 if ( tmpfv < 0 - ped_mean)
429 adcvec_a[i] = (tmpfv >=0) ? (
short) (tmpfv+0.5) : (short) (tmpfv-0.5);
432 for(
unsigned int i = 0; i < signalSize; ++i){
433 if(view==
geo::kU) { tnoisepre = noise_a_Upre[i]; tnoisepost = noise_a_Upost[i]; }
434 else if(view==
geo::kV) { tnoisepre = noise_a_Vpre[i]; tnoisepost = noise_a_Vpost[i]; }
435 else { tnoisepre = noise_a_Zpre[i]; tnoisepost = noise_a_Zpost[i]; }
437 tmpfv = tnoisepre + fChargeWorkPreSpill_a[i];
443 if ( tmpfv < 0- ped_mean ){
446 adcvecPreSpill_a[i] = (tmpfv >=0) ? (
short) (tmpfv+0.5) : (short) (tmpfv-0.5);
448 tmpfv = tnoisepost + fChargeWorkPostSpill_a[i];
454 if ( tmpfv < 0 - ped_mean){
457 adcvecPostSpill_a[i] = (tmpfv >=0) ? (
short) (tmpfv+0.5) : (short) (tmpfv-0.5);
463 std::map< double, int > fShapingTimeOrder;
464 fShapingTimeOrder = { {0.5, 0}, {1.0, 1}, {2.0, 2}, {3.0, 3} };
467 if ( fShapingTimeOrder.find( fShapingTime ) != fShapingTimeOrder.end() ){
469 fNoiseFactVec.resize(2);
470 for (
auto& item : tempNoiseVec) {
471 fNoiseFactVec[i] = item.at( fShapingTimeOrder.find( fShapingTime )->second );
472 fNoiseFactVec[i] *= fASICGain/4.7;
479 <<
"Shaping Time received from signalservices_microboone.fcl is not one of allowed values" 481 <<
"Allowed values: 0.5, 1.0, 2.0, 3.0 usec" 487 CLHEP::RandGaussQ rGauss_Ind(
fEngine, 0.0, fNoiseFactVec[0]);
488 CLHEP::RandGaussQ rGauss_Col(
fEngine, 0.0, fNoiseFactVec[1]);
491 for(
unsigned int i = 0; i < signalSize; ++i){
492 if(view==
geo::kU) { tnoise = rGauss_Ind.fire(); }
493 else if (view==
geo::kV) { tnoise = rGauss_Ind.fire(); }
494 else { tnoise = rGauss_Col.fire(); }
495 tmpfv = tnoise + fChargeWork_a[i];
500 if ( tmpfv < 0 - ped_mean)
502 adcvec_a[i] = (tmpfv >=0) ? (
short) (tmpfv+0.5) : (short) (tmpfv-0.5);
505 for(
unsigned int i = 0; i < signalSize; ++i){
506 if(view==
geo::kU) { tnoisepre = rGauss_Ind.fire(); tnoisepost = rGauss_Ind.fire(); }
507 else if(view==
geo::kV) { tnoisepre = rGauss_Ind.fire(); tnoisepost = rGauss_Ind.fire(); }
508 else { tnoisepre = rGauss_Col.fire(); tnoisepost = rGauss_Col.fire(); }
510 tmpfv = tnoisepre + fChargeWorkPreSpill_a[i];
516 if ( tmpfv < 0 - ped_mean){
519 adcvecPreSpill_a[i] = (tmpfv >=0) ? (
short) (tmpfv+0.5) : (short) (tmpfv-0.5);
521 tmpfv = tnoisepost + fChargeWorkPostSpill_a[i];
527 if ( tmpfv < 0 - ped_mean){
530 adcvecPostSpill_a[i] = (tmpfv >=0) ? (
short) (tmpfv+0.5) : (short) (tmpfv-0.5);
535 for(
unsigned int i = 0; i < signalSize; ++i){
536 tmpfv = fChargeWork_a[i];
541 if ( tmpfv < 0 - ped_mean)
543 adcvec_a[i] = (tmpfv >=0) ? (
short) (tmpfv+0.5) : (short) (tmpfv-0.5);
546 for(
unsigned int i = 0; i < signalSize; ++i){
547 tmpfv = fChargeWorkPreSpill_a[i];
552 if ( tmpfv < 0 - ped_mean) {
553 tmpfv = 0- ped_mean; }
554 adcvecPreSpill_a[i] = (tmpfv >=0) ? (
short) (tmpfv+0.5) : (short) (tmpfv-0.5);
555 tmpfv = fChargeWorkPostSpill_a[i];
560 if ( tmpfv < 0 - ped_mean) {
561 tmpfv = 0- ped_mean; }
562 adcvecPostSpill_a[i] = (tmpfv >=0) ? (
short) (tmpfv+0.5) : (short) (tmpfv-0.5);
580 adcvec.resize(signalSize);
583 digcol->push_back(rd);
599 adcvecPreSpill.resize(signalSize);
600 adcvecPostSpill.resize(signalSize);
603 digcolPreSpill->push_back(rdPreSpill);
605 digcolPostSpill->push_back(rdPostSpill);
unsigned int fNoiseArrayPoints
number of points in randomly generated noise array
std::string fDriftEModuleLabel
module making the ionization electrons
double GetShapingTime(Channel channel) const override
Collection of charge vs time digitized from a single readout channel.
Energy deposited on a readout channel by simulated tracks.
unsigned int fNoiseModel
noise model
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
std::vector< DoubleVec > GetNoiseFactVec() const override
float fInductionPed
ADC value of baseline for induction plane.
Planes which measure Z direction.
const float adcsaturation
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
std::vector< std::vector< float > > fNoiseV
noise on each channel for each time for V plane
unsigned int fNoiseOn
noise turned on or off for debugging; default is on
unsigned int Nchannels() const
Returns the number of TPC readout channels in the detector.
std::vector< std::vector< float > > fNoiseZ
noise on each channel for each time for Z (collection) plane
float fCollectionPed
ADC value of baseline for collection plane.
unsigned int fNTimeSamples
number of ADC readout samples in all readout frames (per event)
int fNearestNeighbor
Maximum distance between hits above threshold before they are separated into different blocks...
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
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
void Convolute(detinfo::DetectorClocksData const &clockData, Channel channel, std::vector< T > &func) const
std::vector< double > fChargeWork
std::vector< std::vector< float > > fNoiseU
noise on each channel for each time for U plane
void Compress(std::vector< short > &adc, raw::Compress_t compress)
Compresses a raw data buffer.
CLHEP::HepRandomEngine & fEngine
raw::Compress_t fCompression
compression type to use
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
double GetASICGain(Channel channel) const override
unsigned int fNSamplesReadout
number of ADC readout samples in 1 readout frame
LArSoft geometry interface.
unsigned int fZeroThreshold
Zero suppression threshold.
int fNTicks
number of ticks of the clock
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
Signal from collection planes.
std::vector< double > DoubleVec