Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:17:46

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4DETECTORS_PHG4CYLINDERGEOMCONTAINER_H
0004 #define G4DETECTORS_PHG4CYLINDERGEOMCONTAINER_H
0005 
0006 #include <phool/PHObject.h>
0007 
0008 #include <iostream>  // for cout, ostream
0009 #include <limits>
0010 #include <map>
0011 #include <utility>  // for make_pair, pair
0012 
0013 class PHG4CylinderGeom;
0014 
0015 class PHG4CylinderGeomContainer : public PHObject
0016 {
0017  public:
0018   using Map = std::map<int, PHG4CylinderGeom *>;
0019   using Iterator = Map::iterator;
0020   using ConstIterator = Map::const_iterator;
0021   using Range = std::pair<Iterator, Iterator>;
0022   using ConstRange = std::pair<ConstIterator, ConstIterator>;
0023 
0024   PHG4CylinderGeomContainer() = default;
0025   ~PHG4CylinderGeomContainer() override;
0026 
0027   // from PHObject
0028   void identify(std::ostream &os = std::cout) const override;
0029 
0030   int AddLayerGeom(const int i, PHG4CylinderGeom *mygeom);
0031   int AddLayerGeom(PHG4CylinderGeom *mygeom);
0032   PHG4CylinderGeom *GetLayerGeom(const int i);
0033   PHG4CylinderGeom *GetFirstLayerGeom();
0034   int get_NLayers() const { return layergeoms.size(); }
0035   ConstRange get_begin_end() const { return std::make_pair(layergeoms.begin(), layergeoms.end()); }
0036 
0037  protected:
0038   Map layergeoms;
0039   float magfield{std::numeric_limits<float>::quiet_NaN()};
0040   ClassDefOverride(PHG4CylinderGeomContainer, 1)
0041 };
0042 
0043 #endif