File indexing completed on 2025-12-17 09:19:52
0001 #include "PhotonClusterv1.h"
0002 #include <cmath>
0003 #include <iostream>
0004 #include <limits>
0005 #include <map>
0006 #include <string>
0007
0008 PhotonClusterv1::PhotonClusterv1(const RawCluster& rc)
0009 : RawClusterv1(rc)
0010 {
0011 if (const auto* photon = dynamic_cast<const PhotonClusterv1*>(&rc))
0012 {
0013 m_shower_shapes = photon->get_all_shower_shapes();
0014 }
0015 }
0016
0017 void PhotonClusterv1::Reset()
0018 {
0019
0020 RawClusterv1::Reset();
0021
0022
0023 reset_photon_properties();
0024 }
0025
0026 void PhotonClusterv1::reset_photon_properties()
0027 {
0028 m_shower_shapes.clear();
0029 return;
0030 }
0031
0032
0033
0034
0035 void PhotonClusterv1::identify(std::ostream& os) const
0036 {
0037
0038 RawClusterv1::identify(os);
0039
0040
0041 identify_photon(os);
0042 }
0043
0044 void PhotonClusterv1::identify_photon(std::ostream& os) const
0045 {
0046 os << "--- PhotonClusterv1 Photon Properties ---" << std::endl;
0047 os << " Photon Energy: " << get_energy() << " GeV" << std::endl;
0048
0049 for (const auto& kv : m_shower_shapes)
0050 {
0051 os << " shape[" << kv.first << "]: " << kv.second << std::endl;
0052 }
0053 os << "------------------------------------------" << std::endl;
0054 }
0055
0056 bool PhotonClusterv1::pass_photon_cuts() const
0057 {
0058
0059 std::cout << "PhotonClusterv1::pass_photon_cuts() is currently unimplemented" << std::endl;
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072 return true;
0073 }
0074
0075 float PhotonClusterv1::get_shower_shape_parameter(const std::string& name) const
0076 {
0077 auto it = m_shower_shapes.find(name);
0078 if (it != m_shower_shapes.end())
0079 {
0080 return it->second;
0081 }
0082 return std::numeric_limits<float>::quiet_NaN();
0083 }