source: Sophya/trunk/SophyaLib/HiStats/proxtuple.cc@ 2244

Last change on this file since 2244 was 2244, checked in by plaszczy, 23 years ago

nouvelle classe qui permet une gestion plus siple des ntuples
(juste un proxy) : voir header

File size: 1.2 KB
RevLine 
[2244]1//--------------------------------------------------------------------------
2//
3// Description:
4// class ProxTuple : see header file for description.
5//
6//------------------------------------------------------------------------
7//-----------------------
8// This Class's Header --
9//-----------------------
10#include "proxtuple.h"
11//---------------
12// STL
13//-----------------
14using namespace std;
15//-------------------------------
16// Collaborating Class Headers --
17//-------------------------------
18//-----------------------------------------------------------------------
19// Local Macros, Typedefs, Structures, Unions and Forward Declarations --
20//-----------------------------------------------------------------------
21
22
23//-----------------
24// Member functions --
25//-----------------
26void
27ProxTuple::fill(float v,const char* n){
28
29 if (_tuple==0) {
30 _name.push_back(string(n));
31 }
32 _val.push_back(v);
33
34}
35
36void
37ProxTuple::dump(){
38
39 int N=_val.size();
40 if (_tuple==0) {
41 char** names=new (char*)[N];
42 for (int i=0;i<N;i++) names[i]=(char*)_name[i].c_str();
43 _tuple=new NTuple(N,names);
44 }
45 float* xnt=new float[N];
46 for (int i=0;i<N;i++) xnt[i]=_val[i];
47 _tuple->Fill(xnt);
48
49 delete xnt;
50 _val.clear();
51
52
53}
Note: See TracBrowser for help on using the repository browser.