LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
StandardPandora_module.cc
Go to the documentation of this file.
1 
8 
10 
11 #include <string>
12 
13 namespace lar_pandora
14 {
15 
20 {
21 public:
28 
33 
34 private:
37  void RunPandoraInstances();
38  void ResetPandoraInstances();
40 
46  void ProvideExternalSteeringParameters(const pandora::Pandora *const pPandora) const;
47 };
48 
50 
51 } // namespace lar_pandora
52 
53 //------------------------------------------------------------------------------------------------------------------------------------------
54 // implementation follows
55 
56 #include "cetlib_except/exception.h"
57 
58 #include "Api/PandoraApi.h"
59 
65 
66 #include <iostream>
67 
68 namespace lar_pandora
69 {
70 
72  LArPandora(pset)
73 {
74 }
75 
76 //------------------------------------------------------------------------------------------------------------------------------------------
77 
79 {
80  this->DeletePandoraInstances();
81 }
82 
83 //------------------------------------------------------------------------------------------------------------------------------------------
84 
86 {
87  m_pPrimaryPandora = new pandora::Pandora();
88  PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, LArContent::RegisterAlgorithms(*m_pPrimaryPandora));
89  PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, LArContent::RegisterBasicPlugins(*m_pPrimaryPandora));
90 
91  // ATTN Potentially ill defined, unless coordinate system set up to ensure that all drift volumes have same wire angles and pitches
92  PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::SetPseudoLayerPlugin(*m_pPrimaryPandora, new lar_content::LArPseudoLayerPlugin));
93  PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::SetLArTransformationPlugin(*m_pPrimaryPandora, new lar_content::LArRotationalTransformationPlugin));
94 
96 }
97 
98 //------------------------------------------------------------------------------------------------------------------------------------------
99 
101 {
102  cet::search_path sp("FW_SEARCH_PATH");
103  std::string fullConfigFileName;
104 
105  if (!sp.find_file(m_configFile, fullConfigFileName))
106  throw cet::exception("StandardPandora") << " ConfigurePrimaryPandoraInstance - Failed to find xml configuration file " << m_configFile << " in FW search path";
107 
109  PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::ReadSettings(*m_pPrimaryPandora, fullConfigFileName));
110 }
111 
112 //------------------------------------------------------------------------------------------------------------------------------------------
113 
115 {
116  PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::ProcessEvent(*m_pPrimaryPandora));
117 }
118 
119 //------------------------------------------------------------------------------------------------------------------------------------------
120 
122 {
123  PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::Reset(*m_pPrimaryPandora));
124 }
125 
126 //------------------------------------------------------------------------------------------------------------------------------------------
127 
129 {
131 }
132 
133 //------------------------------------------------------------------------------------------------------------------------------------------
134 
135 void StandardPandora::ProvideExternalSteeringParameters(const pandora::Pandora *const pPandora) const
136 {
137  auto *const pEventSteeringParameters = new lar_content::MasterAlgorithm::ExternalSteeringParameters;
139  pEventSteeringParameters->m_shouldRunStitching = m_shouldRunStitching;
140  pEventSteeringParameters->m_shouldRunCosmicHitRemoval = m_shouldRunCosmicHitRemoval;
141  pEventSteeringParameters->m_shouldRunSlicing = m_shouldRunSlicing;
142  pEventSteeringParameters->m_shouldRunNeutrinoRecoOption = m_shouldRunNeutrinoRecoOption;
143  pEventSteeringParameters->m_shouldRunCosmicRecoOption = m_shouldRunCosmicRecoOption;
144  pEventSteeringParameters->m_shouldPerformSliceId = m_shouldPerformSliceId;
145  pEventSteeringParameters->m_printOverallRecoStatus = m_printOverallRecoStatus;
146  PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, pandora::ExternallyConfiguredAlgorithm::SetExternalParameters(*pPandora, "LArMaster", pEventSteeringParameters));
147 }
148 
149 } // namespace lar_pandora
void ProvideExternalSteeringParameters(const pandora::Pandora *const pPandora) const
Pass external steering parameters, read from fhicl parameter set, to LArMaster Pandora algorithm...
void DeletePandoraInstances()
Delete pandora instances.
Base producer module for reconstructing recob::PFParticles from recob::Hits.
static void DeletePandoraInstances(const pandora::Pandora *const pPrimaryPandora)
Delete all pandora instances associated with (and including) a specified primary pandora instance...
bool m_shouldRunAllHitsCosmicReco
Steering: whether to run all hits cosmic-ray reconstruction.
Definition: LArPandora.h:41
void ProcessEvent(G4int iProp, size_t nEv)
Definition: errprop.cc:172
bool m_shouldRunCosmicHitRemoval
Steering: whether to remove hits from tagged cosmic-rays.
Definition: LArPandora.h:43
pandora::InputBool m_shouldRunAllHitsCosmicReco
Whether to run all hits cosmic-ray reconstruction.
bool m_shouldRunNeutrinoRecoOption
Steering: whether to run neutrino reconstruction for each slice.
Definition: LArPandora.h:45
const pandora::Pandora * m_pPrimaryPandora
The address of the primary pandora instance.
Definition: ILArPandora.h:82
void ResetPandoraInstances()
Reset all associated pandora instances.
void RunPandoraInstances()
Run all associated pandora instances.
Header file for the master algorithm class.
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:42
bool m_printOverallRecoStatus
Steering: whether to print current operation status messages.
Definition: LArPandora.h:48
static void AddPrimaryPandoraInstance(const pandora::Pandora *const pPrimaryPandora)
Declare a new primary pandora instance and receive the relevant multi pandora book-keeping instance...
ntupleExperimental Reset()
static pandora::StatusCode RegisterBasicPlugins(const pandora::Pandora &pandora)
Register the basic lar content plugins with pandora.
Definition: LArContent.cc:388
Header file for the rotational transformation plugin class.
Header file for the MultiPandoraApi class.
bool m_shouldRunCosmicRecoOption
Steering: whether to run cosmic-ray reconstruction for each slice.
Definition: LArPandora.h:46
std::string m_configFile
The config file.
Definition: LArPandora.h:39
static pandora::StatusCode RegisterAlgorithms(const pandora::Pandora &pandora)
Register all the lar content algorithms and tools with pandora.
Definition: LArContent.cc:372
bool m_shouldRunStitching
Steering: whether to stitch cosmic-ray muons crossing between volumes.
Definition: LArPandora.h:42
void ConfigurePandoraInstances()
Configure pandora instances.
void CreatePandoraInstances()
Create pandora instances.
Header file detailing content for use with particle flow reconstruction at liquid argon time projecti...
bool m_shouldRunSlicing
Steering: whether to slice events into separate regions for processing.
Definition: LArPandora.h:44
Header file for the lar pseudo layer plugin class.
LArPandora class.
Definition: LArPandora.h:25
StandardPandora(fhicl::ParameterSet const &pset)
Constructor.
bool m_shouldPerformSliceId
Steering: whether to identify slices and select most appropriate pfos.
Definition: LArPandora.h:47
LarPandoraPseudoLayerPlugin class.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33