LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
hit::RawHitFinder Class Reference
Inheritance diagram for hit::RawHitFinder:
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

 RawHitFinder (fhicl::ParameterSet const &pset)
 
virtual ~RawHitFinder ()
 
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

unsigned int fDataSize
 
art::InputTag fDigitModuleLabel
 
std::string fSpillName
 
std::string fCalDataModuleLabel
 
std::string fHitLabelName
 
double fMinSigInd
 
double fMinSigCol
 
double fIndWidth
 
double fColWidth
 
double fIndMinWidth
 
double fColMinWidth
 
int fMaxMultiHit
 
int fAreaMethod
 
std::vector< double > fAreaNorms
 
bool fUncompressWithPed
 
bool fSkipInd
 
double fIncludeMoreTail
 
int fColMinWindow
 
int fIndCutoff
 

Detailed Description

Definition at line 61 of file RawHitFinder_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::RawHitFinder::RawHitFinder ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 104 of file RawHitFinder_module.cc.

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

105  {
106  this->reconfigure(pset);
107 
108  //LET HITCOLLECTIONCREATOR DECLARE THAT WE ARE GOING TO PRODUCE
109  //HITS AND ASSOCIATIONS TO RAW DIGITS BUT NOT ASSOCIATIONS TO WIRES
110  //(WITH NO PARTICULAR PRODUCT LABEL).
112  /*instance_name*/"",
113  /*doWireAssns*/false,
114  /*doRawDigitAssns*/true);
115  }
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::RawHitFinder::~RawHitFinder ( )
virtual

Definition at line 118 of file RawHitFinder_module.cc.

119  {
120  }

Member Function Documentation

void hit::RawHitFinder::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 144 of file RawHitFinder_module.cc.

145  {
146  }
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::RawHitFinder::endJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 148 of file RawHitFinder_module.cc.

149  {
150  }
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::RawHitFinder::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 153 of file RawHitFinder_module.cc.

References raw::RawDigit::ADCs(), bin, raw::RawDigit::Channel(), geo::GeometryCore::ChannelToWire(), raw::RawDigit::Compression(), DEFINE_ART_MODULE, recob::HitCollectionCreator::emplace_back(), evd::details::end(), fColMinWindow, fDataSize, fDigitModuleLabel, fIncludeMoreTail, fIndCutoff, fMinSigCol, fMinSigInd, fSkipInd, fUncompressWithPed, art::DataViewImpl::getByLabel(), raw::RawDigit::GetPedestal(), geo::kCollection, geo::kInduction, recob::HitCollectionCreator::put_into(), recob::HitCollectionCreator::reserve(), raw::RawDigit::Samples(), geo::GeometryCore::SignalType(), and raw::Uncompress().

