EventWritingAlgorithm.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArPersistency/EventWritingAlgorithm.h
3  *
4  * @brief Header file for the event writing algorithm class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_EVENT_WRITING_ALGORITHM_H
9 #define LAR_EVENT_WRITING_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 
13 #include "Persistency/PandoraIO.h"
14 
15 namespace pandora
16 {
17 class FileWriter;
18 }
19 
20 //------------------------------------------------------------------------------------------------------------------------------------------
21 
22 namespace lar_content
23 {
24 
25 /**
26  * @brief EventWritingAlgorithm class
27  */
28 class EventWritingAlgorithm : public pandora::Algorithm
29 {
30 public:
31  /**
32  * @brief Default constructor
33  */
35 
36  /**
37  * @brief Destructor
38  */
40 
41 private:
42  pandora::StatusCode Initialize();
43  pandora::StatusCode Run();
44 
45  /**
46  * @brief Whether current event passes nuance code filter
47  *
48  * @return boolean
49  */
50  bool PassNuanceCodeFilter() const;
51 
52  /**
53  * @brief Whether current event passes mc particle constituent filter
54  *
55  * @return boolean
56  */
57  bool PassMCParticleFilter() const;
58 
59  /**
60  * @brief Whether current event passes neutrino vertex position filter (e.g. fiducial volume cut)
61  *
62  * @return boolean
63  */
64  bool PassNeutrinoVertexFilter() const;
65 
66  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
67 
68  pandora::FileType m_geometryFileType; ///< The geometry file type
69  pandora::FileType m_eventFileType; ///< The event file type
70 
71  pandora::FileWriter *m_pEventFileWriter; ///< Address of the event file writer
72  pandora::FileWriter *m_pGeometryFileWriter; ///< Address of the geometry file writer
73 
74  bool m_shouldWriteGeometry; ///< Whether to write geometry to a specified file
75  bool m_writtenGeometry; ///< Whether geometry has been written
76  std::string m_geometryFileName; ///< Name of the output geometry file
77 
78  bool m_shouldWriteEvents; ///< Whether to write events to a specified file
79  std::string m_eventFileName; ///< Name of the output event file
80 
81  bool m_shouldWriteMCRelationships; ///< Whether to write mc relationship information to the events file
82  bool m_shouldWriteTrackRelationships; ///< Whether to write track relationship information to the events file
83 
84  bool m_shouldOverwriteEventFile; ///< Whether to overwrite existing event file with specified name, or append
85  bool m_shouldOverwriteGeometryFile; ///< Whether to overwrite existing geometry file with specified name, or append
86 
87  bool m_useLArCaloHits; ///< Whether to write lar calo hits, or standard pandora calo hits
88  unsigned int m_larCaloHitVersion; ///< LArCaloHit version for LArCaloHitFactory
89  bool m_useLArMCParticles; ///< Whether to write lar mc particles, or standard pandora mc particles
90 
91  bool m_shouldFilterByNuanceCode; ///< Whether to filter output by nuance code
92  int m_filterNuanceCode; ///< The filter nuance code (required if specify filter by nuance code)
93 
94  bool m_shouldFilterByMCParticles; ///< Whether to filter output by mc particle constituents
95  bool m_neutrinoInducedOnly; ///< Whether to consider only mc particles that were neutrino induced
96  unsigned int m_matchingMinPrimaryHits; ///< The minimum number of mc primary hits used in matching scheme
97  unsigned int m_nNonNeutrons; ///< The requested number of mc primaries that are not neutrons
98  unsigned int m_nMuons; ///< The requested number of mc primaries that are muons
99  unsigned int m_nElectrons; ///< The requested number of mc primaries that are electrons
100  unsigned int m_nProtons; ///< The requested number of mc primaries that are protons
101  unsigned int m_nPhotons; ///< The requested number of mc primaries that are photons
102  unsigned int m_nChargedPions; ///< The requested number of mc primaries that are charged pions
103 
104  bool m_shouldFilterByNeutrinoVertex; ///< Whether to filter output by neutrino vertex position (e.g. fiducial volume cut)
105  float m_detectorHalfLengthX; ///< Half length of detector in x dimension
106  float m_detectorHalfLengthY; ///< Half length of detector in y dimension
107  float m_detectorHalfLengthZ; ///< Half length of detector in z dimension
108  float m_coordinateOffsetX; ///< Origin offset (from detector corner) in x dimension
109  float m_coordinateOffsetY; ///< Origin offset (from detector corner) in y dimension
110  float m_coordinateOffsetZ; ///< Origin offset (from detector corner) in z dimension
111  float m_selectedBorderX; ///< Required distance from detector edge in x dimension
112  float m_selectedBorderY; ///< Required distance from detector edge in y dimension
113  float m_selectedBorderZ; ///< Required distance from detector edge in z dimension
114 };
115 
116 } // namespace lar_content
117 
118 #endif // #ifndef LAR_EVENT_WRITING_ALGORITHM_H
float m_detectorHalfLengthZ
Half length of detector in z dimension.
unsigned int m_matchingMinPrimaryHits
The minimum number of mc primary hits used in matching scheme.
bool m_shouldWriteMCRelationships
Whether to write mc relationship information to the events file.
pandora::FileWriter * m_pEventFileWriter
Address of the event file writer.
EventWritingAlgorithm class.
bool m_shouldFilterByMCParticles
Whether to filter output by mc particle constituents.
bool m_shouldWriteEvents
Whether to write events to a specified file.
std::string string
Definition: nybbler.cc:12
bool m_useLArCaloHits
Whether to write lar calo hits, or standard pandora calo hits.
float m_coordinateOffsetY
Origin offset (from detector corner) in y dimension.
bool m_neutrinoInducedOnly
Whether to consider only mc particles that were neutrino induced.
unsigned int m_larCaloHitVersion
LArCaloHit version for LArCaloHitFactory.
unsigned int m_nPhotons
The requested number of mc primaries that are photons.
unsigned int m_nProtons
The requested number of mc primaries that are protons.
float m_selectedBorderY
Required distance from detector edge in y dimension.
float m_detectorHalfLengthY
Half length of detector in y dimension.
float m_selectedBorderZ
Required distance from detector edge in z dimension.
std::string m_eventFileName
Name of the output event file.
pandora::FileType m_geometryFileType
The geometry file type.
unsigned int m_nChargedPions
The requested number of mc primaries that are charged pions.
bool m_shouldWriteTrackRelationships
Whether to write track relationship information to the events file.
bool m_useLArMCParticles
Whether to write lar mc particles, or standard pandora mc particles.
pandora::FileWriter * m_pGeometryFileWriter
Address of the geometry file writer.
unsigned int m_nNonNeutrons
The requested number of mc primaries that are not neutrons.
float m_selectedBorderX
Required distance from detector edge in x dimension.
bool m_shouldFilterByNeutrinoVertex
Whether to filter output by neutrino vertex position (e.g. fiducial volume cut)
void Initialize(void)
int m_filterNuanceCode
The filter nuance code (required if specify filter by nuance code)
float m_detectorHalfLengthX
Half length of detector in x dimension.
unsigned int m_nElectrons
The requested number of mc primaries that are electrons.
std::string m_geometryFileName
Name of the output geometry file.
pandora::FileType m_eventFileType
The event file type.
bool m_shouldFilterByNuanceCode
Whether to filter output by nuance code.
bool m_shouldOverwriteEventFile
Whether to overwrite existing event file with specified name, or append.
unsigned int m_nMuons
The requested number of mc primaries that are muons.
bool m_shouldWriteGeometry
Whether to write geometry to a specified file.
bool m_shouldOverwriteGeometryFile
Whether to overwrite existing geometry file with specified name, or append.
float m_coordinateOffsetZ
Origin offset (from detector corner) in z dimension.
bool m_writtenGeometry
Whether geometry has been written.
float m_coordinateOffsetX
Origin offset (from detector corner) in x dimension.