LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
rwgt::NuReweight Class Reference

#include "NuReweight.h"

Inheritance diagram for rwgt::NuReweight:
rwgt::GENIEReweight

Public Member Functions

 NuReweight ()
 <constructor More...
 
 ~NuReweight ()
 
double CalcWeight (const simb::MCTruth &truth, const simb::GTruth &gtruth) const
 
void AddReweightValue (ReweightLabel_t rLabel, double value)
 Change a reweight parameter. If it hasn't been added yet add it. More...
 
void ChangeParameterValue (ReweightLabel_t rLabel, double value)
 Configure the weight calculators. More...
 
double NominalParameterValue (ReweightLabel_t rLabel)
 Return the configured value of the given parameter. More...
 
double ReweightParameterValue (ReweightLabel_t rLabel)
 Add reweight parameters to the list. More...
 
genie::rew::GReWeight * WeightCalculator ()
 
void Configure ()
 Reconfigure the weight calculators. More...
 
void Reconfigure ()
 Simple Configuration functions for configuring a single weight calculator. More...
 
void ReweightNCEL (double ma, double eta)
 Simple Configurtion of the CCQE axial weight calculator. More...
 
void ReweightQEMA (double ma)
 Simple Configuration of the CCQE vector weight calculator. More...
 
void ReweightQEVec (double mv)
 
void ReweightQEZExp (double norm, double a1, double a2, double a3, double a4)
 Simple Configuration of the CC Resonance weight calculator. More...
 
void ReweightResGanged (double ma, double mv=0.0)
 Simple Configuration of the Coherant weight calculator. More...
 
void ReweightCCRes (double ma, double mv=0.0)
 Simple Configurtion of the NC Resonance weight calculator. More...
 
void ReweightNCRes (double ma, double mv=0.0)
 Simple Configuration of the NC and CC Resonance weight calculator with the axial mass parameter for NC/CC ganged together. More...
 
void ReweightCoh (double ma, double r0)
 Simple Configuration of the Non-Resonance Background weight calculator. More...
 
void ReweightNonResRvp1pi (double sigma)
 Simple Configuration of the Non-Resonance Background weight calculator. More...
 
void ReweightNonResRvbarp1pi (double sigma)
 Simple Configuration of the Non-Resonance Background weight calculator. Here it is being configured for v+p and vbar + n (2 pi) type interactions. More...
 
void ReweightNonResRvp2pi (double sigma)
 Simple Configuration of the Non-Resonance Background weight calculator. More...
 
void ReweightNonResRvbarp2pi (double sigma)
 Simple Configuration of the Resonance decay model weight calculator. More...
 
void ReweightResDecay (double gamma, double eta, double theta)
 Simple Configuration of the Total NC cross section. More...
 
void ReweightNC (double norm)
 Simple Configuration of the DIS FF model weight calculator. More...
 
void ReweightDIS (double aht, double bht, double cv1u, double cv2u)
 Simple Configuration of the DIS nuclear model. More...
 
void ReweightDISnucl (bool mode)
 Simple Configuration of the DIS AGKY hadronization model. More...
 
void ReweightAGKY (double xF, double pT)
 Simple Configuration of the Intranuke Nuclear model. More...
 
void ReweightFormZone (double sigma)
 Simple Configuration of the Fermigas model reweight calculator. More...
 
void ReweightFGM (double kF, double sf)
 End of Simple Reweight Configurations. More...
 
void ReweightIntraNuke (ReweightLabel_t name, double sigma)
 Simple Configuration of the Formation Zone reweight calculator. More...
 
void ReweightIntraNuke (int name, double sigma)
 
void MaQEshape ()
 
void MaQErate ()
 
void CCRESshape ()
 
void CCRESrate ()
 
void NCRESshape ()
 
void NCRESrate ()
 
void DIS_BYshape ()
 
void DIS_BYrate ()
 
void UseSigmaDef ()
 
void UseStandardDef ()
 
void SetNominalValues ()
 Return the nominal value for the given parameter. More...
 
double CalculateSigma (ReweightLabel_t label, double value)
 Calculate the weights. More...
 
double CalculateWeight (const genie::EventRecord &evr) const
 
void ConfigureNCEL ()
 Configure the MaQE weight calculator. More...
 
void ConfigureQEMA ()
 Configure the QE vector FF weight calculator. More...
 
void ConfigureQEVec ()
 Configure the CCRES calculator. More...
 
void ConfigureCCRes ()
 Configure the NCRES calculator. More...
 
void ConfigureNCRes ()
 Configure the ResBkg (kno) weight calculator. More...
 
void ConfigureResBkg ()
 Configure the ResDecay weight calculator. More...
 
void ConfgureResDecay ()
 Configure the NC weight calculator. More...
 
void ConfigureNC ()
 Configure the DIS (Bodek-Yang) weight calculator. More...
 
void ConfigureDIS ()
 Configure the Coherant model weight calculator. More...
 
void ConfigureCoh ()
 Configure the hadronization (AGKY) weight calculator. More...
 
void ConfigureAGKY ()
 Configure the DIS nuclear model weight calculator. More...
 
void ConfigureDISNucMod ()
 Configure the FG model weight calculator. More...
 
void ConfigureFGM ()
 Configure the Formation Zone weight calculator. More...
 
void ConfigureFZone ()
 Configure the intranuke weight calculator. More...
 
void ConfigureINuke ()
 configure the weight parameters being used More...
 
void ConfigureParameters ()
 

Protected Attributes

bool fReweightNCEL
 
bool fReweightQEMA
 
bool fReweightQEVec
 
bool fReweightCCRes
 
bool fReweightNCRes
 
bool fReweightResBkg
 
bool fReweightResDecay
 
bool fReweightNC
 
bool fReweightDIS
 
bool fReweightCoh
 
bool fReweightAGKY
 
bool fReweightDISNucMod
 
bool fReweightFGM
 
bool fReweightFZone
 
bool fReweightINuke
 
bool fReweightZexp
 
bool fReweightMEC
 
bool fMaQEshape
 