154  {
155  //GET THE GEOMETRY.
157 
158  //READ IN THE DIGIT LIST OBJECTS(S).
160 
161  bool retVal = evt.getByLabel(fDigitModuleLabel, digitVecHandle);
162  if(retVal==true)
163  mf::LogInfo("RawHitFinder_module") << "I got fDigitModuleLabel: " << fDigitModuleLabel << std::endl;
164  else
165  mf::LogWarning("RawHitFinder_module") << "Could not get fDigitModuleLabel: " << fDigitModuleLabel << std::endl;
166 
167  std::vector<float> holder; //HOLDS SIGNAL DATA.
168  std::vector<short> rawadc; //UNCOMPRESSED ADC VALUES.
169 
170  // ###############################################
171  // ### Making a ptr vector to put on the event ###
172  // ###############################################
173  // THIS CONTAINS THE HIT COLLECTION AND ITS ASSOCIATIONS TO WIRES AND RAW DIGITS.
174  recob::HitCollectionCreator hcol(*this, evt, false /* doWireAssns */, true /* doRawDigitAssns */);
175 
176  std::vector<float> startTimes; //STORES TIME OF WINDOW START.
177  std::vector<float> maxTimes; //STORES TIME OF LOCAL MAXIMUM.
178  std::vector<float> endTimes; //STORES TIME OF WINDOW END.
179  std::vector<float> peakHeight; //STORES ADC COUNT AT THE MAXIMUM.
180  std::vector<float> hitrms; //STORES CHARGE WEIGHTED RMS OF TIME ACROSS THE HIT.
181  std::vector<double> charge; //STORES THE TOTAL CHARGE ASSOCIATED WITH THE HIT.
182 
183  uint32_t channel = 0; //CHANNEL NUMBER.
184  double threshold = 0; //MINIMUM SIGNAL SIZE FOR ID'ING A HIT.
185  double totSig = 0;
186  double myrms = 0;
187  double mynorm = 0;
189  std::stringstream numConv;
190 
191  hcol.reserve(digitVecHandle->size());
192  for(size_t rdIter = 0; rdIter < digitVecHandle->size(); ++rdIter){
193  holder.clear();
194 
195  //GET THE REFERENCE TO THE CURRENT raw::RawDigit.
196  art::Ptr<raw::RawDigit> digitVec(digitVecHandle, rdIter);
197  channel = digitVec->Channel();
198  fDataSize = digitVec->Samples();
199 
200  rawadc.resize(fDataSize);
201  holder.resize(fDataSize);
202 
203  //UNCOMPRESS THE DATA.
204  if (fUncompressWithPed){
205  int pedestal = (int)digitVec->GetPedestal();
206  raw::Uncompress(digitVec->ADCs(), rawadc, pedestal, digitVec->Compression());
207  }
208  else{
209  raw::Uncompress(digitVec->ADCs(), rawadc, digitVec->Compression());
210  }
211 
212  //GET THE LIST OF BAD CHANNELS.
213  lariov::ChannelStatusProvider const& channelStatus
215 
216  lariov::ChannelStatusProvider::ChannelSet_t const BadChannels
217  = channelStatus.BadChannels();
218 
219  for(unsigned int bin = 0; bin < fDataSize; ++bin){
220  holder[bin]=(rawadc[bin]-digitVec->GetPedestal());
221  }
222 
223  sigType = geom->SignalType(channel);
224 
225  peakHeight.clear();
226  endTimes.clear();
227  startTimes.clear();
228  maxTimes.clear();
229  charge.clear();
230  hitrms.clear();
231 
232  bool channelSwitch = false;
233 
234  for(auto it = BadChannels.begin(); it != BadChannels.end(); it++)
235  {
236  if(channel==*it)
237  {
238  channelSwitch = true;
239  break;
240  }
241  }
242 
243  if(channelSwitch==false)
244  {
245  // ###############################################
246  // ### Induction Planes ###
247  // ###############################################
248 
249  //THE INDUCTION PLANE METHOD HAS NOT YET BEEN MODIFIED AND TESTED FOR REAL DATA.
250  // Or for detectors without a grid plane
251  //
252  if(sigType == geo::kInduction && !fSkipInd){
253  threshold = fMinSigInd;
254  // std::cout<< "Threshold is " << threshold << std::endl;
255  // fitWidth = fIndWidth;
256  // minWidth = fIndMinWidth;
257  // continue;
258  float negthr=-1.0*threshold;
259  unsigned int bin =1;
260  float minadc=0;
261 
262  // find the dips
263  while (bin<(fDataSize-1)) { // loop over ticks
264  float thisadc = holder[bin]; float nextadc = holder[bin+1];
265  if (thisadc<negthr && nextadc < negthr) { // new region, require two ticks above threshold
266  // std::cout << "new region" << bin << " " << thisadc << std::endl;
267  // step back to find zero crossing
268  unsigned int place = bin;
269  while (thisadc<=0 && bin>0) {
270  // std::cout << bin << " " << thisadc << std::endl;
271  bin--;
272  thisadc=holder[bin];
273  }
274  float hittime = bin+thisadc/(thisadc-holder[bin+1]);
275  maxTimes.push_back(hittime);
276 
277  // step back more to find the hit start time
278  uint32_t stop;
279  if (fIndCutoff<(int)bin) {stop=bin-fIndCutoff;} else {stop=0;}
280  while (thisadc<threshold && bin>stop) {
281  // std::cout << bin << " " << thisadc << std::endl;
282  bin--;
283  thisadc=holder[bin];
284  }
285  if (bin>=2) bin-=2;
286  while (thisadc>threshold && bin>stop) {
287  // std::cout << bin << " " << thisadc << std::endl;
288  bin--;
289  thisadc=holder[bin];
290  }
291  startTimes.push_back(bin+1);
292  // now step forward from hit time to find end time, area of dip
293  bin=place;
294  thisadc=holder[bin];
295  minadc=thisadc;
296  bin++;
297  totSig = fabs(thisadc);
298  while (thisadc<negthr && bin<fDataSize) {
299  totSig += fabs(thisadc);
300  thisadc=holder[bin];
301  if (thisadc<minadc) minadc=thisadc;
302  bin++;
303  }
304  endTimes.push_back(bin-1);
305  peakHeight.push_back(-1.0*minadc);
306  charge.push_back(totSig);
307  hitrms.push_back(5.0);
308  // std::cout << "TOTAL SIGNAL INDUCTION " << totSig << " 5.0" << std::endl;
309  // std::cout << "filled end times " << bin-1 << "peak height vector size " << peakHeight.size() << std::endl;
310 
311  // don't look for a new hit until it returns to baseline
312  while (thisadc<0 && bin<fDataSize) {
313  // std::cout << bin << " " << thisadc << std::endl;
314  bin++;
315  thisadc=holder[bin];
316  }
317  } // end region
318  bin++;
319  }// loop over ticks
320  }
321 
322  // ###############################################
323  // ### Collection Plane ###
324  // ###############################################
325 
326  else if(sigType == geo::kCollection)
327  {
328  threshold = fMinSigCol;
329 
330  float madc = threshold;
331  int ibin = 0;
332  int start = 0;
333  int end = 0;
334  unsigned int bin = 0;
335 
336  while (bin<fDataSize)
337  {
338  float thisadc = holder[bin];
339  madc = threshold;
340  ibin = 0;
341 
342  if (thisadc>madc)
343  {
344  start = bin;
345 
346  if(thisadc>threshold && bin<fDataSize)
347  {
348  while (thisadc>threshold && bin<fDataSize)
349  {
350  if (thisadc>madc)
351  {
352  ibin=bin;
353  madc=thisadc;
354  }
355  bin++;
356  thisadc=holder[bin];
357  }
358  }
359  else
360  {
361  bin++;
362  }
363 
364  end = bin-1;
365 
366  if(start!=end)
367  {
368  maxTimes.push_back(ibin);
369  peakHeight.push_back(madc);
370  startTimes.push_back(start);
371  endTimes.push_back(end);
372 
373  totSig = 0;
374  myrms = 0;
375  mynorm = 0;
376 
377  int moreTail = std::ceil(fIncludeMoreTail*(end-start));
378  if (moreTail<fColMinWindow) moreTail=fColMinWindow;
379 
380  for(int i = start-moreTail; i <= end+moreTail; i++)
381  {
382  if(i<(int)(holder.size()) && i>=0)
383  {
384  float temp = ibin-i;
385  myrms += temp*temp*holder[i];
386 
387  totSig += holder[i];
388  }
389  }
390 
391  charge.push_back(totSig);
392  mynorm = totSig;
393  myrms/=mynorm;
394  hitrms.push_back(sqrt(myrms));
395 
396  //PRE CHANGES MADE 04/14/16. A BOOTH, DUNE 35T.
397  /*
398  int moreTail = std::ceil(fIncludeMoreTail*(end-start));
399 
400  for(int i = start-moreTail; i <= end+moreTail; i++)
401  {
402  totSig += holder[i];
403  float temp2 = holder[i]*holder[i];
404  mynorm += temp2;
405  float temp = ibin-i;
406  myrms += temp*temp*temp2;
407  }
408 
409  charge.push_back(totSig);
410  myrms/=mynorm;
411  if((end-start+2*moreTail+1)!=0)
412  {
413  myrms/=(float)(end-start+2*moreTail+1);
414  hitrms.push_back(sqrt(myrms));
415  }
416  else
417  {
418  hitrms.push_back(sqrt(myrms));
419  }*/
420  }
421  }
422  start = 0;
423  end = 0;
424  bin++;
425  }
426  }
427  }
428 
429  int numHits(0); //NUMBER OF CONSECUTIVE HITS BEING FITTED.
430  int hitIndex(0); //INDEX OF CURRENT HIT IN SEQUENCE.
431  double amplitude(0), position(0); //FIT PARAMETERS.
432  double start(0), end(0);
433  double amplitudeErr(0), positionErr(0); //FIT ERRORS.
434  double goodnessOfFit(0), chargeErr(0); //CHI2/NDF and error on charge.
435  double hrms(0);
436 
437  numHits = maxTimes.size();
438  for (int i = 0; i < numHits; ++i)
439  {
440  amplitude = peakHeight[i];
441  position = maxTimes[i];
442  start = startTimes[i];
443  end = endTimes[i];
444  hrms = hitrms[i];
445  amplitudeErr = -1;
446  positionErr = 1.0;
447  goodnessOfFit = -1;
448  chargeErr = -1;
449  totSig = charge[i];
450 
451 
452  std::vector<geo::WireID> wids = geom->ChannelToWire(channel);
453  geo::WireID wid = wids[0];
454 
455  if (start>=end)
456  {
457  mf::LogWarning("RawHitFinder_module") << "Hit start " << start << " is >= hit end " << end;
458  continue;
459  }
460 
462  *digitVec, //RAW DIGIT REFERENCE.
463  wid, //WIRE ID.
464  start, //START TICK.
465  end, //END TICK.
466  hrms, //RMS.
467  position, //PEAK_TIME.
468  positionErr, //SIGMA_PEAK_TIME.
469  amplitude, //PEAK_AMPLITUDE.
470  amplitudeErr, //SIGMA_PEAK_AMPLITUDE.
471  totSig, //HIT_INTEGRAL.
472  chargeErr, //HIT_SIGMA_INTEGRAL.
473  std::accumulate(holder.begin() + (int) start, holder.begin() + (int) end, 0.), //SUMMED CHARGE.
474  1, //MULTIPLICITY.
475  -1, //LOCAL_INDEX.
476  goodnessOfFit, //WIRE ID.
477  int(end-start+1) //DEGREES OF FREEDOM.
478  );
479  hcol.emplace_back(hit.move(), digitVec);
480 
481  ++hitIndex;
482  }
483  }
484 
485  hcol.put_into(evt);
486  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
Class managing the creation of a new recob::Hit object.
Definition: HitCreator.h:84
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.
float bin[41]
Definition: plottest35.C:14
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
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
art::InputTag fDigitModuleLabel
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
Definition: raw.cxx:756
Signal from collection planes.
Definition: geo_types.h:93
void hit::RawHitFinder::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 122 of file RawHitFinder_module.cc.

