Jpp 21.0.0
the software that should make you happy
Loading...
Searching...
No Matches
JEvtWeightFactorRadiativeCorrections.hh
Go to the documentation of this file.
1#ifndef __JAANET__JEVTWEIGHTFACTORRADIATIVECORRECTIONS__
2#define __JAANET__JEVTWEIGHTFACTORRADIATIVECORRECTIONS__
3
5
6#include "JLang/JClonable.hh"
7#include "JLang/JException.hh"
8
9#include "Jeep/JProperties.hh"
10
13
14#include "JAAnet/JPDB.hh"
15#include "JAAnet/JGENIETypes.hh"
18
19
20/**
21 * \author bjjung
22 */
23
24namespace JAANET {}
25namespace JPP { using namespace JAANET; }
26
27namespace JAANET {
28
29 using JLANG::JClonable;
31
33
35
38
41
42
43 static const char* const PRIMARY_QUARK_PDG_KEY = "primary_quark_pdg"; //!< ID string for primary quark user info
44
45
46 /**
47 * Class for radiative corrections to the neutrino CC-DIS weights, based on references:
48 *
49 * - JHEP06(2005)078, "Radiative corrections to neutrino deep inelastic scattering revisited"
50 * by Andrej B. Arbuzov, Dmitry Yu. Bardin and Lidia V. Kalinovskaya, and
51 * - JINR-E2-86-260 (1986), "On the radiative corrections to the neutrino deep inelastic scattering",
52 * by D. Yu Bardin and V.A. Dokuchaeva
53 *
54 * The template argument refers to the type of event-weighter.
55 *
56 * N.B.: Unless the primary quark PDG code is available in the Evt::usr vector, this class assumes a QE-like scenario, in which:
57 * - neutrinos are assumed to scatter exclusively on down-type quarks, whilst
58 * - anti-neutrinos are assumed to scatter exclusively on up-type quarks.
59 *
60 * N.B.: Corrections for NC events are only calculated if the LoopTools software package is available.
61 */
62 template<class JEvtWeightFactor_t = JEvtWeightFactor>
64 public JClonable<JEvtWeightFactor_t, JEvtWeightFactorRadiativeCorrections<JEvtWeightFactor_t> >
65 {
67
68
69 /**
70 * Default constructor.
71 */
74
75
76 /**
77 * Get the quark mass and charge corresponding to a given PDG code.
78 *
79 * \param pdg PDG code
80 * \return pair of quark mass [GeV] and quark charge [e/3]
81 */
83 {
84 static const JPDBSelection& quarks = getQuarks();
85
86 if (quarks.hasPDG(pdg)) {
87
88 const JParticle& quark = quarks.getPDG(pdg);
89
90 return std::make_pair(quark.mass, quark.charge);
91
92 } else {
93 THROW(JValueOutOfRange, "JEvtWeightFactorRadiativeCorrections::getQuarkParameter(): Invalid quark PDG code " << pdg);
94 }
95 }
96
97
98 /**
99 * Get the mass of a charged lepton corresponding to a given PDG code.
100 *
101 * \param pdg PDG code
102 * \return charged lepton mass
103 */
104 static double getChargedLeptonMass(const int pdg)
105 {
106 static const JPDBSelection& charged_leptons = getChargedLeptons();
107
108 if (charged_leptons.hasPDG(pdg)) {
109
110 const JParticle& charged_lepton = charged_leptons.getPDG(pdg);
111
112 return charged_lepton.mass;
113
114 } else {
115 THROW(JValueOutOfRange, "JEvtWeightFactorRadiativeCorrections::getChargedLeptonMass(): Invalid charged lepton PDG code " << pdg);
116 }
117 }
118
119
120 /**
121 * Get event-weight factor of given event.
122 *
123 * \param evt event
124 * \return event-weight factor
125 */
126 double getFactor(const Evt& evt) const override final
127 {
128 const Trk& neutrino = get_neutrino(evt);
129
130 if (evt.w2list.size() <= W2LIST_GSEAGEN_CC) {
131 THROW(JIndexOutOfRange, "JEvtWeightFactorRadiativeCorrections::getFactor(): W2LIST_GSEAGEN_CC unavailable");
132 }
133
134 const int interactionType = evt.w2list[W2LIST_GSEAGEN_CC];
135 const int scatteringType = evt.w2list[W2LIST_GSEAGEN_ICHAN];
136
137 if (scatteringType != (int) JGENIEScatteringType_t::DEEP_INELASTIC) { return 1.0; }
138
139 const double Q2 = getQ2(evt);
140
141 const double mN = get_target_nucleon_mass(evt);
142
143 const double x = evt.w2list[W2LIST_GSEAGEN_BX];
144 const double y = evt.w2list[W2LIST_GSEAGEN_BY];
145
146 const double Sx = Q2 / y + x * mN*mN; //!< Squared invariant mass, multiplied by Björken-x
147
148 const bool antiNeutrino = neutrino.type < 0;
149
150 auto [m1, q1] = (antiNeutrino ? // Assume neutrino-down or anti-neutrino-down scattering by default
153
154 const bool hasPrimaryQuarkInfo = evt.haveusr(PRIMARY_QUARK_PDG_KEY);
155
156 if (hasPrimaryQuarkInfo) { // Update quark parameters if primary quark PDG code is available
157 const int pdg = evt.getusr(PRIMARY_QUARK_PDG_KEY);
158 std::tie(m1, q1) = getQuarkParameters(pdg);
159 }
160
161 const int Ltype = neutrino.type + (antiNeutrino ? +1 : -1);
162 const double mL = getChargedLeptonMass(Ltype);
163
164 switch (interactionType) {
166
167 if (!antiNeutrino) {
168
169 return getRadiativeCorrectionCCDISNeutrino(y, Sx, mL, q1);
170
171 } else if (hasPrimaryQuarkInfo) {
172
173 return getRadiativeCorrectionCCDISAntiNeutrino(y, Sx, mL, q1);
174
175 } else { // Try valence up quark assumption for anti-neutrino CC DIS
176
177 static const double yThreshold = 0.95; //!< Inelasticity threshold
178 static const double RCthreshold = 1.1; //!< Radiative correction acceptance threshold
179
180 double RC = getRadiativeCorrectionCCDISAntiNeutrino(y, Sx, mL, q1);
181
182 // Very high values of RC * (1-y)^2 for anti-neutrino CC DIS at very high inelasticities
183 // off assumed valence up-quark, strongly suggest valence quark assumption was wrong;
184 // Retry with anti-down quark assumption.
185 if (y > yThreshold && RC * (1.0 - y) * (1.0 + y) > RCthreshold) {
186 std::tie(m1, q1) = getQuarkParameters(QUARK_TYPE_ANTIDOWN);
187 RC = getRadiativeCorrectionCCDISAntiNeutrino(y, Sx, mL, q1);
188 }
189
190 return RC < RCthreshold ? RC : 1.0;
191 }
192 }
194 return (!antiNeutrino ?
195 getRadiativeCorrectionNCDISNeutrino (y, Sx, Q2, mL, m1, q1) :
196 getRadiativeCorrectionNCDISAntiNeutrino(y, Sx, Q2, mL, m1, q1));
197 }
198 default:
199 return 1.0;
200 }
201 }
202
203
204 /**
205 * Get properties of this class.
206 *
207 * \param eqpars equation parameters
208 */
213
214
215 /**
216 * Get properties of this class.
217 *
218 * \param eqpars equation parameters
219 */
224
225
226 private:
227
228 /**
229 * Auxiliary class for I/O of constant event-weight factor.
230 */
232 public JProperties
233 {
234 /**
235 * Constructor.
236 *
237 * \param factor constant event-weight factor
238 * \param eqpars equation parameters
239 */
240 template<class JEvtWeightFactorRadiativeCorrections_T>
241 JEvtWeightFactorRadiativeCorrectionsHelper(JEvtWeightFactorRadiativeCorrections_T& factor,
242 const JEquationParameters& eqpars) :
243 JProperties(eqpars, 1)
244 {
245 (*this)[JEvtWeightFactor::getTypeKey()] = "radiative corrections";
246 }
247 };
248 };
249}
250
251#endif
Definition of hit and track types and auxiliary methods for handling Monte Carlo data.
Exceptions.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition of GENIE neutrino interaction types.
Physics constants.
Utility class to parse parameter values.
Utility class to parse parameter values.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Exception for accessing an index in a collection that is outside of its range.
Definition JException.hh:92
Exception for accessing a value in a collection that is outside of its range.
Extensions to Evt data format.
@ QUARK_TYPE_ANTIDOWN
static const char *const PRIMARY_QUARK_PDG_KEY
ID string for primary quark user info.
const JPDBSelection & getChargedLeptons()
Retrieve charged lepton entries from particle data book.
Definition JPDB.hh:343
double get_target_nucleon_mass(const Evt &evt)
Get target nucleon mass.
@ WEAK_NEUTRAL_CURRENT
Weak neutral current interaction.
@ WEAK_CHARGED_CURRENT
Weak charged current interaction.
const JPDBSelection & getQuarks()
Retrieve quark entries from particle data book.
Definition JPDB.hh:317
@ DEEP_INELASTIC
Deep Inelastic Scattering.
double getQ2(const Evt &event)
Get negative squared momentum transfer (Q^2 = -q^2 >= 0) of a neutrino interaction.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
double getRadiativeCorrectionCCDISAntiNeutrino(const double y, const double Sx, const double ml, const JElectricCharge &q1)
Compute the radiative correction factor for anti-neutrino CC DIS interactions according to eqns.
double getRadiativeCorrectionNCDISAntiNeutrino(const double y, const double Sx, const double Q2, const double ml, const double m1, const JElectricCharge &q1)
Compute the radiative correction factor for NC anti-neutrino DIS interactions according to eqns.
double getRadiativeCorrectionNCDISNeutrino(const double y, const double Sx, const double Q2, const double ml, const double m1, const JElectricCharge &q1)
Compute the radiative correction factor for NC neutrino DIS interactions according to eqns.
double getRadiativeCorrectionCCDISNeutrino(const double y, const double Sx, const double ml, const JElectricCharge &q1)
Compute the radiative correction factor for neutrino CC DIS interactions according to eqns.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition Evt.hh:21
JEvtWeightFactorRadiativeCorrectionsHelper(JEvtWeightFactorRadiativeCorrections_T &factor, const JEquationParameters &eqpars)
Constructor.
Class for radiative corrections to the neutrino CC-DIS weights, based on references:
JProperties getProperties(const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) override final
Get properties of this class.
JProperties getProperties(const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) const override final
Get properties of this class.
JEvtWeightFactorRadiativeCorrections< JEvtWeightFactor_t > JEvtWeightFactorRadiativeCorrections_t
static std::pair< double, JElectricCharge > getQuarkParameters(const int pdg)
Get the quark mass and charge corresponding to a given PDG code.
double getFactor(const Evt &evt) const override final
Get event-weight factor of given event.
static double getChargedLeptonMass(const int pdg)
Get the mass of a charged lepton corresponding to a given PDG code.
static const char *const getTypeKey()
Get type keyword.
static JEquationParameters & getEquationParameters()
Get equation parameters.
Selection of particle data book entries.
Definition JPDB.hh:277
bool hasPDG(const int pdg) const
Check if PDB has particle corresponding to given PDG code.
Definition JPDB.hh:222
const JParticle & getPDG(const int pdg) const
Get particle corresponding to given PDG code.
Definition JPDB.hh:235
Auxiliary class to handle particle name, codes and mass.
Definition JPDB.hh:42
JElectricCharge charge
electric charge of particle [|e|/3]
Definition JPDB.hh:93
double mass
mass of particle [GeV]
Definition JPDB.hh:92
Template class for object cloning.
Definition JClonable.hh:59
Auxiliary class for electric charges of SM fields.
Definition JCharges.hh:28
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition Trk.hh:15
int type
MC: particle type in PDG encoding.
Definition Trk.hh:24
static const int W2LIST_GSEAGEN_BX
Bjorken x.
static const int W2LIST_GSEAGEN_CC
Charged current interaction flag.
static const int W2LIST_GSEAGEN_ICHAN
Interaction channel.
static const int W2LIST_GSEAGEN_BY
Bjorken y.