Last change
on this file since 224 was 224, checked in by ansari, 26 years ago |
Creation module DPC/Tests Reza 09/04/99
|
File size:
1013 bytes
|
Line | |
---|
1 | #include <stdio.h>
|
---|
2 | #include <stdlib.h>
|
---|
3 | #include <math.h>
|
---|
4 | #include <iostream.h>
|
---|
5 |
|
---|
6 | #include "ntuple.h"
|
---|
7 |
|
---|
8 | int main(int, char **)
|
---|
9 | {
|
---|
10 | PeidaInit();
|
---|
11 |
|
---|
12 | char * names[3] = {"XPos", "YPos", "Val"};
|
---|
13 | int i,j, k;
|
---|
14 | float xnt[3];
|
---|
15 |
|
---|
16 | printf("Creation Ntuple avec X,Y,Val ... \n");
|
---|
17 | NTuple nt1(3, names, 20);
|
---|
18 |
|
---|
19 | k = 0;
|
---|
20 | for(j=0; j<8; j++)
|
---|
21 | for(i=0; i<12; i++)
|
---|
22 | { xnt[0] = i+0.5; xnt[1] = j+0.5; xnt[2] = k;
|
---|
23 | nt1.Fill(xnt); k++; }
|
---|
24 |
|
---|
25 | nt1.Show(cout);
|
---|
26 | nt1.Print(0, 5);
|
---|
27 | nt1.Print(18, 5);
|
---|
28 | nt1.Print(94, 5);
|
---|
29 |
|
---|
30 | printf("Ecriture NTuple ds nt.ppf ... \n");
|
---|
31 | nt1.Write("nt.ppf");
|
---|
32 |
|
---|
33 | printf("Lecture NTuple (nt2) ds nt.ppf ... \n");
|
---|
34 |
|
---|
35 | NTuple nt2("nt.ppf");
|
---|
36 | nt2.Show(cout);
|
---|
37 | nt2.Print(0, 5);
|
---|
38 | nt2.Print(18, 5);
|
---|
39 | nt2.Print(94, 5);
|
---|
40 |
|
---|
41 | printf("ReLecture NTuple (nt1) ds nt.ppf ... \n");
|
---|
42 |
|
---|
43 | nt1.Read("nt.ppf");
|
---|
44 | nt1.Show(cout);
|
---|
45 | nt1.Print(0, 5);
|
---|
46 | nt1.Print(18, 5);
|
---|
47 | nt1.Print(94, 5);
|
---|
48 |
|
---|
49 | printf("Creation/Lecture Lecture NTuple (nt1) ds nt.ppf ... \n");
|
---|
50 | NTuple nt3;
|
---|
51 | nt3.Read("nt.ppf");
|
---|
52 | nt3.Show(cout);
|
---|
53 | nt3.Print(0, 5);
|
---|
54 | nt3.Print(18, 5);
|
---|
55 | nt3.Print(94, 5);
|
---|
56 |
|
---|
57 | exit(0);
|
---|
58 | }
|
---|
59 |
|
---|
60 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.