CheatingNeutrinoCreationAlgorithm.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArCheating/CheatingNeutrinoCreationAlgorithm.h
3  *
4  * @brief Header file for the cheating neutrino creation algorithm class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_CHEATING_NEUTRINO_CREATION_ALGORITHM_H
9 #define LAR_CHEATING_NEUTRINO_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 CheatingNeutrinoCreationAlgorithm::Algorithm class
22  */
23 class CheatingNeutrinoCreationAlgorithm : public pandora::Algorithm
24 {
25 public:
26  /**
27  * @brief Default constructor
28  */
30 
31 private:
32  pandora::StatusCode Run();
33 
34  /**
35  * @brief Get the mc neutrino vector
36  *
37  * @param mcNeutrinoVector to receive the mc neutrino vector
38  */
39  void GetMCNeutrinoVector(pandora::MCParticleVector &mcNeutrinoVector) const;
40 
41  /**
42  * @brief Create and save a neutrino pfo with properties dictated by the mc neutrino
43  *
44  * @param pMCNeutrino the address of the mc neutrino
45  * @param pNeutrinoPfo to receive the address of the neutrino pfo
46  */
47  void CreateAndSaveNeutrinoPfo(const pandora::MCParticle *const pMCNeutrino, const pandora::ParticleFlowObject *&pNeutrinoPfo) const;
48 
49  /**
50  * @brief Extract reconstructed vertex from external list, check its position agrees with mc neutrino, and add to pfo
51  *
52  * @param pMCNeutrino the address of the mc neutrino
53  * @param pNeutrinoPfo the address of the neutrino pfo
54  */
55  void AddNeutrinoVertex(const pandora::MCParticle *const pMCNeutrino, const pandora::ParticleFlowObject *const pNeutrinoPfo) const;
56 
57  typedef std::unordered_map<const pandora::MCParticle *, const pandora::ParticleFlowObject *> MCParticleToPfoMap;
58 
59  /**
60  * @brief Extract candidate daughter pfos from external lists and populate a map from main mc particle (or primary) to pfo
61  *
62  * @param mcParticleToPfoMap to receive the mc particle to pfo map
63  */
64  void GetMCParticleToDaughterPfoMap(MCParticleToPfoMap &mcParticleToPfoMap) const;
65 
66  /**
67  * @brief Use information from mc particles and the mc particle to pfo map to fully-reconstruct the daughter pfo hierarchy
68  *
69  * @param pParentMCParticle the address of the (current) parent mc particle
70  * @param pParentPfo the address of the (current) parent pfo
71  * @param mcParticleToPfoMap the mc particle to pfo map
72  */
73  void CreatePfoHierarchy(const pandora::MCParticle *const pParentMCParticle, const pandora::ParticleFlowObject *const pParentPfo,
74  const MCParticleToPfoMap &mcParticleToPfoMap) const;
75 
76  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
77 
78  bool m_collapseToPrimaryMCParticles; ///< Whether to collapse mc particle hierarchies to primary particles
79 
80  std::string m_mcParticleListName; ///< The name of the three d mc particle list name
81  std::string m_neutrinoPfoListName; ///< The name of the neutrino pfo list
82 
83  std::string m_vertexListName; ///< The name of the neutrino vertex list
84  pandora::StringVector m_daughterPfoListNames; ///< The list of daughter pfo list names
85 
86  float m_vertexTolerance; ///< Tolerance, 3d displacement, allowed between reco neutrino vertex and mc neutrino endpoint
87 };
88 
89 } // namespace lar_content
90 
91 #endif // #ifndef LAR_CHEATING_NEUTRINO_CREATION_ALGORITHM_H
std::string string
Definition: nybbler.cc:12
std::string m_neutrinoPfoListName
The name of the neutrino pfo list.
std::unordered_map< const pandora::MCParticle *, const pandora::ParticleFlowObject * > MCParticleToPfoMap
float m_vertexTolerance
Tolerance, 3d displacement, allowed between reco neutrino vertex and mc neutrino endpoint.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::vector< art::Ptr< simb::MCParticle > > MCParticleVector
std::string m_mcParticleListName
The name of the three d mc particle list name.
void CreatePfoHierarchy(const pandora::MCParticle *const pParentMCParticle, const pandora::ParticleFlowObject *const pParentPfo, const MCParticleToPfoMap &mcParticleToPfoMap) const
Use information from mc particles and the mc particle to pfo map to fully-reconstruct the daughter pf...
Header file for the lar monte carlo particle helper helper class.
CheatingNeutrinoCreationAlgorithm::Algorithm class.
pandora::StringVector m_daughterPfoListNames
The list of daughter pfo list names.
void GetMCParticleToDaughterPfoMap(MCParticleToPfoMap &mcParticleToPfoMap) const
Extract candidate daughter pfos from external lists and populate a map from main mc particle (or prim...
std::vector< string > StringVector
Definition: fcldump.cxx:29
std::string m_vertexListName
The name of the neutrino vertex list.
bool m_collapseToPrimaryMCParticles
Whether to collapse mc particle hierarchies to primary particles.
void GetMCNeutrinoVector(pandora::MCParticleVector &mcNeutrinoVector) const
Get the mc neutrino vector.
void AddNeutrinoVertex(const pandora::MCParticle *const pMCNeutrino, const pandora::ParticleFlowObject *const pNeutrinoPfo) const
Extract reconstructed vertex from external list, check its position agrees with mc neutrino...
void CreateAndSaveNeutrinoPfo(const pandora::MCParticle *const pMCNeutrino, const pandora::ParticleFlowObject *&pNeutrinoPfo) const
Create and save a neutrino pfo with properties dictated by the mc neutrino.