GENIEGenerator
Loading...
Searching...
No Matches
write_dk2nus.h File Reference
#include <string>
#include <iostream>
#include <iomanip>
#include <map>
#include <cstdlib>
#include <algorithm>
#include "TROOT.h"
#include "TH1.h"
#include "TH2.h"
#include "TF1.h"
#include "TFile.h"
#include "TRandom3.h"
#include "TMath.h"
#include "TChain.h"
#include "TSystem.h"
#include "TSystemDirectory.h"
#include "TLorentzVector.h"
#include "FluxDrivers/GNuMIFlux.h"
#include "dk2nu/genie/GDk2NuFlux.h"
#include "tree/dk2nu.h"
#include "tree/calcLocationWeights.h"
#include "tree/dkmeta.h"
Include dependency graph for write_dk2nus.h:

Go to the source code of this file.

Functions

TRandom3 generator (0)
void InitialiseMetaBranches (TTree *meta)
void InitialiseTreeBranches (TTree *tree)
void FillMetaBranches (bsim::DkMeta *dkmeta)
void FillTreeBranches (bsim::Dk2Nu *dk2nu)
void LoopEntries (TChain *cflux, TChain *dflux, bool grid, bool debug)
void RootifyChar (std::string rfch, char fdch[maxC])
void LoadDetectorPosition (bool grid, genie::GFluxI *gfluxdriver)

Variables

const Int_t setID = 0
const int maxArray = 30
const int maxC = 100
const std::string USER = std::getenv("USER") != NULL ? string(std::getenv("USER")) : "user"
const std::string OUTDIR = std::getenv("OUTDIR") != NULL ? string(std::getenv("OUTDIR")) : string(std::getenv("PWD"))
const std::string SAMPLEDK2NU = std::getenv("INDIR") != NULL ? string(std::getenv("INDIR"))+"/sample_dk2nu.root" : string(std::getenv("PWD"))+"/sample_dk2nu.root"
const std::string INDIR_GRID = ""
const std::string OUTDIR_GRID = ""
const std::string INDIR_DEBUG = "./DEBUG"
const std::string GDK2NU_PSET = "MINERVA-v10r8"
const int m_maxNFiles = 100
TTree * dkMeta = 0
int mArSize = 0
int mJob = 0
double mPots = 0.0
char mBeamsim [maxC]
char mPhysics [maxC]
char mPhyscuts [maxC]
char mTgtcfg [maxC]
char mHorncfg [maxC]
char mDkvolcfg [maxC]
double mBeam0x = 0.0
double mBeam0y = 0.0
double mBeam0z = 0.0
double mBeamhwidth = 0.0
double mBeamvwidth = 0.0
double mBeamdxdz = 0.0
double mBeamdydz = 0.0
double mLocationDotX [maxArray]
double mLocationDotY [maxArray]
double mLocationDotZ [maxArray]
char mLocationDotName [maxC *maxArray]
TTree * dkTree = 0
int dArSize = 0
int dAnArSize = 0
int dTrArSize = 0
int dJob = 0
double dPotnum = 0.0
double dPpvx = 0.0
double dPpvy = 0.0
double dPpvz = 0.0
int dDecayDotNorig = 0
int dDecayDotNdecay = 0
int dDecayDotNtype = 0
double dDecayDotVx = 0.0
double dDecayDotVy = 0.0
double dDecayDotVz = 0.0
double dDecayDotPdpx = 0.0
double dDecayDotPdpy = 0.0
double dDecayDotPdpz = 0.0
double dDecayDotPpdxdz = 0.0
double dDecayDotPpdydz = 0.0
double dDecayDotPppz = 0.0
double dDecayDotPpenergy = 0.0
int dDecayDotPpmedium = 0
int dDecayDotPtype = 0
double dDecayDotMuparpx = 0.0
double dDecayDotMuparpy = 0.0
double dDecayDotMuparpz = 0.0
double dDecayDotMupare = 0.0
double dDecayDotNecm = 0.0
double dDecayDotNimpwt = 0.0
double dNurayDotPx [maxArray]
double dNurayDotPy [maxArray]
double dNurayDotPz [maxArray]
double dNurayDotE [maxArray]
double dNurayDotWgt [maxArray]
int dAncestorDotPdg [maxArray]
double dAncestorDotStartx [maxArray]
double dAncestorDotStarty [maxArray]
double dAncestorDotStartz [maxArray]
double dAncestorDotStartt [maxArray]
double dAncestorDotStartpx [maxArray]
double dAncestorDotStartpy [maxArray]
double dAncestorDotStartpz [maxArray]
double dAncestorDotStoppx [maxArray]
double dAncestorDotStoppy [maxArray]
double dAncestorDotStoppz [maxArray]
double dAncestorDotPolx [maxArray]
double dAncestorDotPoly [maxArray]
double dAncestorDotPolz [maxArray]
double dAncestorDotPprodpx [maxArray]
double dAncestorDotPprodpy [maxArray]
double dAncestorDotPprodpz [maxArray]
int dAncestorDotNucleus [maxArray]
char dAncestorDotProc [maxArray *maxC]
char dAncestorDotIvol [maxArray *maxC]
char dAncestorDotImat [maxArray *maxC]
double dTgtexitDotTvx = 0.0
double dTgtexitDotTvy = 0.0
double dTgtexitDotTvz = 0.0
double dTgtexitDotTpx = 0.0
double dTgtexitDotTpy = 0.0
double dTgtexitDotTpz = 0.0
int dTgtexitDotTptype = 0
int dTgtexitDotTgen = 0
double dTrajDotTrkx [maxArray]
double dTrajDotTrky [maxArray]
double dTrajDotTrkz [maxArray]
double dTrajDotTrkpx [maxArray]
double dTrajDotTrkpy [maxArray]
double dTrajDotTrkpz [maxArray]

