LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
cluster::BlurredClusteringAlg Class Reference

#include "BlurredClusteringAlg.h"

Public Member Functions

 BlurredClusteringAlg (fhicl::ParameterSet const &pset)
 
 ~BlurredClusteringAlg ()
 
void CreateDebugPDF (int run, int subrun, int event)
 Create the PDF to save debug images. More...
 
void ConvertBinsToClusters (std::vector< std::vector< double >> const &image, std::vector< std::vector< int >> const &allClusterBins, std::vector< art::PtrVector< recob::Hit >> &clusters) const
 Takes a vector of clusters (itself a vector of hits) and turns them into clusters using the initial hit selection. More...
 
std::vector< std::vector< double > > ConvertRecobHitsToVector (std::vector< art::Ptr< recob::Hit >> const &hits)
 Takes hit map and returns a 2D vector representing wire and tick, filled with the charge. More...
 
int FindClusters (std::vector< std::vector< double >> const &image, std::vector< std::vector< int >> &allcluster)
 Find clusters in the histogram. More...
 
int GlobalWire (geo::WireID const &wireID)
 Find the global wire position. More...
 
std::vector< std::vector< double > > GaussianBlur (std::vector< std::vector< double >> const &image)
 Applies Gaussian blur to image. More...
 
unsigned int GetMinSize () const noexcept
 Minimum size of cluster to save. More...
 
TH2F * MakeHistogram (std::vector< std::vector< double >> const &image, TString name)
 Converts a 2D vector in a histogram for the debug pdf. More...
 
void SaveImage (TH2F *image, std::vector< art::PtrVector< recob::Hit >> const &allClusters, int pad, int tpc, int plane)
 
void SaveImage (TH2F *image, int pad, int tpc, int plane)
 Save the images for debugging. More...
 
void SaveImage (TH2F *image, std::vector< std::vector< int >> const &allClusterBins, int pad, int tpc, int plane)
 

Private Member Functions

art::PtrVector< recob::HitConvertBinsToRecobHits (std::vector< std::vector< double >> const &image, std::vector< int > const &bins) const
 Converts a vector of bins into a hit selection - not all the hits in the bins vector are real hits. More...
 
art::Ptr< recob::HitConvertBinToRecobHit (std::vector< std::vector< double >> const &image, int bin) const
 Converts a bin into a recob::Hit (not all of these bins correspond to recob::Hits - some are fake hits created by the blurring) More...
 
int ConvertWireTickToBin (std::vector< std::vector< double >> const &image, int xbin, int ybin) const
 Converts an xbin and a ybin to a global bin number. More...
 
double ConvertBinToCharge (std::vector< std::vector< double >> const &image, int bin) const
 Returns the charge stored in the global bin value. More...
 
std::pair< int, int > DeadWireCount (int wire_bin, int width) const
 
std::array< int, 4 > FindBlurringParameters () const
 Dynamically find the blurring radii and Gaussian sigma in each dimension. More...
 
double GetTimeOfBin (std::vector< std::vector< double >> const &image, int bin) const
 Returns the hit time of a hit in a particular bin. More...
 
std::vector< std::vector< std::vector< double > > > MakeKernels () const
 Makes all the kernels which could be required given the tuned parameters. More...
 
unsigned int NumNeighbours (int nx, std::vector< bool > const &used, int bin) const
 Determines the number of clustered neighbours of a hit. More...
 
bool PassesTimeCut (std::vector< double > const &times, double time) const
 Determine if a hit is within a time threshold of any other hits in a cluster. More...
 

Private Attributes

bool fDebug
 
std::string fDetector
 
int fBlurWire
 
int fBlurTick
 
double fSigmaWire
 
double fSigmaTick
 
int fMaxTickWidthBlur
 
int fClusterWireDistance
 
int fClusterTickDistance
 
unsigned int fNeighboursThreshold
 
unsigned int fMinNeighbours
 
unsigned int fMinSize
 
double fMinSeed
 
double fTimeThreshold
 
double fChargeThreshold
 
int fKernelWidth
 
int fKernelHeight
 
std::vector< std::vector< std::vector< double > > > fAllKernels
 
std::vector< std::vector< art::Ptr< recob::Hit > > > fHitMap
 
std::vector< bool > fDeadWires
 
int fLowerTick
 
int fUpperTick
 
int fLowerWire
 
int fUpperWire
 
TCanvas * fDebugCanvas {nullptr}
 
std::string fDebugPDFName {}
 
art::ServiceHandle< geo::GeometryfGeom
 
detinfo::DetectorProperties const * fDetProp
 
lariov::ChannelStatusProvider const & fChanStatus {art::ServiceHandle<lariov::ChannelStatusService>()->GetProvider()}
 

Detailed Description

Definition at line 70 of file BlurredClusteringAlg.h.

Constructor & Destructor Documentation

cluster::BlurredClusteringAlg::BlurredClusteringAlg ( fhicl::ParameterSet const &  pset)

Definition at line 18 of file BlurredClusteringAlg.cxx.

References fAllKernels, fBlurTick, fBlurWire, fChargeThreshold, fClusterTickDistance, fClusterWireDistance, fDetector, fDetProp, fKernelHeight, fKernelWidth, fMaxTickWidthBlur, fMinNeighbours, fMinSeed, fMinSize, fNeighboursThreshold, fSigmaTick, fSigmaWire, fTimeThreshold, fhicl::ParameterSet::get(), and MakeKernels().

19  : fDebug{pset.get<bool>("Debug",false)}
20  , fDetector{pset.get<std::string>("Detector","dune35t")}
21  , fBlurWire{pset.get<int>("BlurWire")}
22  , fBlurTick{pset.get<int>("BlurTick")}
23  , fSigmaWire{pset.get<double>("SigmaWire")}
24  , fSigmaTick{pset.get<double>("SigmaTick")}
25  , fMaxTickWidthBlur{pset.get<int>("MaxTickWidthBlur")}
26  , fClusterWireDistance{pset.get<int>("ClusterWireDistance")}
27  , fClusterTickDistance{pset.get<int>("ClusterTickDistance")}
28  , fNeighboursThreshold{pset.get<unsigned int>("NeighboursThreshold")}
29  , fMinNeighbours{pset.get<unsigned int>("MinNeighbours")}
30  , fMinSize{pset.get<unsigned int>("MinSize")}
31  , fMinSeed{pset.get<double>("MinSeed")}
32  , fTimeThreshold{pset.get<double>("TimeThreshold")}
33  , fChargeThreshold{pset.get<double>("ChargeThreshold")}
34  , fKernelWidth{2 * fBlurWire + 1}
37  , fDetProp{lar::providerFrom<detinfo::DetectorPropertiesService>()}
38 {}
std::vector< std::vector< std::vector< double > > > MakeKernels() const
Makes all the kernels which could be required given the tuned parameters.
std::vector< std::vector< std::vector< double > > > fAllKernels
detinfo::DetectorProperties const * fDetProp
cluster::BlurredClusteringAlg::~BlurredClusteringAlg ( )

Definition at line 40 of file BlurredClusteringAlg.cxx.

References fDebugCanvas, and fDebugPDFName.

41 {
42  if (fDebugCanvas) {
43  std::string closeName = fDebugPDFName;
44  closeName.append("]");
45  fDebugCanvas->Print(closeName.c_str());
46  delete fDebugCanvas;
47  }
48 }

Member Function Documentation

void cluster::BlurredClusteringAlg::ConvertBinsToClusters ( std::vector< std::vector< double >> const &  image,
std::vector< std::vector< int >> const &  allClusterBins,
std::vector< art::PtrVector< recob::Hit >> &  clusters 
) const

Takes a vector of clusters (itself a vector of hits) and turns them into clusters using the initial hit selection.

Definition at line 92 of file BlurredClusteringAlg.cxx.

References ConvertBinsToRecobHits(), fMinSize, and art::PtrVector< T >::size().

Referenced by cluster::BlurredClustering::produce().

95 {
96  // Loop through the clusters (each a vector of bins)
97  for (auto const& bins : allClusterBins) {
98  // Convert the clusters (vectors of bins) to hits in a vector of recob::Hits
99  art::PtrVector<recob::Hit> clusHits = ConvertBinsToRecobHits(image, bins);
100 
101  mf::LogInfo("BlurredClustering") << "Cluster made from " << bins.size() << " bins, of which " << clusHits.size() << " were real hits";
102 
103  // Make sure the clusters are above the minimum cluster size
104  if (clusHits.size() < fMinSize) {
105  mf::LogVerbatim("BlurredClustering") << "Cluster of size " << clusHits.size() << " not saved since it is smaller than the minimum cluster size, set to " << fMinSize;
106  continue;
107  }
108 
109  clusters.push_back(clusHits);
110  }
111 }
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
art::PtrVector< recob::Hit > ConvertBinsToRecobHits(std::vector< std::vector< double >> const &image, std::vector< int > const &bins) const
Converts a vector of bins into a hit selection - not all the hits in the bins vector are real hits...
size_type size() const
Definition: PtrVector.h:308
art::PtrVector< recob::Hit > cluster::BlurredClusteringAlg::ConvertBinsToRecobHits ( std::vector< std::vector< double >> const &  image,
std::vector< int > const &  bins 
) const
private

Converts a vector of bins into a hit selection - not all the hits in the bins vector are real hits.

Definition at line 594 of file BlurredClusteringAlg.cxx.

References bin, ConvertBinToRecobHit(), hits(), art::Ptr< T >::isNull(), and art::PtrVector< T >::push_back().

Referenced by ConvertBinsToClusters(), and GetMinSize().

