CosmicRayRemovalTool.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArThreeDReco/LArCosmicRay/CosmicRayRemovalTool.h
3  *
4  * @brief Header file for the cosmic ray removal tool class.
5  *
6  * $Log: $
7  */
8 
9 #ifndef COSMIC_RAY_REMOVAL_TOOL_H
10 #define COSMIC_RAY_REMOVAL_TOOL_H 1
11 
14 
15 namespace lar_content
16 {
17 /**
18  * @brief CosmicRayRemovalTool class
19  */
21 {
22 public:
23  /**
24  * @brief Default constructor
25  */
27 
28 private:
29  bool Run(ThreeViewDeltaRayMatchingAlgorithm *const pAlgorithm, TensorType &overlapTensor);
30  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
31 
32  /**
33  * @brief Remove hits from delta ray clusters that belong to the parent muon
34  *
35  * @param elementList the tensor element list
36  *
37  * @return whether any clusters have been modified
38  */
39  bool RemoveCosmicRayHits(const TensorType::ElementList &elementList) const;
40 
41  /**
42  * @brief Determine whether element satifies simple checks
43  *
44  * @param element the tensor element
45  * @param hitType the hit type of the cluster under investigation
46  *
47  * @return whether the checks pass
48  */
49  virtual bool PassElementChecks(const TensorType::Element &element, const pandora::HitType hitType) const;
50 
51  /**
52  * @brief Determine whether the cluster under investigation has muon contamination
53  *
54  * @param element the tensor element
55  * @param hitType the hit type of the cluster under investigation
56  *
57  * @return whether the cluster contains muon hits to remove
58  */
59  bool IsContaminated(const TensorType::Element &element, const pandora::HitType hitType) const;
60 
61  /**
62  * @brief Collect hits in the delta ray cluster that lie close to calculated projected positions forming a seed to later grow
63  *
64  * @param element the tensor element
65  * @param hitType the hit type of the cluster under investigation
66  * @param collectedHits the output list of identified delta ray hits
67  */
68  void CreateSeed(const TensorType::Element &element, const pandora::HitType hitType, pandora::CaloHitList &collectedHits) const;
69 
70  /**
71  * @brief Examine remaining hits in the delta ray cluster adding them to the delta ray seed or parent muon if appropriate and a separate list if not
72  *
73  * @param element the tensor element
74  * @param hitType the hit type of the cluster under investigation
75  * @param collectedHits the list of identified delta ray hits
76  * @param deltaRayRemantHits the list of remainder hits
77  *
78  * @return whether the muon projection mechanics were successful - abort process if not
79  */
80  pandora::StatusCode GrowSeed(const TensorType::Element &element, const pandora::HitType hitType, pandora::CaloHitList &collectedHits,
81  pandora::CaloHitList &deltaRayRemantHits) const;
82 
83  /**
84  * @brief Collect hits from the delta ray cluster to either keep (demandCloserToCollected == true) or separate into a new shower (demandCloserToCollected == false)
85  *
86  * @param positionOnMuon the parameterised muon position
87  * @param muonDirection the parameterised muon direction
88  * @param pDeltaRayCluster the delta ray cluster under investigation
89  * @param minDistanceFromMuon the minimum distance of a hit from the muon track for it to not belong to the muon
90  * @param demandCloserToCollected whether to demand a hit be closer to the collected hits than to the muon hits for it to be collected
91  * @param protectedHits the hits that are protected from being collected
92  * @param collectedHits the output list of collected hits
93  */
94  void CollectHitsFromDeltaRay(const pandora::CartesianVector &positionOnMuon, const pandora::CartesianVector &muonDirection,
95  const pandora::Cluster *const pDeltaRayCluster, const float &minDistanceFromMuon, const bool demandCloserToCollected,
96  const pandora::CaloHitList &protectedHits, pandora::CaloHitList &collectedHits) const;
97 
98  /**
99  * @brief Fragment the delta ray cluster adding hits to the muon track and perhaps creating significant remnants in the process
100  *
101  * @param element the tensor element
102  * @param hitType the hit type of the cluster under investigation
103  * @param collectedHits the list of identified delta ray hits
104  * @param deltaRayRemantHits the list of remainder hits
105  */
106  void SplitDeltaRayCluster(const TensorType::Element &element, const pandora::HitType hitType, pandora::CaloHitList &collectedHits,
107  pandora::CaloHitList &deltaRayRemnantHits) const;
108 
109  /**
110  * @brief Reculster a given remnant cluster, merging insignificant created clusters into the parent muon (if proximity checks pass)
111  *
112  * @param hitType the hit type of the cluster under investigation
113  * @param pMuonCluster the address of the parent muon cluster
114  * @param pDeltaRayRemnant the address of the delta ray remnant
115  * @param clusterVector a vector containing the address of created/modified clusters for bookeeping purposes
116  * @param pfoVector a vector containing the address of the pfo to which a modified muon cluster belongs for bookeeping purposes
117  */
118  void ReclusterRemnant(const pandora::HitType hitType, const pandora::Cluster *const pMuonCluster,
119  const pandora::Cluster *const pDeltaRayRemnant, pandora::ClusterVector &clusterVector, pandora::PfoVector &pfoVector) const;
120 
121  unsigned int m_slidingFitWindow; ///< The sliding fit window used in cosmic ray parameterisations
122  float m_minContaminationLength; ///< The minimum projected length of a delta ray cluster onto the muon track for it to be considered contaminated
123  float m_maxDistanceToHit; ///< The maximum distance of a hit from the cosmic ray track for it to be added into the CR
124  unsigned int m_minRemnantClusterSize; ///< The minimum hit number of a remnant cluster for it to be considered significant
125  float m_maxDistanceToTrack; ///< The minimum distance of an insignificant remnant cluster from the cosmic ray track for it to be merged into the CR
126 };
127 
128 } // namespace lar_content
129 
130 #endif // #ifndef COSMIC_RAY_REMOVAL_TOOL_H
void CollectHitsFromDeltaRay(const pandora::CartesianVector &positionOnMuon, const pandora::CartesianVector &muonDirection, const pandora::Cluster *const pDeltaRayCluster, const float &minDistanceFromMuon, const bool demandCloserToCollected, const pandora::CaloHitList &protectedHits, pandora::CaloHitList &collectedHits) const
Collect hits from the delta ray cluster to either keep (demandCloserToCollected == true) or separate ...
enum cvn::HType HitType
unsigned int m_slidingFitWindow
The sliding fit window used in cosmic ray parameterisations.
Header file for the removal base tool class.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
bool RemoveCosmicRayHits(const TensorType::ElementList &elementList) const
Remove hits from delta ray clusters that belong to the parent muon.
float m_maxDistanceToHit
The maximum distance of a hit from the cosmic ray track for it to be added into the CR...
float m_maxDistanceToTrack
The minimum distance of an insignificant remnant cluster from the cosmic ray track for it to be merge...
bool IsContaminated(const TensorType::Element &element, const pandora::HitType hitType) const
Determine whether the cluster under investigation has muon contamination.
virtual bool PassElementChecks(const TensorType::Element &element, const pandora::HitType hitType) const
Determine whether element satifies simple checks.
CosmicRayRemovalTool()
Default constructor.
void SplitDeltaRayCluster(const TensorType::Element &element, const pandora::HitType hitType, pandora::CaloHitList &collectedHits, pandora::CaloHitList &deltaRayRemnantHits) const
Fragment the delta ray cluster adding hits to the muon track and perhaps creating significant remnant...
CosmicRayRemovalTool class.
pandora::StatusCode GrowSeed(const TensorType::Element &element, const pandora::HitType hitType, pandora::CaloHitList &collectedHits, pandora::CaloHitList &deltaRayRemantHits) const
Examine remaining hits in the delta ray cluster adding them to the delta ray seed or parent muon if a...
unsigned int m_minRemnantClusterSize
The minimum hit number of a remnant cluster for it to be considered significant.
bool Run(ThreeViewDeltaRayMatchingAlgorithm *const pAlgorithm, TensorType &overlapTensor)
Run the algorithm tool.
void ReclusterRemnant(const pandora::HitType hitType, const pandora::Cluster *const pMuonCluster, const pandora::Cluster *const pDeltaRayRemnant, pandora::ClusterVector &clusterVector, pandora::PfoVector &pfoVector) const
Reculster a given remnant cluster, merging insignificant created clusters into the parent muon (if pr...
float m_minContaminationLength
The minimum projected length of a delta ray cluster onto the muon track for it to be considered conta...
std::vector< art::Ptr< recob::Cluster > > ClusterVector
void CreateSeed(const TensorType::Element &element, const pandora::HitType hitType, pandora::CaloHitList &collectedHits) const
Collect hits in the delta ray cluster that lie close to calculated projected positions forming a seed...
RemovalBaseTool class.