All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Classes | Functions | Variables
opdet Namespace Reference

Namespaces

 factory
 

Classes

class  SharedWaveformBaseline
 Extracts a common baseline from waveforms. More...
 
class  FullOpHitFinder
 
class  ICARUSOpHitFinder
 Extracts PMT activity as optical hits (recob::OpHit). More...
 
class  wvfAnaicarus
 
class  DefaultOpDetResponse
 
class  FIFOHistogramAna
 
class  FlashHypothesis
 
class  FlashHypothesisCollection
 
class  FlashHypothesisAna
 
class  FlashHypothesisAnaAlg
 
class  FlashHypothesisCalculator
 
class  FlashHypothesisComparison
 
class  FlashHypothesisCreator
 
class  FlashUtilities
 
class  LEDCalibrationAna
 
class  MicrobooneOpDetResponse
 
class  OpDetResponseInterface
 
class  OpDigiAna
 
class  OpDigiProperties
 
class  OpFlashAna
 
class  OpFlashAnaAlg
 
class  OpFlashFinder
 
class  OpFlashMCTruthAna
 
class  OpFlashSimpleAna
 
class  OpHitAna
 
class  OpHitFinder
 
class  OpMCDigi
 
class  OptDetDigitizer
 
class  OpticalRawDigitReformatter
 
class  SimPhotonCounter
 
class  SimPhotonCounterAlg
 
class  opHitFinderSBND
 
class  PDMapAlg
 
class  PDMapAlgSimple
 
class  OpDetAnalyzer
 
class  OpDeconvolutionAlg
 
class  OpDeconvolutionAlgWiener
 
class  SBNDOpDeconvolution
 
class  SBNDFlashFinder
 
class  SBNDOpHitFinder
 
class  DigiArapucaSBNDAlg
 
class  DigiArapucaSBNDAlgMaker
 
class  DigiPMTSBNDAlg
 
class  DigiPMTSBNDAlgMaker
 
class  opDetDigitizerSBND
 
class  opDetDigitizerWorker
 
struct  TriggerPrimitive
 
class  opDetSBNDTriggerAlg
 
class  PMTGainFluctuations
 
class  PMTGainFluctuations1Dynode
 
class  sbndPDMapAlg
 
class  wvfAna
 

Functions

std::ostream & operator<< (std::ostream &out, SharedWaveformBaseline::Params_t const &params)
 
void writeHistogram (std::vector< double > const &binned)
 
void checkOnBeamFlash (std::vector< recob::OpFlash > const &FlashVector)
 
void RunFlashFinder (std::vector< recob::OpHit > const &HitVector, std::vector< recob::OpFlash > &FlashVector, std::vector< std::vector< int >> &AssocList, double const BinWidth, geo::GeometryCore const &geom, float const FlashThreshold, float const WidthTolerance, detinfo::DetectorClocksData const &ClocksData, float const TrigCoinc)
 
unsigned int GetAccumIndex (double const PeakTime, double const MinTime, double const BinWidth, double const BinOffset)
 
void FillAccumulator (unsigned int const &AccumIndex, unsigned int const &HitIndex, double const PE, float const FlashThreshold, std::vector< double > &Binned, std::vector< std::vector< int >> &Contributors, std::vector< int > &FlashesInAccumulator)
 
void FillFlashesBySizeMap (std::vector< int > const &FlashesInAccumulator, std::vector< double > const &BinnedPE, int const &Accumulator, std::map< double, std::map< int, std::vector< int >>, std::greater< double >> &FlashesBySize)
 
void FillHitsThisFlash (std::vector< std::vector< int >> const &Contributors, int const &Bin, std::vector< int > const &HitClaimedByFlash, std::vector< int > &HitsThisFlash)
 
void ClaimHits (std::vector< recob::OpHit > const &HitVector, std::vector< int > const &HitsThisFlash, float const FlashThreshold, std::vector< std::vector< int >> &HitsPerFlash, std::vector< int > &HitClaimedByFlash)
 
void AssignHitsToFlash (std::vector< int > const &FlashesInAccumulator1, std::vector< int > const &FlashesInAccumulator2, std::vector< double > const &Binned1, std::vector< double > const &Binned2, std::vector< std::vector< int >> const &Contributors1, std::vector< std::vector< int >> const &Contributors2, std::vector< recob::OpHit > const &HitVector, std::vector< std::vector< int >> &HitsPerFlash, float const FlashThreshold)
 
void FindSeedHit (std::map< double, std::vector< int >, std::greater< double >> const &HitsBySize, std::vector< bool > &HitsUsed, std::vector< recob::OpHit > const &HitVector, std::vector< int > &HitsThisRefinedFlash, double &PEAccumulated, double &FlashMaxTime, double &FlashMinTime)
 
void AddHitToFlash (int const &HitID, std::vector< bool > &HitsUsed, recob::OpHit const &currentHit, double const WidthTolerance, std::vector< int > &HitsThisRefinedFlash, double &PEAccumulated, double &FlashMaxTime, double &FlashMinTime)
 
void CheckAndStoreFlash (std::vector< std::vector< int >> &RefinedHitsPerFlash, std::vector< int > const &HitsThisRefinedFlash, double const PEAccumulated, float const FlashThreshold, std::vector< bool > &HitsUsed)
 
void RefineHitsInFlash (std::vector< int > const &HitsThisFlash, std::vector< recob::OpHit > const &HitVector, std::vector< std::vector< int >> &RefinedHitsPerFlash, float const WidthTolerance, float const FlashThreshold)
 
void AddHitContribution (recob::OpHit const &currentHit, double &MaxTime, double &MinTime, double &AveTime, double &FastToTotal, double &AveAbsTime, double &TotalPE, std::vector< double > &PEs)
 
void GetHitGeometryInfo (recob::OpHit const &currentHit, geo::GeometryCore const &geom, std::vector< double > &sumw, std::vector< double > &sumw2, double &sumy, double &sumy2, double &sumz, double &sumz2)
 
double CalculateWidth (double const sum, double const sum_squared, double const weights_sum)
 
void ConstructFlash (std::vector< int > const &HitsPerFlashVec, std::vector< recob::OpHit > const &HitVector, std::vector< recob::OpFlash > &FlashVector, geo::GeometryCore const &geom, detinfo::DetectorClocksData const &ClocksData, float const TrigCoinc)
 
double GetLikelihoodLateLight (double const iPE, double const iTime, double const iWidth, double const jPE, double const jTime, double const jWidth)
 
