1#include "G4Svc/ProjectMessenger.h"
2#include "G4Svc/Goofy.h"
4#include "G4UIcommand.hh"
5#include "G4UImanager.hh"
7#include "FadsPackageLoader/PackageLoader.h"
15 if (in.getline(buffer,200))
23void parseTemplate(std::string dir,std::string filename, std::string dname)
25 std::string outname=dname;
26 std::string outfile=dir+outname+
".temp";
27 ofstream out(outfile.c_str());
28 ifstream in((dir+filename).c_str());
32 while ((buffer=
getLine(in))!=
"eof")
34 while ((i=buffer.find(
"@NAME"))!=std::string::npos)
36 if (i>0) buffer.replace(i,5,outname);
38 out<<buffer<<std::endl;
46 make=
new G4UIcommand(
"/Project/make",
this);
47 make->SetGuidance(
"Builds the specified project");
48 G4UIparameter* parameter;
50 parameter =
new G4UIparameter (
"Project",
's', omitable =
false);
51 make->SetParameter(parameter);
53 create=
new G4UIcommand(
"/Project/create",
this);
54 create->SetGuidance(
"Creates an empty project");
55 parameter =
new G4UIparameter (
"Project",
's', omitable =
false);
56 create->SetParameter(parameter);
58 del=
new G4UIcommand(
"/Project/delete",
this);
59 del->SetGuidance(
"Deletes a project");
60 parameter =
new G4UIparameter (
"Project",
's', omitable =
false);
61 del->SetParameter(parameter);
63 geo=
new G4UIcommand(
"/Project/add/DetectorFacility",
this);
64 geo->SetGuidance(
"Generates sample code for a detector facility in a project");
65 parameter =
new G4UIparameter (
"Project",
's', omitable =
false);
66 geo->SetParameter(parameter);
68 G4UIparameter* parameter2;
69 parameter2 =
new G4UIparameter (
"DetectorFacilityName",
's', omitable =
false);
70 geo->SetParameter(parameter2);
72 act=
new G4UIcommand(
"/Project/add/UserAction",
this);
73 act->SetGuidance(
"Generates sample code for an user action in a project");
74 parameter =
new G4UIparameter (
"Project",
's', omitable =
false);
75 act->SetParameter(parameter);
77 G4UIparameter* parameter3;
78 parameter3 =
new G4UIparameter (
"UserAction Name",
's', omitable =
false);
79 act->SetParameter(parameter3);
97 else if (command==create)
103 std::cout<<
"Looking for "<<std::flush;
104 if (
Goofy::Shell(
"find $FADS_CURRENT/config -name GNUmakefile_template")==0)
106 std::cout<<
" Found! "<<std::endl;
107 Goofy::Shell(
"cp $FADS_CURRENT/config/GNUmakefile_template "
108 +newValues+
"/GNUmakefile");
112 else if (command==del)
117 else if (command==geo)
119 G4String detName,project;
120 const char*
s = newValues;
121 std::istrstream is ((
char*)
s);
122 is>>project>>detName;
126 std::string where=
"$FADS_CURRENT/config/";
127 std::string incl=project+
"/include/";
128 std::string src=project+
"/src/";
133 +detName+
"Facility.hh");
134 Goofy::Shell(
"rm -f "+incl+
"DetectorFacilityTemplate.hh");
139 +detName+
"Facility.cc");
140 Goofy::Shell(
"rm -f "+src+
"DetectorFacilityTemplate.cc");
143 else if (command==act)
145 G4String actName,project;
146 const char*
s = newValues;
147 std::istrstream is ((
char*)
s);
148 is>>project>>actName;
152 std::string where=
"$FADS_CURRENT/config/";
153 std::string incl=project+
"/include/";
154 std::string src=project+
"/src/";
159 +actName+
"Action.hh");
165 +actName+
"Action.cc");
173 G4String
s=
"Undefined";
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
std::string getLine(ifstream &in)
void parseTemplate(std::string dir, std::string filename, std::string dname)
static int Shell(std::string s)
void SetNewValue(G4UIcommand *command, G4String newValues)
ProjectMessenger(Goofy *v)
G4String GetCurrentValue(G4UIcommand *command)