LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
detsim::SimWire Class Reference
Inheritance diagram for detsim::SimWire:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Types

using ModuleType = EDProducer
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 SimWire (fhicl::ParameterSet const &pset)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
void fillProductDescriptions ()
 
void registerProducts (ProductDescriptions &productsToRegister)
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
std::unique_ptr< Worker > makeWorker (WorkerParams const &wp)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Protected Member Functions

ConsumesCollector & consumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Private Member Functions

void produce (art::Event &evt) override
 
void beginJob () override
 
void ConvoluteResponseFunctions ()
 convolute electronics and field response More...
 
void SetFieldResponse ()
 response of wires to field More...
 
void SetElectResponse ()
 response of electronics More...
 
void GenNoise (std::vector< float > &array, CLHEP::HepRandomEngine &engine)
 

Private Attributes

std::string fDriftEModuleLabel
 module making the ionization electrons More...
 
raw::Compress_t fCompression
 compression type to use More...
 
int fNTicks
 number of ticks of the clock More...
 
double fSampleRate
 sampling rate in ns More...
 
unsigned int fNSamplesReadout
 number of ADC readout samples in 1 readout frame More...
 
double fCol3DCorrection
 
double fInd3DCorrection
 
unsigned int fNElectResp
 number of entries from response to use More...
 
double fInputFieldRespSamplingPeriod
 Sampling period in the input field response. More...
 
double fShapeTimeConst
 time constants for exponential shaping More...
 
double fADCPerPCAtLowestASICGain
 ADCs/pC at lowest gain setting of 4.7 mV/fC. More...
 
double fASICGainInMVPerFC
 actual gain setting used in mV/fC More...
 
int fNoiseNchToSim
 number of noise channels to generate More...
 
std::string fNoiseModelChoice
 choice for noise model More...
 
std::string fNoiseFluctChoice
 choice for noise freq component mag fluctuations More...
 
std::vector< int > fFieldRespTOffset
 field response time offset in ticks More...
 
std::vector< int > fCalibRespTOffset
 calib response time offset in ticks More...
 
std::vector< float > fColFieldParams
 collection plane field function parameterization More...
 
std::vector< float > fIndFieldParams
 induction plane field function parameterization More...
 
std::vector< double > fColFieldResponse
 response function for the field @ collection plane More...
 
std::vector< double > fIndFieldResponse
 response function for the field @ induction plane More...
 
std::vector< TComplex > fColShape
 response function for the field @ collection plane More...
 
std::vector< TComplex > fIndShape
 response function for the field @ induction plane More...
 
std::vector< double > fElectResponse
 response function for the electronics More...
 
std::vector< std::vector< float > > fNoise
 noise on each channel for each time More...
 
std::vector< double > fNoiseModelPar
 noise model params More...
 
std::vector< double > fNoiseFluctPar
 Poisson noise fluctuations params. More...
 
TH1D * fIndFieldResp
 response function for the field @ induction plane More...
 
TH1D * fColFieldResp
 response function for the field @ collection plane More...
 
TH1D * fElectResp
 response function for the electronics More...
 
TH1D * fColTimeShape
 convoluted shape for field x electronics @ col plane More...
 
TH1D * fIndTimeShape
 convoluted shape for field x electronics @ ind plane More...
 
TH1D * fNoiseDist
 distribution of noise counts More...
 
TF1 * fNoiseFluct
 Poisson dist for fluctuations in magnitude of noise freq components. More...
 
CLHEP::HepRandomEngine & fEngine
 Random-number engine owned by art. More...
 

Detailed Description

Definition at line 69 of file SimWire_module.cc.

Member Typedef Documentation

Definition at line 17 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::detail::Producer::Table = Modifier::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 26 of file Producer.h.

Constructor & Destructor Documentation

detsim::SimWire::SimWire ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 132 of file SimWire_module.cc.

References art::detail::EngineCreator::createEngine(), fADCPerPCAtLowestASICGain, fASICGainInMVPerFC, fCalibRespTOffset, fCol3DCorrection, fColFieldParams, fCompression, fDriftEModuleLabel, fEngine, fFieldRespTOffset, fInd3DCorrection, fIndFieldParams, fInputFieldRespSamplingPeriod, fNoiseFluctChoice, fNoiseFluctPar, fNoiseModelChoice, fNoiseModelPar, fNoiseNchToSim, fNSamplesReadout, fSampleRate, fShapeTimeConst, raw::kHuffman, raw::kNone, MF_LOG_WARNING, and detinfo::sampling_rate().

133  : EDProducer{pset}
134  , fDriftEModuleLabel{pset.get<std::string>("DriftEModuleLabel")}
135  , fCompression{pset.get<std::string>("CompressionType") == "Huffman" ? raw::kHuffman :
136  raw::kNone}
137  , fCol3DCorrection{pset.get<double>("Col3DCorrection")}
138  , fInd3DCorrection{pset.get<double>("Ind3DCorrection")}
139  , fInputFieldRespSamplingPeriod{pset.get<double>("InputFieldRespSamplingPeriod")}
140  , fShapeTimeConst{pset.get<double>("ShapeTimeConst")}
141  , fADCPerPCAtLowestASICGain{pset.get<double>("ADCPerPCAtLowestASICGain")}
142  , fASICGainInMVPerFC{pset.get<double>("ASICGainInMVPerFC")}
143  , fNoiseNchToSim{pset.get<int>("NoiseNchToSim")}
144  , fNoiseModelChoice{pset.get<std::string>("NoiseModelChoice")}
145  , fNoiseFluctChoice{pset.get<std::string>("NoiseFluctChoice")}
146  , fFieldRespTOffset{pset.get<std::vector<int>>("FieldRespTOffset")}
147  , fCalibRespTOffset{pset.get<std::vector<int>>("CalibRespTOffset")}
148  , fColFieldParams{pset.get<std::vector<float>>("ColFieldParams")}
149  , fIndFieldParams{pset.get<std::vector<float>>("IndFieldParams")}
150  , fNoiseModelPar{pset.get<std::vector<double>>("NoiseModelPar")}
151  , fNoiseFluctPar{pset.get<std::vector<double>>("NoiseFluctPar")}
152  // create a default random engine; obtain the random seed from NuRandomService,
153  // unless overridden in configuration with key "Seed"
154  , fEngine(art::ServiceHandle<rndm::NuRandomService>()->registerAndSeedEngine(createEngine(0),
155  pset,
156  "Seed"))
157  {
158  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataForJob();
159  auto const detProp =
161  fSampleRate = sampling_rate(clockData);
162  fNSamplesReadout = detProp.NumberTimeSamples();
163 
164  MF_LOG_WARNING("SimWire") << "SimWire is an example module that works for the "
165  << "MicroBooNE detector. Each experiment should implement "
166  << "its own version of this module to simulate electronics "
167  << "response.";
168 
169  produces<std::vector<raw::RawDigit>>();
170  }
base_engine_t & createEngine(seed_t seed)
Huffman Encoding.
Definition: RawTypes.h:10
unsigned int fNSamplesReadout
number of ADC readout samples in 1 readout frame
std::string fNoiseModelChoice
choice for noise model
std::vector< float > fIndFieldParams
induction plane field function parameterization
std::string fDriftEModuleLabel
module making the ionization electrons
int fNoiseNchToSim
number of noise channels to generate
double fADCPerPCAtLowestASICGain
ADCs/pC at lowest gain setting of 4.7 mV/fC.
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.cc:6
std::string fNoiseFluctChoice
choice for noise freq component mag fluctuations
raw::Compress_t fCompression
compression type to use
double fShapeTimeConst
time constants for exponential shaping
double fInputFieldRespSamplingPeriod
Sampling period in the input field response.
no compression
Definition: RawTypes.h:9
std::vector< float > fColFieldParams
collection plane field function parameterization
std::vector< int > fCalibRespTOffset
calib response time offset in ticks
std::vector< double > fNoiseFluctPar
Poisson noise fluctuations params.
double fSampleRate
sampling rate in ns
std::vector< int > fFieldRespTOffset
field response time offset in ticks
double fASICGainInMVPerFC
actual gain setting used in mV/fC
#define MF_LOG_WARNING(category)
CLHEP::HepRandomEngine & fEngine
Random-number engine owned by art.
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
std::vector< double > fNoiseModelPar
noise model params

