ROOT/Handling Data/ROOT Data Types

There are a couple of standard data types like,  ,  , etc. you've probably been using so far. However, despite these universally used names, there is no general agreement, what these types actually mean. In fact, it depends on your machine and compiler, how a data type will actually be stored. For example, some older standards will assign 16 bit to the  type while newer environments will use 32 bit. This might be acceptable for some applications, for data analysis it definitely isn't. As one starts to deal with huge amounts of data, one should be concerned about economic memory usage. This means to chose a data type that is big enough but nothing bigger to hold the intended value with the needed accuracy. To provide this, the programmer must be sure that the chosen data type will actually be the same on any machine the code gets compiled.

To ensure this, a number of machine independent data types that will always have the same definition has been defined in ROOT. It is strongly recommended to use this types when programming ROOT.

Table 1: Some of the machine independent data types defined in ROOT. See ref. for all types.