LArCaloHitFactory responsible for object creation.
More...
#include "LArCaloHit.h"
|
| LArCaloHitFactory (const unsigned int version=1) |
| Constructor. More...
|
|
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...
|
|
LArCaloHitFactory responsible for object creation.
Definition at line 110 of file LArCaloHit.h.
lar_content::LArCaloHitFactory::LArCaloHitFactory |
( |
const unsigned int |
version = 1 | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 245 of file LArCaloHit.h.
unsigned int m_version
The LArCaloHit version.
pandora::StatusCode lar_content::LArCaloHitFactory::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 259 of file LArCaloHit.h.
261 const LArCaloHitParameters &larCaloHitParameters(dynamic_cast<const LArCaloHitParameters &>(parameters));
262 pObject =
new LArCaloHit(larCaloHitParameters);
264 return pandora::STATUS_CODE_SUCCESS;
LArCaloHitFactory::Parameters * lar_content::LArCaloHitFactory::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 252 of file LArCaloHit.h.
254 return (
new LArCaloHitParameters);
pandora::StatusCode lar_content::LArCaloHitFactory::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 269 of file LArCaloHit.h.
References lar_content::LArCaloHitParameters::m_daughterVolumeId, lar_content::LArCaloHitParameters::m_larTPCVolumeId, and m_version.
272 unsigned int larTPCVolumeId(std::numeric_limits<unsigned int>::max());
273 unsigned int daughterVolumeId(0);
275 if (pandora::BINARY == fileReader.GetFileType())
277 pandora::BinaryFileReader &binaryFileReader(dynamic_cast<pandora::BinaryFileReader &>(fileReader));
278 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, binaryFileReader.ReadVariable(larTPCVolumeId));
280 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, binaryFileReader.ReadVariable(daughterVolumeId));
282 else if (pandora::XML == fileReader.GetFileType())
284 pandora::XmlFileReader &xmlFileReader(dynamic_cast<pandora::XmlFileReader &>(fileReader));
285 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, xmlFileReader.ReadVariable(
"LArTPCVolumeId", larTPCVolumeId));
287 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, xmlFileReader.ReadVariable(
"DaughterVolumeId", daughterVolumeId));
291 return pandora::STATUS_CODE_INVALID_PARAMETER;
294 LArCaloHitParameters &larCaloHitParameters(dynamic_cast<LArCaloHitParameters &>(parameters));
295 larCaloHitParameters.m_larTPCVolumeId = larTPCVolumeId;
296 larCaloHitParameters.m_daughterVolumeId = daughterVolumeId;
298 return pandora::STATUS_CODE_SUCCESS;
unsigned int m_version
The LArCaloHit version.
pandora::StatusCode lar_content::LArCaloHitFactory::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 303 of file LArCaloHit.h.
References lar_content::LArCaloHit::GetDaughterVolumeId(), lar_content::LArCaloHit::GetLArTPCVolumeId(), and m_version.
306 const LArCaloHit *
const pLArCaloHit(dynamic_cast<const LArCaloHit *>(pObject));
309 return pandora::STATUS_CODE_INVALID_PARAMETER;
311 if (pandora::BINARY == fileWriter.GetFileType())
313 pandora::BinaryFileWriter &binaryFileWriter(dynamic_cast<pandora::BinaryFileWriter &>(fileWriter));
314 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, binaryFileWriter.WriteVariable(pLArCaloHit->GetLArTPCVolumeId()));
316 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, binaryFileWriter.WriteVariable(pLArCaloHit->GetDaughterVolumeId()));
318 else if (pandora::XML == fileWriter.GetFileType())
320 pandora::XmlFileWriter &xmlFileWriter(dynamic_cast<pandora::XmlFileWriter &>(fileWriter));
321 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, xmlFileWriter.WriteVariable(
"LArTPCVolumeId", pLArCaloHit->GetLArTPCVolumeId()));
323 PANDORA_RETURN_RESULT_IF(
324 pandora::STATUS_CODE_SUCCESS, !=, xmlFileWriter.WriteVariable(
"DaughterVolumeId", pLArCaloHit->GetDaughterVolumeId()));
328 return pandora::STATUS_CODE_INVALID_PARAMETER;
331 return pandora::STATUS_CODE_SUCCESS;
unsigned int m_version
The LArCaloHit version.
unsigned int lar_content::LArCaloHitFactory::m_version |
|
private |
The documentation for this class was generated from the following file:
- larpandoracontent/v04_08_01/source/larpandoracontent/LArObjects/LArCaloHit.h