References fAreaMethod, fAreaNorms, fCalDataModuleLabel, fColMinWidth, fColMinWindow, fColWidth, fDigitModuleLabel, fIncludeMoreTail, fIndCutoff, fIndMinWidth, fIndWidth, fMaxMultiHit, fMinSigCol, fMinSigInd, fSkipInd, fUncompressWithPed, and fhicl::ParameterSet::get().

Referenced by RawHitFinder().

123  {
124  fDigitModuleLabel = p.get< art::InputTag >("DigitModuleLabel", "daq");
125  fCalDataModuleLabel = p.get< std::string >("CalDataModuleLabel");
126  fMinSigInd = p.get< double >("MinSigInd");
127  fMinSigCol = p.get< double >("MinSigCol");
128  fIncludeMoreTail = p.get< double >("IncludeMoreTail", 0.);
129  fIndWidth = p.get< int >("IndWidth",20);
130  fColWidth = p.get< double >("ColWidth");
131  fIndMinWidth = p.get< double >("IndMinWidth");
132  fColMinWidth = p.get< double >("ColMinWidth",0.);
133  fMaxMultiHit = p.get< int >("MaxMultiHit");
134  fAreaMethod = p.get< int >("AreaMethod");
135  fAreaNorms = p.get< std::vector< double > >("AreaNorms");
136  fUncompressWithPed = p.get< bool >("UncompressWithPed", true);
137  fSkipInd = p.get< bool >("SkipInd", false);
138  fColMinWindow = p.get< int >("ColMinWindow",0);
139  fIndCutoff = p.get< int >("IndCutoff",20);
140  mf::LogInfo("RawHitFinder_module") << "fDigitModuleLabel: " << fDigitModuleLabel << std::endl;
141  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector< double > fAreaNorms
std::string fCalDataModuleLabel
art::InputTag fDigitModuleLabel
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::RawHitFinder::fAreaMethod
private

Definition at line 89 of file RawHitFinder_module.cc.

Referenced by reconfigure().

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

Definition at line 90 of file RawHitFinder_module.cc.

Referenced by reconfigure().

std::string hit::RawHitFinder::fCalDataModuleLabel
private

Definition at line 80 of file RawHitFinder_module.cc.

Referenced by reconfigure().

double hit::RawHitFinder::fColMinWidth
private

Definition at line 87 of file RawHitFinder_module.cc.

Referenced by reconfigure().

int hit::RawHitFinder::fColMinWindow
private

Definition at line 95 of file RawHitFinder_module.cc.

Referenced by produce(), and reconfigure().

double hit::RawHitFinder::fColWidth
private

Definition at line 85 of file RawHitFinder_module.cc.

Referenced by reconfigure().

unsigned int hit::RawHitFinder::fDataSize
private

Definition at line 75 of file RawHitFinder_module.cc.

Referenced by produce().

art::InputTag hit::RawHitFinder::fDigitModuleLabel
private

Definition at line 76 of file RawHitFinder_module.cc.

Referenced by produce(), and reconfigure().

std::string hit::RawHitFinder::fHitLabelName
private

Definition at line 81 of file RawHitFinder_module.cc.

double hit::RawHitFinder::fIncludeMoreTail
private

Definition at line 93 of file RawHitFinder_module.cc.

Referenced by produce(), and reconfigure().

int hit::RawHitFinder::fIndCutoff
private

Definition at line 96 of file RawHitFinder_module.cc.

Referenced by produce(), and reconfigure().

double hit::RawHitFinder::fIndMinWidth
private

Definition at line 86 of file RawHitFinder_module.cc.

Referenced by reconfigure().

double hit::RawHitFinder::fIndWidth
private

Definition at line 84 of file RawHitFinder_module.cc.

Referenced by reconfigure().

int hit::RawHitFinder::fMaxMultiHit
private

Definition at line 88 of file RawHitFinder_module.cc.

Referenced by reconfigure().

double hit::RawHitFinder::fMinSigCol
private

Definition at line 83 of file RawHitFinder_module.cc.

Referenced by produce(), and reconfigure().

double hit::RawHitFinder::fMinSigInd
private

Definition at line 82 of file RawHitFinder_module.cc.

Referenced by produce(), and reconfigure().

bool hit::RawHitFinder::fSkipInd
private

Definition at line 92 of file RawHitFinder_module.cc.

Referenced by produce(), and reconfigure().

std::string hit::RawHitFinder::fSpillName
private

Definition at line 77 of file RawHitFinder_module.cc.

bool hit::RawHitFinder::fUncompressWithPed
private

Definition at line 91 of file RawHitFinder_module.cc.

Referenced by produce(), and reconfigure().


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