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

Last change on this file since 3840 was 3572, checked in by cmv, 17 years ago

char* -> const char* pour regler les problemes de deprecated string const... + comparaison unsigned signed + suppression EVOL_PLANCK rz+cmv 07/02/2009

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