17 #include "convert/common_convert.C" 18 #include "convert/flugg/flugg.C" 25 string volumeFilePath=
"../fluxfiles/g4numi001_Volumes_index.inp",
26 string inputloc=
"MINOS",
27 Long64_t maxentries=-1,
36 int highest_potnum = 0;
39 TFile*
fin = TFile::Open(ifname.c_str());
41 cout <<
"couldn't open input file: " << ifname <<
endl;
44 const char* objName =
"h10";
46 fin->GetObject(objName,tin);
49 cout <<
"couldn't find " << objName <<
endl;
59 cout <<
"Output file: " << ofname << endl <<
endl;
68 if ( maxentries > 0 ) {
69 cout <<
"limit # of entries to " << nentries
70 <<
" / " << maxentries <<
endl;
71 nentries = TMath::Min(nentries,maxentries);
76 for (Long64_t jentry = 0; jentry <
nentries; ++jentry) {
77 Long64_t ientry = fluggObj.
LoadTree(jentry);
78 if (ientry < 0)
break;
79 nb = fluggObj.
fChain->GetEntry(jentry);
101 if ( moddump > 0 && jentry%moddump == 0 )
cout << endl << *
dk2nu <<
endl;
109 cout <<
"estimated pots " <<
pots <<
" (" << highest_potnum <<
")" <<
endl;
110 cout <<
"maximum observed fractional difference in cross checks: " 120 cout << endl <<
"========== last entries" << endl <<
endl;
141 double pzrndm = fluggObj.
Npz;
142 double pxrndm = fluggObj.
Ndxdz * pzrndm;
143 double pyrndm = fluggObj.
Ndydz * pzrndm;
215 for (
int ian=0; ian < nmx; ++ian) {
237 TString procString, volumeString;
239 ancestor.
proc = procString.Data();
241 ancestor.
ivol = volumeString.Data();
254 static bool first =
true;
255 static size_t indxNear = -1, indxFar = -1;
261 cout <<
"indx " << inputloc <<
" Near " << indxNear
262 <<
" Far " << indxFar <<
endl;
Double_t ppdydz
% direction of nu parent at its production point
Int_t job
identifying job #
TString ConvertVolumeCodeToString(int volumeCode, string volumeFilePath)
Int_t parIndex
particle index, from nu (0), parent (1) ... to proton (n)
Double_t pppz
% z momentum of nu parent at its production point
void SetStopP(Double_t px, Double_t py, Double_t pz)
std::string ivol
name of the volume where the particle starts
void copy_flugg_to_dk2nu(const flugg &fluggObj, string volumeFilePath)
Double_t pdpx
% px momentum of nu parent at (vx,vy,vz)
void clear(const std::string &opt="")
reset everything
std::vector< bsim::NuRay > nuray
rays through detector fixed points
Int_t potnum
proton # processed by simulation
std::string proc
name of the process that creates this particle
Double_t nimpwt
% cumulative importance weight prod to decay
Double_t necm
% nu energy in center-of-mass frame
double estimate_pots(int highest_potnum)
bsim::Decay decay
basic decay information
Double_t ppvz
production vertex z of nu parent
int ConvertGeantToPdg(int geant_code, std::string tag="?")
Double_t tvy
y position of nu ancestor as it exits target
string construct_outfilename(string infilename)
void SetStartXYZT(Double_t x, Double_t y, Double_t z, Double_t t)
set triplets
Double_t ppdxdz
% direction of nu parent at its production point
Double_t ppvy
production vertex y of nu parent
Double_t vz
% neutrino production vertex z
bsim::TgtExit tgtexit
info about leaving the target
Int_t tptype
species of ancestor exiting the target
Int_t pdg
ancestor species
double frac_diff_tolerance
Double_t pdpz
% pz momentum of nu parent at (vx,vy,vz)
Double_t ppvx
production vertex x of nu parent
Double_t tpz
z momentum of nu ancestor as it exits target
void SetStartP(Double_t px, Double_t py, Double_t pz)
virtual Long64_t LoadTree(Long64_t entry)
Double_t ppenergy
% energy of nu parent at its production point
Double_t tpy
y momentum of nu ancestor as it exits target
Int_t ntype
% neutrino flavor (PDG? code)
void ConvertBookNtuple(std::string ofname="test_dk2nu.root")
void convert_flugg(string ifname="../fluxfiles/generic_flugg.root", int jobnum=42, string volumeFilePath="../fluxfiles/g4numi001_Volumes_index.inp", string inputloc="MINOS", Long64_t maxentries=-1, Long64_t moddump=-1)
Double_t tvz
z position of nu ancestor as it exits target
bool histCompare(double a, double b, string s)
int Convert5xToPdg(int old_ntype)
size_t find_loc_index(string match)
void fluggCrossChecks(const flugg &fluggObj, string inputloc)
Double_t tpx
x momentum of nu ancestor as it exits target
Double_t vx
% neutrino production vertex x
void calcLocationWeights(const bsim::DkMeta *dkmeta, bsim::Dk2Nu *dk2nu)
user interface
Int_t ndecay
decay process (see dkproc_t)
Double_t mupare
% energy of nu grandparent
Double_t vy
% neutrino production vertex y
Int_t ppmedium
material nu parent was produced in
TString ConvertFlukaInteractionCodeToString(int interactionCode)
Double_t tvx
x position of nu ancestor as it exits target
std::vector< bsim::Ancestor > ancestor
chain from proton to neutrino
Double_t pdpy
% py momentum of nu parent at (vx,vy,vz)
Int_t ptype
% nu parent species (PDG? code)
void ConvertInit(std::string locfilename="$(DK2NU)/etc/locations.txt")