50 return STATUS_CODE_FAILURE;
58 return STATUS_CODE_SUCCESS;
64 const bool writeMCRelationships,
const bool writeTrackRelationships)
71 if (writeMCRelationships)
78 if (writeTrackRelationships)
85 return STATUS_CODE_SUCCESS;
97 return STATUS_CODE_SUCCESS;
109 return STATUS_CODE_SUCCESS;
121 return STATUS_CODE_SUCCESS;
128 for (
const Track *
const pTrack : trackList)
133 return STATUS_CODE_SUCCESS;
140 for (
const CaloHit *
const pCaloHit : caloHitList)
145 return STATUS_CODE_SUCCESS;
152 for (
const MCParticle *
const pMCParticle : mcParticleList)
157 return STATUS_CODE_SUCCESS;
164 for (
const CaloHit *
const pCaloHit : caloHitList)
169 return STATUS_CODE_SUCCESS;
176 for (
const Track *
const pTrack : trackList)
181 return STATUS_CODE_SUCCESS;
188 for (
const MCParticle *
const pMCParticle : mcParticleList)
193 return STATUS_CODE_SUCCESS;
200 for (
const Track *
const pTrack : trackList)
205 return STATUS_CODE_SUCCESS;
213 return STATUS_CODE_FAILURE;
218 for (
const MCParticleWeightMap::value_type &mapEntry : mcParticleWeightMap) mcParticleVector.push_back(mapEntry.first);
221 for (
const MCParticle *
const pMCParticle : mcParticleVector)
224 pMCParticle->GetUid(), mcParticleWeightMap.at(pMCParticle)));
227 return STATUS_CODE_SUCCESS;
235 return STATUS_CODE_FAILURE;
240 for (
const MCParticleWeightMap::value_type &mapEntry : mcParticleWeightMap) mcParticleVector.push_back(mapEntry.first);
243 for (
const MCParticle *
const pMCParticle : mcParticleVector)
246 pMCParticle->GetUid(), mcParticleWeightMap.at(pMCParticle)));
249 return STATUS_CODE_SUCCESS;
257 return STATUS_CODE_FAILURE;
263 for (
const MCParticle *
const pParentMCParticle : parentList)
268 for (
const MCParticle *
const pDaughterMCParticle : daughterList)
273 return STATUS_CODE_SUCCESS;
281 return STATUS_CODE_FAILURE;
288 for (
const Track *
const pParentTrack : parentList)
293 for (
const Track *
const pDaughterTrack : daughterList)
298 for (
const Track *
const pSiblingTrack : siblingList)
303 return STATUS_CODE_SUCCESS;
Header file for the calo hit class.
Header file for the detector gap class.
Header file for the file writer class.
Header file for the geometry manager class.
Header file for the lar tpc class.
Header file for the mc particle class.
Header file for the pandora class.
Header file for the pandora content api class.
Header file for the pandora content api implementation class.
Header file defining relevant internal typedefs, sort and string conversion functions.
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
Header file for the sub detector class.
Header file for the track class.
const MCParticleWeightMap & GetMCParticleWeightMap() const
Get mc particle weight map for the calo hit.
const void * GetParentAddress() const
Get the address of the parent calo hit in the user framework.
virtual ~FileWriter()
Destructor.
virtual StatusCode WriteFooter()=0
Write the container footer to the file.
virtual StatusCode WriteHeader(const ContainerId containerId)=0
Write the container header to the file.
virtual StatusCode WriteSubDetector(const SubDetector *const pSubDetector)=0
Write a sub detector to the file.
StatusCode WriteTrackToMCParticleRelationships(const TrackList &trackList)
Write track to mc particle relationships for a specified track list.
StatusCode WriteSubDetectorList()
Write the sub detector parameters to the file.
StatusCode WriteTrackList(const TrackList &trackList)
Write a track list to the current position in the file.
virtual StatusCode WriteCaloHit(const CaloHit *const pCaloHit)=0
Write a calo hit to the current position in the file.
virtual StatusCode WriteLArTPC(const LArTPC *const pLArTPC)=0
Write a lar tpc to the file.
StatusCode WriteEvent(const CaloHitList &caloHitList, const TrackList &trackList, const MCParticleList &mcParticleList, const bool writeMCRelationships=true, const bool writeTrackRelationships=true)
Write the specified event components to the file.
StatusCode WriteTrackRelationships(const TrackList &trackList)
Write track relationships for a specified list of tracks.
StatusCode WriteCaloHitToMCParticleRelationships(const CaloHitList &caloHitList)
Write calo hit to mc particle relationships for a specified calo hit list.
virtual StatusCode WriteRelationship(const RelationshipId relationshipId, const void *address1, const void *address2, const float weight=1.f)=0
Write a relationship between two objects with specified addresses.
StatusCode WriteMCParticleRelationships(const MCParticleList &mcParticleList)
Write mc particle relationships for a specified mc particle list.
StatusCode WriteCaloHitToMCParticleRelationship(const CaloHit *const pCaloHit)
Write a calo hit to mc particle relationship to the current position in the file.
virtual StatusCode WriteTrack(const Track *const pTrack)=0
Write a track to the current position in the file.
StatusCode WriteCaloHitList(const CaloHitList &caloHitList)
Write a calo hit list to the current position in the file.
FileWriter(const pandora::Pandora &pandora, const std::string &fileName)
Constructor.
StatusCode WriteDetectorGapList()
Write the detector gap parameters to the file.
virtual StatusCode WriteMCParticle(const MCParticle *const pMCParticle)=0
Write a mc particle to the current position in the file.
StatusCode WriteTrackToMCParticleRelationship(const Track *const pTrack)
Write a track to mc particle relationship to the current position in the file.
virtual StatusCode WriteDetectorGap(const DetectorGap *const pDetectorGap)=0
Write the detector gap parameters to the file.
StatusCode WriteGeometry()
Write the current geometry information to the file.
StatusCode WriteMCParticleList(const MCParticleList &mcParticleList)
Write a mc particle list to the current position in the file.
StatusCode WriteLArTPCList()
Write the lar tpc parameters to the file.
const SubDetectorMap & GetSubDetectorMap() const
Get the map from name to sub detector parameters.
const DetectorGapList & GetDetectorGapList() const
Get the list of gaps in the active detector volume.
const LArTPCMap & GetLArTPCMap() const
Get the map from name to lar tpc parameters.
Uid GetUid() const
Get the mc particle unique identifier.
const MCParticleList & GetDaughterList() const
Get list of daughters of mc particle.
const MCParticleList & GetParentList() const
Get list of parents of mc particle.
const GeometryManager * GetGeometry() const
Get the pandora geometry instance.
ContainerId m_containerId
The type of container currently being written to file.
const Pandora *const m_pPandora
Address of pandora instance to be used alongside the file writer.
Enable ordering of pointers based on properties of target objects.
const TrackList & GetParentList() const
Get the parent track list.
const TrackList & GetDaughterList() const
Get the daughter track list.
const MCParticleWeightMap & GetMCParticleWeightMap() const
Get mc particle weight map for the track.
const TrackList & GetSiblingList() const
Get the sibling track list.
const void * GetParentAddress() const
Get the address of the parent track in the user framework.
MANAGED_CONTAINER< const MCParticle * > MCParticleList
std::unordered_map< const MCParticle *, float > MCParticleWeightMap
@ TRACK_TO_MC_RELATIONSHIP
@ CALO_HIT_TO_MC_RELATIONSHIP
@ TRACK_SIBLING_RELATIONSHIP
@ TRACK_PARENT_DAUGHTER_RELATIONSHIP
@ MC_PARENT_DAUGHTER_RELATIONSHIP
MANAGED_CONTAINER< const CaloHit * > CaloHitList
MANAGED_CONTAINER< const Track * > TrackList
std::vector< const MCParticle * > MCParticleVector
StatusCode
The StatusCode enum.