CheatingClusterCreationAlgorithm.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArCheating/CheatingClusterCreationAlgorithm.h
3  *
4  * @brief Header file for the cheating cluster creation algorithm class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_CHEATING_CLUSTER_CREATION_ALGORITHM_H
9 #define LAR_CHEATING_CLUSTER_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 CheatingClusterCreationAlgorithm class
22  */
23 class CheatingClusterCreationAlgorithm : 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::CaloHitList> MCParticleToHitListMap;
36 
37  /**
38  * @brief Create map between each (primary) MC particle and associated calo hits
39  *
40  * @param mcParticleToHitListMap to receive the mc particle to hit list map
41  */
42  void GetMCParticleToHitListMap(MCParticleToHitListMap &mcParticleToHitListMap) const;
43 
44  /**
45  * @brief Simple mc particle collection, using main mc particle associated with each calo hit
46  *
47  * @param pCaloHit address of the calo hit
48  * @param mcPrimaryMap the mapping between mc particles and their parents
49  * @param mcParticleToHitListMap the mc particle to hit list map
50  */
51  void SimpleMCParticleCollection(const pandora::CaloHit *const pCaloHit, const LArMCParticleHelper::MCRelationMap &mcPrimaryMap,
52  MCParticleToHitListMap &mcParticleToHitListMap) const;
53 
54  /**
55  * @brief Check whether mc particle is of a type specified for inclusion in cheated clustering
56  *
57  * @param pMCParticle the mc particle to hit list map
58  *
59  * @return boolean
60  */
61  bool SelectMCParticlesForClustering(const pandora::MCParticle *const pMCParticle) const;
62 
63  /**
64  * @brief Create clusters based on information in the mc particle to hit list map
65  *
66  * @param mcParticleToHitListMap the mc particle to hit list map
67  */
68  void CreateClusters(const MCParticleToHitListMap &mcParticleToHitListMap) const;
69 
70  bool m_collapseToPrimaryMCParticles; ///< Whether to collapse mc particle hierarchies to primary particles
71  std::string m_mcParticleListName; ///< The mc particle list name, required if want to collapse mc particle hierarchy
72 
73  pandora::IntVector m_particleIdList; ///< list of particle ids of MCPFOs to be selected
74 };
75 
76 } // namespace lar_content
77 
78 #endif // #ifndef LAR_CHEATING_CLUSTER_CREATION_ALGORITHM_H
pandora::IntVector m_particleIdList
list of particle ids of MCPFOs to be selected
void GetMCParticleToHitListMap(MCParticleToHitListMap &mcParticleToHitListMap) const
Create map between each (primary) MC particle and associated calo hits.
std::string string
Definition: nybbler.cc:12
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::string m_mcParticleListName
The mc particle list name, required if want to collapse mc particle hierarchy.
void SimpleMCParticleCollection(const pandora::CaloHit *const pCaloHit, const LArMCParticleHelper::MCRelationMap &mcPrimaryMap, MCParticleToHitListMap &mcParticleToHitListMap) const
Simple mc particle collection, using main mc particle associated with each calo hit.
std::vector< int > IntVector
bool SelectMCParticlesForClustering(const pandora::MCParticle *const pMCParticle) const
Check whether mc particle is of a type specified for inclusion in cheated clustering.
Header file for the lar monte carlo particle helper helper class.
bool m_collapseToPrimaryMCParticles
Whether to collapse mc particle hierarchies to primary particles.
std::unordered_map< const pandora::MCParticle *, pandora::CaloHitList > MCParticleToHitListMap
void CreateClusters(const MCParticleToHitListMap &mcParticleToHitListMap) const
Create clusters based on information in the mc particle to hit list map.
std::unordered_map< const pandora::MCParticle *, const pandora::MCParticle * > MCRelationMap