Arrays CERN从TNTuple提取数组

Arrays CERN从TNTuple提取数组,arrays,root-framework,Arrays,Root Framework,我正在使用CERN的根框架,在存储和检索简单数组时遇到了一些问题。似乎我的最佳选择是使用TNTuple类,但我找不到一种方法来轻松地以逐个数字的方式访问TNTuple中存储的数据。实际上,我想做的是像通常使用浮点数组一样使用TNTuple,或者轻松地将TNTuple转换为浮点数组。有什么方法可以做到这一点吗?我建议直接使用数组类-TArrayF TNtuple通过GetArgs()公开各个列,例如 // make dummy ntuple with some data TNtuple nt("n

我正在使用CERN的根框架,在存储和检索简单数组时遇到了一些问题。似乎我的最佳选择是使用TNTuple类,但我找不到一种方法来轻松地以逐个数字的方式访问TNTuple中存储的数据。实际上,我想做的是像通常使用浮点数组一样使用TNTuple,或者轻松地将TNTuple转换为浮点数组。有什么方法可以做到这一点吗?

我建议直接使用数组类-TArrayF


TNtuple
通过
GetArgs()
公开各个列,例如

// make dummy ntuple with some data
TNtuple nt("nt", "", "a:b:c");
nt.Fill(0, 0, 0);
nt.Fill(1, 1, 1);

// show the data we have
nt.Scan();
************************************************
*    Row   *         a *         b *         c *
************************************************
*        0 *         0 *         0 *         0 *
*        1 *         1 *         1 *         1 *
************************************************
(Long64_t)2

for (int row = 0; row < nt.GetEntries(); ++row) {
    nt.GetEntry(row);

    // run through a, b, c
    for (int column = 0; nt.GetNvar(); ++column) {
      nt.GetArgs()[column];
    }
}
//使用一些数据进行虚拟N耦合
t元组nt(“nt”,“a:b:c”);
新台币填充(0,0,0);
新台币(1,1,1);;
//显示我们拥有的数据
nt.Scan();
************************************************
*第*a*b*c行*
************************************************
*        0 *         0 *         0 *         0 *
*        1 *         1 *         1 *         1 *
************************************************
(长64_t)2
对于(int row=0;row