51 class BlurredClustering;
75 std::unique_ptr<std::vector<recob::Cluster> >
clusters;
76 std::unique_ptr<art::Assns<recob::Cluster,recob::Hit> >
associations;
84 produces<std::vector<recob::Cluster> >();
85 produces<art::Assns<recob::Cluster,recob::Hit> >();
115 clusters.reset(
new std::vector<recob::Cluster>);
127 std::vector<art::Ptr<recob::Hit> >
hits;
128 std::vector<art::Ptr<recob::Hit> > hitsToCluster;
136 std::vector<art::Ptr<recob::Track> > tracks;
142 std::vector<art::Ptr<recob::SpacePoint> > spacePoints;
148 std::vector<art::Ptr<recob::Vertex> > vertices;
154 std::vector<art::Ptr<recob::PFParticle> > pfParticles;
160 if (trackCollection.
isValid()) {
190 hitsToCluster =
hits;
193 std::map<std::pair<int,int>,std::vector<art::Ptr<recob::Hit> > > planeToHits;
196 planeToHits[std::make_pair((*hitToCluster)->WireID().Plane,(*hitToCluster)->WireID().TPC%2)].push_back(*hitToCluster);
198 planeToHits[std::make_pair((*hitToCluster)->WireID().Plane,(*hitToCluster)->WireID().TPC)].push_back(*hitToCluster);
208 std::vector<art::PtrVector<recob::Hit> > finalClusters;
218 std::vector<std::vector<int> > allClusterBins;
220 mf::LogVerbatim(
"Blurred Clustering") <<
"Found " << numClusters <<
" clusters" << std::endl;
223 std::vector<art::PtrVector<recob::Hit> > planeClusters;
229 mf::LogVerbatim(
"Blurred Clustering") <<
"After merging, there are " << numMergedClusters <<
" clusters" << std::endl;
231 else finalClusters = planeClusters;
235 std::stringstream name;
236 name <<
"blurred_image";
238 name <<
"_convolved";
245 blurredHist->Delete();
256 if (clusterHits.
size() > 0) {
270 clusterHits.
front()->PeakTime(),
271 clusterHits.
front()->SigmaPeakTime(),
274 clusterHits.
back()->PeakTime(),
275 clusterHits.
back()->SigmaPeakTime(),
277 clusterHits.
front()->View(),
278 clusterHits.
front()->WireID().planeID(),
void SaveImage(TH2F *image, std::vector< art::PtrVector< recob::Hit > > const &allClusters, int pad, int tpc, int plane)
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
std::string fPFParticleModuleLabel
SubRunNumber_t subRun() const
int FindClusters(std::vector< std::vector< double > > const &image, std::vector< std::vector< int > > &allcluster)
Find clusters in the histogram.
Class managing the creation of a new recob::Cluster object.
std::vector< std::vector< double > > GaussianBlur(std::vector< std::vector< double > > const &image)
Applies Gaussian blur to image.
void reconfigure(fhicl::ParameterSet const &pset)
Read in configurable parameters from provided parameter set.
Encapsulate the construction of a single cyostat.
void reconfigure(fhicl::ParameterSet const &p)
Declaration of signal hit object.
int MergeClusters(std::vector< art::PtrVector< recob::Hit > > const &planeClusters, std::vector< art::PtrVector< recob::Hit > > &clusters)
cluster::MergeClusterAlg fMergeClusterAlg
std::vector< art::Ptr< recob::Hit > > SelectShowerHits(int event, const std::vector< art::Ptr< recob::Hit > > &hits, const std::vector< art::Ptr< recob::Track > > &tracks, const std::vector< art::Ptr< recob::SpacePoint > > &spacePoints, const art::FindManyP< recob::Hit > &fmht, const art::FindManyP< recob::Track > &fmth, const art::FindManyP< recob::SpacePoint > &fmspt, const art::FindManyP< recob::Track > &fmtsp)
Cluster finding and building.
static const SentryArgument_t Sentry
An instance of the sentry object.
void reconfigure(fhicl::ParameterSet const &p)
virtual ~BlurredClustering()
ProductID put(std::unique_ptr< PROD > &&product)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
void CreateDebugPDF(int run, int subrun, int event)
Create the PDF to save debug images.
#define DEFINE_ART_MODULE(klass)
BlurredClustering(fhicl::ParameterSet const &pset)
void reconfigure(fhicl::ParameterSet const &p)
std::unique_ptr< std::vector< recob::Cluster > > clusters
Helper functions to create a cluster.
Wrapper for ClusterParamsAlgBase objects to accept diverse input.
T get(std::string const &key) const
Wrapper for ClusterParamsAlgBase objects to accept arbitrary input.
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
EventNumber_t event() const
Declaration of cluster object.
std::string fHitsModuleLabel
Provides recob::Track data product.
shower::TrackShowerSeparationAlg fTrackShowerSeparationAlg
TH2F * MakeHistogram(std::vector< std::vector< double > > const &image, TString name)
Converts a 2D vector in a histogram for the debug pdf.
Utility object to perform functions of association.
cluster::BlurredClusteringAlg fBlurredClusteringAlg
Encapsulate the construction of a single detector plane.
std::string fTrackModuleLabel
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
void ImportHits(Iter begin, Iter end)
Calls SetHits() with the hits in the sequence.
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...
void produce(art::Event &evt)
std::string fVertexModuleLabel
Interface to class computing cluster parameters.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
std::unique_ptr< art::Assns< recob::Cluster, recob::Hit > > associations
void ConvertBinsToClusters(std::vector< std::vector< double > > const &image, std::vector< std::vector< int > > const &allClusterBins, std::vector< art::PtrVector< recob::Hit > > &clusters)
Takes a vector of clusters (itself a vector of hits) and turns them into clusters using the initial h...
unsigned int GetMinSize()
Minimum size of cluster to save.
art framework interface to geometry description
Encapsulate the construction of a single detector plane.
int GlobalWire(geo::WireID const &wireID)
Find the global wire position.