void MarkFlashesForRemoval (std::vector< recob::OpFlash > const &FlashVector, size_t const BeginFlash, std::vector< bool > &MarkedForRemoval)
 
void RemoveFlashesFromVectors (std::vector< bool > const &MarkedForRemoval, std::vector< recob::OpFlash > &FlashVector, size_t const BeginFlash, std::vector< std::vector< int >> &RefinedHitsPerFlash)
 
void RemoveLateLight (std::vector< recob::OpFlash > &FlashVector, std::vector< std::vector< int >> &RefinedHitsPerFlash)
 
template<typename T , typename Compare >
std::vector< int > sort_permutation (std::vector< T > const &vec, int offset, Compare compare)
 
template<typename T >
void apply_permutation (std::vector< T > &vec, std::vector< int > const &p)
 
void RunHitFinder (std::vector< raw::OpDetWaveform > const &opDetWaveformVector, std::vector< recob::OpHit > &hitVector, pmtana::PulseRecoManager const &pulseRecoMgr, pmtana::PMTPulseRecoBase const &threshAlg, geo::GeometryCore const &geometry, float hitThreshold, detinfo::DetectorClocksData const &clocksData, calib::IPhotonCalibrator const &calibrator, bool use_start_time)
 
void ConstructHit (float hitThreshold, int channel, double timeStamp, pmtana::pulse_param const &pulse, std::vector< recob::OpHit > &hitVector, detinfo::DetectorClocksData const &clocksData, calib::IPhotonCalibrator const &calibrator, bool use_start_time)
 
void StartopDetDigitizerWorkers (unsigned n_workers, opDetDigitizerWorker::Semaphore &sem_start)
 
void WaitopDetDigitizerWorkers (unsigned n_workers, opDetDigitizerWorker::Semaphore &sem_finish)
 
void opDetDigitizerWorkerThread (const opDetDigitizerWorker &worker, detinfo::DetectorClocksData const &clockData, opDetDigitizerWorker::Semaphore &sem_start, opDetDigitizerWorker::Semaphore &sem_finish, bool ApplyTriggerLocations, bool *finished)
 
void AddTriggerLocation (std::vector< std::array< raw::TimeStamp_t, 2 >> &triggers, std::array< raw::TimeStamp_t, 2 > range)
 
void AddTriggerPrimitive (std::vector< TriggerPrimitive > &triggers, TriggerPrimitive trigger)
 
void AddTriggerPrimitiveFinish (std::vector< TriggerPrimitive > &triggers, TriggerPrimitive trigger)
 

Variables

createEngine this
 
createEngine fFlatRandom {fEngine}
 

Detailed Description

Title: FlashHypothesis Class Author: Wes Ketchum (wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov)

Description: Class that represents a flash hypothesis (PEs per opdet) and its error

Title: FlashUtilities Class Author: Wes Ketchum (wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov)

Description: Class that contains utility functions for flash and flash hypotheses: — compare a flash hypothesis to a truth or reco vector — get an extent of a flash (central point, width) These classes should operate using simple objects, and will need other classes/functions to fill those vectors properly.

Title: OpFlash Algorithims Authors, editors: Ben Jones, MIT Wes Ketchum wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov Gleb Sinev gleb..nosp@m.sine.nosp@m.v@duk.nosp@m.e.ed.nosp@m.u Alex Himmel ahimm.nosp@m.el@f.nosp@m.nal.g.nosp@m.ov

Description: These are the algorithms used by OpFlashFinder to produce flashes.

Title: OpHit Algorithims Authors, editors: Ben Jones, MIT Wes Ketchum wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov Gleb Sinev gleb..nosp@m.sine.nosp@m.v@duk.nosp@m.e.ed.nosp@m.u Alex Himmel ahimm.nosp@m.el@f.nosp@m.nal.g.nosp@m.ov Kevin Wood kevin.nosp@m..woo.nosp@m.d@sto.nosp@m.nybr.nosp@m.ook.e.nosp@m.du

Description: These are the algorithms used by OpHitFinder to produce optical hits.

Interface class for OpDeconvolution tool

Interface class for PMTGainFluctuations1Dynode tool

Function Documentation

void opdet::AddHitContribution ( recob::OpHit const &  currentHit,
double &  MaxTime,
double &  MinTime,
double &  AveTime,
double &  FastToTotal,
double &  AveAbsTime,
double &  TotalPE,
std::vector< double > &  PEs 
)

Definition at line 456 of file OpFlashAlg.cxx.

464  {
465  double PEThisHit = currentHit.PE();
466  double TimeThisHit = currentHit.PeakTime();
467  if (TimeThisHit > MaxTime) MaxTime = TimeThisHit;
468  if (TimeThisHit < MinTime) MinTime = TimeThisHit;
469 
470  // These quantities for the flash are defined
471  // as the weighted averages over the hits
472  AveTime += PEThisHit * TimeThisHit;
473  FastToTotal += PEThisHit * currentHit.FastToTotal();
474  AveAbsTime += PEThisHit * currentHit.PeakTimeAbs();
475 
476  // These are totals
477  TotalPE += PEThisHit;
478  PEs.at(static_cast<unsigned int>(currentHit.OpChannel())) += PEThisHit;
479  }
void opdet::AddHitToFlash ( int const &  HitID,
std::vector< bool > &  HitsUsed,
recob::OpHit const &  currentHit,
double const  WidthTolerance,
std::vector< int > &  HitsThisRefinedFlash,
double &  PEAccumulated,
double &  FlashMaxTime,
double &  FlashMinTime 
)

Definition at line 331 of file OpFlashAlg.cxx.

339  {
340  if (HitsUsed.at(HitID)) return;
341 
342  double HitTime = currentHit.PeakTime();
343  double HitWidth = 0.5 * currentHit.Width();
344  double FlashTime = 0.5 * (FlashMaxTime + FlashMinTime);
345  double FlashWidth = 0.5 * (FlashMaxTime - FlashMinTime);
346 
347  if (std::abs(HitTime - FlashTime) > WidthTolerance * (HitWidth + FlashWidth)) return;
348 
349  HitsThisRefinedFlash.push_back(HitID);
350  FlashMaxTime = std::max(FlashMaxTime, HitTime + HitWidth);
351  FlashMinTime = std::min(FlashMinTime, HitTime - HitWidth);
352  PEAccumulated += currentHit.PE();
353  HitsUsed[HitID] = true;
354 
355  } // End AddHitToFlash
T abs(T value)
constexpr double WidthTolerance
void opdet::AddTriggerLocation ( std::vector< std::array< raw::TimeStamp_t, 2 >> &  triggers,
std::array< raw::TimeStamp_t, 2 >  range 
)

