Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:12:36

0001 #ifndef SPHELECTRONPAIRCONTAINER_V1_H
0002 #define SPHELECTRONPAIRCONTAINER_V1_H
0003 
0004 #include "sPHElectronPair.h"
0005 #include "sPHElectronPairv1.h"
0006 #include "sPHElectronPairContainer.h"
0007 
0008 #include <cstddef>        // for size_t
0009 #include <iostream>        // for cout, ostream
0010 
0011 class sPHElectronPairContainerv1 : public sPHElectronPairContainer
0012 {
0013 public:
0014 
0015   typedef std::map<unsigned int, sPHElectronPairv1*> PairMap;
0016   typedef std::map<unsigned int, sPHElectronPairv1*>::const_iterator ConstIter;
0017   typedef std::map<unsigned int, sPHElectronPairv1*>::iterator Iter;
0018 
0019   sPHElectronPairContainerv1();
0020   sPHElectronPairContainerv1(const sPHElectronPairContainerv1& container);
0021   sPHElectronPairContainerv1& operator=(const sPHElectronPairContainerv1& container);
0022 
0023   virtual ~sPHElectronPairContainerv1();
0024 
0025   void identify(std::ostream& os = std::cout) const;
0026   void Reset();
0027   void clear() { Reset(); }
0028   int isValid() const { return 1; }
0029   size_t size() const { return _map.size(); }
0030   bool empty() const { return _map.empty(); }
0031   PHObject* CloneMe() const { return new sPHElectronPairContainerv1(*this); }
0032 
0033   const sPHElectronPairv1* get(unsigned int idkey) const;
0034   sPHElectronPairv1* get(unsigned int idkey);
0035   void insert(const sPHElectronPairv1* pair);
0036   size_t erase(unsigned int idkey)
0037   {
0038     delete _map[idkey];
0039     return _map.erase(idkey);
0040   }
0041 
0042   ConstIter begin() const { return _map.begin(); }
0043   ConstIter find(unsigned int idkey) const { return _map.find(idkey); }
0044   ConstIter end() const { return _map.end(); }
0045 
0046   Iter begin() { return _map.begin(); }
0047   Iter find(unsigned int idkey) { return _map.find(idkey); }
0048   Iter end() { return _map.end(); }
0049 
0050 protected:
0051   PairMap _map;
0052   ClassDef(sPHElectronPairContainerv1, 1);
0053 
0054 };
0055 
0056 #endif
0057