Functions | Variables
testXsec.C File Reference
#include "TROOT.h"
#include "TFile.h"
#include "TNtuple.h"
#include "Algorithm/AlgConfigPool.h"
#include "EVGCore/InteractionList.h"
#include "VLE/StrumiaVissaniIBDPXSec.h"
#include "PDG/PDGCodeList.h"
#include "PDG/PDGUtils.h"
#include "Messenger/Messenger.h"
#include "PDG/PDGCodes.h"
#include "Conventions/Units.h"
#include "Interaction/InteractionType.h"
#include "Interaction/ScatteringType.h"

Go to the source code of this file.

Functions

void testXsec (const Char_t *outfn="VLExsecNT.root")
 

Variables

const Int_t nknots = 44
 
const Double_t E [nknots]
 
const Double_t s [nknots]
 
Double_t xsec [nknots]
 
Double_t xsec_n [nknots]
 
TFile * outf
 
TNtuple * nt
 

Function Documentation

void testXsec ( const Char_t *  outfn = "VLExsecNT.root")

Definition at line 54 of file testXsec.C.

References genie::units::cm2, genie::Algorithm::Configure(), E, e, genie::AlgConfigPool::FindRegistry(), MECModelEnuComparisons::i, genie::Interaction::InitStatePtr(), genie::AlgConfigPool::Instance(), genie::XSecAlgorithmI::Integral(), genie::kIntWeakCC, genie::kPdgAntiNuE, genie::kPdgNeutron, genie::kPdgNuE, genie::kPdgProton, genie::kPdgTgtFreeN, genie::kPdgTgtFreeP, genie::kScInverseBetaDecay, nknots, nt, outf, make_associated_cosmic_defs::p4, time_estimates::pool, genie::Target::SetHitNucPdg(), genie::InitialState::SetProbeP4(), genie::InitialState::TgtPtr(), xsec, and xsec_n.

54  {
55  gROOT->Macro("loadlibs.C");
56 
57 /*
58  PDGCodeList * targets = new PDGCodeList;
59  targets->push_back(kPdgTgtFreeP);
60 
61  PDGCodeList * neutrinos = new PDGCodeList;
62  neutrinos->push_back(kPdgAntiNuE);
63 */
64 
65  // load VLE xsec parameters
66  AlgConfigPool * pool = AlgConfigPool::Instance();
67  const Registry * config =
68  pool->FindRegistry("genie::StrumiaVissaniIBDPXSec/Default");
69 
70  // our xsec calculator
72  alg->Configure(*config);
73 
74  // prepare to save results
75  outf = TFile::Open(outfn,"recreate");
76  nt = new TNtuple("nt","nt","Ev:xsec:xsnun:xspaper");
77  nt->SetDirectory(outf);
78 
79 
80  // nu_e_bar + p --> n + e+
83  genie::Interaction * interaction =
84  new genie::Interaction(init_state, proc_info);
85  Target * target = interaction->InitStatePtr()->TgtPtr();
86  target->SetHitNucPdg(kPdgProton);
87  Int_t i=0;
88  for (i = 0; i < nknots; i++) {
89  TLorentzVector p4(0,0,E[i]*1e-3,E[i]*1e-3);
90  interaction->InitStatePtr()->SetProbeP4(p4);
91  xsec[i] = alg->Integral(interaction);
92  }
93 
94 
95  // nu_e + n --> p + e-
96  InitialState init_state_n(kPdgTgtFreeN, kPdgNuE);
98  genie::Interaction * interaction_n =
99  new genie::Interaction(init_state_n, proc_info_n);
100  Target * target_n = interaction_n->InitStatePtr()->TgtPtr();
101  target_n->SetHitNucPdg(kPdgNeutron);
102  for (i = 0; i < nknots; i++) {
103  TLorentzVector n4(0,0,E[i]*1e-3,E[i]*1e-3);
104  interaction_n->InitStatePtr()->SetProbeP4(n4);
105  xsec_n[i] = alg->Integral(interaction_n);
106  }
107 
108  for (i = 0; i < nknots; i++) {
109  Printf("xsec(E=%g MeV) = %g \t xsec_n = %g", E[i],
110  (1E+41/units::cm2)*xsec[i],
111  (1E+41/units::cm2)*xsec_n[i]);
112  nt->Fill(E[i],
113  (1E+41/units::cm2)*xsec[i],
114  (1E+41/units::cm2)*xsec_n[i],
115  s[i]);
116  }
117 
118  outf->Write();
119 
120 }
Cross Section Calculation Interface.
const int kPdgNuE
Definition: PDGCodes.h:28
const XML_Char * target
Definition: expat.h:268
void SetProbeP4(const TLorentzVector &P4)
static constexpr Double_t cm2
Definition: Munits.h:141
const int kPdgAntiNuE
Definition: PDGCodes.h:29
A singleton class holding all configuration registries built while parsing all loaded XML configurati...
Definition: AlgConfigPool.h:41
Definition: config.py:1
An implementation of the neutrino - (free) nucleon [inverse beta decay] cross section, valid from the threshold energy (1.806MeV) up to hundreds of MeV. Currently cut off at 1/2 nucleon mass. Based on the Strumia/Vissani paper Phys.Lett.B564:42-54,2003.
const XML_Char * s
Definition: expat.h:262
Summary information for an interaction.
Definition: Interaction.h:56
const Double_t E[nknots]
Definition: testXsec.C:25
const Int_t nknots
Definition: testXsec.C:24
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:44
virtual double Integral(const Interaction *i) const =0
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:41
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:70
const int kPdgTgtFreeN
Definition: PDGCodes.h:177
const int kPdgTgtFreeP
Definition: PDGCodes.h:176
TFile * outf
Definition: testXsec.C:51
Double_t xsec[nknots]
Definition: testXsec.C:47
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
void SetHitNucPdg(int pdgc)
Definition: Target.cxx:188
Target * TgtPtr(void) const
Definition: InitialState.h:68
InitialState * InitStatePtr(void) const
Definition: Interaction.h:74
Registry * FindRegistry(string key) const
Double_t xsec_n[nknots]
Definition: testXsec.C:47
const int kPdgProton
Definition: PDGCodes.h:65
Float_t e
Definition: plot.C:35
TNtuple * nt
Definition: testXsec.C:52
const int kPdgNeutron
Definition: PDGCodes.h:67
Initial State information.
Definition: InitialState.h:49

