Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef CALOBASE_PHOTONCLUSTERV1_H
0002 #define CALOBASE_PHOTONCLUSTERV1_H
0003 
0004 #include "PhotonCluster.h"
0005 #include "RawClusterv1.h"
0006 
0007 #include <map>
0008 #include <string>
0009 
0010 //! PhotonClusterv1 - derives from both PhotonCluster and RawClusterv1
0011 //! @warning Multiple inheritance used - be careful with method resolution
0012 class PhotonClusterv1 : public PhotonCluster, public RawClusterv1
0013 {
0014  public:
0015   PhotonClusterv1() = default;
0016 
0017   //! @warning Virtual destructor override - ensures proper cleanup
0018   ~PhotonClusterv1() override = default;
0019 
0020   //! Copy constructor from existing RawClusterv1 object
0021   //! @warning This will copy all RawClusterv1 data but initialize photon properties to defaults
0022   explicit PhotonClusterv1(const RawClusterv1& rawcluster);
0023 
0024   //! Copy constructor
0025   PhotonClusterv1(const PhotonClusterv1& other) = default;
0026 
0027   //! Assignment operator
0028   PhotonClusterv1& operator=(const PhotonClusterv1& other) = default;
0029 
0030   //! @name PHObject Interface Overrides
0031   //! @{
0032   //! @warning Override methods from RawClusterv1 - virtual dispatch applies
0033   void Reset() override;
0034   PHObject* CloneMe() const override { return new PhotonClusterv1(*this); }
0035   int isValid() const override;
0036   void identify(std::ostream& os = std::cout) const override;
0037   //! @}
0038 
0039   //! @name PhotonCluster Virtual Method Implementations
0040   //! @{
0041   //! @warning These methods override virtual functions from PhotonCluster base
0042   float get_conversion_probability() const override { return m_conversion_prob; }
0043   bool is_converted() const override { return m_is_converted; }
0044   // RawClusterv1 already provides energy and isolation energy accessors
0045   // No single default shower shape parameter anymore
0046   bool pass_photon_cuts() const override;
0047   void identify_photon(std::ostream& os = std::cout) const override;
0048   bool is_valid_photon() const override;
0049   void reset_photon_properties() override;
0050   //! @}
0051 
0052   //! @name PhotonCluster Setter Implementations
0053   //! @{
0054   //! @warning Virtual override - can be further overridden in derived classes
0055   void set_conversion_probability(const float prob) override { m_conversion_prob = prob; }
0056   void set_converted(const bool converted) override { m_is_converted = converted; }
0057   // Extra helper to set named shower shape parameters
0058   void set_shower_shape_parameter(const std::string& name, float value) override { m_shower_shapes[name] = value; }
0059   float get_shower_shape_parameter(const std::string& name) const override;
0060   const std::map<std::string, float>& get_all_shower_shapes() const { return m_shower_shapes; }
0061   //! @}
0062 
0063  private:
0064   //! @warning Photon-specific data members - memory managed only in this derived class
0065   //! @warning Base class PhotonCluster has NO data members by design
0066   // Photon energy and isolation energy now sourced from RawClusterv1
0067   float m_conversion_prob{0.0f};                 //!< Probability of photon conversion
0068   bool m_is_converted{false};                    //!< Conversion flag
0069   std::map<std::string, float> m_shower_shapes;  //!< Named shower shape parameters
0070 
0071   ClassDefOverride(PhotonClusterv1, 1)  //!< ROOT dictionary generation
0072 };
0073 
0074 #endif