Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:08

0001 #ifndef TRACKBASE_CMFLASHDIFFERENCECONTAINER_H
0002 #define TRACKBASE_CMFLASHDIFFERENCECONTAINER_H
0003 
0004 /**
0005  * @file trackbase/CMFlashDifferenceContainer.h
0006  * @author Tony Frawley
0007  * @date January 2022
0008  * @brief Central membrane flash difference container base class
0009  */
0010 
0011 #include <phool/PHObject.h>
0012 
0013 #include <iostream>  // for cout, ostream
0014 #include <map>
0015 #include <utility>  // for pair
0016 
0017 class CMFlashDifference;
0018 
0019 /**
0020  * @brief CM cluster difference due to distortions container object
0021  */
0022 class CMFlashDifferenceContainer : public PHObject
0023 {
0024  public:
0025   //!@name convenient shortuts
0026   //@{
0027   using Map = std::map<unsigned int, CMFlashDifference*>;
0028   using Iterator = Map::iterator;
0029   using ConstIterator = Map::const_iterator;
0030   using Range = std::pair<Iterator, Iterator>;
0031   using ConstRange = std::pair<ConstIterator, ConstIterator>;
0032   //@}
0033 
0034   //! reset method
0035   void Reset() override {}
0036 
0037   //! identify object
0038   void identify(std::ostream& /*os*/ = std::cout) const override {}
0039 
0040   //! add a differences with specific key
0041   virtual void addDifferenceSpecifyKey(const unsigned int, CMFlashDifference*) = 0;
0042 
0043   //! remove differences
0044   virtual void removeDifference(unsigned int) {}
0045 
0046   //! return all differences
0047   virtual ConstRange getDifferences() const = 0;
0048 
0049   //! find differences matching given key
0050   virtual CMFlashDifference* findDifference(unsigned int) const { return nullptr; }
0051 
0052   //! total number of differences
0053   virtual unsigned int size() const { return 0; }
0054 
0055  protected:
0056   //! constructor
0057   CMFlashDifferenceContainer() = default;
0058 
0059  private:
0060   ClassDefOverride(CMFlashDifferenceContainer, 1)
0061 };
0062 
0063 #endif  // TRACKBASE_CMFLASHDIFFERENCECONTAINER_H