Definition at line 30 of file opDetSBNDTriggerAlg.cc.

30  {
31  typedef std::vector<std::array<raw::TimeStamp_t,2>> TimeStamps;
32 
33  TimeStamps::iterator insert = std::lower_bound(triggers.begin(), triggers.end(), range,
34  [](const auto &lhs, const auto &rhs) { return lhs[0] < rhs[0]; });
35  triggers.insert(insert, range);
36 }
void opdet::AddTriggerPrimitive ( std::vector< TriggerPrimitive > &  triggers,
TriggerPrimitive  trigger 
)

Definition at line 38 of file opDetSBNDTriggerAlg.cc.

38  {
39  typedef std::vector<TriggerPrimitive> TimeStamps;
40 
41  TimeStamps::iterator insert = std::lower_bound(triggers.begin(), triggers.end(), trigger,
42  [](auto const &lhs, auto const &rhs) { return lhs.start < rhs.start; });
43 
44  triggers.insert(insert, trigger);
45 }
void opdet::AddTriggerPrimitiveFinish ( std::vector< TriggerPrimitive > &  triggers,
TriggerPrimitive  trigger 
)

Definition at line 47 of file opDetSBNDTriggerAlg.cc.

47  {
48  typedef std::vector<TriggerPrimitive> TimeStamps;
49 
50  TimeStamps::iterator insert = std::upper_bound(triggers.begin(), triggers.end(), trigger,
51  [](auto const &lhs, auto const &rhs) { return lhs.finish < rhs.finish; });
52 
53  triggers.insert(insert, trigger);
54 }
template<typename T >
void opdet::apply_permutation ( std::vector< T > &  vec,
std::vector< int > const &  p 
)

Definition at line 704 of file OpFlashAlg.cxx.

705  {
706 
707  std::vector<T> sorted_vec(p.size());
708  std::transform(p.begin(), p.end(), sorted_vec.begin(), [&](int i) { return vec[i]; });
709  vec = sorted_vec;
710  }
static constexpr Sample_t transform(Sample_t sample)
void opdet::AssignHitsToFlash ( std::vector< int > const &  FlashesInAccumulator1,
std::vector< int > const &  FlashesInAccumulator2,
std::vector< double > const &  Binned1,
std::vector< double > const &  Binned2,
std::vector< std::vector< int >> const &  Contributors1,
std::vector< std::vector< int >> const &  Contributors2,
std::vector< recob::OpHit > const &  HitVector,
std::vector< std::vector< int >> &  HitsPerFlash,
float const  FlashThreshold 
)

Definition at line 250 of file OpFlashAlg.cxx.

259  {
260  // Sort all the flashes found by size. The structure is:
261  // FlashesBySize[flash size][accumulator_num] = [flash_index1, flash_index2...]
262  std::map<double, std::map<int, std::vector<int>>, std::greater<double>> FlashesBySize;
263 
264  // Sort the flashes by size using map
265  FillFlashesBySizeMap(FlashesInAccumulator1, Binned1, 1, FlashesBySize);
266  FillFlashesBySizeMap(FlashesInAccumulator2, Binned2, 2, FlashesBySize);
267 
268  // This keeps track of which hits are claimed by which flash
269  std::vector<int> HitClaimedByFlash(HitVector.size(), -1);
270 
271  // Walk from largest to smallest, claiming hits.
272  // The biggest flash always gets dibbs,
273  // but we keep track of overlaps for re-merging later (do we? ---WK)
274  for (auto const& itFlash : FlashesBySize)
275  // If several with same size, walk through accumulators
276  for (auto const& itAcc : itFlash.second) {
277 
278  int Accumulator = itAcc.first;
279 
280  // Walk through flash-tagged bins in this accumulator
281  for (auto const& Bin : itAcc.second) {
282 
283  std::vector<int> HitsThisFlash;
284 
285  if (Accumulator == 1)
286  FillHitsThisFlash(Contributors1, Bin, HitClaimedByFlash, HitsThisFlash);
287  else if (Accumulator == 2)
288  FillHitsThisFlash(Contributors2, Bin, HitClaimedByFlash, HitsThisFlash);
289 
290  ClaimHits(HitVector, HitsThisFlash, FlashThreshold, HitsPerFlash, HitClaimedByFlash);
291 
292  } // End loop over this accumulator
293 
294  } // End loops over accumulators
295  // End of loops over sorted flashes
296 
297  } // End AssignHitsToFlash
void FillHitsThisFlash(std::vector< std::vector< int >> const &Contributors, int const &Bin, std::vector< int > const &HitClaimedByFlash, std::vector< int > &HitsThisFlash)
Definition: OpFlashAlg.cxx:214
void ClaimHits(std::vector< recob::OpHit > const &HitVector, std::vector< int > const &HitsThisFlash, float const FlashThreshold, std::vector< std::vector< int >> &HitsPerFlash, std::vector< int > &HitClaimedByFlash)
Definition: OpFlashAlg.cxx:227
constexpr float FlashThreshold
void FillFlashesBySizeMap(std::vector< int > const &FlashesInAccumulator, std::vector< double > const &BinnedPE, int const &Accumulator, std::map< double, std::map< int, std::vector< int >>, std::greater< double >> &FlashesBySize)
Definition: OpFlashAlg.cxx:202
double opdet::CalculateWidth ( double const  sum,
double const  sum_squared,
double const  weights_sum 
)

Definition at line 515 of file OpFlashAlg.cxx.

516  {
517  if (sum_squared * weights_sum - sum * sum < 0)
518  return 0;
519  else
520  return std::sqrt(sum_squared * weights_sum - sum * sum) / weights_sum;
521  }
void opdet::CheckAndStoreFlash ( std::vector< std::vector< int >> &  RefinedHitsPerFlash,
std::vector< int > const &  HitsThisRefinedFlash,
double const  PEAccumulated,
float const  FlashThreshold,
std::vector< bool > &  HitsUsed 
)

Definition at line 359 of file OpFlashAlg.cxx.

