7 #ifndef LAR_PANDORA_OUTPUT_H 8 #define LAR_PANDORA_OUTPUT_H 21 #include "Pandora/PandoraInternal.h" 27 class GeometryUtilities;
45 typedef std::unique_ptr<std::vector<larpandoraobj::PFParticleMetadata>>
49 typedef std::unique_ptr<art::Assns<recob::PFParticle, larpandoraobj::PFParticleMetadata>>
51 typedef std::unique_ptr<art::Assns<recob::PFParticle, recob::SpacePoint>>
53 typedef std::unique_ptr<art::Assns<recob::PFParticle, recob::Cluster>>
55 typedef std::unique_ptr<art::Assns<recob::PFParticle, recob::Vertex>>
58 typedef std::unique_ptr<art::Assns<recob::PFParticle, recob::Slice>>
78 void Validate()
const;
103 static void ProduceArtOutput(
const Settings& settings,
116 static bool GetPandoraInstance(
const pandora::Pandora*
const pPrimaryPandora,
118 const pandora::Pandora*& pPandoraInstance);
126 static void GetPandoraSlices(
const pandora::Pandora*
const pPrimaryPandora,
127 pandora::PfoVector& slicePfos);
136 static bool IsClearCosmic(
const pandora::ParticleFlowObject*
const pPfo);
145 static bool IsFromSlice(
const pandora::ParticleFlowObject*
const pPfo);
154 static unsigned int GetSliceIndex(
const pandora::ParticleFlowObject*
const pPfo);
163 static pandora::PfoVector CollectPfos(
const pandora::Pandora*
const pPrimaryPandora);
172 static pandora::PfoVector CollectAllPfoOutcomes(
const pandora::Pandora*
const pPrimaryPandora);
180 static void CollectPfos(
const pandora::PfoList& parentPfoList, pandora::PfoVector& pfoVector);
193 const pandora::PfoVector& pfoVector,
194 IdToIdVectorMap& pfoToVerticesMap,
207 static pandora::ClusterList CollectClusters(
const pandora::PfoVector& pfoVector,
208 IdToIdVectorMap& pfoToClustersMap);
216 static void Collect3DHits(
const pandora::ParticleFlowObject*
const pPfo,
217 pandora::CaloHitVector& caloHits);
228 static pandora::CaloHitList Collect3DHits(
const pandora::PfoVector& pfoVector,
229 IdToIdVectorMap& pfoToThreeDHitsMap);
239 template <
typename T>
240 static size_t GetId(
const T*
const pT,
const std::list<const T*>& tList);
250 template <
typename T>
251 static size_t GetId(
const T*
const pT,
const std::vector<const T*>& tVector);
261 static void GetPandoraToArtHitMap(
const pandora::ClusterList& clusterList,
262 const pandora::CaloHitList& threeDHitList,
264 CaloHitToArtHitMap& pandoraHitToArtHitMap);
273 const pandora::CaloHit*
const pCaloHit);
282 VertexCollection& outputVertices);
296 const pandora::CaloHitList& threeDHitList,
297 const CaloHitToArtHitMap& pandoraHitToArtHitMap,
298 SpacePointCollection& outputSpacePoints,
299 SpacePointToHitCollection& outputSpacePointsToHits);
316 const pandora::ClusterList& clusterList,
317 const CaloHitToArtHitMap& pandoraHitToArtHitMap,
318 const IdToIdVectorMap& pfoToClustersMap,
319 ClusterCollection& outputClusters,
320 ClusterToHitCollection& outputClustersToHits,
321 IdToIdVectorMap& pfoToArtClustersMap);
339 const pandora::PfoVector& pfoVector,
340 const IdToIdVectorMap& pfoToVerticesMap,
341 const IdToIdVectorMap& pfoToThreeDHitsMap,
342 const IdToIdVectorMap& pfoToArtClustersMap,
343 PFParticleCollection& outputParticles,
357 static void AssociateAdditionalVertices(
360 const pandora::PfoVector& pfoVector,
361 const IdToIdVectorMap& pfoToVerticesMap,
374 const pandora::PfoVector& pfoVector,
391 static void BuildSlices(
const Settings& settings,
392 const pandora::Pandora*
const pPrimaryPandora,
395 const pandora::PfoVector& pfoVector,
397 SliceCollection& outputSlices,
399 SliceToHitCollection& outputSlicesToHits);
406 static unsigned int BuildDummySlice(SliceCollection& outputSlices);
420 static void CopyAllHitsToSingleSlice(
const Settings& settings,
423 const pandora::PfoVector& pfoVector,
425 SliceCollection& outputSlices,
427 SliceToHitCollection& outputSlicesToHits);
439 static unsigned int BuildSlice(
const pandora::ParticleFlowObject*
const pParentPfo,
443 SliceCollection& outputSlices,
444 SliceToHitCollection& outputSlicesToHits);
458 const pandora::PfoVector& pfoVector,
459 T0Collection& outputT0s,
460 PFParticleToT0Collection& outputParticlesToT0s);
481 const size_t spacePointId);
489 static void GetHitsInCluster(
const pandora::Cluster*
const pCluster,
490 pandora::CaloHitVector& sortedHits);
504 static std::vector<recob::Cluster> BuildClusters(
506 const pandora::Cluster*
const pCluster,
507 const pandora::ClusterList& clusterList,
508 const CaloHitToArtHitMap& pandoraHitToArtHitMap,
509 IdToIdVectorMap& pandoraClusterToArtClustersMap,
510 std::vector<HitVector>& hitVectors,
542 static recob::PFParticle BuildPFParticle(
const pandora::ParticleFlowObject*
const pPfo,
544 const pandora::PfoVector& pfoVector);
558 const pandora::ParticleFlowObject*
const pPfo,
559 const pandora::PfoVector& pfoVector,
571 template <
typename A,
typename B>
586 template <
typename A,
typename B>
590 const IdToIdVectorMap& aToBMap,
601 template <
typename A,
typename B>
611 template <
typename T>
613 LArPandoraOutput::GetId(
const T*
const pT,
const std::list<const T*>& tList)
617 if (it == tList.end())
619 <<
" LArPandoraOutput::GetId --- can't find the id of supplied object";
621 return static_cast<size_t>(
std::distance(tList.begin(), it));
626 template <
typename T>
628 LArPandoraOutput::GetId(
const T*
const pT,
const std::vector<const T*>& tVector)
631 std::find(tVector.begin(), tVector.end(), pT));
633 if (it == tVector.end())
635 <<
" LArPandoraOutput::GetId --- can't find the id of supplied object";
637 return static_cast<size_t>(
std::distance(tVector.begin(), it));
642 template <
typename A,
typename B>
656 association->addSingle(pA, pB);
661 template <
typename A,
typename B>
666 const IdToIdVectorMap& aToBMap,
670 if (it == aToBMap.end())
672 <<
" LArPandoraOutput::AddAssociation --- id doesn't exists in the assocaition map";
678 for (
const size_t idB : it->second) {
680 association->addSingle(pA, pB);
686 template <
typename A,
typename B>
698 association->addSingle(pA, pB);
703 #endif // LAR_PANDORA_OUTPUT_H
code to link reconstructed objects back to the MC truth information
Interface class for LArPandora producer modules, which reconstruct recob::PFParticles from recob::Hit...
Namespace for general, non-LArSoft-specific utilities.
const pandora::Pandora * m_pPrimaryPandora
std::unique_ptr< std::vector< larpandoraobj::PFParticleMetadata > > PFParticleMetadataCollection
std::unique_ptr< art::Assns< recob::PFParticle, recob::Slice > > PFParticleToSliceCollection
std::unique_ptr< std::vector< recob::Slice > > SliceCollection
std::unique_ptr< std::vector< recob::PFParticle > > PFParticleCollection
std::string m_testBeamInteractionVerticesInstanceLabel
The label for the test beam interaction vertices.
std::unique_ptr< std::vector< recob::Vertex > > VertexCollection
std::string m_allOutcomesInstanceLabel
The label for the instance producing all outcomes.
std::map< size_t, IdVector > IdToIdVectorMap
Set of hits with a 2D structure.
std::unique_ptr< art::Assns< recob::PFParticle, larpandoraobj::PFParticleMetadata > > PFParticleToMetadataCollection
std::map< int, art::Ptr< recob::Hit > > IdToHitMap
bool m_isNeutrinoRecoOnlyNoSlicing
If we are running the neutrino reconstruction only with no slicing.
Definition of vertex object for LArSoft.
std::unique_ptr< art::Assns< recob::PFParticle, recob::Cluster > > PFParticleToClusterCollection
std::string m_hitfinderModuleLabel
The hit finder module label.
Algorithm collection class computing cluster parameters.
std::unique_ptr< art::Assns< recob::Slice, recob::Hit > > SliceToHitCollection
std::vector< size_t > IdVector
std::unique_ptr< art::Assns< recob::PFParticle, anab::T0 > > PFParticleToT0Collection
std::unique_ptr< art::Assns< recob::SpacePoint, recob::Hit > > SpacePointToHitCollection
std::unique_ptr< std::vector< recob::Cluster > > ClusterCollection
std::map< const pandora::CaloHit *, art::Ptr< recob::Hit > > CaloHitToArtHitMap
std::unique_ptr< art::Assns< recob::PFParticle, recob::Vertex > > PFParticleToVertexCollection
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
bool m_shouldProduceTestBeamInteractionVertices
Whether to write the test beam interaction vertices in a separate collection.
std::unique_ptr< art::Assns< recob::PFParticle, recob::SpacePoint > > PFParticleToSpacePointCollection
std::vector< art::Ptr< recob::Hit > > HitVector
Hierarchical representation of particle flow.
bool m_shouldRunStitching
Interface for a algorithm class computing cluster parameters.
std::unique_ptr< std::vector< anab::T0 > > T0Collection
bool m_shouldProduceAllOutcomes
If all outcomes should be produced in separate collections (choose false if you only require the cons...
bool m_shouldProduceSlices
Whether to produce output slices e.g. may not want to do this if only (re)processing single slices...
std::pair< unsigned short, unsigned short > GetSliceIndex(std::string typeName, int uID)
std::vector< art::Ptr< recob::Vertex > > VertexVector
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
std::unique_ptr< std::vector< recob::SpacePoint > > SpacePointCollection
void function(int client, int *resource, int parblock, int *test, int p)
std::set< art::Ptr< recob::Hit > > HitList
helper function for LArPandoraInterface producer module
std::unique_ptr< art::Assns< recob::Cluster, recob::Hit > > ClusterToHitCollection
cet::coded_exception< error, detail::translate > exception
Event finding and building.