Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:14:59

0001 /**
0002  *  @file   LCContent/include/LCPlugins/LCParticleIdPlugins.h
0003  *
0004  *  @brief  Header file for the lc particle id plugins class.
0005  *
0006  *  $Log: $
0007  */
0008 #ifndef LC_PARTICLE_ID_PLUGINS_H
0009 #define LC_PARTICLE_ID_PLUGINS_H 1
0010 
0011 #include "Plugins/ParticleIdPlugin.h"
0012 
0013 namespace lc_content {
0014 
0015 /**
0016  *  @brief  LCParticleIdPlugins class
0017  */
0018 class LCParticleIdPlugins {
0019 public:
0020   /**
0021    *   @brief  LCEmShowerId class
0022    */
0023   class LCEmShowerId : public pandora::ParticleIdPlugin {
0024   public:
0025     /**
0026      *  @brief  Default constructor
0027      */
0028     LCEmShowerId();
0029 
0030     bool IsMatch(const pandora::Cluster* const pCluster) const;
0031     bool IsMatch(const pandora::ParticleFlowObject* const pPfo) const;
0032 
0033   private:
0034     typedef std::pair<float, float> HitEnergyDistance;
0035     typedef std::vector<HitEnergyDistance> HitEnergyDistanceVector;
0036 
0037     /**
0038      *  @brief  Sort HitEnergyDistance objects by increasing distance
0039      *
0040      *  @param  lhs the first hit energy distance pair
0041      *  @param  rhs the second hit energy distance pair
0042      */
0043     static bool SortHitsByDistance(const HitEnergyDistance& lhs, const HitEnergyDistance& rhs);
0044 
0045     pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
0046 
0047     float m_mipCut_0;                       ///< Default cluster mip fraction cut for emshw id
0048     float m_mipCutEnergy_1;                 ///< Energy above which mip fraction cut value 1 is applied
0049     float m_mipCut_1;                       ///< Cluster mip fraction cut value 1
0050     float m_mipCutEnergy_2;                 ///< Energy above which mip fraction cut value 2 is applied
0051     float m_mipCut_2;                       ///< Cluster mip fraction cut value 2
0052     float m_mipCutEnergy_3;                 ///< Energy above which mip fraction cut value 3 is applied
0053     float m_mipCut_3;                       ///< Cluster mip fraction cut value 3
0054     float m_mipCutEnergy_4;                 ///< Energy above which mip fraction cut value 4 is applied
0055     float m_mipCut_4;                       ///< Cluster mip fraction cut value 4
0056     float m_dCosRCutEnergy;                 ///< Energy at which emshw id cut (on cluster fit result dCosR) changes
0057     float m_dCosRLowECut;                   ///< Low energy cut on cluster fit result dCosR
0058     float m_dCosRHighECut;                  ///< High energy cut on cluster fit result dCosR
0059     float m_rmsCutEnergy;                   ///< Energy at which emshw id cut (on cluster fit result rms) changes
0060     float m_rmsLowECut;                     ///< Low energy cut on cluster fit result rms
0061     float m_rmsHighECut;                    ///< High energy cut on cluster fit result rms
0062     float m_minCosAngle;                    ///< Min angular correction used to adjust radiation length measures
0063     float m_maxInnerLayerRadLengths;        ///< Max number of radiation lengths before cluster inner layer
0064     float m_minLayer90RadLengths;           ///< Min number of radiation lengths before cluster layer90
0065     float m_maxLayer90RadLengths;           ///< Max number of radiation lengths before cluster layer90
0066     float m_minShowerMaxRadLengths;         ///< Min number of radiation lengths before cluster shower max layer
0067     float m_maxShowerMaxRadLengths;         ///< Max number of radiation lengths before cluster shower max layer
0068     float m_highRadLengths;                 ///< Max number of radiation lengths expected to be spanned by em shower
0069     float m_maxHighRadLengthEnergyFraction; ///< Max fraction of cluster energy above max expected radiation lengths
0070     float m_maxRadial90;                    ///< Max value of transverse profile radial90
0071   };
0072 
0073   /**
0074    *   @brief  LCPhotonId class
0075    */
0076   class LCPhotonId : public pandora::ParticleIdPlugin {
0077   public:
0078     /**
0079      *  @brief  Default constructor
0080      */
0081     LCPhotonId();
0082 
0083     bool IsMatch(const pandora::Cluster* const pCluster) const;
0084     bool IsMatch(const pandora::ParticleFlowObject* const pPfo) const;
0085 
0086   private:
0087     pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
0088   };
0089 
0090   /**
0091    *   @brief  LCElectronId class
0092    */
0093   class LCElectronId : public pandora::ParticleIdPlugin {
0094   public:
0095     /**
0096      *  @brief  Default constructor
0097      */
0098     LCElectronId();
0099 
0100     bool IsMatch(const pandora::Cluster* const pCluster) const;
0101     bool IsMatch(const pandora::ParticleFlowObject* const pPfo) const;
0102 
0103   private:
0104     pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
0105 
0106     unsigned int m_maxInnerLayer;        ///< Max inner psuedo layer for fast electron id
0107     float m_maxEnergy;                   ///< Max electromagnetic energy for fast electron id
0108     float m_maxProfileStart;             ///< Max shower profile start for fast electron id
0109     float m_maxProfileDiscrepancy;       ///< Max shower profile discrepancy for fast electron id
0110     float m_profileDiscrepancyForAutoId; ///< Shower profile discrepancy for automatic fast electron selection
0111     float m_maxResidualEOverP;           ///< Max absolute difference between unity and ratio em energy / track momentum
0112   };
0113 
0114   /**
0115    *   @brief  LCMuonId class
0116    */
0117   class LCMuonId : public pandora::ParticleIdPlugin {
0118   public:
0119     /**
0120      *  @brief  Default constructor
0121      */
0122     LCMuonId();
0123 
0124     bool IsMatch(const pandora::Cluster* const pCluster) const;
0125     bool IsMatch(const pandora::ParticleFlowObject* const pPfo) const;
0126 
0127   private:
0128     pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
0129 
0130     unsigned int m_maxInnerLayer;            ///< Max inner psuedo layer for fast muon id
0131     float m_minTrackEnergy;                  ///< Min energy of associated track for fast muon id
0132     float m_maxHCalHitEnergy;                ///< Max hadronic energy for an individual hcal hit (suppress fluctuations)
0133     unsigned int m_minECalLayers;            ///< Min number of ecal layers for fast muon id
0134     unsigned int m_minHCalLayers;            ///< Min number of hcal layers for fast muon id
0135     bool m_shouldPerformGapCheck;            ///< Whether to perform muon recovery gap checks
0136     unsigned int m_minHCalLayersForGapCheck; ///< Min number of hcal layers to perform muon recovery gap check
0137     unsigned int m_minMuonHitsForGapCheck;   ///< Min number of muon hits to perform muon recovery gap check
0138     float m_eCalEnergyCut0;                  ///< Parameter 0 for ecal energy cut: cut = par0 + (par1 * trackEnergy)
0139     float m_eCalEnergyCut1;                  ///< Parameter 1 for ecal energy cut: cut = par0 + (par1 * trackEnergy)
0140     float m_hCalEnergyCut0;                  ///< Parameter 0 for hcal energy cut: cut = par0 + (par1 * trackEnergy)
0141     float m_hCalEnergyCut1;                  ///< Parameter 1 for hcal energy cut: cut = par0 + (par1 * trackEnergy)
0142     unsigned int m_minECalLayersForFit;      ///< Min number of ecal layers to perform fit to ecal section of cluster
0143     unsigned int m_minHCalLayersForFit;      ///< Min number of hcal layers to perform fit to hcal section of cluster
0144     unsigned int m_minMuonLayersForFit;      ///< Min number of muon layers to perform fit to muon section of cluster
0145     unsigned int m_eCalFitInnerLayer;        ///< Inner layer used for fit to ecal section of cluster
0146     unsigned int m_eCalFitOuterLayer;        ///< Outer layer used for fit to ecal section of cluster
0147     unsigned int m_hCalFitInnerLayer;        ///< Inner layer used for fit to hcal section of cluster
0148     unsigned int m_hCalFitOuterLayer;        ///< Outer layer used for fit to hcal section of cluster
0149     float m_eCalRmsCut0;                     ///< Parameter 0 for ecal rms cut: cut = par0 + (par1 * trackEnergy)
0150     float m_eCalRmsCut1;                     ///< Parameter 1 for ecal rms cut: cut = par0 + (par1 * trackEnergy)
0151     float m_eCalMaxRmsCut;                   ///< Max value of ecal rms cut
0152     float m_hCalRmsCut0;                     ///< Parameter 0 for hcal rms cut: cut = par0 + (par1 * trackEnergy)
0153     float m_hCalRmsCut1;                     ///< Parameter 0 for hcal rms cut: cut = par0 + (par1 * trackEnergy)
0154     float m_hCalMaxRmsCut;                   ///< Max value of hcal rms cut
0155     float m_eCalMipFractionCut0;     ///< Parameter 0 for ecal mip fraction cut: cut = par0 - (par1 * trackEnergy)
0156     float m_eCalMipFractionCut1;     ///< Parameter 1 for ecal mip fraction cut: cut = par0 - (par1 * trackEnergy)
0157     float m_eCalMaxMipFractionCut;   ///< Max value of ecal mip fraction cut
0158     float m_hCalMipFractionCut0;     ///< Parameter 0 for hcal mip fraction cut: cut = par0 - (par1 * trackEnergy)
0159     float m_hCalMipFractionCut1;     ///< Parameter 1 for hcal mip fraction cut: cut = par0 - (par1 * trackEnergy)
0160     float m_hCalMaxMipFractionCut;   ///< Max value of hcal mip fraction cut
0161     float m_eCalHitsPerLayerCut0;    ///< Parameter 0 for ecal hits per layer cut: cut = par0 + (par1 * trackEnergy)
0162     float m_eCalHitsPerLayerCut1;    ///< Parameter 1 for ecal hits per layer cut: cut = par0 + (par1 * trackEnergy)
0163     float m_eCalMaxHitsPerLayerCut;  ///< Max value of ecal hits per layer cut
0164     float m_hCalHitsPerLayerCut0;    ///< Parameter 0 for hcal hits per layer cut: cut = par0 + (par1 * trackEnergy)
0165     float m_hCalHitsPerLayerCut1;    ///< Parameter 1 for hcal hits per layer cut: cut = par0 + (par1 * trackEnergy)
0166     float m_hCalMaxHitsPerLayerCut;  ///< Max value of hcal hits per layer cut
0167     float m_curlingTrackEnergy;      ///< Max energy for associated track to be considered as curling
0168     float m_inBarrelHitFraction;     ///< Min fraction of hcal hits in barrel region to identify "barrel cluster"
0169     float m_tightMipFractionCut;     ///< Tight mip fraction cut
0170     float m_tightMipFractionECalCut; ///< Tight ecal mip fraction cut
0171     float m_tightMipFractionHCalCut; ///< Tight hcal mip fraction cut
0172     unsigned int m_minMuonHitsCut;   ///< Min number of hits in muon region
0173     unsigned int m_minMuonTrackSegmentHitsCut; ///< Min number of muon track segment hits
0174     float m_muonRmsCut;                        ///< Muon rms cut
0175     float m_maxMuonHitsCut0;                   ///< Parameter 0 for max muon hits cut: cut = par0 + (par1 * trackEnergy)
0176     float m_maxMuonHitsCut1;                   ///< Parameter 1 for max muon hits cut: cut = par0 + (par1 * trackEnergy)
0177     float m_maxMuonHitsCutMinValue;            ///< Min value of max muon hits cut
0178   };
0179 };
0180 
0181 //------------------------------------------------------------------------------------------------------------------------------------------
0182 
0183 inline bool LCParticleIdPlugins::LCEmShowerId::SortHitsByDistance(const HitEnergyDistance& lhs,
0184                                                                   const HitEnergyDistance& rhs) {
0185   return (lhs.second < rhs.second);
0186 }
0187 
0188 } // namespace lc_content
0189 
0190 #endif // #ifndef LC_PARTICLE_ID_PLUGINS_H