-
Notifications
You must be signed in to change notification settings - Fork 6
/
LArNDContent.cc
100 lines (81 loc) · 6.39 KB
/
LArNDContent.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/**
* @file src/LArNDContent.cc
*
* @brief Factory implementations for content intended for use with particle flow reconstruction at liquid argon time projection chambers
*
* $Log: $
*/
#include "Api/PandoraApi.h"
#include "Pandora/Algorithm.h"
#include "Pandora/AlgorithmTool.h"
#include "Pandora/Pandora.h"
#include "CandidateVertexCreationThreeDAlgorithm.h"
#include "CreateTwoDClustersFromThreeDAlgorithm.h"
#include "CutClusterCharacterisationThreeDAlgorithm.h"
#include "EventSlicingThreeDTool.h"
#include "HierarchyAnalysisAlgorithm.h"
#include "LArNDContent.h"
#include "MasterThreeDAlgorithm.h"
#include "MergeClearTracksThreeDAlgorithm.h"
#include "PfoThreeDHitAssignmentAlgorithm.h"
#include "PreProcessingThreeDAlgorithm.h"
#include "ReplaceHitAndClusterListsAlgorithm.h"
#include "SimpleClusterCreationThreeDAlgorithm.h"
#include "SlicingThreeDAlgorithm.h"
// clang-format off
#define LAR_ND_ALGORITHM_LIST(d) \
d("LArMasterThreeD", MasterThreeDAlgorithm) \
d("LArMergeClearTracksThreeD", MergeClearTracksThreeDAlgorithm) \
d("LArSimpleClusterCreationThreeD", SimpleClusterCreationThreeDAlgorithm) \
d("LArCreateTwoDClustersFromThreeD", CreateTwoDClustersFromThreeDAlgorithm) \
d("LArSlicingThreeD", SlicingThreeDAlgorithm) \
d("LArPfoThreeDHitAssignment", PfoThreeDHitAssignmentAlgorithm) \
d("LArReplaceHitAndClusterLists", ReplaceHitAndClusterListsAlgorithm) \
d("LArPreProcessingThreeD", PreProcessingThreeDAlgorithm) \
d("LArCutClusterCharacterisationThreeD", CutClusterCharacterisationThreeDAlgorithm) \
d("LArCandidateVertexCreationThreeD", CandidateVertexCreationThreeDAlgorithm) \
d("LArHierarchyAnalysis", HierarchyAnalysisAlgorithm)
#define LAR_ND_ALGORITHM_TOOL_LIST(d) \
d("LArEventSlicingThreeD", EventSlicingThreeDTool) \
#define FACTORY Factory
//------------------------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------------------------
namespace lar_content
{
#define LAR_ND_CONTENT_CREATE_ALGORITHM_FACTORY(a, b) \
class b##FACTORY : public pandora::AlgorithmFactory \
{ \
public: \
pandora::Algorithm *CreateAlgorithm() const {return new b;}; \
};
LAR_ND_ALGORITHM_LIST(LAR_ND_CONTENT_CREATE_ALGORITHM_FACTORY)
//------------------------------------------------------------------------------------------------------------------------------------------
#define LAR_ND_CONTENT_CREATE_ALGORITHM_TOOL_FACTORY(a, b) \
class b##FACTORY : public pandora::AlgorithmToolFactory \
{ \
public: \
pandora::AlgorithmTool *CreateAlgorithmTool() const {return new b;}; \
};
LAR_ND_ALGORITHM_TOOL_LIST(LAR_ND_CONTENT_CREATE_ALGORITHM_TOOL_FACTORY)
} // namespace lar_content
//------------------------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------------------------
#define LAR_ND_CONTENT_REGISTER_ALGORITHM(a, b) \
{ \
const pandora::StatusCode statusCode(PandoraApi::RegisterAlgorithmFactory(pandora, a, new lar_content::b##FACTORY)); \
if (pandora::STATUS_CODE_SUCCESS != statusCode) \
return statusCode; \
}
#define LAR_ND_CONTENT_REGISTER_ALGORITHM_TOOL(a, b) \
{ \
const pandora::StatusCode statusCode(PandoraApi::RegisterAlgorithmToolFactory(pandora, a, new lar_content::b##FACTORY)); \
if (pandora::STATUS_CODE_SUCCESS != statusCode) \
return statusCode; \
}
pandora::StatusCode LArNDContent::RegisterAlgorithms(const pandora::Pandora &pandora)
{
LAR_ND_ALGORITHM_LIST(LAR_ND_CONTENT_REGISTER_ALGORITHM);
LAR_ND_ALGORITHM_TOOL_LIST(LAR_ND_CONTENT_REGISTER_ALGORITHM_TOOL);
return pandora::STATUS_CODE_SUCCESS;
}
// clang-format on