Variable Documentation

const Double_t E[nknots]
Initial value:
= {
2.01, 2.25, 2.51, 2.80,
3.12, 3.48, 3.89, 4.33, 4.84,
5.40, 6.02, 6.72, 7.49, 8.36,
8.83, 9.85, 11.0, 12.3, 13.7,
15.3, 17.0, 19.0, 21.2, 23.6,
26.4, 29.4, 32.8, 36.6, 40.9,
43.2, 48.2, 53.7, 59.9, 66.9,
74.6, 83.2, 92.9, 104, 116,
129, 144, 160, 179, 200
}

Definition at line 25 of file testXsec.C.

Referenced by testXsec().

const Int_t nknots = 44
TNtuple* nt

Definition at line 52 of file testXsec.C.

Referenced by testXsec().

TFile* outf
const Double_t s[nknots]
Initial value:
= {
0.00351, 0.00735, 0.0127, 0.0202,
0.0304, 0.0440, 0.06190, 0.0854, 0.116,
0.155, 0.205, 0.269, 0.349, 0.451,
0.511, 0.654, 0.832, 1.05, 1.33,
1.67, 2.09, 2.61, 3.24, 4.01,
4.95, 6.08, 7.44, 9.08, 11.0,
12.1, 14.7, 17.6, 21.0, 25.0,
29.6, 34.8, 40.7, 47.3, 54.6,
62.7, 71.5, 81.0, 91.3, 102.
}

Definition at line 36 of file testXsec.C.

Double_t xsec[nknots]

Definition at line 47 of file testXsec.C.