364  {
365  // If above threshold, we just add hits to the flash vector, and move on
366  if (PEAccumulated >= FlashThreshold) {
367  RefinedHitsPerFlash.push_back(HitsThisRefinedFlash);
368  return;
369  }
370 
371  // If there is only one hit in collection, we can immediately move on
372  if (HitsThisRefinedFlash.size() == 1) return;
373 
374  // We need to release all other hits (allow possible reuse)
375  for (std::vector<int>::const_iterator hitIterator = std::next(HitsThisRefinedFlash.begin());
376  hitIterator != HitsThisRefinedFlash.end();
377  ++hitIterator)
378  HitsUsed.at(*hitIterator) = false;
379 
380  } // End CheckAndStoreFlash
constexpr float FlashThreshold
void opdet::checkOnBeamFlash ( std::vector< recob::OpFlash > const &  FlashVector)

Definition at line 54 of file OpFlashAlg.cxx.

55  {
56  for (auto const& flash : FlashVector)
57  if (flash.OnBeamTime() == 1)
58  std::cout << "OnBeamFlash with time " << flash.Time() << std::endl;
59  }
BEGIN_PROLOG could also be cout
void opdet::ClaimHits ( std::vector< recob::OpHit > const &  HitVector,
std::vector< int > const &  HitsThisFlash,
float const  FlashThreshold,
std::vector< std::vector< int >> &  HitsPerFlash,
std::vector< int > &  HitClaimedByFlash 
)

Definition at line 227 of file OpFlashAlg.cxx.

232  {
233  // Check for newly claimed hits
234  double PE = 0;
235  for (auto const& Hit : HitsThisFlash)
236  PE += HitVector.at(Hit).PE();
237 
238  if (PE < FlashThreshold) return;
239 
240  // Add the flash to the list
241  HitsPerFlash.push_back(HitsThisFlash);
242 
243  // And claim all the hits
244  for (auto const& Hit : HitsThisFlash)
245  if (HitClaimedByFlash.at(Hit) == -1) HitClaimedByFlash.at(Hit) = HitsPerFlash.size() - 1;
246  }
constexpr float FlashThreshold
void opdet::ConstructFlash ( std::vector< int > const &  HitsPerFlashVec,
std::vector< recob::OpHit > const &  HitVector,
std::vector< recob::OpFlash > &  FlashVector,
geo::GeometryCore const &  geom,
detinfo::DetectorClocksData const &  ClocksData,
float const  TrigCoinc 
)

Definition at line 525 of file OpFlashAlg.cxx.

531  {
532  double MaxTime = -std::numeric_limits<double>::max();
533  double MinTime = std::numeric_limits<double>::max();
534 
535  std::vector<double> PEs(geom.MaxOpChannel() + 1, 0.0);
536  unsigned int Nplanes = geom.Nplanes();
537  std::vector<double> sumw(Nplanes, 0.0);
538  std::vector<double> sumw2(Nplanes, 0.0);
539 
540  double TotalPE = 0;
541  double AveTime = 0;
542  double AveAbsTime = 0;
543  double FastToTotal = 0;
544  double sumy = 0;
545  double sumz = 0;
546  double sumy2 = 0;
547  double sumz2 = 0;
548 
549  for (auto const& HitID : HitsPerFlashVec) {
551  HitVector.at(HitID), MaxTime, MinTime, AveTime, FastToTotal, AveAbsTime, TotalPE, PEs);
552  GetHitGeometryInfo(HitVector.at(HitID), geom, sumw, sumw2, sumy, sumy2, sumz, sumz2);
553  }
554 
555  AveTime /= TotalPE;
556  AveAbsTime /= TotalPE;
557  FastToTotal /= TotalPE;
558 
559  double meany = sumy / TotalPE;
560  double meanz = sumz / TotalPE;
561 
562  double widthy = CalculateWidth(sumy, sumy2, TotalPE);
563  double widthz = CalculateWidth(sumz, sumz2, TotalPE);
564 
565  std::vector<double> WireCenters(Nplanes, 0.0);
566  std::vector<double> WireWidths(Nplanes, 0.0);
567 
568  for (size_t p = 0; p != Nplanes; ++p) {
569  WireCenters.at(p) = sumw.at(p) / TotalPE;
570  WireWidths.at(p) = CalculateWidth(sumw.at(p), sumw2.at(p), TotalPE);
571  }
572 
573  // Emprical corrections to get the Frame right.
574  // Eventual solution - remove frames
575  int Frame = ClocksData.OpticalClock().Frame(AveAbsTime - 18.1);
576  if (Frame == 0) Frame = 1;
577 
578  int BeamFrame = ClocksData.OpticalClock().Frame(ClocksData.TriggerTime());
579  bool InBeamFrame = false;
580  if (!(ClocksData.TriggerTime() < 0)) InBeamFrame = (Frame == BeamFrame);
581 
582  double TimeWidth = (MaxTime - MinTime) / 2.0;
583 
584  int OnBeamTime = 0;
585  if (InBeamFrame && (std::abs(AveTime) < TrigCoinc)) OnBeamTime = 1;
586 
587  FlashVector.emplace_back(AveTime,
588  TimeWidth,
589  AveAbsTime,
590  Frame,
591  PEs,
592  InBeamFrame,
593  OnBeamTime,
594  FastToTotal,
595  meany,
596  widthy,
597  meanz,
598  widthz,
599  WireCenters,
600  WireWidths);
601  }
pdgs p
Definition: selectors.fcl:22
void AddHitContribution(recob::OpHit const &currentHit, double &MaxTime, double &MinTime, double &AveTime, double &FastToTotal, double &AveAbsTime, double &TotalPE, std::vector< double > &PEs)
Definition: OpFlashAlg.cxx:456
T abs(T value)
double CalculateWidth(double const sum, double const sum_squared, double const weights_sum)
Definition: OpFlashAlg.cxx:515
void GetHitGeometryInfo(recob::OpHit const &currentHit, geo::GeometryCore const &geom, std::vector< double > &sumw, std::vector< double > &sumw2, double &sumy, double &sumy2, double &sumz, double &sumz2)
Definition: OpFlashAlg.cxx:483
void opdet::ConstructHit ( float  hitThreshold,
int  channel,
double  timeStamp,
pmtana::pulse_param const &  pulse,
std::vector< recob::OpHit > &  hitVector,
detinfo::DetectorClocksData const &  clocksData,
calib::IPhotonCalibrator const &  calibrator,
bool  use_start_time 
)

Definition at line 65 of file OpHitAlg.cxx.