Function Documentation

◆ FillMetaBranches()

void FillMetaBranches ( bsim::DkMeta * dkmeta)

◆ FillTreeBranches()

void FillTreeBranches ( bsim::Dk2Nu * dk2nu)

◆ generator()

TRandom3 generator ( 0 )

! This is a script to generate flat root trees from dk2nu tuples. ! It copies the dk2nu structure but does away with members of bsim ! so that GENIE HNL simulation can avoid having dk2nu as a compile-time package

Author
John Plows <komninos-john.plows \at physics.ox.ac.uk> University of Oxford
License:\n Copyright (c) 2003-2025, The GENIE Collaboration
For the full text of the license visit http://copyright.genie-mc.org

Referenced by genie::flux::GFluxBlender::AdoptFluxGenerator().

◆ InitialiseMetaBranches()

void InitialiseMetaBranches ( TTree * meta)

◆ InitialiseTreeBranches()

void InitialiseTreeBranches ( TTree * tree)

◆ LoadDetectorPosition()

void LoadDetectorPosition ( bool grid,
genie::GFluxI * gfluxdriver )

Definition at line 199 of file write_dk2nus.h.

200{
202 dynamic_cast<genie::flux::GFluxFileConfigI*>(gfluxdriver);
203
204 // change FLUXFILE_GRID to your favourite grid location
205 std::string FLUXFILE_GRID = "";
206 std::string sample_rootfile = grid ? FLUXFILE_GRID : SAMPLEDK2NU;
207 sample_rootfile = gSystem->ExpandPathName(sample_rootfile.c_str());
208
209 // this is generalized out in GFluxFileConfigI ...
210 gffconfig->LoadBeamSimData(sample_rootfile, GDK2NU_PSET);
211
212 std::cout << "\nDetector position loaded." << std::endl;
213}
virtual void LoadBeamSimData(const std::vector< std::string > &filenames, const std::string &det_loc)=0
const std::string SAMPLEDK2NU
const std::string GDK2NU_PSET

References GDK2NU_PSET, genie::flux::GFluxFileConfigI::LoadBeamSimData(), and SAMPLEDK2NU.

◆ LoopEntries()

void LoopEntries ( TChain * cflux,
TChain * dflux,
bool grid,
bool debug )

◆ RootifyChar()

void RootifyChar ( std::string rfch,
char fdch[maxC] )

References maxC.

Variable Documentation

◆ dAnArSize

int dAnArSize = 0

Definition at line 120 of file write_dk2nus.h.

◆ dAncestorDotImat

char dAncestorDotImat[maxArray *maxC]

Definition at line 177 of file write_dk2nus.h.

◆ dAncestorDotIvol

char dAncestorDotIvol[maxArray *maxC]

