LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
hit::FFTHitFinder Class Reference
Inheritance diagram for hit::FFTHitFinder:
art::EDProducer art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerBase::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 FFTHitFinder (fhicl::ParameterSet const &pset)
 
virtual ~FFTHitFinder ()
 
void produce (art::Event &evt)
 
void beginJob ()
 
void endJob ()
 
void reconfigure (fhicl::ParameterSet const &p)
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > consumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > consumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > mayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > mayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

std::string fCalDataModuleLabel
 
double fMinSigInd
 Induction signal height threshold. More...
 
double fMinSigCol
 Collection signal height threshold. More...
 
double fIndWidth
 Initial width for induction fit. More...
 
double fColWidth
 Initial width for collection fit. More...
 
double fIndMinWidth
 Minimum induction hit width. More...
 
double fColMinWidth
 Minimum collection hit width. More...
 
int fMaxMultiHit
 maximum hits for multi fit More...
 
int fAreaMethod
 Type of area calculation. More...
 
std::vector< double > fAreaNorms
 factors for converting area to same units as peak height More...
 

Detailed Description

Definition at line 46 of file FFTHitFinder_module.cc.

Member Typedef Documentation

using art::EDProducer::ModuleType = EDProducer
inherited

Definition at line 34 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::EDProducer::Table = ProducerBase::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 43 of file EDProducer.h.

using art::EDProducer::WorkerType = WorkerT<EDProducer>
inherited

Definition at line 35 of file EDProducer.h.

Constructor & Destructor Documentation

hit::FFTHitFinder::FFTHitFinder ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 76 of file FFTHitFinder_module.cc.

References recob::HitAndAssociationsWriterBase::declare_products(), and reconfigure().