Member Function Documentation

void detsim::SimWire::beginJob ( )
overrideprivatevirtual

Reimplemented from art::EDProducer.

Definition at line 173 of file SimWire_module.cc.

References ConvoluteResponseFunctions(), fEngine, util::LArFFT::FFTSize(), fNoise, fNoiseDist, fNoiseFluct, fNoiseFluctChoice, fNoiseFluctPar, fNoiseNchToSim, fNTicks, GenNoise(), SetElectResponse(), and SetFieldResponse().

174  {
175  // ... get access to the TFile service
177 
178  fNoiseDist = tfs->make<TH1D>("Noise", ";Noise (ADC);", 1000, -10., 10.);
179 
181  fNTicks = fFFT->FFTSize();
182 
183  // ... Poisson dist function for fluctuating magnitude of noise frequency component
184  if (fNoiseFluctChoice == "SimplePoisson") {
185  // .. simple modified Poisson with (x-1)! in denominator
186  double params[1];
187  fNoiseFluct = new TF1("_poisson", "[0]**(x) * exp(-[0]) / ROOT::Math::tgamma(x)", 0, 5.);
188  params[0] = fNoiseFluctPar[0]; // Poisson mean
189  fNoiseFluct->SetParameters(params);
190  }
191  else if (fNoiseFluctChoice == "WeightedPoisson") {
192  // .. weighted Poisson in ArgoNeuT DDN model
193  double params[3];
194  fNoiseFluct = new TF1(
195  "_poisson", "[0]*pow([1]/[2], x/[2])*exp(-[1]/[2])/ROOT::Math::tgamma(x/[2]+1.)", 0, 5.);
196  params[0] = fNoiseFluctPar[0];
197  params[1] = fNoiseFluctPar[1];
198  params[2] = fNoiseFluctPar[2];
199  fNoiseFluct->SetParameters(params);
200  }
201  else {
202  throw cet::exception("SimWire::beginJob")
203  << fNoiseFluctChoice << " is an unknown noise fluctuation choice" << std::endl;
204  }
205 
206  // ... generate the noise in advance depending on value of fNoiseNchToSim:
207  // positive - generate N=fNoiseNchToSim channels & randomly pick from pool when adding to signal
208  // zero - no noise
209  // negative - generate unique noise for each channel for each event
210  if (fNoiseNchToSim > 0) {
211  if (fNoiseNchToSim > 10000) {
212  throw cet::exception("SimWire::beginJob")
213  << fNoiseNchToSim << " noise channels requested exceeds 10000" << std::endl;
214  }
215  fNoise.resize(fNoiseNchToSim);
216  for (unsigned int p = 0; p < fNoise.size(); ++p) {
217  GenNoise(fNoise[p], fEngine);
218  for (int i = 0; i < fNTicks; ++i) {
219  fNoiseDist->Fill(fNoise[p][i]);
220  }
221  }
222  }
223 
224  // ... set field response and electronics response, then convolute them
228  }
TF1 * fNoiseFluct
Poisson dist for fluctuations in magnitude of noise freq components.
int fNoiseNchToSim
number of noise channels to generate
void SetElectResponse()
response of electronics
TH1D * fNoiseDist
distribution of noise counts
std::string fNoiseFluctChoice
choice for noise freq component mag fluctuations
std::vector< std::vector< float > > fNoise
noise on each channel for each time
int FFTSize() const
Definition: LArFFT.h:66
void GenNoise(std::vector< float > &array, CLHEP::HepRandomEngine &engine)
std::vector< double > fNoiseFluctPar
Poisson noise fluctuations params.
void ConvoluteResponseFunctions()
convolute electronics and field response
void SetFieldResponse()
response of wires to field
int fNTicks
number of ticks of the clock
CLHEP::HepRandomEngine & fEngine
Random-number engine owned by art.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 61 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumes().

