Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
StandardPandora_module.cc
Go to the documentation of this file.
1
7#include "art/Framework/Core/ModuleMacros.h"
8
10
11#include <string>
12
13namespace lar_pandora {
14
18 class StandardPandora : public LArPandora {
19 public:
25 StandardPandora(fhicl::ParameterSet const& pset);
26
31
32 private:
38
44 void ProvideExternalSteeringParameters(const pandora::Pandora* const pPandora) const;
45 };
46
47 DEFINE_ART_MODULE(StandardPandora)
48
49} // namespace lar_pandora
50
51//------------------------------------------------------------------------------------------------------------------------------------------
52// implementation follows
53
54#include "cetlib_except/exception.h"
55
56#include "Api/PandoraApi.h"
57
63
64#ifdef LIBTORCH_DL
66#endif
67
68namespace lar_pandora {
69
70 StandardPandora::StandardPandora(fhicl::ParameterSet const& pset) : LArPandora(pset) {}
71
72 //------------------------------------------------------------------------------------------------------------------------------------------
73
75
76 //------------------------------------------------------------------------------------------------------------------------------------------
77
79 {
82 pandora::STATUS_CODE_SUCCESS, !=, LArContent::RegisterAlgorithms(*m_pPrimaryPandora));
83#ifdef LIBTORCH_DL
85 pandora::STATUS_CODE_SUCCESS, !=, LArDLContent::RegisterAlgorithms(*m_pPrimaryPandora));
86#endif
88 pandora::STATUS_CODE_SUCCESS, !=, LArContent::RegisterBasicPlugins(*m_pPrimaryPandora));
89
90 // ATTN Potentially ill defined, unless coordinate system set up to ensure that all drift volumes have same wire angles and pitches
92 pandora::STATUS_CODE_SUCCESS,
93 !=,
96 pandora::STATUS_CODE_SUCCESS,
97 !=,
100
102 }
103
104 //------------------------------------------------------------------------------------------------------------------------------------------
105
107 {
108 cet::search_path sp("FW_SEARCH_PATH");
109 std::string fullConfigFileName;
110
111 if (!sp.find_file(m_configFile, fullConfigFileName))
112 throw cet::exception("StandardPandora")
113 << " ConfigurePrimaryPandoraInstance - Failed to find xml configuration file "
114 << m_configFile << " in FW search path";
115
117 PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS,
118 !=,
119 PandoraApi::ReadSettings(*m_pPrimaryPandora, fullConfigFileName));
120 }
121
122 //------------------------------------------------------------------------------------------------------------------------------------------
123
125 {
127 pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::ProcessEvent(*m_pPrimaryPandora));
128 }
129
130 //------------------------------------------------------------------------------------------------------------------------------------------
131
133 {
135 pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::Reset(*m_pPrimaryPandora));
136 }
137
138 //------------------------------------------------------------------------------------------------------------------------------------------
139
144
145 //------------------------------------------------------------------------------------------------------------------------------------------
146
148 const pandora::Pandora* const pPandora) const
149 {
150 auto* const pEventSteeringParameters =
153 pEventSteeringParameters->m_shouldRunStitching = m_shouldRunStitching;
154 pEventSteeringParameters->m_shouldRunCosmicHitRemoval = m_shouldRunCosmicHitRemoval;
155 pEventSteeringParameters->m_shouldRunSlicing = m_shouldRunSlicing;
156 pEventSteeringParameters->m_shouldRunNeutrinoRecoOption = m_shouldRunNeutrinoRecoOption;
157 pEventSteeringParameters->m_shouldRunCosmicRecoOption = m_shouldRunCosmicRecoOption;
158 pEventSteeringParameters->m_shouldPerformSliceId = m_shouldPerformSliceId;
159 pEventSteeringParameters->m_printOverallRecoStatus = m_printOverallRecoStatus;
160 PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS,
161 !=,
163 *pPandora, "LArMaster", pEventSteeringParameters));
164
165#ifdef LIBTORCH_DL
166 auto* const pEventSettingsParametersCopy =
168 PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS,
169 !=,
171 *pPandora, "LArDLMaster", pEventSettingsParametersCopy));
172#endif
173 }
174
175} // namespace lar_pandora
Header file detailing content for use with particle flow reconstruction at liquid argon time projecti...
Header file detailing content for use with particle flow reconstruction at liquid argon time projecti...
Base producer module for reconstructing recob::PFParticles from recob::Hits.
Header file for the lar pseudo layer plugin class.
Header file for the rotational transformation plugin class.
Header file for the master algorithm class.
Header file for the MultiPandoraApi class.
Header file for the pandora api class.
#define PANDORA_THROW_RESULT_IF(StatusCode1, Operator, Command)
Definition StatusCodes.h:43
static pandora::StatusCode RegisterAlgorithms(const pandora::Pandora &pandora)
Register all the lar content algorithms and tools with pandora.
static pandora::StatusCode RegisterBasicPlugins(const pandora::Pandora &pandora)
Register the basic lar content plugins with pandora.
static pandora::StatusCode RegisterAlgorithms(const pandora::Pandora &pandora)
Register all the lar dl content algorithms and tools with pandora.
static void DeletePandoraInstances(const pandora::Pandora *const pPrimaryPandora)
Delete all pandora instances associated with (and including) a specified primary pandora instance.
static void AddPrimaryPandoraInstance(const pandora::Pandora *const pPrimaryPandora)
Declare a new primary pandora instance and receive the relevant multi pandora book-keeping instance.
static pandora::StatusCode ReadSettings(const pandora::Pandora &pandora, const std::string &xmlFileName)
Read pandora settings.
Definition PandoraApi.cc:21
static pandora::StatusCode ProcessEvent(const pandora::Pandora &pandora)
Process an event.
Definition PandoraApi.cc:14
static pandora::StatusCode Reset(const pandora::Pandora &pandora)
Reset pandora to process another event.
static pandora::StatusCode SetLArTransformationPlugin(const pandora::Pandora &pandora, pandora::LArTransformationPlugin *const pLArTransformationPlugin)
Set the lar transformation plugin used by pandora.
static pandora::StatusCode SetPseudoLayerPlugin(const pandora::Pandora &pandora, pandora::PseudoLayerPlugin *const pPseudoLayerPlugin)
Set the pseudo layer plugin used by pandora.
LarPandoraPseudoLayerPlugin class.
pandora::InputBool m_shouldRunAllHitsCosmicReco
Whether to run all hits cosmic-ray reconstruction.
const pandora::Pandora * m_pPrimaryPandora
The address of the primary pandora instance.
Definition ILArPandora.h:85
LArPandora class.
Definition LArPandora.h:24
bool m_printOverallRecoStatus
Steering: whether to print current operation status messages.
Definition LArPandora.h:58
std::string m_configFile
The config file.
Definition LArPandora.h:42
bool m_shouldRunCosmicRecoOption
Steering: whether to run cosmic-ray reconstruction for each slice.
Definition LArPandora.h:54
bool m_shouldRunSlicing
Steering: whether to slice events into separate regions for processing.
Definition LArPandora.h:50
bool m_shouldRunAllHitsCosmicReco
Steering: whether to run all hits cosmic-ray reconstruction.
Definition LArPandora.h:45
bool m_shouldRunNeutrinoRecoOption
Steering: whether to run neutrino reconstruction for each slice.
Definition LArPandora.h:52
bool m_shouldRunCosmicHitRemoval
Steering: whether to remove hits from tagged cosmic-rays.
Definition LArPandora.h:48
bool m_shouldPerformSliceId
Steering: whether to identify slices and select most appropriate pfos.
Definition LArPandora.h:56
bool m_shouldRunStitching
Steering: whether to stitch cosmic-ray muons crossing between volumes.
Definition LArPandora.h:47
void CreatePandoraInstances()
Create pandora instances.
void DeletePandoraInstances()
Delete pandora instances.
void ConfigurePandoraInstances()
Configure pandora instances.
void ProvideExternalSteeringParameters(const pandora::Pandora *const pPandora) const
Pass external steering parameters, read from fhicl parameter set, to LArMaster Pandora algorithm.
StandardPandora(fhicl::ParameterSet const &pset)
Constructor.
void RunPandoraInstances()
Run all associated pandora instances.
void ResetPandoraInstances()
Reset all associated pandora instances.
static StatusCode SetExternalParameters(const Pandora &pandora, const std::string &algorithmType, ExternalParameters *const pExternalParameters)
Set the external parameters associated with an algorithm instance of a specific type,...
Pandora class.
Definition Pandora.h:40