All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventReadingAlgorithm.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArPersistency/EventReadingAlgorithm.h
3  *
4  * @brief Header file for the event reading algorithm class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_EVENT_READING_ALGORITHM_H
9 #define LAR_EVENT_READING_ALGORITHM_H 1
10 
11 #include "Pandora/ExternallyConfiguredAlgorithm.h"
12 
13 #include "Pandora/PandoraInputTypes.h"
14 
15 #include "Persistency/PandoraIO.h"
16 
17 namespace pandora
18 {
19 class FileReader;
20 }
21 
22 //------------------------------------------------------------------------------------------------------------------------------------------
23 
24 namespace lar_content
25 {
26 
27 /**
28  * @brief EventReadingAlgorithm class
29  */
30 class EventReadingAlgorithm : public pandora::ExternallyConfiguredAlgorithm
31 {
32 public:
33  /**
34  * @brief Default constructor
35  */
37 
38  /**
39  * @brief Destructor
40  */
42 
43  /**
44  * @brief External event reading parameters class
45  */
46  class ExternalEventReadingParameters : public pandora::ExternalParameters
47  {
48  public:
49  std::string m_geometryFileName; ///< Name of the file containing geometry information
50  std::string m_eventFileNameList; ///< Colon-separated list of file names to be processed
51  pandora::InputUInt m_skipToEvent; ///< Index of first event to consider in input file
52  };
53 
54 private:
55  pandora::StatusCode Initialize();
56  pandora::StatusCode Run();
57 
58  /**
59  * @brief Proceed to process next event file named in the input list
60  */
61  void MoveToNextEventFile();
62 
63  /**
64  * @brief Replace the current event file reader with a new reader for the specified file
65  *
66  * @param fileName the file name
67  */
68  pandora::StatusCode ReplaceEventFileReader(const std::string &fileName);
69 
70  /**
71  * @brief Analyze a provided file name to extract the file type/extension
72  *
73  * @param fileName the file name
74  *
75  * @return the file type
76  */
77  pandora::FileType GetFileType(const std::string &fileName) const;
78 
79  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
80 
81  std::string m_geometryFileName; ///< Name of the file containing geometry information
82  std::string m_eventFileName; ///< Name of the current file containing event information
83  pandora::StringVector m_eventFileNameVector; ///< Vector of file names to be processed
84 
85  unsigned int m_skipToEvent; ///< Index of first event to consider in first input file
86  bool m_useLArCaloHits; ///< Whether to read lar calo hits, or standard pandora calo hits
87  unsigned int m_larCaloHitVersion; ///< LArCaloHit version for LArCaloHitFactory
88  bool m_useLArMCParticles; ///< Whether to read lar mc particles, or standard pandora mc particles
89  unsigned int m_larMCParticleVersion; ///< LArMCParticle version for LArMCParticleFactory
90 
91  pandora::FileReader *m_pEventFileReader; ///< Address of the event file reader
92 };
93 
94 } // namespace lar_content
95 
96 #endif // #ifndef LAR_EVENT_READING_ALGORITHM_H
std::string m_geometryFileName
Name of the file containing geometry information.
bool m_useLArMCParticles
Whether to read lar mc particles, or standard pandora mc particles.
unsigned int m_larCaloHitVersion
LArCaloHit version for LArCaloHitFactory.
EventReadingAlgorithm class.
pandora::StatusCode ReplaceEventFileReader(const std::string &fileName)
Replace the current event file reader with a new reader for the specified file.
pandora::StringVector m_eventFileNameVector
Vector of file names to be processed.
unsigned int m_skipToEvent
Index of first event to consider in first input file.
pandora::InputUInt m_skipToEvent
Index of first event to consider in input file.
std::string m_geometryFileName
Name of the file containing geometry information.
bool m_useLArCaloHits
Whether to read lar calo hits, or standard pandora calo hits.
pandora::FileType GetFileType(const std::string &fileName) const
Analyze a provided file name to extract the file type/extension.
EventReadingAlgorithm()
Default constructor.
std::string m_eventFileNameList
Colon-separated list of file names to be processed.
pandora::FileReader * m_pEventFileReader
Address of the event file reader.
required by fuzzyCluster table::sbnd_g4_services gaushitTruthMatch pandora
Definition: reco_sbnd.fcl:182
unsigned int m_larMCParticleVersion
LArMCParticle version for LArMCParticleFactory.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::string m_eventFileName
Name of the current file containing event information.
void MoveToNextEventFile()
Proceed to process next event file named in the input list.