1777 TBits* brEvtFlags = 0;
1778 TObjString* brEvtCode = 0;
1787 int brStdHepPdg [
kNPmax];
1788 int brStdHepStatus[
kNPmax];
1789 int brStdHepRescat[
kNPmax];
1790 double brStdHepX4 [
kNPmax][4];
1791 double brStdHepP4 [
kNPmax][4];
1792 double brStdHepPolz [
kNPmax][3];
1801 TObjString* brNuFileName = 0;
1806 int brNuParentDecMode;
1807 double brNuParentDecP4 [4];
1808 double brNuParentDecX4 [4];
1809 double brNuParentProP4 [4];
1810 double brNuParentProX4 [4];
1811 int brNuParentProNVtx;
1862 int brNumiFluxEvtno;
1863 double brNumiFluxNdxdz;
1864 double brNumiFluxNdydz;
1865 double brNumiFluxNpz;
1866 double brNumiFluxNenergy;
1867 double brNumiFluxNdxdznea;
1868 double brNumiFluxNdydznea;
1869 double brNumiFluxNenergyn;
1870 double brNumiFluxNwtnear;
1871 double brNumiFluxNdxdzfar;
1872 double brNumiFluxNdydzfar;
1873 double brNumiFluxNenergyf;
1874 double brNumiFluxNwtfar;
1875 int brNumiFluxNorig;
1876 int brNumiFluxNdecay;
1891 int brNumiFluxNtype;
1892 double brNumiFluxVx;
1893 double brNumiFluxVy;
1894 double brNumiFluxVz;
1895 double brNumiFluxPdpx;
1896 double brNumiFluxPdpy;
1897 double brNumiFluxPdpz;
1898 double brNumiFluxPpdxdz;
1899 double brNumiFluxPpdydz;
1900 double brNumiFluxPppz;
1901 double brNumiFluxPpenergy;
1902 int brNumiFluxPpmedium;
1903 int brNumiFluxPtype;
1904 double brNumiFluxPpvx;
1905 double brNumiFluxPpvy;
1906 double brNumiFluxPpvz;
1907 double brNumiFluxMuparpx;
1908 double brNumiFluxMuparpy;
1909 double brNumiFluxMuparpz;
1910 double brNumiFluxMupare;
1911 double brNumiFluxNecm;
1912 double brNumiFluxNimpwt;
1913 double brNumiFluxXpoint;
1914 double brNumiFluxYpoint;
1915 double brNumiFluxZpoint;
1916 double brNumiFluxTvx;
1917 double brNumiFluxTvy;
1918 double brNumiFluxTvz;
1919 double brNumiFluxTpx;
1920 double brNumiFluxTpy;
1921 double brNumiFluxTpz;
1922 double brNumiFluxTptype;
1923 double brNumiFluxTgen;
1927 double brNumiFluxTgptype;
1928 double brNumiFluxTgppx;
1930 double brNumiFluxTgppy;
1932 double brNumiFluxTgppz;
1934 double brNumiFluxTprivx;
1935 double brNumiFluxTprivy;
1936 double brNumiFluxTprivz;
1937 double brNumiFluxBeamx;
1938 double brNumiFluxBeamy;
1939 double brNumiFluxBeamz;
1940 double brNumiFluxBeampx;
1941 double brNumiFluxBeampy;
1942 double brNumiFluxBeampz;
1948 TTree * rootracker_tree =
new TTree(
"gRooTracker",
"GENIE event tree rootracker format");
1958 rootracker_tree->Branch(
"EvtFlags",
"TBits", &brEvtFlags, 32000, 1);
1959 rootracker_tree->Branch(
"EvtCode",
"TObjString", &brEvtCode, 32000, 1);
1960 rootracker_tree->Branch(
"EvtNum", &brEvtNum,
"EvtNum/I");
1961 rootracker_tree->Branch(
"EvtXSec", &brEvtXSec,
"EvtXSec/D");
1962 rootracker_tree->Branch(
"EvtDXSec", &brEvtDXSec,
"EvtDXSec/D");
1963 rootracker_tree->Branch(
"EvtWght", &brEvtWght,
"EvtWght/D");
1964 rootracker_tree->Branch(
"EvtProb", &brEvtProb,
"EvtProb/D");
1965 rootracker_tree->Branch(
"EvtVtx", brEvtVtx,
"EvtVtx[4]/D");
1966 rootracker_tree->Branch(
"StdHepN", &brStdHepN,
"StdHepN/I");
1967 rootracker_tree->Branch(
"StdHepPdg", brStdHepPdg,
"StdHepPdg[StdHepN]/I");
1968 rootracker_tree->Branch(
"StdHepStatus", brStdHepStatus,
"StdHepStatus[StdHepN]/I");
1969 rootracker_tree->Branch(
"StdHepRescat", brStdHepRescat,
"StdHepRescat[StdHepN]/I");
1970 rootracker_tree->Branch(
"StdHepX4", brStdHepX4,
"StdHepX4[StdHepN][4]/D");
1971 rootracker_tree->Branch(
"StdHepP4", brStdHepP4,
"StdHepP4[StdHepN][4]/D");
1972 rootracker_tree->Branch(
"StdHepPolz", brStdHepPolz,
"StdHepPolz[StdHepN][3]/D");
1973 rootracker_tree->Branch(
"StdHepFd", brStdHepFd,
"StdHepFd[StdHepN]/I");
1974 rootracker_tree->Branch(
"StdHepLd", brStdHepLd,
"StdHepLd[StdHepN]/I");
1975 rootracker_tree->Branch(
"StdHepFm", brStdHepFm,
"StdHepFm[StdHepN]/I");
1976 rootracker_tree->Branch(
"StdHepLm", brStdHepLm,
"StdHepLm[StdHepN]/I");
1979 rootracker_tree->Branch(
"EvtNum", &brEvtNum,
"EvtNum/I");
1980 rootracker_tree->Branch(
"EvtWght", &brEvtWght,
"EvtWght/D");
1981 rootracker_tree->Branch(
"EvtVtx", brEvtVtx,
"EvtVtx[4]/D");
1982 rootracker_tree->Branch(
"StdHepN", &brStdHepN,
"StdHepN/I");
1983 rootracker_tree->Branch(
"StdHepPdg", brStdHepPdg,
"StdHepPdg[StdHepN]/I");
1984 rootracker_tree->Branch(
"StdHepX4", brStdHepX4,
"StdHepX4[StdHepN][4]/D");
1985 rootracker_tree->Branch(
"StdHepP4", brStdHepP4,
"StdHepP4[StdHepN][4]/D");
1992 rootracker_tree->Branch(
"G2NeutEvtCode", &brNeutCode,
"G2NeutEvtCode/I");
1994 rootracker_tree->Branch(
"NuFileName",
"TObjString", &brNuFileName, 32000, 1);
1995 rootracker_tree->Branch(
"NuParentPdg", &brNuParentPdg,
"NuParentPdg/I");
1996 rootracker_tree->Branch(
"NuParentDecMode", &brNuParentDecMode,
"NuParentDecMode/I");
1997 rootracker_tree->Branch(
"NuParentDecP4", brNuParentDecP4,
"NuParentDecP4[4]/D");
1998 rootracker_tree->Branch(
"NuParentDecX4", brNuParentDecX4,
"NuParentDecX4[4]/D");
1999 rootracker_tree->Branch(
"NuParentProP4", brNuParentProP4,
"NuParentProP4[4]/D");
2000 rootracker_tree->Branch(
"NuParentProX4", brNuParentProX4,
"NuParentProX4[4]/D");
2001 rootracker_tree->Branch(
"NuParentProNVtx", &brNuParentProNVtx,
"NuParentProNVtx/I");
2003 rootracker_tree->Branch(
"NuFluxEntry", &brNuFluxEntry,
"NuFluxEntry/L");
2004 rootracker_tree->Branch(
"NuIdfd", &brNuIdfd,
"NuIdfd/I");
2005 rootracker_tree->Branch(
"NuCospibm", &brNuCospibm,
"NuCospibm/F");
2006 rootracker_tree->Branch(
"NuCospi0bm", &brNuCospi0bm,
"NuCospi0bm/F");
2007 rootracker_tree->Branch(
"NuGipart", &brNuGipart,
"NuGipart/I");
2008 rootracker_tree->Branch(
"NuGpos0", brNuGpos0,
"NuGpos0[3]/F");
2009 rootracker_tree->Branch(
"NuGvec0", brNuGvec0,
"NuGvec0[3]/F");
2010 rootracker_tree->Branch(
"NuGamom0", &brNuGamom0,
"NuGamom0/F");
2012 rootracker_tree->Branch(
"NuXnu", brNuXnu,
"NuXnu[2]/F");
2013 rootracker_tree->Branch(
"NuRnu", &brNuRnu,
"NuRnu/F");
2014 rootracker_tree->Branch(
"NuNg", &brNuNg,
"NuNg/I");
2015 rootracker_tree->Branch(
"NuGpid", brNuGpid,
"NuGpid[NuNg]/I");
2016 rootracker_tree->Branch(
"NuGmec", brNuGmec,
"NuGmec[NuNg]/I");
2017 rootracker_tree->Branch(
"NuGv", brNuGv,
"NuGv[NuNg][3]/F");
2018 rootracker_tree->Branch(
"NuGp", brNuGp,
"NuGp[NuNg][3]/F");
2019 rootracker_tree->Branch(
"NuGcosbm", brNuGcosbm,
"NuGcosbm[NuNg]/F");
2020 rootracker_tree->Branch(
"NuGmat", brNuGmat,
"NuGmat[NuNg]/I");
2021 rootracker_tree->Branch(
"NuGdistc", brNuGdistc,
"NuGdistc[NuNg]/F");
2022 rootracker_tree->Branch(
"NuGdistal", brNuGdistal,
"NuGdistal[NuNg]/F");
2023 rootracker_tree->Branch(
"NuGdistti", brNuGdistti,
"NuGdistti[NuNg]/F");
2024 rootracker_tree->Branch(
"NuGdistfe", brNuGdistfe,
"NuGdistfe[NuNg]/F");
2025 rootracker_tree->Branch(
"NuNorm", &brNuNorm,
"NuNorm/F");
2026 rootracker_tree->Branch(
"NuEnusk", &brNuEnusk,
"NuEnusk/F");
2027 rootracker_tree->Branch(
"NuNormsk", &brNuNormsk,
"NuNormsk/F");
2028 rootracker_tree->Branch(
"NuAnorm", &brNuAnorm,
"NuAnorm/F");
2029 rootracker_tree->Branch(
"NuVersion", &brNuVersion,
"NuVersion/F");
2030 rootracker_tree->Branch(
"NuNtrig", &brNuNtrig,
"NuNtrig/I");
2031 rootracker_tree->Branch(
"NuTuneid", &brNuTuneid,
"NuTuneid/I");
2032 rootracker_tree->Branch(
"NuPint", &brNuPint,
"NuPint/I");
2033 rootracker_tree->Branch(
"NuBpos", brNuBpos,
"NuBpos[2]/F");
2034 rootracker_tree->Branch(
"NuBtilt", brNuBtilt,
"NuBtilt[2]/F");
2035 rootracker_tree->Branch(
"NuBrms", brNuBrms,
"NuBrms[2]/F");
2036 rootracker_tree->Branch(
"NuEmit", brNuEmit,
"NuEmit[2]/F");
2037 rootracker_tree->Branch(
"NuAlpha", brNuAlpha,
"NuAlpha[2]/F");
2038 rootracker_tree->Branch(
"NuHcur", brNuHcur,
"NuHcur[3]/F");
2039 rootracker_tree->Branch(
"NuRand", &brNuRand,
"NuRand/I");
2047 rootracker_tree->Branch(
"NumiFluxRun", &brNumiFluxRun,
"NumiFluxRun/I");
2048 rootracker_tree->Branch(
"NumiFluxEvtno", &brNumiFluxEvtno,
"NumiFluxEvtno/I");
2049 rootracker_tree->Branch(
"NumiFluxNdxdz", &brNumiFluxNdxdz,
"NumiFluxNdxdz/D");
2050 rootracker_tree->Branch(
"NumiFluxNdydz", &brNumiFluxNdydz,
"NumiFluxNdydz/D");
2051 rootracker_tree->Branch(
"NumiFluxNpz", &brNumiFluxNpz,
"NumiFluxNpz/D");
2052 rootracker_tree->Branch(
"NumiFluxNenergy", &brNumiFluxNenergy,
"NumiFluxNenergy/D");
2053 rootracker_tree->Branch(
"NumiFluxNdxdznea", &brNumiFluxNdxdznea,
"NumiFluxNdxdznea/D");
2054 rootracker_tree->Branch(
"NumiFluxNdydznea", &brNumiFluxNdydznea,
"NumiFluxNdydznea/D");
2055 rootracker_tree->Branch(
"NumiFluxNenergyn", &brNumiFluxNenergyn,
"NumiFluxNenergyn/D");
2056 rootracker_tree->Branch(
"NumiFluxNwtnear", &brNumiFluxNwtnear,
"NumiFluxNwtnear/D");
2057 rootracker_tree->Branch(
"NumiFluxNdxdzfar", &brNumiFluxNdxdzfar,
"NumiFluxNdxdzfar/D");
2058 rootracker_tree->Branch(
"NumiFluxNdydzfar", &brNumiFluxNdydzfar,
"NumiFluxNdydzfar/D");
2059 rootracker_tree->Branch(
"NumiFluxNenergyf", &brNumiFluxNenergyf,
"NumiFluxNenergyf/D");
2060 rootracker_tree->Branch(
"NumiFluxNwtfar", &brNumiFluxNwtfar,
"NumiFluxNwtfar/D");
2061 rootracker_tree->Branch(
"NumiFluxNorig", &brNumiFluxNorig,
"NumiFluxNorig/I");
2062 rootracker_tree->Branch(
"NumiFluxNdecay", &brNumiFluxNdecay,
"NumiFluxNdecay/I");
2063 rootracker_tree->Branch(
"NumiFluxNtype", &brNumiFluxNtype,
"NumiFluxNtype/I");
2064 rootracker_tree->Branch(
"NumiFluxVx", &brNumiFluxVx,
"NumiFluxVx/D");
2065 rootracker_tree->Branch(
"NumiFluxVy", &brNumiFluxVy,
"NumiFluxVy/D");
2066 rootracker_tree->Branch(
"NumiFluxVz", &brNumiFluxVz,
"NumiFluxVz/D");
2067 rootracker_tree->Branch(
"NumiFluxPdpx", &brNumiFluxPdpx,
"NumiFluxPdpx/D");
2068 rootracker_tree->Branch(
"NumiFluxPdpy", &brNumiFluxPdpy,
"NumiFluxPdpy/D");
2069 rootracker_tree->Branch(
"NumiFluxPdpz", &brNumiFluxPdpz,
"NumiFluxPdpz/D");
2070 rootracker_tree->Branch(
"NumiFluxPpdxdz", &brNumiFluxPpdxdz,
"NumiFluxPpdxdz/D");
2071 rootracker_tree->Branch(
"NumiFluxPpdydz", &brNumiFluxPpdydz,
"NumiFluxPpdydz/D");
2072 rootracker_tree->Branch(
"NumiFluxPppz", &brNumiFluxPppz,
"NumiFluxPppz/D");
2073 rootracker_tree->Branch(
"NumiFluxPpenergy", &brNumiFluxPpenergy,
"NumiFluxPpenergy/D");
2074 rootracker_tree->Branch(
"NumiFluxPpmedium", &brNumiFluxPpmedium,
"NumiFluxPpmedium/I");
2075 rootracker_tree->Branch(
"NumiFluxPtype", &brNumiFluxPtype,
"NumiFluxPtype/I");
2076 rootracker_tree->Branch(
"NumiFluxPpvx", &brNumiFluxPpvx,
"NumiFluxPpvx/D");
2077 rootracker_tree->Branch(
"NumiFluxPpvy", &brNumiFluxPpvy,
"NumiFluxPpvy/D");
2078 rootracker_tree->Branch(
"NumiFluxPpvz", &brNumiFluxPpvz,
"NumiFluxPpvz/D");
2079 rootracker_tree->Branch(
"NumiFluxMuparpx", &brNumiFluxMuparpx,
"NumiFluxMuparpx/D");
2080 rootracker_tree->Branch(
"NumiFluxMuparpy", &brNumiFluxMuparpy,
"NumiFluxMuparpy/D");
2081 rootracker_tree->Branch(
"NumiFluxMuparpz", &brNumiFluxMuparpz,
"NumiFluxMuparpz/D");
2082 rootracker_tree->Branch(
"NumiFluxMupare", &brNumiFluxMupare,
"NumiFluxMupare/D");
2083 rootracker_tree->Branch(
"NumiFluxNecm", &brNumiFluxNecm,
"NumiFluxNecm/D");
2084 rootracker_tree->Branch(
"NumiFluxNimpwt", &brNumiFluxNimpwt,
"NumiFluxNimpwt/D");
2085 rootracker_tree->Branch(
"NumiFluxXpoint", &brNumiFluxXpoint,
"NumiFluxXpoint/D");
2086 rootracker_tree->Branch(
"NumiFluxYpoint", &brNumiFluxYpoint,
"NumiFluxYpoint/D");
2087 rootracker_tree->Branch(
"NumiFluxZpoint", &brNumiFluxZpoint,
"NumiFluxZpoint/D");
2088 rootracker_tree->Branch(
"NumiFluxTvx", &brNumiFluxTvx,
"NumiFluxTvx/D");
2089 rootracker_tree->Branch(
"NumiFluxTvy", &brNumiFluxTvy,
"NumiFluxTvy/D");
2090 rootracker_tree->Branch(
"NumiFluxTvz", &brNumiFluxTvz,
"NumiFluxTvz/D");
2091 rootracker_tree->Branch(
"NumiFluxTpx", &brNumiFluxTpx,
"NumiFluxTpx/D");
2092 rootracker_tree->Branch(
"NumiFluxTpy", &brNumiFluxTpy,
"NumiFluxTpy/D");
2093 rootracker_tree->Branch(
"NumiFluxTpz", &brNumiFluxTpz,
"NumiFluxTpz/D");
2094 rootracker_tree->Branch(
"NumiFluxTptype", &brNumiFluxTptype,
"NumiFluxTptype/I");
2095 rootracker_tree->Branch(
"NumiFluxTgen", &brNumiFluxTgen,
"NumiFluxTgen/I");
2096 rootracker_tree->Branch(
"NumiFluxTgptype", &brNumiFluxTgptype,
"NumiFluxTgptype/I");
2097 rootracker_tree->Branch(
"NumiFluxTgppx", &brNumiFluxTgppx,
"NumiFluxTgppx/D");
2098 rootracker_tree->Branch(
"NumiFluxTgppy", &brNumiFluxTgppy,
"NumiFluxTgppy/D");
2099 rootracker_tree->Branch(
"NumiFluxTgppz", &brNumiFluxTgppz,
"NumiFluxTgppz/D");
2100 rootracker_tree->Branch(
"NumiFluxTprivx", &brNumiFluxTprivx,
"NumiFluxTprivx/D");
2101 rootracker_tree->Branch(
"NumiFluxTprivy", &brNumiFluxTprivy,
"NumiFluxTprivy/D");
2102 rootracker_tree->Branch(
"NumiFluxTprivz", &brNumiFluxTprivz,
"NumiFluxTprivz/D");
2103 rootracker_tree->Branch(
"NumiFluxBeamx", &brNumiFluxBeamx,
"NumiFluxBeamx/D");
2104 rootracker_tree->Branch(
"NumiFluxBeamy", &brNumiFluxBeamy,
"NumiFluxBeamy/D");
2105 rootracker_tree->Branch(
"NumiFluxBeamz", &brNumiFluxBeamz,
"NumiFluxBeamz/D");
2106 rootracker_tree->Branch(
"NumiFluxBeampx", &brNumiFluxBeampx,
"NumiFluxBeampx/D");
2107 rootracker_tree->Branch(
"NumiFluxBeampy", &brNumiFluxBeampy,
"NumiFluxBeampy/D");
2108 rootracker_tree->Branch(
"NumiFluxBeampz", &brNumiFluxBeampz,
"NumiFluxBeampz/D");
2115 gtree = dynamic_cast <TTree *> ( fin.Get(
"gtree") );
2118 LOG(
"gntpc",
pINFO) <<
"Input tree header: " << *thdr;
2122 gtree->SetBranchAddress(
"gmcrec", &mcrec);
2133 LOG(
"gntpc",
pINFO) <<
"Found T2KMetaData!";
2138 <<
"Could not find T2KMetaData attached to the event tree!";
2142 #ifdef __GENIE_FLUX_DRIVERS_ENABLED__ 2145 gtree->SetBranchAddress(
"flux", &jnubeam_flux_info);
2149 gtree->SetBranchAddress(
"flux", &gnumi_flux_info);
2153 <<
"\n Flux drivers are not enabled." 2154 <<
"\n No flux pass-through information will be written-out in the rootracker file" 2155 <<
"\n If this isn't what you are supposed to be doing then build GENIE by adding " 2156 <<
"--with-flux-drivers in the configuration step.";
2160 Long64_t nmax = (
gOptN<0) ?
2161 gtree->GetEntries() : TMath::Min(gtree->GetEntries(),
gOptN);
2163 LOG(
"gntpc",
pERROR) <<
"Number of events = 0";
2166 LOG(
"gntpc",
pNOTICE) <<
"*** Analyzing: " << nmax <<
" events";
2169 for(Long64_t iev = 0; iev < nmax; iev++) {
2170 gtree->GetEntry(iev);
2179 #ifdef __GENIE_FLUX_DRIVERS_ENABLED__ 2181 if(jnubeam_flux_info) {
2182 LOG(
"gntpc",
pINFO) << *jnubeam_flux_info;
2184 LOG(
"gntpc",
pINFO) <<
"No JNUBEAM flux info associated with this event";
2192 if(brEvtFlags)
delete brEvtFlags;
2194 if(brEvtCode)
delete brEvtCode;
2201 for(
int k=0;
k<4;
k++) {
2205 for(
int i=0; i<
kNPmax; i++) {
2206 brStdHepPdg [i] = 0;
2207 brStdHepStatus[i] = -1;
2208 brStdHepRescat[i] = -1;
2209 for(
int k=0;
k<4;
k++) {
2210 brStdHepX4 [i][
k] = 0;
2211 brStdHepP4 [i][
k] = 0;
2213 for(
int k=0;
k<3;
k++) {
2214 brStdHepPolz [i][
k] = 0;
2222 brNuParentDecMode = 0;
2223 for(
int k=0;
k<4;
k++) {
2224 brNuParentDecP4 [
k] = 0;
2225 brNuParentDecX4 [
k] = 0;
2226 brNuParentProP4 [
k] = 0;
2227 brNuParentProX4 [
k] = 0;
2229 brNuParentProNVtx = 0;
2233 brNuCospibm = -999999.;
2234 brNuCospi0bm = -999999.;
2236 brNuGamom0 = -999999.;
2237 for(
int k=0;
k< 3;
k++){
2238 brNuGvec0[
k] = -999999.;
2239 brNuGpos0[
k] = -999999.;
2242 for(
int k=0;
k<2;
k++) {
2243 brNuXnu[
k] = brNuBpos[
k] = brNuBtilt[
k] = brNuBrms[
k] = brNuEmit[
k] = brNuAlpha[
k] = -999999.;
2245 for(
int k=0;
k<3;
k++) brNuHcur[
k] = -999999.;
2247 for(
int k=0;
k<3;
k++){
2248 brNuGv[np][
k] = -999999.;
2249 brNuGp[np][
k] = -999999.;
2251 brNuGpid[np] = -999999;
2252 brNuGmec[np] = -999999;
2253 brNuGmat[np] = -999999;
2254 brNuGcosbm[np] = -999999.;
2255 brNuGdistc[np] = -999999.;
2256 brNuGdistal[np] = -999999.;
2257 brNuGdistti[np] = -999999.;
2258 brNuGdistfe[np] = -999999.;
2262 brNuNorm = -999999.;
2263 brNuEnusk = -999999.;
2264 brNuNormsk = -999999.;
2265 brNuAnorm = -999999.;
2266 brNuVersion= -999999.;
2267 brNuNtrig = -999999;
2268 brNuTuneid = -999999;
2271 if(brNuFileName)
delete brNuFileName;
2278 brEvtFlags =
new TBits(*
event.EventFlags());
2279 brEvtCode =
new TObjString(
event.Summary()->AsString().c_str());
2280 brEvtNum = (
int) iev;
2283 brEvtWght =
event.Weight();
2284 brEvtProb =
event.Probability();
2285 brEvtVtx[0] =
event.Vertex()->X();
2286 brEvtVtx[1] =
event.Vertex()->Y();
2287 brEvtVtx[2] =
event.Vertex()->Z();
2288 brEvtVtx[3] =
event.Vertex()->T();
2292 TIter event_iter(&
event);
2293 while ( (p = dynamic_cast<GHepParticle *>(event_iter.Next())) ) {
2299 brStdHepPdg [iparticle] = p->
Pdg();
2300 brStdHepStatus[iparticle] = (
int) p->
Status();
2302 brStdHepX4 [iparticle][0] = p->
X4()->X();
2303 brStdHepX4 [iparticle][1] = p->
X4()->Y();
2304 brStdHepX4 [iparticle][2] = p->
X4()->Z();
2305 brStdHepX4 [iparticle][3] = p->
X4()->T();
2306 brStdHepP4 [iparticle][0] = p->
P4()->Px();
2307 brStdHepP4 [iparticle][1] = p->
P4()->Py();
2308 brStdHepP4 [iparticle][2] = p->
P4()->Pz();
2309 brStdHepP4 [iparticle][3] = p->
P4()->E();
2321 brStdHepN = iparticle;
2331 #ifdef __GENIE_FLUX_DRIVERS_ENABLED__ 2335 PDGLibrary * pdglib = PDGLibrary::Instance();
2336 if(jnubeam_flux_info) {
2338 brNuParentDecMode = jnubeam_flux_info->
mode;
2340 brNuParentDecP4 [0] = jnubeam_flux_info->
ppi * jnubeam_flux_info->
npi[0];
2341 brNuParentDecP4 [1] = jnubeam_flux_info->
ppi * jnubeam_flux_info->
npi[1];
2342 brNuParentDecP4 [2] = jnubeam_flux_info->
ppi * jnubeam_flux_info->
npi[2];
2343 brNuParentDecP4 [3] = TMath::Sqrt(
2344 TMath::Power(pdglib->
Find(brNuParentPdg)->Mass(), 2.)
2345 + TMath::Power(jnubeam_flux_info->
ppi, 2.)
2347 brNuParentDecX4 [0] = jnubeam_flux_info->
xpi[0];
2348 brNuParentDecX4 [1] = jnubeam_flux_info->
xpi[1];
2349 brNuParentDecX4 [2] = jnubeam_flux_info->
xpi[2];
2350 brNuParentDecX4 [3] = 0;
2352 brNuParentProP4 [0] = jnubeam_flux_info->
ppi0 * jnubeam_flux_info->
npi0[0];
2353 brNuParentProP4 [1] = jnubeam_flux_info->
ppi0 * jnubeam_flux_info->
npi0[1];
2354 brNuParentProP4 [2] = jnubeam_flux_info->
ppi0 * jnubeam_flux_info->
npi0[2];
2355 brNuParentProP4 [3] = TMath::Sqrt(
2356 TMath::Power(pdglib->
Find(brNuParentPdg)->Mass(), 2.)
2357 + TMath::Power(jnubeam_flux_info->
ppi0, 2.)
2359 brNuParentProX4 [0] = jnubeam_flux_info->
xpi0[0];
2360 brNuParentProX4 [1] = jnubeam_flux_info->
xpi0[1];
2361 brNuParentProX4 [2] = jnubeam_flux_info->
xpi0[2];
2362 brNuParentProX4 [3] = 0;
2364 brNuParentProNVtx = jnubeam_flux_info->
nvtx0;
2367 brNuFluxEntry = jnubeam_flux_info->
fluxentry;
2368 brNuIdfd = jnubeam_flux_info->
idfd;
2369 brNuCospibm = jnubeam_flux_info->
cospibm;
2370 brNuCospi0bm = jnubeam_flux_info->
cospi0bm;
2371 brNuGipart = jnubeam_flux_info->
gipart;
2372 brNuGamom0 = jnubeam_flux_info->
gamom0;
2373 for(
int k=0;
k<3;
k++){
2374 brNuGpos0[
k] = (double) jnubeam_flux_info->
gpos0[
k];
2375 brNuGvec0[
k] = (
double) jnubeam_flux_info->
gvec0[
k];
2378 brNuXnu[0] = (double) jnubeam_flux_info->
xnu;
2379 brNuXnu[1] = (
double) jnubeam_flux_info->
ynu;
2380 brNuRnu = (double) jnubeam_flux_info->
rnu;
2381 for(
int k=0;
k<2;
k++){
2382 brNuBpos[
k] = (double) jnubeam_flux_info->
bpos[
k];
2383 brNuBtilt[
k] = (
double) jnubeam_flux_info->
btilt[
k];
2384 brNuBrms[
k] = (double) jnubeam_flux_info->
brms[
k];
2385 brNuEmit[
k] = (
double) jnubeam_flux_info->
emit[
k];
2386 brNuAlpha[
k] = (double) jnubeam_flux_info->
alpha[
k];
2388 for(
int k=0;
k<3;
k++) brNuHcur[
k] = jnubeam_flux_info->
hcur[
k];
2389 for(
int np = 0; np < flux::fNgmax; np++){
2390 brNuGv[np][0] = jnubeam_flux_info->
gvx[np];
2391 brNuGv[np][1] = jnubeam_flux_info->
gvy[np];
2392 brNuGv[np][2] = jnubeam_flux_info->
gvz[np];
2393 brNuGp[np][0] = jnubeam_flux_info->
gpx[np];
2394 brNuGp[np][1] = jnubeam_flux_info->
gpy[np];
2395 brNuGp[np][2] = jnubeam_flux_info->
gpz[np];
2396 brNuGpid[np] = jnubeam_flux_info->
gpid[np];
2397 brNuGmec[np] = jnubeam_flux_info->
gmec[np];
2398 brNuGcosbm[np] = jnubeam_flux_info->
gcosbm[np];
2399 brNuGmat[np] = jnubeam_flux_info->
gmat[np];
2400 brNuGdistc[np] = jnubeam_flux_info->
gdistc[np];
2401 brNuGdistal[np] = jnubeam_flux_info->
gdistal[np];
2402 brNuGdistti[np] = jnubeam_flux_info->
gdistti[np];
2403 brNuGdistfe[np] = jnubeam_flux_info->
gdistfe[np];
2405 brNuNg = jnubeam_flux_info->
ng;
2406 brNuNorm = jnubeam_flux_info->
norm;
2407 brNuEnusk = jnubeam_flux_info->
Enusk;
2408 brNuNormsk = jnubeam_flux_info->
normsk;
2409 brNuAnorm = jnubeam_flux_info->
anorm;
2410 brNuVersion= jnubeam_flux_info->
version;
2411 brNuNtrig = jnubeam_flux_info->
ntrig;
2412 brNuTuneid = jnubeam_flux_info->
tuneid;
2413 brNuPint = jnubeam_flux_info->
pint;
2414 brNuRand = jnubeam_flux_info->
rand;
2415 brNuFileName =
new TObjString(jnubeam_flux_info->
fluxfilename.c_str());
2424 #ifdef __GENIE_FLUX_DRIVERS_ENABLED__ 2426 if(gnumi_flux_info) {
2427 brNumiFluxRun = gnumi_flux_info->
run;
2428 brNumiFluxEvtno = gnumi_flux_info->
evtno;
2429 brNumiFluxNdxdz = gnumi_flux_info->
ndxdz;
2430 brNumiFluxNdydz = gnumi_flux_info->
ndydz;
2431 brNumiFluxNpz = gnumi_flux_info->
npz;
2432 brNumiFluxNenergy = gnumi_flux_info->
nenergy;
2433 brNumiFluxNdxdznea = gnumi_flux_info->
ndxdznea;
2434 brNumiFluxNdydznea = gnumi_flux_info->
ndydznea;
2435 brNumiFluxNenergyn = gnumi_flux_info->
nenergyn;
2436 brNumiFluxNwtnear = gnumi_flux_info->
nwtnear;
2437 brNumiFluxNdxdzfar = gnumi_flux_info->
ndxdzfar;
2438 brNumiFluxNdydzfar = gnumi_flux_info->
ndydzfar;
2439 brNumiFluxNenergyf = gnumi_flux_info->
nenergyf;
2440 brNumiFluxNwtfar = gnumi_flux_info->
nwtfar;
2441 brNumiFluxNorig = gnumi_flux_info->
norig;
2442 brNumiFluxNdecay = gnumi_flux_info->
ndecay;
2443 brNumiFluxNtype = gnumi_flux_info->
ntype;
2444 brNumiFluxVx = gnumi_flux_info->
vx;
2445 brNumiFluxVy = gnumi_flux_info->
vy;
2446 brNumiFluxVz = gnumi_flux_info->
vz;
2447 brNumiFluxPdpx = gnumi_flux_info->
pdpx;
2448 brNumiFluxPdpy = gnumi_flux_info->
pdpy;
2449 brNumiFluxPdpz = gnumi_flux_info->
pdpz;
2450 brNumiFluxPpdxdz = gnumi_flux_info->
ppdxdz;
2451 brNumiFluxPpdydz = gnumi_flux_info->
ppdydz;
2452 brNumiFluxPppz = gnumi_flux_info->
pppz;
2453 brNumiFluxPpenergy = gnumi_flux_info->
ppenergy;
2454 brNumiFluxPpmedium = gnumi_flux_info->
ppmedium;
2455 brNumiFluxPtype = gnumi_flux_info->
ptype;
2456 brNumiFluxPpvx = gnumi_flux_info->
ppvx;
2457 brNumiFluxPpvy = gnumi_flux_info->
ppvy;
2458 brNumiFluxPpvz = gnumi_flux_info->
ppvz;
2459 brNumiFluxMuparpx = gnumi_flux_info->
muparpx;
2460 brNumiFluxMuparpy = gnumi_flux_info->
muparpy;
2461 brNumiFluxMuparpz = gnumi_flux_info->
muparpz;
2462 brNumiFluxMupare = gnumi_flux_info->
mupare;
2463 brNumiFluxNecm = gnumi_flux_info->
necm;
2464 brNumiFluxNimpwt = gnumi_flux_info->
nimpwt;
2465 brNumiFluxXpoint = gnumi_flux_info->
xpoint;
2466 brNumiFluxYpoint = gnumi_flux_info->
ypoint;
2467 brNumiFluxZpoint = gnumi_flux_info->
zpoint;
2468 brNumiFluxTvx = gnumi_flux_info->
tvx;
2469 brNumiFluxTvy = gnumi_flux_info->
tvy;
2470 brNumiFluxTvz = gnumi_flux_info->
tvz;
2471 brNumiFluxTpx = gnumi_flux_info->
tpx;
2472 brNumiFluxTpy = gnumi_flux_info->
tpy;
2473 brNumiFluxTpz = gnumi_flux_info->
tpz;
2474 brNumiFluxTptype = gnumi_flux_info->
tptype;
2475 brNumiFluxTgen = gnumi_flux_info->
tgen;
2476 brNumiFluxTgptype = gnumi_flux_info->
tgptype;
2477 brNumiFluxTgppx = gnumi_flux_info->
tgppx;
2478 brNumiFluxTgppy = gnumi_flux_info->
tgppy;
2479 brNumiFluxTgppz = gnumi_flux_info->
tgppz;
2480 brNumiFluxTprivx = gnumi_flux_info->
tprivx;
2481 brNumiFluxTprivy = gnumi_flux_info->
tprivy;
2482 brNumiFluxTprivz = gnumi_flux_info->
tprivz;
2483 brNumiFluxBeamx = gnumi_flux_info->
beamx;
2484 brNumiFluxBeamy = gnumi_flux_info->
beamy;
2485 brNumiFluxBeamz = gnumi_flux_info->
beamz;
2486 brNumiFluxBeampx = gnumi_flux_info->
beampx;
2487 brNumiFluxBeampy = gnumi_flux_info->
beampy;
2488 brNumiFluxBeampz = gnumi_flux_info->
beampz;
2494 rootracker_tree->Fill();
2500 double pot = gtree->GetWeight();
2501 rootracker_tree->SetWeight(pot);
2505 TFolder * genv = (TFolder*) fin.Get(
"genv");
2506 TFolder * gconfig = (TFolder*) fin.Get(
"gconfig");
2508 genv ->
Write(
"genv");
2509 gconfig ->
Write(
"gconfig");
2517 LOG(
"gntpc",
pINFO) <<
"\nDone converting GENIE's GHEP ntuple";
int NeutReactionCode(const GHepRecord *evrec)
int RescatterCode(void) const
NtpMCRecHeader hdr
record header
const TLorentzVector * P4(void) const
int FirstDaughter(void) const
MINOS-style ntuple record. Each such ntuple record holds a generated EventRecord object. Ntuples of this type are intended for feeding GENIE events into other applications (for example the GEANT4 based MC generation framework of an experiment) if no direct interface exists.
double PolzPolarAngle(void) const
bool gOptCopyJobMeta
copy MC job metadata (gconfig, genv TFolders)
string gOptInpFileName
input file name
GHepStatus_t Status(void) const
int LastMother(void) const
int FirstMother(void) const
Summary information for an interaction.
int GeantToPdg(int geant_code)
int LastDaughter(void) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
static constexpr double cm2
Long64_t gOptN
number of events to process
GNtpcFmt_t gOptOutFileFormat
output file format id
bool PolzIsSet(void) const
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
Singleton class to load & serve a TDatabasePDG.
const TLorentzVector * X4(void) const
TParticlePDG * Find(int pdgc, bool must_exist=true)
double PolzAzimuthAngle(void) const
void Clear(Option_t *opt="")
STDHEP-like event record entry that can fit a particle or a nucleus.
Event finding and building.
string gOptOutFileName
output file name