Definition at line 176 of file write_dk2nus.h.

◆ dAncestorDotNucleus

int dAncestorDotNucleus[maxArray]

Definition at line 174 of file write_dk2nus.h.

◆ dAncestorDotPdg

int dAncestorDotPdg[maxArray]

Definition at line 157 of file write_dk2nus.h.

◆ dAncestorDotPolx

double dAncestorDotPolx[maxArray]

Definition at line 168 of file write_dk2nus.h.

◆ dAncestorDotPoly

double dAncestorDotPoly[maxArray]

Definition at line 169 of file write_dk2nus.h.

◆ dAncestorDotPolz

double dAncestorDotPolz[maxArray]

Definition at line 170 of file write_dk2nus.h.

◆ dAncestorDotPprodpx

double dAncestorDotPprodpx[maxArray]

Definition at line 171 of file write_dk2nus.h.

◆ dAncestorDotPprodpy

double dAncestorDotPprodpy[maxArray]

Definition at line 172 of file write_dk2nus.h.

◆ dAncestorDotPprodpz

double dAncestorDotPprodpz[maxArray]

Definition at line 173 of file write_dk2nus.h.

◆ dAncestorDotProc

char dAncestorDotProc[maxArray *maxC]

Definition at line 175 of file write_dk2nus.h.

◆ dAncestorDotStartpx

double dAncestorDotStartpx[maxArray]

Definition at line 162 of file write_dk2nus.h.

◆ dAncestorDotStartpy

double dAncestorDotStartpy[maxArray]

Definition at line 163 of file write_dk2nus.h.

◆ dAncestorDotStartpz

double dAncestorDotStartpz[maxArray]

Definition at line 164 of file write_dk2nus.h.

◆ dAncestorDotStartt

double dAncestorDotStartt[maxArray]

Definition at line 161 of file write_dk2nus.h.

◆ dAncestorDotStartx

double dAncestorDotStartx[maxArray]

Definition at line 158 of file write_dk2nus.h.

◆ dAncestorDotStarty

double dAncestorDotStarty[maxArray]

Definition at line 159 of file write_dk2nus.h.

◆ dAncestorDotStartz

double dAncestorDotStartz[maxArray]

Definition at line 160 of file write_dk2nus.h.

◆ dAncestorDotStoppx

double dAncestorDotStoppx[maxArray]

Definition at line 165 of file write_dk2nus.h.

◆ dAncestorDotStoppy

double dAncestorDotStoppy[maxArray]

Definition at line 166 of file write_dk2nus.h.

◆ dAncestorDotStoppz

double dAncestorDotStoppz[maxArray]

Definition at line 167 of file write_dk2nus.h.

◆ dArSize

int dArSize = 0

Definition at line 119 of file write_dk2nus.h.

◆ dDecayDotMupare

double dDecayDotMupare = 0.0

Definition at line 147 of file write_dk2nus.h.

◆ dDecayDotMuparpx

double dDecayDotMuparpx = 0.0

Definition at line 144 of file write_dk2nus.h.

◆ dDecayDotMuparpy

double dDecayDotMuparpy = 0.0

Definition at line 145 of file write_dk2nus.h.

◆ dDecayDotMuparpz

double dDecayDotMuparpz = 0.0

Definition at line 146 of file write_dk2nus.h.

◆ dDecayDotNdecay

int dDecayDotNdecay = 0

Definition at line 130 of file write_dk2nus.h.

◆ dDecayDotNecm

double dDecayDotNecm = 0.0

Definition at line 148 of file write_dk2nus.h.

◆ dDecayDotNimpwt

double dDecayDotNimpwt = 0.0

Definition at line 149 of file write_dk2nus.h.

◆ dDecayDotNorig

int dDecayDotNorig = 0

Definition at line 129 of file write_dk2nus.h.

◆ dDecayDotNtype

int dDecayDotNtype = 0

Definition at line 131 of file write_dk2nus.h.

◆ dDecayDotPdpx

double dDecayDotPdpx = 0.0

Definition at line 135 of file write_dk2nus.h.

◆ dDecayDotPdpy

double dDecayDotPdpy = 0.0

Definition at line 136 of file write_dk2nus.h.

◆ dDecayDotPdpz

double dDecayDotPdpz = 0.0

Definition at line 137 of file write_dk2nus.h.

