File indexing completed on 2025-08-03 08:16:56
0001 #ifndef CALOBASE_RAWCLUSTERCONTAINER_H
0002 #define CALOBASE_RAWCLUSTERCONTAINER_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 RawCluster;
0013
0014 class RawClusterContainer : public PHObject
0015 {
0016 public:
0017 typedef std::map<RawClusterDefs::keytype, RawCluster *> Map;
0018 typedef Map::iterator Iterator;
0019 typedef Map::const_iterator ConstIterator;
0020 typedef std::pair<Iterator, Iterator> Range;
0021 typedef std::pair<ConstIterator, ConstIterator> ConstRange;
0022
0023 RawClusterContainer() {}
0024 ~RawClusterContainer() override {}
0025
0026 void Reset() override;
0027 int isValid() const override;
0028 void identify(std::ostream &os = std::cout) const override;
0029
0030 ConstIterator AddCluster(RawCluster *clus);
0031
0032 RawCluster *getCluster(const RawClusterDefs::keytype id);
0033 const RawCluster *getCluster(const RawClusterDefs::keytype id) const;
0034
0035
0036 ConstRange getClusters(void) const;
0037 Range getClusters(void);
0038 const Map &getClustersMap() const { return _clusters; }
0039 Map &getClustersMap() { return _clusters; }
0040
0041 unsigned int size() const { return _clusters.size(); }
0042 double getTotalEdep() const;
0043
0044 protected:
0045 Map _clusters;
0046
0047 ClassDefOverride(RawClusterContainer, 1)
0048 };
0049
0050 #endif