StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
pamc_test.C
1 {
2 Int_t i999jsis;
3 Int_t j;
4 Int_t k;
5 printf(" Creating the tables \n");
6 
7 St_scalars *sc = new St_scalars(10);
8 St_vectors *ve = new St_vectors(10);
9 
10 printf(" Calling the 'pamc'module \n");
11 
12 pamc(sc,ve);
13 
14 printf(" Checking the results \n");
15 
16 table_head_st *t1_h = sc.GetHeader();
17 table_head_st *t2_h = ve.GetHeader();
18 
19 printf(" t1_h.nok = %i, t2_h.nok = %i \n", t1_h.nok, t2_h.nok);
20 printf(" t1_h.rbytes = %i, t2_h.rbytes = %i \n", t1_h.rbytes, t2_h.rbytes);
21 
22 scalars_st *t1 = sc.GetTable();
23 vectors_st *t2 = ve.GetTable();
24 
25 for(k=0;k<(t1_h->nok);k++) {
26  printf(" scalars_st t1[%i]: \n ", k);
27  printf("\t aShort=%i \n", t1[k].aShort);
28  printf("\t aUshort=%i\n", t1[k].aUshort);
29  printf("\t aLong=%i\n", t1[k].aLong);
30  printf("\t aUlong=%i\n", t1[k].aUlong);
31  printf("\t aChar=%c\n", t1[k].aChar);
32  printf("\t aOctet=%x\n", t1[k].aOctet);
33  printf("\t aFloat=%f\n", t1[k].aFloat);
34  printf("\t aDouble=%e\n", t1[k].aDouble);
35  printf("\n");
36 }
37 for(k=0;k<(t2_h->nok);k++){
38  printf(" vectors_st t2[%i]: \n ", k);
39 
40 
41  //*-* t2[i].bShorts[j] = i+j;
42  printf("\t bShorts[3]: ");
43  for(j=0;j<3;j++) printf("\t %i ", t2[k].bShorts[j]);
44  printf("\n");
45 
46  //*-* t2[i].bUshorts[j] = i+j;
47  printf("\t bUshorts[3]: ");
48  for(j=0;j<3;j++) printf("\t %i ", t2[k].bUshorts[j]);
49  printf("\n");
50 
51  //*-* t2[i].bLongs[j] = i+j;
52  printf("\t bLongs[3]: ");
53  for(j=0;j<3;j++) printf("\t %i ", t2[k].bLongs[j]);
54  printf("\n");
55 
56  //*-* t2[i].bUlongs[j] = i+j;
57  printf("\t bUlongs[3]: ");
58  for(j=0;j<3;j++) printf("\t %i ", t2[k].bUlongs[j]);
59  printf("\n");
60 
61  //*-* t2[i].bChars[j] = '-';
62  printf("\t aOctet=%x\n", t1[k].aOctet);
63  printf("\t bChars[3]: ");
64  for(j=0;j<3;j++) printf("\t '%x' ", t2[k].bChars[j]);
65  printf("\n");
66 
67  //*-* t2[i].bOctets[j] = i+j;
68  printf("\t bOctets[3]: ");
69  for(j=0;j<3;j++) printf("\t %x ", t2[k].bOctets[j]);
70  printf("\n");
71 
72  //*-* t2[i].bFloats[j] = i+j;
73  printf("\t bFloats[3]: ");
74  for(j=0;j<3;j++) printf("\t %f ", t2[k].bFloats[j]);
75  printf("\n");
76 
77  //*-* t2[i].bDoubles[j] = i+j;
78  printf("\t bDoubles[3]: ");
79  for(j=0;j<3;j++) printf("\t %e ", t2[k].bDoubles[j]);
80  printf("\n");
81 
82  }
83 
84 }