69 using namespace genie;
98 int main(
int argc,
char ** argv) {
116 double widthx = (TMath::Log10(vx[1])-TMath::Log10(vx[0]));
118 LOG(
"gcalchedisdiffxsec",
pINFO) << widthx;
126 TString treename = Form(
"diffxsec_nu%d_tgt%d_%s",
fNu,
fTgt,fChannel.c_str());
128 LOG(
"gcalchedisdiffxsec",
pINFO) << treename;
130 TTree * tree =
new TTree(treename,treename);
131 tree->Branch(
"Quark", &quark,
"Quark/I" );
132 tree->Branch(
"Ei", &ei,
"Ei/D" );
133 tree->Branch(
"Bx", &bx,
"Bx/D" );
134 tree->Branch(
"By", &by,
"By/D" );
135 tree->Branch(
"DiffXsec", &dxsec,
"DiffXsec/D" );
139 InteractionList::const_iterator intliter;
140 for(intliter = intlst->begin(); intliter != intlst->end(); ++intliter) {
146 if ( quark>0 ) quark += 100;
151 LOG(
"gcalchedisdiffxsec",
pINFO) <<
"Current interaction: " << interaction->
AsString();
155 for (
unsigned i=0; i<ve.size(); i++ ) {
159 LOG(
"gcalchedisdiffxsec",
pINFO) <<
"Energy: " << ei <<
" [GeV]";
161 TLorentzVector p4(0,0,ei,ei);
164 for (
unsigned j=0; j<vy.size(); j++ ) {
168 by = (1-z)*(ei-10.)/ei;
170 LOG(
"gcalchedisdiffxsec",
pDEBUG) <<
" z: " << z <<
" y: " << by;
172 if ( by==1. ) by -= 1
e-4;
175 double by_prev = (1-vy[j-1])*(ei-10.)/ei;
176 LOG(
"gcalchedisdiffxsec",
pDEBUG) <<
" by: " << by <<
" by_prev: " << by_prev <<
" " << vy[j-1];
177 if (by>by_prev) by = 1
e-4;
180 if ( by<0 || by>1 )
continue;
185 for (
unsigned k=0; k<vx.size(); k++ ) {
190 LOG(
"gcalchedisdiffxsec",
pDEBUG) <<
"x: " << bx <<
" y: " << by <<
" -> d2sigmadxdy[E=" << ei <<
"GeV] = " << dxsec <<
" cm2";
196 for (
unsigned k=0; k<vx.size(); k++ ) {
200 dxsec += xsec_alg->
XSec(interaction,
kPSxyfE) * bx;
203 LOG(
"gcalchedisdiffxsec",
pDEBUG) <<
" y: " << by <<
" -> d2sigmady[E=" << ei <<
"GeV] = " << dxsec <<
" cm2";
213 TFile * outfile =
new TFile(
fOutFileName.c_str(),
"RECREATE");
214 tree->Write(tree->GetName());
229 std::ifstream
infile(path.c_str());
233 LOG(
"gcalchedisdiffxsec",
pFATAL) <<
"There was a problem opening the input file!";
238 while (
infile >> val) list.push_back(val);
261 LOG(
"gcalchedisdiffxsec",
pINFO) <<
"Probe = " <<
fNu;
264 LOG(
"gcalchedisdiffxsec",
pFATAL) <<
"Unspecified input neutrino type!";
271 LOG(
"gcalchedisdiffxsec",
pINFO) <<
"Target = " <<
fTgt;
274 LOG(
"gcalchedisdiffxsec",
pFATAL) <<
"Unspecified input target type!";
284 LOG(
"gcalchedisdiffxsec",
pFATAL) <<
"Unspecified input path to Xlist!";
294 LOG(
"gcalchedisdiffxsec",
pFATAL) <<
"Unspecified input path to Ylist!";
304 LOG(
"gcalchedisdiffxsec",
pFATAL) <<
"Unspecified input path to Elist!";
319 LOG(
"gcalchedisdiffxsec",
pFATAL) <<
"Unspecified output file name!";
330 <<
"\n\n" <<
"Syntax:" <<
"\n"
331 <<
" gcalchedisdiffxsec -p nu -t tgt -o root_file\n"
335 <<
" --tune genie_tune\n"
336 <<
" --event-generator-list list_name\n"
337 <<
" [--message-thresholds xml_file]\n";
Cross Section Calculation Interface.
string EventGeneratorList(void) const
bool HitSeaQrk(void) const
void SetProbeP4(const TLorentzVector &P4)
string ArgAsString(char opt)
Kinematics * KinePtr(void) const
const EventGeneratorI * FindGenerator(const Interaction *interaction) const
int HitQrkPdg(void) const
void ReadFromCommandLine(int argc, char **argv)
string AsString(void) const
vector< double > ReadListFromPath(string path)
int main(int argc, char **argv)
Summary information for an interaction.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
void SetEventGeneratorList(string listname)
const InteractionList * Interactions(void) const
static constexpr double cm2
GENIE Event Generation Driver. A minimalist user interface object for generating neutrino interaction...
void BuildTune()
build tune and inform XSecSplineList
virtual double XSec(const Interaction *i, KinePhaseSpace_t k=kPSfE) const =0
Compute the cross section for the input interaction.
int FinalQuarkPdg(void) const
void Setx(double x, bool selected=false)
void UpdateWQ2FromXY(const Interaction *in)
static RunOpt * Instance(void)
void Sety(double y, bool selected=false)
const XclsTag & ExclTag(void) const
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
void Configure(int nu_pdgc, int Z, int A)
A vector of Interaction objects.
InitialState * InitStatePtr(void) const
const InitialState & InitState(void) const
void MesgThresholds(string inpfile)
Command line argument parser.
const Target & Tgt(void) const
bool OptionExists(char opt)
was option set?
void DecodeCommandLine(int argc, char *argv[])
Initial State information.