59 #ifdef G4ANALYSIS_USE_ROOT
85 if ( !
ParseArg(vararg))
return false;
98 en = std::pow(10., logmin + ( c*(logmax-logmin) / (npoints - 1.)) );
112 data <<
"MeV " <<
"MeV*cm2/g " <<
particle <<
" (into " <<
116 for (
size_t i=0; i<
energy.size(); i++){
121 #ifdef G4ANALYSIS_USE_ROOT
127 G4cout <<
"User choice:\n";
131 "\", material= \"" <<
material <<
"\", filename= \""<<
137 #ifdef G4ANALYSIS_USE_ROOT
138 void HadrontherapyInteractionParameters::PlotStopping(
const G4String& filetype)
143 gROOT->SetStyle(
"Plain");
144 theRootCanvas =
new TCanvas(
"theRootCanvas",
"Interaction Parameters",200, 10, 600,400);
145 theRootCanvas -> SetFillColor(20);
146 theRootCanvas -> SetBorderMode(1);
147 theRootCanvas -> SetBorderSize(1);
148 theRootCanvas -> SetFrameBorderMode(0);
149 theRootCanvas -> SetGrid();
153 if (theRootGraph)
delete theRootGraph;
156 axisX = theRootGraph -> GetXaxis(),
157 axisY = theRootGraph -> GetYaxis();
159 axisY ->
SetTitle(
"Stopping Power (MeV cm2/g)");
163 axisX -> SetAxisColor(2);
164 axisY -> SetAxisColor(2);
167 theRootGraph -> SetMarkerColor(4);
168 theRootGraph -> SetMarkerStyle(20);
169 theRootGraph -> SetMarkerSize(.5);
173 G4String fName =
"./referenceData/interaction/" + gName +
"." + filetype;
175 theRootGraph -> Draw(
"AP");
178 theRootCanvas -> SaveAs(fName);
195 std::istringstream strParam(vararg);
207 G4cout <<
"WARNING: kinEmin must not exceed kinEmax!" <<
G4endl;
208 G4cout <<
"Usage: /parameter/command material EkinMin EKinMax nPoints [particle] [output filename]" <<
G4endl;
216 G4cout <<
"WARNING: material \"" <<
material <<
"\" doesn't exist in NIST elements/materials"
217 " table [$G4INSTALL/source/materials/src/G4NistMaterialBuilder.cc]" <<
G4endl;
218 G4cout <<
"Use command \"/parameter/nist\" to see full materials list" <<
G4endl;
226 G4cout <<
"Try the command \"/particle/list\" to get full supported particles list." <<
G4endl;
227 G4cout <<
"If you are interested in an ion that isn't in this list you must give it to the particle gun."
228 "\nTry the commands:\n/gun/particle ion"
229 "\n/gun/ion <atomic number> <mass number> <[charge]>" << G4endl <<
G4endl;
237 outfile.open(filename,std::ios_base::trunc);
251 G4cout <<
"Issuing a G4RunManager::beamOn()... ";
252 G4cout <<
"Current Run State is " << mState -> GetStateString( aState ) <<
G4endl;
269 const std::vector<G4String>& vec =
nistMat -> GetMaterialNames();
270 for (
size_t i=0; i<vec.size(); i++)
276 else if (vararg ==
"all" || vararg ==
"simple" || vararg ==
"compound" || vararg ==
"hep" )
278 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)
G4bool SetTitle(G4ToolsBaseHisto &baseHisto, const G4String &title)
static G4RunManager * GetRunManager()
const G4ParticleDefinition * FindParticle(const G4String &)