60 #define Q2_LOG_MIN 0.1
61 #define Q2_LOG_MAX 100
64 using namespace genie;
66 using std::ostringstream;
80 TTree * affnt,
tdata params, \
98 int main(
int argc,
char ** argv)
105 LOG(
"testAxialFormFactor",
pINFO) <<
"Found coefficient ranges:";
114 TTree * affnt =
new TTree(
"affnt",
"Axial Form Factor Test Tree");
120 AlgId id(
"genie::ZExpAxialFormFactorModel",
"Default");
130 affnt =
new TTree(
"axff",
"Axial Form Factor Test");
131 affnt->Branch(
"Kmax", &Kmax,
"Kmax/I");
132 affnt->Branch(
"mod", &mod,
"mod/I" );
133 affnt->Branch(
"Q2", &Q2,
"Q2/D" );
134 affnt->Branch(
"z" , &z ,
"z/D" );
135 affnt->Branch(
"FA", &FA,
"FA/D" );
136 affnt->Branch(
"cAn", cAn,
"cAn[Kmax]/D");
140 params.
pKmax = &Kmax;
154 if (do_Q4limit)
LOG(
"testAxialFormFactor",
pWARN) \
155 <<
"Q4limit specified, note that coefficients will be altered";
160 params.
pcAn[ip] = 0.;
171 <<
"Too many coefficient ranges, reducing to " <<
MAX_COEF;
175 LOG(
"testAxialFormFactor",
pWARN) <<
"pKmax = " << *params.
pKmax;
185 ostringstream alg_key;
186 for (
int ip=1;ip<Kmax+1;ip++)
189 alg_key <<
"QEL-Z_A" << ip;
192 LOG(
"testAxialFormFactor",
pINFO) <<
"Loading " << alg_key.str() \
193 <<
" : " << params.
pcAn[ip-1];
202 ostringstream alg_key;
206 alg_key <<
"QEL-Z_A" << ip;
209 LOG(
"testAxialFormFactor",
pWARN) <<
"Set parameter: " << params.
pcAn[ip-1];
228 TTree * affnt,
tdata params, \
235 algf->
GetAlgorithm(
"genie::DipoleAxialFormFactorModel",
"Default"));
238 algf->
GetAlgorithm(
"genie::ZExpAxialFormFactorModel",
"Default"));
245 for(
int iq=0; iq<
N_TREE; iq++) {
249 Q2 = TMath::Exp( TMath::Log(
double(
Q2_LOG_MIN))
250 + (
double(iq+1)/
double(N_TREE))
253 }
else { Q2 = (iq+1)*
double(
Q2_LIN)/double(N_TREE) ; }
260 double znum = TMath::Sqrt(tcut - t) - TMath::Sqrt(tcut - t0);
261 double zden = TMath::Sqrt(tcut - t) + TMath::Sqrt(tcut - t0);
262 double zpar = znum/zden;
264 if (zpar != zpar)
LOG(
"testAxialFormFactor",
pERROR) <<
"Undefined expansion parameter";
270 *params.
pFA = axff.
FA();
276 *params.
pFA = axff.
FA();
283 int kmaxinc,
tdata params, \
290 LOG(
"testAxialFormFactor",
pERROR) <<
"No coefficients to increment";
294 ostringstream alg_key;
301 params.
pcAn[ip] = coefmin[ip];
302 r->
Set(alg_key.str(),params.
pcAn[ip]);
307 if (ip == kmaxinc)
return false;
308 alg_key <<
"QEL-Z_A" << ip+1;
309 params.
pcAn[ip] += coefinc[ip];
310 r->
Set(alg_key.str(),params.
pcAn[ip]);
311 if (params.
pcAn[ip] > coefmax[ip]) stopflag=
false;
313 }
while (! stopflag);
325 LOG(
"testAxialFormFactor",
pINFO) <<
"Parsing command line arguments";
330 if( parser.OptionExists(
'o') ) {
331 LOG(
"testAxialFormFactor",
pINFO) <<
"Reading the event filename prefix";
335 <<
"Will set the default event filename prefix";
340 if( parser.OptionExists(
'l') ) {
341 LOG(
"testAxialFormFactor",
pINFO) <<
"Looping over logarithmic Q2";
344 LOG(
"testAxialFormFactor",
pINFO) <<
"Looping over linear Q2";
348 if( parser.OptionExists(
'c') ) {
349 LOG(
"testAxialFormFactor",
pINFO) <<
"Reading Coefficient Ranges";
350 string coef = parser.ArgAsString(
'c');
354 assert(coefrange.size() % 3 == 0);
RgDbl GetDoubleDef(RgKey key, RgDbl def_opt, bool set_def=true)
double Q2(const Interaction *const i)
void SetQ2(double Q2, bool selected=false)
Kinematics * KinePtr(void) const
static const double kPi0Mass
A singleton class holding all configuration registries built while parsing all loaded XML configurati...
Algorithm abstract base class.
RgDbl GetDouble(RgKey key) const
RgInt GetInt(RgKey key) const
static Interaction * QELCC(int tgt, int nuc, int probe, double E=0)
int main(int argc, char **argv)
string kDefOptEvFilePrefix
Summary information for an interaction.
double q2(bool selected=false) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
void ForceReconfiguration(bool ignore_alg_opt_out=false)
const Algorithm * GetAlgorithm(const AlgId &algid)
RgInt GetIntDef(RgKey key, RgInt def_opt, bool set_def=true)
Registry * GlobalParameterList(void) const
void UnLock(void)
unlocks the registry (doesn't unlock items)
Algorithm ID (algorithm name + configuration set name)
vector< string > Split(string input, string delim)
static AlgFactory * Instance()
A registry. Provides the container for algorithm configuration parameters.
RgBool GetBool(RgKey key) const
Registry * FindRegistry(string key) const
Command line argument parser.
void GetCommandLineArgs(int argc, char **argv)
The GENIE Algorithm Factory.
void Set(RgIMapPair entry)
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
RgBool GetBoolDef(RgKey key, RgBool def_opt, bool set_def=true)
static AlgConfigPool * Instance()