31 #include "SystemOfUnits.h"
32 #ifndef ST_NO_NAMESPACES
33 using namespace units;
40 #include "Randomize.h"
43 #include "StTrsDeDx.hh"
50 const int tupleSize = 3;
51 StHbookFile hbookFile(
"hbook");
52 StHbookTuple theTuple(
"dedx", tupleSize);
53 float tuple[tupleSize];
54 theTuple <<
"pri" <<
"tot" <<
"pnt" << book;
56 const int tupleSize2 = 2;
57 StHbookTuple secTuple(
"distribution", tupleSize2);
58 float tuple2[tupleSize2];
60 secTuple <<
"energy" <<
"sec" << book;
66 int primary, secondary;
72 for(
int pnt=0; pnt<10000; pnt++) {
75 primary = myEloss.primary();
79 for(
int ii=0; ii<primary; ii++) {
81 secondary = myEloss.secondary(&xysec);
82 totalSecondary += secondary;
84 tuple2[0] =
static_cast<float>(xysec/eV);
85 tuple2[1] =
static_cast<float>(secondary);
86 secTuple.fill(tuple2);
88 totalSecondary +=secondary;
92 total = primary+totalSecondary;
95 tuple[0] =
static_cast<float>(primary);
96 tuple[1] =
static_cast<float>(total);
97 tuple[2] =
static_cast<float>(pnt);
103 cout <<
"Done: " << endl;
106 hbookFile.saveAndClose();