All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LArTrackPfo.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArObjects/LArTrackPfo.h
3  *
4  * @brief Header file for the lar pfo class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_TRACK_PFO_H
9 #define LAR_TRACK_PFO_H 1
10 
11 #include "Objects/CartesianVector.h"
12 #include "Objects/ParticleFlowObject.h"
13 #include "Objects/TrackState.h"
14 
15 #include "Pandora/ObjectCreation.h"
16 #include "Pandora/ObjectFactory.h"
17 
19 
20 namespace pandora
21 {
22 class CaloHit;
23 }
24 
25 //------------------------------------------------------------------------------------------------------------------------------------------
26 
27 namespace lar_content
28 {
29 
30 /**
31  * @brief lar pfo parameters
32  */
34 {
35 public:
37 };
38 
39 //------------------------------------------------------------------------------------------------------------------------------------------
40 
41 /**
42  * @brief lar pfo object
43  */
44 class LArTrackPfo : public pandora::ParticleFlowObject
45 {
46 public:
47  /**
48  * @brief Constructor
49  */
50  LArTrackPfo(const LArTrackPfoParameters &parameters);
51 
52  /**
53  * @brief Get vertex position
54  */
55  const pandora::CartesianVector &GetVertexPosition() const;
56 
57  /**
58  * @brief Get end position
59  */
60  const pandora::CartesianVector &GetEndPosition() const;
61 
62  /**
63  * @brief Get vertex direction
64  */
65  const pandora::CartesianVector &GetVertexDirection() const;
66 
67  /**
68  * @brief Get end direction
69  */
70  const pandora::CartesianVector &GetEndDirection() const;
71 
72 public:
73  const LArTrackStateVector m_trackStateVector; ///< The vector of track states
74 
75 private:
76  // OTHER MEMBER VARIABLES GO HERE
77 };
78 
79 //------------------------------------------------------------------------------------------------------------------------------------------
80 
81 /**
82  * @brief lar pfo object factory responsible for pfo creation
83  */
84 class LArTrackPfoFactory : public pandora::ObjectFactory<object_creation::ParticleFlowObject::Parameters, pandora::ParticleFlowObject>
85 {
86 public:
87  /**
88  * @brief Create new parameters instance on the heap (memory-management to be controlled by user)
89  *
90  * @return the address of the new parameters instance
91  */
92  Parameters *NewParameters() const;
93 
94  /**
95  * @brief Read any additional (derived class only) object parameters from file using the specified file reader
96  *
97  * @param parameters the parameters to pass in constructor
98  * @param fileReader the file reader, used to extract any additional parameters from file
99  */
100  pandora::StatusCode Read(Parameters &parameters, pandora::FileReader &fileReader) const;
101 
102  /**
103  * @brief Persist any additional (derived class only) object parameters using the specified file writer
104  *
105  * @param pObject the address of the object to persist
106  * @param fileWriter the file writer
107  */
108  pandora::StatusCode Write(const pandora::ParticleFlowObject *const pObject, pandora::FileWriter &fileWriter) const;
109 
110  /**
111  * @brief Create an object with the given parameters
112  *
113  * @param parameters the parameters to pass in constructor
114  * @param pObject to receive the address of the object created
115  */
116  pandora::StatusCode Create(const object_creation::ParticleFlowObject::Parameters &parameters, const pandora::ParticleFlowObject *&pObject) const;
117 };
118 
119 //------------------------------------------------------------------------------------------------------------------------------------------
120 //------------------------------------------------------------------------------------------------------------------------------------------
121 
123 {
124  return (new LArTrackPfoParameters);
125 }
126 
127 //------------------------------------------------------------------------------------------------------------------------------------------
128 
129 inline pandora::StatusCode LArTrackPfoFactory::Create(const Parameters &parameters, const pandora::ParticleFlowObject *&pObject) const
130 {
131  const LArTrackPfoParameters &larPfoParameters(dynamic_cast<const LArTrackPfoParameters &>(parameters));
132  pObject = new LArTrackPfo(larPfoParameters);
133 
134  return pandora::STATUS_CODE_SUCCESS;
135 }
136 
137 //------------------------------------------------------------------------------------------------------------------------------------------
138 
139 inline pandora::StatusCode LArTrackPfoFactory::Read(Parameters &, pandora::FileReader &) const
140 {
141  // TODO: Provide this functionality when necessary
142 
143  return pandora::STATUS_CODE_SUCCESS;
144 }
145 
146 //------------------------------------------------------------------------------------------------------------------------------------------
147 
148 inline pandora::StatusCode LArTrackPfoFactory::Write(const pandora::ParticleFlowObject *, pandora::FileWriter &) const
149 {
150  // TODO: Provide this functionality when necessary
151 
152  return pandora::STATUS_CODE_SUCCESS;
153 }
154 
155 } // namespace lar_content
156 
157 #endif // #ifndef LAR_TRACK_PFO_H
lar pfo object
Definition: LArTrackPfo.h:44
const pandora::CartesianVector & GetEndPosition() const
Get end position.
Definition: LArTrackPfo.cc:36
Header file for lar pfo objects.
const pandora::CartesianVector & GetVertexDirection() const
Get vertex direction.
Definition: LArTrackPfo.cc:46
const LArTrackStateVector m_trackStateVector
The vector of track states.
Definition: LArTrackPfo.h:73
LArTrackStateVector m_trackStateVector
Definition: LArTrackPfo.h:36
pandora::StatusCode Read(Parameters &parameters, pandora::FileReader &fileReader) const
Read any additional (derived class only) object parameters from file using the specified file reader...
Definition: LArTrackPfo.h:139
pandora::StatusCode Create(const object_creation::ParticleFlowObject::Parameters &parameters, const pandora::ParticleFlowObject *&pObject) const
Create an object with the given parameters.
Definition: LArTrackPfo.h:129
fhicl::Table< sbnd::crt::CRTDetSimParams > Parameters
required by fuzzyCluster table::sbnd_g4_services gaushitTruthMatch pandora
Definition: reco_sbnd.fcl:182
const pandora::CartesianVector & GetEndDirection() const
Get end direction.
Definition: LArTrackPfo.cc:56
lar pfo object factory responsible for pfo creation
Definition: LArTrackPfo.h:84
pandora::StatusCode Write(const pandora::ParticleFlowObject *const pObject, pandora::FileWriter &fileWriter) const
Persist any additional (derived class only) object parameters using the specified file writer...
Definition: LArTrackPfo.h:148
std::vector< LArTrackState > LArTrackStateVector
Definition: LArPfoObjects.h:67
Parameters * NewParameters() const
Create new parameters instance on the heap (memory-management to be controlled by user) ...
Definition: LArTrackPfo.h:122
LArTrackPfo(const LArTrackPfoParameters &parameters)
Constructor.
Definition: LArTrackPfo.cc:18
const pandora::CartesianVector & GetVertexPosition() const
Get vertex position.
Definition: LArTrackPfo.cc:26