65 #ifdef G4ANALYSIS_USE_ROOT
91 if ( !
ParseArg(vararg))
return false;
104 en = std::pow(10., logmin + ( c*(logmax-logmin) / (npoints - 1.)) );
118 data <<
"MeV " <<
"MeV*cm2/g " <<
particle <<
" (into " <<
122 for (
size_t i=0; i<
energy.size(); i++){
127 #ifdef G4ANALYSIS_USE_ROOT
133 G4cout <<
"User choice:\n";
137 "\", material= \"" <<
material <<
"\", filename= \""<<
143 #ifdef G4ANALYSIS_USE_ROOT
144 void HadrontherapyInteractionParameters::PlotStopping(
const G4String& filetype)
149 gROOT->SetStyle(
"Plain");
150 theRootCanvas =
new TCanvas(
"theRootCanvas",
"Interaction Parameters",200, 10, 600,400);
151 theRootCanvas -> SetFillColor(20);
152 theRootCanvas -> SetBorderMode(1);
153 theRootCanvas -> SetBorderSize(1);
154 theRootCanvas -> SetFrameBorderMode(0);
155 theRootCanvas -> SetGrid();
159 if (theRootGraph)
delete theRootGraph;
162 axisX = theRootGraph -> GetXaxis(),
163 axisY = theRootGraph -> GetYaxis();
164 axisX -> SetTitle(
"MeV");
165 axisY -> SetTitle(
"Stopping Power (MeV cm2/g)");
169 axisX -> SetAxisColor(2);
170 axisY -> SetAxisColor(2);
173 theRootGraph -> SetMarkerColor(4);
174 theRootGraph -> SetMarkerStyle(20);
175 theRootGraph -> SetMarkerSize(.5);
179 G4String fName =
"./referenceData/interaction/" + gName +
"." + filetype;
180 theRootGraph -> SetTitle(gName);
181 theRootGraph -> Draw(
"AP");
184 theRootCanvas -> SaveAs(fName);
201 std::istringstream strParam(vararg);
213 G4cout <<
"WARNING: kinEmin must not exceed kinEmax!" <<
G4endl;
214 G4cout <<
"Usage: /parameter/command material kinetic Emin kinetic Emax nPoints [particle] [output filename]" <<
G4endl;
222 G4cout <<
"WARNING: material \"" <<
material <<
"\" doesn't exist in NIST elements/materials"
223 " table [$G4INSTALL/source/materials/src/G4NistMaterialBuilder.cc]" <<
G4endl;
224 G4cout <<
"Use command \"/parameter/nist\" to see full materials list" <<
G4endl;
232 G4cout <<
"Try the command \"/particle/list\" to get full supported particles list." <<
G4endl;
233 G4cout <<
"If you are interested in an ion that isn't in this list you must give it to the particle gun."
234 "\nTry the commands:\n/gun/particle ion"
235 "\n/gun/ion <atomic number> <mass number> <[charge]>" << G4endl <<
G4endl;
243 outfile.open(filename,std::ios_base::trunc);
257 G4cout <<
"Issuing a G4RunManager::beamOn()... ";
258 G4cout <<
"Current Run State is " << mState -> GetStateString( aState ) <<
G4endl;
275 const std::vector<G4String>& vec =
nistMat -> GetMaterialNames();
276 for (
size_t i=0; i<vec.size(); i++)
282 else if (vararg ==
"all" || vararg ==
"simple" || vararg ==
"compound" || vararg ==
"hep" )
284 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 &)