#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, int readoutWindowSize) |
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) const |
Find clusters in the histogram. More... | |
int | GlobalWire (geo::WireID const &wireID) const |
Find the global wire position. More... | |
std::vector< std::vector < double > > | GaussianBlur (std::vector< std::vector< double >> const &image) const |
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) const |
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::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. More... | |
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 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 ×, 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::Geometry const > | fGeom |
lariov::ChannelStatusProvider const & | fChanStatus |
Definition at line 51 of file BlurredClusteringAlg.h.
cluster::BlurredClusteringAlg::BlurredClusteringAlg | ( | fhicl::ParameterSet const & | pset | ) |
Definition at line 37 of file BlurredClusteringAlg.cxx.
cluster::BlurredClusteringAlg::~BlurredClusteringAlg | ( | ) |
Definition at line 58 of file BlurredClusteringAlg.cxx.
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 110 of file BlurredClusteringAlg.cxx.
|
private |
Converts a vector of bins into a hit selection - not all the hits in the bins vector are real hits.
Definition at line 616 of file BlurredClusteringAlg.cxx.
|
private |
Returns the charge stored in the global bin value.
Definition at line 653 of file BlurredClusteringAlg.cxx.
|
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 636 of file BlurredClusteringAlg.cxx.
std::vector< std::vector< double > > cluster::BlurredClusteringAlg::ConvertRecobHitsToVector | ( | std::vector< art::Ptr< recob::Hit >> const & | hits, |
int | readoutWindowSize | ||
) |
Takes hit map and returns a 2D vector representing wire and tick, filled with the charge.
Definition at line 136 of file BlurredClusteringAlg.cxx.
|
private |
Converts an xbin and a ybin to a global bin number.
Definition at line 645 of file BlurredClusteringAlg.cxx.
void cluster::BlurredClusteringAlg::CreateDebugPDF | ( | int | run, |
int | subrun, | ||
int | event | ||
) |
Create the PDF to save debug images.
Definition at line 69 of file BlurredClusteringAlg.cxx.
|
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 662 of file BlurredClusteringAlg.cxx.
|
private |
Dynamically find the blurring radii and Gaussian sigma in each dimension.
Definition at line 685 of file BlurredClusteringAlg.cxx.
int cluster::BlurredClusteringAlg::FindClusters | ( | std::vector< std::vector< double >> const & | image, |
std::vector< std::vector< int >> & | allcluster | ||
) | const |
Find clusters in the histogram.
Definition at line 192 of file BlurredClusteringAlg.cxx.
std::vector< std::vector< double > > cluster::BlurredClusteringAlg::GaussianBlur | ( | std::vector< std::vector< double >> const & | image | ) | const |
Applies Gaussian blur to image.
Definition at line 433 of file BlurredClusteringAlg.cxx.
|
inlinenoexcept |
|
private |
Returns the hit time of a hit in a particular bin.
Definition at line 717 of file BlurredClusteringAlg.cxx.
int cluster::BlurredClusteringAlg::GlobalWire | ( | geo::WireID const & | wireID | ) | const |
Find the global wire position.
Definition at line 378 of file BlurredClusteringAlg.cxx.
TH2F * cluster::BlurredClusteringAlg::MakeHistogram | ( | std::vector< std::vector< double >> const & | image, |
TString | name | ||
) | const |
Converts a 2D vector in a histogram for the debug pdf.
Definition at line 498 of file BlurredClusteringAlg.cxx.
|
private |
Makes all the kernels which could be required given the tuned parameters.
Definition at line 725 of file BlurredClusteringAlg.cxx.
|
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 763 of file BlurredClusteringAlg.cxx.
|
private |
Determine if a hit is within a time threshold of any other hits in a cluster.
Definition at line 790 of file BlurredClusteringAlg.cxx.
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 525 of file BlurredClusteringAlg.cxx.
void cluster::BlurredClusteringAlg::SaveImage | ( | TH2F * | image, |
int | pad, | ||
int | tpc, | ||
int | plane | ||
) |
Save the images for debugging.
Definition at line 555 of file BlurredClusteringAlg.cxx.
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 562 of file BlurredClusteringAlg.cxx.
|
private |
Definition at line 163 of file BlurredClusteringAlg.h.
|
private |
Definition at line 148 of file BlurredClusteringAlg.h.
|
private |
Definition at line 147 of file BlurredClusteringAlg.h.
|
private |
Definition at line 178 of file BlurredClusteringAlg.h.
|
private |
Definition at line 159 of file BlurredClusteringAlg.h.
|
private |
Definition at line 153 of file BlurredClusteringAlg.h.
|
private |
Definition at line 152 of file BlurredClusteringAlg.h.
|
private |
Definition at line 167 of file BlurredClusteringAlg.h.
|
private |
Definition at line 143 of file BlurredClusteringAlg.h.
|
private |
Definition at line 173 of file BlurredClusteringAlg.h.
|
private |
Definition at line 174 of file BlurredClusteringAlg.h.
|
private |
Definition at line 144 of file BlurredClusteringAlg.h.
|
private |
Definition at line 177 of file BlurredClusteringAlg.h.
|
private |
Definition at line 166 of file BlurredClusteringAlg.h.
|
private |
Definition at line 162 of file BlurredClusteringAlg.h.
|
private |
Definition at line 162 of file BlurredClusteringAlg.h.
|
private |
Definition at line 169 of file BlurredClusteringAlg.h.
|
private |
Definition at line 170 of file BlurredClusteringAlg.h.
|
private |
Definition at line 151 of file BlurredClusteringAlg.h.
|
private |
Definition at line 155 of file BlurredClusteringAlg.h.
|
private |
Definition at line 157 of file BlurredClusteringAlg.h.
|
private |
Definition at line 156 of file BlurredClusteringAlg.h.
|
private |
Definition at line 154 of file BlurredClusteringAlg.h.
|
private |
Definition at line 150 of file BlurredClusteringAlg.h.
|
private |
Definition at line 149 of file BlurredClusteringAlg.h.
|
private |
Definition at line 158 of file BlurredClusteringAlg.h.
|
private |
Definition at line 169 of file BlurredClusteringAlg.h.
|
private |
Definition at line 170 of file BlurredClusteringAlg.h.