// TrackNtuple.h #ifndef TrackNtuple_H #define TrackNtuple_H // Abstract class for a class which manages an ntuple containing // tracking information. // #include #include "ptr/Ptr.h" #include "trfutil/Tuple_fwd.h" #include "trfbase/SurfacePtr.h" #include "trfbase/MCTrack.h" #include "trffit/RTrack.h" namespace trf { class TrackNtuple { private: // data // the ntuple Tuple* _pntp; // If this is true, then the present row is stored after each fill // operation. Otherwise the user must invoke store_row(). bool _auto_store; protected: // data // The number of filled entries (int or float) for the current row. int _fill_count; public: // constructors and destructor // constructor TrackNtuple(); // destructor virtual ~TrackNtuple(); public: // non-virtual non-const methods // Return the tuple. Tuple& get_tuple() { return *_pntp; } // Set the auto store state. If this is true, each fill operation // automatically stores the current row. void set_auto_store(bool auto_store) { _auto_store = auto_store; } // Add a column for integer data. // The new number of columns is returned. int add_column_int(std::string name, int def =-10000); // Add a column for float data. // The new number of columns is returned. int add_column_float(std::string name, float def =float(-10000)); // Fill an integer value. // Return the number of filled entries for this row. int fill_int(std::string name, int value); // Fill a float value. int fill_float(std::string name, float value); // Store the current row. // Any missing data is captured, all data is stored in the tuple and // then is cleared. // The stored row number is returned. int store_row(); public: // virtual non-const methods // set the event number virtual void set_event(int evt) =0; public: // non-virtual const methods // Return the auto store state. bool auto_store() const { return _auto_store; } // Return the tuple. const Tuple& get_tuple() const { return *_pntp; } // Return the number of columns in the tuple. int ncolumns() const; // Return the number of rows in the tuple. int nrows() const; }; } // end namespace trf #endif