Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-10-17 08:19:25

0001 #ifndef CALOBASE_PHOTONCLUSTER_H
0002 #define CALOBASE_PHOTONCLUSTER_H
0003 
0004 #include <Rtypes.h>  // for ROOT dictionary macro definitions
0005 #include <phool/phool.h>
0006 #include <iostream>
0007 #include <limits>
0008 
0009 //! Interface mixin providing photon-specific augmentation to a calorimeter cluster.
0010 //!
0011 //! Authors:
0012 //!  - S. Li <sli7@bnl.gov>
0013 //!
0014 //! Notes:
0015 //!  - Energy, position and isolation ET live in the underlying RawCluster implementation.
0016 //!  - This interface only covers photon ID related quantities (conversion + shower shape) and
0017 //!    convenience hooks for ID logic/printing. (conversion flag is a placeholder)
0018 //!  - Keep it lean: no data members here – storage resides in concrete subclasses.
0019 class PhotonCluster
0020 {
0021  public:
0022   //! Virtual destructor for proper cleanup via base pointer
0023   virtual ~PhotonCluster();
0024 
0025   //! @name Photon Property Getters
0026   //! @{
0027   //! Implement in derived classes. Default versions only warn and return sentinel values.
0028   virtual float get_conversion_probability() const
0029   {
0030     PHOOL_VIRTUAL_WARN("get_conversion_probability()");
0031     return std::numeric_limits<float>::quiet_NaN();
0032   }
0033 
0034   virtual bool is_converted() const
0035   {
0036     PHOOL_VIRTUAL_WARN("is_converted()");
0037     return false;
0038   }
0039 
0040   virtual float get_shower_shape_parameter(const std::string& /*name*/) const
0041   {
0042     PHOOL_VIRTUAL_WARN("get_shower_shape_parameter()");
0043     return std::numeric_limits<float>::quiet_NaN();
0044   }
0045   //! @}
0046 
0047   //! @name Photon Analysis Methods
0048   //! @{
0049   virtual bool pass_photon_cuts() const
0050   {
0051     PHOOL_VIRTUAL_WARN("pass_photon_cuts()");
0052     return false;
0053   }
0054 
0055   virtual void identify_photon(std::ostream& /*os*/ = std::cout) const
0056   {
0057     PHOOL_VIRTUAL_WARN("identify_photon()");
0058   }
0059   //! @}
0060 
0061   //! @name Photon Property Setters
0062   //! @{
0063   virtual void set_conversion_probability(const float /*prob*/)
0064   {
0065     PHOOL_VIRTUAL_WARN("set_conversion_probability()");
0066   }
0067 
0068   virtual void set_converted(const bool /*converted*/)
0069   {
0070     PHOOL_VIRTUAL_WARN("set_converted()");
0071   }
0072 
0073   virtual void set_shower_shape_parameter(const std::string& /*name*/, const float /*shape*/)
0074   {
0075     PHOOL_VIRTUAL_WARN("set_shower_shape_parameter()");
0076   }
0077   //! @}
0078 
0079   //! @name Lifecycle / validation helpers
0080   //! @{
0081   virtual void reset_photon_properties()
0082   {
0083     PHOOL_VIRTUAL_WARN("reset_photon_properties()");
0084   }
0085 
0086   virtual bool is_valid_photon() const
0087   {
0088     PHOOL_VIRTUAL_WARN("is_valid_photon()");
0089     return false;
0090   }
0091   //! @}
0092 
0093  protected:
0094   // Prevent direct instantiation; allow construction by derived classes only.
0095   PhotonCluster() = default;
0096 
0097   // Interface-only class (no PHObject inheritance) -> no overrides of ROOT virtuals
0098   // Use plain ClassDef to generate dictionary if needed for containers holding PhotonCluster*.
0099   ClassDef(PhotonCluster, 1)
0100 };
0101 
0102 #endif