62  {
63  return collector_.consumes<T, BT>(tag);
64  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ProductToken< T > consumes(InputTag const &)
ConsumesCollector & art::ModuleBase::consumesCollector ( )
protectedinherited

Definition at line 57 of file ModuleBase.cc.

References art::ModuleBase::collector_.

58  {
59  return collector_;
60  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protectedinherited

Definition at line 75 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesMany().

76  {
77  collector_.consumesMany<T, BT>();
78  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::consumesView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::consumesView ( InputTag const &  tag)
inherited

Definition at line 68 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesView().

69  {
70  return collector_.consumesView<T, BT>(tag);
71  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > consumesView(InputTag const &)
void detsim::SimWire::ConvoluteResponseFunctions ( )
private

convolute electronics and field response

Definition at line 341 of file SimWire_module.cc.

References col, util::LArFFT::DoFFT(), util::LArFFT::DoInvFFT(), fColFieldResponse, fColShape, fColTimeShape, fElectResponse, fIndFieldResponse, fIndShape, fIndTimeShape, fNTicks, util::LArFFT::PeakCorrelation(), and util::LArFFT::ShiftData().

Referenced by beginJob().

342  {
343  double tick, ticks, peak;
344 
345  std::vector<double> col(fNTicks, 0.);
346  std::vector<double> ind(fNTicks, 0.);
347  std::vector<TComplex> kern(fNTicks / 2 + 1);
348  std::vector<double> delta(fNTicks, 0.);
349 
351 
352  // ... do collection plane
353  fColShape.resize(fNTicks / 2 + 1);
355 
356  fFFT->DoFFT(fColFieldResponse, kern);
357  for (unsigned int i = 0; i < kern.size(); ++i)
358  fColShape[i] *= kern[i];
359 
360  fFFT->DoInvFFT(fColShape, col);
361 
362  delta[0] = 1.0;
363  peak = fFFT->PeakCorrelation(delta, col);
364  tick = 0.;
365  ticks = tick - peak;
366  fFFT->ShiftData(fColShape, ticks);
367  fFFT->DoInvFFT(fColShape, col);
368 
369  // ... do induction plane
370  fIndShape.resize(fNTicks / 2 + 1);
372 
373  kern.clear();
374  kern.resize(fNTicks / 2 + 1);
375  fFFT->DoFFT(fIndFieldResponse, kern);
376  for (unsigned int i = 0; i < kern.size(); ++i)
377  fIndShape[i] *= kern[i];
378 
379  fFFT->DoInvFFT(fIndShape, ind);
380 
381  delta.resize(0);
382  delta.resize(fNTicks, 0);
383  delta[0] = 1.0;
384  peak = fFFT->PeakCorrelation(delta, ind);
385  tick = 0.;
386  ticks = tick - peak;
387  fFFT->ShiftData(fIndShape, ticks);
388  fFFT->DoInvFFT(fIndShape, ind);
389 
390  // ... write the time-domain shapes out to a file
392  fColTimeShape = tfs->make<TH1D>(
393  "ConvolutedCollection", ";ticks; Electronics#timesCollection", fNTicks, 0, fNTicks);
394  fIndTimeShape = tfs->make<TH1D>(
395  "ConvolutedInduction", ";ticks; Electronics#timesInduction", fNTicks, 0, fNTicks);
396 
397  // ... check that you did the right thing
398  for (unsigned int i = 0; i < ind.size(); ++i) {
399  fColTimeShape->Fill(i, col[i]);
400  fIndTimeShape->Fill(i, ind[i]);
401  }
402 
403  fColTimeShape->Write();
404  fIndTimeShape->Write();
405  }
std::vector< TComplex > fColShape
response function for the field @ collection plane
std::vector< double > fElectResponse
response function for the electronics
TH1D * fColTimeShape
convoluted shape for field x electronics @ col plane
void ShiftData(std::vector< TComplex > &input, double shift)
Definition: LArFFT.cc:116
void DoFFT(std::vector< T > &input, std::vector< TComplex > &output)
Definition: LArFFT.h:95
T PeakCorrelation(std::vector< T > &shape1, std::vector< T > &shape2)
Definition: LArFFT.h:270
tick ticks
Alias for common language habits.
Definition: electronics.h:76
void DoInvFFT(std::vector< TComplex > &input, std::vector< T > &output)
Definition: LArFFT.h:117
std::vector< double > fIndFieldResponse
response function for the field @ induction plane
std::vector< double > fColFieldResponse
response function for the field @ collection plane
std::vector< TComplex > fIndShape
response function for the field @ induction plane
Int_t col[ntarg]
Definition: Style.C:29
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:73
int fNTicks
number of ticks of the clock
TH1D * fIndTimeShape
convoluted shape for field x electronics @ ind plane
void art::detail::Producer::doBeginJob ( SharedResources const &  resources)
inherited

Definition at line 22 of file Producer.cc.

References art::detail::Producer::beginJobWithFrame(), and art::detail::Producer::setupQueues().

23  {
24  setupQueues(resources);
25  ProcessingFrame const frame{ScheduleID{}};
26  beginJobWithFrame(frame);
27  }
virtual void setupQueues(SharedResources const &)=0
virtual void beginJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Producer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 65 of file Producer.cc.

References art::detail::Producer::beginRunWithFrame(), art::RangeSet::forRun(), art::RunPrincipal::makeRun(), r, art::RunPrincipal::runID(), and art::ModuleContext::scheduleID().

66  {
67  auto r = rp.makeRun(mc, RangeSet::forRun(rp.runID()));
68  ProcessingFrame const frame{mc.scheduleID()};
69  beginRunWithFrame(r, frame);
70  r.commitProducts();
71  return true;
72  }
TRandom r
Definition: spectrum.C:23
virtual void beginRunWithFrame(Run &, ProcessingFrame const &)=0
static RangeSet forRun(RunID)
Definition: RangeSet.cc:51
bool art::detail::Producer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 85 of file Producer.cc.

References art::detail::Producer::beginSubRunWithFrame(), art::RangeSet::forSubRun(), art::SubRunPrincipal::makeSubRun(), art::ModuleContext::scheduleID(), and art::SubRunPrincipal::subRunID().

86  {
87  auto sr = srp.makeSubRun(mc, RangeSet::forSubRun(srp.subRunID()));
88  ProcessingFrame const frame{mc.scheduleID()};
89  beginSubRunWithFrame(sr, frame);
90  sr.commitProducts();
91  return true;
92  }
virtual void beginSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
static RangeSet forSubRun(SubRunID)
Definition: RangeSet.cc:57
void art::detail::Producer::doEndJob ( )
inherited

Definition at line 30 of file Producer.cc.

References art::detail::Producer::endJobWithFrame().

31  {
32  ProcessingFrame const frame{ScheduleID{}};
33  endJobWithFrame(frame);
34  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Producer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 75 of file Producer.cc.

References art::detail::Producer::endRunWithFrame(), art::RunPrincipal::makeRun(), r, art::ModuleContext::scheduleID(), and art::Principal::seenRanges().

76  {
77  auto r = rp.makeRun(mc, rp.seenRanges());
78  ProcessingFrame const frame{mc.scheduleID()};
79  endRunWithFrame(r, frame);
80  r.commitProducts();
81  return true;
82  }
TRandom r
Definition: spectrum.C:23
virtual void endRunWithFrame(Run &, ProcessingFrame const &)=0
bool art::detail::Producer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 95 of file Producer.cc.

References art::detail::Producer::endSubRunWithFrame(), art::SubRunPrincipal::makeSubRun(), art::ModuleContext::scheduleID(), and art::Principal::seenRanges().

96  {
97  auto sr = srp.makeSubRun(mc, srp.seenRanges());
98  ProcessingFrame const frame{mc.scheduleID()};
99  endSubRunWithFrame(sr, frame);
100  sr.commitProducts();
101  return true;
102  }
virtual void endSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
bool art::detail::Producer::doEvent ( EventPrincipal ep,
ModuleContext const &  mc,
std::atomic< std::size_t > &  counts_run,
std::atomic< std::size_t > &  counts_passed,
std::atomic< std::size_t > &  counts_failed 
)
inherited

Definition at line 105 of file Producer.cc.

References art::detail::Producer::checkPutProducts_, e, art::EventPrincipal::makeEvent(), art::detail::Producer::produceWithFrame(), and art::ModuleContext::scheduleID().

110  {
111  auto e = ep.makeEvent(mc);
112  ++counts_run;
113  ProcessingFrame const frame{mc.scheduleID()};
114  produceWithFrame(e, frame);
115  e.commitProducts(checkPutProducts_, &expectedProducts<InEvent>());
116  ++counts_passed;
117  return true;
118  }
bool const checkPutProducts_
Definition: Producer.h:70
Float_t e
Definition: plot.C:35
virtual void produceWithFrame(Event &, ProcessingFrame const &)=0
void art::detail::Producer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited

Definition at line 44 of file Producer.cc.

References art::detail::Producer::respondToCloseInputFileWithFrame().

45  {
46  ProcessingFrame const frame{ScheduleID{}};
48  }
virtual void respondToCloseInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Producer::doRespondToCloseOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 58 of file Producer.cc.

References art::detail::Producer::respondToCloseOutputFilesWithFrame().

59  {
60  ProcessingFrame const frame{ScheduleID{}};
62  }
virtual void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Producer::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited

Definition at line 37 of file Producer.cc.

References art::detail::Producer::respondToOpenInputFileWithFrame().

38  {
39  ProcessingFrame const frame{ScheduleID{}};
41  }
virtual void respondToOpenInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Producer::doRespondToOpenOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 51 of file Producer.cc.

References art::detail::Producer::respondToOpenOutputFilesWithFrame().

52  {
53  ProcessingFrame const frame{ScheduleID{}};
55  }
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::Modifier::fillProductDescriptions ( )
inherited

Definition at line 10 of file Modifier.cc.

References art::ProductRegistryHelper::fillDescriptions(), and art::ModuleBase::moduleDescription().

11  {
13  }
void fillDescriptions(ModuleDescription const &md)
ModuleDescription const & moduleDescription() const
Definition: ModuleBase.cc:13
void detsim::SimWire::GenNoise ( std::vector< float > &  array,
CLHEP::HepRandomEngine &  engine 
)
private

Definition at line 408 of file SimWire_module.cc.

References util::LArFFT::DoInvFFT(), fNoiseFluct, fNoiseModelChoice, fNoiseModelPar, fNTicks, fSampleRate, and x.

Referenced by beginJob(), and produce().

409  {
410  CLHEP::RandFlat flat(engine);
411 
412  noise.clear();
413  noise.resize(fNTicks, 0.);
414  std::vector<TComplex> noiseFrequency(fNTicks / 2 + 1, 0.); // noise in frequency space
415 
416  double pval = 0.;
417  double phase = 0.;
418  double rnd[2] = {0.};
419 
420  // .. width of frequencyBin in kHz
421  double binWidth = 1.0 / (fNTicks * fSampleRate * 1.0e-6);
422 
423  for (int i = 0; i < fNTicks / 2 + 1; ++i) {
424 
425  double x = (i + 0.5) * binWidth;
426 
427  if (fNoiseModelChoice == "Legacy") {
428  // ... Legacy exponential model kept here for reference:
429  // par[0]=NoiseFact, par[1]=NoiseWidth, par[2]=LowCutoff, par[3-7]=0
430  // example parameter values for fcl: NoiseModelPar:[ 1.32e-1,120,7.5,0,0,0,0,0 ]
431  pval = fNoiseModelPar[0] * exp(-(double)i * binWidth / fNoiseModelPar[1]);
432  double lofilter = 1.0 / (1.0 + exp(-(i - fNoiseModelPar[2] / binWidth) / 0.5));
433  flat.fireArray(1, rnd, 0, 1);
434  pval *= lofilter * (0.9 + 0.2 * rnd[0]);
435  }
436  else if (fNoiseModelChoice == "ModUBooNE") {
437  // ... Modified uBooNE model with additive exp to account for low freq region:
438  // example parameter values for fcl: NoiseModelPar:[
439  // 4450.,-530.,280.,110.,
440  // -0.85,18.,0.064,74. ]
441  pval = fNoiseModelPar[0] * exp(-0.5 * pow((x - fNoiseModelPar[1]) / fNoiseModelPar[2], 2)) *
442  exp(-0.5 * pow(x / fNoiseModelPar[3], fNoiseModelPar[4])) +
443  fNoiseModelPar[5] + exp(-fNoiseModelPar[6] * (x - fNoiseModelPar[7]));
444  double randomizer = fNoiseFluct->GetRandom();
445  pval = pval * randomizer / fNTicks;
446  }
447  else if (fNoiseModelChoice == "ArgoNeuT") {
448  // ... ArgoNeuT data driven model:
449  // In fcl set parameters to: NoiseModelPar:[
450  // 5000,-5.52058e2,2.81587e2,-5.66561e1,
451  // 4.10817e1,1.76284e1,1e-1,5.97838e1 ]
452  pval = fNoiseModelPar[0] * exp(-0.5 * pow((x - fNoiseModelPar[1]) / fNoiseModelPar[2], 2)) *
453  ((fNoiseModelPar[3] / (x + fNoiseModelPar[4])) + 1) +
454  fNoiseModelPar[5] + exp(-fNoiseModelPar[6] * (x - fNoiseModelPar[7]));
455  double randomizer = fNoiseFluct->GetRandom();
456  pval = pval * randomizer / fNTicks;
457  }
458  else {
459  throw cet::exception("SimWire::GenNoise")
460  << fNoiseModelChoice << " is an unknown choice for the noise model" << std::endl;
461  }
462 
463  flat.fireArray(1, rnd, 0, 1);
464  phase = rnd[0] * 2. * TMath::Pi();
465 
466  TComplex tc(pval * cos(phase), pval * sin(phase));
467  noiseFrequency[i] += tc;
468  }
469 
470  // .. inverse FFT MCSignal
472  fFFT->DoInvFFT(noiseFrequency, noise);
473 
474  noiseFrequency.clear();
475 
476  // .. multiply each noise value by fNTicks as the InvFFT
477  // divides each bin by fNTicks assuming that a forward FFT
478  // has already been done.
479  for (unsigned int i = 0; i < noise.size(); ++i)
480  noise[i] *= 1. * fNTicks;
481  }
Float_t x
Definition: compare.C:6
std::string fNoiseModelChoice
choice for noise model
TF1 * fNoiseFluct
Poisson dist for fluctuations in magnitude of noise freq components.
void DoInvFFT(std::vector< TComplex > &input, std::vector< T > &output)
Definition: LArFFT.h:117
unsigned int noise()
Definition: chem4.cc:261
double fSampleRate
sampling rate in ns
int fNTicks
number of ticks of the clock
std::vector< double > fNoiseModelPar
noise model params
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::array< std::vector< ProductInfo >, NumBranchTypes > const & art::ModuleBase::getConsumables ( ) const
inherited

Definition at line 43 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::getConsumables().

44  {
45  return collector_.getConsumables();
46  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables() const
std::unique_ptr< Worker > art::ModuleBase::makeWorker ( WorkerParams const &  wp)
inherited

Definition at line 37 of file ModuleBase.cc.

References art::ModuleBase::doMakeWorker(), and art::NumBranchTypes.

38  {
39  return doMakeWorker(wp);
40  }
virtual std::unique_ptr< Worker > doMakeWorker(WorkerParams const &wp)=0
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protectedinherited

Definition at line 82 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsume().

83  {
84  return collector_.mayConsume<T, BT>(tag);
85  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protectedinherited

Definition at line 96 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeMany().

97  {
98  collector_.mayConsumeMany<T, BT>();
99  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::mayConsumeView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::mayConsumeView ( InputTag const &  tag)
inherited

Definition at line 89 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeView().

90  {
91  return collector_.mayConsumeView<T, BT>(tag);
92  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > mayConsumeView(InputTag const &)
ModuleDescription const & art::ModuleBase::moduleDescription ( ) const
inherited

Definition at line 13 of file ModuleBase.cc.

References art::errors::LogicError.

Referenced by art::OutputModule::doRespondToOpenInputFile(), art::OutputModule::doWriteEvent(), art::Modifier::fillProductDescriptions(), art::OutputModule::makePlugins_(), art::OutputWorker::OutputWorker(), reco::shower::LArPandoraModularShowerCreation::produce(), art::Modifier::registerProducts(), and art::OutputModule::registerProducts().

14  {
15  if (md_.has_value()) {
16  return *md_;
17  }
18 
20  "There was an error while calling moduleDescription().\n"}
21  << "The moduleDescription() base-class member function cannot be called\n"
22  "during module construction. To determine which module is "
23  "responsible\n"
24  "for calling it, find the '<module type>:<module "
25  "label>@Construction'\n"
26  "tag in the message prefix above. Please contact artists@fnal.gov\n"
27  "for guidance.\n";
28  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void detsim::SimWire::produce ( art::Event evt)
overrideprivatevirtual

Implements art::EDProducer.

Definition at line 231 of file SimWire_module.cc.

References sim::SimChannel::Charge(), raw::Compress(), fCalibRespTOffset, fColShape, fCompression, fDriftEModuleLabel, fEngine, fFieldRespTOffset, fIndShape, fNoise, fNoiseNchToSim, fNSamplesReadout, fNTicks, GenNoise(), art::ProductRetriever::getView(), geo::kInduction, geo::GeometryCore::Nchannels(), art::Event::put(), sc, and geo::GeometryCore::SignalType().

232  {
233 
235 
236  // ... generate unique noise for each channel in each event
237  if (fNoiseNchToSim < 0) {
238  fNoise.clear();
239  fNoise.resize(geo->Nchannels());
240  for (unsigned int p = 0; p < geo->Nchannels(); ++p) {
241  GenNoise(fNoise[p], fEngine);
242  }
243  }
244 
245  // ... make a vector of const sim::SimChannel* that has same number
246  // of entries as the number of channels in the detector
247  // and set the entries for the channels that have signal on them
248  // using the chanHandle
249  std::vector<const sim::SimChannel*> chanHandle;
250  evt.getView(fDriftEModuleLabel, chanHandle);
251 
252  std::vector<const sim::SimChannel*> channels(geo->Nchannels());
253  for (size_t c = 0; c < chanHandle.size(); ++c) {
254  channels[chanHandle[c]->Channel()] = chanHandle[c];
255  }
256 
257  // ... make an unique_ptr of sim::SimDigits that allows ownership of the produced
258  // digits to be transferred to the art::Event after the put statement below
259  auto digcol = std::make_unique<std::vector<raw::RawDigit>>();
260 
262 
263  // ... Add all channels
264  CLHEP::RandFlat flat(fEngine);
265 
267  for (unsigned int chan = 0; chan < geo->Nchannels(); chan++) {
268 
269  std::vector<short> adcvec(fNTicks, 0);
270  std::vector<double> fChargeWork(fNTicks, 0.);
271 
272  if (channels[chan]) {
273 
274  // .. get the sim::SimChannel for this channel
275  const sim::SimChannel* sc = channels[chan];
276 
277  // .. loop over the tdcs and grab the number of electrons for each
278  for (int t = 0; t < fNTicks; ++t)
279  fChargeWork[t] = sc->Charge(t);
280 
281  int time_offset = 0;
282 
283  // .. Convolve charge with appropriate response function
284  if (geo->SignalType(chan) == geo::kInduction) {
285  fFFT->Convolute(fChargeWork, fIndShape);
286  time_offset = fFieldRespTOffset[1] + fCalibRespTOffset[1];
287  }
288  else {
289  fFFT->Convolute(fChargeWork, fColShape);
290  time_offset = fFieldRespTOffset[0] + fCalibRespTOffset[0];
291  }
292 
293  // .. Apply field response offset
294  std::vector<int> temp;
295  if (time_offset <= 0) {
296  temp.assign(fChargeWork.begin(), fChargeWork.begin() - time_offset);
297  fChargeWork.erase(fChargeWork.begin(), fChargeWork.begin() - time_offset);
298  fChargeWork.insert(fChargeWork.end(), temp.begin(), temp.end());
299  }
300  else {
301  temp.assign(fChargeWork.end() - time_offset, fChargeWork.end());
302  fChargeWork.erase(fChargeWork.end() - time_offset, fChargeWork.end());
303  fChargeWork.insert(fChargeWork.begin(), temp.begin(), temp.end());
304  }
305  }
306 
307  // ... Add noise to signal depending on value of fNoiseNchToSim
308  if (fNoiseNchToSim != 0) {
309  int noisechan = chan;
310  if (fNoiseNchToSim > 0) {
311  noisechan = TMath::Nint(flat.fire() * (1. * (fNoise.size() - 1) + 0.1));
312  }
313  for (int i = 0; i < fNTicks; ++i) {
314  adcvec[i] = (short)TMath::Nint(fNoise[noisechan][i] + fChargeWork[i]);
315  }
316  }
317  else {
318  for (int i = 0; i < fNTicks; ++i) {
319  adcvec[i] = (short)TMath::Nint(fChargeWork[i]);
320  }
321  }
322 
323  adcvec.resize(fNSamplesReadout);
324 
325  // ... compress the adc vector using the desired compression scheme,
326  // if raw::kNone is selected nothing happens to adcvec
327  // This shrinks adcvec, if fCompression is not kNone.
328  raw::Compress(adcvec, fCompression);
329 
330  // ... add this digit to the collection
331  digcol->emplace_back(chan, fNTicks, move(adcvec), fCompression);
332 
333  } //end loop over channels
334 
335  evt.put(std::move(digcol));
336 
337  return;
338  }
intermediate_table::iterator iterator
unsigned int fNSamplesReadout
number of ADC readout samples in 1 readout frame
std::vector< TComplex > fColShape
response function for the field @ collection plane
Energy deposited on a readout channel by simulated tracks.
Definition: SimChannel.h:136
std::string fDriftEModuleLabel
module making the ionization electrons
int fNoiseNchToSim
number of noise channels to generate
raw::Compress_t fCompression
compression type to use
std::vector< std::vector< float > > fNoise
noise on each channel for each time
unsigned int Nchannels() const
Returns the number of TPC readout channels in the detector.
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: Event.h:77
std::vector< int > fCalibRespTOffset
calib response time offset in ticks
void GenNoise(std::vector< float > &array, CLHEP::HepRandomEngine &engine)
Signal from induction planes.
Definition: geo_types.h:151
double Charge(TDC_t tdc) const
Returns the total number of ionization electrons on this channel in the specified TDC...
Definition: SimChannel.cxx:110
std::vector< TComplex > fIndShape
response function for the field @ induction plane
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
int fNTicks
number of ticks of the clock
SigType_t SignalType(PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
std::vector< int > fFieldRespTOffset
field response time offset in ticks
Float_t sc
Definition: plot.C:23
void Compress(std::vector< short > &adc, raw::Compress_t compress)
Compresses a raw data buffer.
Definition: raw.cxx:19
CLHEP::HepRandomEngine & fEngine
Random-number engine owned by art.
Namespace collecting geometry-related classes utilities.
void art::Modifier::registerProducts ( ProductDescriptions productsToRegister)
inherited

Definition at line 16 of file Modifier.cc.

References art::ModuleBase::moduleDescription(), and art::ProductRegistryHelper::registerProducts().

17  {
18  ProductRegistryHelper::registerProducts(productsToRegister,
20  }
void registerProducts(ProductDescriptions &productsToRegister, ModuleDescription const &md)
ModuleDescription const & moduleDescription() const
Definition: ModuleBase.cc:13
void detsim::SimWire::SetElectResponse ( )
private

response of electronics

Definition at line 538 of file SimWire_module.cc.

References DEFINE_ART_MODULE, e, fADCPerPCAtLowestASICGain, fASICGainInMVPerFC, fElectResp, fElectResponse, fInputFieldRespSamplingPeriod, fNElectResp, fNTicks, and fShapeTimeConst.

Referenced by beginJob().

539  {
540  fElectResponse.resize(fNTicks, 0.);
541  std::vector<double> time(fNTicks, 0.);
542 
543  // ... Gain and shaping time variables from fcl file:
544  double Ao = 1.0;
545  double To = fShapeTimeConst; //peaking time
546 
547  // ... this is actually sampling time, in ns
548  mf::LogInfo("SimWire::SetElectResponse")
549  << "Check sampling intervals: " << fInputFieldRespSamplingPeriod << " ns"
550  << "Check number of samples: " << fNTicks;
551 
552  // ... The following sets the microboone electronics response function in
553  // time-space. Function comes from BNL SPICE simulation of DUNE35t
554  // electronics. SPICE gives the electronics transfer function in
555  // frequency-space. The inverse laplace transform of that function
556  // (in time-space) was calculated in Mathematica and is what is being
557  // used below. Parameters Ao and To are cumulative gain/timing parameters
558  // from the full (ASIC->Intermediate amp->Receiver->ADC) electronics chain.
559  // They have been adjusted to make the SPICE simulation to match the
560  // actual electronics response. Default params are Ao=1.4, To=0.5us.
561  double max = 0;
562 
563  for (size_t i = 0; i < fElectResponse.size(); ++i) {
564 
565  // ... convert time to microseconds, to match fElectResponse[i] definition
566  time[i] = (1. * i) * fInputFieldRespSamplingPeriod * 1e-3;
567  fElectResponse[i] =
568  4.31054 * exp(-2.94809 * time[i] / To) * Ao -
569  2.6202 * exp(-2.82833 * time[i] / To) * cos(1.19361 * time[i] / To) * Ao -
570  2.6202 * exp(-2.82833 * time[i] / To) * cos(1.19361 * time[i] / To) *
571  cos(2.38722 * time[i] / To) * Ao +
572  0.464924 * exp(-2.40318 * time[i] / To) * cos(2.5928 * time[i] / To) * Ao +
573  0.464924 * exp(-2.40318 * time[i] / To) * cos(2.5928 * time[i] / To) *
574  cos(5.18561 * time[i] / To) * Ao +
575  0.762456 * exp(-2.82833 * time[i] / To) * sin(1.19361 * time[i] / To) * Ao -
576  0.762456 * exp(-2.82833 * time[i] / To) * cos(2.38722 * time[i] / To) *
577  sin(1.19361 * time[i] / To) * Ao +
578  0.762456 * exp(-2.82833 * time[i] / To) * cos(1.19361 * time[i] / To) *
579  sin(2.38722 * time[i] / To) * Ao -
580  2.6202 * exp(-2.82833 * time[i] / To) * sin(1.19361 * time[i] / To) *
581  sin(2.38722 * time[i] / To) * Ao -
582  0.327684 * exp(-2.40318 * time[i] / To) * sin(2.5928 * time[i] / To) * Ao +
583  +0.327684 * exp(-2.40318 * time[i] / To) * cos(5.18561 * time[i] / To) *
584  sin(2.5928 * time[i] / To) * Ao -
585  0.327684 * exp(-2.40318 * time[i] / To) * cos(2.5928 * time[i] / To) *
586  sin(5.18561 * time[i] / To) * Ao +
587  0.464924 * exp(-2.40318 * time[i] / To) * sin(2.5928 * time[i] / To) *
588  sin(5.18561 * time[i] / To) * Ao;
589 
590  if (fElectResponse[i] > max) max = fElectResponse[i];
591 
592  } // end loop over time buckets
593 
594  // ... "normalize" fElectResponse[i], before the convolution
595 
596  for (auto& element : fElectResponse) {
597  element /= max;
598  element *= fADCPerPCAtLowestASICGain * 1.60217657e-7;
599  element *= fASICGainInMVPerFC / 4.7; // relative to lowest gain setting of 4.7 mV/fC
600  }
601 
602  fNElectResp = fElectResponse.size();
603 
604  // ... write the response out to a file
605 
607  fElectResp = tfs->make<TH1D>(
608  "ElectronicsResponse", ";t (ns);Electronics Response", fNElectResp, 0, fNElectResp);
609  for (unsigned int i = 0; i < fNElectResp; ++i) {
610  fElectResp->Fill(i, fElectResponse[i]);
611  }
612 
613  fElectResp->Write();
614  }
std::vector< double > fElectResponse
response function for the electronics
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
double fADCPerPCAtLowestASICGain
ADCs/pC at lowest gain setting of 4.7 mV/fC.
unsigned int fNElectResp
number of entries from response to use
double fShapeTimeConst
time constants for exponential shaping
double fInputFieldRespSamplingPeriod
Sampling period in the input field response.
int fNTicks
number of ticks of the clock
double fASICGainInMVPerFC
actual gain setting used in mV/fC
TH1D * fElectResp
response function for the electronics
Float_t e
Definition: plot.C:35
void detsim::SimWire::SetFieldResponse ( )
private

response of wires to field

Definition at line 484 of file SimWire_module.cc.

References fColFieldParams, fColFieldResp, fColFieldResponse, fIndFieldParams, fIndFieldResp, fIndFieldResponse, and fNTicks.

Referenced by beginJob().

485  {
486 
487  // ... Files to write the response functions to
489  fIndFieldResp =
490  tfs->make<TH1D>("InductionFieldResponse", ";t (ns);Induction Response", fNTicks, 0, fNTicks);
491  fColFieldResp = tfs->make<TH1D>(
492  "CollectionFieldResponse", ";t (ns);Collection Response", fNTicks, 0, fNTicks);
493 
494  fColFieldResponse.resize(fNTicks, 0.);
495  fIndFieldResponse.resize(fNTicks, 0.);
496 
497  // ... First set response for collection plane
498  int nbinc = fColFieldParams[0];
499 
500  double integral = 0.;
501  for (int i = 1; i < nbinc; ++i) {
502  fColFieldResponse[i] = i * i;
503  integral += fColFieldResponse[i];
504  }
505 
506  for (int i = 0; i < nbinc; ++i) {
507  fColFieldResponse[i] *= fColFieldParams[1] / integral;
508  fColFieldResp->Fill(i, fColFieldResponse[i]);
509  }
510 
511  // ... Now set response for induction plane
512  int nbini = fIndFieldParams[0];
513  unsigned short lastbini = 2 * nbini;
514 
515  integral = 0;
516  for (unsigned short i = 0; i < lastbini; ++i) {
517  double ang = i * TMath::Pi() / nbini;
518  fIndFieldResponse[i] = sin(ang);
519  if (fIndFieldResponse[i] > 0) { integral += fIndFieldResponse[i]; }
520  else {
521  fIndFieldResponse[i] *=
522  fIndFieldParams[2]; // scale the negative lobe by 10% (from ArgoNeuT)
523  }
524  }
525  ++lastbini;
526 
527  for (unsigned short i = 0; i < lastbini; ++i) {
528  fIndFieldResponse[i] *= fIndFieldParams[1] / integral;
529  fIndFieldResp->Fill(i, fIndFieldResponse[i]);
530  }
531 
532  // ... Save the field responses
533  fColFieldResp->Write();
534  fIndFieldResp->Write();
535  }
std::vector< float > fIndFieldParams
induction plane field function parameterization
std::vector< float > fColFieldParams
collection plane field function parameterization
std::vector< double > fIndFieldResponse
response function for the field @ induction plane
std::vector< double > fColFieldResponse
response function for the field @ collection plane
TH1D * fIndFieldResp
response function for the field @ induction plane
int fNTicks
number of ticks of the clock
TH1D * fColFieldResp
response function for the field @ collection plane
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  md)
inherited

Definition at line 31 of file ModuleBase.cc.

References art::ModuleBase::md_.

32  {
33  md_ = md;
34  }
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited

Definition at line 49 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().

50  {
51  // Now that we know we have seen all the consumes declarations,
52  // sort the results for fast lookup later.
53  collector_.sortConsumables(current_process_name);
54  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
void sortConsumables(std::string const &current_process_name)

Member Data Documentation

double detsim::SimWire::fADCPerPCAtLowestASICGain
private

ADCs/pC at lowest gain setting of 4.7 mV/fC.

Definition at line 97 of file SimWire_module.cc.

Referenced by SetElectResponse(), and SimWire().

double detsim::SimWire::fASICGainInMVPerFC
private

actual gain setting used in mV/fC

Definition at line 98 of file SimWire_module.cc.

Referenced by SetElectResponse(), and SimWire().

std::vector<int> detsim::SimWire::fCalibRespTOffset
private

calib response time offset in ticks

Definition at line 104 of file SimWire_module.cc.

Referenced by produce(), and SimWire().

double detsim::SimWire::fCol3DCorrection
private

correction factor to account for 3D path of electrons thru wires

Definition at line 90 of file SimWire_module.cc.

Referenced by SimWire().

std::vector<float> detsim::SimWire::fColFieldParams
private

collection plane field function parameterization

Definition at line 105 of file SimWire_module.cc.

Referenced by SetFieldResponse(), and SimWire().

TH1D* detsim::SimWire::fColFieldResp
private

response function for the field @ collection plane

Definition at line 117 of file SimWire_module.cc.

Referenced by SetFieldResponse().

std::vector<double> detsim::SimWire::fColFieldResponse
private

response function for the field @ collection plane

Definition at line 107 of file SimWire_module.cc.

Referenced by ConvoluteResponseFunctions(), and SetFieldResponse().

std::vector<TComplex> detsim::SimWire::fColShape
private

response function for the field @ collection plane

Definition at line 109 of file SimWire_module.cc.

Referenced by ConvoluteResponseFunctions(), and produce().

TH1D* detsim::SimWire::fColTimeShape
private

convoluted shape for field x electronics @ col plane

Definition at line 119 of file SimWire_module.cc.

Referenced by ConvoluteResponseFunctions().

raw::Compress_t detsim::SimWire::fCompression
private

compression type to use

Definition at line 85 of file SimWire_module.cc.

Referenced by produce(), and SimWire().

std::string detsim::SimWire::fDriftEModuleLabel
private

module making the ionization electrons

Definition at line 84 of file SimWire_module.cc.

Referenced by produce(), and SimWire().

TH1D* detsim::SimWire::fElectResp
private

response function for the electronics

Definition at line 118 of file SimWire_module.cc.

Referenced by SetElectResponse().

std::vector<double> detsim::SimWire::fElectResponse
private

response function for the electronics

Definition at line 111 of file SimWire_module.cc.

Referenced by ConvoluteResponseFunctions(), and SetElectResponse().

CLHEP::HepRandomEngine& detsim::SimWire::fEngine
private

Random-number engine owned by art.

Definition at line 124 of file SimWire_module.cc.

Referenced by beginJob(), produce(), and SimWire().

std::vector<int> detsim::SimWire::fFieldRespTOffset
private

field response time offset in ticks

Definition at line 103 of file SimWire_module.cc.

Referenced by produce(), and SimWire().

double detsim::SimWire::fInd3DCorrection
private

correction factor to account for 3D path of electrons thru wires

Definition at line 92 of file SimWire_module.cc.

Referenced by SimWire().

std::vector<float> detsim::SimWire::fIndFieldParams
private

induction plane field function parameterization

Definition at line 106 of file SimWire_module.cc.

Referenced by SetFieldResponse(), and SimWire().

TH1D* detsim::SimWire::fIndFieldResp
private

response function for the field @ induction plane

Definition at line 116 of file SimWire_module.cc.

Referenced by SetFieldResponse().

std::vector<double> detsim::SimWire::fIndFieldResponse
private

response function for the field @ induction plane

Definition at line 108 of file SimWire_module.cc.

Referenced by ConvoluteResponseFunctions(), and SetFieldResponse().

std::vector<TComplex> detsim::SimWire::fIndShape
private

response function for the field @ induction plane

Definition at line 110 of file SimWire_module.cc.

Referenced by ConvoluteResponseFunctions(), and produce().

TH1D* detsim::SimWire::fIndTimeShape
private

convoluted shape for field x electronics @ ind plane

Definition at line 120 of file SimWire_module.cc.

Referenced by ConvoluteResponseFunctions().

double detsim::SimWire::fInputFieldRespSamplingPeriod
private

Sampling period in the input field response.

Definition at line 95 of file SimWire_module.cc.

Referenced by SetElectResponse(), and SimWire().

unsigned int detsim::SimWire::fNElectResp
private

number of entries from response to use

Definition at line 94 of file SimWire_module.cc.

Referenced by SetElectResponse().

std::vector<std::vector<float> > detsim::SimWire::fNoise
private

noise on each channel for each time

Definition at line 112 of file SimWire_module.cc.

Referenced by beginJob(), and produce().

TH1D* detsim::SimWire::fNoiseDist
private

distribution of noise counts

Definition at line 121 of file SimWire_module.cc.

Referenced by beginJob().

TF1* detsim::SimWire::fNoiseFluct
private

Poisson dist for fluctuations in magnitude of noise freq components.

Definition at line 122 of file SimWire_module.cc.

Referenced by beginJob(), and GenNoise().

std::string detsim::SimWire::fNoiseFluctChoice
private

choice for noise freq component mag fluctuations

Definition at line 101 of file SimWire_module.cc.

Referenced by beginJob(), and SimWire().

std::vector<double> detsim::SimWire::fNoiseFluctPar
private

Poisson noise fluctuations params.

Definition at line 114 of file SimWire_module.cc.

Referenced by beginJob(), and SimWire().

std::string detsim::SimWire::fNoiseModelChoice
private

choice for noise model

Definition at line 100 of file SimWire_module.cc.

Referenced by GenNoise(), and SimWire().

std::vector<double> detsim::SimWire::fNoiseModelPar
private

noise model params

Definition at line 113 of file SimWire_module.cc.

Referenced by GenNoise(), and SimWire().

int detsim::SimWire::fNoiseNchToSim
private

number of noise channels to generate

Definition at line 99 of file SimWire_module.cc.

Referenced by beginJob(), produce(), and SimWire().

unsigned int detsim::SimWire::fNSamplesReadout
private

number of ADC readout samples in 1 readout frame

Definition at line 89 of file SimWire_module.cc.

Referenced by produce(), and SimWire().

int detsim::SimWire::fNTicks
private

number of ticks of the clock

Definition at line 87 of file SimWire_module.cc.

Referenced by beginJob(), ConvoluteResponseFunctions(), GenNoise(), produce(), SetElectResponse(), and SetFieldResponse().

double detsim::SimWire::fSampleRate
private

sampling rate in ns

Definition at line 88 of file SimWire_module.cc.

Referenced by GenNoise(), and SimWire().

double detsim::SimWire::fShapeTimeConst
private

time constants for exponential shaping

Definition at line 96 of file SimWire_module.cc.

Referenced by SetElectResponse(), and SimWire().


The documentation for this class was generated from the following file: