60 using namespace genie;
62 using std::ostringstream;
64 static const char*
kModelDipole =
"genie::DipoleAxialFormFactorModel";
65 static const char*
kModelZExp =
"genie::ZExpAxialFormFactorModel";
80 #ifdef _G_REWEIGHT_CCQE_DEBUG_ 210 fMaCurr = TMath::Max(0., fMaCurr );
221 fMaCurr = TMath::Max(0., fMaCurr );
227 double fracerr_zexp = 0.;
238 default:
return;
break;
241 fracerr_zexp = fracerr->
OneSigmaErr(syst, sign_twk);
245 fNormCurr = TMath::Max(0., fNormCurr);
259 ostringstream alg_key;
272 bool is_qe =
event.Summary()->ProcInfo().IsQuasiElastic();
273 bool is_cc =
event.Summary()->ProcInfo().IsWeakCC();
274 if(!is_qe || !is_cc)
return 1.;
276 bool charm =
event.Summary()->ExclTag().IsCharmEvent();
279 int nupdg =
event.Probe()->Pdg();
309 AlgId id(
"genie::LwlynSmithQELCCPXSec",
"Default");
330 this->
SetMaPath(
"FormFactorsAlg/AxialFormFactorModel/QEL-Ma");
331 this->
SetZExpPath(
"FormFactorsAlg/AxialFormFactorModel/");
354 ostringstream alg_key;
367 #ifdef _G_REWEIGHT_CCQE_DEBUG_ 368 fTestFile =
new TFile(
"./ccqe_reweight_test.root",
"recreate");
369 fTestNtp =
new TNtupleD(
"testntp",
"",
"E:Q2:wght");
376 if(!tweaked)
return 1.0;
385 if(!tweaked)
return 1.0;
392 double old_xsec =
event.DiffXSec();
393 double old_weight =
event.Weight();
395 double new_weight = old_weight * (new_xsec/old_xsec);
411 if(!tweaked)
return 1.0;
418 double old_xsec =
event.DiffXSec();
419 double old_weight =
event.Weight();
421 double new_weight = old_weight * (new_xsec/old_xsec);
429 double old_integrated_xsec =
fXSecModelDef -> Integral(interaction);
430 double new_integrated_xsec =
fXSecModel -> Integral(interaction);
431 assert(new_integrated_xsec > 0);
432 new_weight *= (old_integrated_xsec/new_integrated_xsec);
441 #ifdef _G_REWEIGHT_CCQE_DEBUG_ 443 double Q2 = interaction->
Kine().
Q2(
true);
444 fTestNtp->Fill(E,Q2,new_weight);
453 bool tweaked =
false;
458 if(!tweaked) {
return 1.0; }
465 double old_xsec =
event.DiffXSec();
466 double old_weight =
event.Weight();
468 double new_weight = old_weight * (new_xsec/old_xsec);
virtual const Registry & GetConfig(void) const
Get configuration registry.
Cross Section Calculation Interface.
bool fRewNuebar
reweight nu_e_bar CC?
tweak Z-expansion coefficient 1, affects dsigma(CCQE)/dQ2 both in shape and normalization ...
#include "Numerical/GSFunc.h"
double Q2(const Interaction *const i)
Kinematics * KinePtr(void) const
virtual double XSec(const Interaction *i, KinePhaseSpace_t k=kPSfE) const =0
Compute the cross section for the input interaction.
tweak CCQE normalization (energy independent)
string fMaPath
M_{A} path in config Registry.
Algorithm abstract base class.
double CalcWeightZExp(const EventRecord &event)
RgDbl GetDouble(RgKey key) const
double fZExpCurr[fZExpMaxSyst]
array of current parameter values
RgInt GetInt(RgKey key) const
bool fRewNumubar
reweight nu_mu_bar CC?
static const int kModeNormAndMaShape
XSecAlgorithmI * fXSecModelDef
default model
static const int kModeZExp
double OneSigmaErr(GSyst_t syst, int sign=0) const
tweak Z-expansion coefficient 4, affects dsigma(CCQE)/dQ2 both in shape and normalization ...
double fZExpTwkDial[fZExpMaxSyst]
Summary information for an interaction.
void UseSelectedKinematics(void)
double CalcWeightMaShape(const EventRecord &event)
Registry * fXSecModelConfig
config in tweaked model
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
tweak Z-expansion coefficient 3, affects dsigma(CCQE)/dQ2 both in shape and normalization ...
tweak Z-expansion coefficient 2, affects dsigma(CCQE)/dQ2 both in shape and normalization ...
const Kinematics & Kine(void) const
virtual void Configure(const Registry &config)
Configure the algorithm.
void SetSystematic(GSyst_t syst, double val)
update the value for the specified nuisance param
tweak Z-expansion CCQE normalization (energy independent)
static const double kASmallNum
An enumeration of systematic parameters.
void AdoptSubstructure(void)
static const char * kModelZExp
double CalcWeightMa(const EventRecord &event)
Algorithm * AdoptAlgorithm(const AlgId &algid) const
void Reconfigure(void)
propagate updated nuisance parameter values to actual MC, etc
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
void SetZExpPath(string p)
Algorithm ID (algorithm name + configuration set name)
static AlgFactory * Instance()
bool fRewNue
reweight nu_e CC?
A registry. Provides the container for algorithm configuration parameters.
tweak Ma CCQE, affects dsigma(CCQE)/dQ2 both in shape and normalization
const UInt_t kIAssumeFreeNucleon
static string AsString(GSyst_t syst)
string fZExpPath
algorithm path to get coefficients
int fMode
0: Ma, 1: Norm and MaShape, 2: Z-Expansion
bool fRewNumu
reweight nu_mu CC?
const InitialState & InitState(void) const
static GSystUncertainty * Instance(void)
double fZExpDef[fZExpMaxSyst]
double Q2(bool selected=false) const
void ClearRunningValues(void)
The GENIE Algorithm Factory.
XSecAlgorithmI * fXSecModel
tweaked model
int fZExpMaxCoef
max number of coefficients to use
void Set(RgIMapPair entry)
double ProbeE(RefFrame_t rf) const
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
tweak Ma CCQE, affects dsigma(CCQE)/dQ2 in shape only (normalized to constant integral) ...
double CalcWeight(const EventRecord &event)
calculate a weight for the input event using the current nuisance param values
double CalcWeightNorm(const EventRecord &event)
RgAlg GetAlg(RgKey key) const
void Reset(void)
set all nuisance parameters to default values
Event finding and building.
static const int fZExpMaxSyst
maximum number of systematics
bool IsHandled(GSyst_t syst)
does the current weight calculator handle the input nuisance param?
static const char * kModelDipole