◆ dDecayDotPpdxdz

double dDecayDotPpdxdz = 0.0

Definition at line 138 of file write_dk2nus.h.

◆ dDecayDotPpdydz

double dDecayDotPpdydz = 0.0

Definition at line 139 of file write_dk2nus.h.

◆ dDecayDotPpenergy

double dDecayDotPpenergy = 0.0

Definition at line 141 of file write_dk2nus.h.

◆ dDecayDotPpmedium

int dDecayDotPpmedium = 0

Definition at line 142 of file write_dk2nus.h.

◆ dDecayDotPppz

double dDecayDotPppz = 0.0

Definition at line 140 of file write_dk2nus.h.

◆ dDecayDotPtype

int dDecayDotPtype = 0

Definition at line 143 of file write_dk2nus.h.

◆ dDecayDotVx

double dDecayDotVx = 0.0

Definition at line 132 of file write_dk2nus.h.

◆ dDecayDotVy

double dDecayDotVy = 0.0

Definition at line 133 of file write_dk2nus.h.

◆ dDecayDotVz

double dDecayDotVz = 0.0

Definition at line 134 of file write_dk2nus.h.

◆ dJob

int dJob = 0

Definition at line 123 of file write_dk2nus.h.

◆ dkMeta

TTree* dkMeta = 0

Definition at line 90 of file write_dk2nus.h.

◆ dkTree

TTree* dkTree = 0

Definition at line 117 of file write_dk2nus.h.

◆ dNurayDotE

double dNurayDotE[maxArray]

Definition at line 154 of file write_dk2nus.h.

◆ dNurayDotPx

double dNurayDotPx[maxArray]

Definition at line 151 of file write_dk2nus.h.

◆ dNurayDotPy

double dNurayDotPy[maxArray]

Definition at line 152 of file write_dk2nus.h.

◆ dNurayDotPz

double dNurayDotPz[maxArray]

Definition at line 153 of file write_dk2nus.h.

◆ dNurayDotWgt

double dNurayDotWgt[maxArray]

Definition at line 155 of file write_dk2nus.h.

◆ dPotnum

double dPotnum = 0.0

Definition at line 124 of file write_dk2nus.h.

◆ dPpvx

double dPpvx = 0.0

Definition at line 125 of file write_dk2nus.h.

◆ dPpvy

double dPpvy = 0.0

Definition at line 126 of file write_dk2nus.h.

◆ dPpvz

double dPpvz = 0.0

Definition at line 127 of file write_dk2nus.h.

◆ dTgtexitDotTgen

int dTgtexitDotTgen = 0

Definition at line 186 of file write_dk2nus.h.

◆ dTgtexitDotTptype

int dTgtexitDotTptype = 0

Definition at line 185 of file write_dk2nus.h.

◆ dTgtexitDotTpx

double dTgtexitDotTpx = 0.0

Definition at line 182 of file write_dk2nus.h.

◆ dTgtexitDotTpy

double dTgtexitDotTpy = 0.0

Definition at line 183 of file write_dk2nus.h.

◆ dTgtexitDotTpz

double dTgtexitDotTpz = 0.0

Definition at line 184 of file write_dk2nus.h.

◆ dTgtexitDotTvx

double dTgtexitDotTvx = 0.0

Definition at line 179 of file write_dk2nus.h.

◆ dTgtexitDotTvy

double dTgtexitDotTvy = 0.0

Definition at line 180 of file write_dk2nus.h.

◆ dTgtexitDotTvz

double dTgtexitDotTvz = 0.0

Definition at line 181 of file write_dk2nus.h.

◆ dTrajDotTrkpx

double dTrajDotTrkpx[maxArray]

Definition at line 191 of file write_dk2nus.h.

◆ dTrajDotTrkpy

double dTrajDotTrkpy[maxArray]

Definition at line 192 of file write_dk2nus.h.

◆ dTrajDotTrkpz

double dTrajDotTrkpz[maxArray]

Definition at line 193 of file write_dk2nus.h.

◆ dTrajDotTrkx

double dTrajDotTrkx[maxArray]

Definition at line 188 of file write_dk2nus.h.

◆ dTrajDotTrky

double dTrajDotTrky[maxArray]

Definition at line 189 of file write_dk2nus.h.

