35 #include "Randomize.h"
37 #include "StCoordinates.hh"
38 #include "StTpcCoordinateTransform.hh"
42 #include "StTpcSimpleGeometry.hh"
43 #include "StTpcSimpleSlowControl.hh"
44 #include "StTpcSimpleElectronics.hh"
45 #include "StSimpleMagneticField.hh"
46 #include "StTrsDeDx.hh"
49 #include "StTrsFastChargeTransporter.hh"
50 #include "StTrsSlowAnalogSignalGenerator.hh"
51 #include "StTrsFastDigitalSignalGenerator.hh"
54 #include "StTrsChargeSegment.hh"
55 #include "StTrsMiniChargeSegment.hh"
56 #include "StTrsAnalogSignal.hh"
57 #include "StTrsWireBinEntry.hh"
58 #include "StTrsWireHistogram.hh"
60 #include "StTrsSector.hh"
61 #include "StTrsDigitalSector.hh"
64 #define ivb if(VERBOSE)
69 int main (
int argc,
char* argv[])
75 bool usage = (argc > 1 ?
false :
true);
76 while ((c = getopt(argc, argv,
"b:")) != EOF)
81 breakNumber = atoi(argv[opt++]);
94 string geoFile(
"../run/TPCgeo.conf");
95 if (access(geoFile.c_str(),R_OK)) {
96 cerr <<
"ERROR:\n" << geoFile <<
" cannot be opened" << endl;
98 cerr <<
"Exitting..." << endl;
102 string scFile(
"../run/sc.conf");
103 if (access(scFile.c_str(),R_OK)) {
104 cerr <<
"ERROR:\n" << scFile <<
" cannot be opened" << endl;
105 cerr <<
"Exitting..." << endl;
109 string electronicsFile(
"../run/electronics.conf");
110 if (access(electronicsFile.c_str(),R_OK)) {
111 cerr <<
"ERROR:\n" << electronicsFile <<
" cannot be opened" << endl;
112 cerr <<
"Exitting..." << endl;
116 string magFile(
"../run/example.conf");
117 if (access(magFile.c_str(),R_OK)) {
118 cerr <<
"ERROR:\n" << magFile <<
" cannot be opened" << endl;
119 cerr <<
"Exitting..." << endl;
127 StTpcSimpleGeometry::instance(geoFile.c_str());
130 StTpcSimpleSlowControl::instance(scFile.c_str());
134 StSimpleMagneticField::instance(magFile.c_str());
137 StTpcSimpleElectronics::instance(electronicsFile.c_str());
155 StTrsFastChargeTransporter::instance(geomDb, scDb, &myEloss, magDb);
163 StTrsWireHistogram::instance(geomDb, scDb);
169 StTrsSlowAnalogSignalGenerator::instance(geomDb, scDb, electronicsDb, sector);
171 setChargeDistribution(StTrsSlowAnalogSignalGenerator::endo);
176 setElectronicSampler(StTrsSlowAnalogSignalGenerator::symmetricGaussianApproximation);
181 trsAnalogSignalGenerator->setDeltaPad(2);
187 StTrsFastDigitalSignalGenerator::instance(electronicsDb, sector, digitalSector);
194 float dE = 2.444*keV;
195 float dS = 1.*centimeter;
207 list<StTrsMiniChargeSegment> comp;
208 list<StTrsMiniChargeSegment>::iterator iter;
210 aSegment.split(&myEloss, magDb, breakNumber, &comp);
212 copy(comp.begin(), comp.end(), ostream_iterator<StTrsMiniChargeSegment>(cout,
"\n"));
218 for(iter = comp.begin();
227 trsTransporter->transportToWire(*iter);
236 theWirePlane->addEntry(anEntry);
240 cout <<
"\a***************************\a\n" << endl;
248 trsAnalogSignalGenerator->inducedChargeOnPad(theWirePlane);
251 cout <<
"sampleAnalogSiganl() " << endl;
252 trsAnalogSignalGenerator->sampleAnalogSignal();
258 trsDigitalSignalGenerator->digitizeSignal();