Store time series data in ttree/ntuple/vector/array/etc?

Hello,

I know that root is best used for storing many ntuple-like events, but I was wondering if anyone could offer suggestions in storing time-series data. What makes it particularly difficult is that such data usually has a variable name, value, time-value, descriptor. It was mentioned on here before that one could create multiple trees for different time values, though I would rather store by variable. As an example I pasted some similar data below. The problems I see are the storage of the string (as a tbranch? for the country values below for example) and the fact that any option seems to need some sort of multi-demensional approach.

Any suggestions would be very helpful.

Thanks
james

Sample data similar to what I would like to store:


Country 2000 2005 2006 2007 2008 2009
Mexico 4,680,000 5,970,000 6,570,000 6,980,000 7,030,000 6,650,000
El Salvador 430,000 470,000 510,000 540,000 570,000 530,000
Guatemala 290,000 370,000 430,000 500,000 430,000 480,000
Honduras. 160,000 180,000 280,000 280,000 300,000 320,000
Philippines 200,000 210,000 280,000 290,000 300,000 270,000
India 120,000 280,000 210,000 220,000 160,000 200,000
Korea 180,000 210,000 230,000 230,000 240,000 200,000
Ecuador 110,000 120,000 150,000 160,000 170,000 170,000
Brazil 100,000 170,000 210,000 190,000 180,000 150,000
China 190,000 230,000 170,000 290,000 220,000 120,000
Other countries 2,000,000 2,280,000 2,290,000 2,100,000 2,000,000 1,650,000

Hi,

It depends really on the type of analysis you are the most likely to do.

One option is to create one branch per country and have one entry/row per time with the values ( time : data ).

Another option (useful if the countries could vary form time to time) is to use a collection and store one collection per time (i.e. one row with all the value for all the country). For example with a class like:class ValueContainer { Long_t fYear; std::vector<string> fCountries; std::vector<Long_t> fValues; };and store this as a split branch in a TTree.
(you could also bundle the country name and values into one class (and thus only one collection)).

Cheers,
Philippe.