Referenced by genie::DISXSec::CacheFreeNucleonXSec(), genie::DMDISXSec::CacheFreeNucleonXSec(), genie::ReinSehgalRESXSecWithCache::CacheResExcitationXSec(), genie::ReinSehgalRESXSecWithCacheFast::CacheResExcitationXSec(), ana::ICrossSectionAnalysis::CalculateCrossSections(), genie::COHKinematicsGenerator::CalculateKin_AlvarezRuso(), genie::SKKinematicsGenerator::CalculateKin_AtharSingleKaon(), genie::COHKinematicsGenerator::CalculateKin_BergerSehgal(), genie::COHKinematicsGenerator::CalculateKin_BergerSehgalFM(), genie::COHKinematicsGenerator::CalculateKin_ReinSehgal(), caf::Proxy< caf::SRNeutrino >::CheckEquals(), genie::GMCJDriver::ComputeEventProbability(), genie::utils::ComputeFullQELPXSec(), genie::GMCJDriver::ComputeInteractionProbabilities(), genie::DFRKinematicsGenerator::ComputeMaxXSec(), genie::RESKinematicsGenerator::ComputeMaxXSec(), genie::IBDKinematicsGenerator::ComputeMaxXSec(), genie::COHElKinematicsGenerator::ComputeMaxXSec(), genie::NuEKinematicsGenerator::ComputeMaxXSec(), genie::QELKinematicsGenerator::ComputeMaxXSec(), genie::DISKinematicsGenerator::ComputeMaxXSec(), genie::DMELKinematicsGenerator::ComputeMaxXSec(), genie::SKKinematicsGenerator::ComputeMaxXSec(), genie::DMDISKinematicsGenerator::ComputeMaxXSec(), genie::XSecSplineList::CreateSpline(), genie::GEVGDriver::CreateXSecSumSpline(), ana::ICrossSectionAnalysis::CrossSection(), genie::SmithMonizQELCCPXSec::d2sQES_dQ2dv_SM(), genie::SmithMonizQELCCPXSec::d3sQES_dQ2dvdkF_SM(), ana::DeriveFlux(), genie::utils::gsl::dXSec_dQ2_E::DoEval(), genie::utils::gsl::FullQELdXSec::DoEval(), genie::utils::gsl::dXSec_dy_E::DoEval(), genie::utils::gsl::d3Xsec_dTldTkdCosThetal::DoEval(), genie::utils::gsl::d2Xsec_dTCosth::DoEval(), genie::utils::gsl::d2Xsec_dQ2dv::DoEval(), genie::utils::gsl::d2XSecRESFast_dWQ2_E::DoEval(), genie::utils::gsl::d2XSec_dxdy_E::DoEval(), genie::utils::gsl::d2XSec_dQ2dy_E::DoEval(), genie::utils::gsl::d2XSec_dQ2dydt_E::DoEval(), genie::utils::gsl::d3XSec_dxdydt_E::DoEval(), genie::utils::gsl::d2XSec_dWdQ2_E::DoEval(), genie::utils::gsl::d2XSec_dxdy_Ex::DoEval(), genie::utils::gsl::d2XSec_dxdy_Ey::DoEval(), genie::utils::gsl::d2XSec_dWdQ2_EW::DoEval(), genie::utils::gsl::d2XSec_dWdQ2_EQ2::DoEval(), genie::utils::gsl::d5XSecAR::DoEval(), genie::utils::gsl::d5Xsec_dEldOmegaldOmegapi::DoEval(), genie::utils::gsl::d4Xsec_dEldThetaldOmegapi::DoEval(), genie::utils::gsl::d3Xsec_dOmegaldThetapi::DoEval(), genie::utils::gsl::dXSec_dElep_AR::DoEval(), genie::SmithMonizQELCCPXSec::dsQES_dQ2_SM(), genie::INukeHadroData2018::Frac(), genie::INukeHadroData::Frac(), genie::LwlynSmithQELCCPXSec::FullDifferentialXSec(), genie::GMCJDriver::GeomAnalyzerPtr(), genie::GLRESPXSec::Integral(), genie::H3AMNuGammaPXSec::Integral(), genie::COHElasticPXSec::Integral(), genie::EmpiricalMECPXSec2015::Integral(), genie::AlamSimoAtharVacasSKPXSec2014::Integral(), genie::SlowRsclCharmDISPXSecLO::Integral(), genie::ReinDFRPXSec::Integral(), genie::AhrensNCELPXSec::Integral(), genie::RosenbluthPXSec::Integral(), genie::StrumiaVissaniIBDPXSec::Integral(), genie::QPMDISPXSec::Integral(), genie::AivazisCharmPXSecLO::Integral(), genie::KLVOxygenIBDPXSec::Integral(), genie::IMDAnnihilationPXSec::Integral(), genie::AlvarezRusoCOHPiPXSec::Integral(), genie::P33PaschosLalakulichPXSec::Integral(), genie::AhrensDMELPXSec::Integral(), genie::BergerSehgalFMCOHPiPXSec2015::Integral(), genie::QPMDMDISPXSec::Integral(), genie::LwlynSmithQELCCPXSec::Integral(), genie::BergerSehgalCOHPiPXSec2015::Integral(), genie::NuElectronPXSec::Integral(), genie::PaisQELLambdaPXSec::Integral(), genie::ReinSehgalCOHPiPXSec::Integral(), genie::NievesSimoVacasMECPXSec2016::Integral(), genie::KovalenkoQELCharmPXSec::Integral(), genie::MartiniEricsonChanfrayMarteauMECPXSec2016::Integral(), genie::BardinIMDRadCorPXSec::Integral(), genie::ReinSehgalRESPXSec::Integral(), genie::BSKLNBaseRESPXSec2014::Integral(), genie::COHXSecAR::Integrate(), genie::IMDXSec::Integrate(), genie::COHXSec::Integrate(), genie::DISXSec::Integrate(), genie::RESXSec::Integrate(), genie::QELXSec::Integrate(), genie::DMDISXSec::Integrate(), genie::DMELXSec::Integrate(), genie::AlamSimoAtharVacasSKXSec::Integrate(), genie::MECXSec::Integrate(), genie::DFRXSec::Integrate(), genie::NuElectronXSec::Integrate(), genie::SmithMonizQELCCXSec::Integrate(), genie::ReinSehgalRESXSec::Integrate(), genie::ReinSehgalRESXSecFast::Integrate(), genie::ReinSehgalSPPXSec::Integrate(), genie::NewQELXSec::Integrate(), kinematics(), ana::TrivialCrossSectionAnalysis::LoadFrom(), genie::XSecSplineList::LoadFromXml(), genie::COHKinematicsGenerator::MaxXSec_BergerSehgal(), genie::COHKinematicsGenerator::MaxXSec_BergerSehgalFM(), genie::COHKinematicsGenerator::MaxXSec_ReinSehgal(), ana::TrivialCrossSectionAnalysis::operator=(), caf::Proxy< caf::SRNeutrino >::operator=(), ana::PlotAllCrossSectionOverENu(), genie::DFRKinematicsGenerator::ProcessEventRecord(), genie::NuEKinematicsGenerator::ProcessEventRecord(), genie::COHElKinematicsGenerator::ProcessEventRecord(), genie::QELKinematicsGenerator::ProcessEventRecord(), genie::RESKinematicsGenerator::ProcessEventRecord(), genie::IBDKinematicsGenerator::ProcessEventRecord(), genie::DMELKinematicsGenerator::ProcessEventRecord(), genie::DISKinematicsGenerator::ProcessEventRecord(), genie::QELEventGenerator::ProcessEventRecord(), genie::DMDISKinematicsGenerator::ProcessEventRecord(), genie::QELEventGeneratorSM::ProcessEventRecord(), genie::INukeHadroData2018::ReadhNFile(), genie::INukeHadroData::ReadhNFile(), ana::CrossSectionAnalysis::Result(), ana::NumuCCIncAnalysis::Result(), ana::NumuCC2p2hAnalysis::Result1DFluxInt(), ana::SingleNucAnalysis::Result2D(), ana::NumuCC2p2hAnalysis::Result2D(), ana::NumuCCIncAnalysis::Result2D(), ana::TrivialCrossSectionAnalysis::SaveTo(), genie::MECGenerator::SelectEmpiricalKinematics(), genie::PhysInteractionSelector::SelectInteraction(), genie::RSPPResonanceSelector::SelectResonance(), genie::QELKinematicsGenerator::SpectralFuncExperimentalCode(), genie::DMELKinematicsGenerator::SpectralFuncExperimentalCode(), genie::utils::mec::TensorContraction(), test_xsecanalysis(), testXsec(), ana::TrivialCrossSectionAnalysis::TrivialCrossSectionAnalysis(), validation(), genie::COHElasticPXSec::XSec(), genie::EmpiricalMECPXSec2015::XSec(), genie::SlowRsclCharmDISPXSecLO::XSec(), genie::AlamSimoAtharVacasSKPXSec2014::XSec(), genie::ReinDFRPXSec::XSec(), genie::AhrensNCELPXSec::XSec(), genie::RosenbluthPXSec::XSec(), genie::StrumiaVissaniIBDPXSec::XSec(), genie::AivazisCharmPXSecLO::XSec(), genie::AlvarezRusoCOHPiPXSec::XSec(), genie::QPMDISPXSec::XSec(), genie::IMDAnnihilationPXSec::XSec(), genie::P33PaschosLalakulichPXSec::XSec(), genie::AhrensDMELPXSec::XSec(), genie::BergerSehgalFMCOHPiPXSec2015::XSec(), genie::QPMDMDISPXSec::XSec(), genie::LwlynSmithQELCCPXSec::XSec(), genie::BergerSehgalCOHPiPXSec2015::XSec(), genie::NuElectronPXSec::XSec(), genie::PaisQELLambdaPXSec::XSec(), genie::ReinSehgalCOHPiPXSec::XSec(), genie::NievesSimoVacasMECPXSec2016::XSec(), genie::KovalenkoQELCharmPXSec::XSec(), genie::BardinIMDRadCorPXSec::XSec(), genie::ReinSehgalRESPXSec::XSec(), genie::BSKLNBaseRESPXSec2014::XSec(), genie::NievesQELCCPXSec::XSec(), genie::INukeHadroData2018::XSec(), genie::INukeHadroData::XSec(), genie::ReinSehgalSPPPXSec::XSecNRES(), genie::GEVGDriver::XSecSum(), and ana::ICrossSectionAnalysis::~ICrossSectionAnalysis().

Double_t xsec_n[nknots]

Definition at line 47 of file testXsec.C.

Referenced by testXsec().