12 #ifndef BlurredClustering_h
13 #define BlurredClustering_h
16 #include "art/Framework/Services/Registry/ServiceHandle.h"
17 #include "canvas/Persistency/Common/Ptr.h"
18 #include "canvas/Persistency/Common/PtrVector.h"
25 class DetectorProperties;
31 class ChannelStatusProvider;
48 class BlurredClusteringAlg;
61 std::vector<std::vector<int>>
const& allClusterBins,
62 std::vector<art::PtrVector<recob::Hit>>& clusters)
const;
67 int readoutWindowSize);
78 std::vector<std::vector<double>>
const& image)
const;
93 std::vector<art::PtrVector<recob::Hit>>
const& allClusters,
99 void SaveImage(TH2F* image,
int pad,
int tpc,
int plane);
104 std::vector<std::vector<int>>
const& allClusterBins,
112 std::vector<int>
const& bins)
const;
126 std::pair<int, int>
DeadWireCount(
int wire_bin,
int width)
const;
135 std::vector<std::vector<std::vector<double>>>
MakeKernels()
const;
138 unsigned int NumNeighbours(
int nx, std::vector<bool>
const& used,
int bin)
const;
141 bool PassesTimeCut(std::vector<double>
const& times,
double time)
const;
166 std::vector<std::vector<art::Ptr<recob::Hit>>>
fHitMap;
177 art::ServiceHandle<geo::Geometry const>
fGeom;
179 art::ServiceHandle<lariov::ChannelStatusService const>()->GetProvider()};
unsigned int fNeighboursThreshold
BlurredClusteringAlg(fhicl::ParameterSet const &pset)
TH2F * MakeHistogram(std::vector< std::vector< double >> const &image, TString name) const
Converts a 2D vector in a histogram for the debug pdf.
std::vector< std::vector< art::Ptr< recob::Hit > > > fHitMap
std::vector< std::vector< std::vector< double > > > MakeKernels() const
Makes all the kernels which could be required given the tuned parameters.
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 ×, double time) const
Determine if a hit is within a time threshold of any other hits in a cluster.
Declaration of signal hit object.
unsigned int NumNeighbours(int nx, std::vector< bool > const &used, int bin) const
Determines the number of clustered neighbours of a hit.
std::array< int, 4 > FindBlurringParameters() const
Dynamically find the blurring radii and Gaussian sigma in each dimension.
std::string fDebugPDFName
std::vector< bool > fDeadWires
int FindClusters(std::vector< std::vector< double >> const &image, std::vector< std::vector< int >> &allcluster) const
Find clusters in the histogram.
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
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...
unsigned int GetMinSize() const noexcept
Minimum size of cluster to save.
void CreateDebugPDF(int run, int subrun, int event)
Create the PDF to save debug images.
std::pair< int, int > DeadWireCount(int wire_bin, int width) const
double ConvertBinToCharge(std::vector< std::vector< double >> const &image, int bin) const
Returns the charge stored in the global bin value.
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
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.
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...
int GlobalWire(geo::WireID const &wireID) const
Find the global wire position.
std::vector< std::vector< double > > GaussianBlur(std::vector< std::vector< double >> const &image) const
Applies Gaussian blur to image.
void SaveImage(TH2F *image, std::vector< art::PtrVector< recob::Hit >> const &allClusters, int pad, int tpc, int plane)
Class providing information about the quality of channels.
unsigned int fMinNeighbours
art::ServiceHandle< geo::Geometry const > fGeom
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 h...
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...
std::vector< std::vector< std::vector< double > > > fAllKernels
Interface for experiment-specific service for channel quality info.
lariov::ChannelStatusProvider const & fChanStatus
art framework interface to geometry description