73  {
74 
75  if (pulse.peak < hitThreshold) return;
76 
77  double absTime = timeStamp + clocksData.OpticalClock().TickPeriod() * (use_start_time ? pulse.t_start : pulse.t_max);
78 
79  double relTime = absTime - clocksData.TriggerTime();
80 
81  double startTime = timeStamp + clocksData.OpticalClock().TickPeriod() * pulse.t_start - clocksData.TriggerTime();
82 
83  double riseTime = clocksData.OpticalClock().TickPeriod() * pulse.t_rise;
84 
85  int frame = clocksData.OpticalClock().Frame(timeStamp);
86 
87  double PE = 0.0;
88  if (calibrator.UseArea())
89  PE = calibrator.PE(pulse.area, channel);
90  else
91  PE = calibrator.PE(pulse.peak, channel);
92 
93  double width = (pulse.t_end - pulse.t_start) * clocksData.OpticalClock().TickPeriod();
94 
95  hitVector.emplace_back(channel, relTime, absTime, startTime, riseTime, frame, width, pulse.area, pulse.peak, PE, 0.0);
96 
97  }
void opdet::FillAccumulator ( unsigned int const &  AccumIndex,
unsigned int const &  HitIndex,
double const  PE,
float const  FlashThreshold,
std::vector< double > &  Binned,
std::vector< std::vector< int >> &  Contributors,
std::vector< int > &  FlashesInAccumulator 
)

Definition at line 182 of file OpFlashAlg.cxx.

189  {
190 
191  Contributors.at(AccumIndex).push_back(HitIndex);
192 
193  Binned.at(AccumIndex) += PE;
194 
195  // If this wasn't a flash already, add it to the list
196  if (Binned.at(AccumIndex) >= FlashThreshold && (Binned.at(AccumIndex) - PE) < FlashThreshold)
197  FlashesInAccumulator.push_back(AccumIndex);
198  }
constexpr float FlashThreshold
void opdet::FillFlashesBySizeMap ( std::vector< int > const &  FlashesInAccumulator,
std::vector< double > const &  BinnedPE,
int const &  Accumulator,
std::map< double, std::map< int, std::vector< int >>, std::greater< double >> &  FlashesBySize 
)

Definition at line 202 of file OpFlashAlg.cxx.

207  {
208  for (auto const& flash : FlashesInAccumulator)
209  FlashesBySize[BinnedPE.at(flash)][Accumulator].push_back(flash);
210  }
void opdet::FillHitsThisFlash ( std::vector< std::vector< int >> const &  Contributors,
int const &  Bin,
std::vector< int > const &  HitClaimedByFlash,
std::vector< int > &  HitsThisFlash 
)

Definition at line 214 of file OpFlashAlg.cxx.

218  {
219  // For each hit in the flash
220  for (auto const& HitIndex : Contributors.at(Bin))
221  // If unclaimed, claim it
222  if (HitClaimedByFlash.at(HitIndex) == -1) HitsThisFlash.push_back(HitIndex);
223  }
void opdet::FindSeedHit ( std::map< double, std::vector< int >, std::greater< double >> const &  HitsBySize,
std::vector< bool > &  HitsUsed,
std::vector< recob::OpHit > const &  HitVector,
std::vector< int > &  HitsThisRefinedFlash,
double &  PEAccumulated,
double &  FlashMaxTime,
double &  FlashMinTime 
)

Definition at line 301 of file OpFlashAlg.cxx.

308  {
309  for (auto const& itHit : HitsBySize)
310  for (auto const& HitID : itHit.second) {
311 
312  if (HitsUsed.at(HitID)) continue;
313 
314  PEAccumulated = HitVector.at(HitID).PE();
315  FlashMaxTime = HitVector.at(HitID).PeakTime() + 0.5 * HitVector.at(HitID).Width();
316  FlashMinTime = HitVector.at(HitID).PeakTime() - 0.5 * HitVector.at(HitID).Width();
317 
318  HitsThisRefinedFlash.clear();
319  HitsThisRefinedFlash.push_back(HitID);
320 
321  HitsUsed.at(HitID) = true;
322  return;
323 
324  } // End loop over inner vector
325  // End loop over HitsBySize map
326 
327  } // End FindSeedHit
unsigned int opdet::GetAccumIndex ( double const  PeakTime,
double const  MinTime,
double const  BinWidth,
double const  BinOffset 
)

Definition at line 172 of file OpFlashAlg.cxx.

176  {
177  return static_cast<unsigned int>((PeakTime - MinTime + BinOffset) / BinWidth);
178  }
void opdet::GetHitGeometryInfo ( recob::OpHit const &  currentHit,
geo::GeometryCore const &  geom,
std::vector< double > &  sumw,
std::vector< double > &  sumw2,
double &  sumy,
double &  sumy2,
double &  sumz,
double &  sumz2 
)

Definition at line 483 of file OpFlashAlg.cxx.

491  {
492  double xyz[3];
493  geom.OpDetGeoFromOpChannel(currentHit.OpChannel()).GetCenter(xyz);
494  double PEThisHit = currentHit.PE();
495 
496  geo::TPCID tpc = geom.FindTPCAtPosition(xyz);
497  // if the point does not fall into any TPC,
498  // it does not contribute to the average wire position
499  if (tpc.isValid) {
500  for (size_t p = 0; p != geom.Nplanes(); ++p) {
501  geo::PlaneID const planeID(tpc, p);
502  unsigned int w = geom.NearestWire(xyz, planeID);
503  sumw.at(p) += PEThisHit * w;
504  sumw2.at(p) += PEThisHit * w * w;
505  }
506  } // if we found the TPC
507  sumy += PEThisHit * xyz[1];
508  sumy2 += PEThisHit * xyz[1] * xyz[1];
509  sumz += PEThisHit * xyz[2];
510  sumz2 += PEThisHit * xyz[2] * xyz[2];
511  }
pdgs p
Definition: selectors.fcl:22
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:211
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
double opdet::GetLikelihoodLateLight ( double const  iPE,
double const  iTime,
double const  iWidth,
double const  jPE,
double const  jTime,
double const  jWidth 
)

Definition at line 605 of file OpFlashAlg.cxx.

611  {
612  if (iTime > jTime) return 1e6;
613 
614  // Calculate hypothetical PE if this were actually a late flash from i.
615  // Argon time const is 1600 ns, so 1.6.
616  double HypPE = iPE * jWidth / iWidth * std::exp(-(jTime - iTime) / 1.6);
617  double nsigma = (jPE - HypPE) / std::sqrt(HypPE);
618  return nsigma;
619  }
void opdet::MarkFlashesForRemoval ( std::vector< recob::OpFlash > const &  FlashVector,
size_t const  BeginFlash,
std::vector< bool > &  MarkedForRemoval 
)

