All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimWireICARUS_module.cc
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////
2 // $Id: SimWireICARUS.cxx,v 1.22 2010/04/23 20:30:53 seligman Exp $
3 //
4 // SimWireICARUS class designed to simulate signal on a wire in the TPC
5 //
6 // katori@fnal.gov
7 //
8 // - Revised to use sim::RawDigit instead of rawdata::RawDigit, and to
9 // - save the electron clusters associated with each digit.
10 //
11 ////////////////////////////////////////////////////////////////////////
12 
13 // C/C++ standard library
14 #include <stdexcept> // std::range_error
15 #include <vector>
16 #include <string>
17 #include <algorithm> // std::fill()
18 #include <functional>
19 #include <random>
20 #include <chrono>
21 // CLHEP libraries
22 #include "CLHEP/Random/RandFlat.h"
23 #include "CLHEP/Random/RandGaussQ.h"
24 #include "CLHEP/Random/JamesRandom.h"
25 // ROOT libraries
26 #include "TMath.h"
27 #include "TComplex.h"
28 #include "TString.h"
29 #include "TH2F.h"
30 #include "TH1D.h"
31 #include "TFile.h"
32 #include "TCanvas.h"
33 // art library and utilities
34 #include "art/Framework/Core/ModuleMacros.h"
35 #include "art/Framework/Core/EDProducer.h"
36 #include "art/Framework/Principal/Event.h"
37 #include "art/Framework/Principal/Handle.h"
38 #include "art/Framework/Services/Registry/ServiceHandle.h"
39 #include "art_root_io/TFileService.h"
40 #include "art_root_io/TFileDirectory.h"
41 #include "art/Utilities/make_tool.h"
42 #include "fhiclcpp/ParameterSet.h"
43 #include "messagefacility/MessageLogger/MessageLogger.h"
44 // art extensions
45 #include "nurandom/RandomUtils/NuRandomService.h"
46 // LArSoft libraries
48 #include "lardataobj/RawData/raw.h"
62 #include "tools/IGenNoise.h"
63 #include "icarus_signal_processing/Filters/ICARUSFFT.h"
64 
65 using namespace util;
66 ///Detector simulation of raw signals on wires
67 namespace detsim {
68 
69 // Base class for creation of raw signals on wires.
70 class SimWireICARUS : public art::EDProducer
71 {
72 public:
73 
74  explicit SimWireICARUS(fhicl::ParameterSet const& pset);
75  virtual ~SimWireICARUS();
76 
77  // read/write access to event
78  void produce (art::Event& evt);
79  void beginJob();
80  void endJob();
81  void reconfigure(fhicl::ParameterSet const& p);
82 
83 private:
84 
85  void MakeADCVec(std::vector<short>& adc, icarusutil::TimeVec const& noise,
86  icarusutil::TimeVec const& charge, float ped_mean) const;
87 
88  using TPCIDVec = std::vector<geo::TPCID>;
89 
90  art::InputTag fDriftEModuleLabel; ///< module making the ionization electrons
91  std::string fOutInstanceLabel; ///< The label to apply to the output data product
92  bool fProcessAllTPCs; ///< If true we process all TPCs
93  unsigned int fCryostat; ///< If ProcessAllTPCs is false then cryostat to use
94  TPCIDVec fTPCVec; ///< List of TPCs to process for this instance of the module
95  raw::Compress_t fCompression; ///< compression type to use
96  unsigned int fNTimeSamples; ///< number of ADC readout samples in all readout frames (per event)
97  std::map< double, int > fShapingTimeOrder;
98 
99  bool fSimDeadChannels; ///< if True, simulate dead channels using the ChannelStatus service. If false, do not simulate dead channels
100  bool fSuppressNoSignal; ///< If no signal on wire (simchannel) then suppress the channel
101  bool fSmearPedestals; ///< If True then we smear the pedestals
102  int fNumChanPerMB; ///< Number of channels per motherboard
103 
104  std::vector<std::unique_ptr<icarus_tool::IGenNoise>> fNoiseToolVec; ///< Tool for generating noise
105 
107  bool fTest; // for forcing a test case
108  std::vector<sim::SimChannel> fTestSimChannel_v;
109  size_t fTestWire;
110  std::vector<size_t> fTestIndex;
111  std::vector<double> fTestCharge;
112 
113  TH1F* fSimCharge;
115 
116  // Random engines
117  CLHEP::HepRandomEngine& fPedestalEngine;
118  CLHEP::HepRandomEngine& fUncNoiseEngine;
119  CLHEP::HepRandomEngine& fCorNoiseEngine;
120 
121  //define max ADC value - if one wishes this can
122  //be made a fcl parameter but not likely to ever change
123  const float adcsaturation = 4095;
124 
125  // little helper class to hold the params of each charge dep
127  public:
128  ResponseParams(double charge, size_t time) : m_charge(charge), m_time(time) {}
129  double getCharge() { return m_charge; }
130  size_t getTime() { return m_time; }
131  private:
132  double m_charge;
133  size_t m_time;
134  };
135 
136  using FFTPointer = std::unique_ptr<icarus_signal_processing::ICARUSFFT<double>>;
137  FFTPointer fFFT; //< Object to handle thread safe FFT
138 
139  //services
141  icarusutil::SignalShapingICARUSService* fSignalShapingService; //< Access to the response functions
142 
143 }; // class SimWireICARUS
144 DEFINE_ART_MODULE(SimWireICARUS)
145 
146 //-------------------------------------------------
147 SimWireICARUS::SimWireICARUS(fhicl::ParameterSet const& pset)
148  : EDProducer{pset}
149  , fPedestalEngine(art::ServiceHandle<rndm::NuRandomService>()->createEngine(*this, "HepJamesRandom", "pedestal", pset, "SeedPedestal"))
150  , fUncNoiseEngine(art::ServiceHandle<rndm::NuRandomService>()->createEngine(*this, "HepJamesRandom", "noise", pset, "Seed"))
151  , fCorNoiseEngine(art::ServiceHandle<rndm::NuRandomService>()->createEngine(*this, "HepJamesRandom", "cornoise", pset, "Seed"))
152  , fGeometry(*lar::providerFrom<geo::Geometry>())
153 {
154  this->reconfigure(pset);
155 
156  produces< std::vector<raw::RawDigit>>(fOutInstanceLabel);
158  TString compression(pset.get< std::string >("CompressionType"));
159  if(compression.Contains("Huffman",TString::kIgnoreCase)) fCompression = raw::kHuffman;
160 
161  return;
162 }
163 //-------------------------------------------------
164 SimWireICARUS::~SimWireICARUS() {}
165 //-------------------------------------------------
166 void SimWireICARUS::reconfigure(fhicl::ParameterSet const& p)
167 {
168  fDriftEModuleLabel = p.get< art::InputTag >("DriftEModuleLabel", "largeant");
169  fOutInstanceLabel = p.get< std::string >("OutputInstanceLabel", "");
170  fProcessAllTPCs = p.get< bool >("ProcessAllTPCs", false);
171  fCryostat = p.get< unsigned int >("Cryostat", 0);
172  fSimDeadChannels = p.get< bool >("SimDeadChannels", false);
173  fSuppressNoSignal = p.get< bool >("SuppressNoSignal", false);
174  fMakeHistograms = p.get< bool >("MakeHistograms", false);
175  fSmearPedestals = p.get< bool >("SmearPedestals", true);
176  fNumChanPerMB = p.get< int >("NumChanPerMB", 32);
177  fTest = p.get< bool >("Test", false);
178  fTestWire = p.get< size_t >("TestWire", 0);
179  fTestIndex = p.get< std::vector<size_t> >("TestIndex", std::vector<size_t>());
180  fTestCharge = p.get< std::vector<double> >("TestCharge", std::vector<double>());
181 
182  using TPCValsPair = std::pair<unsigned int, unsigned int>; // Assume cryostat, TPC
183  using TPCValsVec = std::vector<TPCValsPair>;
184 
185  TPCValsVec tempIDVec = p.get< TPCValsVec >("TPCVec", TPCValsVec());
186 
187  for(const auto& idPair : tempIDVec)
188  {
189  fTPCVec.push_back(geo::TPCID(idPair.first,idPair.second));
190  }
191 
192  if(fTestIndex.size() != fTestCharge.size())
193  throw cet::exception(__FUNCTION__)<<"# test pulse mismatched: check TestIndex and TestCharge fcl parameters...";
194 
195  std::vector<fhicl::ParameterSet> noiseToolParamSetVec = p.get<std::vector<fhicl::ParameterSet>>("NoiseGenToolVec");
196 
197  for(auto& noiseToolParams : noiseToolParamSetVec) {
198  fNoiseToolVec.push_back(art::make_tool<icarus_tool::IGenNoise>(noiseToolParams));
199  }
200  //Map the Shaping Times to the entry position for the noise ADC
201  //level in fNoiseFactInd and fNoiseFactColl
202  fShapingTimeOrder = { {0.6, 0}, {1, 1}, {1.3, 2}, {3.0, 3} };
203 
204  //detector properties information
205  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataForJob();
206  fNTimeSamples = detProp.NumberTimeSamples();
207 
208  fSignalShapingService = art::ServiceHandle<icarusutil::SignalShapingICARUSService>{}.get();
209 
210  fFFT = std::make_unique<icarus_signal_processing::ICARUSFFT<double>>(fNTimeSamples);
211 
212  return;
213 }
214 //-------------------------------------------------
215 void SimWireICARUS::beginJob()
216 {
217  // get access to the TFile service
218  art::ServiceHandle<art::TFileService> tfs;
219 
220  // If in test mode create a test data set
221  if(fTest)
222  {
223  if(fGeometry.Nchannels()<=fTestWire)
224  throw cet::exception(__FUNCTION__)<<"Invalid test wire channel: "<<fTestWire;
225  std::vector<unsigned int> channels;
226  for(auto const& plane_id : fGeometry.IteratePlaneIDs())
227  channels.push_back(fGeometry.PlaneWireToChannel(plane_id.Plane,fTestWire));
228  double xyz[3] = { std::numeric_limits<double>::max() };
229  for(auto const& ch : channels)
230  {
231  fTestSimChannel_v.push_back(sim::SimChannel(ch));
232  for(size_t i=0; i<fTestIndex.size(); ++i)
233  {
234  fTestSimChannel_v.back().AddIonizationElectrons(-1,
235  fTestIndex[i],
236  fTestCharge[i],
237  xyz,
238  std::numeric_limits<double>::max());
239  }
240  }
241  }
242 
243  fSimCharge = tfs->make<TH1F>("fSimCharge", "simulated charge", 150, 0, 1500);
244  fSimChargeWire = tfs->make<TH2F>("fSimChargeWire", "simulated charge", 5600,0.,5600.,500, 0, 1500);
245 
246  return;
247 }
248 //-------------------------------------------------
249 void SimWireICARUS::endJob()
250 {}
251 void SimWireICARUS::produce(art::Event& evt)
252 {
253  //--------------------------------------------------------------------
254  //
255  // Get all of the services we will be using
256  //
257  //--------------------------------------------------------------------
258 
259  //get pedestal conditions
260  const lariov::DetPedestalProvider& pedestalRetrievalAlg = art::ServiceHandle<lariov::DetPedestalService>()->GetPedestalProvider();
261 
262  //channel status for simulating dead channels
263  const lariov::ChannelStatusProvider& ChannelStatusProvider = art::ServiceHandle<lariov::ChannelStatusService>()->GetProvider();
264 
265  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
266 
267  // get the geometry to be able to figure out signal types and chan -> plane mappings
268  const raw::ChannelID_t maxChannel = fGeometry.Nchannels();
269 
270  //--------------------------------------------------------------------
271  //
272  // Get the SimChannels, which we will use to produce RawDigits
273  //
274  //--------------------------------------------------------------------
275  // make a vector of const sim::SimChannel* that has same number
276  // of entries as the number of channels in the detector
277  // and set the entries for the channels that have signal on them
278  // using the chanHandle
279  std::vector<const sim::SimChannel*> channels(maxChannel,nullptr);
280  if(!fTest)
281  {
282  std::vector<const sim::SimChannel*> chanHandle;
283  evt.getView(fDriftEModuleLabel,chanHandle);
284 
285  for(const auto& simChannel : chanHandle) channels.at(simChannel->Channel()) = simChannel;
286  }
287  else
288  for(const auto& testChannel : fTestSimChannel_v) channels.at(testChannel.Channel()) = &testChannel;
289 
290  // make a unique_ptr of sim::SimDigits that allows ownership of the produced
291  // digits to be transferred to the art::Event after the put statement below
292  std::unique_ptr< std::vector<raw::RawDigit>> digcol(new std::vector<raw::RawDigit>);
293  digcol->reserve(maxChannel);
294  //--------------------------------------------------------------------
295  //
296  // Loop over channels a second time and produce the RawDigits by adding together
297  // pedestal, noise, and direct & induced charges
298  //
299  //--------------------------------------------------------------------
300 
301  // vectors for working in the following for loop
302  std::vector<short> adcvec(fNTimeSamples, 0);
303  icarusutil::TimeVec chargeWork(fNTimeSamples,0.);
304  icarusutil::TimeVec zeroCharge(fNTimeSamples,0.);
305  icarusutil::TimeVec noisetmp(fNTimeSamples,0.);
306 
307  // make sure chargeWork is correct size
308  if (chargeWork.size() < fNTimeSamples) throw std::range_error("SimWireICARUS: chargeWork vector too small");
309 
310  //detector properties information
311  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(evt);
312 
313  // Let the tools know to update to the next event
314  for(const auto& noiseTool : fNoiseToolVec) noiseTool->nextEvent();
315 
316  // The original implementation would allow the option to skip channels for which there was no MC signal
317  // present. We want to update this so that if there is an MC signal on any wire in a common group (a
318  // motherboard) then we keep all of those wires. This so we can implment noise mitigation techniques
319  // with the simulation
320  //
321 
322  // Here we determine the first and last channel numbers based on whether we are outputting a single TPC or all
323  using ChannelPair = std::pair<raw::ChannelID_t,raw::ChannelID_t>;
324  using ChannelPairVec = std::vector<ChannelPair>;
325 
326  ChannelPairVec channelPairVec;
327 
328  for (geo::TPCID const& tpcid : fTPCVec)
329  {
330  for (geo::PlaneGeo const& plane : fGeometry.IteratePlanes(tpcid))
331  {
332  raw::ChannelID_t const planeStartChannel = fGeometry.PlaneWireToChannel({ plane.ID(), 0U });
333  raw::ChannelID_t const planeEndChannel = fGeometry.PlaneWireToChannel({ plane.ID(), plane.Nwires() - 1U }) + 1;
334 
335  channelPairVec.emplace_back(planeStartChannel, planeEndChannel);
336  } // for planes in TPC
337  }
338 
339  // Ok, define the structure for the MB info....
340  using MBWithSignalSet = std::set<raw::ChannelID_t>;
341 
342  MBWithSignalSet mbWithSignalSet;
343 
344  for(const ChannelPair& channelPair : channelPairVec)
345  {
346  // If we are not suppressing the signal then we need to make sure there is an entry in the set for every motherboard
347  if (!fSuppressNoSignal)
348  {
349  raw::ChannelID_t firstMBIdx(channelPair.first / fNumChanPerMB);
350  raw::ChannelID_t endMBIdx(channelPair.second / fNumChanPerMB);
351 
352  for(raw::ChannelID_t mbIdx = firstMBIdx; mbIdx < endMBIdx; mbIdx++) mbWithSignalSet.insert(mbIdx);
353  }
354  else
355  {
356  for(const auto& simChan : channels)
357  {
358  if (simChan)
359  {
360  raw::ChannelID_t channel = simChan->Channel();
361 
362  if (channel >= channelPair.first && channel < channelPair.second) mbWithSignalSet.insert(channel/fNumChanPerMB);
363  }
364  }
365  }
366  }
367 
368  // Ok, now we can simply loop over MB's...
369  for(const auto& mb : mbWithSignalSet)
370  {
371  raw::ChannelID_t baseChannel = fNumChanPerMB * mb;
372 
373  // And for a given MB we can loop over the channels it contains
374  for(raw::ChannelID_t channel = baseChannel; channel < baseChannel + fNumChanPerMB; channel++)
375  {
376  //clean up working vectors from previous iteration of loop
377  adcvec.resize(fNTimeSamples, 0); //compression may have changed the size of this vector
378  noisetmp.resize(fNTimeSamples, 0.); //just in case
379 
380  //use channel number to set some useful numbers
381  std::vector<geo::WireID> widVec = fGeometry.ChannelToWire(channel);
382  size_t plane = widVec[0].Plane;
383  size_t wire = widVec[0].Wire;
384  size_t board = wire / 32;
385 
386  //Get pedestal with random gaussian variation
387  float ped_mean = pedestalRetrievalAlg.PedMean(channel);
388 
389  if (fSmearPedestals )
390  {
391  CLHEP::RandGaussQ rGaussPed(fPedestalEngine, 0.0, pedestalRetrievalAlg.PedRms(channel));
392  ped_mean += rGaussPed.fire();
393  }
394 
395  //Generate Noise
396  double noise_factor(0.);
397  auto tempNoiseVec = fSignalShapingService->GetNoiseFactVec();
398  double shapingTime = fSignalShapingService->GetShapingTime(plane);
399  double gain = fSignalShapingService->GetASICGain(channel) * sampling_rate(clockData) * 1.e-3; // Gain returned is electrons/us, this converts to electrons/tick
400  int timeOffset = fSignalShapingService->ResponseTOffset(channel);
401 
402  // Recover the response function information for this channel
403  const icarus_tool::IResponse& response = fSignalShapingService->GetResponse(channel);
404 
405  if (fShapingTimeOrder.find( shapingTime ) != fShapingTimeOrder.end() )
406  noise_factor = tempNoiseVec[plane].at( fShapingTimeOrder.find( shapingTime )->second );
407  //Throw exception...
408  else
409  {
410  throw cet::exception("SimWireICARUS")
411  << "\033[93m"
412  << "Shaping Time received from signalservices_icarus.fcl is not one of allowed values"
413  << std::endl
414  << "Allowed values: 0.6, 1.0, 1.3, 3.0 usec"
415  << "\033[00m"
416  << std::endl;
417  }
418 
419  // Use the desired noise tool to actually generate the noise on this wire
420  fNoiseToolVec[plane]->generateNoise(fUncNoiseEngine,
421  fCorNoiseEngine,
422  noisetmp,
423  detProp,
424  noise_factor,
425  widVec[0],
426  board);
427 
428  // Recover the SimChannel (if one) for this channel
429  const sim::SimChannel* simChan = channels[channel];
430 
431  // If there is something on this wire, and it is not dead, then add the signal to the wire
432  if(simChan && !(fSimDeadChannels && (ChannelStatusProvider.IsBad(channel) || !ChannelStatusProvider.IsPresent(channel))))
433  {
434  std::fill(chargeWork.begin(), chargeWork.end(), 0.);
435 
436  // loop over the tdcs and grab the number of electrons for each
437  for(size_t tick = 0; tick < fNTimeSamples; tick++)
438  {
439  int tdc = clockData.TPCTick2TDC(tick);
440 
441  // continue if tdc < 0
442  if( tdc < 0 ) continue;
443 
444  double charge = simChan->Charge(tdc); // Charge returned in number of electrons
445 
446  chargeWork[tick] += charge/gain; // # electrons / (# electrons/tick)
447  } // loop over tdcs
448  // now we have the tempWork for the adjacent wire of interest
449  // convolve it with the appropriate response function
450  fFFT->convolute(chargeWork, response.getConvKernel(), timeOffset);
451 
452  // "Make" the ADC vector
453  MakeADCVec(adcvec, noisetmp, chargeWork, ped_mean);
454  }
455  // "Make" an ADC vector with zero charge added
456  else MakeADCVec(adcvec, noisetmp, zeroCharge, ped_mean);
457 
458  // add this digit to the collection;
459  // adcvec is copied, not moved: in case of compression, adcvec will show
460  // less data: e.g. if the uncompressed adcvec has 9600 items, after
461  // compression it will have maybe 5000, but the memory of the other 4600
462  // is still there, although unused; a copy of adcvec will instead have
463  // only 5000 items. All 9600 items of adcvec will be recovered for free
464  // and used on the next loop.
465  raw::RawDigit rd(channel, fNTimeSamples, adcvec, fCompression);
466 
467  if(fMakeHistograms && plane==2)
468  {
469  short area = std::accumulate(adcvec.begin(),adcvec.end(),0,[](const auto& val,const auto& sum){return sum + val - 400;});
470 
471  if(area>0)
472  {
473  fSimCharge->Fill(area);
474  fSimChargeWire->Fill(widVec[0].Wire,area);
475  }
476  }
477 
478  rd.SetPedestal(ped_mean);
479  digcol->push_back(std::move(rd)); // we do move the raw digit copy, though
480 
481  }
482  }
483 
484  evt.put(std::move(digcol), fOutInstanceLabel);
485 
486  return;
487 }
488 //-------------------------------------------------
489 void SimWireICARUS::MakeADCVec(std::vector<short>& adcvec, icarusutil::TimeVec const& noisevec,
490  icarusutil::TimeVec const& chargevec, float ped_mean) const
491 {
492  for(unsigned int i = 0; i < fNTimeSamples; ++i)
493  {
494  float adcval = noisevec[i] + chargevec[i] + ped_mean;
495 
496  adcval = std::max(float(0.), std::min(adcval, adcsaturation));
497 
498  adcvec[i] = std::round(adcval);
499  }// end loop over signal size
500  // compress the adc vector using the desired compression scheme,
501  // if raw::kNone is selected nothing happens to adcvec
502  // This shrinks adcvec, if fCompression is not kNone.
503  raw::Compress(adcvec, fCompression);
504 
505  return;
506 }
507 
508 }
Huffman Encoding.
Definition: RawTypes.h:10
std::vector< size_t > fTestIndex
TString compression(pset.get< std::string >("CompressionType"))
enum raw::_compress Compress_t
raw::Compress_t fCompression
compression type to use
Collection of charge vs time digitized from a single readout channel.
Definition: RawDigit.h:69
Energy deposited on a readout channel by simulated tracks.
Definition: SimChannel.h:145
std::vector< geo::TPCID > TPCIDVec
virtual bool IsBad(raw::ChannelID_t channel) const =0
Returns whether the specified channel is bad in the current run.
std::vector< double > fTestCharge
virtual const icarusutil::FrequencyVec & getConvKernel() const =0
std::vector< std::unique_ptr< icarus_tool::IGenNoise > > fNoiseToolVec
Tool for generating noise.
pdgs p
Definition: selectors.fcl:22
CLHEP::HepRandomEngine & fUncNoiseEngine
Definition of basic raw digits.
for pfile in ack l reconfigure(.*) override"` do echo "checking $
no compression
Definition: RawTypes.h:9
ResponseParams(double charge, size_t time)
bool fSmearPedestals
If True then we smear the pedestals.
Access the description of detector geometry.
virtual bool IsPresent(raw::ChannelID_t channel) const =0
Returns whether the specified channel is physical and connected to wire.
std::string fOutInstanceLabel
The label to apply to the output data product.
double Charge(TDC_t tdc) const
Returns the total number of ionization electrons on this channel in the specified TDC...
Definition: SimChannel.cxx:138
Collect all the RawData header files together.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:82
std::vector< SigProcPrecision > TimeVec
bool fSuppressNoSignal
If no signal on wire (simchannel) then suppress the channel.
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
TPCIDVec fTPCVec
List of TPCs to process for this instance of the module.
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
Class providing information about the quality of channels.
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
Description of geometry of one entire detector.
int fNumChanPerMB
Number of channels per motherboard.
virtual float PedMean(raw::ChannelID_t ch) const =0
Retrieve pedestal information.
bool fSimDeadChannels
if True, simulate dead channels using the ChannelStatus service. If false, do not simulate dead chann...
const geo::GeometryCore & fGeometry
std::map< double, int > fShapingTimeOrder
CLHEP::HepRandomEngine & fCorNoiseEngine
std::unique_ptr< icarus_signal_processing::ICARUSFFT< double >> FFTPointer
m_charge
CLHEP::HepRandomEngine & fPedestalEngine
void SetPedestal(float ped, float sigma=1.)
Set pedestal and its RMS (the latter is 0 by default)
Definition: RawDigit.cxx:68
unsigned int fCryostat
If ProcessAllTPCs is false then cryostat to use.
bool fProcessAllTPCs
If true we process all TPCs.
unsigned int fNTimeSamples
number of ADC readout samples in all readout frames (per event)
object containing MC truth information necessary for making RawDigits and doing back tracking ...
Interface for experiment-specific channel quality info provider.
virtual float PedRms(raw::ChannelID_t ch) const =0
void Compress(std::vector< short > &adc, raw::Compress_t compress)
Compresses a raw data buffer.
Definition: raw.cxx:19
std::vector< sim::SimChannel > fTestSimChannel_v
This is the interface class for a tool to handle a GenNoise for the overall response.
icarusutil::SignalShapingICARUSService * fSignalShapingService
art::ServiceHandle< art::TFileService > tfs
TCEvent evt
Definition: DataStructs.cxx:8
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
Interface for experiment-specific service for channel quality info.
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
Tools and modules for checking out the basics of the Monte Carlo.
art framework interface to geometry description
auto const detProp
art::InputTag fDriftEModuleLabel
module making the ionization electrons