bool fMaCCResShape
 
bool fMaNCResShape
 
bool fDISshape
 
bool fUseSigmaDef
 
std::vector< int > fReWgtParameterName
 
std::vector< double > fReWgtParameterValue
 
std::map< int, double > fNominalParameters
 
genie::rew::GReWeight * fWcalc
 

Private Member Functions

genie::EventRecord RetrieveGHEP (const simb::MCTruth &truth, const simb::GTruth &gtruth) const
 

Detailed Description

Definition at line 15 of file NuReweight.h.

Constructor & Destructor Documentation

rwgt::NuReweight::NuReweight ( )

<constructor

destructor

Definition at line 71 of file NuReweight.cxx.

rwgt::NuReweight::~NuReweight ( )

Definition at line 76 of file NuReweight.cxx.

76  {
77  // Don't delete fWcalc here. The GENIEReweight parent class handles it.
78  }

Member Function Documentation

double rwgt::GENIEReweight::CalculateSigma ( ReweightLabel_t  label,
double  value 
)
inherited

Calculate the weights.

Used in parameter value mode (instead of parameter sigma mode) Given a user passed parameter value calculate the corresponding sigma value that needs to be passed to genie to give the same weight.

Definition at line 836 of file GENIEReweight.cxx.

References rwgt::fReweightCCQEMomDistroFGtoSF, rwgt::fReweightDISNuclMod, rwgt::fReweightTheta_Delta2Npi, rwgt::GENIEReweight::NominalParameterValue(), pmtana::sign(), and fhicl::detail::atom::value().

Referenced by rwgt::GENIEReweight::ConfigureParameters().

double rwgt::GENIEReweight::CalculateWeight ( const genie::EventRecord &  evr) const
inherited

Definition at line 861 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::fWcalc.

Referenced by CalcWeight().