Definition at line 623 of file OpFlashAlg.cxx.

626  {
627  for (size_t iFlash = BeginFlash; iFlash != FlashVector.size(); ++iFlash) {
628 
629  double iTime = FlashVector.at(iFlash).Time();
630  double iPE = FlashVector.at(iFlash).TotalPE();
631  double iWidth = FlashVector.at(iFlash).TimeWidth();
632 
633  for (size_t jFlash = iFlash + 1; jFlash != FlashVector.size(); ++jFlash) {
634 
635  if (MarkedForRemoval.at(jFlash - BeginFlash)) continue;
636 
637  double jTime = FlashVector.at(jFlash).Time();
638  double jPE = FlashVector.at(jFlash).TotalPE();
639  double jWidth = FlashVector.at(jFlash).TimeWidth();
640 
641  // If smaller than, or within 2sigma of expectation,
642  // attribute to late light and toss out
643  if (GetLikelihoodLateLight(iPE, iTime, iWidth, jPE, jTime, jWidth) < 3.0)
644  MarkedForRemoval.at(jFlash - BeginFlash) = true;
645  }
646  }
647  }
double GetLikelihoodLateLight(double const iPE, double const iTime, double const iWidth, double const jPE, double const jTime, double const jWidth)
Definition: OpFlashAlg.cxx:605
void opdet::opDetDigitizerWorkerThread ( const opDetDigitizerWorker &  worker,
detinfo::DetectorClocksData const &  clockData,
opDetDigitizerWorker::Semaphore &  sem_start,
opDetDigitizerWorker::Semaphore &  sem_finish,
bool  ApplyTriggerLocations,
bool *  finished 
)

Definition at line 21 of file opDetDigitizerWorker.cc.

27 {
28 
29  bool do_apply_trigger_locations = false;
30  while (1) {
31  sem_start.decrement();
32 
33  if (*finished) break;
34 
35  if (do_apply_trigger_locations) {
36  worker.ApplyTriggerLocations(clockData);
37  do_apply_trigger_locations = false;
38  }
39  else {
40  worker.Start(clockData);
41  do_apply_trigger_locations = ApplyTriggerLocations;
42  }
43 
44  sem_finish.increment();
45  }
46 
47 }
std::ostream& opdet::operator<< ( std::ostream &  out,
SharedWaveformBaseline::Params_t const &  params 
)
inline

Definition at line 123 of file SharedWaveformBaseline.h.

124  { params.dump(out); return out; }
void opdet::RefineHitsInFlash ( std::vector< int > const &  HitsThisFlash,
std::vector< recob::OpHit > const &  HitVector,
std::vector< std::vector< int >> &  RefinedHitsPerFlash,
float const  WidthTolerance,
float const  FlashThreshold 
)

Definition at line 384 of file OpFlashAlg.cxx.

389  {
390  // Sort the hits by their size using map
391  // HitsBySize[HitSize] = [hit1, hit2 ...]
392  std::map<double, std::vector<int>, std::greater<double>> HitsBySize;
393  for (auto const& HitID : HitsThisFlash)
394  HitsBySize[HitVector.at(HitID).PE()].push_back(HitID);
395 
396  // Heres what we do:
397  // 1.Start with the biggest remaining hit
398  // 2.Look for any within one width of this hit
399  // 3.Find the new upper and lower bounds of the flash
400  // 4.Collect again
401  // 5.Repeat until no new hits collected
402  // 6.Remove these hits from consideration and repeat
403 
404  std::vector<bool> HitsUsed(HitVector.size(), false);
405  double PEAccumulated, FlashMaxTime, FlashMinTime;
406  std::vector<int> HitsThisRefinedFlash;
407 
408  while (true) {
409 
410  HitsThisRefinedFlash.clear();
411  PEAccumulated = 0;
412  FlashMaxTime = 0;
413  FlashMinTime = 0;
414 
415  FindSeedHit(HitsBySize,
416  HitsUsed,
417  HitVector,
418  HitsThisRefinedFlash,
419  PEAccumulated,
420  FlashMaxTime,
421  FlashMinTime);
422 
423  if (HitsThisRefinedFlash.size() == 0) return;
424 
425  // Start this at zero to do the while at least once
426  size_t NHitsThisRefinedFlash = 0;
427 
428  // If size of HitsThisRefinedFlash is same size,
429  // that means we're not adding anymore
430  while (NHitsThisRefinedFlash < HitsThisRefinedFlash.size()) {
431  NHitsThisRefinedFlash = HitsThisRefinedFlash.size();
432 
433  for (auto const& itHit : HitsBySize)
434  for (auto const& HitID : itHit.second)
435  AddHitToFlash(HitID,
436  HitsUsed,
437  HitVector.at(HitID),
439  HitsThisRefinedFlash,
440  PEAccumulated,
441  FlashMaxTime,
442  FlashMinTime);
443  }
444 
445  // We did our collecting, now check if the flash is
446  // still good and push back
448  RefinedHitsPerFlash, HitsThisRefinedFlash, PEAccumulated, FlashThreshold, HitsUsed);
449 
450  } // End while there are hits left
451 
452  } // End RefineHitsInFlash
void CheckAndStoreFlash(std::vector< std::vector< int >> &RefinedHitsPerFlash, std::vector< int > const &HitsThisRefinedFlash, double const PEAccumulated, float const FlashThreshold, std::vector< bool > &HitsUsed)
Definition: OpFlashAlg.cxx:359
void FindSeedHit(std::map< double, std::vector< int >, std::greater< double >> const &HitsBySize, std::vector< bool > &HitsUsed, std::vector< recob::OpHit > const &HitVector, std::vector< int > &HitsThisRefinedFlash, double &PEAccumulated, double &FlashMaxTime, double &FlashMinTime)
Definition: OpFlashAlg.cxx:301
constexpr float FlashThreshold
void AddHitToFlash(int const &HitID, std::vector< bool > &HitsUsed, recob::OpHit const &currentHit, double const WidthTolerance, std::vector< int > &HitsThisRefinedFlash, double &PEAccumulated, double &FlashMaxTime, double &FlashMinTime)
Definition: OpFlashAlg.cxx:331
constexpr double WidthTolerance
void opdet::RemoveFlashesFromVectors ( std::vector< bool > const &  MarkedForRemoval,
std::vector< recob::OpFlash > &  FlashVector,
size_t const  BeginFlash,
std::vector< std::vector< int >> &  RefinedHitsPerFlash 
)

