BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
ProjectMessenger Class Reference

#include <ProjectMessenger.h>

+ Inheritance diagram for ProjectMessenger:

Public Member Functions

 ProjectMessenger (Goofy *v)
 
 ~ProjectMessenger ()
 
void SetNewValue (G4UIcommand *command, G4String newValues)
 
G4String GetCurrentValue (G4UIcommand *command)
 

Detailed Description

Definition at line 10 of file ProjectMessenger.h.

Constructor & Destructor Documentation

◆ ProjectMessenger()

ProjectMessenger::ProjectMessenger ( Goofy v)

Definition at line 42 of file ProjectMessenger.cpp.

43{
44 rm=v;
45
46 make=new G4UIcommand("/Project/make",this);
47 make->SetGuidance("Builds the specified project");
48 G4UIparameter* parameter;
49 G4bool omitable;
50 parameter = new G4UIparameter ("Project", 's', omitable = false);
51 make->SetParameter(parameter);
52
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);
57
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);
62
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);
67
68 G4UIparameter* parameter2;
69 parameter2 = new G4UIparameter ("DetectorFacilityName", 's', omitable = false);
70 geo->SetParameter(parameter2);
71
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);
76
77 G4UIparameter* parameter3;
78 parameter3 = new G4UIparameter ("UserAction Name", 's', omitable = false);
79 act->SetParameter(parameter3);
80}
**********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
Definition: KarLud.h:35
double precision pisqo6 parameter(pi=3.14159265358979d0, pisq=pi *pi, pisqo6=pisq/6d0) double precision zip

◆ ~ProjectMessenger()

ProjectMessenger::~ProjectMessenger ( )

Definition at line 82 of file ProjectMessenger.cpp.

83{
84 // delete make;
85 // delete create;
86 // delete del;
87 // delete geo;
88 // delete act;
89}

Member Function Documentation

◆ GetCurrentValue()

G4String ProjectMessenger::GetCurrentValue ( G4UIcommand *  command)

Definition at line 171 of file ProjectMessenger.cpp.

172{
173 G4String s="Undefined";
174 return s;
175}
XmlRpcServer s
Definition: HelloServer.cpp:11

◆ SetNewValue()

void ProjectMessenger::SetNewValue ( G4UIcommand *  command,
G4String  newValues 
)

Definition at line 91 of file ProjectMessenger.cpp.

92{
93 if (command==make)
94 {
95 Goofy::Shell("cd "+newValues+"; gmake");
96 }
97 else if (command==create)
98 {
99 Goofy::Shell("mkdir "+newValues);
100 Goofy::Shell("mkdir "+newValues+"/src");
101 Goofy::Shell("mkdir "+newValues+"/include");
102 Goofy::Shell("touch "+newValues+"/src/dummy.cc");
103 std::cout<<"Looking for "<<std::flush;
104 if (Goofy::Shell("find $FADS_CURRENT/config -name GNUmakefile_template")==0)
105 {
106 std::cout<<" Found! "<<std::endl;
107 Goofy::Shell("cp $FADS_CURRENT/config/GNUmakefile_template "
108 +newValues+"/GNUmakefile");
109 }
110 Goofy::Shell("chmod -R 755 "+newValues);
111 }
112 else if (command==del)
113 {
114 if (Goofy::Shell("find . -name "+newValues))
115 Goofy::Shell("rm -rf "+newValues);
116 }
117 else if (command==geo)
118 {
119 G4String detName,project;
120 const char* s = newValues;
121 std::istrstream is ((char*)s);
122 is>>project>>detName;
123
124 if (Goofy::Shell("find . -name "+project)==0)
125 {
126 std::string where="$FADS_CURRENT/config/";
127 std::string incl=project+"/include/";
128 std::string src=project+"/src/";
129 Goofy::Shell("cp "+where+"DetectorFacilityTemplate.hh "
130 +incl);
131 parseTemplate(incl,"DetectorFacilityTemplate.hh",detName);
132 Goofy::Shell("mv "+incl+detName+".temp "+incl+
133 +detName+"Facility.hh");
134 Goofy::Shell("rm -f "+incl+"DetectorFacilityTemplate.hh");
135 Goofy::Shell("cp "+where+"DetectorFacilityTemplate.cc "
136 +src);
137 parseTemplate(src,"DetectorFacilityTemplate.cc",detName);
138 Goofy::Shell("mv "+src+detName+".temp "+src+
139 +detName+"Facility.cc");
140 Goofy::Shell("rm -f "+src+"DetectorFacilityTemplate.cc");
141 }
142 }
143 else if (command==act)
144 {
145 G4String actName,project;
146 const char* s = newValues;
147 std::istrstream is ((char*)s);
148 is>>project>>actName;
149
150 if (Goofy::Shell("find . -name "+project)==0)
151 {
152 std::string where="$FADS_CURRENT/config/";
153 std::string incl=project+"/include/";
154 std::string src=project+"/src/";
155 Goofy::Shell("cp "+where+"UserActionTemplate.hh "
156 +incl);
157 parseTemplate(incl,"UserActionTemplate.hh",actName);
158 Goofy::Shell("mv "+incl+actName+".temp "+incl+
159 +actName+"Action.hh");
160 Goofy::Shell("rm -f "+incl+"UserActionTemplate.hh");
161 Goofy::Shell("cp "+where+"UserActionTemplate.cc "
162 +src);
163 parseTemplate(src,"UserActionTemplate.cc",actName);
164 Goofy::Shell("mv "+src+actName+".temp "+src+
165 +actName+"Action.cc");
166 Goofy::Shell("rm -f "+src+"UserActionTemplate.cc");
167 }
168 }
169}
void parseTemplate(std::string dir, std::string filename, std::string dname)
static int Shell(std::string s)
Definition: Goofy.cpp:62

The documentation for this class was generated from the following files: