Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /**
0002  *  @file   LCContent/include/LCPlugins/LCSoftwareCompensation.h
0003  *
0004  *  @brief  Header file for the lc software compensation plugin algorithm class.
0005  *
0006  *  $Log: $
0007  */
0008 #ifndef LC_SOFTWARE_COMPENSATION_H
0009 #define LC_SOFTWARE_COMPENSATION_H 1
0010 
0011 #include "Plugins/EnergyCorrectionsPlugin.h"
0012 
0013 namespace lc_content {
0014 
0015 /**
0016  *  @brief LCSoftwareCompensationParameters class
0017  */
0018 class LCSoftwareCompensationParameters {
0019 public:
0020   /**
0021    * @brief  Default constructor
0022    */
0023   LCSoftwareCompensationParameters();
0024 
0025   pandora::FloatVector
0026       m_softCompParameters; ///< Parameters used to determine the weights applied to caloriemter hit energies
0027   pandora::FloatVector m_softCompEnergyDensityBins; ///< Energy density bins used for software compensation
0028   float m_energyDensityFinalBin;           ///< Energy density used for final bin entries in software compensation
0029   float m_maxClusterEnergyToApplySoftComp; ///< Maxmium energy of a cluster for which software compensation is applied
0030   float m_minCleanHitEnergy;               ///< Min calo hit hadronic energy to consider cleaning hit/cluster
0031   float m_minCleanHitEnergyFraction;       ///< Min fraction of cluster energy represented by hit to consider cleaning
0032   float m_minCleanCorrectedHitEnergy;      ///< Min value of new hit hadronic energy estimate after cleaning
0033 };
0034 
0035 //------------------------------------------------------------------------------------------------------------------------------------------
0036 //------------------------------------------------------------------------------------------------------------------------------------------
0037 
0038 /**
0039  *  @brief  LCSoftwareCompensation class.
0040  */
0041 class LCSoftwareCompensation : public pandora::EnergyCorrectionPlugin {
0042 public:
0043   /**
0044    *  @brief  Constructor with input parameters
0045    *
0046    *  @param  parameters the input parameters
0047    */
0048   LCSoftwareCompensation(const LCSoftwareCompensationParameters& parameters);
0049 
0050   pandora::StatusCode MakeEnergyCorrections(const pandora::Cluster* const pCluster, float& correctedEnergy) const;
0051 
0052 private:
0053   /**
0054    *  @brief  CleanCluster logic. Correct cluster energy by searching for constituent calo hits with anomalously high
0055    * energy. Corrections are made by examining the energy in adjacent layers of the cluster.
0056    *
0057    *  @param  pCluster the cluster
0058    *  @param  correctedHadronicEnergy corrected hadronic energy of the cluster
0059    */
0060   pandora::StatusCode CleanCluster(const pandora::Cluster* const pCluster, float& correctedHadronicEnergy) const;
0061 
0062   /**
0063    *  @brief  Get the sum of the hadronic energies of all calo hits in a specified layer of an ordered calo hit list
0064    *
0065    *  @param  orderedCaloHitList the ordered calo hit list
0066    *  @param  pseudoLayer the specified pseudolayer
0067    */
0068   float GetHadronicEnergyInLayer(const pandora::OrderedCaloHitList& orderedCaloHitList,
0069                                  const unsigned int pseudoLayer) const;
0070 
0071   /**
0072    *  @brief  Calculation of the software compensated corrected hadronic energy for a cluster
0073    *
0074    *  @param  clusterEnergyEstimation raw (i.e. no energy corrections) hadronic energy estimator for the cluster
0075    *  @param  caloHitList the calo hit list for the cluster where software compensation is being applied
0076    *  @param  energyCorrection corrected hadronic energy of the cluster
0077    */
0078   pandora::StatusCode SoftComp(float clusterEnergyEstimation, const pandora::CaloHitList& caloHitList,
0079                                float& energyCorrection) const;
0080 
0081   /**
0082    *  @brief  Calculate the energy density (binned) of a calo hit in units of GeV per cell
0083    *
0084    *  @param  pCaloHit the calo hit
0085    *  @param  energyDensity the binned energy density of the calo hit
0086    */
0087   pandora::StatusCode FindDensity(const pandora::CaloHit* const pCaloHit, float& energyDensity) const;
0088 
0089   pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
0090 
0091   pandora::FloatVector
0092       m_softCompParameters; ///< Parameters used to determine the weights applied to caloriemter hit energies
0093   pandora::FloatVector m_softCompEnergyDensityBins; ///< Energy density bins used for software compensation
0094   float m_energyDensityFinalBin;           ///< Energy density used for final bin entries in software compensation
0095   float m_maxClusterEnergyToApplySoftComp; ///< Maxmium energy of a cluster for which software compensation is applied
0096   float m_minCleanHitEnergy;               ///< Min calo hit hadronic energy to consider cleaning hit/cluster
0097   float m_minCleanHitEnergyFraction;       ///< Min fraction of cluster energy represented by hit to consider cleaning
0098   float m_minCleanCorrectedHitEnergy;      ///< Min value of new hit hadronic energy estimate after cleaning
0099 };
0100 
0101 } // namespace lc_content
0102 
0103 #endif // #ifndef LC_PARTICLE_ID_PLUGINS_H