Definition at line 651 of file OpFlashAlg.cxx.

655  {
656  for (int iFlash = MarkedForRemoval.size() - 1; iFlash != -1; --iFlash)
657  if (MarkedForRemoval.at(iFlash)) {
658  RefinedHitsPerFlash.erase(RefinedHitsPerFlash.begin() + iFlash);
659  FlashVector.erase(FlashVector.begin() + BeginFlash + iFlash);
660  }
661  }
void opdet::RemoveLateLight ( std::vector< recob::OpFlash > &  FlashVector,
std::vector< std::vector< int >> &  RefinedHitsPerFlash 
)

Definition at line 665 of file OpFlashAlg.cxx.

667  {
668  std::vector<bool> MarkedForRemoval(RefinedHitsPerFlash.size(), false);
669 
670  size_t const BeginFlash = FlashVector.size() - RefinedHitsPerFlash.size();
671 
672  recob::OpFlashSortByTime sort_flash_by_time;
673 
674  // Determine the sort of FlashVector starting at BeginFlash
675  auto sort_order = sort_permutation(FlashVector, BeginFlash, sort_flash_by_time);
676 
677  // Sort the RefinedHitsPerFlash in the same way as tail end of FlashVector
678  apply_permutation(RefinedHitsPerFlash, sort_order);
679 
680  std::sort(FlashVector.begin() + BeginFlash, FlashVector.end(), sort_flash_by_time);
681 
682  MarkFlashesForRemoval(FlashVector, BeginFlash, MarkedForRemoval);
683 
684  RemoveFlashesFromVectors(MarkedForRemoval, FlashVector, BeginFlash, RefinedHitsPerFlash);
685 
686  } // End RemoveLateLight
void apply_permutation(std::vector< T > &vec, std::vector< int > const &p)
Definition: OpFlashAlg.cxx:704
void MarkFlashesForRemoval(std::vector< recob::OpFlash > const &FlashVector, size_t const BeginFlash, std::vector< bool > &MarkedForRemoval)
Definition: OpFlashAlg.cxx:623
std::vector< int > sort_permutation(std::vector< T > const &vec, int offset, Compare compare)
Definition: OpFlashAlg.cxx:691
void RemoveFlashesFromVectors(std::vector< bool > const &MarkedForRemoval, std::vector< recob::OpFlash > &FlashVector, size_t const BeginFlash, std::vector< std::vector< int >> &RefinedHitsPerFlash)
Definition: OpFlashAlg.cxx:651
void opdet::RunFlashFinder ( std::vector< recob::OpHit > const &  HitVector,
std::vector< recob::OpFlash > &  FlashVector,
std::vector< std::vector< int >> &  AssocList,
double const  BinWidth,
geo::GeometryCore const &  geom,
float const  FlashThreshold,
float const  WidthTolerance,
detinfo::DetectorClocksData const &  ClocksData,
float const  TrigCoinc 
)

Definition at line 63 of file OpFlashAlg.cxx.

72  {
73  // Initial size for accumulators - will be automatically extended if needed
74  int initialsize = 6400;
75 
76  // These are the accumulators which will hold broad-binned light yields
77  std::vector<double> Binned1(initialsize);
78  std::vector<double> Binned2(initialsize);
79 
80  // These will keep track of which pulses put activity in each bin
81  std::vector<std::vector<int>> Contributors1(initialsize);
82  std::vector<std::vector<int>> Contributors2(initialsize);
83 
84  // These will keep track of where we have met the flash condition
85  // (in order to prevent second pointless loop)
86  std::vector<int> FlashesInAccumulator1;
87  std::vector<int> FlashesInAccumulator2;
88 
89  double minTime = std::numeric_limits<float>::max();
90  for (auto const& hit : HitVector)
91  if (hit.PeakTime() < minTime) minTime = hit.PeakTime();
92 
93  for (auto const& hit : HitVector) {
94 
95  double peakTime = hit.PeakTime();
96 
97  unsigned int AccumIndex1 = GetAccumIndex(peakTime, minTime, BinWidth, 0.0);
98 
99  unsigned int AccumIndex2 = GetAccumIndex(peakTime, minTime, BinWidth, BinWidth / 2.0);
100 
101  // Extend accumulators if needed (2 always larger than 1)
102  if (AccumIndex2 >= Binned1.size()) {
103  std::cout << "Extending vectors to " << AccumIndex2 * 1.2 << std::endl;
104  Binned1.resize(AccumIndex2 * 1.2);
105  Binned2.resize(AccumIndex2 * 1.2);
106  Contributors1.resize(AccumIndex2 * 1.2);
107  Contributors2.resize(AccumIndex2 * 1.2);
108  }
109 
110  size_t const hitIndex = &hit - &HitVector[0];
111 
112  FillAccumulator(AccumIndex1,
113  hitIndex,
114  hit.PE(),
116  Binned1,
117  Contributors1,
118  FlashesInAccumulator1);
119 
120  FillAccumulator(AccumIndex2,
121  hitIndex,
122  hit.PE(),
124  Binned2,
125  Contributors2,
126  FlashesInAccumulator2);
127 
128  } // End loop over hits
129 
130  // Now start to create flashes.
131  // First, need vector to keep track of which hits belong to which flashes
132  std::vector<std::vector<int>> HitsPerFlash;
133 
134  //if (Frame == 1) writeHistogram(Binned1);
135 
136  AssignHitsToFlash(FlashesInAccumulator1,
137  FlashesInAccumulator2,
138  Binned1,
139  Binned2,
140  Contributors1,
141  Contributors2,
142  HitVector,
143  HitsPerFlash,
145 
146  // Now we do the fine grained part.
147  // Subdivide each flash into sub-flashes with overlaps within hit widths
148  // (assumed wider than photon travel time)
149  std::vector<std::vector<int>> RefinedHitsPerFlash;
150  for (auto const& HitsThisFlash : HitsPerFlash)
152  HitsThisFlash, HitVector, RefinedHitsPerFlash, WidthTolerance, FlashThreshold);
153 
154  // Now we have all our hits assigned to a flash.
155  // Make the recob::OpFlash objects
156  for (auto const& HitsPerFlashVec : RefinedHitsPerFlash)
157  ConstructFlash(HitsPerFlashVec, HitVector, FlashVector, geom, ClocksData, TrigCoinc);
158 
159  RemoveLateLight(FlashVector, RefinedHitsPerFlash);
160 
161  //checkOnBeamFlash(FlashVector);
162 
163  // Finally, write the association list.
164  // back_inserter tacks the result onto the end of AssocList
165  for (auto& HitIndicesThisFlash : RefinedHitsPerFlash)
166  AssocList.push_back(HitIndicesThisFlash);
167 
168  } // End RunFlashFinder
void ConstructFlash(std::vector< int > const &HitsPerFlashVec, std::vector< recob::OpHit > const &HitVector, std::vector< recob::OpFlash > &FlashVector, geo::GeometryCore const &geom, detinfo::DetectorClocksData const &ClocksData, float const TrigCoinc)
Definition: OpFlashAlg.cxx:525
process_name hit
Definition: cheaterreco.fcl:51
void AssignHitsToFlash(std::vector< int > const &FlashesInAccumulator1, std::vector< int > const &FlashesInAccumulator2, std::vector< double > const &Binned1, std::vector< double > const &Binned2, std::vector< std::vector< int >> const &Contributors1, std::vector< std::vector< int >> const &Contributors2, std::vector< recob::OpHit > const &HitVector, std::vector< std::vector< int >> &HitsPerFlash, float const FlashThreshold)
Definition: OpFlashAlg.cxx:250
constexpr float FlashThreshold
void RemoveLateLight(std::vector< recob::OpFlash > &FlashVector, std::vector< std::vector< int >> &RefinedHitsPerFlash)
Definition: OpFlashAlg.cxx:665
void RefineHitsInFlash(std::vector< int > const &HitsThisFlash, std::vector< recob::OpHit > const &HitVector, std::vector< std::vector< int >> &RefinedHitsPerFlash, float const WidthTolerance, float const FlashThreshold)
Definition: OpFlashAlg.cxx:384
unsigned int GetAccumIndex(double const PeakTime, double const MinTime, double const BinWidth, double const BinOffset)
Definition: OpFlashAlg.cxx:172
constexpr double WidthTolerance
void FillAccumulator(unsigned int const &AccumIndex, unsigned int const &HitIndex, double const PE, float const FlashThreshold, std::vector< double > &Binned, std::vector< std::vector< int >> &Contributors, std::vector< int > &FlashesInAccumulator)
Definition: OpFlashAlg.cxx:182
BEGIN_PROLOG could also be cout
void opdet::RunHitFinder ( std::vector< raw::OpDetWaveform > const &  opDetWaveformVector,
std::vector< recob::OpHit > &  hitVector,
pmtana::PulseRecoManager const &  pulseRecoMgr,
pmtana::PMTPulseRecoBase const &  threshAlg,
geo::GeometryCore const &  geometry,
float  hitThreshold,
detinfo::DetectorClocksData const &  clocksData,
calib::IPhotonCalibrator const &  calibrator,
bool  use_start_time 
)

Definition at line 30 of file OpHitAlg.cxx.

39  {
40 
41  for (auto const& waveform : opDetWaveformVector) {
42 
43  const int channel = static_cast<int>(waveform.ChannelNumber());
44 
45  if (!geometry.IsValidOpChannel(channel)) {
46  mf::LogError("OpHitFinder")
47  << "Error! unrecognized channel number " << channel << ". Ignoring pulse";
48  continue;
49  }
50 
51  pulseRecoMgr.Reconstruct(waveform);
52 
53  // Get the result
54  auto const& pulses = threshAlg.GetPulses();
55 
56  const double timeStamp = waveform.TimeStamp();
57 
58  for (auto const& pulse : pulses)
59  ConstructHit(hitThreshold, channel, timeStamp, pulse, hitVector, clocksData, calibrator, use_start_time);
60  }
61  }
const geo::GeometryCore * geometry
void ConstructHit(float hitThreshold, int channel, double timeStamp, pmtana::pulse_param const &pulse, std::vector< recob::OpHit > &hitVector, detinfo::DetectorClocksData const &clocksData, calib::IPhotonCalibrator const &calibrator, bool use_start_time)
Definition: OpHitAlg.cxx:65
bool IsValidOpChannel(int opChannel) const
Is this a valid OpChannel number?
template<typename T , typename Compare >
std::vector< int > opdet::sort_permutation ( std::vector< T > const &  vec,
int  offset,
Compare  compare 
)

Definition at line 691 of file OpFlashAlg.cxx.

692  {
693 
694  std::vector<int> p(vec.size() - offset);
695  std::iota(p.begin(), p.end(), 0);
696  std::sort(
697  p.begin(), p.end(), [&](int i, int j) { return compare(vec[i + offset], vec[j + offset]); });
698  return p;
699  }
BEGIN_PROLOG TPC Trig offset(g4 rise time) ProjectToHeight
Definition: CORSIKAGen.fcl:7
pdgs p
Definition: selectors.fcl:22
void opdet::StartopDetDigitizerWorkers ( unsigned  n_workers,
opDetDigitizerWorker::Semaphore &  sem_start 
)

Definition at line 49 of file opDetDigitizerWorker.cc.

51 {
52  sem_start.increment(n_workers);
53 }
void opdet::WaitopDetDigitizerWorkers ( unsigned  n_workers,
opDetDigitizerWorker::Semaphore &  sem_finish 
)

Definition at line 55 of file opDetDigitizerWorker.cc.

57 {
58  sem_finish.decrement(n_workers);
59 }
void opdet::writeHistogram ( std::vector< double > const &  binned)

Definition at line 35 of file OpFlashAlg.cxx.

36  {
37  TH1D* binned_histogram = new TH1D("binned_histogram",
38  "Collection of All OpHits;Time (ms);PEs",
39  binned.size(),
40  0,
41  binned.size());
42  for (size_t i = 0; i < binned.size(); ++i)
43  binned_histogram->SetBinContent(i, binned.at(i));
44 
45  TFile f_out("output_hist.root", "RECREATE");
46  binned_histogram->Write();
47  f_out.Close();
48 
49  delete binned_histogram;
50  }

Variable Documentation

createEngine opdet::fFlatRandom {fEngine}

Definition at line 85 of file OpMCDigi_module.cc.

createEngine opdet::this

Definition at line 84 of file OpMCDigi_module.cc.