596 {
597  // Create the vector of hits to output
599 
600  // Look through the hits in the cluster
601  for (auto const bin : bins) {
602  // Take each hit and convert it to a recob::Hit
604 
605  // If this hit was a real hit put it in the hit selection
606  if (!hit.isNull())
607  hits.push_back(hit);
608  }
609 
610  // Return the vector of hits to make cluster
611  return hits;
612 }
void hits()
Definition: readHits.C:15
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:441
art::Ptr< recob::Hit > ConvertBinToRecobHit(std::vector< std::vector< double >> const &image, int bin) const
Converts a bin into a recob::Hit (not all of these bins correspond to recob::Hits - some are fake hit...
float bin[41]
Definition: plottest35.C:14
Detector simulation of raw signals on wires.
bool isNull() const
Definition: Ptr.h:328
double cluster::BlurredClusteringAlg::ConvertBinToCharge ( std::vector< std::vector< double >> const &  image,
int  bin 
) const
private

Returns the charge stored in the global bin value.

Definition at line 632 of file BlurredClusteringAlg.cxx.

References x, and y.

Referenced by FindClusters(), and GetMinSize().

634 {
635  int const x = bin % image.size();
636  int const y = bin / image.size();
637  return image.at(x).at(y);
638 }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
float bin[41]
Definition: plottest35.C:14
art::Ptr< recob::Hit > cluster::BlurredClusteringAlg::ConvertBinToRecobHit ( std::vector< std::vector< double >> const &  image,
int  bin 
) const
private

Converts a bin into a recob::Hit (not all of these bins correspond to recob::Hits - some are fake hits created by the blurring)

Definition at line 615 of file BlurredClusteringAlg.cxx.

References fHitMap.

Referenced by ConvertBinsToRecobHits(), GetMinSize(), and GetTimeOfBin().

617 {
618  int const wire = bin % image.size();
619  int const tick = bin / image.size();
620  return fHitMap[wire][tick];
621 }
std::vector< std::vector< art::Ptr< recob::Hit > > > fHitMap
float bin[41]
Definition: plottest35.C:14
std::vector< std::vector< double > > cluster::BlurredClusteringAlg::ConvertRecobHitsToVector ( std::vector< art::Ptr< recob::Hit >> const &  hits)

Takes hit map and returns a 2D vector representing wire and tick, filled with the charge.

Definition at line 114 of file BlurredClusteringAlg.cxx.

References fChanStatus, fDeadWires, fDetProp, fGeom, fHitMap, fLowerTick, fLowerWire, fUpperTick, fUpperWire, GlobalWire(), hits(), geo::GeometryCore::MaxWires(), geo::GeometryCore::PlaneWireToChannel(), detinfo::DetectorProperties::ReadOutWindowSize(), and lar::dump::vector().

Referenced by cluster::BlurredClustering::produce().

115 {
116  // Define the size of this particular plane -- dynamically to avoid huge histograms
117  int lowerTick = fDetProp->ReadOutWindowSize(), upperTick{}, lowerWire = fGeom->MaxWires(), upperWire{};
118  for (auto const& hit : hits) {
119  int histWire = GlobalWire(hit->WireID());
120  if (hit->PeakTime() < lowerTick) lowerTick = hit->PeakTime();
121  if (hit->PeakTime() > upperTick) upperTick = hit->PeakTime();
122  if (histWire < lowerWire) lowerWire = histWire;
123  if (histWire > upperWire) upperWire = histWire;
124  }
125  fLowerTick = lowerTick-20;
126  fUpperTick = upperTick+20;
127  fLowerWire = lowerWire-20;
128  fUpperWire = upperWire+20;
129 
130  // Use a map to keep a track of the real hits and their wire/ticks
131  fHitMap.clear();
133 
134  // Create a 2D vector
135  std::vector<std::vector<double>> image(fUpperWire-fLowerWire, std::vector<double>(fUpperTick-fLowerTick));
136 
137  // Look through the hits
138  for (auto const& hit : hits) {
139  int const wire = GlobalWire(hit->WireID());
140  auto const tick = static_cast<int>(hit->PeakTime());
141  float const charge = hit->Integral();
142 
143  // Fill hit map and keep a note of all real hits for later
144  if (charge > image.at(wire-fLowerWire).at(tick-fLowerTick)) {
145  image.at(wire-fLowerWire).at(tick-fLowerTick) = charge;
146  fHitMap[wire-fLowerWire][tick-fLowerTick] = hit;
147  }
148  }
149 
150  // Keep a note of dead wires
151  fDeadWires = std::vector<bool>(fUpperWire-fLowerWire, false);
152  geo::PlaneID const planeID = hits.front()->WireID().planeID();
153 
154  for (int wire = fLowerWire; wire < fUpperWire; ++wire) {
155  raw::ChannelID_t const channel = fGeom->PlaneWireToChannel(planeID.Plane,wire,planeID.TPC,planeID.Cryostat);
156  fDeadWires[wire-fLowerWire] = !fChanStatus.IsGood(channel);
157  }
158 
159  return image;
160 }
virtual unsigned int ReadOutWindowSize() const =0
std::vector< std::vector< art::Ptr< recob::Hit > > > fHitMap
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
unsigned int MaxWires() const
Returns the largest number of wires among all planes in this detector.
art::ServiceHandle< geo::Geometry > fGeom
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
Detector simulation of raw signals on wires.
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:27
lariov::ChannelStatusProvider const & fChanStatus
detinfo::DetectorProperties const * fDetProp
int GlobalWire(geo::WireID const &wireID)
Find the global wire position.
int cluster::BlurredClusteringAlg::ConvertWireTickToBin ( std::vector< std::vector< double >> const &  image,
int  xbin,
int  ybin 
) const
private

Converts an xbin and a ybin to a global bin number.

Definition at line 624 of file BlurredClusteringAlg.cxx.

Referenced by FindClusters(), and GetMinSize().

627 {
628  return ybin * image.size() + xbin;
629 }
void cluster::BlurredClusteringAlg::CreateDebugPDF ( int  run,
int  subrun,
int  event 
)

Create the PDF to save debug images.

Definition at line 50 of file BlurredClusteringAlg.cxx.

References fDebugCanvas, and fDebugPDFName.

Referenced by cluster::BlurredClustering::produce().

51 {
52  if (!fDebugCanvas) {
53 
54  // Create the grayscale palette for the Z axis
55  Double_t Red[2] = { 1.00, 0.00 };
56  Double_t Green[2] = { 1.00, 0.00 };
57  Double_t Blue[2] = { 1.00, 0.00 };
58  Double_t Length[2] = { 0.00, 1.00 };
59  TColor::CreateGradientColorTable(2, Length, Red, Green, Blue, 1000);
60  gStyle->SetOptStat(110000);
61 
62  // Decide what to call this PDF
63  std::ostringstream oss;
64  oss << "BlurredImages_Run" << run << "_Subrun" << subrun;
65  fDebugPDFName = oss.str();
66  fDebugCanvas = new TCanvas(fDebugPDFName.c_str(), "Image canvas", 1000, 500);
67  fDebugPDFName.append(".pdf");
68 
69  std::string openName = fDebugPDFName;
70  openName.append("[");
71  fDebugCanvas->Print(openName.c_str());
72  fDebugCanvas->Divide(2, 2);
73  fDebugCanvas->SetGrid();
74  }
75 
76  // Clear the pads on the canvas
77  for (int i = 1; i <= 4; ++i) {
78  fDebugCanvas->GetPad(i)->Clear();
79  }
80 
81  std::ostringstream oss;
82  oss << "Event " << event;
83  fDebugCanvas->cd(1);
84  TLatex l;
85  l.SetTextSize(0.15);
86  l.DrawLatex(0.1, 0.1, oss.str().c_str());
87  fDebugCanvas->Print(fDebugPDFName.c_str());
88 
89 }
Event finding and building.
std::pair< int, int > cluster::BlurredClusteringAlg::DeadWireCount ( int  wire_bin,
int  width 
) const
private

Count how many dead wires there are in the blurring region for a particular hit Returns a pair of counters representing how many dead wires there are below and above the hit respectively

Definition at line 641 of file BlurredClusteringAlg.cxx.

References fDeadWires, fLowerWire, fUpperWire, max, and min.

Referenced by GaussianBlur(), and GetMinSize().

642 {
643  auto deadWires = std::make_pair(0, 0);
644 
645  int const lower_bin = width / 2;
646  int const upper_bin = (width+1) / 2;
647 
648  auto const offset = wire_bin + fLowerWire;
649  for (int wire = std::max(offset - lower_bin, fLowerWire); wire < std::min(offset + upper_bin, fUpperWire); ++wire) {
650  if (!fDeadWires[wire-fLowerWire]) continue;
651 
652  if (wire < offset)
653  ++deadWires.first;
654  else if (wire > offset)
655  ++deadWires.second;
656  }
657 
658  return deadWires;
659 
660 }
Int_t max
Definition: plot.C:27
Int_t min
Definition: plot.C:26
std::array< int, 4 > cluster::BlurredClusteringAlg::FindBlurringParameters ( ) const
private

Dynamically find the blurring radii and Gaussian sigma in each dimension.

Definition at line 663 of file BlurredClusteringAlg.cxx.

References fBlurTick, fBlurWire, fHitMap, fLowerTick, fLowerWire, fSigmaTick, fSigmaWire, max, x, and y.

Referenced by GaussianBlur(), and GetMinSize().

664 {
665  // Calculate least squares slope
666  double nhits{}, sumx{}, sumy{}, sumx2{}, sumxy{};
667  for (unsigned int wireIt = 0; wireIt < fHitMap.size(); ++wireIt) {
668  for (unsigned int tickIt = 0; tickIt < fHitMap.at(wireIt).size(); ++tickIt) {
669  if (fHitMap[wireIt][tickIt].isNull())
670  continue;
671  ++nhits;
672  int const x = wireIt + fLowerWire;
673  int const y = tickIt + fLowerTick;
674  sumx += x;
675  sumy += y;
676  sumx2 += x*x;
677  sumxy += x*y;
678  }
679  }
680  double const gradient = (nhits * sumxy - sumx * sumy) / (nhits * sumx2 - sumx * sumx);
681 
682  // Get the rough unit vector for the trajectories, making sure to
683  // catch the vertical gradient.
684  auto const unit = std::isnan(gradient) ? TVector2{0, 1} : TVector2{1, gradient}.Unit();
685 
686  // Use this direction to scale the blurring radii and Gaussian sigma
687  int const blur_wire = std::max(std::abs(std::round(fBlurWire * unit.X())), 1.);
688  int const blur_tick = std::max(std::abs(std::round(fBlurTick * unit.Y())), 1.);
689 
690  int const sigma_wire = std::max(std::abs(std::round(fSigmaWire * unit.X())), 1.);
691  int const sigma_tick = std::max(std::abs(std::round(fSigmaTick * unit.Y())), 1.);
692  return {{blur_wire, blur_tick, sigma_wire, sigma_tick}};
693 }
Float_t x
Definition: compare.C:6
std::vector< std::vector< art::Ptr< recob::Hit > > > fHitMap
Float_t y
Definition: compare.C:6
Int_t max
Definition: plot.C:27
int cluster::BlurredClusteringAlg::FindClusters ( std::vector< std::vector< double >> const &  image,
std::vector< std::vector< int >> &  allcluster 
)

Find clusters in the histogram.

Definition at line 163 of file BlurredClusteringAlg.cxx.

References bin, ConvertBinToCharge(), ConvertWireTickToBin(), fChargeThreshold, fClusterTickDistance, fClusterWireDistance, fMinNeighbours, fMinSeed, fMinSize, fNeighboursThreshold, GetTimeOfBin(), NumNeighbours(), PassesTimeCut(), x, and y.

Referenced by cluster::BlurredClustering::produce().

165 {
166  // Size of image in x and y
167  int const nbinsx = blurred.size();
168  int const nbinsy = blurred.at(0).size();
169  int const nbins = nbinsx * nbinsy;
170 
171  // Vectors to hold hit information
172  std::vector<bool> used(nbins);
173  std::vector<std::pair<double, int>> values;
174 
175  // Place the bin number and contents as a pair in the values vector
176  for (int xbin = 0; xbin < nbinsx; ++xbin) {
177  for (int ybin = 0; ybin < nbinsy; ++ybin) {
178  int const bin = ConvertWireTickToBin(blurred, xbin, ybin);
179  values.emplace_back(ConvertBinToCharge(blurred, bin), bin);
180  }
181  }
182 
183  // Sort the values into charge order
184  std::sort(values.rbegin(), values.rend());
185 
186  // Count the number of iterations of the cluster forming loop (== number of clusters)
187  int niter = 0;
188 
189  // Clustering loops
190  // First loop - considers highest charge hits in decreasing order, and puts them in a new cluster if they aren't already clustered (makes new cluster every iteration)
191  // Second loop - looks at the direct neighbours of this seed and clusters to this if above charge/time thresholds. Runs recursively over all hits in cluster (inc. new ones)
192  while (true) {
193 
194  // Start a new cluster each time loop is executed
195  std::vector<int> cluster;
196  std::vector<double> times;
197 
198  // Get the highest charge bin (go no further if below seed threshold)
199  if (double const blurred_binval = values[niter].first; blurred_binval < fMinSeed)
200  break;
201 
202  // Iterate through the bins from highest charge down
203  int const bin = values[niter++].second;
204 
205  // Put this bin in used if not already there
206  if (used[bin])
207  continue;
208  used[bin] = true;
209 
210  // Start a new cluster
211  cluster.push_back(bin);
212 
213  // Get the time of this hit
214  if (double const time = GetTimeOfBin(blurred, bin); time > 0)
215  times.push_back(time);
216 
217  // Now cluster neighbouring hits to this seed
218  while (true) {
219 
220  bool added_cluster{false};
221 
222  for (unsigned int clusBin = 0; clusBin < cluster.size(); ++clusBin) {
223 
224  // Get x and y values for bin (c++ returns a%b = a if a<b)
225  int const binx = cluster[clusBin] % nbinsx;
226  int const biny = ((cluster[clusBin] - binx) / nbinsx) % nbinsy;
227 
228  // Look for hits in the neighbouring x/y bins
229  for (int x = binx - fClusterWireDistance; x <= binx + fClusterWireDistance; x++) {
230  if (x >= nbinsx or x < 0) continue;
231  for (int y = biny - fClusterTickDistance; y <= biny + fClusterTickDistance; y++) {
232  if (y >= nbinsy or y < 0) continue;
233  if (x == binx and y == biny) continue;
234 
235  // Get this bin
236  auto const bin = ConvertWireTickToBin(blurred, x, y);
237  if (bin >= nbinsx * nbinsy or bin < 0)
238  continue;
239  if (used[bin])
240  continue;
241 
242  // Get the blurred value and time for this bin
243  double const blurred_binval = ConvertBinToCharge(blurred, bin);
244  double const time = GetTimeOfBin(blurred, bin); // NB for 'fake' hits, time is defaulted to -10000
245 
246  // Check real hits pass time cut (ignores fake hits)
247  if (time > 0 && times.size() > 0 && ! PassesTimeCut(times, time))
248  continue;
249 
250  // Add to cluster if bin value is above threshold
251  if (blurred_binval > fChargeThreshold) {
252  used[bin] = true;
253  cluster.push_back(bin);
254  added_cluster = true;
255  if (time > 0) {
256  times.push_back(time);
257  }
258  } // End of adding blurred bin to cluster
259 
260  }
261  } // End of looking at directly neighbouring bins
262 
263  } // End of looping over bins already in this cluster
264 
265  if (!added_cluster)
266  break;
267 
268  } // End of adding hits to this cluster
269 
270  // Check this cluster is above minimum size
271  if (cluster.size() < fMinSize) {
272  for (auto const bin : cluster) {
273  assert(bin >= 0);
274  used[bin] = false;
275  }
276  continue;
277  }
278 
279  // Fill in holes in the cluster
280  for (unsigned int clusBin = 0; clusBin < cluster.size(); clusBin++) {
281 
282  // Looks at directly neighbouring bins (and not itself)
283  for (int x = -1; x <= 1; ++x) {
284  for (int y = -1; y <= 1; ++y) {
285  if (x == 0 && y == 0) continue;
286 
287  // Look at neighbouring bins to the clustered bin which are inside the cluster
288  int neighbouringBin = cluster[clusBin] + x + (y * nbinsx);
289  if (neighbouringBin < nbinsx || neighbouringBin % nbinsx == 0 || neighbouringBin % nbinsx == nbinsx - 1 || neighbouringBin >= nbinsx * (nbinsy - 1))
290  continue;
291 
292  double const time = GetTimeOfBin(blurred, neighbouringBin);
293 
294  // If not already clustered and passes neighbour/time thresholds, add to cluster
295  if (!used[neighbouringBin] && (NumNeighbours(nbinsx, used, neighbouringBin) > fNeighboursThreshold) && PassesTimeCut(times, time)) {
296  used[neighbouringBin] = true;
297  cluster.push_back(neighbouringBin);
298 
299  if (time > 0) {
300  times.push_back(time);
301  }
302  } // End of clustering neighbouring bin
303 
304  }
305  } // End of looping over neighbouring bins
306 
307  } // End of looping over bins already in cluster
308 
309  mf::LogVerbatim("Blurred Clustering") << "Size of cluster after filling in holes: " << cluster.size();
310 
311 
312  // Remove peninsulas - hits which have too few neighbouring hits in the cluster (defined by fMinNeighbours)
313  while (true) {
314  bool removed_cluster{false};
315 
316  // Loop over all the bins in the cluster
317  for (int clusBin = cluster.size() - 1; clusBin >= 0; clusBin--) {
318  auto const bin = cluster[clusBin];
319 
320  // If bin is in cluster ignore
321  if (bin < nbinsx || bin % nbinsx == 0 || bin % nbinsx == nbinsx - 1 || bin >= nbinsx * (nbinsy - 1)) continue;
322 
323  // Remove hit if it has too few neighbouring hits
324  if (NumNeighbours(nbinsx, used, bin) < fMinNeighbours) {
325  used[bin] = false;
326  removed_cluster = true;
327  cluster.erase(cluster.begin() + clusBin);
328  }
329  }
330 
331  if (!removed_cluster)
332  break;
333  }
334 
335  mf::LogVerbatim("Blurred Clustering") << "Size of cluster after removing peninsulas: " << cluster.size();
336 
337 
338  // Disregard cluster if not of minimum size
339  if (cluster.size() < fMinSize) {
340  for (auto const bin : cluster) {
341  assert(bin >= 0);
342  used[bin] = false;
343  }
344  continue;
345  }
346 
347  // Put this cluster in the vector of clusters
348  allcluster.push_back(cluster);
349 
350  } // End loop over this cluster
351 
352  // Return the number of clusters found in this hit map
353  return allcluster.size();
354 
355 }
Float_t x
Definition: compare.C:6
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
double GetTimeOfBin(std::vector< std::vector< double >> const &image, int bin) const
Returns the hit time of a hit in a particular bin.
bool PassesTimeCut(std::vector< double > const &times, double time) const
Determine if a hit is within a time threshold of any other hits in a cluster.
Float_t y
Definition: compare.C:6
unsigned int NumNeighbours(int nx, std::vector< bool > const &used, int bin) const
Determines the number of clustered neighbours of a hit.
Cluster finding and building.
double ConvertBinToCharge(std::vector< std::vector< double >> const &image, int bin) const
Returns the charge stored in the global bin value.
int ConvertWireTickToBin(std::vector< std::vector< double >> const &image, int xbin, int ybin) const
Converts an xbin and a ybin to a global bin number.
float bin[41]
Definition: plottest35.C:14
std::vector< std::vector< double > > cluster::BlurredClusteringAlg::GaussianBlur ( std::vector< std::vector< double >> const &  image)

Applies Gaussian blur to image.

Definition at line 400 of file BlurredClusteringAlg.cxx.

References DeadWireCount(), fAllKernels, fDeadWires, fHitMap, FindBlurringParameters(), fKernelHeight, fKernelWidth, fMaxTickWidthBlur, fSigmaTick, fSigmaWire, max, min, weight, x, and y.

Referenced by cluster::BlurredClustering::produce().

401 {
402  if (fSigmaWire == 0 and fSigmaTick == 0)
403  return image;
404 
405  auto const [blur_wire, blur_tick, sigma_wire, sigma_tick] = FindBlurringParameters();
406 
407  // Convolve the Gaussian
408  int width = 2 * blur_wire + 1;
409  int height = 2 * blur_tick + 1;
410  int nbinsx = image.size();
411  int nbinsy = image.at(0).size();
412 
413  // Blurred histogram and normalisation for each bin
414  std::vector<std::vector<double>> copy(nbinsx, std::vector<double>(nbinsy, 0));
415 
416  // Loop through all the bins in the histogram to blur
417  for (int x = 0; x < nbinsx; ++x) {
418  for (int y = 0; y < nbinsy; ++y) {
419 
420  if (image[x][y] == 0)
421  continue;
422 
423  // Scale the tick blurring based on the width of the hit
424  int tick_scale = std::sqrt(cet::square(fHitMap[x][y]->RMS()) + cet::square(sigma_tick)) / (double)sigma_tick;
425  tick_scale = std::max(std::min(tick_scale, fMaxTickWidthBlur), 1);
426  auto const& correct_kernel = fAllKernels[sigma_wire][sigma_tick*tick_scale];
427 
428  // Find any dead wires in the potential blurring region
429  auto const [lower_bin_dead, upper_bin_dead] = DeadWireCount(x, width);
430 
431  // Note of how many dead wires we have passed whilst blurring in the wire direction
432  // If blurring below the seed hit, need to keep a note of how many dead wires to come
433  // If blurring above, need to keep a note of how many dead wires have passed
434  auto dead_wires_passed{lower_bin_dead};
435 
436  // Loop over the blurring region around this hit
437  for (int blurx = -(width/2+lower_bin_dead); blurx < (width+1)/2+upper_bin_dead; ++blurx) {
438  if (x + blurx < 0) continue;
439  for (int blury = -height/2*tick_scale; blury < ((((height+1)/2)-1)*tick_scale)+1; ++blury) {
440  if (blurx < 0 and fDeadWires[x+blurx])
441  dead_wires_passed -= 1;
442 
443  // Smear the charge of this hit
444  double const weight = correct_kernel[fKernelWidth * (fKernelHeight / 2 + blury) + (fKernelWidth / 2 + (blurx - dead_wires_passed))];
445  if (x + blurx >= 0 and x + blurx < nbinsx and y + blury >= 0 and y + blury < nbinsy)
446  copy[x+blurx][y+blury] += weight * image[x][y];
447 
448  if (blurx > 0 and fDeadWires[x+blurx])
449  dead_wires_passed += 1;
450  }
451  } // blurring region
452 
453  }
454  } // hits to blur
455 
456  // HAVE REMOVED NOMALISATION CODE
457  // WHEN USING DIFFERENT KERNELS, THERE'S NO EASY WAY OF DOING THIS...
458  // RECONSIDER...
459 
460  // Return the blurred histogram
461  return copy;
462 }
Float_t x
Definition: compare.C:6
std::vector< std::vector< art::Ptr< recob::Hit > > > fHitMap
Float_t y
Definition: compare.C:6
std::array< int, 4 > FindBlurringParameters() const
Dynamically find the blurring radii and Gaussian sigma in each dimension.
std::pair< int, int > DeadWireCount(int wire_bin, int width) const
Int_t max
Definition: plot.C:27
double weight
Definition: plottest35.C:25
Int_t min
Definition: plot.C:26
std::vector< std::vector< std::vector< double > > > fAllKernels
unsigned int cluster::BlurredClusteringAlg::GetMinSize ( ) const
inlinenoexcept
double cluster::BlurredClusteringAlg::GetTimeOfBin ( std::vector< std::vector< double >> const &  image,
int  bin 
) const
private

Returns the hit time of a hit in a particular bin.

Definition at line 696 of file BlurredClusteringAlg.cxx.

References ConvertBinToRecobHit().

Referenced by FindClusters(), and GetMinSize().

698 {
699  auto const hit = ConvertBinToRecobHit(image, bin);
700  return hit.isNull() ? -10000. : hit->PeakTime();
701 }
art::Ptr< recob::Hit > ConvertBinToRecobHit(std::vector< std::vector< double >> const &image, int bin) const
Converts a bin into a recob::Hit (not all of these bins correspond to recob::Hits - some are fake hit...
float bin[41]
Definition: plottest35.C:14
Detector simulation of raw signals on wires.
int cluster::BlurredClusteringAlg::GlobalWire ( geo::WireID const &  wireID)

Find the global wire position.

Definition at line 358 of file BlurredClusteringAlg.cxx.

References geo::CryostatID::Cryostat, fDetector, fGeom, geo::WireGeo::GetCenter(), geo::kInduction, geo::GeometryCore::Nwires(), geo::PlaneID::Plane, geo::GeometryCore::SignalType(), geo::TPCID::TPC, geo::WireID::Wire, geo::GeometryCore::WireCoordinate(), and geo::GeometryCore::WireIDToWireGeo().

Referenced by ConvertRecobHitsToVector(), cluster::BlurredClustering::produce(), and SaveImage().

359 {
360  double globalWire = -999;
361 
362  // Induction
363  if (fGeom->SignalType(wireID) == geo::kInduction) {
364  double wireCentre[3];
365  fGeom->WireIDToWireGeo(wireID).GetCenter(wireCentre);
366  if (wireID.TPC % 2 == 0) globalWire = fGeom->WireCoordinate(wireCentre[1], wireCentre[2], wireID.Plane, 0, wireID.Cryostat);
367  else globalWire = fGeom->WireCoordinate(wireCentre[1], wireCentre[2], wireID.Plane, 1, wireID.Cryostat);
368  }
369 
370  // Collection
371  else {
372  // FOR COLLECTION WIRES, HARD CODE THE GEOMETRY FOR GIVEN DETECTORS
373  // THIS _SHOULD_ BE TEMPORARY. GLOBAL WIRE SUPPORT IS BEING ADDED TO THE LARSOFT GEOMETRY AND SHOULD BE AVAILABLE SOON
374  if (fDetector == "dune35t") {
375  unsigned int nwires = fGeom->Nwires(wireID.Plane, 0, wireID.Cryostat);
376  if (wireID.TPC == 0 or wireID.TPC == 1) globalWire = wireID.Wire;
377  else if (wireID.TPC == 2 or wireID.TPC == 3 or wireID.TPC == 4 or wireID.TPC == 5) globalWire = nwires + wireID.Wire;
378  else if (wireID.TPC == 6 or wireID.TPC == 7) globalWire = (2*nwires) + wireID.Wire;
379  else mf::LogError("BlurredClusterAlg") << "Error when trying to find a global induction plane coordinate for TPC " << wireID.TPC << " (geometry " << fDetector << ")";
380  }
381  else if (fDetector == "dune10kt") {
382  unsigned int nwires = fGeom->Nwires(wireID.Plane, 0, wireID.Cryostat);
383  // Detector geometry has four TPCs, two on top of each other, repeated along z...
384  int block = wireID.TPC / 4;
385  globalWire = (nwires*block) + wireID.Wire;
386  }
387  else {
388  double wireCentre[3];
389  fGeom->WireIDToWireGeo(wireID).GetCenter(wireCentre);
390  if (wireID.TPC % 2 == 0) globalWire = fGeom->WireCoordinate(wireCentre[1], wireCentre[2], wireID.Plane, 0, wireID.Cryostat);
391  else globalWire = fGeom->WireCoordinate(wireCentre[1], wireCentre[2], wireID.Plane, 1, wireID.Cryostat);
392  }
393  }
394 
395  return std::round(globalWire);
396 
397 }
geo::Length_t WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeid) const
Returns the index of the nearest wire to the specified position.
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
art::ServiceHandle< geo::Geometry > fGeom
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
Signal from induction planes.
Definition: geo_types.h:92
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
Definition: WireGeo.cxx:68
WireGeo const & WireIDToWireGeo(geo::WireID const &wireid) const
Returns the specified wire.
TH2F * cluster::BlurredClusteringAlg::MakeHistogram ( std::vector< std::vector< double >> const &  image,
TString  name 
)

Converts a 2D vector in a histogram for the debug pdf.

Definition at line 465 of file BlurredClusteringAlg.cxx.

References fLowerTick, fLowerWire, fUpperTick, fUpperWire, and hist.

Referenced by GetMinSize(), and cluster::BlurredClustering::produce().

467 {
468  auto hist = new TH2F(name, name,
471  hist->SetXTitle("Wire number");
472  hist->SetYTitle("Tick number");
473  hist->SetZTitle("Charge");
474 
475  for (unsigned int imageWireIt = 0; imageWireIt < image.size(); ++imageWireIt) {
476  int const wire = imageWireIt + fLowerWire;
477  for (unsigned int imageTickIt = 0; imageTickIt < image.at(imageWireIt).size(); ++imageTickIt) {
478  int const tick = imageTickIt + fLowerTick;
479  hist->Fill(wire, tick, image.at(imageWireIt).at(imageTickIt));
480  }
481  }
482 
483  return hist;
484 }
TH2F * hist
Definition: plot.C:136
std::vector< std::vector< std::vector< double > > > cluster::BlurredClusteringAlg::MakeKernels ( ) const
private

Makes all the kernels which could be required given the tuned parameters.

Definition at line 704 of file BlurredClusteringAlg.cxx.

References fBlurTick, fBlurWire, fKernelHeight, fKernelWidth, fMaxTickWidthBlur, fSigmaTick, fSigmaWire, fhicl::detail::atom::value(), and lar::dump::vector().

Referenced by BlurredClusteringAlg(), and GetMinSize().

705 {
706  // Kernel size is the largest possible given the hit width rescaling
707  std::vector<std::vector<std::vector<double>>> allKernels(fSigmaWire + 1,
708  std::vector<std::vector<double>>(fSigmaTick*fMaxTickWidthBlur+1, std::vector<double>(fKernelWidth*fKernelHeight)));
709 
710  // Ranges of kernels to make
711  // Complete range of sigmas possible after dynamic fixing and hit width convolution
712  for (int sigma_wire = 1; sigma_wire <= fSigmaWire; ++sigma_wire) {
713  for (int sigma_tick = 1; sigma_tick <= fSigmaTick*fMaxTickWidthBlur; ++sigma_tick) {
714 
715  // New kernel
716  std::vector<double> kernel(fKernelWidth*fKernelHeight,0);
717 
718  // Smear out according to the blur radii in each direction
719  for (int i = -fBlurWire; i <= fBlurWire; i++) {
720  for (int j = -fBlurTick*fMaxTickWidthBlur; j <= fBlurTick*fMaxTickWidthBlur; j++) {
721 
722  // Fill kernel
723  double const sig2i = 2. * sigma_wire * sigma_wire;
724  double const sig2j = 2. * sigma_tick * sigma_tick;
725 
726  int const key = (fKernelWidth * (j + fBlurTick*fMaxTickWidthBlur)) + (i + fBlurWire);
727  double const value = 1. / std::sqrt(sig2i * M_PI) * std::exp(-i * i / sig2i) * 1. / std::sqrt(sig2j * M_PI) * std::exp(-j * j / sig2j);
728  kernel.at(key) = value;
729 
730  }
731  } // End loop over blurring region
732 
733  allKernels[sigma_wire][sigma_tick] = move(kernel);
734  }
735  }
736  return allKernels;
737 }
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
std::string value(boost::any const &)
unsigned int cluster::BlurredClusteringAlg::NumNeighbours ( int  nx,
std::vector< bool > const &  used,
int  bin 
) const
private

Determines the number of clustered neighbours of a hit.

2D hists can be considered a string of bins - the equation to convert between them is [bin = x + (nbinsx * y)]

Definition at line 740 of file BlurredClusteringAlg.cxx.

References x, and y.

Referenced by FindClusters(), and GetMinSize().

743 {
744  unsigned int neighbours = 0;
745 
746  // Loop over all directly neighbouring hits (not itself)
747  for (int x = -1; x <= 1; x++) {
748  for (int y = -1; y <= 1; y++) {
749  if (x == 0 && y == 0) continue;
750 
751  // Determine bin
752  int neighbouringBin = bin + x + (y * nbinsx);
753 
754  // If this bin is in the cluster, increase the neighbouring bin counter
755  if (used.at(neighbouringBin))
756  neighbours++;
757  }
758  }
759 
760  // Return the number of neighbours in the cluster of a particular hit
761  return neighbours;
762 }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
float bin[41]
Definition: plottest35.C:14
bool cluster::BlurredClusteringAlg::PassesTimeCut ( std::vector< double > const &  times,
double  time 
) const
private

Determine if a hit is within a time threshold of any other hits in a cluster.

Definition at line 765 of file BlurredClusteringAlg.cxx.

References fTimeThreshold.

Referenced by FindClusters(), and GetMinSize().

767 {
768  for (auto const t : times) {
769  if (std::abs(time - t) < fTimeThreshold) return true;
770  }
771  return false;
772 }
void cluster::BlurredClusteringAlg::SaveImage ( TH2F *  image,
std::vector< art::PtrVector< recob::Hit >> const &  allClusters,
int  pad,
int  tpc,
int  plane 
)

Save the images for debugging This version takes the final clusters and overlays on the hit map

Definition at line 487 of file BlurredClusteringAlg.cxx.

References bin, fLowerTick, fLowerWire, fMinSize, and GlobalWire().

Referenced by GetMinSize(), cluster::BlurredClustering::produce(), and SaveImage().

492 {
493  // Make a vector of clusters
494  std::vector<std::vector<int>> allClusterBins;
495 
496  for (auto const& cluster : allClusters) {
497  if (cluster.empty())
498  continue;
499 
500  std::vector<int> clusterBins;
501 
502  for (auto const& hit : cluster) {
503  unsigned int const wire = GlobalWire(hit->WireID());
504  float const tick = hit->PeakTime();
505  int bin = image->GetBin((wire-fLowerWire)+1,(tick-fLowerTick)+1);
506  if (cluster.size() < fMinSize)
507  bin *= -1;
508 
509  clusterBins.push_back(bin);
510  }
511 
512  allClusterBins.push_back(clusterBins);
513  }
514 
515  SaveImage(image, allClusterBins, pad, tpc, plane);
516 }
Cluster finding and building.
void SaveImage(TH2F *image, std::vector< art::PtrVector< recob::Hit >> const &allClusters, int pad, int tpc, int plane)
float bin[41]
Definition: plottest35.C:14
Detector simulation of raw signals on wires.
int GlobalWire(geo::WireID const &wireID)
Find the global wire position.
void cluster::BlurredClusteringAlg::SaveImage ( TH2F *  image,
int  pad,
int  tpc,
int  plane 
)

Save the images for debugging.

Definition at line 519 of file BlurredClusteringAlg.cxx.

References SaveImage().

523 {
524  std::vector<std::vector<int>> allClusterBins;
525  SaveImage(image, allClusterBins, pad, tpc, plane);
526 }
void SaveImage(TH2F *image, std::vector< art::PtrVector< recob::Hit >> const &allClusters, int pad, int tpc, int plane)
void cluster::BlurredClusteringAlg::SaveImage ( TH2F *  image,
std::vector< std::vector< int >> const &  allClusterBins,
int  pad,
int  tpc,
int  plane 
)

Save the images for debugging This version takes a vector of bins and overlays the relevant bins on the hit map

Definition at line 529 of file BlurredClusteringAlg.cxx.

References bin, fDebugCanvas, fDebugPDFName, fLowerTick, fLowerWire, and z.

534 {
535  fDebugCanvas->cd(pad);
536  std::string stage;
537 
538  switch (pad) {
539  case 1:
540  stage = "Stage 1: Unblurred";
541  break;
542  case 2:
543  stage = "Stage 2: Blurred";
544  break;
545  case 3:
546  stage = "Stage 3: Blurred with clusters overlaid";
547  break;
548  case 4:
549  stage = "Stage 4: Output clusters";
550  break;
551  default:
552  stage = "Unknown stage";
553  break;
554  }
555 
556  std::stringstream title;
557  title << stage << " -- TPC " << tpc << ", Plane " << plane;// << " (Event " << fEvent << ")";
558 
559  image->SetName(title.str().c_str());
560  image->SetTitle(title.str().c_str());
561  image->DrawCopy("colz");
562 
563  // Draw the clustered hits on the histograms
564  int clusterNum = 2;
565  for (auto const& bins : allClusterBins) {
566  TMarker mark(0, 0, 20);
567  mark.SetMarkerColor(clusterNum);
568  mark.SetMarkerSize(0.1);
569 
570  for (auto bin : bins) {
571  // Hit from a cluster that we aren't going to save
572  if (bin < 0) {
573  bin *= -1;
574  mark.SetMarkerStyle(24);
575  }
576 
577  int wire, tick, z;
578  image->GetBinXYZ(bin,wire,tick,z);
579  mark.DrawMarker(wire+fLowerWire-1, tick+fLowerTick-1);
580  mark.SetMarkerStyle(20);
581  }
582  }
583 
584  if (pad == 4) {
585  fDebugCanvas->Print(fDebugPDFName.c_str());
586  fDebugCanvas->Clear("D");
587  }
588 
589 }
Double_t z
Definition: plot.C:279
float bin[41]
Definition: plottest35.C:14

Member Data Documentation

std::vector<std::vector<std::vector<double> > > cluster::BlurredClusteringAlg::fAllKernels
private

Definition at line 166 of file BlurredClusteringAlg.h.

Referenced by BlurredClusteringAlg(), and GaussianBlur().

int cluster::BlurredClusteringAlg::fBlurTick
private
int cluster::BlurredClusteringAlg::fBlurWire
private
lariov::ChannelStatusProvider const& cluster::BlurredClusteringAlg::fChanStatus {art::ServiceHandle<lariov::ChannelStatusService>()->GetProvider()}
private

Definition at line 182 of file BlurredClusteringAlg.h.

Referenced by ConvertRecobHitsToVector().

double cluster::BlurredClusteringAlg::fChargeThreshold
private

Definition at line 162 of file BlurredClusteringAlg.h.

Referenced by BlurredClusteringAlg(), and FindClusters().

int cluster::BlurredClusteringAlg::fClusterTickDistance
private

Definition at line 156 of file BlurredClusteringAlg.h.

Referenced by BlurredClusteringAlg(), and FindClusters().

int cluster::BlurredClusteringAlg::fClusterWireDistance
private

Definition at line 155 of file BlurredClusteringAlg.h.

Referenced by BlurredClusteringAlg(), and FindClusters().

std::vector<bool> cluster::BlurredClusteringAlg::fDeadWires
private

Definition at line 170 of file BlurredClusteringAlg.h.

Referenced by ConvertRecobHitsToVector(), DeadWireCount(), and GaussianBlur().

bool cluster::BlurredClusteringAlg::fDebug
private

Definition at line 146 of file BlurredClusteringAlg.h.

TCanvas* cluster::BlurredClusteringAlg::fDebugCanvas {nullptr}
private

Definition at line 176 of file BlurredClusteringAlg.h.

Referenced by CreateDebugPDF(), SaveImage(), and ~BlurredClusteringAlg().

std::string cluster::BlurredClusteringAlg::fDebugPDFName {}
private

Definition at line 177 of file BlurredClusteringAlg.h.

Referenced by CreateDebugPDF(), SaveImage(), and ~BlurredClusteringAlg().

std::string cluster::BlurredClusteringAlg::fDetector
private

Definition at line 147 of file BlurredClusteringAlg.h.

Referenced by BlurredClusteringAlg(), and GlobalWire().

detinfo::DetectorProperties const* cluster::BlurredClusteringAlg::fDetProp
private

Definition at line 181 of file BlurredClusteringAlg.h.

Referenced by BlurredClusteringAlg(), and ConvertRecobHitsToVector().

art::ServiceHandle<geo::Geometry> cluster::BlurredClusteringAlg::fGeom
private

Definition at line 180 of file BlurredClusteringAlg.h.

Referenced by ConvertRecobHitsToVector(), and GlobalWire().

std::vector<std::vector<art::Ptr<recob::Hit> > > cluster::BlurredClusteringAlg::fHitMap
private
int cluster::BlurredClusteringAlg::fKernelHeight
private

Definition at line 165 of file BlurredClusteringAlg.h.

Referenced by BlurredClusteringAlg(), GaussianBlur(), and MakeKernels().

int cluster::BlurredClusteringAlg::fKernelWidth
private

Definition at line 165 of file BlurredClusteringAlg.h.

Referenced by BlurredClusteringAlg(), GaussianBlur(), and MakeKernels().

int cluster::BlurredClusteringAlg::fLowerTick
private
int cluster::BlurredClusteringAlg::fLowerWire
private
int cluster::BlurredClusteringAlg::fMaxTickWidthBlur
private

Definition at line 154 of file BlurredClusteringAlg.h.

Referenced by BlurredClusteringAlg(), GaussianBlur(), and MakeKernels().

unsigned int cluster::BlurredClusteringAlg::fMinNeighbours
private

Definition at line 158 of file BlurredClusteringAlg.h.

Referenced by BlurredClusteringAlg(), and FindClusters().

double cluster::BlurredClusteringAlg::fMinSeed
private

Definition at line 160 of file BlurredClusteringAlg.h.

Referenced by BlurredClusteringAlg(), and FindClusters().

unsigned int cluster::BlurredClusteringAlg::fMinSize
private
unsigned int cluster::BlurredClusteringAlg::fNeighboursThreshold
private

Definition at line 157 of file BlurredClusteringAlg.h.

Referenced by BlurredClusteringAlg(), and FindClusters().

double cluster::BlurredClusteringAlg::fSigmaTick
private
double cluster::BlurredClusteringAlg::fSigmaWire
private
double cluster::BlurredClusteringAlg::fTimeThreshold
private

Definition at line 161 of file BlurredClusteringAlg.h.

Referenced by BlurredClusteringAlg(), and PassesTimeCut().

int cluster::BlurredClusteringAlg::fUpperTick
private

Definition at line 172 of file BlurredClusteringAlg.h.

Referenced by ConvertRecobHitsToVector(), and MakeHistogram().

int cluster::BlurredClusteringAlg::fUpperWire
private

Definition at line 173 of file BlurredClusteringAlg.h.

Referenced by ConvertRecobHitsToVector(), DeadWireCount(), and MakeHistogram().


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