// LayerSimulator.h #ifndef LayerSimulator_H #define LayerSimulator_H // A layer simulator generates hits for a layer using a track (VTrack) // as input. It is a simulator (i.e. inherits from class RandomSimulator) // so it must return a list of the generators (class RandomGenerator) used // to generate the hits. // // This class is abstract. A typical implementation would include the // layer, hit generators for each active surface in the layer and a // propagator. // // We take shared management of the associated layer. // #include #include "trfutil/RandomSimulator.h" #include "LayerPtr.h" namespace trf { class Layer; class VTrack; class LayerSimulator; // output stream function std::ostream& operator<<(std::ostream& stream, const LayerSimulator& lsim); class LayerSimulator : public RandomSimulator { private: // attibutes // layer LayerPtr _plyr; private: // methods // output stream virtual void ostr(std::ostream& stream) const =0; protected: // methods // constructor from the layer LayerSimulator(LayerPtr plyr); public: // methods // Return the layer associated with this simulator. Layer& get_layer(); // Return the const layer associated with this simulator. const Layer& get_layer() const; // Return the shared-ownership pointer to the layer. LayerPtr get_layer_pointer() const; // Generate clusters from a track and add them to the layer. virtual void add_clusters(const VTrack& trv) =0; // drop the clusters from the layer // The default method here invokes the layer drop_clusters method(). // In unusual cases subclass may want to override. virtual void drop_clusters(); // output stream function friend std::ostream& operator<<(std::ostream& stream, const LayerSimulator& lsim); }; } // end namespace trf #endif