CheatingPfoCreationAlgorithm.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArCheating/CheatingPfoCreationAlgorithm.h
3  *
4  * @brief Header file for the cheating cluster creation algorithm class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_CHEATING_PFO_CREATION_ALGORITHM_H
9 #define LAR_CHEATING_PFO_CREATION_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 
14 
15 #include <unordered_map>
16 
17 namespace lar_content
18 {
19 
20 /**
21  * @brief CheatingPfoCreationAlgorithm class
22  */
23 class CheatingPfoCreationAlgorithm : public pandora::Algorithm
24 {
25 public:
26  /**
27  * @brief Default constructor
28  */
30 
31 private:
32  pandora::StatusCode Run();
33  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
34 
35  typedef std::unordered_map<const pandora::MCParticle *, pandora::ClusterList> MCParticleToClusterListMap;
36 
37  /**
38  * @brief Get a map relating mc particles to a list of daughter clusters
39  *
40  * @param pClusterList address of a cluster list
41  * @param mcPrimaryMap the mapping between mc particles and their parents
42  * @param mcParticleToClusterListMap to receive the populated mc particle to cluster list map
43  */
44  void GetMCParticleToClusterListMap(const pandora::ClusterList *const pClusterList,
45  const LArMCParticleHelper::MCRelationMap &mcPrimaryMap, MCParticleToClusterListMap &mcParticleToClusterListMap) const;
46 
47  /**
48  * @brief Create pfos corresponding to the details in a provided mc particle to cluster list map
49  *
50  * @param mcParticleToClusterListMap the mc particle to cluster list map
51  */
52  void CreatePfos(const MCParticleToClusterListMap &mcParticleToClusterListMap) const;
53 
54  /**
55  * @brief Get the number of hit types containing more than a specified number of hits
56  *
57  * @param clusterList the cluster list, consider all hits in clusters in this list
58  * @param nHitsThreshold the threshold number of hits of a specified hit type
59  *
60  * @return the number of good hit types
61  */
62  unsigned int GetNHitTypesAboveThreshold(const pandora::ClusterList &clusterList, const unsigned int nHitsThreshold) const;
63 
64  typedef std::map<pandora::HitType, unsigned int> HitTypeMap;
65  typedef std::set<int> ParticleIdList;
66 
67  pandora::StringVector m_inputClusterListNames; ///< The names of the input cluster lists
68  std::string m_outputPfoListName; ///< The output pfo list name
69  std::string m_outputVertexListName; ///< The output vertex list name
70 
71  bool m_collapseToPrimaryMCParticles; ///< Whether to collapse mc particle hierarchies to primary particles
72  std::string m_mcParticleListName; ///< The mc particle list name
73 
74  bool m_useOnlyAvailableClusters; ///< Whether to consider unavailable clusters when identifying cheated pfos
75  bool m_addVertices; ///< Whether to add the start vertex to the cheated pfo
76  bool m_replaceCurrentVertexList; ///< Whether to replace current vertex list
77  unsigned int m_minGoodHitTypes; ///< The min number of good hit types in the clusters collected for a given mc particle
78  unsigned int m_nHitsForGoodHitType; ///< The min number of hits of a particular hit type in order to declare the hit type is good
79  ParticleIdList m_particleIdList; ///< The list of particle ids to consider for pfo creation; will consider all ids if empty
80 };
81 
82 } // namespace lar_content
83 
84 #endif // #ifndef LAR_CHEATING_PFO_CREATION_ALGORITHM_H
std::string m_mcParticleListName
The mc particle list name.
std::string string
Definition: nybbler.cc:12
pandora::StringVector m_inputClusterListNames
The names of the input cluster lists.
std::string m_outputVertexListName
The output vertex list name.
unsigned int m_minGoodHitTypes
The min number of good hit types in the clusters collected for a given mc particle.
std::unordered_map< const pandora::MCParticle *, pandora::ClusterList > MCParticleToClusterListMap
void CreatePfos(const MCParticleToClusterListMap &mcParticleToClusterListMap) const
Create pfos corresponding to the details in a provided mc particle to cluster list map...
std::string m_outputPfoListName
The output pfo list name.
std::map< pandora::HitType, unsigned int > HitTypeMap
Header file for the lar monte carlo particle helper helper class.
unsigned int m_nHitsForGoodHitType
The min number of hits of a particular hit type in order to declare the hit type is good...
void GetMCParticleToClusterListMap(const pandora::ClusterList *const pClusterList, const LArMCParticleHelper::MCRelationMap &mcPrimaryMap, MCParticleToClusterListMap &mcParticleToClusterListMap) const
Get a map relating mc particles to a list of daughter clusters.
bool m_addVertices
Whether to add the start vertex to the cheated pfo.
bool m_useOnlyAvailableClusters
Whether to consider unavailable clusters when identifying cheated pfos.
ParticleIdList m_particleIdList
The list of particle ids to consider for pfo creation; will consider all ids if empty.
unsigned int GetNHitTypesAboveThreshold(const pandora::ClusterList &clusterList, const unsigned int nHitsThreshold) const
Get the number of hit types containing more than a specified number of hits.
bool m_collapseToPrimaryMCParticles
Whether to collapse mc particle hierarchies to primary particles.
bool m_replaceCurrentVertexList
Whether to replace current vertex list.
std::vector< string > StringVector
Definition: fcldump.cxx:29
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::unordered_map< const pandora::MCParticle *, const pandora::MCParticle * > MCRelationMap