All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimReadoutBoardICARUS_module.cc
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////
2 // $Id: SimReadoutBoardICARUS.cxx,v 1.22 2010/04/23 20:30:53 seligman Exp $
3 //
4 // SimReadoutBoardICARUS 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"
65 
66 using namespace util;
67 ///Detector simulation of raw signals on wires
68 namespace detsim {
69 
70 // Base class for creation of raw signals on wires.
71 class SimReadoutBoardICARUS : public art::EDProducer
72 {
73 public:
74 
75  explicit SimReadoutBoardICARUS(fhicl::ParameterSet const& pset);
76  virtual ~SimReadoutBoardICARUS();
77 
78  // read/write access to event
79  void produce (art::Event& evt);
80  void beginJob();
81  void endJob();
82  void reconfigure(fhicl::ParameterSet const& p);
83 
84 private:
85 
86  void MakeADCVec(std::vector<short>& adc, icarusutil::TimeVec const& noise,
87  icarusutil::TimeVec const& charge, float ped_mean) const;
88 
89  using TPCIDVec = std::vector<geo::TPCID>;
90 
91  art::InputTag fDriftEModuleLabel; ///< module making the ionization electrons
92  std::string fOutInstanceLabel; ///< The label to apply to the output data product
93  bool fProcessAllTPCs; ///< If true we process all TPCs
94  unsigned int fCryostat; ///< If ProcessAllTPCs is false then cryostat to use
95  TPCIDVec fTPCVec; ///< List of TPCs to process for this instance of the module
96  raw::Compress_t fCompression; ///< compression type to use
97  unsigned int fNTimeSamples; ///< number of ADC readout samples in all readout frames (per event)
98  std::map< double, int > fShapingTimeOrder;
99 
100  bool fSimDeadChannels; ///< if True, simulate dead channels using the ChannelStatus service. If false, do not simulate dead channels
101  bool fSuppressNoSignal; ///< If no signal on wire (simchannel) then suppress the channel
102  bool fSmearPedestals; ///< If True then we smear the pedestals
103  int fNumChanPerMB; ///< Number of channels per motherboard
104 
105  std::unique_ptr<icarus_tool::IGenNoise> fNoiseTool; ///< Tool for generating noise
106 
108  bool fTest; // for forcing a test case
109  std::vector<sim::SimChannel> fTestSimChannel_v;
110  size_t fTestWire;
111  std::vector<size_t> fTestIndex;
112  std::vector<double> fTestCharge;
113 
114  TH1F* fSimCharge;
116 
117  // Random engines
118  CLHEP::HepRandomEngine& fPedestalEngine;
119  CLHEP::HepRandomEngine& fUncNoiseEngine;
120  CLHEP::HepRandomEngine& fCorNoiseEngine;
121 
122  //define max ADC value - if one wishes this can
123  //be made a fcl parameter but not likely to ever change
124  const float adcsaturation = 4095;
125 
126  // little helper class to hold the params of each charge dep
128  public:
129  ResponseParams(double charge, size_t time) : m_charge(charge), m_time(time) {}
130  double getCharge() { return m_charge; }
131  size_t getTime() { return m_time; }
132  private:
133  double m_charge;
134  size_t m_time;
135  };
136 
137  using FFTPointer = std::unique_ptr<icarus_signal_processing::ICARUSFFT<double>>;
138  FFTPointer fFFT; //< Object to handle thread safe FFT
139 
140  //services
142  icarusutil::SignalShapingICARUSService* fSignalShapingService; //< Access to the response functions
144 
145 }; // class SimReadoutBoardICARUS
146 DEFINE_ART_MODULE(SimReadoutBoardICARUS)
147 
148 //-------------------------------------------------
150  : EDProducer{pset}
151  , fPedestalEngine(art::ServiceHandle<rndm::NuRandomService>()->createEngine(*this, "HepJamesRandom", "pedestal", pset, "SeedPedestal"))
152  , fUncNoiseEngine(art::ServiceHandle<rndm::NuRandomService>()->createEngine(*this, "HepJamesRandom", "noise", pset, "Seed"))
153  , fCorNoiseEngine(art::ServiceHandle<rndm::NuRandomService>()->createEngine(*this, "HepJamesRandom", "cornoise", pset, "Seed"))
154  , fGeometry(*lar::providerFrom<geo::Geometry>())
155  , fChannelMap(art::ServiceHandle<icarusDB::IICARUSChannelMap const>{}.get())
156 {
157  this->reconfigure(pset);
158 
159  produces< std::vector<raw::RawDigit>>(fOutInstanceLabel);
161  TString compression(pset.get< std::string >("CompressionType"));
162  if(compression.Contains("Huffman",TString::kIgnoreCase)) fCompression = raw::kHuffman;
163 
164  return;
165 }
166 //-------------------------------------------------
167 SimReadoutBoardICARUS::~SimReadoutBoardICARUS() {}
168 //-------------------------------------------------
169 void SimReadoutBoardICARUS::reconfigure(fhicl::ParameterSet const& p)
170 {
171  fDriftEModuleLabel = p.get< art::InputTag >("DriftEModuleLabel", "largeant");
172  fOutInstanceLabel = p.get< std::string >("OutputInstanceLabel", "");
173  fProcessAllTPCs = p.get< bool >("ProcessAllTPCs", false);
174  fCryostat = p.get< unsigned int >("Cryostat", 0);
175  fSimDeadChannels = p.get< bool >("SimDeadChannels", false);
176  fSuppressNoSignal = p.get< bool >("SuppressNoSignal", false);
177  fMakeHistograms = p.get< bool >("MakeHistograms", false);
178  fSmearPedestals = p.get< bool >("SmearPedestals", true);
179  fNumChanPerMB = p.get< int >("NumChanPerMB", 32);
180  fTest = p.get< bool >("Test", false);
181  fTestWire = p.get< size_t >("TestWire", 0);
182  fTestIndex = p.get< std::vector<size_t> >("TestIndex", std::vector<size_t>());
183  fTestCharge = p.get< std::vector<double> >("TestCharge", std::vector<double>());
184 
185  using TPCValsPair = std::pair<unsigned int, unsigned int>; // Assume cryostat, TPC
186  using TPCValsVec = std::vector<TPCValsPair>;
187 
188  TPCValsVec tempIDVec = p.get< TPCValsVec >("TPCVec", TPCValsVec());
189 
190  for(const auto& idPair : tempIDVec)
191  {
192  fTPCVec.push_back(geo::TPCID(idPair.first,idPair.second));
193  }
194 
195  if(fTestIndex.size() != fTestCharge.size())
196  throw cet::exception(__FUNCTION__)<<"# test pulse mismatched: check TestIndex and TestCharge fcl parameters...";
197 
198  fNoiseTool = art::make_tool<icarus_tool::IGenNoise>(p.get<fhicl::ParameterSet>("NoiseGenTool"));
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 SimReadoutBoardICARUS::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 SimReadoutBoardICARUS::endJob()
250 {}
251 void SimReadoutBoardICARUS::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("SimReadoutBoardICARUS: 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  fNoiseTool->nextEvent();
315 
316  // Plan is to loop over readout boards, rejecting any that are not in the TPC list
317  // For any good readout boards we loop through the channels.
318 
319  // Get the board ids for this fragment
320  const icarusDB::TPCReadoutBoardToChannelMap& readoutBoardToChannelMap = fChannelMap->getReadoutBoardToChannelMap();
321 
322  unsigned int boardCount(0);
323 
324  std::set<raw::ChannelID_t> channelIDSet;
325 
326  for(const auto& boardPair : readoutBoardToChannelMap)
327  {
328  // A little song and dance to make sure this board is in our TPC group
329  // What we need is a proper mapping but because we can have channels which are not valid for the geometry
330  // service we have a little thing we have to go through here...
331  std::vector<geo::WireID> wireIDVec;
332 
333  for(const auto& channelPair : boardPair.second.second)
334  {
335  wireIDVec = fGeometry.ChannelToWire(channelPair.first);
336 
337  if (wireIDVec.size() > 0) break;
338  }
339 
340  if (wireIDVec.empty()) continue; // Can this happen?
341 
342  bool goodBoard(false);
343  unsigned int cryostat(0);
344  unsigned int tpc(0);
345 
346  for(geo::TPCID const& tpcid : fTPCVec)
347  {
348  if (tpcid.Cryostat == wireIDVec[0].Cryostat && tpcid.TPC == wireIDVec[0].TPC)
349  {
350  goodBoard = true;
351  cryostat = tpcid.Cryostat;
352  tpc = tpcid.TPC;
353  break;
354  }
355  }
356 
357  if (!goodBoard) continue;
358 
359  // For this board loop over channels
360  for(const auto& channelPair : boardPair.second.second)
361  {
362  // Recover channel and plane info
363  raw::ChannelID_t channel = channelPair.first;
364  size_t plane = channelPair.second;
365  geo::PlaneID planeID(cryostat,tpc,plane);
366 
367  if (channelIDSet.find(channel) != channelIDSet.end())
368  {
369  std::cout << "############### Found already used channel! channelID: " << channel << std::endl;
370  }
371  channelIDSet.insert(channel);
372 
373  //clean up working vectors from previous iteration of loop
374  adcvec.resize(fNTimeSamples, 0); //compression may have changed the size of this vector
375  noisetmp.resize(fNTimeSamples, 0.); //just in case
376 
377  //use channel number to set some useful numbers
378 
379  //Get pedestal with random gaussian variation
380  float ped_mean = 2048; //pedestalRetrievalAlg.PedMean(channel);
381 
382  if (fSmearPedestals )
383  {
384  CLHEP::RandGaussQ rGaussPed(fPedestalEngine, 0.0, 3.0); //pedestalRetrievalAlg.PedRms(channel));
385  ped_mean += rGaussPed.fire();
386  }
387 
388  //Generate Noise
389  double noise_factor(0.);
390  double shapingTime = fSignalShapingService->GetShapingTime(plane);
391  auto tempNoiseVec = fSignalShapingService->GetNoiseFactVec();
392 
393  if (fShapingTimeOrder.find( shapingTime ) != fShapingTimeOrder.end() )
394  noise_factor = tempNoiseVec[plane].at( fShapingTimeOrder.find( shapingTime )->second );
395  //Throw exception...
396  else
397  {
398  throw cet::exception("SimReadoutBoardICARUS")
399  << "\033[93m"
400  << "Shaping Time received from signalservices_icarus.fcl is not one of allowed values"
401  << std::endl
402  << "Allowed values: 0.6, 1.0, 1.3, 3.0 usec"
403  << "\033[00m"
404  << std::endl;
405  }
406 
407  // Check where this wire is located
408  std::vector<geo::WireID> widVec = fGeometry.ChannelToWire(channel);
409 
410  // For now skip the channels with no info
411 // if (widVec.empty()) continue;
412 // unsigned int wire(0);
413 // if (widVec.size() > 0) wire = widVec[0].Wire;
414 
415 // if (cryostat == 0 && tpc == 0) std::cout << " -wireIdx " << wireIdx++ << ", wire: " << wire << ", plane " << plane << " channel " << channel << ", noise_factor: " << noise_factor << ", planeID: " << planeID << std::endl;
416 
417  // Use the desired noise tool to actually generate the noise on this wire
418  fNoiseTool->generateNoise(fUncNoiseEngine,
419  fCorNoiseEngine,
420  noisetmp,
421  detProp,
422  noise_factor,
423  planeID,
424  boardPair.first);
425 
426  // Recover the SimChannel (if one) for this channel
427  const sim::SimChannel* simChan = channels[channel];
428 
429  // If there is something on this wire, and it is not dead, then add the signal to the wire
430  if(simChan && !(fSimDeadChannels && (ChannelStatusProvider.IsBad(channel) || !ChannelStatusProvider.IsPresent(channel))))
431  {
432  double gain = fSignalShapingService->GetASICGain(channel) * sampling_rate(clockData) * 1.e-3; // Gain returned is electrons/us, this converts to electrons/tick
433  int timeOffset = fSignalShapingService->ResponseTOffset(channel);
434 
435  // Recover the response function information for this channel
436  const icarus_tool::IResponse& response = fSignalShapingService->GetResponse(channel);
437 
438  std::fill(chargeWork.begin(), chargeWork.end(), 0.);
439 
440  // loop over the tdcs and grab the number of electrons for each
441  for(size_t tick = 0; tick < fNTimeSamples; tick++)
442  {
443  // Note that we attempt to explicitly remove the time offsets between the planes and leave it to the response
444  // functions to handle this. So we reference the time to the first plane
445  int tdc = clockData.TPCTick2TDC(tick + detProp.GetXTicksOffset(planeID) - detProp.GetXTicksOffset(geo::PlaneID(cryostat,tpc,0)));
446 
447  // continue if tdc < 0
448  if( tdc < 0 ) continue;
449 
450  double charge = simChan->Charge(tdc); // Charge returned in number of electrons
451 
452  chargeWork[tick] += charge/gain; // # electrons / (# electrons/tick)
453  } // loop over tdcs
454  // now we have the tempWork for the adjacent wire of interest
455  // convolve it with the appropriate response function
456  fFFT->convolute(chargeWork, response.getConvKernel(), timeOffset);
457 
458  // "Make" the ADC vector
459  MakeADCVec(adcvec, noisetmp, chargeWork, ped_mean);
460  }
461  // "Make" an ADC vector with zero charge added
462  else MakeADCVec(adcvec, noisetmp, zeroCharge, ped_mean);
463 
464  // add this digit to the collection;
465  // adcvec is copied, not moved: in case of compression, adcvec will show
466  // less data: e.g. if the uncompressed adcvec has 9600 items, after
467  // compression it will have maybe 5000, but the memory of the other 4600
468  // is still there, although unused; a copy of adcvec will instead have
469  // only 5000 items. All 9600 items of adcvec will be recovered for free
470  // and used on the next loop.
471  raw::RawDigit rd(channel, fNTimeSamples, adcvec, fCompression);
472 
473  if(fMakeHistograms && plane==2)
474  {
475  short area = std::accumulate(adcvec.begin(),adcvec.end(),0,[](const auto& val,const auto& sum){return sum + val - 400;});
476 
477  if(area>0)
478  {
479  std::vector<geo::WireID> widVec = fGeometry.ChannelToWire(channel);
480 
481  fSimCharge->Fill(area);
482  fSimChargeWire->Fill(widVec[0].Wire,area);
483  }
484  }
485 
486  rd.SetPedestal(ped_mean);
487  digcol->push_back(std::move(rd)); // we do move the raw digit copy, though
488  }
489 
490  boardCount++;
491  }
492  evt.put(std::move(digcol), fOutInstanceLabel);
493 
494  return;
495 }
496 //-------------------------------------------------
497 void SimReadoutBoardICARUS::MakeADCVec(std::vector<short>& adcvec, icarusutil::TimeVec const& noisevec,
498  icarusutil::TimeVec const& chargevec, float ped_mean) const
499 {
500  for(unsigned int i = 0; i < fNTimeSamples; ++i)
501  {
502  float adcval = noisevec[i] + chargevec[i] + ped_mean;
503 
504  adcval = std::max(float(0.), std::min(adcval, adcsaturation));
505 
506  adcvec[i] = std::round(adcval);
507  }// end loop over signal size
508  // compress the adc vector using the desired compression scheme,
509  // if raw::kNone is selected nothing happens to adcvec
510  // This shrinks adcvec, if fCompression is not kNone.
511  raw::Compress(adcvec, fCompression);
512 
513  return;
514 }
515 
516 }
Huffman Encoding.
Definition: RawTypes.h:10
TString compression(pset.get< std::string >("CompressionType"))
TPCIDVec fTPCVec
List of TPCs to process for this instance of the module.
enum raw::_compress Compress_t
bool fSimDeadChannels
if True, simulate dead channels using the ChannelStatus service. If false, do not simulate dead chann...
Collection of charge vs time digitized from a single readout channel.
Definition: RawDigit.h:69
int fNumChanPerMB
Number of channels per motherboard.
Energy deposited on a readout channel by simulated tracks.
Definition: SimChannel.h:145
virtual bool IsBad(raw::ChannelID_t channel) const =0
Returns whether the specified channel is bad in the current run.
std::unique_ptr< icarus_signal_processing::ICARUSFFT< double >> FFTPointer
virtual const icarusutil::FrequencyVec & getConvKernel() const =0
pdgs p
Definition: selectors.fcl:22
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
Definition of basic raw digits.
bool fSmearPedestals
If True then we smear the pedestals.
for pfile in ack l reconfigure(.*) override"` do echo "checking $
bool fSuppressNoSignal
If no signal on wire (simchannel) then suppress the channel.
no compression
Definition: RawTypes.h:9
std::string fOutInstanceLabel
The label to apply to the output data product.
bool fProcessAllTPCs
If true we process all TPCs.
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.
double Charge(TDC_t tdc) const
Returns the total number of ionization electrons on this channel in the specified TDC...
Definition: SimChannel.cxx:138
art::InputTag fDriftEModuleLabel
module making the ionization electrons
const icarusDB::IICARUSChannelMap * fChannelMap
Collect all the RawData header files together.
std::vector< SigProcPrecision > TimeVec
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
icarusutil::SignalShapingICARUSService * fSignalShapingService
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
Class providing information about the quality of channels.
unsigned int fCryostat
If ProcessAllTPCs is false then cryostat to use.
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
Description of geometry of one entire detector.
m_charge
void SetPedestal(float ped, float sigma=1.)
Set pedestal and its RMS (the latter is 0 by default)
Definition: RawDigit.cxx:68
std::map< unsigned int, SlotChannelVecPair > TPCReadoutBoardToChannelMap
object containing MC truth information necessary for making RawDigits and doing back tracking ...
Interface for experiment-specific channel quality info provider.
std::vector< sim::SimChannel > fTestSimChannel_v
void Compress(std::vector< short > &adc, raw::Compress_t compress)
Compresses a raw data buffer.
Definition: raw.cxx:19
This is the interface class for a tool to handle a GenNoise for the overall response.
art::ServiceHandle< art::TFileService > tfs
TCEvent evt
Definition: DataStructs.cxx:8
raw::Compress_t fCompression
compression type to use
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.
unsigned int fNTimeSamples
number of ADC readout samples in all readout frames (per event)
art framework interface to geometry description
BEGIN_PROLOG could also be cout
auto const detProp
std::unique_ptr< icarus_tool::IGenNoise > fNoiseTool
Tool for generating noise.