LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
caldata::CalWireT962 Class Reference
Inheritance diagram for caldata::CalWireT962:
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

 CalWireT962 (fhicl::ParameterSet const &pset)
 
void produce (art::Event &evt)
 
void beginJob ()
 
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 Attributes

std::string fResponseFile
 
int fExpEndBins
 number of end bins to consider for tail fit More...
 
int fPostsample
 number of postsample bins More...
 
std::string fDigitModuleLabel
 module that made digits More...
 
std::vector< std::vector< TComplex > > fKernelR
 
std::vector< std::vector< TComplex > > fKernelS
 
std::vector< double > fDecayConstsR
 
std::vector< double > fDecayConstsS
 
std::vector< int > fKernMapR
 
std::vector< int > fKernMapS
 

Detailed Description

Definition at line 43 of file CalWireT962_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

caldata::CalWireT962::CalWireT962 ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 81 of file CalWireT962_module.cc.

References fDigitModuleLabel, fExpEndBins, fPostsample, and fResponseFile.

81  : EDProducer{pset}
82  {
83  fDigitModuleLabel = pset.get<std::string>("DigitModuleLabel", "daq");
84  fExpEndBins = pset.get<int>("ExponentialEndBins");
85  fPostsample = pset.get<int>("PostsampleBins");
86 
87  cet::search_path sp("FW_SEARCH_PATH");
88  sp.find_file(pset.get<std::string>("ResponseFile"), fResponseFile);
89 
90  produces<std::vector<recob::Wire>>();
91  produces<art::Assns<raw::RawDigit, recob::Wire>>();
92  }
int fPostsample
number of postsample bins
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.cc:6
std::string fDigitModuleLabel
module that made digits
int fExpEndBins
number of end bins to consider for tail fit

Member Function Documentation

void caldata::CalWireT962::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 95 of file CalWireT962_module.cc.

References bin, f, fDecayConstsR, fDecayConstsS, fKernelR, fKernelS, fKernMapR, fKernMapS, fResponseFile, and MF_LOG_DEBUG.

96  {
97 
98  MF_LOG_DEBUG("CalWireT962") << "CalWireT962_module: Opening Electronics Response File: "
99  << fResponseFile.c_str();
100 
101  TFile f(fResponseFile.c_str());
102  if (f.IsZombie())
103  mf::LogWarning("CalWireT962") << "Cannot open response file " << fResponseFile.c_str();
104 
105  TH2D* respRe = dynamic_cast<TH2D*>(f.Get("real/RespRe"));
106  TH2D* respIm = dynamic_cast<TH2D*>(f.Get("real/RespIm"));
107  TH1D* decayHist = dynamic_cast<TH1D*>(f.Get("real/decayHist"));
108  unsigned int wires = decayHist->GetNbinsX();
109  unsigned int bins = respRe->GetYaxis()->GetNbins();
110  unsigned int bin = 0;
111  unsigned int wire = 0;
112  fDecayConstsR.resize(wires);
113  fKernMapR.resize(wires);
114  fKernelR.resize(respRe->GetXaxis()->GetNbins());
115  const TArrayD* edges = respRe->GetXaxis()->GetXbins();
116  for (int i = 0; i < respRe->GetXaxis()->GetNbins(); ++i) {
117  fKernelR[i].resize(bins);
118  for (bin = 0; bin < bins; ++bin) {
119 
120  const TComplex a(respRe->GetBinContent(i + 1, bin + 1),
121  respIm->GetBinContent(i + 1, bin + 1));
122  fKernelR[i][bin] = a;
123  }
124  for (; wire < (*edges)[i + 1]; ++wire) {
125  fKernMapR[wire] = i;
126  fDecayConstsR[wire] = decayHist->GetBinContent(wire + 1);
127  }
128  }
129  respRe = dynamic_cast<TH2D*>(f.Get("sim/RespRe"));
130  respIm = dynamic_cast<TH2D*>(f.Get("sim/RespIm"));
131  decayHist = dynamic_cast<TH1D*>(f.Get("sim/decayHist"));
132  wires = decayHist->GetNbinsX();
133  bins = respRe->GetYaxis()->GetNbins();
134  fDecayConstsS.resize(wires);
135  fKernMapS.resize(wires);
136  fKernelS.resize(respRe->GetXaxis()->GetNbins());
137  const TArrayD* edges1 = respRe->GetXaxis()->GetXbins();
138  wire = 0;
139  for (int i = 0; i < respRe->GetXaxis()->GetNbins(); ++i) {
140  fKernelS[i].resize(bins);
141  for (bin = 0; bin < bins; ++bin) {
142  const TComplex b(respRe->GetBinContent(i + 1, bin + 1),
143  respIm->GetBinContent(i + 1, bin + 1));
144  fKernelS[i][bin] = b;
145  }
146  for (; wire < (*edges1)[i + 1]; ++wire) {
147  fKernMapS[wire] = i;
148  fDecayConstsS[wire] = decayHist->GetBinContent(wire + 1);
149  }
150  }
151 
152  f.Close();
153  }
std::vector< std::vector< TComplex > > fKernelR
std::vector< double > fDecayConstsS
TFile f
Definition: plotHisto.C:6
std::vector< int > fKernMapS
float bin[41]
Definition: plottest35.C:14
std::vector< double > fDecayConstsR
#define MF_LOG_DEBUG(id)
std::vector< std::vector< TComplex > > fKernelS
std::vector< int > fKernMapR
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 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
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 caldata::CalWireT962::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 156 of file CalWireT962_module.cc.

