Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef CALOBASE_PHOTONCLUSTERCONTAINER_H
0002 #define CALOBASE_PHOTONCLUSTERCONTAINER_H
0003 
0004 #include "RawClusterDefs.h"
0005 
0006 #include <phool/PHObject.h>
0007 
0008 #include <iostream>
0009 #include <map>
0010 #include <utility>
0011 
0012 class PhotonCluster;  // interface
0013 
0014 // Container owning photon cluster objects (PhotonClusterv1 or derivatives)
0015 class PhotonClusterContainer : public PHObject
0016 {
0017  public:
0018   typedef std::map<RawClusterDefs::keytype, PhotonCluster*> Map;
0019   typedef Map::iterator Iterator;
0020   typedef Map::const_iterator ConstIterator;
0021   typedef std::pair<Iterator, Iterator> Range;
0022   typedef std::pair<ConstIterator, ConstIterator> ConstRange;
0023 
0024   PhotonClusterContainer() = default;
0025   ~PhotonClusterContainer() override = default;
0026 
0027   void Reset() override;
0028   int isValid() const override;
0029   void identify(std::ostream& os = std::cout) const override;
0030 
0031   ConstIterator AddCluster(PhotonCluster* clus);  // takes ownership
0032 
0033   PhotonCluster* getCluster(const RawClusterDefs::keytype key);
0034   const PhotonCluster* getCluster(const RawClusterDefs::keytype key) const;
0035 
0036   ConstRange getClusters() const;
0037   Range getClusters();
0038   const Map& getClustersMap() const { return m_clusters; }
0039   Map& getClustersMap() { return m_clusters; }
0040 
0041   unsigned int size() const { return m_clusters.size(); }
0042 
0043  protected:
0044   Map m_clusters;
0045 
0046   ClassDefOverride(PhotonClusterContainer, 1)
0047 };
0048 
0049 #endif