Jpp 21.0.0
the software that should make you happy
Loading...
Searching...
No Matches
JRadiativeCorrections.cc File Reference

Example program for plotting radiative corrections. More...

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include "TFile.h"
#include "TGraph.h"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
#include "Jeep/JProperties.hh"
#include "JTools/JGrid.hh"
#include "JROOT/JManager.hh"
#include "JPhysics/JConstants.hh"
#include "JPhysics/JRadiativeCorrections.hh"
#include "JAAnet/JParticleTypes.hh"
#include "JAAnet/JPDB.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program for plotting radiative corrections.

Author
bjjung

Definition in file JRadiativeCorrections.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

< Quark PDB entries

< Charged lepton PDB entries

< CC DIS RC factors, equal charge parity initial state particles

< CC DIS RC factors, opposite charge parity initial state particles

< CC DIS RC factors, opposite charge parity, multiplied by (1-y)^2

< NC DIS RC factors, neutrinos

< NC DIS RC factors, anti-neutrinos

< Squared invariant mass assuming fixed proton target

Definition at line 31 of file JRadiativeCorrections.cc.

32{
33 using namespace std;
34 using namespace JPP;
35
36 typedef JGrid<double> JGrid_t;
37
38
39 string outputFile;
40
42 JGrid_t Y;
44
45 double epsilon;
46
47 int debug;
48
49 try {
50
51 JParser<> zap;
52
53 zap['x'] = make_field(X, "Bjorken-x") = vector<double>{0.1, 0.5, 0.9};
54 zap['y'] = make_field(Y, "Inelasticity grid") = JGrid_t( 1000, 1e-6, 1.0 - 1e-6);
55 zap['E'] = make_field(E, "Neutrino energy") = vector<double>{7.0, 80.0};
56 zap['o'] = make_field(outputFile, "Output file name") = "radiative_corrections.root";
57 zap['e'] = make_field(epsilon, "Assertion precision") = 1e-3;
58 zap['d'] = make_field(debug) = 1;
59
60 zap(argc, argv);
61 }
62 catch(const exception& error) {
63 FATAL(error.what() << endl);
64 }
65
66 const JPDBSelection& quarks = getQuarks(); //!< Quark PDB entries
67 const JPDBSelection& charged_leptons = getChargedLeptons(); //!< Charged lepton PDB entries
68
69
70 TFile out(outputFile.c_str(), "recreate");
71
72 JManager<string, TGraph> g1(new TGraph(), "g1[%]"); //!< CC DIS RC factors, equal charge parity initial state particles
73 JManager<string, TGraph> g2(new TGraph(), "g2[%]"); //!< CC DIS RC factors, opposite charge parity initial state particles
74 JManager<string, TGraph> g3(new TGraph(), "g3[%]"); //!< CC DIS RC factors, opposite charge parity, multiplied by (1-y)^2
75 JManager<string, TGraph> g4(new TGraph(), "g4[%]"); //!< NC DIS RC factors, neutrinos
76 JManager<string, TGraph> g5(new TGraph(), "g5[%]"); //!< NC DIS RC factors, anti-neutrinos
77
78#ifdef HAVE_LOOPTOOLS
79
80 const JPassarinoVeltman& PV = JPassarinoVeltman::getInstance();
81
82 const double mt2 = MASS_TOP_QUARK * MASS_TOP_QUARK;
83 const double RtW = MASS_TOP_QUARK / MASS_W_BOSON;
84 const double s2tW = (1.0 + RtW) * (1.0 - RtW);
85
86 DEBUG(PV.getI1(0.0, mt2, 0.0) << endl <<
87 0.5 * log1p(-s2tW) - 0.25 << endl <<
88 0.5 * PV.getI0(0.0, mt2, mt2) - PV.getI1(0.0, mt2, 0.0) << endl <<
89 PV.getI3(0.0, 0.0, mt2) << endl <<
90 (log1p(-s2tW) - 5./6.) / 6. << endl);
91
92 ASSERT(real(PV.getI1(0.0, mt2, 0.0)) == 0.5 * log1p(-s2tW) - 0.25);
93 ASSERT(real(PV.getI0(0.0, mt2, mt2) * 0.5 -
94 PV.getI1(0.0, mt2, 0.0)) == 0.25);
95 ASSERT(real(PV.getI3(0.0, 0.0, mt2)) == (log1p(-s2tW) - 5./6.) / 6.);
96
97 STATUS(CENTER(15) << "fCCDIS" <<
98 CENTER(15) << "fNCDISNeutrino" <<
99 CENTER(15) << "fNCDISAntiNeutrino");
100 DEBUG (CENTER(30) << "rho" <<
101 CENTER(30) << "kappa"); STATUS(endl);
102
103 DEBUG (FILL(90,'=') << '=');
104#else
105 STATUS(CENTER(15) << "fCCDIS" << endl);
106#endif
107
108 STATUS(FILL(15,'=') << '=' << setfill(' ') << endl << endl);
109
110 for (vector<double>::const_iterator Enu = E.begin(); Enu != E.end(); ++Enu) {
111
112 const double S = MASS_PROTON * (2 * (*Enu) + MASS_PROTON); //!< Squared invariant mass assuming fixed proton target
113
114 for (vector<double>::const_iterator x = X.begin(); x != X.end(); ++x) {
115
116 const double Sx = (*x) * S;
117
118 for (int i = 0; i < Y.getSize(); ++i) {
119
120 const double y = Y.getX(i);
121
122 for (JPDBSelection::const_iterator L = charged_leptons.begin(); L != charged_leptons.end(); ++L) {
123
124 if (L->charge > 0) { continue; } // Prevent looping twice
125
126 const string Lsuffix(L->name.substr(0, L->name.length() - 1));
127
128 for (JPDBSelection::const_iterator quark = quarks.begin(); quark != quarks.end(); ++quark) {
129
130#ifndef HAVE_LOOPTOOLS // Prevent redundant loops (only quark charge matters for CC NLO EW corrections)
131 if (abs(quark->pdg) > QUARK_TYPE_UP) { continue; }
132#endif
133
134 const string tag = MAKE_STRING("m_l = m_" << Lsuffix <<
135 "; q_1 = " << quark->name <<
136 "; Enu = " << SCIENTIFIC(8,3) << *Enu <<
137 "; x = " << SCIENTIFIC(8,3) << *x);
138
139 double fCCDIS = 1.0;
140 double fCCDIScheck = 1.0;
141
142 switch ((int) quark->charge) {
143
144 case JElectricCharge::MINUS_TWO: // Anti-up type
145
146 fCCDIS = getRadiativeCorrectionCCDISNeutrino(y, Sx, L->mass, quark->charge);
147 fCCDIScheck = getRadiativeCorrectionCCDIS<false> (y, Sx, L->mass, quark->charge);
148
149 g2[tag]->SetPoint(i, y, (fCCDIS - 1.0) * 100.0);
150 g3[tag]->SetPoint(i, y, (fCCDIS - 1.0) * 100.0 * (1-y) * (1-y));
151 break;
152
153 case JElectricCharge::MINUS_ONE: // Down type
154
155 fCCDIS = getRadiativeCorrectionCCDISNeutrino(y, Sx, L->mass, quark->charge);
156 fCCDIScheck = getRadiativeCorrectionCCDIS<true> (y, Sx, L->mass, quark->charge);
157
158 g1[tag]->SetPoint(i, y, (fCCDIS - 1.0) * 100.0);
159 break;
160
161 case JElectricCharge::PLUS_ONE: // Anti-down type
162
163 fCCDIS = getRadiativeCorrectionCCDISAntiNeutrino(y, Sx, L->mass, quark->charge);
164 fCCDIScheck = getRadiativeCorrectionCCDIS<true> (y, Sx, L->mass, quark->charge);
165
166 g1[tag]->SetPoint(i, y, (fCCDIS - 1.0) * 100.0);
167 break;
168
169 case JElectricCharge::PLUS_TWO: // Up type
170
171 fCCDIS = getRadiativeCorrectionCCDISAntiNeutrino(y, Sx, L->mass, quark->charge);
172 fCCDIScheck = getRadiativeCorrectionCCDIS<false> (y, Sx, L->mass, quark->charge);
173
174 g2[tag]->SetPoint(i, y, (fCCDIS - 1.0) * 100.0);
175 g3[tag]->SetPoint(i, y, (fCCDIS - 1.0) * 100.0 * (1-y) * (1-y));
176 break;
177
178 default:
179 FATAL("Invalid quark charge " << static_cast<int>(quark->charge) << " [e/3]");
180 }
181
182 STATUS(MAKE_STRING(tag << "; y = " << SCIENTIFIC(8,3) << y) << endl <<
183 SCIENTIFIC(15,5) << fCCDIS);
184
185#ifdef HAVE_LOOPTOOLS // NC corrections require LoopTools package
186
187 const double Q2 = (*x) * y * (S - MASS_PROTON * MASS_PROTON);
188
189 const JWeakIsospinProjection I3(quark->charge < 0 ? -0.5 : +0.5);
190
191 const complex<double> rho = getRho (quark->charge, I3);
192 const complex<double> kappa = getKappa(quark->charge, I3, Q2, L->mass);
193
194 const complex<double> rho1986 = getRho1986 (quark->charge, Q2);
195 const complex<double> kappa1986 = getKappa1986(quark->charge, Q2, L->mass*L->mass);
196
197 const double gR = getEWgR(quark->charge);
198 const double gL = getEWgL(quark->charge, quark->charge < JElectricCharge::ZERO ? -0.5 : 0.5);
199
200 const complex<double> gRr = getEWgRrenormalized(quark->charge, rho1986, kappa1986);
201 const complex<double> gLr = getEWgLrenormalized(I3, rho1986, gRr);
202
203 const double fNCDISequalCP = getRadiativeCorrectionNCDIS<true> (y, Sx, quark->mass, quark->charge, gL, gR, gLr, gRr);
204 const double fNCDISoppositeCP = getRadiativeCorrectionNCDIS<false> (y, Sx, quark->mass, quark->charge, gL, gR, gLr, gRr);
205 const double fNCDISNeutrino = getRadiativeCorrectionNCDISNeutrino (y, Sx, Q2, L->mass, quark->mass, quark->charge);
206 const double fNCDISAntiNeutrino = getRadiativeCorrectionNCDISAntiNeutrino(y, Sx, Q2, L->mass, quark->mass, quark->charge);
207
208 STATUS(SCIENTIFIC(15,5) << fNCDISNeutrino <<
209 SCIENTIFIC(15,5) << fNCDISAntiNeutrino);
210 DEBUG (SCIENTIFIC(30,5) << rho1986 <<
211 SCIENTIFIC(30,5) << kappa1986 << endl <<
212 SCIENTIFIC(15,5) << fCCDIScheck);
213
214 switch ((int) quark->charge) {
215
216 case JElectricCharge::PLUS_TWO:
217 case JElectricCharge::MINUS_ONE:
218
219 DEBUG(SCIENTIFIC(15,5) << fNCDISequalCP <<
220 SCIENTIFIC(15,5) << fNCDISoppositeCP <<
221 SCIENTIFIC(30,5) << rho <<
222 SCIENTIFIC(30,5) << kappa); STATUS(endl);
223
224 ASSERT(fabs(fCCDIS - fCCDIScheck) < epsilon);
225 ASSERT(fabs(fNCDISNeutrino - fNCDISequalCP) < epsilon);
226 ASSERT(fabs(fNCDISAntiNeutrino - fNCDISoppositeCP) < epsilon);
227 break;
228
229 case JElectricCharge::MINUS_TWO:
230 case JElectricCharge::PLUS_ONE:
231
232 DEBUG(SCIENTIFIC(15,5) << fNCDISoppositeCP <<
233 SCIENTIFIC(15,5) << fNCDISequalCP <<
234 SCIENTIFIC(30,5) << rho <<
235 SCIENTIFIC(30,5) << kappa); STATUS(endl);
236
237 ASSERT(fabs(fCCDIS - fCCDIScheck) < epsilon);
238 ASSERT(fabs(fNCDISAntiNeutrino - fNCDISequalCP) < epsilon);
239 ASSERT(fabs(fNCDISNeutrino - fNCDISoppositeCP) < epsilon);
240 break;
241
242 default:
243 FATAL("Invalid quark charge " << static_cast<int>(quark->charge) << " [e/3]");
244 }
245
246 ASSERT(abs(rho - rho1986) < epsilon);
247 ASSERT(abs(kappa - kappa1986) < epsilon);
248
249 g4[tag]->SetPoint(i, y, (fNCDISNeutrino - 1.0) * 100.0);
250 g5[tag]->SetPoint(i, y, (fNCDISAntiNeutrino - 1.0) * 100.0);
251#else
252 DEBUG(endl << SCIENTIFIC(15,5) << fCCDIS); STATUS(endl);
253
254 ASSERT(fabs(fCCDIS - fCCDIScheck) < epsilon);
255#endif
256 }
257 }
258 }
259 }
260 }
261
262 out << g1 << g2 << g3 << g4 << g5;
263
264 out.Close();
265
266 return 0;
267}
string outputFile
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
#define STATUS(A)
Definition JMessage.hh:63
#define ASSERT(A,...)
Assert macro.
Definition JMessage.hh:90
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:74
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2107
#define MAKE_STRING(A)
Make string.
Definition JPrint.hh:48
Double_t g1(const Double_t x)
Function.
Definition JQuantiles.cc:25
Utility class to parse command line options.
Definition JParser.hh:1664
const JPDBSelection & getChargedLeptons()
Retrieve charged lepton entries from particle data book.
Definition JPDB.hh:343
const JPDBSelection & getQuarks()
Retrieve quark entries from particle data book.
Definition JPDB.hh:317
double getRho(const JElectricCharge &Cf, const JWeakIsospinProjection &I3)
Compute electroweak renormalization factor rho according to eqn.
std::complex< double > getEWgLrenormalized(const JWeakIsospinProjection &I3, const std::complex< double > &rho, const std::complex< double > &gRrenorm)
Compute renormalized left-chiral electroweak coupling constant.
std::complex< double > getKappa1986(const JElectricCharge &qf, const double Q2, const double ml2)
Compute electroweak renormalization factor kappa as specified on p.
double getEWgR(const JElectricCharge &Qf)
Get electroweak right-chiral coupling constant.
std::complex< double > getKappa(const JElectricCharge &Cf, const JWeakIsospinProjection &I3, const double Q2, const double mf)
Compute electroweak renormalization factor kappa according to eqn.
double getEWgL(const JElectricCharge &Qf, const JWeakIsospinProjection &I3)
Get electroweak left-chiral coupling constant.
std::complex< double > getRho1986(const JElectricCharge &qf, const double Q2)
Compute electroweak renormalization factor rho as specified on p.
std::complex< double > getEWgRrenormalized(const JElectricCharge &Qf, const std::complex< double > &rho, const std::complex< double > &kappa)
Compute renormalized electroweak right-chiral coupling constant.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for alignment of data.
Definition JManip.hh:368
Auxiliary data structure for sequence of same character.
Definition JManip.hh:330
Selection of particle data book entries.
Definition JPDB.hh:277
Singleton class for computing Passarino-Veltman functions using LoopTools.
std::complex< double > getI3(const double q2, const double m1sq, const double m2sq) const
Compute I3 (eqn.
std::complex< double > getI1(const double q2, const double m1sq, const double m2sq) const
Compute I1 (eqn.
std::complex< double > getI0(const double q2, const double m1sq, const double m2sq) const
Compute I0 (eqn.
Auxiliary class for weak isospin projections of SM fields.
Definition JCharges.hh:224
Simple data structure for an abstract collection of equidistant abscissa values.
Definition JGrid.hh:40
Auxiliary data structure for floating point format specification.
Definition JManip.hh:488