LArMCParticleFactory responsible for object creation.
More...
#include "LArMCParticle.h"
|
Parameters * | NewParameters () const |
| Create new parameters instance on the heap (memory-management to be controlled by user) More...
|
|
pandora::StatusCode | Read (Parameters ¶meters, pandora::FileReader &fileReader) const |
| Read any additional (derived class only) object parameters from file using the specified file reader. More...
|
|
pandora::StatusCode | Write (const Object *const pObject, pandora::FileWriter &fileWriter) const |
| Persist any additional (derived class only) object parameters using the specified file writer. More...
|
|
pandora::StatusCode | Create (const Parameters ¶meters, const Object *&pObject) const |
| Create an object with the given parameters. More...
|
|
LArMCParticleFactory responsible for object creation.
Definition at line 64 of file LArMCParticle.h.
pandora::StatusCode lar_content::LArMCParticleFactory::Create |
( |
const Parameters & |
parameters, |
|
|
const Object *& |
pObject |
|
) |
| const |
|
inline |
Create an object with the given parameters.
- Parameters
-
parameters | the parameters to pass in constructor |
pObject | to receive the address of the object created |
Definition at line 125 of file LArMCParticle.h.
References lar_content::LArMCParticle::LArMCParticle().
127 const LArMCParticleParameters &larMCParticleParameters(dynamic_cast<const LArMCParticleParameters&>(parameters));
128 pObject =
new LArMCParticle(larMCParticleParameters);
130 return pandora::STATUS_CODE_SUCCESS;
LArMCParticleFactory::Parameters * lar_content::LArMCParticleFactory::NewParameters |
( |
| ) |
const |
|
inline |
Create new parameters instance on the heap (memory-management to be controlled by user)
- Returns
- the address of the new parameters instance
Definition at line 118 of file LArMCParticle.h.
120 return (
new LArMCParticleParameters);
pandora::StatusCode lar_content::LArMCParticleFactory::Read |
( |
Parameters & |
parameters, |
|
|
pandora::FileReader & |
fileReader |
|
) |
| const |
|
inline |
Read any additional (derived class only) object parameters from file using the specified file reader.
- Parameters
-
parameters | the parameters to pass in constructor |
fileReader | the file reader, used to extract any additional parameters from file |
Definition at line 135 of file LArMCParticle.h.
References lar_content::LArMCParticleParameters::m_nuanceCode.
140 if (pandora::BINARY == fileReader.GetFileType())
142 pandora::BinaryFileReader &binaryFileReader(dynamic_cast<pandora::BinaryFileReader&>(fileReader));
143 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, binaryFileReader.ReadVariable(nuanceCode));
145 else if (pandora::XML == fileReader.GetFileType())
147 pandora::XmlFileReader &xmlFileReader(dynamic_cast<pandora::XmlFileReader&>(fileReader));
148 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, xmlFileReader.ReadVariable(
"NuanceCode", nuanceCode));
152 return pandora::STATUS_CODE_INVALID_PARAMETER;
155 LArMCParticleParameters &larMCParticleParameters(dynamic_cast<LArMCParticleParameters&>(parameters));
156 larMCParticleParameters.m_nuanceCode = nuanceCode;
158 return pandora::STATUS_CODE_SUCCESS;
pandora::StatusCode lar_content::LArMCParticleFactory::Write |
( |
const Object *const |
pObject, |
|
|
pandora::FileWriter & |
fileWriter |
|
) |
| const |
|
inline |
Persist any additional (derived class only) object parameters using the specified file writer.
- Parameters
-
pObject | the address of the object to persist |
fileWriter | the file writer |
Definition at line 163 of file LArMCParticle.h.
References lar_content::LArMCParticle::GetNuanceCode().
166 const LArMCParticle *
const pLArMCParticle(dynamic_cast<const LArMCParticle*>(pObject));
169 return pandora::STATUS_CODE_INVALID_PARAMETER;
171 if (pandora::BINARY == fileWriter.GetFileType())
173 pandora::BinaryFileWriter &binaryFileWriter(dynamic_cast<pandora::BinaryFileWriter&>(fileWriter));
174 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, binaryFileWriter.WriteVariable(pLArMCParticle->GetNuanceCode()));
176 else if (pandora::XML == fileWriter.GetFileType())
178 pandora::XmlFileWriter &xmlFileWriter(dynamic_cast<pandora::XmlFileWriter&>(fileWriter));
179 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, xmlFileWriter.WriteVariable(
"NuanceCode", pLArMCParticle->GetNuanceCode()));
183 return pandora::STATUS_CODE_INVALID_PARAMETER;
186 return pandora::STATUS_CODE_SUCCESS;
The documentation for this class was generated from the following file:
- /cvmfs/larsoft.opensciencegrid.org/products/larpandoracontent/v03_14_03/source/larpandoracontent/LArObjects/LArMCParticle.h