12 #ifndef BlurredClustering_h 13 #define BlurredClustering_h 27 #include "larevt/CalibrationDBI/Interface/ChannelStatusService.h" 28 #include "larevt/CalibrationDBI/Interface/ChannelStatusProvider.h" 47 #include <TVirtualPad.h> 52 #include <TPrincipal.h> 67 class BlurredClusteringAlg;
81 std::vector<std::vector<int>>
const& allClusterBins,
107 void SaveImage(TH2F* image,
int pad,
int tpc,
int plane);
111 void SaveImage(TH2F* image,
std::vector<std::vector<int>>
const& allClusterBins,
int pad,
int tpc,
int plane);
129 std::pair<int, int>
DeadWireCount(
int wire_bin,
int width)
const;
138 std::vector<std::vector<std::vector<double>>>
MakeKernels()
const;
141 unsigned int NumNeighbours(
int nx, std::vector<bool>
const& used,
int bin)
const;
144 bool PassesTimeCut(std::vector<double>
const& times,
double time)
const;
169 std::vector<std::vector<art::Ptr<recob::Hit>>>
fHitMap;
unsigned int fNeighboursThreshold
BlurredClusteringAlg(fhicl::ParameterSet const &pset)
Utilities related to art service access.
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::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...
std::array< int, 4 > FindBlurringParameters() const
Dynamically find the blurring radii and Gaussian sigma in each dimension.
std::string fDebugPDFName
Cluster finding and building.
art::ServiceHandle< geo::Geometry > fGeom
std::vector< bool > fDeadWires
int FindClusters(std::vector< std::vector< double >> const &image, std::vector< std::vector< int >> &allcluster)
Find clusters in the histogram.
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...
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.
Provides recob::Track data product.
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.
TH2F * MakeHistogram(std::vector< std::vector< double >> const &image, TString name)
Converts a 2D vector in a histogram for the debug pdf.
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...
void SaveImage(TH2F *image, std::vector< art::PtrVector< recob::Hit >> const &allClusters, int pad, int tpc, int plane)
unsigned int fMinNeighbours
Encapsulate the geometry of a wire.
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...
Encapsulate the construction of a single detector plane.
std::vector< std::vector< double > > GaussianBlur(std::vector< std::vector< double >> const &image)
Applies Gaussian blur to image.
std::vector< std::vector< std::vector< double > > > fAllKernels
lariov::ChannelStatusProvider const & fChanStatus
detinfo::DetectorProperties const * fDetProp
art framework interface to geometry description
unsigned int GetMinSize() const noexcept
Minimum size of cluster to save.
Event finding and building.
int GlobalWire(geo::WireID const &wireID)
Find the global wire position.