36 #include "Framework/AlgorithmAlgFactory.h"
47 using namespace genie;
48 using namespace genie::utils;
49 using namespace genie::mueloss;
56 int main(
int argc,
char ** argv)
61 double E[N] = {1,5,10,15,20,30,50,100,200,500, 1000,2000, 5000, 9000};
71 "genie::mueloss::BetheBlochModel",
"Default"));
73 const MuELossI * petrukhinShestakov =
75 "genie::mueloss::PetrukhinShestakovModel",
"Default"));
77 const MuELossI * kokoulinPetroukhin =
79 "genie::mueloss::KokoulinPetrukhinModel",
"Default"));
83 "genie::mueloss::BezrukovBugaevModel",
"Default"));
85 assert ( betheBloch );
86 assert ( petrukhinShestakov );
87 assert ( kokoulinPetroukhin );
88 assert ( bezroukovBugaev );
91 string myunits_name =
" GeV/(gr/cm^2)";
94 TFile froot(
"./genie-mueloss.root",
"RECREATE");
95 TNtuple muntp(
"muntp",
"muon dE/dx",
"material:E:ion:brem:pair:pnucl");
98 vector<string>::iterator iter;
99 for(iter = mtv.begin(); iter != mtv.end(); ++iter) {
104 <<
"---------- Computing/Printing muon energy losses in "
108 for(
int i=0; i<N; i++) {
111 double ion = betheBloch->
dE_dx(E[i],mt) / myunits_conversion;
115 <<
", Model: " << betheBloch->
Id().
Key()
116 <<
" : \n -dE/dx(E=" << E[i] <<
") = " << ion << myunits_name;
119 double brem = petrukhinShestakov->
dE_dx(E[i],mt) / myunits_conversion;
123 <<
", Model: " << petrukhinShestakov->
Id().
Key()
124 <<
" : \n -dE/dx(E=" << E[i] <<
") = " << brem << myunits_name;
127 double pair = kokoulinPetroukhin->
dE_dx(E[i],mt) / myunits_conversion;
131 <<
", Model: " << kokoulinPetroukhin->
Id().
Key()
132 <<
" : \n -dE/dx(E=" << E[i] <<
") = " << pair << myunits_name;
135 double pnucl = bezroukovBugaev->
dE_dx(E[i],mt) / myunits_conversion;
139 <<
", Model: " << bezroukovBugaev->
Id().
Key()
140 <<
" : \n -dE/dx(E=" << E[i] <<
") = " << pnucl << myunits_name
143 muntp.Fill( (
int)mt,E[i],ion,brem,pair,pnucl);
155 LOG(
"test",
pNOTICE) <<
"Parsing command line arguments";
159 if ( parser.OptionExists(
'm') ) {
160 LOG(
"test",
pINFO) <<
"Reading material ids";
163 LOG(
"test",
pINFO) <<
"Unspecified material ids - Exiting";
static constexpr double g
virtual double dE_dx(double E, MuELMaterial_t m) const =0
int main(int argc, char **argv)
virtual MuELProcess_t Process(void) const =0
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
static constexpr double cm2
static constexpr double GeV
const Algorithm * GetAlgorithm(const AlgId &algid)
virtual const AlgId & Id(void) const
Get algorithm ID.
vector< string > Split(string input, string delim)
static AlgFactory * Instance()
const char * AsString(Resonance_t res)
resonance id -> string
Command line argument parser.
void GetCommandLineArgs(int argc, char **argv)
The GENIE Algorithm Factory.
enum genie::mueloss::EMuELMaterial MuELMaterial_t