//----------------------------------------------------------- // File and Version Information: // $Id$ // // Description: // Owns the TpcPadShapes, can read them from a file and returns the // right shape after getting its ID. // // Environment: // Software developed for the PANDA Detector at FAIR. // // Author List: // Cristoforo Simonetto TUM (original author) // // //----------------------------------------------------------- #ifndef TPCPADSHAPEPOOL_HH #define TPCPADSHAPEPOOL_HH // Base Class Headers ---------------- // Collaborating Class Headers ------- #include #include // Collaborating Class Declarations -- class TpcAbsPadShape; class TpcGem; class TpcPadShapePool { public: // Constructors/Destructors --------- TpcPadShapePool(); TpcPadShapePool(const char* const filename, const TpcGem& gem, const double _range, const double _step, const double _intStep); ~TpcPadShapePool(); // Operators friend std::ostream& operator<< (std::ostream& s, const TpcPadShapePool& me); // Accessors ----------------------- TpcAbsPadShape* GetPadShape(const unsigned int _ID) const; // Modifiers ----------------------- //PadShapePool will take ownership // The user is responsible for Building the PRLookupTable void AddPadShape(TpcAbsPadShape* padshape); void RemovePadShape(const unsigned int _ID);//deletes it //PadShapePool will take ownership // PadShapePool will build the PRLookupTables void ReadFromFile(const char* const filename); void BuildLookupTable(const TpcGem& gem, const double _range, const double _step, const double _intStep); private: // Private Data Members ------------ std::vector references; // Private Methods ----------------- bool TryAddingPadShape(TpcAbsPadShape* padshape); bool ReadLine(std::ifstream& infile); TpcAbsPadShape* ReadShape(const char* const line); TpcAbsPadShape* ReadPolygon(const char* const line); }; #endif //-------------------------------------------------------------- // $Log$ //--------------------------------------------------------------