Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
XmlFileWriter.cc
Go to the documentation of this file.
1
11
13#include "Geometry/LArTPC.h"
15
16#include "Objects/CaloHit.h"
17#include "Objects/MCParticle.h"
18#include "Objects/Track.h"
19
21
22namespace pandora
23{
24
25XmlFileWriter::XmlFileWriter(const pandora::Pandora &pandora, const std::string &fileName, const FileMode fileMode) :
26 FileWriter(pandora, fileName),
27 m_pContainerXmlElement(nullptr),
28 m_pCurrentXmlElement(nullptr)
29{
31
32 if (APPEND == fileMode)
33 {
34 m_pXmlDocument = new TiXmlDocument(fileName);
35
37 {
38 std::cout << "XmlFileWriter, fileMode: Append - Invalid xml file." << std::endl;
39 delete m_pXmlDocument;
40 throw StatusCodeException(STATUS_CODE_FAILURE);
41 }
42 }
43 else if (OVERWRITE == fileMode)
44 {
46 }
47 else
48 {
49 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
50 }
51}
52
53//------------------------------------------------------------------------------------------------------------------------------------------
54
60
61//------------------------------------------------------------------------------------------------------------------------------------------
62
64{
65 const std::string containerXmlKey((GEOMETRY_CONTAINER == containerId) ? "Geometry" : (EVENT_CONTAINER == containerId) ? "Event" : "Unknown");
66 m_pContainerXmlElement = new TiXmlElement(containerXmlKey);
68
69 m_containerId = containerId;
70
71 return STATUS_CODE_SUCCESS;
72}
73
74//------------------------------------------------------------------------------------------------------------------------------------------
75
77{
79 return STATUS_CODE_FAILURE;
80
82
83 return STATUS_CODE_SUCCESS;
84}
85
86//------------------------------------------------------------------------------------------------------------------------------------------
87
89{
91 return STATUS_CODE_FAILURE;
92
93 m_pCurrentXmlElement = new TiXmlElement("SubDetector");
94 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pSubDetectorFactory->Write(pSubDetector, *this));
95
96 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("SubDetectorName", pSubDetector->GetSubDetectorName()));
97 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("SubDetectorType", pSubDetector->GetSubDetectorType()));
98 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("InnerRCoordinate", pSubDetector->GetInnerRCoordinate()));
99 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("InnerZCoordinate", pSubDetector->GetInnerZCoordinate()));
100 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("InnerPhiCoordinate", pSubDetector->GetInnerPhiCoordinate()));
101 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("InnerSymmetryOrder", pSubDetector->GetInnerSymmetryOrder()));
102 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("OuterRCoordinate", pSubDetector->GetOuterRCoordinate()));
103 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("OuterZCoordinate", pSubDetector->GetOuterZCoordinate()));
104 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("OuterPhiCoordinate", pSubDetector->GetOuterPhiCoordinate()));
105 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("OuterSymmetryOrder", pSubDetector->GetOuterSymmetryOrder()));
106 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("IsMirroredInZ", pSubDetector->IsMirroredInZ()));
107
108 const unsigned int nLayers(pSubDetector->GetNLayers());
109 const SubDetector::SubDetectorLayerVector &subDetectorLayerVector(pSubDetector->GetSubDetectorLayerVector());
110
111 if (subDetectorLayerVector.size() != nLayers)
112 return STATUS_CODE_FAILURE;
113
114 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("NLayers", nLayers));
115
116 if (nLayers > 0)
117 {
118 std::string closestDistanceToIpString, nRadiationLengthsString, nInteractionLengthsString;
119
120 for (unsigned int iLayer = 0; iLayer < nLayers; ++iLayer)
121 {
122 closestDistanceToIpString += TypeToString(subDetectorLayerVector.at(iLayer).GetClosestDistanceToIp()) + " ";
123 nRadiationLengthsString += TypeToString(subDetectorLayerVector.at(iLayer).GetNRadiationLengths()) + " ";
124 nInteractionLengthsString += TypeToString(subDetectorLayerVector.at(iLayer).GetNInteractionLengths()) + " ";
125 }
126
127 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("ClosestDistanceToIp", closestDistanceToIpString));
128 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("NRadiationLengths", nRadiationLengthsString));
129 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("NInteractionLengths", nInteractionLengthsString));
130 }
131
133 m_pCurrentXmlElement = nullptr;
134
135 return STATUS_CODE_SUCCESS;
136}
137
138//------------------------------------------------------------------------------------------------------------------------------------------
139
141{
143 return STATUS_CODE_FAILURE;
144
145 m_pCurrentXmlElement = new TiXmlElement("LArTPC");
146 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pLArTPCFactory->Write(pLArTPC, *this));
147
148 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("LArTPCVolumeId", pLArTPC->GetLArTPCVolumeId()));
149 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("CenterX", pLArTPC->GetCenterX()));
150 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("CenterY", pLArTPC->GetCenterY()));
151 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("CenterZ", pLArTPC->GetCenterZ()));
152 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("WidthX", pLArTPC->GetWidthX()));
153 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("WidthY", pLArTPC->GetWidthY()));
154 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("WidthZ", pLArTPC->GetWidthZ()));
155 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("WirePitchU", pLArTPC->GetWirePitchU()));
156 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("WirePitchV", pLArTPC->GetWirePitchV()));
157 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("WirePitchW", pLArTPC->GetWirePitchW()));
158 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("WireAngleU", pLArTPC->GetWireAngleU()));
159 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("WireAngleV", pLArTPC->GetWireAngleV()));
160 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("WireAngleW", pLArTPC->GetWireAngleW()));
161 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("SigmaUVW", pLArTPC->GetSigmaUVW()));
162 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("IsDriftInPositiveX", pLArTPC->IsDriftInPositiveX()));
163
165 m_pCurrentXmlElement = nullptr;
166
167 return STATUS_CODE_SUCCESS;
168}
169
170//------------------------------------------------------------------------------------------------------------------------------------------
171
173{
175 return STATUS_CODE_FAILURE;
176
177 const LineGap *pLineGap(nullptr);
178 pLineGap = dynamic_cast<const LineGap *>(pDetectorGap);
179
180 const BoxGap *pBoxGap(nullptr);
181 pBoxGap = dynamic_cast<const BoxGap *>(pDetectorGap);
182
183 const ConcentricGap *pConcentricGap(nullptr);
184 pConcentricGap = dynamic_cast<const ConcentricGap *>(pDetectorGap);
185
186 if (nullptr != pLineGap)
187 {
188 m_pCurrentXmlElement = new TiXmlElement("LineGap");
189 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pLineGapFactory->Write(pLineGap, *this));
190
191 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("LineGapType", pLineGap->GetLineGapType()));
192 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("LineStartX", pLineGap->GetLineStartX()));
193 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("LineEndX", pLineGap->GetLineEndX()));
194 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("LineStartZ", pLineGap->GetLineStartZ()));
195 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("LineEndZ", pLineGap->GetLineEndZ()));
196
198 m_pCurrentXmlElement = nullptr;
199 }
200 else if (nullptr != pBoxGap)
201 {
202 m_pCurrentXmlElement = new TiXmlElement("BoxGap");
203 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pBoxGapFactory->Write(pBoxGap, *this));
204
205 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Vertex", pBoxGap->GetVertex()));
206 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Side1", pBoxGap->GetSide1()));
207 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Side2", pBoxGap->GetSide2()));
208 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Side3", pBoxGap->GetSide3()));
209
211 m_pCurrentXmlElement = nullptr;
212 }
213 else if (nullptr != pConcentricGap)
214 {
215 m_pCurrentXmlElement = new TiXmlElement("ConcentricGap");
216 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pConcentricGapFactory->Write(pConcentricGap, *this));
217
218 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("MinZCoordinate", pConcentricGap->GetMinZCoordinate()));
219 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("MaxZCoordinate", pConcentricGap->GetMaxZCoordinate()));
220 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("InnerRCoordinate", pConcentricGap->GetInnerRCoordinate()));
221 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("InnerPhiCoordinate", pConcentricGap->GetInnerPhiCoordinate()));
222 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("InnerSymmetryOrder", pConcentricGap->GetInnerSymmetryOrder()));
223 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("OuterRCoordinate", pConcentricGap->GetOuterRCoordinate()));
224 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("OuterPhiCoordinate", pConcentricGap->GetOuterPhiCoordinate()));
225 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("OuterSymmetryOrder", pConcentricGap->GetOuterSymmetryOrder()));
226
228 m_pCurrentXmlElement = nullptr;
229 }
230 else
231 {
232 return STATUS_CODE_FAILURE;
233 }
234
235 return STATUS_CODE_SUCCESS;
236}
237
238//------------------------------------------------------------------------------------------------------------------------------------------
239
241{
243 return STATUS_CODE_FAILURE;
244
245 m_pCurrentXmlElement = new TiXmlElement("CaloHit");
246 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pCaloHitFactory->Write(pCaloHit, *this));
247
248 const CellGeometry cellGeometry(pCaloHit->GetCellGeometry());
249 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("CellGeometry", cellGeometry));
250 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("PositionVector", pCaloHit->GetPositionVector()));
251 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("ExpectedDirection", pCaloHit->GetExpectedDirection()));
252 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("CellNormalVector", pCaloHit->GetCellNormalVector()));
253 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("CellThickness", pCaloHit->GetCellThickness()));
254 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("NCellRadiationLengths", pCaloHit->GetNCellRadiationLengths()));
255 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("NCellInteractionLengths", pCaloHit->GetNCellInteractionLengths()));
256 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Time", pCaloHit->GetTime()));
257 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("InputEnergy", pCaloHit->GetInputEnergy()));
258 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("MipEquivalentEnergy", pCaloHit->GetMipEquivalentEnergy()));
259 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("ElectromagneticEnergy", pCaloHit->GetElectromagneticEnergy()));
260 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("HadronicEnergy", pCaloHit->GetHadronicEnergy()));
261 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("IsDigital", pCaloHit->IsDigital()));
262 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("HitType", pCaloHit->GetHitType()));
263 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("HitRegion", pCaloHit->GetHitRegion()));
264 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Layer", pCaloHit->GetLayer()));
265 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("IsInOuterSamplingLayer", pCaloHit->IsInOuterSamplingLayer()));
266 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("ParentCaloHitAddress", pCaloHit->GetParentAddress()));
267 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("CellSize0", pCaloHit->GetCellSize0()));
268 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("CellSize1", pCaloHit->GetCellSize1()));
269
271 m_pCurrentXmlElement = nullptr;
272
273 return STATUS_CODE_SUCCESS;
274}
275
276//------------------------------------------------------------------------------------------------------------------------------------------
277
279{
281 return STATUS_CODE_FAILURE;
282
283 m_pCurrentXmlElement = new TiXmlElement("Track");
284 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pTrackFactory->Write(pTrack, *this));
285
286 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("D0", pTrack->GetD0()));
287 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Z0", pTrack->GetZ0()));
288 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("ParticleId", pTrack->GetParticleId()));
289 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Charge", pTrack->GetCharge()));
290 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Mass", pTrack->GetMass()));
291 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("MomentumAtDca", pTrack->GetMomentumAtDca()));
292 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("TrackStateAtStart", pTrack->GetTrackStateAtStart()));
293 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("TrackStateAtEnd", pTrack->GetTrackStateAtEnd()));
294 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("TrackStateAtCalorimeter", pTrack->GetTrackStateAtCalorimeter()));
295 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("TimeAtCalorimeter", pTrack->GetTimeAtCalorimeter()));
296 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("ReachesCalorimeter", pTrack->ReachesCalorimeter()));
297 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("IsProjectedToEndCap", pTrack->IsProjectedToEndCap()));
298 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("CanFormPfo", pTrack->CanFormPfo()));
299 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("CanFormClusterlessPfo", pTrack->CanFormClusterlessPfo()));
300 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("ParentTrackAddress", pTrack->GetParentAddress()));
301
303 m_pCurrentXmlElement = nullptr;
304
305 return STATUS_CODE_SUCCESS;
306}
307
308//------------------------------------------------------------------------------------------------------------------------------------------
309
311{
313 return STATUS_CODE_FAILURE;
314
315 m_pCurrentXmlElement = new TiXmlElement("MCParticle");
316 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pMCParticleFactory->Write(pMCParticle, *this));
317
318 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Energy", pMCParticle->GetEnergy()));
319 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Momentum", pMCParticle->GetMomentum()));
320 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Vertex", pMCParticle->GetVertex()));
321 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Endpoint", pMCParticle->GetEndpoint()));
322 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("ParticleId", pMCParticle->GetParticleId()));
323 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("MCParticleType", pMCParticle->GetMCParticleType()));
324 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Uid", pMCParticle->GetUid()));
325
327 m_pCurrentXmlElement = nullptr;
328
329 return STATUS_CODE_SUCCESS;
330}
331
332//------------------------------------------------------------------------------------------------------------------------------------------
333
334StatusCode XmlFileWriter::WriteRelationship(const RelationshipId relationshipId, const void *address1, const void *address2, const float weight)
335{
337 return STATUS_CODE_FAILURE;
338
339 m_pCurrentXmlElement = new TiXmlElement("Relationship");
340
341 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("RelationshipId", relationshipId));
342 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Address1", address1));
343 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Address2", address2));
344 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable("Weight", weight));
345
347 m_pCurrentXmlElement = nullptr;
348
349 return STATUS_CODE_SUCCESS;
350}
351
352} // namespace pandora
Header file for the calo hit class.
Header file for the detector gap class.
Header file for the lar tpc class.
Header file for the mc particle class.
Header file for the pandora content api class.
Header file for the pandora content api implementation class.
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
Definition StatusCodes.h:19
Header file for the sub detector class.
Header file for the track class.
Header file for the xml file writer class.
BoxGap class, associated with all 3D hit types.
const CartesianVector & GetSide1() const
Get the vector describing first side meeting vertex.
const CartesianVector & GetSide2() const
Get the vector describing second side meeting vertex.
const CartesianVector & GetSide3() const
Get the vector describing third side meeting vertex.
const CartesianVector & GetVertex() const
Get the gap vertex.
CaloHit class.
Definition CaloHit.h:26
float GetElectromagneticEnergy() const
Get the calibrated electromagnetic energy measure.
Definition CaloHit.h:483
HitType GetHitType() const
Get the calorimeter hit type.
Definition CaloHit.h:441
CellGeometry GetCellGeometry() const
Get the cell geometry.
Definition CaloHit.h:378
bool IsInOuterSamplingLayer() const
Whether cell is in one of the outermost detector sampling layers.
Definition CaloHit.h:469
HitRegion GetHitRegion() const
Get the region of the detector in which the calo hit is located.
Definition CaloHit.h:448
const CartesianVector & GetPositionVector() const
Get the position vector of center of calorimeter cell, units mm.
Definition CaloHit.h:350
unsigned int GetLayer() const
Get the subdetector readout layer number.
Definition CaloHit.h:455
float GetMipEquivalentEnergy() const
Get the calibrated mip equivalent energy.
Definition CaloHit.h:476
float GetNCellRadiationLengths() const
Get the absorber material in front of cell, units radiation lengths.
Definition CaloHit.h:406
float GetNCellInteractionLengths() const
Get the absorber material in front of cell, units interaction lengths.
Definition CaloHit.h:413
float GetCellThickness() const
Get the thickness of cell, units mm.
Definition CaloHit.h:399
float GetCellSize1() const
Get the cell size 1 [pointing: phi, rectangular: perpendicular to size 0 and thickness,...
Definition CaloHit.h:392
bool IsDigital() const
Whether cell should be treated as digital.
Definition CaloHit.h:434
float GetCellSize0() const
Get the cell size 0 [pointing: eta, rectangular: up in ENDCAP, along beam in BARREL,...
Definition CaloHit.h:385
const CartesianVector & GetCellNormalVector() const
Get the unit vector normal to the sampling layer, pointing outwards from the origin.
Definition CaloHit.h:371
float GetHadronicEnergy() const
Get the calibrated hadronic energy measure.
Definition CaloHit.h:490
float GetInputEnergy() const
Get the corrected energy of the calorimeter cell, units GeV, as supplied by the user.
Definition CaloHit.h:420
float GetTime() const
Get the time of (earliest) energy deposition in this cell, units ns.
Definition CaloHit.h:427
const void * GetParentAddress() const
Get the address of the parent calo hit in the user framework.
Definition CaloHit.h:532
const CartesianVector & GetExpectedDirection() const
Get the unit vector in direction of expected hit propagation.
Definition CaloHit.h:364
ConcentricGap class, associated with all 3D hit types.
float GetInnerRCoordinate() const
Get the inner cylindrical polar r coordinate, origin interaction point.
float GetMaxZCoordinate() const
Get the max cylindrical polar z coordinate, origin interaction point.
float GetOuterPhiCoordinate() const
Get the outer cylindrical polar phi coordinate.
unsigned int GetOuterSymmetryOrder() const
Get the order of symmetry of the outermost edge of gap.
float GetInnerPhiCoordinate() const
Get the inner cylindrical polar phi coordinate.
unsigned int GetInnerSymmetryOrder() const
Get the order of symmetry of the innermost edge of gap.
float GetOuterRCoordinate() const
Get the outer cylindrical polar r coordinate, origin interaction point.
float GetMinZCoordinate() const
Get the min cylindrical polar z coordinate, origin interaction point.
DetectorGap class.
Definition DetectorGap.h:25
FileWriter class.
Definition FileWriter.h:29
LArTPC class.
Definition LArTPC.h:26
float GetWireAngleV() const
Get the v wire angle to the vertical, units radians.
Definition LArTPC.h:245
float GetWirePitchU() const
Get the u wire pitch, units mm.
Definition LArTPC.h:217
float GetCenterY() const
Get center in y, units mm.
Definition LArTPC.h:182
float GetWidthZ() const
Get the width in z, units mm.
Definition LArTPC.h:210
float GetWireAngleW() const
Get the w wire angle to the vertical, units radians.
Definition LArTPC.h:252
float GetCenterZ() const
Get center in z, units mm.
Definition LArTPC.h:189
bool IsDriftInPositiveX() const
Whether the electron drift is in the positive x direction.
Definition LArTPC.h:266
float GetCenterX() const
Get center in x, units mm.
Definition LArTPC.h:175
float GetWirePitchV() const
Get the v wire pitch, units mm.
Definition LArTPC.h:224
float GetWidthX() const
Get the width in x, units mm.
Definition LArTPC.h:196
float GetWidthY() const
Get the width in y, units mm.
Definition LArTPC.h:203
float GetWireAngleU() const
Get the u wire angle to the vertical, units radians.
Definition LArTPC.h:238
float GetWirePitchW() const
Get the w wire pitch, units mm.
Definition LArTPC.h:231
unsigned int GetLArTPCVolumeId() const
Get the lar volume id, uniquely specifying the lar tpc.
Definition LArTPC.h:168
float GetSigmaUVW() const
Get the u, v, w resolution, units mm.
Definition LArTPC.h:259
LineGap class, associated only with 2D TPC hit types and applied only to the z coordinate when sampli...
Definition DetectorGap.h:50
float GetLineEndZ() const
Get the line end z coordinate.
LineGapType GetLineGapType() const
Get the line gap type.
float GetLineStartX() const
Get the line start x coordinate.
float GetLineStartZ() const
Get the line start z coordinate.
float GetLineEndX() const
Get the line end x coordinate.
MCParticle class.
Definition MCParticle.h:26
MCParticleType GetMCParticleType() const
Get the type of the mc particle, e.g. vertex, 2D-projection, etc.
Definition MCParticle.h:292
Uid GetUid() const
Get the mc particle unique identifier.
Definition MCParticle.h:236
float GetEnergy() const
Get energy of mc particle, units GeV.
Definition MCParticle.h:243
const CartesianVector & GetMomentum() const
Get momentum of mc particle, units GeV.
Definition MCParticle.h:250
const CartesianVector & GetEndpoint() const
Get the endpoint of the mc particle, units mm.
Definition MCParticle.h:264
const CartesianVector & GetVertex() const
Get the production vertex of the mc particle, units mm.
Definition MCParticle.h:257
int GetParticleId() const
Get the PDG code of the mc particle.
Definition MCParticle.h:285
virtual StatusCode Write(const Object *const pObject, FileWriter &fileWriter) const =0
Persist any additional (derived class only) object parameters using the specified file writer.
Pandora class.
Definition Pandora.h:40
ObjectFactory< object_creation::Geometry::BoxGap::Parameters, object_creation::Geometry::BoxGap::Object > * m_pBoxGapFactory
Address of the box gap factory.
Definition Persistency.h:84
ContainerId m_containerId
The type of container currently being written to file.
Definition Persistency.h:76
ObjectFactory< object_creation::MCParticle::Parameters, object_creation::MCParticle::Object > * m_pMCParticleFactory
Address of the mc particle factory.
Definition Persistency.h:80
ObjectFactory< object_creation::Geometry::LArTPC::Parameters, object_creation::Geometry::LArTPC::Object > * m_pLArTPCFactory
Address of the lar tpc factory.
Definition Persistency.h:82
ObjectFactory< object_creation::Track::Parameters, object_creation::Track::Object > * m_pTrackFactory
Address of the track factory.
Definition Persistency.h:79
ObjectFactory< object_creation::CaloHit::Parameters, object_creation::CaloHit::Object > * m_pCaloHitFactory
Address of the calo hit factory.
Definition Persistency.h:78
ObjectFactory< object_creation::Geometry::LineGap::Parameters, object_creation::Geometry::LineGap::Object > * m_pLineGapFactory
Address of the line gap factory.
Definition Persistency.h:83
ObjectFactory< object_creation::Geometry::ConcentricGap::Parameters, object_creation::Geometry::ConcentricGap::Object > * m_pConcentricGapFactory
Address of the concentric gap factory.
Definition Persistency.h:85
std::string m_fileName
The file name.
Definition Persistency.h:74
ObjectFactory< object_creation::Geometry::SubDetector::Parameters, object_creation::Geometry::SubDetector::Object > * m_pSubDetectorFactory
Address of the sub detector factory.
Definition Persistency.h:81
FileType m_fileType
The file type.
Definition Persistency.h:75
StatusCodeException class.
SubDetector class.
Definition SubDetector.h:26
const std::string & GetSubDetectorName() const
Get the sub detector name, uniquely specifying the sub detector.
float GetOuterPhiCoordinate() const
Get the outer cylindrical polar phi coordinate (angle wrt cartesian x axis)
float GetInnerRCoordinate() const
Get the inner cylindrical polar r coordinate, origin interaction point, units mm.
unsigned int GetOuterSymmetryOrder() const
Get the order of symmetry of the outermost edge of sub detector.
float GetInnerPhiCoordinate() const
Get the inner cylindrical polar phi coordinate (angle wrt cartesian x axis)
SubDetectorType GetSubDetectorType() const
Get the sub detector type, e.g. ECAL_BARREL, HCAL_ENDCAP, TPC, etc.
float GetOuterRCoordinate() const
Get the outer cylindrical polar r coordinate, origin interaction point, units mm.
unsigned int GetInnerSymmetryOrder() const
Get the order of symmetry of the innermost edge of subdetector.
float GetOuterZCoordinate() const
Get the outer cylindrical polar z coordinate, origin interaction point, units mm.
unsigned int GetNLayers() const
Get the number of layers in the sub detector.
std::vector< SubDetectorLayer > SubDetectorLayerVector
Definition SubDetector.h:70
bool IsMirroredInZ() const
Whether a second sub detector exists, equivalent to a reflection in z=0 plane.
const SubDetectorLayerVector & GetSubDetectorLayerVector() const
Get the vector of layer parameters for the sub detector.
float GetInnerZCoordinate() const
Get the inner cylindrical polar z coordinate, origin interaction point, units mm.
bool SaveFile() const
Save a file using the current document value. Returns true if successful.
Definition tinyxml.cc:963
bool LoadFile(TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
Definition tinyxml.cc:957
TiXmlNode * LinkEndChild(TiXmlNode *addThis)
Definition tinyxml.cc:189
Track class.
Definition Track.h:26
bool CanFormClusterlessPfo() const
Whether track should form a pfo, even if it has no associated cluster.
Definition Track.h:393
float GetZ0() const
Get the z coordinate at the 2D distance of closest approach.
Definition Track.h:302
const TrackState & GetTrackStateAtStart() const
Get the track state at the start of the track.
Definition Track.h:344
bool ReachesCalorimeter() const
Whether the track reaches the calorimeter.
Definition Track.h:372
bool IsProjectedToEndCap() const
Whether the calorimeter projection is to an endcap.
Definition Track.h:379
const CartesianVector & GetMomentumAtDca() const
Get the track momentum at the 2D distance of closest approach.
Definition Track.h:330
int GetParticleId() const
Get the PDG code of the tracked particle.
Definition Track.h:309
const TrackState & GetTrackStateAtEnd() const
Get the track state at the end of the track.
Definition Track.h:351
float GetTimeAtCalorimeter() const
Get the (sometimes projected) time at the calorimeter.
Definition Track.h:365
bool CanFormPfo() const
Whether track should form a pfo, if it has an associated cluster.
Definition Track.h:386
int GetCharge() const
Get the charge of the tracked particle.
Definition Track.h:316
float GetD0() const
Get the 2D impact parameter wrt (0,0)
Definition Track.h:295
const TrackState & GetTrackStateAtCalorimeter() const
Get the (sometimes projected) track state at the calorimeter.
Definition Track.h:358
float GetMass() const
Get the mass of the tracked particle, units GeV.
Definition Track.h:323
const void * GetParentAddress() const
Get the address of the parent track in the user framework.
Definition Track.h:414
StatusCode WriteVariable(const std::string &xmlKey, const T &t)
Write a variable to the file.
TiXmlDocument * m_pXmlDocument
The xml document.
TiXmlElement * m_pContainerXmlElement
The container xml element.
StatusCode WriteLArTPC(const LArTPC *const pLArTPC)
Write a lar tpc to the file.
StatusCode WriteHeader(const ContainerId containerId)
Write the container header to the file.
StatusCode WriteSubDetector(const SubDetector *const pSubDetector)
Write a sub detector to the file.
StatusCode WriteCaloHit(const CaloHit *const pCaloHit)
Write a calo hit to the current position in the file.
StatusCode WriteTrack(const Track *const pTrack)
Write a track to the current position in the file.
StatusCode WriteMCParticle(const MCParticle *const pMCParticle)
Write a mc particle to the current position in the file.
StatusCode WriteFooter()
Write the container footer to the file.
~XmlFileWriter()
Destructor.
StatusCode WriteDetectorGap(const DetectorGap *const pDetectorGap)
Write the detector gap parameters to the file.
TiXmlElement * m_pCurrentXmlElement
The current xml element.
StatusCode WriteRelationship(const RelationshipId relationshipId, const void *address1, const void *address2, const float weight)
Write a relationship between two objects with specified addresses.
XmlFileWriter(const pandora::Pandora &pandora, const std::string &fileName, const FileMode fileMode=APPEND)
Constructor.
FileMode
The file mode enum.
Definition PandoraIO.h:84
@ OVERWRITE
Definition PandoraIO.h:86
RelationshipId
The relationship identification enum.
Definition PandoraIO.h:57
CellGeometry
Cell geometry enum.
ContainerId
The container identification enum.
Definition PandoraIO.h:24
@ EVENT_CONTAINER
Definition PandoraIO.h:25
@ UNKNOWN_CONTAINER
Definition PandoraIO.h:27
@ GEOMETRY_CONTAINER
Definition PandoraIO.h:26
std::string TypeToString(const T &t)
StatusCode
The StatusCode enum.