APRILContent
Algorithm of Particle Reconstruction for ILC - implementation with PandoraSDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations
FragmentRemovalHelper.h
Go to the documentation of this file.
1 
8 #ifndef APRIL_FRAGMENT_REMOVAL_HELPER_H
9 #define APRIL_FRAGMENT_REMOVAL_HELPER_H 1
10 
11 #include "Pandora/PandoraInternal.h"
12 #include "Pandora/StatusCodes.h"
13 
14 namespace april_content
15 {
16 
21 {
22 public:
26  class Parameters
27  {
28  public:
34  };
35 
44  ClusterContact(const pandora::Pandora &pandora, const pandora::Cluster *const pDaughterCluster, const pandora::Cluster *const pParentCluster,
45  const Parameters &parameters);
46 
52  const pandora::Cluster *GetDaughterCluster() const;
53 
59  const pandora::Cluster *GetParentCluster() const;
60 
66  unsigned int GetNContactLayers() const;
67 
73  float GetContactFraction() const;
74 
80  float GetDistanceToClosestHit() const;
81 
87  float GetCloseHitFraction1() const;
88 
94  float GetCloseHitFraction2() const;
95 
101  float GetConeFraction1() const;
102 
103 protected:
112  void HitDistanceComparison(const pandora::Cluster *const pDaughterCluster, const pandora::Cluster *const pParentCluster, const Parameters &parameters);
113 
114  const pandora::Cluster *m_pDaughterCluster;
115  const pandora::Cluster *m_pParentCluster;
116 
117  unsigned int m_nContactLayers;
123 };
124 
125 typedef std::vector<ClusterContact> ClusterContactVector;
126 typedef std::map<const pandora::Cluster *, ClusterContactVector> ClusterContactMap;
127 
128 //------------------------------------------------------------------------------------------------------------------------------------------
129 
134 {
135 public:
145  static float GetFractionOfCloseHits(const pandora::Cluster *const pClusterI, const pandora::Cluster *const pClusterJ, const float distanceThreshold);
146 
159  static float GetFractionOfHitsInCone(const pandora::Pandora &pandora, const pandora::Cluster *const pClusterI, const pandora::Cluster *const pClusterJ,
160  const float coneCosineHalfAngle);
161 
171  static float GetFractionOfHitsInCone(const pandora::Cluster *const pCluster, const pandora::Track *const pTrack, const float coneCosineHalfAngle);
172 
183  static float GetFractionOfHitsInCone(const pandora::Cluster *const pCluster, const pandora::CartesianVector &coneApex,
184  const pandora::CartesianVector &coneDirection, const float coneCosineHalfAngle);
185 
197  static unsigned int GetNLayersCrossed(const pandora::Pandora &pandora, const pandora::Helix &helix, const float zStart,
198  const float zEnd, const unsigned int nSamplingPoints = 100);
199 
211  static pandora::StatusCode GetClusterHelixDistance(const pandora::Cluster *const pCluster, const pandora::Helix &helix,
212  const unsigned int startLayer, const unsigned int endLayer, const unsigned int maxOccupiedLayers, float &closestDistanceToHit,
213  float &meanDistanceToHits);
214 
224  static pandora::StatusCode GetClusterContactDetails(const pandora::Cluster *const pClusterI, const pandora::Cluster *const pClusterJ,
225  const float distanceThreshold, unsigned int &nContactLayers, float &contactFraction);
226 
236  static float GetEMEnergyWeightedLayerSeparation(const pandora::Cluster *const pClusterI, const pandora::Cluster *const pClusterJ);
237 
245  static pandora::CartesianVector GetEMEnergyWeightedPosition(const pandora::Cluster *const pCluster);
246 };
247 
248 //------------------------------------------------------------------------------------------------------------------------------------------
249 //------------------------------------------------------------------------------------------------------------------------------------------
250 
251 inline const pandora::Cluster *ClusterContact::GetDaughterCluster() const
252 {
253  return m_pDaughterCluster;
254 }
255 
256 //------------------------------------------------------------------------------------------------------------------------------------------
257 
258 inline const pandora::Cluster *ClusterContact::GetParentCluster() const
259 {
260  return m_pParentCluster;
261 }
262 
263 //------------------------------------------------------------------------------------------------------------------------------------------
264 
265 inline unsigned int ClusterContact::GetNContactLayers() const
266 {
267  return m_nContactLayers;
268 }
269 
270 //------------------------------------------------------------------------------------------------------------------------------------------
271 
273 {
274  return m_contactFraction;
275 }
276 
277 //------------------------------------------------------------------------------------------------------------------------------------------
278 
280 {
281  return m_distanceToClosestHit;
282 }
283 
284 //------------------------------------------------------------------------------------------------------------------------------------------
285 
287 {
288  return m_closeHitFraction1;
289 }
290 
291 //------------------------------------------------------------------------------------------------------------------------------------------
292 
294 {
295  return m_closeHitFraction2;
296 }
297 
298 //------------------------------------------------------------------------------------------------------------------------------------------
299 
301 {
302  return m_coneFraction1;
303 }
304 
305 }
306 
307 #endif
float GetConeFraction1() const
Get the fraction of daughter hits that lie within specified cone 1 along parent direction.
Definition: FragmentRemovalHelper.h:300
static float GetFractionOfCloseHits(const pandora::Cluster *const pClusterI, const pandora::Cluster *const pClusterJ, const float distanceThreshold)
Get the fraction of calo hits in cluster I that lie within a specified distance of a calo hit in clus...
Definition: FragmentRemovalHelper.cc:18
const pandora::Cluster * m_pDaughterCluster
Address of the daughter candidate cluster.
Definition: FragmentRemovalHelper.h:114
float m_closeHitFraction1
Fraction of daughter hits that lie within sepcified distance 1 of parent cluster. ...
Definition: FragmentRemovalHelper.h:120
float GetDistanceToClosestHit() const
Distance between closest hits in parent and daughter clusters, units mm.
Definition: FragmentRemovalHelper.h:279
static pandora::StatusCode GetClusterContactDetails(const pandora::Cluster *const pClusterI, const pandora::Cluster *const pClusterJ, const float distanceThreshold, unsigned int &nContactLayers, float &contactFraction)
Get the number of contact layers for two clusters and also the ratio of the number of contact layers ...
Definition: FragmentRemovalHelper.cc:255
float m_closeHitFraction2
Fraction of daughter hits that lie within sepcified distance 2 of parent cluster. ...
Definition: FragmentRemovalHelper.h:121
float m_closeHitDistance2
Second distance used to identify close hits in cluster contact object.
Definition: FragmentRemovalHelper.h:31
unsigned int GetNContactLayers() const
Get the number of contact layers for parent and daughter clusters two clusters.
Definition: FragmentRemovalHelper.h:265
static float GetEMEnergyWeightedLayerSeparation(const pandora::Cluster *const pClusterI, const pandora::Cluster *const pClusterJ)
Get the electromagnetic energy-weighted mean common layer separation for a pair of provided clusters ...
Definition: FragmentRemovalHelper.cc:312
void HitDistanceComparison(const pandora::Cluster *const pDaughterCluster, const pandora::Cluster *const pParentCluster, const Parameters &parameters)
Compare hits in daughter cluster with those in parent cluster to calculate minimum hit separation and...
Definition: FragmentRemovalHelper.cc:415
FragmentRemovalHelper class.
Definition: FragmentRemovalHelper.h:133
unsigned int m_nContactLayers
The number of contact layers for parent and daughter clusters.
Definition: FragmentRemovalHelper.h:117
const pandora::Cluster * GetDaughterCluster() const
Get the address of the daughter candidate cluster.
Definition: FragmentRemovalHelper.h:251
ClusterContact(const pandora::Pandora &pandora, const pandora::Cluster *const pDaughterCluster, const pandora::Cluster *const pParentCluster, const Parameters &parameters)
Constructor.
Definition: FragmentRemovalHelper.cc:397
float GetContactFraction() const
Get the ratio of the number of contact layers to the number of overlap layers.
Definition: FragmentRemovalHelper.h:272
static float GetFractionOfHitsInCone(const pandora::Pandora &pandora, const pandora::Cluster *const pClusterI, const pandora::Cluster *const pClusterJ, const float coneCosineHalfAngle)
Get the fraction of calo hits in cluster I that lie within a cone along the direction of cluster J...
Parameters class.
Definition: FragmentRemovalHelper.h:26
static pandora::CartesianVector GetEMEnergyWeightedPosition(const pandora::Cluster *const pCluster)
Get the electromagnetic energy-weighted mean cluster position for a provided cluster.
Definition: FragmentRemovalHelper.cc:371
const pandora::Cluster * GetParentCluster() const
Get the address of the parent candidate cluster.
Definition: FragmentRemovalHelper.h:258
float m_closeHitDistance1
First distance used to identify close hits in cluster contact object.
Definition: FragmentRemovalHelper.h:30
float m_contactFraction
The ratio of the number of contact layers to the number of overlap layers.
Definition: FragmentRemovalHelper.h:118
float m_coneFraction1
Fraction of daughter hits that lie within specified cone 1 along parent direction.
Definition: FragmentRemovalHelper.h:119
ClusterContact class, describing the interactions and proximity between parent and daughter candidate...
Definition: FragmentRemovalHelper.h:20
static pandora::StatusCode GetClusterHelixDistance(const pandora::Cluster *const pCluster, const pandora::Helix &helix, const unsigned int startLayer, const unsigned int endLayer, const unsigned int maxOccupiedLayers, float &closestDistanceToHit, float &meanDistanceToHits)
Get the distance between hits in a cluster and a helix, typically the result of a fit to a track...
Definition: FragmentRemovalHelper.cc:208
static unsigned int GetNLayersCrossed(const pandora::Pandora &pandora, const pandora::Helix &helix, const float zStart, const float zEnd, const unsigned int nSamplingPoints=100)
Get the number of pseudo layers crossed by helix in specified range of z coordinates.
Definition: FragmentRemovalHelper.cc:153
const pandora::Cluster * m_pParentCluster
Address of the parent candidate cluster.
Definition: FragmentRemovalHelper.h:115
float GetCloseHitFraction1() const
Get the fraction of daughter hits that lie within sepcified distance 1 of parent cluster.
Definition: FragmentRemovalHelper.h:286
float m_minCosOpeningAngle
Min opening angle between two clusters to perform contact hit comparisons.
Definition: FragmentRemovalHelper.h:32
float m_distanceThreshold
Number of calorimeter cell-widths used to identify cluster contact layers.
Definition: FragmentRemovalHelper.h:33
float m_distanceToClosestHit
Distance between closest hits in parent and daughter clusters, units mm.
Definition: FragmentRemovalHelper.h:122
float GetCloseHitFraction2() const
Get the fraction of daughter hits that lie within sepcified distance 2 of parent cluster.
Definition: FragmentRemovalHelper.h:293
float m_coneCosineHalfAngle1
Cosine half angle for first cone comparison in cluster contact object.
Definition: FragmentRemovalHelper.h:29