References util::abs(), raw::RawDigit::ADCs(), bin, raw::RawDigit::Channel(), raw::RawDigit::Compression(), util::LArFFT::Convolute(), util::CreateAssn(), DEFINE_ART_MODULE, e, fDecayConstsR, fDecayConstsS, fDigitModuleLabel, fExpEndBins, util::LArFFT::FFTSize(), fKernelR, fKernelS, fKernMapR, fKernMapS, fPostsample, art::ProductRetriever::getByLabel(), raw::RawDigit::GetPedestal(), raw::InvalidChannelID, art::Event::isRealData(), art::Ptr< T >::key(), art::errors::ProductRegistrationFailure, art::Event::put(), raw::RawDigit::Samples(), and raw::Uncompress().

157  {
158 
159  // get the geometry
161 
162  std::vector<double> decayConsts;
163  std::vector<int> kernMap;
164  std::vector<std::vector<TComplex>> kernel;
165  //Put correct response functions and decay constants in place
166  if (evt.isRealData()) {
167  decayConsts = fDecayConstsR;
168  kernMap = fKernMapR;
169  kernel = fKernelR;
170  }
171  else {
172  decayConsts = fDecayConstsS;
173  kernMap = fKernMapS;
174  kernel = fKernelS;
175  }
176 
177  // get the FFT service to have access to the FFT size
179 
180  // make a collection of Wires
181  std::unique_ptr<std::vector<recob::Wire>> wirecol(new std::vector<recob::Wire>);
182  // ... and an association set
183  std::unique_ptr<art::Assns<raw::RawDigit, recob::Wire>> WireDigitAssn(
185 
186  // Read in the digit List object(s).
188  evt.getByLabel(fDigitModuleLabel, digitVecHandle);
189 
190  if (!digitVecHandle->size()) return;
191  mf::LogInfo("CalWireT962") << "CalWireT962:: digitVecHandle size is " << digitVecHandle->size();
192 
193  // Use the handle to get a particular (0th) element of collection.
194  art::Ptr<raw::RawDigit> digitVec0(digitVecHandle, 0);
195 
196  unsigned int dataSize = digitVec0->Samples(); //size of raw data vectors
197 
198  int transformSize = fFFT->FFTSize();
199  raw::ChannelID_t channel = raw::InvalidChannelID; // channel number
200  unsigned int bin(0); // time bin loop variable
201 
202  lariov::ChannelStatusProvider const& channelStatus =
204 
205  double decayConst = 0.; // exponential decay constant of electronics shaping
206  double fitAmplitude = 0.; //This is the seed value for the amplitude in the exponential tail fit
207  std::vector<float> holder; // holds signal data
208  std::vector<TComplex> freqHolder(transformSize + 1); // temporary frequency data
209 
210  // loop over all wires
211  for (unsigned int rdIter = 0; rdIter < digitVecHandle->size(); ++rdIter) { // ++ move
212  holder.clear();
213 
214  art::Ptr<raw::RawDigit> digitVec(digitVecHandle, rdIter);
216  digitVec->Samples()); // vector holding uncompressed adc values
217  raw::Uncompress(digitVec->ADCs(), rawadc, digitVec->Compression());
218  channel = digitVec->Channel();
219 
220  // skip bad channels
221  if (!channelStatus.IsBad(channel)) {
222  holder.resize(transformSize);
223 
224  for (bin = 0; bin < dataSize; ++bin)
225  holder[bin] = (rawadc[bin] - digitVec->GetPedestal());
226  // fExpEndBins only nonzero for detectors needing exponential tail fitting
227  if (fExpEndBins && std::abs(decayConsts[channel]) > 0.0) {
228 
229  TH1D expTailData(
230  "expTailData", "Tail data for fit", fExpEndBins, dataSize - fExpEndBins, dataSize);
231  TF1 expFit("expFit", "[0]*exp([1]*x)");
232 
233  for (bin = 0; bin < (unsigned int)fExpEndBins; ++bin)
234  expTailData.Fill(dataSize - fExpEndBins + bin, holder[dataSize - fExpEndBins + bin]);
235  decayConst = decayConsts[channel];
236  fitAmplitude =
237  holder[dataSize - fExpEndBins] / exp(decayConst * (dataSize - fExpEndBins));
238  expFit.FixParameter(1, decayConst);
239  expFit.SetParameter(0, fitAmplitude);
240  expTailData.Fit(&expFit, "QWN", "", dataSize - fExpEndBins, dataSize);
241  expFit.SetRange(dataSize, transformSize);
242  for (bin = 0; bin < dataSize; ++bin)
243  holder[dataSize + bin] = expFit.Eval(bin + dataSize);
244  }
245  // This is actually deconvolution, by way of convolution with the inverted
246  // kernel. This code assumes the response function has already been
247  // been transformed and inverted. This way a complex multiplication, rather
248  // than a complex division is performed saving 2 multiplications and
249  // 2 divsions
250 
251  fFFT->Convolute(holder, kernel[kernMap[channel]]);
252  } // end if channel is a good channel
253 
254  holder.resize(dataSize, 1e-5);
255  //This restores the DC component to signal removed by the deconvolution.
256  if (fPostsample) {
257  double average = 0.0;
258  for (bin = 0; bin < (unsigned int)fPostsample; ++bin)
259  average += holder[holder.size() - 1 - bin] / (double)fPostsample;
260  for (bin = 0; bin < holder.size(); ++bin)
261  holder[bin] -= average;
262  }
263 
264  // Make a single ROI that spans the entire data size
265  wirecol->push_back(recob::WireCreator(holder, *digitVec).move());
266 
267  // add an association between the last object in wirecol
268  // (that we just inserted) and digitVec
269  if (!util::CreateAssn(evt, *wirecol, digitVec, *WireDigitAssn)) {
271  << "Can't associate wire #" << (wirecol->size() - 1) << " with raw digit #"
272  << digitVec.key();
273  } // if failed to add association
274  }
275 
276  if (wirecol->size() == 0) mf::LogWarning("CalWireT962") << "No wires made for this event.";
277 
278  evt.put(std::move(wirecol));
279  evt.put(std::move(WireDigitAssn));
280 
281  return;
282  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
int fPostsample
number of postsample bins
constexpr auto abs(T v)
Returns the absolute value of the argument.
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:72
bool isRealData() const
Definition: Event.cc:53
Class managing the creation of a new recob::Wire object.
Definition: WireCreator.h:55
std::vector< std::vector< TComplex > > fKernelR
std::vector< double > fDecayConstsS
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: Event.h:77
int FFTSize() const
Definition: LArFFT.h:66
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:31
std::string fDigitModuleLabel
module that made digits
std::vector< int > fKernMapS
void Convolute(std::vector< T > &input, std::vector< T > &respFunc)
Definition: LArFFT.h:170
float bin[41]
Definition: plottest35.C:14
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::vector< double > fDecayConstsR
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
Definition: raw.cxx:744
Float_t e
Definition: plot.C:35
std::vector< std::vector< TComplex > > fKernelS
std::vector< int > fKernMapR
int fExpEndBins
number of end bins to consider for tail fit
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 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

std::vector<double> caldata::CalWireT962::fDecayConstsR
private

vector holding RC decay constants

Definition at line 66 of file CalWireT962_module.cc.

Referenced by beginJob(), and produce().

std::vector<double> caldata::CalWireT962::fDecayConstsS
private

vector holding RC decay constants

Definition at line 68 of file CalWireT962_module.cc.

Referenced by beginJob(), and produce().

std::string caldata::CalWireT962::fDigitModuleLabel
private

module that made digits

Definition at line 60 of file CalWireT962_module.cc.

Referenced by CalWireT962(), and produce().

int caldata::CalWireT962::fExpEndBins
private

number of end bins to consider for tail fit

Definition at line 58 of file CalWireT962_module.cc.

Referenced by CalWireT962(), and produce().

std::vector<std::vector<TComplex> > caldata::CalWireT962::fKernelR
private

holds transformed induction response function

Definition at line 62 of file CalWireT962_module.cc.

Referenced by beginJob(), and produce().

std::vector<std::vector<TComplex> > caldata::CalWireT962::fKernelS
private

holds transformed induction response function

Definition at line 64 of file CalWireT962_module.cc.

Referenced by beginJob(), and produce().

std::vector<int> caldata::CalWireT962::fKernMapR
private

map telling which channels have which response functions

Definition at line 70 of file CalWireT962_module.cc.

Referenced by beginJob(), and produce().

std::vector<int> caldata::CalWireT962::fKernMapS
private

map telling which channels have which response functions

Definition at line 72 of file CalWireT962_module.cc.

Referenced by beginJob(), and produce().

int caldata::CalWireT962::fPostsample
private

number of postsample bins

Definition at line 59 of file CalWireT962_module.cc.

Referenced by CalWireT962(), and produce().

std::string caldata::CalWireT962::fResponseFile
private

response file containing transformed shape histograms and decay constants

Definition at line 54 of file CalWireT962_module.cc.

Referenced by beginJob(), and CalWireT962().


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