◆ dTrajDotTrkz

double dTrajDotTrkz[maxArray]

Definition at line 190 of file write_dk2nus.h.

◆ dTrArSize

int dTrArSize = 0

Definition at line 121 of file write_dk2nus.h.

◆ GDK2NU_PSET

const std::string GDK2NU_PSET = "MINERVA-v10r8"

Definition at line 76 of file write_dk2nus.h.

Referenced by LoadDetectorPosition().

◆ INDIR_DEBUG

const std::string INDIR_DEBUG = "./DEBUG"

Definition at line 74 of file write_dk2nus.h.

◆ INDIR_GRID

const std::string INDIR_GRID = ""

Definition at line 71 of file write_dk2nus.h.

◆ m_maxNFiles

const int m_maxNFiles = 100

Definition at line 81 of file write_dk2nus.h.

◆ mArSize

int mArSize = 0

Definition at line 92 of file write_dk2nus.h.

◆ maxArray

const int maxArray = 30

Definition at line 50 of file write_dk2nus.h.

◆ maxC

const int maxC = 100

Definition at line 51 of file write_dk2nus.h.

Referenced by RootifyChar().

◆ mBeam0x

double mBeam0x = 0.0

Definition at line 101 of file write_dk2nus.h.

◆ mBeam0y

double mBeam0y = 0.0

Definition at line 102 of file write_dk2nus.h.

◆ mBeam0z

double mBeam0z = 0.0

Definition at line 103 of file write_dk2nus.h.

◆ mBeamdxdz

double mBeamdxdz = 0.0

Definition at line 106 of file write_dk2nus.h.

◆ mBeamdydz

double mBeamdydz = 0.0

Definition at line 107 of file write_dk2nus.h.

◆ mBeamhwidth

double mBeamhwidth = 0.0

Definition at line 104 of file write_dk2nus.h.

◆ mBeamsim

char mBeamsim[maxC]

Definition at line 95 of file write_dk2nus.h.

◆ mBeamvwidth

double mBeamvwidth = 0.0

Definition at line 105 of file write_dk2nus.h.

◆ mDkvolcfg

char mDkvolcfg[maxC]

Definition at line 100 of file write_dk2nus.h.

◆ mHorncfg

char mHorncfg[maxC]

Definition at line 99 of file write_dk2nus.h.

◆ mJob

int mJob = 0

Definition at line 93 of file write_dk2nus.h.

◆ mLocationDotName

char mLocationDotName[maxC *maxArray]

Definition at line 111 of file write_dk2nus.h.

◆ mLocationDotX

double mLocationDotX[maxArray]

Definition at line 108 of file write_dk2nus.h.

◆ mLocationDotY

double mLocationDotY[maxArray]

Definition at line 109 of file write_dk2nus.h.

◆ mLocationDotZ

double mLocationDotZ[maxArray]

Definition at line 110 of file write_dk2nus.h.

◆ mPhyscuts

char mPhyscuts[maxC]

Definition at line 97 of file write_dk2nus.h.

◆ mPhysics

char mPhysics[maxC]

Definition at line 96 of file write_dk2nus.h.

◆ mPots

double mPots = 0.0

Definition at line 94 of file write_dk2nus.h.

◆ mTgtcfg

char mTgtcfg[maxC]

Definition at line 98 of file write_dk2nus.h.

◆ OUTDIR

const std::string OUTDIR = std::getenv("OUTDIR") != NULL ? string(std::getenv("OUTDIR")) : string(std::getenv("PWD"))

Definition at line 68 of file write_dk2nus.h.

◆ OUTDIR_GRID

const std::string OUTDIR_GRID = ""

Definition at line 72 of file write_dk2nus.h.

◆ SAMPLEDK2NU

const std::string SAMPLEDK2NU = std::getenv("INDIR") != NULL ? string(std::getenv("INDIR"))+"/sample_dk2nu.root" : string(std::getenv("PWD"))+"/sample_dk2nu.root"

Definition at line 69 of file write_dk2nus.h.

Referenced by LoadDetectorPosition().

◆ setID

const Int_t setID = 0

Definition at line 45 of file write_dk2nus.h.

◆ USER

const std::string USER = std::getenv("USER") != NULL ? string(std::getenv("USER")) : "user"

Definition at line 67 of file write_dk2nus.h.