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

Last change on this file since 2341 was 2246, checked in by ansari, 23 years ago

Pb compil proxtuple.cc - Reza 4/11/2002

File size: 1.2 KB
Line 
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]=const_cast<char*>(_name[i].c_str());
43 _tuple=new NTuple(N,names);
44 delete[] names;
45 }
46 float* xnt=new float[N];
47 for (int i=0;i<N;i++) xnt[i]=_val[i];
48 _tuple->Fill(xnt);
49
50 delete xnt;
51 _val.clear();
52
53
54}
Note: See TracBrowser for help on using the repository browser.