Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
PandoraObjectFactories.cc
Go to the documentation of this file.
1
9
#include "
Pandora/ObjectCreation.h
"
10
#include "
Pandora/PandoraObjectFactories.h
"
11
12
#include "
Geometry/DetectorGap.h
"
13
#include "
Geometry/LArTPC.h
"
14
#include "
Geometry/SubDetector.h
"
15
16
#include "
Objects/CaloHit.h
"
17
#include "
Objects/Cluster.h
"
18
#include "
Objects/MCParticle.h
"
19
#include "
Objects/ParticleFlowObject.h
"
20
#include "
Objects/Track.h
"
21
#include "
Objects/Vertex.h
"
22
23
namespace
pandora
24
{
25
26
template
<
typename
PARAMETERS,
typename
OBJECT>
27
typename
PandoraObjectFactory<PARAMETERS, OBJECT>::Parameters
*
PandoraObjectFactory<PARAMETERS, OBJECT>::NewParameters
()
const
28
{
29
return
(
new
Parameters
);
30
}
31
32
//------------------------------------------------------------------------------------------------------------------------------------------
33
34
template
<
typename
PARAMETERS,
typename
OBJECT>
35
StatusCode
PandoraObjectFactory<PARAMETERS, OBJECT>::Read
(
Parameters
&
/*parameters*/
,
FileReader
&
/*fileReader*/
)
const
36
{
37
return
STATUS_CODE_SUCCESS;
38
}
39
40
//------------------------------------------------------------------------------------------------------------------------------------------
41
42
template
<
typename
PARAMETERS,
typename
OBJECT>
43
StatusCode
PandoraObjectFactory<PARAMETERS, OBJECT>::Write
(
const
Object
*
const
/*pObject*/
,
FileWriter
&
/*fileWriter*/
)
const
44
{
45
return
STATUS_CODE_SUCCESS;
46
}
47
48
//------------------------------------------------------------------------------------------------------------------------------------------
49
50
template
<
typename
PARAMETERS,
typename
OBJECT>
51
StatusCode
PandoraObjectFactory<PARAMETERS, OBJECT>::Create
(
const
PARAMETERS ¶meters,
const
OBJECT *&pObject)
const
52
{
53
pObject =
nullptr
;
54
55
try
56
{
57
pObject =
new
OBJECT(parameters);
58
}
59
catch
(
StatusCodeException
&statusCodeException)
60
{
61
delete
pObject;
62
pObject =
nullptr
;
63
64
std::cout <<
"StatusCodeException caught while instantiating pandora object :"
<< statusCodeException.
ToString
() << std::endl;
65
return
statusCodeException.
GetStatusCode
();
66
}
67
68
return
STATUS_CODE_SUCCESS;
69
}
70
71
//------------------------------------------------------------------------------------------------------------------------------------------
72
//------------------------------------------------------------------------------------------------------------------------------------------
73
74
template
class
PandoraObjectFactory<object_creation::CaloHit::Parameters, object_creation::CaloHit::Object>
;
75
template
class
PandoraObjectFactory<object_creation::CaloHitFragment::Parameters, object_creation::CaloHitFragment::Object>
;
76
template
class
PandoraObjectFactory<object_creation::Track::Parameters, object_creation::Track::Object>
;
77
template
class
PandoraObjectFactory<object_creation::MCParticle::Parameters, object_creation::MCParticle::Object>
;
78
template
class
PandoraObjectFactory<object_creation::Cluster::Parameters, object_creation::Cluster::Object>
;
79
template
class
PandoraObjectFactory<object_creation::ParticleFlowObject::Parameters, object_creation::ParticleFlowObject::Object>
;
80
template
class
PandoraObjectFactory<object_creation::Vertex::Parameters, object_creation::Vertex::Object>
;
81
template
class
PandoraObjectFactory<object_creation::Geometry::SubDetector::Parameters, object_creation::Geometry::SubDetector::Object>
;
82
template
class
PandoraObjectFactory<object_creation::Geometry::LArTPC::Parameters, object_creation::Geometry::LArTPC::Object>
;
83
template
class
PandoraObjectFactory<object_creation::Geometry::LineGap::Parameters, object_creation::Geometry::LineGap::Object>
;
84
template
class
PandoraObjectFactory<object_creation::Geometry::BoxGap::Parameters, object_creation::Geometry::BoxGap::Object>
;
85
template
class
PandoraObjectFactory<object_creation::Geometry::ConcentricGap::Parameters, object_creation::Geometry::ConcentricGap::Object>
;
86
87
}
// namespace pandora
CaloHit.h
Header file for the calo hit class.
Cluster.h
Header file for the cluster class.
DetectorGap.h
Header file for the detector gap class.
LArTPC.h
Header file for the lar tpc class.
MCParticle.h
Header file for the mc particle class.
ObjectCreation.h
Header file for pandora object creation classes.
PandoraObjectFactories.h
Header file for the pandora object factories classes.
ParticleFlowObject.h
Header file for the particle flow object class.
SubDetector.h
Header file for the sub detector class.
Track.h
Header file for the track class.
Vertex.h
Header file for the vertex class.
Parameters
Parameters class.
Definition
Validation.h:20
pandora::FileReader
FileReader class.
Definition
FileReader.h:29
pandora::FileWriter
FileWriter class.
Definition
FileWriter.h:29
pandora::PandoraObjectFactory
PandoraObjectFactory class.
Definition
PandoraObjectFactories.h:22
pandora::PandoraObjectFactory::Read
StatusCode Read(Parameters ¶meters, FileReader &fileReader) const
Read any additional (derived class only) object parameters from file using the specified file reader.
Definition
PandoraObjectFactories.cc:35
pandora::PandoraObjectFactory::Parameters
PARAMETERS Parameters
Definition
PandoraObjectFactories.h:24
pandora::PandoraObjectFactory::Write
StatusCode Write(const Object *const pObject, FileWriter &fileWriter) const
Persist any additional (derived class only) object parameters using the specified file writer.
Definition
PandoraObjectFactories.cc:43
pandora::PandoraObjectFactory::NewParameters
Parameters * NewParameters() const
Create new parameters instance on the heap (memory-management to be controlled by user)
Definition
PandoraObjectFactories.cc:27
pandora::PandoraObjectFactory::Object
OBJECT Object
Definition
PandoraObjectFactories.h:25
pandora::PandoraObjectFactory::Create
StatusCode Create(const Parameters ¶meters, const Object *&pObject) const
Create an object with the given parameters.
Definition
PandoraObjectFactories.cc:51
pandora::StatusCodeException
StatusCodeException class.
Definition
StatusCodes.h:119
pandora::StatusCodeException::ToString
std::string ToString() const
Get status code as a string.
Definition
StatusCodes.h:198
pandora::StatusCodeException::GetStatusCode
StatusCode GetStatusCode() const
Get status code.
Definition
StatusCodes.h:191
pandora
Definition
LArContent.h:12
pandora::StatusCode
StatusCode
The StatusCode enum.
Definition
StatusCodes.h:100
PandoraSDK
src
Pandora
PandoraObjectFactories.cc