77  {
78  this->reconfigure(pset);
79 
80  // let HitCollectionCreator declare that we are going to produce
81  // hits and associations with wires and raw digits
82  // (with no particular product label)
84  }
void reconfigure(fhicl::ParameterSet const &p)
static void declare_products(ModuleType &producer, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
Definition: HitCreator.h:1117
hit::FFTHitFinder::~FFTHitFinder ( )
virtual

Definition at line 88 of file FFTHitFinder_module.cc.

89  {
90  }

Member Function Documentation

void hit::FFTHitFinder::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 108 of file FFTHitFinder_module.cc.

109  {
110  }
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 147 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

148 {
149  if (!moduleContext_)
150  return ProductToken<T>::invalid();
151 
152  consumables_[BT].emplace_back(ConsumableType::Product,
153  TypeID{typeid(T)},
154  it.label(),
155  it.instance(),
156  it.process());
157  return ProductToken<T>{it};
158 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 162 of file Consumer.h.

163 {
164  if (!moduleContext_)
165  return;
166 
167  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
168 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 172 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

173 {
174  if (!moduleContext_)
175  return ViewToken<T>::invalid();
176 
177  consumables_[BT].emplace_back(ConsumableType::ViewElement,
178  TypeID{typeid(T)},
179  it.label(),
180  it.instance(),
181  it.process());
182  return ViewToken<T>{it};
183 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited

Definition at line 32 of file EngineCreator.cc.

References art::EngineCreator::rng().

34 {
35  return rng()->createEngine(
36  placeholder_schedule_id(), seed, kind_of_engine_to_make);
37 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited

Definition at line 40 of file EngineCreator.cc.

References art::EngineCreator::rng().

43 {
44  return rng()->createEngine(
45  placeholder_schedule_id(), seed, kind_of_engine_to_make, engine_label);
46 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
CurrentProcessingContext const * art::EDProducer::currentContext ( ) const
protectedinherited

Definition at line 120 of file EDProducer.cc.

References art::EDProducer::current_context_.

121  {
122  return current_context_.get();
123  }
CPC_exempt_ptr current_context_
Definition: EDProducer.h:116
void hit::FFTHitFinder::endJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 113 of file FFTHitFinder_module.cc.

114  {
115  }
EngineCreator::seed_t EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited

Definition at line 49 of file EngineCreator.cc.

References fhicl::ParameterSet::get().

Referenced by art::MixFilter< T >::initEngine_().

52 {
53  auto const& explicit_seeds = pset.get<std::vector<int>>(key, {});
54  return explicit_seeds.empty() ? implicit_seed : explicit_seeds.front();
55 }
template<typename PROD , BranchType B>
ProductID art::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 123 of file EDProducer.h.

References art::EDProducer::moduleDescription_.

124  {
125  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
126  instanceName);
127  }
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References B, and art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
Int_t B
Definition: plot.C:25
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 190 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

191 {
192  if (!moduleContext_)
193  return ProductToken<T>::invalid();
194 
195  consumables_[BT].emplace_back(ConsumableType::Product,
196  TypeID{typeid(T)},
197  it.label(),
198  it.instance(),
199  it.process());
200  return ProductToken<T>{it};
201 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 205 of file Consumer.h.

206 {
207  if (!moduleContext_)
208  return;
209 
210  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
211 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 215 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

216 {
217  if (!moduleContext_)
218  return ViewToken<T>::invalid();
219 
220  consumables_[BT].emplace_back(ConsumableType::ViewElement,
221  TypeID{typeid(T)},
222  it.label(),
223  it.instance(),
224  it.process());
225  return ViewToken<T>{it};
226 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID().

41  {
42  return true;
43  }
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited

Definition at line 89 of file Consumer.cc.

References fhicl::ParameterSet::get_if_present().

Referenced by art::EDProducer::doBeginJob(), art::EDFilter::doBeginJob(), and art::EDAnalyzer::doBeginJob().

90 {
91  if (!moduleContext_)
92  return;
93 
94  pset.get_if_present("errorOnMissingConsumes", requireConsumes_);
95  for (auto& consumablesPerBranch : consumables_) {
96  cet::sort_all(consumablesPerBranch);
97  }
98 }
bool requireConsumes_
Definition: Consumer.h:137
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
void hit::FFTHitFinder::produce ( art::Event evt)
virtual
Todo:
  • just get the integral from the fit for totSig
Todo:
need to have a disambiguation algorithm somewhere in here
Todo:
  • multiplicity and local_index have to be determined

Implements art::EDProducer.

Definition at line 121 of file FFTHitFinder_module.cc.

References recob::Wire::Channel(), geo::GeometryCore::ChannelToWire(), DEFINE_ART_MODULE, recob::HitCollectionCreator::emplace_back(), fAreaMethod, fAreaNorms, fCalDataModuleLabel, fColMinWidth, fColWidth, fIndMinWidth, fIndWidth, fMaxMultiHit, fMinSigCol, fMinSigInd, art::DataViewImpl::getByLabel(), raw::InvalidChannelID, geo::kCollection, geo::kInduction, recob::HitCollectionCreator::put_into(), recob::Wire::Signal(), and geo::GeometryCore::SignalType().

122  {
123 
124  // this object contains the hit collection
125  // and its associations to wires and raw digits:
126  recob::HitCollectionCreator hcol(*this, evt);
127 
128  // Read in the wire List object(s).
130  evt.getByLabel(fCalDataModuleLabel,wireVecHandle);
132 
133  // also get the raw digits associated with wires
134  art::FindOneP<raw::RawDigit> WireToRawDigits
135  (wireVecHandle, evt, fCalDataModuleLabel);
136 
137  std::vector<int> startTimes; // stores time of 1st local minimum
138  std::vector<int> maxTimes; // stores time of local maximum
139  std::vector<int> endTimes; // stores time of 2nd local minimum
140  int time = 0; // current time bin
141  int minTimeHolder = 0; // current start time
142  raw::ChannelID_t channel = raw::InvalidChannelID; // channel number
143  bool maxFound = false; // Flag for whether a peak > threshold has been found
144  double threshold = 0.; // minimum signal size for id'ing a hit
145  double fitWidth = 0.; // hit fit width initial value
146  double minWidth = 0.; // minimum hit width
147  std::string eqn = "gaus(0)"; // string for equation to fit
148  geo::SigType_t sigType = geo::kInduction;// type of plane we are looking at
149  std::stringstream numConv;
150 
151 
152  //loop over wires
153  for(unsigned int wireIter = 0; wireIter < wireVecHandle->size(); wireIter++) {
154 
155  art::Ptr<recob::Wire> wire(wireVecHandle, wireIter);
156  startTimes.clear();
157  maxTimes.clear();
158  endTimes.clear();
159  std::vector<float> signal(wire->Signal());
160  std::vector<float>::iterator timeIter; // iterator for time bins
161  time = 0;
162  minTimeHolder = 0;
163  maxFound = false;
164  channel = wire->Channel();
165  sigType = geom->SignalType(channel);
166 
167  //Set the appropriate signal widths and thresholds
168  if(sigType == geo::kInduction){
169  threshold = fMinSigInd;
170  fitWidth = fIndWidth;
171  minWidth = fIndMinWidth;
172  }
173  else if(sigType == geo::kCollection){
174  threshold = fMinSigCol;
175  fitWidth = fColWidth;
176  minWidth = fColMinWidth;
177  }
178  // loop over signal
179  for(timeIter = signal.begin(); timeIter+2 < signal.end(); timeIter++){
180  //test if timeIter+1 is a local minimum
181  if(*timeIter > *(timeIter+1) && *(timeIter+1) < *(timeIter+2)){
182  //only add points if already found a local max above threshold.
183  if(maxFound) {
184  endTimes.push_back(time+1);
185  maxFound = false;
186  //keep these in case new hit starts right away
187  minTimeHolder = time+2;
188  }
189  else minTimeHolder = time+1;
190  }
191  //if not a minimum, test if we are at a local maximum
192  //if so, and the max value is above threshold, add it and proceed.
193  else if(*timeIter < *(timeIter+1) &&
194  *(timeIter+1) > *(timeIter+2) &&
195  *(timeIter+1) > threshold){
196  maxFound = true;
197  maxTimes.push_back(time+1);
198  startTimes.push_back(minTimeHolder);
199  }
200  time++;
201  }//end loop over signal vec
202 
203 
204  //if no inflection found before end, but peak found add end point
205  while(maxTimes.size()>endTimes.size())
206  endTimes.push_back(signal.size()-1);
207  if(startTimes.size() == 0) continue;
208 
209  //All code below does the fitting, adding of hits
210  //to the hit vector and when all wires are complete
211  //saving them
212  double totSig(0); // stores the total hit signal
213  double startT(0); // stores the start time
214  double endT(0); // stores the end time
215  int numHits(0); // number of consecutive hits being fitted
216  int size(0); // size of data vector for fit
217  int hitIndex(0); // index of current hit in sequence
218  double amplitude(0), position(0), width(0); //fit parameters
219  double amplitudeErr(0), positionErr(0), widthErr(0); //fit errors
220  double goodnessOfFit(0), chargeErr(0); //Chi2/NDF and error on charge
221  double minPeakHeight(0); //lowest peak height in multi-hit fit
222 
223  //stores gaussian paramters first index is the hit number
224  //the second refers to height, position, and width respectively
225  std::vector<double> hitSig;
226 
227  //add found hits to hit vector
228  while(hitIndex < (signed)startTimes.size()) {
229 
230  startT = endT = 0;
231  numHits = 1;
232  minPeakHeight = signal[maxTimes[hitIndex]];
233 
234  //consider adding pulse to group of consecutive hits if:
235  //1 less than max consecutive hits
236  //2 we are not at the last point in the signal vector
237  //3 the height of the dip between the two is greater than threshold/2
238  //4 and there is no gap between them
239  while(numHits < fMaxMultiHit &&
240  numHits+hitIndex < (signed)endTimes.size() &&
241  signal[endTimes[hitIndex+numHits-1]] >threshold/2.0 &&
242  startTimes[hitIndex+numHits] - endTimes[hitIndex+numHits-1] < 2){
243 
244  if(signal[maxTimes[hitIndex+numHits]] < minPeakHeight)
245  minPeakHeight = signal[maxTimes[hitIndex+numHits]];
246 
247  ++numHits;
248  }
249 
250  //finds the first point > 1/2 the smallest peak
251  startT = startTimes[hitIndex];
252 
253  while(signal[(int)startT] < minPeakHeight/2.0) ++startT;
254 
255  //finds the first point from the end > 1/2 the smallest peak
256  endT = endTimes[hitIndex+numHits-1];
257 
258  while(signal[(int)endT] <minPeakHeight/2.0) --endT;
259  size = (int)(endT-startT);
260  TH1D hitSignal("hitSignal","",size,startT,endT);
261  for(int i = (int)startT; i < (int)endT; ++i)
262  hitSignal.Fill(i,signal[i]);
263 
264  //build the TFormula
265  eqn = "gaus(0)";
266 
267  for(int i = 3; i < numHits*3; i+=3) {
268  eqn.append("+gaus(");
269  numConv.str("");
270  numConv << i;
271  eqn.append(numConv.str());
272  eqn.append(")");
273  }
274 
275  TF1 gSum("gSum",eqn.c_str(),0,size);
276 
277  if(numHits > 1) {
278  TArrayD data(numHits*numHits);
279  TVectorD amps(numHits);
280  for(int i = 0; i < numHits; ++i) {
281  amps[i] = signal[maxTimes[hitIndex+i]];
282  for(int j = 0; j < numHits;j++)
283  data[i+numHits*j] = TMath::Gaus(maxTimes[hitIndex+j],
284  maxTimes[hitIndex+i],
285  fitWidth);
286  }//end loop over hits
287 
288  //This section uses a linear approximation in order to get an
289  //initial value of the individual hit amplitudes
290  try{
291  TMatrixD h(numHits,numHits);
292  h.Use(numHits,numHits,data.GetArray());
293  TDecompSVD a(h);
294  a.Solve(amps);
295  }
296  catch(...){
297  mf::LogInfo("FFTHitFinder")<<"TDcompSVD failed";
298  hitIndex += numHits;
299  continue;
300  }
301 
302  for(int i = 0; i < numHits; ++i) {
303  //if the approximation makes a peak vanish
304  //set initial height as average of threshold and
305  //raw peak height
306  if(amps[i] > 0 ) amplitude = amps[i];
307  else amplitude = 0.5*(threshold+signal[maxTimes[hitIndex+i]]);
308  gSum.SetParameter(3*i,amplitude);
309  gSum.SetParameter(1+3*i, maxTimes[hitIndex+i]);
310  gSum.SetParameter(2+3*i, fitWidth);
311  gSum.SetParLimits(3*i, 0.0, 3.0*amplitude);
312  gSum.SetParLimits(1+3*i, startT , endT);
313  gSum.SetParLimits(2+3*i, 0.0, 10.0*fitWidth);
314  }//end loop over hits
315  }//end if numHits > 1
316  else {
317  gSum.SetParameters(signal[maxTimes[hitIndex]],maxTimes[hitIndex],fitWidth);
318  gSum.SetParLimits(0,0.0,1.5*signal[maxTimes[hitIndex]]);
319  gSum.SetParLimits(1, startT , endT);
320  gSum.SetParLimits(2,0.0,10.0*fitWidth);
321  }
322 
324  hitSignal.Fit(&gSum,"QNRW","", startT, endT);
325  for(int hitNumber = 0; hitNumber < numHits; ++hitNumber) {
326  totSig = 0;
327  if(gSum.GetParameter(3*hitNumber) > threshold/2.0 &&
328  gSum.GetParameter(3*hitNumber+2) > minWidth) {
329  amplitude = gSum.GetParameter(3*hitNumber);
330  position = gSum.GetParameter(3*hitNumber+1);
331  width = gSum.GetParameter(3*hitNumber+2);
332  amplitudeErr = gSum.GetParError(3*hitNumber);
333  positionErr = gSum.GetParError(3*hitNumber+1);
334  widthErr = gSum.GetParError(3*hitNumber+2);
335  goodnessOfFit = gSum.GetChisquare()/(double)gSum.GetNDF();
336  int DoF = gSum.GetNDF();
337 
338  //estimate error from area of Gaussian
339  chargeErr = std::sqrt(TMath::Pi())*(amplitudeErr*width+widthErr*amplitude);
340 
341  hitSig.resize(size);
342 
343  for(int sigPos = 0; sigPos < size; ++sigPos){
344  hitSig[sigPos] = amplitude*TMath::Gaus(sigPos+startT,position, width);
345  totSig += hitSig[(int)sigPos];
346  }
347 
348  if(fAreaMethod)
349  totSig = std::sqrt(2*TMath::Pi())*amplitude*width/fAreaNorms[(size_t)sigType];
350 
351  // get the WireID for this hit
352  std::vector<geo::WireID> wids = geom->ChannelToWire(channel);
354  // for now, just take the first option returned from ChannelToWire
355  geo::WireID wid = wids[0];
356 
357  // make the hit
359  *wire, // wire
360  wid, // wireID
361  (int) startT, // start_tick
362  (int) endT, // end_tick
363  width, // rms
364  position, // peak_time
365  positionErr, // sigma_peak_time
366  amplitude, // peak_amplitude
367  amplitudeErr, // sigma_peak_amplitude
368  totSig, // hit_integral
369  chargeErr, // hit_sigma_integral
370  std::accumulate // summedADC
371  (signal.begin() + (int) startT, signal.begin() + (int) endT, 0.),
372  1, // multiplicity
373  -1, // local_index
375  goodnessOfFit, // goodness_of_fit
376  DoF // dof
377  );
378 
379  // get the object associated with the original hit
380  art::Ptr<raw::RawDigit> rawdigits = WireToRawDigits.at(wireIter);
381 
382  hcol.emplace_back(hit.move(), wire, rawdigits);
383  }//end if over threshold
384  }//end loop over hits
385  hitIndex += numHits;
386  } // end while on hitIndex<(signed)startTimes.size()
387 
388  } // while on Wires
389 
390  // put the hit collection and associations into the event
391  hcol.put_into(evt);
392 
393  } // End of produce()
double fIndMinWidth
Minimum induction hit width.
intermediate_table::iterator iterator
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
double fMinSigInd
Induction signal height threshold.
double fIndWidth
Initial width for induction fit.
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
int fMaxMultiHit
maximum hits for multi fit
double fColWidth
Initial width for collection fit.
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
std::vector< double > fAreaNorms
factors for converting area to same units as peak height
Class managing the creation of a new recob::Hit object.
Definition: HitCreator.h:84
std::string fCalDataModuleLabel
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:31
A class handling a collection of hits and its associations.
Definition: HitCreator.h:513
Signal from induction planes.
Definition: geo_types.h:92
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
double fColMinWidth
Minimum collection hit width.
Detector simulation of raw signals on wires.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
double fMinSigCol
Collection signal height threshold.
int fAreaMethod
Type of area calculation.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:27
Definition: fwd.h:25
Signal from collection planes.
Definition: geo_types.h:93
void hit::FFTHitFinder::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 93 of file FFTHitFinder_module.cc.

References fAreaMethod, fAreaNorms, fCalDataModuleLabel, fColMinWidth, fColWidth, fIndMinWidth, fIndWidth, fMaxMultiHit, fMinSigCol, fMinSigInd, and fhicl::ParameterSet::get().

Referenced by FFTHitFinder().

94  {
95  fCalDataModuleLabel = p.get< std::string >("CalDataModuleLabel");
96  fMinSigInd = p.get< double >("MinSigInd");
97  fMinSigCol = p.get< double >("MinSigCol");
98  fIndWidth = p.get< double >("IndWidth");
99  fColWidth = p.get< double >("ColWidth");
100  fIndMinWidth = p.get< double >("IndMinWidth");
101  fColMinWidth = p.get< double >("ColMinWidth");
102  fMaxMultiHit = p.get< int >("MaxMultiHit");
103  fAreaMethod = p.get< int >("AreaMethod");
104  fAreaNorms = p.get< std::vector< double > >("AreaNorms");
105  }
double fIndMinWidth
Minimum induction hit width.
double fMinSigInd
Induction signal height threshold.
double fIndWidth
Initial width for induction fit.
int fMaxMultiHit
maximum hits for multi fit
double fColWidth
Initial width for collection fit.
std::vector< double > fAreaNorms
factors for converting area to same units as peak height
std::string fCalDataModuleLabel
double fColMinWidth
Minimum collection hit width.
double fMinSigCol
Collection signal height threshold.
int fAreaMethod
Type of area calculation.
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Definition at line 125 of file Consumer.cc.

Referenced by art::EDProducer::doEndJob(), art::EDFilter::doEndJob(), art::EDAnalyzer::doEndJob(), and art::RootOutput::endJob().

126 {
127  if (!moduleContext_)
128  return;
129 
130  // If none of the branches have missing consumes statements, exit early.
131  if (std::all_of(cbegin(missingConsumes_),
132  cend(missingConsumes_),
133  [](auto const& perBranch) { return perBranch.empty(); }))
134  return;
135 
136  constexpr cet::HorizontalRule rule{60};
137  mf::LogPrint log{"MTdiagnostics"};
138  log << '\n'
139  << rule('=') << '\n'
140  << "The following consumes (or mayConsume) statements are missing from\n"
141  << module_context(moduleDescription_) << '\n'
142  << rule('-') << '\n';
143 
144  cet::for_all_with_index(
145  missingConsumes_, [&log](std::size_t const i, auto const& perBranch) {
146  for (auto const& pi : perBranch) {
147  log << " "
148  << assemble_consumes_statement(static_cast<BranchType>(i), pi)
149  << '\n';
150  }
151  });
152  log << rule('=');
153 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Definition at line 101 of file Consumer.cc.

References art::errors::ProductRegistrationFailure.

103 {
104  // Early exits if consumes tracking has been disabled or if the
105  // consumed product is an allowed consumable.
106  if (!moduleContext_)
107  return;
108 
109  if (cet::binary_search_all(consumables_[bt], pi))
110  return;
111 
112  if (requireConsumes_) {
114  "Consumer: an error occurred during validation of a "
115  "retrieved product\n\n")
116  << "The following consumes (or mayConsume) statement is missing from\n"
117  << module_context(moduleDescription_) << ":\n\n"
118  << " " << assemble_consumes_statement(bt, pi) << "\n\n";
119  }
120 
121  missingConsumes_[bt].insert(pi);
122 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
bool requireConsumes_
Definition: Consumer.h:137
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139

Member Data Documentation

int hit::FFTHitFinder::fAreaMethod
private

Type of area calculation.

Definition at line 68 of file FFTHitFinder_module.cc.

Referenced by produce(), and reconfigure().

std::vector<double> hit::FFTHitFinder::fAreaNorms
private

factors for converting area to same units as peak height

Definition at line 69 of file FFTHitFinder_module.cc.

Referenced by produce(), and reconfigure().

std::string hit::FFTHitFinder::fCalDataModuleLabel
private

Definition at line 60 of file FFTHitFinder_module.cc.

Referenced by produce(), and reconfigure().

double hit::FFTHitFinder::fColMinWidth
private

Minimum collection hit width.

Definition at line 66 of file FFTHitFinder_module.cc.

Referenced by produce(), and reconfigure().

double hit::FFTHitFinder::fColWidth
private

Initial width for collection fit.

Definition at line 64 of file FFTHitFinder_module.cc.

Referenced by produce(), and reconfigure().

double hit::FFTHitFinder::fIndMinWidth
private

Minimum induction hit width.

Definition at line 65 of file FFTHitFinder_module.cc.

Referenced by produce(), and reconfigure().

double hit::FFTHitFinder::fIndWidth
private

Initial width for induction fit.

Definition at line 63 of file FFTHitFinder_module.cc.

Referenced by produce(), and reconfigure().

int hit::FFTHitFinder::fMaxMultiHit
private

maximum hits for multi fit

Definition at line 67 of file FFTHitFinder_module.cc.

Referenced by produce(), and reconfigure().

double hit::FFTHitFinder::fMinSigCol
private

Collection signal height threshold.

Definition at line 62 of file FFTHitFinder_module.cc.

Referenced by produce(), and reconfigure().

double hit::FFTHitFinder::fMinSigInd
private

Induction signal height threshold.

Definition at line 61 of file FFTHitFinder_module.cc.

Referenced by produce(), and reconfigure().


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