61 #ifdef G4ANALYSIS_USE_ROOT
87 if ( !
ParseArg(vararg))
return false;
100 en = std::pow(10., logmin + ( c*(logmax-logmin) / (npoints - 1.)) );
114 data <<
"MeV " <<
"MeV*cm2/g " <<
particle <<
" (into " <<
118 for (
size_t i=0; i<
energy.size(); i++){
123 #ifdef G4ANALYSIS_USE_ROOT
129 G4cout <<
"User choice:\n";
133 "\", material= \"" <<
material <<
"\", filename= \""<<
139 #ifdef G4ANALYSIS_USE_ROOT
140 void HadrontherapyInteractionParameters::PlotStopping(
const G4String& filetype)
145 gROOT->SetStyle(
"Plain");
146 theRootCanvas =
new TCanvas(
"theRootCanvas",
"Interaction Parameters",200, 10, 600,400);
147 theRootCanvas -> SetFillColor(20);
148 theRootCanvas -> SetBorderMode(1);
149 theRootCanvas -> SetBorderSize(1);
150 theRootCanvas -> SetFrameBorderMode(0);
151 theRootCanvas -> SetGrid();
155 if (theRootGraph)
delete theRootGraph;
158 axisX = theRootGraph -> GetXaxis(),
159 axisY = theRootGraph -> GetYaxis();
160 axisX -> SetTitle(
"MeV");
161 axisY -> SetTitle(
"Stopping Power (MeV cm2/g)");
165 axisX -> SetAxisColor(2);
166 axisY -> SetAxisColor(2);
169 theRootGraph -> SetMarkerColor(4);
170 theRootGraph -> SetMarkerStyle(20);
171 theRootGraph -> SetMarkerSize(.5);
175 G4String fName =
"./referenceData/interaction/" + gName +
"." + filetype;
176 theRootGraph -> SetTitle(gName);
177 theRootGraph -> Draw(
"AP");
180 theRootCanvas -> SaveAs(fName);
197 std::istringstream strParam(vararg);
209 G4cout <<
"WARNING: kinEmin must not exceed kinEmax!" <<
G4endl;
210 G4cout <<
"Usage: /parameter/command material kinetic Emin kinetic Emax nPoints [particle] [output filename]" <<
G4endl;
218 G4cout <<
"WARNING: material \"" <<
material <<
"\" doesn't exist in NIST elements/materials"
219 " table [$G4INSTALL/source/materials/src/G4NistMaterialBuilder.cc]" <<
G4endl;
220 G4cout <<
"Use command \"/parameter/nist\" to see full materials list" <<
G4endl;
228 G4cout <<
"Try the command \"/particle/list\" to get full supported particles list." <<
G4endl;
229 G4cout <<
"If you are interested in an ion that isn't in this list you must give it to the particle gun."
230 "\nTry the commands:\n/gun/particle ion"
231 "\n/gun/ion <atomic number> <mass number> <[charge]>" << G4endl <<
G4endl;
239 outfile.open(filename,std::ios_base::trunc);
253 G4cout <<
"Issuing a G4RunManager::beamOn()... ";
254 G4cout <<
"Current Run State is " << mState -> GetStateString( aState ) <<
G4endl;
271 const std::vector<G4String>& vec =
nistMat -> GetMaterialNames();
272 for (
size_t i=0; i<vec.size(); i++)
278 else if (vararg ==
"all" || vararg ==
"simple" || vararg ==
"compound" || vararg ==
"hep" )
280 nistMat -> ListMaterials(vararg);
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
std::vector< G4double > energy
G4Material * GetNistMaterial(G4String material)
~HadrontherapyInteractionParameters()
G4double ComputeTotalDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, G4double cut=DBL_MAX)
HadrontherapyInteractionParameters(G4bool)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4NistMaterialBuilder * nistMat
static G4NistManager * Instance()
void ListOfNistMaterials(const G4String &vararg)
G4double GetStopping(G4double energy, const G4ParticleDefinition *, const G4Material *, G4double density=0.)
std::vector< G4double > massDedx
static G4StateManager * GetStateManager()
HadrontherapyParameterMessenger * pMessenger
G4GLOB_DLL std::ostream G4cout
G4NistElementBuilder * nistEle
bool ParseArg(const G4String &vararg)
G4bool GetStoppingTable(const G4String &vararg)
static G4RunManager * GetRunManager()
const G4ParticleDefinition * FindParticle(const G4String &)