LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
LArShowerPfo.h
Go to the documentation of this file.
1 
8 #ifndef LAR_SHOWER_PFO_H
9 #define LAR_SHOWER_PFO_H 1
10 
11 #include "Objects/ParticleFlowObject.h"
12 
13 #include "Pandora/ObjectCreation.h"
14 #include "Pandora/ObjectFactory.h"
15 
16 #include <string>
17 
18 namespace lar_content
19 {
20 
24 class LArShowerPfoParameters : public object_creation::ParticleFlowObject::Parameters
25 {
26 public:
27  pandora::InputCartesianVector m_showerLength;
28  pandora::InputCartesianVector m_showerCentroid;
29  pandora::InputFloat m_showerOpeningAngle;
30  pandora::InputCartesianVector m_showerDirection;
31  pandora::InputCartesianVector m_showerSecondaryVector;
32  pandora::InputCartesianVector m_showerTertiaryVector;
33  pandora::InputCartesianVector m_showerEigenValues;
34  pandora::InputCartesianVector m_showerVertex;
35 };
36 
37 //------------------------------------------------------------------------------------------------------------------------------------------
38 
42 class LArShowerPfo : public object_creation::ParticleFlowObject::Object
43 {
44 public:
50  LArShowerPfo(const LArShowerPfoParameters &parameters);
51 
57  const pandora::CartesianVector &GetShowerLength() const;
58 
64  const pandora::CartesianVector &GetShowerCentroid() const;
65 
71  float GetShowerOpeningAngle() const;
72 
78  const pandora::CartesianVector &GetShowerDirection() const;
79 
85  const pandora::CartesianVector &GetShowerSecondaryVector() const;
86 
92  const pandora::CartesianVector &GetShowerTertiaryVector() const;
93 
99  const pandora::CartesianVector &GetShowerEigenValues() const;
100 
106  const pandora::CartesianVector &GetShowerVertex() const;
107 
108 private:
109  pandora::CartesianVector m_showerLength;
110  pandora::CartesianVector m_showerCentroid;
112  pandora::CartesianVector m_showerDirection;
113  pandora::CartesianVector m_showerSecondaryVector;
114  pandora::CartesianVector m_showerTertiaryVector;
115  pandora::CartesianVector m_showerEigenValues;
116  pandora::CartesianVector m_showerVertex;
117 };
118 
119 //------------------------------------------------------------------------------------------------------------------------------------------
120 
124 class LArShowerPfoFactory : public pandora::ObjectFactory<object_creation::ParticleFlowObject::Parameters, object_creation::ParticleFlowObject::Object>
125 {
126 public:
132  Parameters *NewParameters() const;
133 
140  pandora::StatusCode Read(Parameters &parameters, pandora::FileReader &fileReader) const;
141 
148  pandora::StatusCode Write(const Object *const pObject, pandora::FileWriter &fileWriter) const;
149 
156  pandora::StatusCode Create(const Parameters &parameters, const Object *&pObject) const;
157 };
158 
159 //------------------------------------------------------------------------------------------------------------------------------------------
160 //------------------------------------------------------------------------------------------------------------------------------------------
161 
163  object_creation::ParticleFlowObject::Object(parameters),
164  m_showerLength(parameters.m_showerLength.Get()),
165  m_showerCentroid(parameters.m_showerCentroid.Get()),
171  m_showerVertex(parameters.m_showerVertex.Get())
172 {
173 }
174 
175 //------------------------------------------------------------------------------------------------------------------------------------------
176 
177 inline const pandora::CartesianVector &LArShowerPfo::GetShowerLength() const
178 {
179  return m_showerLength;
180 }
181 
182 //------------------------------------------------------------------------------------------------------------------------------------------
183 
184 inline const pandora::CartesianVector &LArShowerPfo::GetShowerCentroid() const
185 {
186  return m_showerCentroid;
187 }
188 
189 //------------------------------------------------------------------------------------------------------------------------------------------
190 
192 {
193  return m_showerOpeningAngle;
194 }
195 
196 //------------------------------------------------------------------------------------------------------------------------------------------
197 
198 inline const pandora::CartesianVector &LArShowerPfo::GetShowerDirection() const
199 {
200  return m_showerDirection;
201 }
202 
203 //------------------------------------------------------------------------------------------------------------------------------------------
204 
205 inline const pandora::CartesianVector &LArShowerPfo::GetShowerSecondaryVector() const
206 {
208 }
209 
210 //------------------------------------------------------------------------------------------------------------------------------------------
211 
212 inline const pandora::CartesianVector &LArShowerPfo::GetShowerTertiaryVector() const
213 {
214  return m_showerTertiaryVector;
215 }
216 
217 //------------------------------------------------------------------------------------------------------------------------------------------
218 
219 inline const pandora::CartesianVector &LArShowerPfo::GetShowerEigenValues() const
220 {
221  return m_showerEigenValues;
222 }
223 
224 //------------------------------------------------------------------------------------------------------------------------------------------
225 
226 inline const pandora::CartesianVector &LArShowerPfo::GetShowerVertex() const
227 {
228  return m_showerVertex;
229 }
230 
231 //------------------------------------------------------------------------------------------------------------------------------------------
232 
233 inline LArShowerPfoFactory::Parameters *LArShowerPfoFactory::NewParameters() const
234 {
235  return (new LArShowerPfoParameters);
236 }
237 
238 //------------------------------------------------------------------------------------------------------------------------------------------
239 
240 inline pandora::StatusCode LArShowerPfoFactory::Create(const Parameters &parameters, const Object *&pObject) const
241 {
242  const LArShowerPfoParameters &larPfoParameters(dynamic_cast<const LArShowerPfoParameters&>(parameters));
243  pObject = new LArShowerPfo(larPfoParameters);
244 
245  return pandora::STATUS_CODE_SUCCESS;
246 }
247 
248 //------------------------------------------------------------------------------------------------------------------------------------------
249 
250 inline pandora::StatusCode LArShowerPfoFactory::Read(Parameters&, pandora::FileReader&) const
251 {
252  // TODO: Provide this functionality if necessary
253 
254  return pandora::STATUS_CODE_SUCCESS;
255 }
256 
257 //------------------------------------------------------------------------------------------------------------------------------------------
258 
259 inline pandora::StatusCode LArShowerPfoFactory::Write(const pandora::ParticleFlowObject*, pandora::FileWriter&) const
260 {
261  // TODO: Provide this functionality if necessary
262 
263  return pandora::STATUS_CODE_SUCCESS;
264 }
265 
266 } // namespace lar_content
267 
268 #endif // #ifndef LAR_SHOWER_PFO_H
pandora::StatusCode Create(const Parameters &parameters, const Object *&pObject) const
Create an object with the given parameters.
Definition: LArShowerPfo.h:240
const pandora::CartesianVector & GetShowerSecondaryVector() const
Get the shower secondary eigen vector from 3d shower fit.
Definition: LArShowerPfo.h:205
pandora::InputFloat m_showerOpeningAngle
Shower opening angle.
Definition: LArShowerPfo.h:29
const pandora::CartesianVector & GetShowerDirection() const
Get the shower direction, also the primary eigen vector from 3d shower fit.
Definition: LArShowerPfo.h:198
pandora::InputCartesianVector m_showerCentroid
Shower centroid from 3d shower fit.
Definition: LArShowerPfo.h:28
pandora::InputCartesianVector m_showerTertiaryVector
Shower teriary eigen vector.
Definition: LArShowerPfo.h:32
pandora::CartesianVector m_showerDirection
Shower direction, primary eigen vector.
Definition: LArShowerPfo.h:112
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: LArShowerPfo.h:250
pandora::StatusCode Write(const Object *const pObject, pandora::FileWriter &fileWriter) const
Persist any additional (derived class only) object parameters using the specified file writer...
Definition: LArShowerPfo.h:259
pandora::InputCartesianVector m_showerVertex
Shower starting point.
Definition: LArShowerPfo.h:34
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
pandora::CartesianVector m_showerEigenValues
Shower eigenvalues from 3d PCA.
Definition: LArShowerPfo.h:115
pandora::InputCartesianVector m_showerDirection
Shower direction, also the primary eigen vector.
Definition: LArShowerPfo.h:30
LArShowerPfo(const LArShowerPfoParameters &parameters)
Constructor.
Definition: LArShowerPfo.h:162
lar pfo object factory responsible for pfo creation
Definition: LArShowerPfo.h:124
const pandora::CartesianVector & GetShowerTertiaryVector() const
Get the shower tertiary eigen vector from 3d shower fit.
Definition: LArShowerPfo.h:212
pandora::CartesianVector m_showerLength
Shower length and widths from 3d shower fit.
Definition: LArShowerPfo.h:109
pandora::InputCartesianVector m_showerEigenValues
Shower eigenvalues from 3d PCA.
Definition: LArShowerPfo.h:33
const pandora::CartesianVector & GetShowerLength() const
Get the shower length and width from 3d shower fit.
Definition: LArShowerPfo.h:177
pandora::InputCartesianVector m_showerLength
Shower length and widths from 3d shower fit.
Definition: LArShowerPfo.h:27
Parameters * NewParameters() const
Create new parameters instance on the heap (memory-management to be controlled by user) ...
Definition: LArShowerPfo.h:233
float m_showerOpeningAngle
Shower opening angle.
Definition: LArShowerPfo.h:111
float GetShowerOpeningAngle() const
Get the shower opening angle from 3d shower fit.
Definition: LArShowerPfo.h:191
pandora::InputCartesianVector m_showerSecondaryVector
Shower secondary eigen vector.
Definition: LArShowerPfo.h:31
pandora::CartesianVector m_showerCentroid
Shower centroid from 3d shower fit.
Definition: LArShowerPfo.h:110
const pandora::CartesianVector & GetShowerCentroid() const
Get the shower centroid from the 3d shower fit.
Definition: LArShowerPfo.h:184
const pandora::CartesianVector & GetShowerVertex() const
Get the shower starting point from 3d shower fit.
Definition: LArShowerPfo.h:226
const pandora::CartesianVector & GetShowerEigenValues() const
Get the shower eigen values from 3d PCA.
Definition: LArShowerPfo.h:219
pandora::CartesianVector m_showerSecondaryVector
Shower secondary eigen vector.
Definition: LArShowerPfo.h:113
pandora::CartesianVector m_showerVertex
Shower starting point.
Definition: LArShowerPfo.h:116
pandora::CartesianVector m_showerTertiaryVector
Shower tertiary eigen vector.
Definition: LArShowerPfo.h:114