GReWeightUtils.h
Go to the documentation of this file.
1 
2 //____________________________________________________________________________
3 /*!
4 
5 \namespace genie::utils::rew
6 
7 \brief Event reweighting utilities
8 
9 \author Jim Dobson <J.Dobson07 \at imperial.ac.uk>
10  Imperial College London
11 
12  Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
13  University of Liverpool & STFC Rutherford Appleton Lab
14 
15 \created Sep 09, 2009
16 
17 \cpright Copyright (c) 2003-2017, GENIE Neutrino MC Generator Collaboration
18  For the full text of the license visit http://copyright.genie-mc.org
19  or see $GENIE/LICENSE
20 */
21 //____________________________________________________________________________
22 
23 #ifndef _RW_UTILS_H_
24 #define _RW_UTILS_H_
25 
26 #include <TLorentzVector.h>
27 
28 #include "EVGCore/EventRecord.h"
29 #include "ReWeight/GSyst.h"
30 
31 namespace genie {
32 namespace utils {
33 namespace rew {
34 
35  // Returns a weight to account for a change in hadron mean free path
36  double MeanFreePathWeight(
37  int pdgc, const TLorentzVector & x4, const TLorentzVector & p4,
38  double A, double Z,
39  double mfp_scale_factor, bool interacted,
40  double nRpi=0.5, double nRnuc=1.0, double NR=3, double R0=1.4);
41  double MeanFreePathWeight(
42  double prob_def, double prob_twk, bool interacted);
43 
44  // Calculates a weight to account for a change in the formation zone. Is
45  // only an approximation as impossible to calculate a weight for hadrons
46  // which were already outside the nucleus with the default formation zone.
47  double FZoneWeight(
48  int pdgc, const TLorentzVector & vtx, const TLorentzVector & x4,
49  const TLorentzVector & p4, double A, double Z, double fz_scale_factor, bool interacted,
50  double nRpi=0.5, double nRnuc=1.0, double NR=3, double R0=1.4);
51 
52  // Return the fraction of the hadron rescatering fate described by the input
53  // systematic enumeration at the input hadron kinetic energy
54  double FateFraction(genie::rew::GSyst_t syst, double kinE, double frac_scale_factor=1.);
55 
56  // Return the required fate fraction scaling factor for the fate described by the input
57  // systematic enumeration, at the input hadron kinetic energy, so that the fate fraction
58  // becomes the input one.
59  double WhichFateFractionScaleFactor(genie::rew::GSyst_t syst, double kinE, double fate_frac);
60 
61  // Check whether the input event is hadronized by AGKY
62  bool HadronizedByAGKY(const EventRecord & event);
63 
64  // Check whether the input event is hadronized by AGKY/PYTHIA
65  bool HadronizedByAGKYPythia(const EventRecord & event);
66 
67  // Compute the hadronic system 4-momentum @ LAB
68  TLorentzVector Hadronic4pLAB(const EventRecord & event);
69 
70  //
71  double AGKYWeight(int pdgc, double xF, double pT2);
72 
73  // Get the sign of the tweaking dial so as to correctly pick-p the +err or the -err,
74  // in case of asymmetric errors
75  int Sign(double twkdial);
76 
77 } // rew namespace
78 } // utils namespace
79 } // genie namespace
80 
81 #endif // _RW_UTILS_H_
double FZoneWeight(int pdgc, const TLorentzVector &vtx, const TLorentzVector &x4, const TLorentzVector &p4, double A, double Z, double fz_scale_factor, bool interacted, double nRpi=0.5, double nRnuc=1.0, double NR=3, double R0=1.4)
double WhichFateFractionScaleFactor(genie::rew::GSyst_t syst, double kinE, double fate_frac)
#include "Numerical/GSFunc.h"
Definition: AlgCmp.h:26
TLorentzVector Hadronic4pLAB(const EventRecord &event)
double AGKYWeight(int pdgc, double xF, double pT2)
bool HadronizedByAGKY(const EventRecord &event)
An enumeration of systematic parameters.
double MeanFreePathWeight(int pdgc, const TLorentzVector &x4, const TLorentzVector &p4, double A, double Z, double mfp_scale_factor, bool interacted, double nRpi=0.5, double nRnuc=1.0, double NR=3, double R0=1.4)
bool HadronizedByAGKYPythia(const EventRecord &event)
Definition: utils.py:1
double FateFraction(genie::rew::GSyst_t syst, double kinE, double frac_scale_factor=1.)
Event finding and building.
int Sign(double twkdial)