865  {
866  //genie::EventRecord evr = this->RetrieveGHEP(truth, gtruth);
double rwgt::NuReweight::CalcWeight ( const simb::MCTruth truth,
const simb::GTruth gtruth 
) const

Definition at line 80 of file NuReweight.cxx.

References rwgt::GENIEReweight::CalculateWeight(), and RetrieveGHEP().

Referenced by rwgt::ReweightAna::analyze().

80  {
81  genie::EventRecord evr = this->RetrieveGHEP(truth, gtruth);
82  double wgt = this->CalculateWeight(evr);
83  //mf::LogVerbatim("GENIEReweight") << "New Event Weight is: " << wgt;
84  return wgt;
85  }
double CalculateWeight(const genie::EventRecord &evr) const
genie::EventRecord RetrieveGHEP(const simb::MCTruth &truth, const simb::GTruth &gtruth) const
Definition: NuReweight.cxx:87
void rwgt::GENIEReweight::CCRESrate ( )
inlineinherited

Definition at line 80 of file GENIEReweight.h.

80 {fMaCCResShape=false;}
void rwgt::GENIEReweight::CCRESshape ( )
inlineinherited

Definition at line 79 of file GENIEReweight.h.

79 {fMaCCResShape=true;}
void rwgt::GENIEReweight::ChangeParameterValue ( ReweightLabel_t  rLabel,
double  value 
)
inherited
void rwgt::GENIEReweight::ConfgureResDecay ( )
inherited

Configure the NC weight calculator.

Definition at line 757 of file GENIEReweight.cxx.

References LOG_INFO.

Referenced by rwgt::GENIEReweight::Configure().

void rwgt::GENIEReweight::Configure ( )
inherited

Reconfigure the weight calculators.

Definition at line 292 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::ConfgureResDecay(), rwgt::GENIEReweight::ConfigureAGKY(), rwgt::GENIEReweight::ConfigureCCRes(), rwgt::GENIEReweight::ConfigureCoh(), rwgt::GENIEReweight::ConfigureDIS(), rwgt::GENIEReweight::ConfigureDISNucMod(), rwgt::GENIEReweight::ConfigureFGM(), rwgt::GENIEReweight::ConfigureFZone(), rwgt::GENIEReweight::ConfigureINuke(), rwgt::GENIEReweight::ConfigureNC(), rwgt::GENIEReweight::ConfigureNCEL(), rwgt::GENIEReweight::ConfigureNCRes(), rwgt::GENIEReweight::ConfigureParameters(), rwgt::GENIEReweight::ConfigureQEMA(), rwgt::GENIEReweight::ConfigureQEVec(), rwgt::GENIEReweight::ConfigureResBkg(), rwgt::GENIEReweight::fReweightAGKY, rwgt::fReweightAGKY_pT1pi, rwgt::fReweightAGKY_xF1pi, rwgt::fReweightAhtBY, rwgt::fReweightAhtBYshape, rwgt::fReweightAxFFCCQEshape, rwgt::fReweightBhtBY, rwgt::fReweightBhtBYshape, rwgt::fReweightBR1eta, rwgt::fReweightBR1gamma, rwgt::fReweightCCQEMomDistroFGtoSF, rwgt::fReweightCCQEPauliSupViaKF, rwgt::GENIEReweight::fReweightCCRes, rwgt::GENIEReweight::fReweightCoh, rwgt::fReweightCV1uBY, rwgt::fReweightCV1uBYshape, rwgt::fReweightCV2uBY, rwgt::fReweightCV2uBYshape, rwgt::GENIEReweight::fReweightDIS, rwgt::fReweightDISNuclMod, rwgt::GENIEReweight::fReweightDISNucMod, rwgt::fReweightEtaNCEL, rwgt::GENIEReweight::fReweightFGM, rwgt::fReweightFormZone, rwgt::fReweightFrAbs_N, rwgt::fReweightFrAbs_pi, rwgt::fReweightFrCEx_N, rwgt::fReweightFrCEx_pi, rwgt::fReweightFrElas_N, rwgt::fReweightFrElas_pi, rwgt::fReweightFrInel_N, rwgt::fReweightFrInel_pi, rwgt::fReweightFrPiProd_N, rwgt::fReweightFrPiProd_pi, rwgt::GENIEReweight::fReweightFZone, rwgt::GENIEReweight::fReweightINuke, rwgt::fReweightMaCCQE, rwgt::fReweightMaCCQEshape, rwgt::fReweightMaCCRES, rwgt::fReweightMaCCRESshape, rwgt::fReweightMaCOHpi, rwgt::fReweightMaNCEL, rwgt::fReweightMaNCRES, rwgt::fReweightMaNCRESshape, rwgt::fReweightMFP_N, rwgt::fReweightMFP_pi, rwgt::fReweightMvCCRES, rwgt::fReweightMvCCRESshape, rwgt::fReweightMvNCRES, rwgt::fReweightMvNCRESshape, rwgt::fReweightNC, rwgt::GENIEReweight::fReweightNC, rwgt::GENIEReweight::fReweightNCEL, rwgt::GENIEReweight::fReweightNCRes, rwgt::fReweightNormCCQE, rwgt::fReweightNormCCQEenu, rwgt::fReweightNormCCRES, rwgt::fReweightNormDISCC, rwgt::fReweightNormNCRES, rwgt::GENIEReweight::fReweightQEMA, rwgt::GENIEReweight::fReweightQEVec, rwgt::fReweightR0COHpi, rwgt::GENIEReweight::fReweightResBkg, rwgt::GENIEReweight::fReweightResDecay, rwgt::fReweightRnubarnuCC, rwgt::fReweightRvbarnCC1pi, rwgt::fReweightRvbarnCC2pi, rwgt::fReweightRvbarnNC1pi, rwgt::fReweightRvbarnNC2pi, rwgt::fReweightRvbarpCC1pi, rwgt::fReweightRvbarpCC2pi, rwgt::fReweightRvbarpNC1pi, rwgt::fReweightRvbarpNC2pi, rwgt::fReweightRvnCC1pi, rwgt::fReweightRvnCC2pi, rwgt::fReweightRvnNC1pi, rwgt::fReweightRvnNC2pi, rwgt::fReweightRvpCC1pi, rwgt::fReweightRvpCC2pi, rwgt::fReweightRvpNC1pi, rwgt::fReweightRvpNC2pi, rwgt::fReweightTheta_Delta2Npi, rwgt::fReweightVecCCQEshape, rwgt::GENIEReweight::fReweightZexp, rwgt::fReweightZExpA1CCQE, rwgt::fReweightZExpA2CCQE, rwgt::fReweightZExpA3CCQE, rwgt::fReweightZExpA4CCQE, rwgt::fReweightZNormCCQE, rwgt::GENIEReweight::fReWgtParameterName, and LOG_INFO.

Referenced by rwgt::ReweightAna::beginJob(), rwgt::GENIEReweight::Reconfigure(), rwgt::GENIEReweight::ReweightAGKY(), rwgt::GENIEReweight::ReweightCCRes(), rwgt::GENIEReweight::ReweightCoh(), rwgt::GENIEReweight::ReweightDIS(), rwgt::GENIEReweight::ReweightDISnucl(), rwgt::GENIEReweight::ReweightFGM(), rwgt::GENIEReweight::ReweightFormZone(), rwgt::GENIEReweight::ReweightIntraNuke(), rwgt::GENIEReweight::ReweightNC(), rwgt::GENIEReweight::ReweightNCEL(), rwgt::GENIEReweight::ReweightNCRes(), rwgt::GENIEReweight::ReweightNonResRvp2pi(), rwgt::GENIEReweight::ReweightQEMA(), rwgt::GENIEReweight::ReweightQEVec(), rwgt::GENIEReweight::ReweightQEZExp(), rwgt::GENIEReweight::ReweightResDecay(), and rwgt::GENIEReweight::ReweightResGanged().

void rwgt::GENIEReweight::ConfigureAGKY ( )
inherited

Configure the DIS nuclear model weight calculator.

Definition at line 789 of file GENIEReweight.cxx.

References LOG_INFO.

Referenced by rwgt::GENIEReweight::Configure().

void rwgt::GENIEReweight::ConfigureCCRes ( )
inherited

Configure the NCRES calculator.

Definition at line 723 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::fMaCCResShape, rwgt::GENIEReweight::fWcalc, and LOG_INFO.

Referenced by rwgt::GENIEReweight::Configure().

void rwgt::GENIEReweight::ConfigureCoh ( )
inherited

Configure the hadronization (AGKY) weight calculator.

Definition at line 783 of file GENIEReweight.cxx.

References LOG_INFO.

Referenced by rwgt::GENIEReweight::Configure().

void rwgt::GENIEReweight::ConfigureDIS ( )
inherited

Configure the Coherant model weight calculator.

Definition at line 769 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::fDISshape, rwgt::GENIEReweight::fWcalc, and LOG_INFO.

Referenced by rwgt::GENIEReweight::Configure().

void rwgt::GENIEReweight::ConfigureDISNucMod ( )
inherited

Configure the FG model weight calculator.

Definition at line 795 of file GENIEReweight.cxx.

References LOG_INFO.

Referenced by rwgt::GENIEReweight::Configure().

void rwgt::GENIEReweight::ConfigureFGM ( )
inherited

Configure the Formation Zone weight calculator.

Definition at line 801 of file GENIEReweight.cxx.

References LOG_INFO.

Referenced by rwgt::GENIEReweight::Configure().

void rwgt::GENIEReweight::ConfigureFZone ( )
inherited

Configure the intranuke weight calculator.

Definition at line 807 of file GENIEReweight.cxx.

References LOG_INFO.

Referenced by rwgt::GENIEReweight::Configure().

void rwgt::GENIEReweight::ConfigureINuke ( )
inherited

configure the weight parameters being used

Definition at line 813 of file GENIEReweight.cxx.

References LOG_INFO.

Referenced by rwgt::GENIEReweight::Configure().

void rwgt::GENIEReweight::ConfigureNC ( )
inherited

Configure the DIS (Bodek-Yang) weight calculator.

Definition at line 763 of file GENIEReweight.cxx.

References LOG_INFO.

Referenced by rwgt::GENIEReweight::Configure().

void rwgt::GENIEReweight::ConfigureNCEL ( )
inherited

Configure the MaQE weight calculator.

Definition at line 692 of file GENIEReweight.cxx.

Referenced by rwgt::GENIEReweight::Configure(), and rwgt::GENIEReweight::ReweightFGM().

void rwgt::GENIEReweight::ConfigureNCRes ( )
inherited

Configure the ResBkg (kno) weight calculator.

Definition at line 737 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::fMaNCResShape, rwgt::GENIEReweight::fWcalc, and LOG_INFO.

Referenced by rwgt::GENIEReweight::Configure().

void rwgt::GENIEReweight::ConfigureParameters ( )
inherited

Definition at line 819 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::CalculateSigma(), rwgt::GENIEReweight::fReWgtParameterName, rwgt::GENIEReweight::fReWgtParameterValue, rwgt::GENIEReweight::fUseSigmaDef, rwgt::GENIEReweight::fWcalc, and LOG_INFO.

Referenced by rwgt::GENIEReweight::Configure().

823  {
824  GSystSet & syst = fWcalc->Systematics();
825  for(unsigned int i = 0; i < fReWgtParameterName.size(); i++) {
826  LOG_INFO("GENIEReweight") << "Configuring GENIEReweight parameter: " << genie::rew::GSyst::AsString(genie::rew::EGSyst(fReWgtParameterName[i])) << " with value: " << fReWgtParameterValue[i];
827  if(fUseSigmaDef) {
828  syst.Set( (GSyst_t)fReWgtParameterName[i], fReWgtParameterValue[i]);
829  }
830  else {
832  syst.Set( (GSyst_t)fReWgtParameterName[i], parameter);
enum rwgt::EReweightLabel ReweightLabel_t
#define LOG_INFO(category)
std::vector< int > fReWgtParameterName
genie::rew::GReWeight * fWcalc
std::vector< double > fReWgtParameterValue
double CalculateSigma(ReweightLabel_t label, double value)
Calculate the weights.
void rwgt::GENIEReweight::ConfigureQEMA ( )
inherited

Configure the QE vector FF weight calculator.

Definition at line 698 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::fMaQEshape, rwgt::GENIEReweight::fReweightZexp, rwgt::GENIEReweight::fWcalc, and LOG_INFO.

Referenced by rwgt::GENIEReweight::Configure().

void rwgt::GENIEReweight::ConfigureQEVec ( )
inherited

Configure the CCRES calculator.

Definition at line 717 of file GENIEReweight.cxx.

References LOG_INFO.

Referenced by rwgt::GENIEReweight::Configure().

void rwgt::GENIEReweight::ConfigureResBkg ( )
inherited

Configure the ResDecay weight calculator.

Definition at line 751 of file GENIEReweight.cxx.

References LOG_INFO.

Referenced by rwgt::GENIEReweight::Configure().

void rwgt::GENIEReweight::DIS_BYrate ( )
inlineinherited

Definition at line 86 of file GENIEReweight.h.

86 {fDISshape=false;}
void rwgt::GENIEReweight::DIS_BYshape ( )
inlineinherited

Definition at line 85 of file GENIEReweight.h.

85 {fDISshape=true;}
void rwgt::GENIEReweight::MaQErate ( )
inlineinherited

Definition at line 77 of file GENIEReweight.h.

77 {fMaQEshape=false;}
void rwgt::GENIEReweight::MaQEshape ( )
inlineinherited

Definition at line 76 of file GENIEReweight.h.

76 {fMaQEshape=true;}
void rwgt::GENIEReweight::NCRESrate ( )
inlineinherited

Definition at line 83 of file GENIEReweight.h.

83 {fMaNCResShape=false;}
void rwgt::GENIEReweight::NCRESshape ( )
inlineinherited

Definition at line 82 of file GENIEReweight.h.

82 {fMaNCResShape=true;}
double rwgt::GENIEReweight::NominalParameterValue ( ReweightLabel_t  rLabel)
inherited

Return the configured value of the given parameter.

Definition at line 235 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::fNominalParameters.

Referenced by rwgt::GENIEReweight::CalculateSigma().

void rwgt::GENIEReweight::Reconfigure ( )
inherited

Simple Configuration functions for configuring a single weight calculator.

Simple Configuraiton of the NC elastic weight calculator

Definition at line 461 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::Configure(), and rwgt::GENIEReweight::fWcalc.

genie::EventRecord rwgt::NuReweight::RetrieveGHEP ( const simb::MCTruth truth,
const simb::GTruth gtruth 
) const
private

Definition at line 87 of file NuReweight.cxx.

References simb::MCParticle::Daughter(), simb::MCParticle::E(), simb::GTruth::fDiffXsec, simb::GTruth::fFShadSystP4, simb::GTruth::fGint, simb::GTruth::fgQ2, simb::GTruth::fgq2, simb::GTruth::fGscatter, simb::GTruth::fgT, simb::GTruth::fgW, simb::GTruth::fgX, simb::GTruth::fgY, simb::GTruth::fIsCharm, simb::GTruth::fIsSeaQuark, simb::GTruth::fNumNeutron, simb::GTruth::fNumPi0, simb::GTruth::fNumPiMinus, simb::GTruth::fNumPiPlus, simb::GTruth::fNumProton, simb::GTruth::fprobability, simb::GTruth::fProbePDG, simb::GTruth::fResNum, simb::GTruth::ftgtPDG, simb::GTruth::fVertex, simb::GTruth::fweight, simb::GTruth::fXsec, simb::MCTruth::GetNeutrino(), simb::MCTruth::GetParticle(), simb::MCParticle::Gvt(), simb::MCParticle::Gvx(), simb::MCParticle::Gvy(), simb::MCParticle::Gvz(), simb::MCNeutrino::HitNuc(), simb::MCNeutrino::HitQuark(), simb::MCNeutrino::Lepton(), simb::MCParticle::Mother(), simb::MCTruth::NParticles(), simb::MCParticle::NumberDaughters(), simb::MCParticle::PdgCode(), simb::MCParticle::Polarization(), simb::MCParticle::Px(), simb::MCParticle::Py(), simb::MCParticle::Pz(), simb::MCParticle::Rescatter(), simb::MCParticle::StatusCode(), target, and simb::MCParticle::TrackId().

Referenced by CalcWeight().

87  {
88  genie::EventRecord newEvent;
89  newEvent.SetWeight(gtruth.fweight);
90  newEvent.SetProbability(gtruth.fprobability);
91  newEvent.SetXSec(gtruth.fXsec);
92 #ifndef SETDIFFXSEC_1ARG
93  // this argument is used only for bookkeeping purposes in a GHepRecord.
94  // since we're making a GHepRecord that will be thrown away
95  // as soon as we're done getting the weights for it,
96  // it doesn't matter what we put here.
97  genie::KinePhaseSpace_t space = genie::kPSNull;
98  newEvent.SetDiffXSec(gtruth.fDiffXsec,space);
99 #else
100  newEvent.SetDiffXSec(gtruth.fDiffXsec);
101 #endif
102  TLorentzVector vtx = gtruth.fVertex;
103  newEvent.SetVertex(vtx);
104 
105  for(int i = 0; i < truth.NParticles(); i++) {
106  simb::MCParticle mcpart = truth.GetParticle(i);
107 
108  int gmid = mcpart.PdgCode();
109  genie::GHepStatus_t gmst = (genie::GHepStatus_t)mcpart.StatusCode();
110  int gmmo = mcpart.Mother();
111  int ndaughters = mcpart.NumberDaughters();
112  //find the track ID of the first and last daughter particles
113  int fdtrkid = 0;
114  int ldtrkid = 0;
115  if(ndaughters !=0) {
116  fdtrkid = mcpart.Daughter(0);
117  if(ndaughters == 1) {
118  ldtrkid = 1;
119  }
120  else if(ndaughters >1) {
121  fdtrkid = mcpart.Daughter(ndaughters-1);
122  }
123  }
124  int gmfd = -1;
125  int gmld = -1;
126  //Genie uses the index in the particle array to reference the daughter particles.
127  //MCTruth keeps the particles in the same order so use the track ID to find the proper index.
128  for(int j = 0; j < truth.NParticles(); j++) {
129  simb::MCParticle temp = truth.GetParticle(i);
130  if(temp.TrackId() == fdtrkid) {
131  gmfd = j;
132  }
133  if(temp.TrackId() == ldtrkid) {
134  gmld = j;
135  }
136  }
137 
138  double gmpx = mcpart.Px(0);
139  double gmpy = mcpart.Py(0);
140  double gmpz = mcpart.Pz(0);
141  double gme = mcpart.E(0);
142  double gmvx = mcpart.Gvx();
143  double gmvy = mcpart.Gvy();
144  double gmvz = mcpart.Gvz();
145  double gmvt = mcpart.Gvt();
146  int gmri = mcpart.Rescatter();
147 
148  genie::GHepParticle gpart(gmid, gmst, gmmo, -1, gmfd, gmld, gmpx, gmpy, gmpz, gme, gmvx, gmvy, gmvz, gmvt);
149  gpart.SetRescatterCode(gmri);
150  TVector3 polz = mcpart.Polarization();
151  if(polz.x() !=0 || polz.y() !=0 || polz.z() !=0) {
152  gpart.SetPolarization(polz);
153  }
154  newEvent.AddParticle(gpart);
155 
156  }
157 
158  genie::ProcessInfo proc_info;
159  genie::ScatteringType_t gscty = (genie::ScatteringType_t)gtruth.fGscatter;
160  genie::InteractionType_t ginty = (genie::InteractionType_t)gtruth.fGint;
161 
162  proc_info.Set(gscty,ginty);
163 
164  genie::XclsTag gxt;
165 
166  //Set Exclusive Final State particle numbers
167  genie::Resonance_t gres = (genie::Resonance_t)gtruth.fResNum;
168  gxt.SetResonance(gres);
169  gxt.SetNPions(gtruth.fNumPiPlus, gtruth.fNumPi0, gtruth.fNumPiMinus);
170  gxt.SetNNucleons(gtruth.fNumProton, gtruth.fNumNeutron);
171 
172  if(gtruth.fIsCharm) {
173  gxt.SetCharm(0);
174  }
175  else {
176  gxt.UnsetCharm();
177  }
178 
179  //Set the GENIE kinematic info
180  genie::Kinematics gkin;
181  gkin.Setx(gtruth.fgX, true);
182  gkin.Sety(gtruth.fgY, true);
183  gkin.Sett(gtruth.fgT, true);
184  gkin.SetW(gtruth.fgW, true);
185  gkin.SetQ2(gtruth.fgQ2, true);
186  gkin.Setq2(gtruth.fgq2, true);
187  simb::MCNeutrino nu = truth.GetNeutrino();
188  simb::MCParticle lep = nu.Lepton();
189  gkin.SetFSLeptonP4(lep.Px(), lep.Py(), lep.Pz(), lep.E());
190  gkin.SetHadSystP4(gtruth.fFShadSystP4.Px(), gtruth.fFShadSystP4.Py(), gtruth.fFShadSystP4.Pz(), gtruth.fFShadSystP4.E());
191 
192  //Set the GENIE final state interaction info
193  genie::Interaction * p_gint = new genie::Interaction;
194  genie::InitialState * p_ginstate = p_gint->InitStatePtr();
195  //int Z = gtruth.ftgtZ;
196  //int A = gtruth.ftgtA;
197  int targetNucleon = nu.HitNuc();
198  int struckQuark = nu.HitQuark();
199  int incoming = gtruth.fProbePDG;
200  p_ginstate->SetProbePdg(incoming);
201 
202  genie::Target* target123 = p_ginstate->TgtPtr();
203 
204  target123->SetId(gtruth.ftgtPDG);
205  //target123->SetId(Z,A);
206 
207  //int pdg_code = pdg::IonPdgCode(A, Z);
208  //TParticlePDG * p = PDGLibrary::Instance()->Find(pdg_code);
209 
210  //mf::LogWarning("GENIEReweight") << "Setting Target Z and A";
211  //mf::LogWarning("GENIEReweight") << "Saved PDG: " << gtruth.ftgtPDG;
212  //mf::LogWarning("GENIEReweight") << "Target PDG: " << target123->Pdg();
213  target123->SetHitNucPdg(targetNucleon);
214  target123->SetHitQrkPdg(struckQuark);
215  target123->SetHitSeaQrk(gtruth.fIsSeaQuark);
216 
217  if(newEvent.HitNucleonPosition()> 0) {
218  genie::GHepParticle * hitnucleon = newEvent.HitNucleon();
219  std::unique_ptr<TLorentzVector> p4hitnucleon(hitnucleon->GetP4());
220  target123->SetHitNucP4(*p4hitnucleon);
221  }
222  else {
223  TLorentzVector dummy(0.,0.,0.,0.);
224  target123->SetHitNucP4(dummy);
225  }
226 
227  genie::GHepParticle * probe = newEvent.Probe();
228  std::unique_ptr<TLorentzVector> p4probe(probe->GetP4());
229  p_ginstate->SetProbeP4(*p4probe);
230  if(newEvent.TargetNucleusPosition()> 0) {
231  genie::GHepParticle * target = newEvent.TargetNucleus();
232  std::unique_ptr<TLorentzVector> p4target(target->GetP4());
233  p_ginstate->SetTgtP4(*p4target);
234  } else {
235  TLorentzVector dummy(0.,0.,0.,0.);
236  p_ginstate->SetTgtP4(dummy);
237  }
238  p_gint->SetProcInfo(proc_info);
239  p_gint->SetKine(gkin);
240  p_gint->SetExclTag(gxt);
241  newEvent.AttachSummary(p_gint);
242 
243  /*
244  //For temporary debugging purposes
245  genie::Interaction *inter = newEvent.Summary();
246  const genie::InitialState &initState = inter->InitState();
247  const genie::Target &tgt = initState.Tgt();
248  std::cout << "TargetPDG as Recorded: " << gtruth.ftgtPDG << std::endl;
249  std::cout << "TargetZ as Recorded: " << gtruth.ftgtZ << std::endl;
250  std::cout << "TargetA as Recorded: " << gtruth.ftgtA << std::endl;
251  std::cout << "TargetPDG as Recreated: " << tgt.Pdg() << std::endl;
252  std::cout << "TargetZ as Recreated: " << tgt.Z() << std::endl;
253  std::cout << "TargetA as Recreated: " << tgt.A() << std::endl;
254  */
255  return newEvent;
256 
257  }
double fgW
Definition: GTruth.h:48
double E(const int i=0) const
Definition: MCParticle.h:237
int fGint
interaction code
Definition: GTruth.h:25
const TVector3 & Polarization() const
Definition: MCParticle.h:218
int PdgCode() const
Definition: MCParticle.h:216
double fgq2
Definition: GTruth.h:47
const simb::MCNeutrino & GetNeutrino() const
Definition: MCTruth.h:74
double fgX
Definition: GTruth.h:50
double Py(const int i=0) const
Definition: MCParticle.h:235
double Gvz() const
Definition: MCParticle.h:252
int HitQuark() const
Definition: MCNeutrino.h:157
cout<< "-> Edep in the target
Definition: analysis.C:54
int Mother() const
Definition: MCParticle.h:217
double Px(const int i=0) const
Definition: MCParticle.h:234
int fNumNeutron
number of neutrons after reaction, before FSI
Definition: GTruth.h:40
int HitNuc() const
Definition: MCNeutrino.h:156
double fXsec
cross section of interaction
Definition: GTruth.h:32
int fNumPiPlus
number of pi pluses after reaction, before FSI
Definition: GTruth.h:36
int StatusCode() const
Definition: MCParticle.h:215
int fNumPiMinus
number of pi minuses after reaction, before FSI
Definition: GTruth.h:37
double Gvx() const
Definition: MCParticle.h:250
int NParticles() const
Definition: MCTruth.h:72
double Gvy() const
Definition: MCParticle.h:251
int NumberDaughters() const
Definition: MCParticle.h:221
int TrackId() const
Definition: MCParticle.h:214
int Daughter(const int i) const
Definition: MCParticle.cxx:112
int fResNum
resonance number
Definition: GTruth.h:42
int fNumProton
number of protons after reaction, before FSI
Definition: GTruth.h:39
double fprobability
interaction probability
Definition: GTruth.h:31
const simb::MCParticle & Lepton() const
Definition: MCNeutrino.h:151
int fProbePDG
Definition: GTruth.h:62
int fGscatter
neutrino scattering code
Definition: GTruth.h:26
int fNumPi0
number of pi0 after reaction, before FSI
Definition: GTruth.h:38
bool fIsCharm
did the interaction produce a charmed hadron?
Definition: GTruth.h:41
double fweight
event interaction weight (genie internal)
Definition: GTruth.h:30
const simb::MCParticle & GetParticle(int i) const
Definition: MCTruth.h:73
int ftgtPDG
PDG of Target Nucleus, nucleon only if free.
Definition: GTruth.h:59
double fgQ2
< these are for the internal (on shell) genie kinematics
Definition: GTruth.h:46
double Gvt() const
Definition: MCParticle.h:253
TLorentzVector fFShadSystP4
Definition: GTruth.h:52
double Pz(const int i=0) const
Definition: MCParticle.h:236
int Rescatter() const
Definition: MCParticle.h:256
double fgT
Definition: GTruth.h:49
Event generator information.
Definition: MCNeutrino.h:18
bool fIsSeaQuark
Definition: GTruth.h:55
TLorentzVector fVertex
Definition: GTruth.h:64
double fgY
Definition: GTruth.h:51
double fDiffXsec
differential cross section of interaction
Definition: GTruth.h:33
void rwgt::GENIEReweight::ReweightAGKY ( double  xF,
double  pT 
)
inherited

Simple Configuration of the Intranuke Nuclear model.

Definition at line 641 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::AddReweightValue(), rwgt::GENIEReweight::Configure(), rwgt::fReweightAGKY_pT1pi, rwgt::fReweightAGKY_xF1pi, and LOG_INFO.

void rwgt::GENIEReweight::ReweightCCRes ( double  ma,
double  mv = 0.0 
)
inherited
void rwgt::GENIEReweight::ReweightDIS ( double  aht,
double  bht,
double  cv1u,
double  cv2u 
)
inherited
void rwgt::GENIEReweight::ReweightDISnucl ( bool  mode)
inherited

Simple Configuration of the DIS AGKY hadronization model.

Definition at line 634 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::AddReweightValue(), rwgt::GENIEReweight::Configure(), rwgt::fReweightDISNuclMod, and LOG_INFO.

void rwgt::GENIEReweight::ReweightFGM ( double  kF,
double  sf 
)
inherited

End of Simple Reweight Configurations.

Private Member functions to configure individual weight calculators. Configure the NCEL weight calculator

Definition at line 683 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::AddReweightValue(), rwgt::GENIEReweight::Configure(), rwgt::GENIEReweight::ConfigureNCEL(), rwgt::fReweightCCQEMomDistroFGtoSF, rwgt::fReweightCCQEPauliSupViaKF, and LOG_INFO.

void rwgt::GENIEReweight::ReweightFormZone ( double  sigma)
inherited

Simple Configuration of the Fermigas model reweight calculator.

Definition at line 676 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::AddReweightValue(), rwgt::GENIEReweight::Configure(), rwgt::fReweightFormZone, and LOG_INFO.

void rwgt::GENIEReweight::ReweightIntraNuke ( int  name,
double  sigma 
)
inherited
void rwgt::GENIEReweight::ReweightNC ( double  norm)
inherited

Simple Configuration of the DIS FF model weight calculator.

Definition at line 608 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::AddReweightValue(), rwgt::GENIEReweight::Configure(), rwgt::fReweightNC, and LOG_INFO.

void rwgt::GENIEReweight::ReweightNCEL ( double  ma,
double  eta 
)
inherited

Simple Configurtion of the CCQE axial weight calculator.

Definition at line 468 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::AddReweightValue(), rwgt::GENIEReweight::Configure(), rwgt::fReweightEtaNCEL, rwgt::fReweightMaNCEL, and LOG_INFO.

void rwgt::GENIEReweight::ReweightNCRes ( double  ma,
double  mv = 0.0 
)
inherited

Simple Configuration of the NC and CC Resonance weight calculator with the axial mass parameter for NC/CC ganged together.

Definition at line 517 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::AddReweightValue(), rwgt::GENIEReweight::Configure(), rwgt::GENIEReweight::fMaNCResShape, rwgt::fReweightMaNCRES, rwgt::fReweightMvNCRES, and LOG_INFO.

void rwgt::GENIEReweight::ReweightNonResRvbarp1pi ( double  sigma)
inherited

Simple Configuration of the Non-Resonance Background weight calculator. Here it is being configured for v+p and vbar + n (2 pi) type interactions.

Definition at line 562 of file GENIEReweight.cxx.

Referenced by rwgt::GENIEReweight::ReweightCoh().

void rwgt::GENIEReweight::ReweightNonResRvbarp2pi ( double  sigma)
inherited

Simple Configuration of the Resonance decay model weight calculator.

Definition at line 583 of file GENIEReweight.cxx.

Referenced by rwgt::GENIEReweight::ReweightNonResRvp2pi().

void rwgt::GENIEReweight::ReweightNonResRvp1pi ( double  sigma)
inherited

Simple Configuration of the Non-Resonance Background weight calculator.

Definition at line 551 of file GENIEReweight.cxx.

Referenced by rwgt::GENIEReweight::ReweightCoh().

double rwgt::GENIEReweight::ReweightParameterValue ( ReweightLabel_t  rLabel)
inherited

Add reweight parameters to the list.

Definition at line 242 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::fReWgtParameterName, and rwgt::GENIEReweight::fReWgtParameterValue.

void rwgt::GENIEReweight::ReweightQEMA ( double  ma)
inherited

Simple Configuration of the CCQE vector weight calculator.

Definition at line 480 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::AddReweightValue(), rwgt::GENIEReweight::Configure(), rwgt::GENIEReweight::fMaQEshape, rwgt::fReweightMaCCQE, and LOG_INFO.

void rwgt::GENIEReweight::ReweightQEVec ( double  mv)
inherited

Definition at line 488 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::AddReweightValue(), rwgt::GENIEReweight::Configure(), rwgt::fReweightVecCCQEshape, and LOG_INFO.

490  {
491  LOG_INFO("GENIEReweight") << "Configuring GENIEReweight for QE Vector Mass Reweighting";
void AddReweightValue(ReweightLabel_t rLabel, double value)
Change a reweight parameter. If it hasn&#39;t been added yet add it.
#define LOG_INFO(category)
tweak elastic nucleon form factors (BBA/default -> dipole) - shape only effect of dsigma(CCQE)/dQ2 ...
void rwgt::GENIEReweight::ReweightQEZExp ( double  norm,
double  a1,
double  a2,
double  a3,
double  a4 
)
inherited
void rwgt::GENIEReweight::ReweightResDecay ( double  gamma,
double  eta,
double  theta 
)
inherited
void rwgt::GENIEReweight::ReweightResGanged ( double  ma,
double  mv = 0.0 
)
inherited
void rwgt::GENIEReweight::SetNominalValues ( )
inherited

Return the nominal value for the given parameter.

Definition at line 113 of file GENIEReweight.cxx.

References rwgt::GENIEReweight::fNominalParameters, rwgt::fReweightAGKY_pT1pi, rwgt::fReweightAGKY_xF1pi, rwgt::fReweightAhtBY, rwgt::fReweightAhtBYshape, rwgt::fReweightBhtBY, rwgt::fReweightBhtBYshape, rwgt::fReweightBR1eta, rwgt::fReweightBR1gamma, rwgt::fReweightCCQEMomDistroFGtoSF, rwgt::fReweightCCQEPauliSupViaKF, rwgt::fReweightCV1uBY, rwgt::fReweightCV1uBYshape, rwgt::fReweightCV2uBY, rwgt::fReweightCV2uBYshape, rwgt::fReweightDISNuclMod, rwgt::fReweightEtaNCEL, rwgt::fReweightFormZone, rwgt::fReweightFrAbs_N, rwgt::fReweightFrAbs_pi, rwgt::fReweightFrCEx_N, rwgt::fReweightFrCEx_pi, rwgt::fReweightFrElas_N, rwgt::fReweightFrElas_pi, rwgt::fReweightFrInel_N, rwgt::fReweightFrInel_pi, rwgt::fReweightFrPiProd_N, rwgt::fReweightFrPiProd_pi, rwgt::fReweightMaCCQE, rwgt::fReweightMaCCQEshape, rwgt::fReweightMaCCRES, rwgt::fReweightMaCCRESshape, rwgt::fReweightMaCOHpi, rwgt::fReweightMaNCEL, rwgt::fReweightMaNCRES, rwgt::fReweightMaNCRESshape, rwgt::fReweightMFP_N, rwgt::fReweightMFP_pi, rwgt::fReweightMvCCRES, rwgt::fReweightMvCCRESshape, rwgt::fReweightMvNCRES, rwgt::fReweightMvNCRESshape, rwgt::fReweightNC, rwgt::fReweightNormCCQE, rwgt::fReweightNormCCQEenu, rwgt::fReweightNormCCRES, rwgt::fReweightNormDISCC, rwgt::fReweightNormNCRES, rwgt::fReweightR0COHpi, rwgt::fReweightRnubarnuCC, rwgt::fReweightRvbarnCC1pi, rwgt::fReweightRvbarnCC2pi, rwgt::fReweightRvbarnNC1pi, rwgt::fReweightRvbarnNC2pi, rwgt::fReweightRvbarpCC1pi, rwgt::fReweightRvbarpCC2pi, rwgt::fReweightRvbarpNC1pi, rwgt::fReweightRvbarpNC2pi, rwgt::fReweightRvnCC1pi, rwgt::fReweightRvnCC2pi, rwgt::fReweightRvnNC1pi, rwgt::fReweightRvnNC2pi, rwgt::fReweightRvpCC1pi, rwgt::fReweightRvpCC2pi, rwgt::fReweightRvpNC1pi, rwgt::fReweightRvpNC2pi, rwgt::fReweightTheta_Delta2Npi, and rwgt::fReweightVecCCQEshape.

Referenced by rwgt::GENIEReweight::GENIEReweight().

void rwgt::GENIEReweight::UseSigmaDef ( )
inlineinherited

Definition at line 88 of file GENIEReweight.h.

88 {fUseSigmaDef=true;}
void rwgt::GENIEReweight::UseStandardDef ( )
inlineinherited

Definition at line 89 of file GENIEReweight.h.

89 {fUseSigmaDef=false;}
genie::rew::GReWeight* rwgt::GENIEReweight::WeightCalculator ( )
inlineinherited

Definition at line 40 of file GENIEReweight.h.

References a1, a2, a3, a4, and norm.

40 {return fWcalc;}
genie::rew::GReWeight * fWcalc

Member Data Documentation

bool rwgt::GENIEReweight::fDISshape
protectedinherited
bool rwgt::GENIEReweight::fMaCCResShape
protectedinherited
bool rwgt::GENIEReweight::fMaNCResShape
protectedinherited
bool rwgt::GENIEReweight::fMaQEshape
protectedinherited
std::map<int, double> rwgt::GENIEReweight::fNominalParameters
protectedinherited
bool rwgt::GENIEReweight::fReweightAGKY
protectedinherited

Definition at line 130 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::Configure().

bool rwgt::GENIEReweight::fReweightCCRes
protectedinherited

Definition at line 123 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::Configure().

bool rwgt::GENIEReweight::fReweightCoh
protectedinherited

Definition at line 129 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::Configure().

bool rwgt::GENIEReweight::fReweightDIS
protectedinherited

Definition at line 128 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::Configure().

bool rwgt::GENIEReweight::fReweightDISNucMod
protectedinherited

Definition at line 131 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::Configure().

bool rwgt::GENIEReweight::fReweightFGM
protectedinherited

Definition at line 132 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::Configure().

bool rwgt::GENIEReweight::fReweightFZone
protectedinherited

Definition at line 133 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::Configure().

bool rwgt::GENIEReweight::fReweightINuke
protectedinherited

Definition at line 134 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::Configure().

bool rwgt::GENIEReweight::fReweightMEC
protectedinherited

Definition at line 136 of file GENIEReweight.h.

bool rwgt::GENIEReweight::fReweightNC
protectedinherited

Definition at line 127 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::Configure().

bool rwgt::GENIEReweight::fReweightNCEL
protectedinherited

Definition at line 120 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::Configure().

bool rwgt::GENIEReweight::fReweightNCRes
protectedinherited

Definition at line 124 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::Configure().

bool rwgt::GENIEReweight::fReweightQEMA
protectedinherited

Definition at line 121 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::Configure().

bool rwgt::GENIEReweight::fReweightQEVec
protectedinherited

Definition at line 122 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::Configure().

bool rwgt::GENIEReweight::fReweightResBkg
protectedinherited

Definition at line 125 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::Configure().

bool rwgt::GENIEReweight::fReweightResDecay
protectedinherited

Definition at line 126 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::Configure().

bool rwgt::GENIEReweight::fReweightZexp
protectedinherited
std::vector<double> rwgt::GENIEReweight::fReWgtParameterValue
protectedinherited
bool rwgt::GENIEReweight::fUseSigmaDef
protectedinherited

Definition at line 143 of file GENIEReweight.h.

Referenced by rwgt::GENIEReweight::ConfigureParameters().


The documentation for this class was generated from the following files: