Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
larreco
larreco
RecoAlg
MergeClusterAlg.h
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////
2
// Merge Cluster algorithm
3
//
4
// Runs on the output of previous clustering algorithms to merge
5
// clusters together which lie on a straight line and are within
6
// some separation threshold.
7
// Runs recursively over all clusters, including new ones formed
8
// in the algorithm.
9
//
10
// M Wallbank (m.wallbank@sheffield.ac.uk), July 2015
11
////////////////////////////////////////////////////////////////////
12
13
#ifndef MergeCluster_h
14
#define MergeCluster_h
15
16
// Framework includes
17
#include "
art/Framework/Services/Registry/ServiceHandle.h
"
18
#include "art_root_io/TFileService.h"
19
#include "
canvas/Persistency/Common/Ptr.h
"
20
#include "
canvas/Persistency/Common/PtrVector.h
"
21
namespace
fhicl
{
class
ParameterSet; }
22
23
// LArSoft includes
24
#include "
lardataobj/RecoBase/Hit.h
"
25
#include "
larcorealg/Geometry/PlaneGeo.h
"
26
#include "
larcore/Geometry/Geometry.h
"
27
namespace
geo
{
struct
WireID
; }
28
29
//tmp
30
#include "
lardataobj/RecoBase/Hit.h
"
31
32
#include "TVector2.h"
33
class
TTree;
34
35
#include <vector>
36
#include <map>
37
38
namespace
cluster
{
39
class
MergeClusterAlg;
40
}
41
42
class
cluster::MergeClusterAlg
{
43
public
:
44
45
MergeClusterAlg
(
fhicl::ParameterSet
const
& pset);
46
47
void
FindClusterEndPoints(
art::PtrVector<recob::Hit>
const
&
cluster
, TVector2
const
& centre, TVector2
const
&
direction
, TVector2& start, TVector2&
end
)
const
;
48
double
FindClusterOverlap(TVector2
const
& direction, TVector2
const
& centre, TVector2
const
& start1, TVector2
const
& end1, TVector2
const
& start2, TVector2
const
& end2)
const
;
49
double
FindCrossingDistance(TVector2
const
&direction1, TVector2
const
¢re1, TVector2
const
&direction2, TVector2
const
¢re2)
const
;
50
double
FindMinSeparation(
art::PtrVector<recob::Hit>
const
&cluster1,
art::PtrVector<recob::Hit>
const
&cluster2)
const
;
51
double
FindProjectedWidth(TVector2
const
& centre1, TVector2
const
& start1, TVector2
const
& end1, TVector2
const
& centre2, TVector2
const
& start2, TVector2
const
& end2)
const
;
52
double
GlobalWire(
geo::WireID
const
& wireID)
const
;
53
TVector2 HitCoordinates(
art::Ptr<recob::Hit>
const
&
hit
)
const
;
54
int
MergeClusters(
std::vector
<
art::PtrVector<recob::Hit>
>
const
&planeClusters,
std::vector
<
art::PtrVector<recob::Hit>
> &clusters)
const
;
55
void
reconfigure
(
fhicl::ParameterSet
const
&
p
);
56
bool
PassCuts(
double
const
& angle,
double
const
& crossingDistance,
double
const
& projectedWidth,
double
const
& separation,
double
const
& overlap,
double
const
& longLength)
const
;
57
58
private
:
59
60
// Merging parameters
61
unsigned
int
fMinMergeClusterSize
;
// Minimum size of a cluster for it to be considered for merging
62
double
fMaxMergeSeparation
;
// Maximum separation of clusters for merging
63
double
fProjWidthThreshold
;
// Maximum projected width (width of a tube parallel to the line connecting centres of clusters which just encompasses the clusters) for merging
64
65
// Create geometry and detector property handle
66
art::ServiceHandle<geo::Geometry const>
fGeom
;
67
art::ServiceHandle<art::TFileService const>
tfs
;
68
69
std::map<int,int>
trueClusterMap
;
70
71
// Tree
72
TTree *
fTree
;
73
double
fAngle
;
74
double
fEigenvalue
;
75
int
fCluster1Size
;
76
int
fCluster2Size
;
77
double
fLength1
;
78
double
fLength2
;
79
double
fSeparation
;
80
double
fCrossingDistance
;
81
double
fProjectedWidth
;
82
double
fOverlap
;
83
bool
fTrueMerge
;
84
// bool fMerge;
85
86
};
87
88
#endif
ValidateOpDetReco.end
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
Definition:
ValidateOpDetReco.py:548
cluster::MergeClusterAlg::fCrossingDistance
double fCrossingDistance
Definition:
MergeClusterAlg.h:80
art::ServiceHandle< geo::Geometry const >
cluster::MergeClusterAlg::fCluster1Size
int fCluster1Size
Definition:
MergeClusterAlg.h:75
cluster::MergeClusterAlg::trueClusterMap
std::map< int, int > trueClusterMap
Definition:
MergeClusterAlg.h:69
cluster::MergeClusterAlg::fGeom
art::ServiceHandle< geo::Geometry const > fGeom
Definition:
MergeClusterAlg.h:66
cluster::MergeClusterAlg::tfs
art::ServiceHandle< art::TFileService const > tfs
Definition:
MergeClusterAlg.h:67
vector
struct vector vector
cluster::MergeClusterAlg
Definition:
MergeClusterAlg.h:42
cluster::MergeClusterAlg::fTrueMerge
bool fTrueMerge
Definition:
MergeClusterAlg.h:83
geo::WireID
Definition:
geo_types.h:560
PtrVector.h
cluster
Cluster finding and building.
Definition:
SmallClusterFilter_module.cc:34
cluster::MergeClusterAlg::fTree
TTree * fTree
Definition:
MergeClusterAlg.h:72
Geometry.h
art framework interface to geometry description
ServiceHandle.h
cluster::MergeClusterAlg::fEigenvalue
double fEigenvalue
Definition:
MergeClusterAlg.h:74
MakeVectorFile.direction
direction
Definition:
MakeVectorFile.py:80
geo::fhicl::WireID
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
Definition:
geo_types_fhicl.h:407
RunHistoryService::reconfigure
virtual void reconfigure(fhicl::ParameterSet const &pset)
fhicl
Definition:
InputSourceFactory.h:7
cluster::MergeClusterAlg::fOverlap
double fOverlap
Definition:
MergeClusterAlg.h:82
cluster::MergeClusterAlg::fProjWidthThreshold
double fProjWidthThreshold
Definition:
MergeClusterAlg.h:63
Ptr.h
test.p
p
Definition:
test.py:223
cluster::MergeClusterAlg::fLength1
double fLength1
Definition:
MergeClusterAlg.h:77
cluster::MergeClusterAlg::fProjectedWidth
double fProjectedWidth
Definition:
MergeClusterAlg.h:81
hit
Detector simulation of raw signals on wires.
Definition:
NumberOfHitsFilter_module.cc:25
Hit.h
Declaration of signal hit object.
cluster::MergeClusterAlg::fLength2
double fLength2
Definition:
MergeClusterAlg.h:78
cluster::MergeClusterAlg::fSeparation
double fSeparation
Definition:
MergeClusterAlg.h:79
PlaneGeo.h
Encapsulate the construction of a single detector plane.
art::PtrVector< recob::Hit >
cluster::MergeClusterAlg::fAngle
double fAngle
Definition:
MergeClusterAlg.h:73
cluster::MergeClusterAlg::fMinMergeClusterSize
unsigned int fMinMergeClusterSize
Definition:
MergeClusterAlg.h:61
geo
LArSoft geometry interface.
Definition:
ChannelGeo.h:16
art::Ptr< recob::Hit >
cluster::MergeClusterAlg::fMaxMergeSeparation
double fMaxMergeSeparation
Definition:
MergeClusterAlg.h:62
cluster::MergeClusterAlg::fCluster2Size
int fCluster2Size
Definition:
MergeClusterAlg.h:76
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11