6 ifstream infil; infil.open(aeuler);
7 if ( !infil.is_open() ) {
8 G4cout <<
"[ConvertAeulerTodfb] *** Cannot open input file " << aeuler << endl;
11 ofstream oufil; oufil.open(dfb);
12 if ( !oufil.is_open() ) {
13 G4cout <<
"[ConvertAeulerTodfb] *** Cannot open input file " << dfb << endl;
16 std::string line; Int_t lline, i1, i2, nclust = 0; Double_t ps, th, ph, x, y, z; std::string sign_p[3], sign_r[3];
19 oufil <<
"# " << endl;
20 oufil <<
"# First the world / detector envelop. if detector does not exist, box with dim given otherwise dim ignored " << endl;
21 oufil <<
"# " << endl;
22 oufil <<
"w AGATA +2. +2. +2. m " << endl;
23 oufil <<
"# " << endl;
24 oufil <<
"@ 0 -> " << endl;
25 oufil <<
"# " << endl;
26 oufil <<
"# " << endl;
29 while( infil.good() ) {
33 if ( line.size() < 2u )
39 if(sscanf(line.data(),
"%d %d %lf %lf %lf %lf %lf %lf", &i1, &i2, &ps, &th, &ph, &x, &y, &z) != 8) {
68 oufil <<
"* DetectorFactory/SemiConductors/Ge/AGATA-TC\t"
69 << sign_p[0] << x <<
"\t" << sign_p[1] << y <<
"\t" << sign_p[2] << z <<
"\tmm"
70 <<
"\tRz " << sign_r[0] << ps <<
"\tRy " << sign_r[1] << th <<
"\tRz " << sign_r[2] << ph <<
"" << endl;
72 oufil <<
"# " << endl;
73 oufil <<
"# end " << endl;
void ConvertAeulerTodfb(const Char_t *aeuler, const Char_t *dfb)
read aeuler file as given in the AGATA G4 package and creates a .dfb that can be used in SToGS ...