// LayerStat.h #ifndef LayerStat_H #define LayerStat_H // Layer status contains the results of propagation to a layer surface. // It includes: // 1. the layer // 2. a flag indicating whether this is the last surface in the layer // 3. an optional miss which provides the likelihood that the track // would not have produced any clusters // 4. an optional cluster finder which provides access to the clusters // associated with the layer surface and // 5. an integer to record the internal state of the layer // // This is a concrete class and is not intended to be used for inheritance. // Layers can save and then retrieve their state in the layer status. // // Layer status objects form a linked list which is intended to be managed // from the top; when an object is deleted, children (and not parents) // are deleted recursively. // // The miss object is managed here, i.e. it is deleted when the layer // status is deleted. The layer and finder are not managed here. // #include #include "trfbase/Hit.h" #include "trfbase/MissPtr.h" namespace trf { class ClusterFinder; class ETrack; class Layer; class LayerStat; class CutRecord; class ClusterContainer; // Output stream. std::ostream& operator<<(std::ostream& stream, const LayerStat& lstat); class LayerStat { friend class Layer; private: // the layer that produced this status const Layer* _player; // flag indicating this is the last surface in this layer bool _at_exit; // crossing of track with layer surface MissPtr _pmiss; // Pointer to the object managing the list of clusters. // The object is not managed here; it is managed by the layer. // We are in trouble if the layer is deleted. // Null => this layer surface does not hold clusters (default). const ClusterFinder* _pfinder; // layer internal state int _layer_state; private: // methods // output stream void ostr(std::ostream& stream) const; public: // constructors // default constructor LayerStat(); // constructor from layer LayerStat(const Layer& layer); // copy constructor LayerStat(const LayerStat& rhs); // assignment operator LayerStat& operator=(const LayerStat& rhs); // destructor ~LayerStat(); public: // modifiers // reset flag, miss, finder and state void reset(); // set exit void set_at_exit(bool value =true ) { _at_exit = value; } // set the miss void set_miss(const Miss& miss); // drop the miss void unset_miss(); // set the cluster finder void set_finder(const ClusterFinder& finder) { _pfinder = &finder; }; // set the layer state void set_state(int layer_state) { _layer_state = layer_state; } public: // const accessors // return the layer const Layer& get_layer() const { return *_player; } // return true if the track is at the exit of this layer bool at_exit() const { return _at_exit; } // Return whether this surface has clusters. bool has_clusters() const { return _pfinder!=0; } // Return all the clusters associated with this surface // in the layer. ClusterList get_clusters() const; // Return all the clusters near the specified track associated with // the track's surface in the current layer surface and generate // CutRecords. const ClusterContainer& get_clusters(const ETrack& tre, const CutRecord* pcut_record, std::map* precs) const; // Return the miss. // Use get_miss()->new_copy() to get a mutable copy. const MissPtr& get_miss() const { return _pmiss; } // Fetch the layer state int get_state() const { return _layer_state; } // friends // Output stream. friend std::ostream& operator<<(std::ostream& stream, const LayerStat& lstat); }; //********************************************************************** } // end namespace trf #endif