Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
BinaryFileWriter.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
25BinaryFileWriter::BinaryFileWriter(const pandora::Pandora &pandora, const std::string &fileName, const FileMode fileMode) :
26 FileWriter(pandora, fileName)
27{
29
30 if (APPEND == fileMode)
31 {
32 m_fileStream.open(fileName.c_str(), std::ios::out | std::ios::in | std::ios::binary | std::ios::ate);
33
34 if (!m_fileStream.is_open())
35 {
36 m_fileStream.open(fileName.c_str(), std::ios::out | std::ios::binary);
37 }
38 }
39 else if (OVERWRITE == fileMode)
40 {
41 m_fileStream.open(fileName.c_str(), std::ios::out | std::ios::binary | std::ios::trunc);
42 }
43 else
44 {
45 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
46 }
47
48 if (!m_fileStream.is_open() || !m_fileStream.good())
49 throw StatusCodeException(STATUS_CODE_FAILURE);
50
52}
53
54//------------------------------------------------------------------------------------------------------------------------------------------
55
60
61//------------------------------------------------------------------------------------------------------------------------------------------
62
64{
65 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(PANDORA_FILE_HASH));
66 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(containerId));
67
69 const std::ofstream::pos_type dummyContainerSize(0);
70 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(dummyContainerSize));
71
72 m_containerId = containerId;
73
74 return STATUS_CODE_SUCCESS;
75}
76
77//------------------------------------------------------------------------------------------------------------------------------------------
78
80{
82 return STATUS_CODE_FAILURE;
83
86
87 const std::ofstream::pos_type containerSize(m_fileStream.tellp() - m_containerPosition);
88 m_fileStream.seekp(m_containerPosition, std::ios::beg);
89
90 if (!m_fileStream.good())
91 return STATUS_CODE_FAILURE;
92
93 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(containerSize));
94 m_fileStream.seekp(0, std::ios::end);
95
96 if (!m_fileStream.good())
97 return STATUS_CODE_FAILURE;
98
100
101 return STATUS_CODE_SUCCESS;
102}
103
104//------------------------------------------------------------------------------------------------------------------------------------------
105
107{
109 return STATUS_CODE_FAILURE;
110
111 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(SUB_DETECTOR_COMPONENT));
112 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pSubDetectorFactory->Write(pSubDetector, *this));
113
114 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pSubDetector->GetSubDetectorName()));
115 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pSubDetector->GetSubDetectorType()));
116 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pSubDetector->GetInnerRCoordinate()));
117 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pSubDetector->GetInnerZCoordinate()));
118 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pSubDetector->GetInnerPhiCoordinate()));
119 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pSubDetector->GetInnerSymmetryOrder()));
120 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pSubDetector->GetOuterRCoordinate()));
121 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pSubDetector->GetOuterZCoordinate()));
122 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pSubDetector->GetOuterPhiCoordinate()));
123 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pSubDetector->GetOuterSymmetryOrder()));
124 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pSubDetector->IsMirroredInZ()));
125
126 const unsigned int nLayers(pSubDetector->GetNLayers());
127 const SubDetector::SubDetectorLayerVector &subDetectorLayerVector(pSubDetector->GetSubDetectorLayerVector());
128
129 if (subDetectorLayerVector.size() != nLayers)
130 return STATUS_CODE_FAILURE;
131
132 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(nLayers));
133
134 for (unsigned int iLayer = 0; iLayer < nLayers; ++iLayer)
135 {
136 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(subDetectorLayerVector.at(iLayer).GetClosestDistanceToIp()));
137 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(subDetectorLayerVector.at(iLayer).GetNRadiationLengths()));
138 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(subDetectorLayerVector.at(iLayer).GetNInteractionLengths()));
139 }
140
141 return STATUS_CODE_SUCCESS;
142}
143
144//------------------------------------------------------------------------------------------------------------------------------------------
145
147{
149 return STATUS_CODE_FAILURE;
150
151 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(LAR_TPC_COMPONENT));
152 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pLArTPCFactory->Write(pLArTPC, *this));
153
154 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLArTPC->GetLArTPCVolumeId()));
155 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLArTPC->GetCenterX()));
156 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLArTPC->GetCenterY()));
157 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLArTPC->GetCenterZ()));
158 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLArTPC->GetWidthX()));
159 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLArTPC->GetWidthY()));
160 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLArTPC->GetWidthZ()));
161 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLArTPC->GetWirePitchU()));
162 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLArTPC->GetWirePitchV()));
163 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLArTPC->GetWirePitchW()));
164 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLArTPC->GetWireAngleU()));
165 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLArTPC->GetWireAngleV()));
166 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLArTPC->GetWireAngleW()));
167 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLArTPC->GetSigmaUVW()));
168 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLArTPC->IsDriftInPositiveX()));
169
170 return STATUS_CODE_SUCCESS;
171}
172
173//------------------------------------------------------------------------------------------------------------------------------------------
174
176{
178 return STATUS_CODE_FAILURE;
179
180 const LineGap *pLineGap(nullptr);
181 pLineGap = dynamic_cast<const LineGap *>(pDetectorGap);
182
183 const BoxGap *pBoxGap(nullptr);
184 pBoxGap = dynamic_cast<const BoxGap *>(pDetectorGap);
185
186 const ConcentricGap *pConcentricGap(nullptr);
187 pConcentricGap = dynamic_cast<const ConcentricGap *>(pDetectorGap);
188
189 if (nullptr != pLineGap)
190 {
191 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(LINE_GAP_COMPONENT));
192 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pLineGapFactory->Write(pLineGap, *this));
193
194 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLineGap->GetLineGapType()));
195 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLineGap->GetLineStartX()));
196 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLineGap->GetLineEndX()));
197 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLineGap->GetLineStartZ()));
198 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pLineGap->GetLineEndZ()));
199 }
200 else if (nullptr != pBoxGap)
201 {
202 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(BOX_GAP_COMPONENT));
203 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pBoxGapFactory->Write(pBoxGap, *this));
204
205 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pBoxGap->GetVertex()));
206 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pBoxGap->GetSide1()));
207 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pBoxGap->GetSide2()));
208 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pBoxGap->GetSide3()));
209 }
210 else if (nullptr != pConcentricGap)
211 {
212 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(CONCENTRIC_GAP_COMPONENT));
213 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pConcentricGapFactory->Write(pConcentricGap, *this));
214
215 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pConcentricGap->GetMinZCoordinate()));
216 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pConcentricGap->GetMaxZCoordinate()));
217 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pConcentricGap->GetInnerRCoordinate()));
218 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pConcentricGap->GetInnerPhiCoordinate()));
219 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pConcentricGap->GetInnerSymmetryOrder()));
220 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pConcentricGap->GetOuterRCoordinate()));
221 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pConcentricGap->GetOuterPhiCoordinate()));
222 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pConcentricGap->GetOuterSymmetryOrder()));
223 }
224 else
225 {
226 return STATUS_CODE_FAILURE;
227 }
228
229 return STATUS_CODE_SUCCESS;
230}
231
232//------------------------------------------------------------------------------------------------------------------------------------------
233
235{
237 return STATUS_CODE_FAILURE;
238
239 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(CALO_HIT_COMPONENT));
240 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pCaloHitFactory->Write(pCaloHit, *this));
241
242 const CellGeometry cellGeometry(pCaloHit->GetCellGeometry());
243 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(cellGeometry));
244 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetPositionVector()));
245 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetExpectedDirection()));
246 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetCellNormalVector()));
247 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetCellThickness()));
248 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetNCellRadiationLengths()));
249 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetNCellInteractionLengths()));
250 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetTime()));
251 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetInputEnergy()));
252 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetMipEquivalentEnergy()));
253 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetElectromagneticEnergy()));
254 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetHadronicEnergy()));
255 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->IsDigital()));
256 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetHitType()));
257 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetHitRegion()));
258 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetLayer()));
259 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->IsInOuterSamplingLayer()));
260 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetParentAddress()));
261 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetCellSize0()));
262 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pCaloHit->GetCellSize1()));
263
264 return STATUS_CODE_SUCCESS;
265}
266
267//------------------------------------------------------------------------------------------------------------------------------------------
268
270{
272 return STATUS_CODE_FAILURE;
273
274 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(TRACK_COMPONENT));
275 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pTrackFactory->Write(pTrack, *this));
276
277 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pTrack->GetD0()));
278 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pTrack->GetZ0()));
279 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pTrack->GetParticleId()));
280 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pTrack->GetCharge()));
281 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pTrack->GetMass()));
282 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pTrack->GetMomentumAtDca()));
283 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pTrack->GetTrackStateAtStart()));
284 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pTrack->GetTrackStateAtEnd()));
285 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pTrack->GetTrackStateAtCalorimeter()));
286 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pTrack->GetTimeAtCalorimeter()));
287 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pTrack->ReachesCalorimeter()));
288 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pTrack->IsProjectedToEndCap()));
289 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pTrack->CanFormPfo()));
290 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pTrack->CanFormClusterlessPfo()));
291 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pTrack->GetParentAddress()));
292
293 return STATUS_CODE_SUCCESS;
294}
295
296//------------------------------------------------------------------------------------------------------------------------------------------
297
299{
301 return STATUS_CODE_FAILURE;
302
303 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(MC_PARTICLE_COMPONENT));
304 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, m_pMCParticleFactory->Write(pMCParticle, *this));
305
306 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pMCParticle->GetEnergy()));
307 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pMCParticle->GetMomentum()));
308 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pMCParticle->GetVertex()));
309 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pMCParticle->GetEndpoint()));
310 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pMCParticle->GetParticleId()));
311 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pMCParticle->GetMCParticleType()));
312 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(pMCParticle->GetUid()));
313
314 return STATUS_CODE_SUCCESS;
315}
316
317//------------------------------------------------------------------------------------------------------------------------------------------
318
319StatusCode BinaryFileWriter::WriteRelationship(const RelationshipId relationshipId, const void *address1, const void *address2, const float weight)
320{
322 return STATUS_CODE_FAILURE;
323
324 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(RELATIONSHIP_COMPONENT));
325 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(relationshipId));
326 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(address1));
327 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(address2));
328 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->WriteVariable(weight));
329
330 return STATUS_CODE_SUCCESS;
331}
332
333} // namespace pandora
Header file for the binary file writer class.
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.
StatusCode WriteSubDetector(const SubDetector *const pSubDetector)
Write a sub detector to the file.
std::ofstream::pos_type m_containerPosition
Position of start of the current event/geometry container object in file.
StatusCode WriteDetectorGap(const DetectorGap *const pDetectorGap)
Write the detector gap parameters to the file.
StatusCode WriteTrack(const Track *const pTrack)
Write a track to the current position in the file.
StatusCode WriteLArTPC(const LArTPC *const pLArTPC)
Write a lar tpc to the file.
BinaryFileWriter(const pandora::Pandora &pandora, const std::string &fileName, const FileMode fileMode=APPEND)
Constructor.
StatusCode WriteHeader(const ContainerId containerId)
Write the container header to the file.
StatusCode WriteCaloHit(const CaloHit *const pCaloHit)
Write a calo hit to the current position in the file.
StatusCode WriteMCParticle(const MCParticle *const pMCParticle)
Write a mc particle to the current position in the file.
std::ofstream m_fileStream
The stream class to write to the file.
StatusCode WriteRelationship(const RelationshipId relationshipId, const void *address1, const void *address2, const float weight)
Write a relationship between two objects with specified addresses.
StatusCode WriteFooter()
Write the container footer to the file.
StatusCode WriteVariable(const T &t)
Write a variable to the file.
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
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.
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
@ GEOMETRY_END_COMPONENT
Definition PandoraIO.h:46
@ LINE_GAP_COMPONENT
Definition PandoraIO.h:43
@ TRACK_COMPONENT
Definition PandoraIO.h:38
@ BOX_GAP_COMPONENT
Definition PandoraIO.h:44
@ CONCENTRIC_GAP_COMPONENT
Definition PandoraIO.h:45
@ SUB_DETECTOR_COMPONENT
Definition PandoraIO.h:42
@ MC_PARTICLE_COMPONENT
Definition PandoraIO.h:39
@ EVENT_END_COMPONENT
Definition PandoraIO.h:41
@ LAR_TPC_COMPONENT
Definition PandoraIO.h:47
@ RELATIONSHIP_COMPONENT
Definition PandoraIO.h:40
@ CALO_HIT_COMPONENT
Definition PandoraIO.h:37
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
StatusCode
The StatusCode enum.
const std::string PANDORA_FILE_HASH("pandora")
Look for hash each event to check integrity.