Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
garsoft
RecoAlg
KNNClusterAlg.h
Go to the documentation of this file.
1
//
2
// KNNClusterAlg.h
3
//
4
// Created by Eldwan Brianne on 17.04.2019
5
// Based on MarlinReco simple clusetring algo
6
// https://github.com/iLCSoft/MarlinReco/blob/master/Clustering/NNClustering/include/NNClusterProcessor.h
7
//
8
// Modificaiton: Addition of usesTracks, Leo Bellantoni 21 Jun2019
9
// If we have more clustering algorithms someday, this should be derived from
10
// some class with a bunch of virtual methods or some sort of thing like that.
11
12
13
#ifndef GAR_RECOALG_KNNClusterAlg_h
14
#define GAR_RECOALG_KNNClusterAlg_h
15
16
#include "
art/Framework/Core/ModuleMacros.h
"
17
#include "Geometry/GeometryCore.h"
18
19
#include "
ReconstructionDataProducts/CaloHit.h
"
20
#include "
ReconstructionDataProducts/Cluster.h
"
21
#include "
ReconstructionDataProducts/Track.h
"
22
23
#include <list>
24
#include <map>
25
#include <unordered_map>
26
#include <unordered_set>
27
28
namespace
fhicl
{
29
class
ParameterSet;
30
}
31
32
namespace
gar
{
33
namespace
rec
{
34
namespace
alg{
35
36
typedef
std::vector<gar::rec::CaloHit*>
CaloHitVec
;
37
typedef
std::vector<gar::rec::Track*>
TrackVec
;
38
typedef
std::vector<gar::rec::Cluster*>
ClusterVec
;
39
40
class
KNNClusterAlg
{
41
public
:
42
43
KNNClusterAlg
(
fhicl::ParameterSet
const
& pset);
44
45
virtual
~
KNNClusterAlg
();
46
47
void
reconfigure
(
fhicl::ParameterSet
const
& pset);
48
49
bool
usesTracks
() {
return
false
;}
50
51
void
PrepareAlgo(
const
std::vector
<
art::Ptr<gar::rec::Track>
> &trkVector,
const
std::vector
<
art::Ptr<gar::rec::CaloHit>
> &hitVector, std::unordered_map<
const
gar::rec::Track
*,
art::Ptr<gar::rec::Track>
> &trkMaptoArtPtr, std::unordered_map<
const
gar::rec::CaloHit
*,
art::Ptr<gar::rec::CaloHit>
> &hitMaptoArtPtr);
52
53
void
DoClustering();
54
55
ClusterVec
GetFoundClusters
()
const
{
return
clusterVector; }
56
57
private
:
58
59
void
ClearLists();
60
61
gar::geo::GeometryCore
const
*
fGeo
;
///< geometry information
62
63
std::string
fClusterAlgName
;
64
float
m_EnergyCut
;
65
float
m_DistanceCut
;
66
67
CaloHitVec
m_CaloHitVec
;
68
TrackVec
m_TrackVec
;
69
ClusterVec
clusterVector
;
70
};
71
72
}
// namespace alg
73
}
// namespace rec
74
}
//namespace gar
75
76
#endif
/* GAR_RECOALG_KNNClusterAlg_h */
gar::rec::alg::KNNClusterAlg::m_EnergyCut
float m_EnergyCut
Definition:
KNNClusterAlg.h:64
tracks.rec
rec
Definition:
tracks.py:88
string
std::string string
Definition:
nybbler.cc:12
gar::rec::alg::CaloHitVec
std::vector< gar::rec::CaloHit * > CaloHitVec
Definition:
KNNClusterAlg.h:36
gar::rec::alg::KNNClusterAlg::m_CaloHitVec
CaloHitVec m_CaloHitVec
Definition:
KNNClusterAlg.h:67
CaloHit.h
vector
struct vector vector
gar::rec::alg::KNNClusterAlg::m_TrackVec
TrackVec m_TrackVec
Definition:
KNNClusterAlg.h:68
Track.h
gar::geo::GeometryCore
Description of geometry of one entire detector.
Definition:
GeometryCore.h:436
Cluster.h
gar::rec::alg::KNNClusterAlg::clusterVector
ClusterVec clusterVector
Definition:
KNNClusterAlg.h:69
gar::rec::alg::TrackVec
std::vector< gar::rec::Track * > TrackVec
Definition:
KNNClusterAlg.h:37
gar::rec::alg::KNNClusterAlg::fGeo
gar::geo::GeometryCore const * fGeo
geometry information
Definition:
KNNClusterAlg.h:61
RunHistoryService::reconfigure
virtual void reconfigure(fhicl::ParameterSet const &pset)
fhicl
Definition:
InputSourceFactory.h:7
gar::rec::alg::KNNClusterAlg::m_DistanceCut
float m_DistanceCut
Definition:
KNNClusterAlg.h:65
ModuleMacros.h
gar::rec::Track
Definition:
Track.h:37
gar::rec::alg::KNNClusterAlg::GetFoundClusters
ClusterVec GetFoundClusters() const
Definition:
KNNClusterAlg.h:55
gar
General GArSoft Utilities.
Definition:
anatest_module.cc:57
gar::rec::CaloHit
Definition:
CaloHit.h:21
gar::rec::alg::ClusterVec
std::vector< gar::rec::Cluster * > ClusterVec
Definition:
KNNClusterAlg.h:38
gar::rec::alg::KNNClusterAlg::fClusterAlgName
std::string fClusterAlgName
Definition:
KNNClusterAlg.h:63
gar::rec::alg::KNNClusterAlg::usesTracks
bool usesTracks()
Definition:
KNNClusterAlg.h:49
art::Ptr< gar::rec::Track >
gar::rec::alg::KNNClusterAlg
Definition:
KNNClusterAlg.h:40
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11