// SimpleEventDatasetSplitter.h #ifndef dset__SimpleEventDatasetSplitter_H #define dset__SimpleEventDatasetSplitter_H // David Adams // August 2003 // Updated June 2005. // // This dataset splitter splits a compound dataset into its constituents // and their constituents down to a specified depth and then merges these // to meet a number of criteria. Any other type of dataset is returned whole. // // The merging is done sequentially and the current dataset is merged as soon // as all datasets are merged. Criteria include // min_dataset - miumum # split datasets // min_event - minimum event count for those datasets // The last dataset holds whatever is leftover and is not required to meet // the criteria. // // XML description: // // SimpleEventDatasetSplitter // xml_version = 1.30 // dataset_depth = 1 Depth to descend in the dataset tree (-1 for all) // min_dataset = 1 Minumum # constituent datasets // min_event = 0 Minimum # events in each dataset // max_event = 0 Maximum # events in each dataset (0 for no limit) // // All paramters are optional with above values as defaults. #include "dataset_util/Text.h" #include "dataset_split/DatasetSplitter.h" namespace dset { class SimpleEventDatasetSplitter : public DatasetSplitter { public: // Typedefs. typedef std::string Name; public: // Embedded classes. class Imp; private: // data Imp* m_pimp; public: // static functions // Return the XML name. static const char* xml_name() { return "SimpleEventDatasetSplitter"; } // DTD. static const Text& dtd(); public: // Constructors, assignemnt and destructor. // Default constructor. SimpleEventDatasetSplitter(); // Copy constructor. SimpleEventDatasetSplitter(const SimpleEventDatasetSplitter& rhs); // Assignment. SimpleEventDatasetSplitter& operator=(const SimpleEventDatasetSplitter& rhs); // Destructor. ~SimpleEventDatasetSplitter(); public: // inherited functions // Split. DatasetList::size_type split_and_append(const Dataset& dst, DatasetList& subdsts) const; // Write to XML. const XmlElement* xml() const; // Output stream. std::ostream& ostr(std::ostream& str) const; public: // local functions // Set a parameter. // Names are those apperaing in the XML description. // Returns 0 for success. int set(Name name, int value); }; } // end namespace dset #endif