Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:15:00

0001 /**
0002  *  @file   LCContent/include/LCUtility/CaloHitPreparationAlgorithm.h
0003  *
0004  *  @brief  Header file for the calo hit preparation algorithm class.
0005  *
0006  *  $Log: $
0007  */
0008 #ifndef LC_CALO_HIT_PREPARATION_ALGORITHM_H
0009 #define LC_CALO_HIT_PREPARATION_ALGORITHM_H 1
0010 
0011 #include "Pandora/Algorithm.h"
0012 
0013 namespace lc_content {
0014 
0015 template <typename, unsigned int>
0016 class KDTreeLinkerAlgo;
0017 template <typename, unsigned int>
0018 class KDTreeNodeInfoT;
0019 
0020 //------------------------------------------------------------------------------------------------------------------------------------------
0021 
0022 /**
0023  *  @brief  CaloHitPreparationAlgorithm class
0024  */
0025 class CaloHitPreparationAlgorithm : public pandora::Algorithm {
0026 public:
0027   typedef KDTreeLinkerAlgo<const pandora::CaloHit*, 4> HitKDTree4D;
0028   typedef KDTreeNodeInfoT<const pandora::CaloHit*, 4> HitKDNode4D;
0029 
0030   /**
0031    *  @brief Default constructor
0032    */
0033   CaloHitPreparationAlgorithm();
0034 
0035   /**
0036    * @brief Destructor
0037    */
0038   ~CaloHitPreparationAlgorithm();
0039 
0040 private:
0041   pandora::StatusCode Run();
0042 
0043   /**
0044    *  @brief  Initialize a kd-tree of the input hits to the preparation alg.
0045    *
0046    *  @param  pCaloHitList -- the calorimeter hit list
0047    */
0048   void InitializeKDTree(const pandora::CaloHitList* const pCaloHitList);
0049 
0050   /**
0051    *  @brief  Calculate calo hit properties for a particular calo hit, through comparison with an ordered list of other
0052    * hits.
0053    *
0054    *  @param  pCaloHit the calo hit
0055    *  @param  pOrderedCaloHitList the ordered calo hit list
0056    */
0057   void CalculateCaloHitProperties(const pandora::CaloHit* const pCaloHit,
0058                                   const pandora::OrderedCaloHitList& orderedCaloHitList);
0059 
0060   /**
0061    *  @brief  Count number of "nearby" hits using the isolation scheme
0062    *
0063    *  @param  searchLayer the pseudolayer to search in
0064    *  @param  pCaloHit the calo hit
0065    *
0066    *  @return the number of nearby hits
0067    */
0068   unsigned int IsolationCountNearbyHits(unsigned int searchLayer, const pandora::CaloHit* const pCaloHit);
0069 
0070   /**
0071    *  @brief  Count number of "nearby" hits using the mip identification scheme
0072    *
0073    *  @param  searchLayer the pseudolayer to search in
0074    *  @param  pCaloHit the calo hit
0075    *
0076    *  @return the number of nearby hits
0077    */
0078   unsigned int MipCountNearbyHits(unsigned int searchLayer, const pandora::CaloHit* const pCaloHit);
0079 
0080   pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
0081 
0082   float m_caloHitMaxSeparation2; ///< Max separation to consider associations between hits, units mm (used squared)
0083   float m_isolationCaloHitMaxSeparation2; ///< Max separation considered when identifying isolated hits, units mm (used
0084                                           ///< squared)
0085 
0086   unsigned int m_isolationNLayers;       ///< Number of adjacent layers to use in isolation calculation
0087   float m_isolationCutDistanceFine2;     ///< Fine granularity isolation cut distance, units mm (used squared)
0088   float m_isolationCutDistanceCoarse2;   ///< Coarse granularity isolation cut distance, units mm (used squared)
0089   float m_isolationSearchSafetyFactor;   ///< Safety factor, applied to isolation cut distance, to define kd-tree search
0090                                          ///< region
0091   unsigned int m_isolationMaxNearbyHits; ///< Max number of "nearby" hits for a hit to be considered isolated
0092 
0093   float m_mipLikeMipCut;                ///< Mip equivalent energy cut for hit to be flagged as possible mip
0094   unsigned int m_mipNCellsForNearbyHit; ///< Separation (in calo cells) for hits to be declared "nearby"
0095   unsigned int m_mipMaxNearbyHits;      ///< Max number of "nearby" hits for hit to be flagged as possible mip
0096 
0097   std::vector<HitKDNode4D>* m_hitNodes4D; ///< nodes for the KD tree (used for filling)
0098   HitKDTree4D* m_hitsKdTree4D;            ///< the kd-tree itself, 4D in x,y,z,pseudolayer
0099 };
0100 
0101 } // namespace lc_content
0102 
0103 #endif // #ifndef LC_CALO_HIT_PREPARATION_ALGORITHM_H