28#include "TApplication.h"
38int main(
int argc,
char *argv[])
41 const Pandora *pPrimaryPandora(
nullptr);
51 TApplication *pTApplication =
new TApplication(
"LArReco", &argc, argv);
52 pTApplication->SetReturnFromRun(kTRUE);
63 std::cerr <<
"Pandora StatusCodeException: " << statusCodeException.
ToString() << statusCodeException.
GetBackTrace() << std::endl;
73 std::cerr <<
"Unknown exception: " << std::endl;
88 pPrimaryPandora =
new Pandora();
116 std::cout << std::endl <<
" PROCESSING EVENT: " << (nEvents - 1) << std::endl << std::endl;
131 std::string recoOption;
133 while ((c = getopt(argc, argv,
"r:i:e:g:n:s:pNh")) != -1)
174 std::cout << std::endl
175 <<
"./bin/PandoraInterface " << std::endl
176 <<
" -r RecoOption (required) [Full, AllHitsCR, AllHitsNu, CRRemHitsSliceCR, CRRemHitsSliceNu, AllHitsSliceCR, AllHitsSliceNu]"
178 <<
" -i Settings (required) [algorithm description: xml]" << std::endl
179 <<
" -e EventFileList (optional) [colon-separated list of files: xml/pndr]" << std::endl
180 <<
" -g GeometryFile (optional) [detector geometry description: xml/pndr]" << std::endl
181 <<
" -n NEventsToProcess (optional) [no. of events to process]" << std::endl
182 <<
" -s NEventsToSkip (optional) [no. of events to skip in first file]" << std::endl
183 <<
" -p (optional) [print status]" << std::endl
184 <<
" -N (optional) [print event numbers]" << std::endl
194 std::string chosenRecoOption(recoOption);
195 std::transform(chosenRecoOption.begin(), chosenRecoOption.end(), chosenRecoOption.begin(), ::tolower);
197 if (
"full" == chosenRecoOption)
207 else if (
"allhitscr" == chosenRecoOption)
217 else if (
"nostitchingcr" == chosenRecoOption)
227 else if (
"allhitsnu" == chosenRecoOption)
237 else if (
"crremhitsslicecr" == chosenRecoOption)
247 else if (
"crremhitsslicenu" == chosenRecoOption)
257 else if (
"allhitsslicecr" == chosenRecoOption)
267 else if (
"allhitsslicenu" == chosenRecoOption)
279 std::cout <<
"LArReco, Unrecognized reconstruction option: " << recoOption << std::endl << std::endl;
Header file for the event reading algorithm class.
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...
Header file for the pfo helper class.
Header file for the lar pseudo layer plugin class.
Header file for the master algorithm class.
Header file for the MultiPandoraApi class.
Header file for the pandora api class.
int main(int argc, char *argv[])
Header file for PandoraInterface.
#define PANDORA_THROW_RESULT_IF(StatusCode1, Operator, Command)
Header file for the xml helper class.
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.
static pandora::StatusCode ProcessEvent(const pandora::Pandora &pandora)
Process an event.
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 SetExternalParameters(const pandora::Pandora &pandora, const std::string &algorithmType, pandora::ExternalParameters *const pExternalParameters)
Set the external parameters associated with an algorithm instance of a specific type....
static pandora::StatusCode SetPseudoLayerPlugin(const pandora::Pandora &pandora, pandora::PseudoLayerPlugin *const pPseudoLayerPlugin)
Set the pseudo layer plugin used by pandora.
External event reading parameters class.
std::string m_geometryFileName
Name of the file containing geometry information.
LarPandoraPseudoLayerPlugin class.
LArRotationalTransformationPlugin class.
External steering parameters class.
pandora::InputBool m_shouldRunAllHitsCosmicReco
Whether to run all hits cosmic-ray reconstruction.
std::string m_eventFileNameList
Colon-separated list of file names to be processed.
int m_nEventsToProcess
The number of events to process (default all events in file)
bool m_shouldRunNeutrinoRecoOption
Whether to run neutrino reconstruction for each slice.
pandora::InputInt m_nEventsToSkip
The number of events to skip.
bool m_shouldRunCosmicRecoOption
Whether to run cosmic-ray reconstruction for each slice.
bool m_shouldRunCosmicHitRemoval
Whether to remove hits from tagged cosmic-rays.
std::string m_geometryFileName
Name of the file containing geometry information.
bool m_printOverallRecoStatus
Whether to print current operation status messages.
bool m_shouldPerformSliceId
Whether to identify slices and select most appropriate pfos.
bool m_shouldRunAllHitsCosmicReco
Whether to run all hits cosmic-ray reconstruction.
std::string m_settingsFile
The path to the pandora settings file (mandatory parameter)
bool m_shouldDisplayEventNumber
Whether event numbers should be displayed (default false)
bool m_shouldRunStitching
Whether to stitch cosmic-ray muons crossing between volumes.
bool m_shouldRunSlicing
Whether to slice events into separate regions for processing.
StatusCodeException class.
std::string ToString() const
Get status code as a string.
const std::string & GetBackTrace() const
Get back trace at point of exception construction (gcc only)
Stop processing exception class.
void ProcessExternalParameters(const Parameters ¶meters, const pandora::Pandora *const pPandora)
Process list of external, commandline parameters to be passed to specific algorithms.
bool ParseCommandLine(int argc, char *argv[], Parameters ¶meters)
Parse the command line arguments, setting the application parameters.
bool ProcessRecoOption(const std::string &recoOption, Parameters ¶meters)
Process the provided reco option string to perform high-level steering.
bool PrintOptions()
Print the list of configurable options.
void CreatePandoraInstances(const Parameters ¶meters, const pandora::Pandora *&pPrimaryPandora)
Create pandora instances.
void ProcessEvents(const Parameters ¶meters, const pandora::Pandora *const pPrimaryPandora)
Process events using the supplied pandora instances.