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.

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:25
void SetProbeP4(const TLorentzVector &P4)
size_t i(0)
const int kPdgAntiNuE
Definition: PDGCodes.h:26
A singleton class holding all configuration registries built while parsing all loaded XML configurati...
Definition: AlgConfigPool.h:41
OutputModules and Sources **NOTE that will make much of the current OutputModules and Sources irrelevant When the framework executable starts the class names for the modules and services to be loaded are obtained from the configuration A module *Factory *is used to create the modules the configuration will ParameterSet const & config
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.
static const double cm2
Definition: Units.h:77
const Double_t s[nknots]
Definition: testXsec.C:36
Summary information for an interaction.
Definition: Interaction.h:53
const Double_t E[nknots]
Definition: testXsec.C:25
const double e
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:41
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)
Configure the algorithm.
Definition: Algorithm.cxx:70
const int kPdgTgtFreeN
Definition: PDGCodes.h:172
const int kPdgTgtFreeP
Definition: PDGCodes.h:171
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:178
Target * TgtPtr(void) const
Definition: InitialState.h:57
InitialState * InitStatePtr(void) const
Definition: Interaction.h:71
Registry * FindRegistry(string key) const
Double_t xsec_n[nknots]
Definition: testXsec.C:47
const int kPdgProton
Definition: PDGCodes.h:62
TNtuple * nt
Definition: testXsec.C:52
const int kPdgNeutron
Definition: PDGCodes.h:64
Initial State information.
Definition: InitialState.h:42

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.

const Int_t nknots = 44

Definition at line 24 of file testXsec.C.

TNtuple* nt

Definition at line 52 of file testXsec.C.

TFile* outf

Definition at line 51 of file testXsec.C.

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.

Double_t xsec_n[nknots]

Definition at line 47 of file testXsec.C.