30 #include "SystemOfUnits.h"
33 #include "StTpcSimpleGeometry.hh"
34 #include "StTpcSimpleSlowControl.hh"
35 #include "StTpcSimpleElectronics.hh"
36 #include "StSimpleMagneticField.hh"
37 #include "StTrsDeDx.hh"
39 #include "StTrsFastChargeTransporter.hh"
44 const int tupleSize = 2;
45 StHbookFile hbookFile(
"hbook");
46 StHbookTuple theTuple(
"gating grid", tupleSize);
47 float tuple[tupleSize];
48 theTuple <<
"v" <<
"t" << book;
53 string geoFile(
"../run/TPCgeo.conf");
54 if (access(geoFile.c_str(),R_OK)) {
55 cerr <<
"ERROR:\n" << geoFile <<
" cannot be opened" << endl;
57 cerr <<
"Exitting..." << endl;
61 string scFile(
"../run/sc.conf");
62 if (access(scFile.c_str(),R_OK)) {
63 cerr <<
"ERROR:\n" << scFile <<
" cannot be opened" << endl;
65 cerr <<
"Exitting..." << endl;
69 string magFile(
"../run/example.conf");
70 if (access(magFile.c_str(),R_OK)) {
71 cerr <<
"ERROR:\n" << magFile <<
" cannot be opened" << endl;
72 cerr <<
"Exitting..." << endl;
76 string electronicsFile(
"../run/electronics.conf");
77 if (access(electronicsFile.c_str(),R_OK)) {
78 cerr <<
"ERROR:\n" << electronicsFile <<
" cannot be opened" << endl;
79 cerr <<
"Exitting..." << endl;
88 StTpcSimpleGeometry::instance(geoFile.c_str());
91 StTpcSimpleElectronics::instance(electronicsFile.c_str());
94 StTpcSimpleSlowControl::instance(scFile.c_str());
97 StSimpleMagneticField::instance(scFile.c_str());
107 StTrsFastChargeTransporter::instance(geomDb, scDb, &gasDb, magDb);
109 trsTransporter->setGatingGridTransparency(
true);
111 #ifndef ST_NO_NAMESPACES
112 using namespace units;
114 float voltage = -140.*volt;
116 voltage += (1.*volt);
117 trsTransporter->setGatingGridVoltage(voltage);
118 double value = trsTransporter->transparencyCalculation();
120 tuple[0] =
static_cast<float>(voltage/volt);
121 tuple[1] =
static_cast<float>(value);
123 theTuple.fill(tuple);
125 }
while (voltage <= (10.*volt));
127 hbookFile.saveAndClose();