1637 TBits* brEvtFlags = 0;
1638 TObjString* brEvtCode = 0;
1647 int brStdHepPdg [
kNPmax];
1648 int brStdHepStatus[
kNPmax];
1649 int brStdHepRescat[
kNPmax];
1650 double brStdHepX4 [
kNPmax][4];
1651 double brStdHepP4 [
kNPmax][4];
1652 double brStdHepPolz [
kNPmax][3];
1661 TObjString* brNuFileName = 0;
1666 int brNuParentDecMode;
1667 double brNuParentDecP4 [4];
1668 double brNuParentDecX4 [4];
1669 double brNuParentProP4 [4];
1670 double brNuParentProX4 [4];
1671 int brNuParentProNVtx;
1722 int brNumiFluxEvtno;
1723 double brNumiFluxNdxdz;
1724 double brNumiFluxNdydz;
1725 double brNumiFluxNpz;
1726 double brNumiFluxNenergy;
1727 double brNumiFluxNdxdznea;
1728 double brNumiFluxNdydznea;
1729 double brNumiFluxNenergyn;
1730 double brNumiFluxNwtnear;
1731 double brNumiFluxNdxdzfar;
1732 double brNumiFluxNdydzfar;
1733 double brNumiFluxNenergyf;
1734 double brNumiFluxNwtfar;
1735 int brNumiFluxNorig;
1736 int brNumiFluxNdecay;
1751 int brNumiFluxNtype;
1752 double brNumiFluxVx;
1753 double brNumiFluxVy;
1754 double brNumiFluxVz;
1755 double brNumiFluxPdpx;
1756 double brNumiFluxPdpy;
1757 double brNumiFluxPdpz;
1758 double brNumiFluxPpdxdz;
1759 double brNumiFluxPpdydz;
1760 double brNumiFluxPppz;
1761 double brNumiFluxPpenergy;
1762 int brNumiFluxPpmedium;
1763 int brNumiFluxPtype;
1764 double brNumiFluxPpvx;
1765 double brNumiFluxPpvy;
1766 double brNumiFluxPpvz;
1767 double brNumiFluxMuparpx;
1768 double brNumiFluxMuparpy;
1769 double brNumiFluxMuparpz;
1770 double brNumiFluxMupare;
1771 double brNumiFluxNecm;
1772 double brNumiFluxNimpwt;
1773 double brNumiFluxXpoint;
1774 double brNumiFluxYpoint;
1775 double brNumiFluxZpoint;
1776 double brNumiFluxTvx;
1777 double brNumiFluxTvy;
1778 double brNumiFluxTvz;
1779 double brNumiFluxTpx;
1780 double brNumiFluxTpy;
1781 double brNumiFluxTpz;
1782 double brNumiFluxTptype;
1783 double brNumiFluxTgen;
1787 double brNumiFluxTgptype;
1788 double brNumiFluxTgppx;
1790 double brNumiFluxTgppy;
1792 double brNumiFluxTgppz;
1794 double brNumiFluxTprivx;
1795 double brNumiFluxTprivy;
1796 double brNumiFluxTprivz;
1797 double brNumiFluxBeamx;
1798 double brNumiFluxBeamy;
1799 double brNumiFluxBeamz;
1800 double brNumiFluxBeampx;
1801 double brNumiFluxBeampy;
1802 double brNumiFluxBeampz;
1808 TTree * rootracker_tree =
new TTree(
"gRooTracker",
"GENIE event tree rootracker format");
1818 rootracker_tree->Branch(
"EvtFlags",
"TBits", &brEvtFlags, 32000, 1);
1819 rootracker_tree->Branch(
"EvtCode",
"TObjString", &brEvtCode, 32000, 1);
1820 rootracker_tree->Branch(
"EvtNum", &brEvtNum,
"EvtNum/I");
1821 rootracker_tree->Branch(
"EvtXSec", &brEvtXSec,
"EvtXSec/D");
1822 rootracker_tree->Branch(
"EvtDXSec", &brEvtDXSec,
"EvtDXSec/D");
1823 rootracker_tree->Branch(
"EvtWght", &brEvtWght,
"EvtWght/D");
1824 rootracker_tree->Branch(
"EvtProb", &brEvtProb,
"EvtProb/D");
1825 rootracker_tree->Branch(
"EvtVtx", brEvtVtx,
"EvtVtx[4]/D");
1826 rootracker_tree->Branch(
"StdHepN", &brStdHepN,
"StdHepN/I");
1827 rootracker_tree->Branch(
"StdHepPdg", brStdHepPdg,
"StdHepPdg[StdHepN]/I");
1828 rootracker_tree->Branch(
"StdHepStatus", brStdHepStatus,
"StdHepStatus[StdHepN]/I");
1829 rootracker_tree->Branch(
"StdHepRescat", brStdHepRescat,
"StdHepRescat[StdHepN]/I");
1830 rootracker_tree->Branch(
"StdHepX4", brStdHepX4,
"StdHepX4[StdHepN][4]/D");
1831 rootracker_tree->Branch(
"StdHepP4", brStdHepP4,
"StdHepP4[StdHepN][4]/D");
1832 rootracker_tree->Branch(
"StdHepPolz", brStdHepPolz,
"StdHepPolz[StdHepN][3]/D");
1833 rootracker_tree->Branch(
"StdHepFd", brStdHepFd,
"StdHepFd[StdHepN]/I");
1834 rootracker_tree->Branch(
"StdHepLd", brStdHepLd,
"StdHepLd[StdHepN]/I");
1835 rootracker_tree->Branch(
"StdHepFm", brStdHepFm,
"StdHepFm[StdHepN]/I");
1836 rootracker_tree->Branch(
"StdHepLm", brStdHepLm,
"StdHepLm[StdHepN]/I");
1839 rootracker_tree->Branch(
"EvtNum", &brEvtNum,
"EvtNum/I");
1840 rootracker_tree->Branch(
"EvtWght", &brEvtWght,
"EvtWght/D");
1841 rootracker_tree->Branch(
"EvtVtx", brEvtVtx,
"EvtVtx[4]/D");
1842 rootracker_tree->Branch(
"StdHepN", &brStdHepN,
"StdHepN/I");
1843 rootracker_tree->Branch(
"StdHepPdg", brStdHepPdg,
"StdHepPdg[StdHepN]/I");
1844 rootracker_tree->Branch(
"StdHepX4", brStdHepX4,
"StdHepX4[StdHepN][4]/D");
1845 rootracker_tree->Branch(
"StdHepP4", brStdHepP4,
"StdHepP4[StdHepN][4]/D");
1852 rootracker_tree->Branch(
"G2NeutEvtCode", &brNeutCode,
"G2NeutEvtCode/I");
1854 rootracker_tree->Branch(
"NuFileName",
"TObjString", &brNuFileName, 32000, 1);
1855 rootracker_tree->Branch(
"NuParentPdg", &brNuParentPdg,
"NuParentPdg/I");
1856 rootracker_tree->Branch(
"NuParentDecMode", &brNuParentDecMode,
"NuParentDecMode/I");
1857 rootracker_tree->Branch(
"NuParentDecP4", brNuParentDecP4,
"NuParentDecP4[4]/D");
1858 rootracker_tree->Branch(
"NuParentDecX4", brNuParentDecX4,
"NuParentDecX4[4]/D");
1859 rootracker_tree->Branch(
"NuParentProP4", brNuParentProP4,
"NuParentProP4[4]/D");
1860 rootracker_tree->Branch(
"NuParentProX4", brNuParentProX4,
"NuParentProX4[4]/D");
1861 rootracker_tree->Branch(
"NuParentProNVtx", &brNuParentProNVtx,
"NuParentProNVtx/I");
1863 rootracker_tree->Branch(
"NuFluxEntry", &brNuFluxEntry,
"NuFluxEntry/L");
1864 rootracker_tree->Branch(
"NuIdfd", &brNuIdfd,
"NuIdfd/I");
1865 rootracker_tree->Branch(
"NuCospibm", &brNuCospibm,
"NuCospibm/F");
1866 rootracker_tree->Branch(
"NuCospi0bm", &brNuCospi0bm,
"NuCospi0bm/F");
1867 rootracker_tree->Branch(
"NuGipart", &brNuGipart,
"NuGipart/I");
1868 rootracker_tree->Branch(
"NuGpos0", brNuGpos0,
"NuGpos0[3]/F");
1869 rootracker_tree->Branch(
"NuGvec0", brNuGvec0,
"NuGvec0[3]/F");
1870 rootracker_tree->Branch(
"NuGamom0", &brNuGamom0,
"NuGamom0/F");
1872 rootracker_tree->Branch(
"NuXnu", brNuXnu,
"NuXnu[2]/F");
1873 rootracker_tree->Branch(
"NuRnu", &brNuRnu,
"NuRnu/F");
1874 rootracker_tree->Branch(
"NuNg", &brNuNg,
"NuNg/I");
1875 rootracker_tree->Branch(
"NuGpid", brNuGpid,
"NuGpid[NuNg]/I");
1876 rootracker_tree->Branch(
"NuGmec", brNuGmec,
"NuGmec[NuNg]/I");
1877 rootracker_tree->Branch(
"NuGv", brNuGv,
"NuGv[NuNg][3]/F");
1878 rootracker_tree->Branch(
"NuGp", brNuGp,
"NuGp[NuNg][3]/F");
1879 rootracker_tree->Branch(
"NuGcosbm", brNuGcosbm,
"NuGcosbm[NuNg]/F");
1880 rootracker_tree->Branch(
"NuGmat", brNuGmat,
"NuGmat[NuNg]/I");
1881 rootracker_tree->Branch(
"NuGdistc", brNuGdistc,
"NuGdistc[NuNg]/F");
1882 rootracker_tree->Branch(
"NuGdistal", brNuGdistal,
"NuGdistal[NuNg]/F");
1883 rootracker_tree->Branch(
"NuGdistti", brNuGdistti,
"NuGdistti[NuNg]/F");
1884 rootracker_tree->Branch(
"NuGdistfe", brNuGdistfe,
"NuGdistfe[NuNg]/F");
1885 rootracker_tree->Branch(
"NuNorm", &brNuNorm,
"NuNorm/F");
1886 rootracker_tree->Branch(
"NuEnusk", &brNuEnusk,
"NuEnusk/F");
1887 rootracker_tree->Branch(
"NuNormsk", &brNuNormsk,
"NuNormsk/F");
1888 rootracker_tree->Branch(
"NuAnorm", &brNuAnorm,
"NuAnorm/F");
1889 rootracker_tree->Branch(
"NuVersion", &brNuVersion,
"NuVersion/F");
1890 rootracker_tree->Branch(
"NuNtrig", &brNuNtrig,
"NuNtrig/I");
1891 rootracker_tree->Branch(
"NuTuneid", &brNuTuneid,
"NuTuneid/I");
1892 rootracker_tree->Branch(
"NuPint", &brNuPint,
"NuPint/I");
1893 rootracker_tree->Branch(
"NuBpos", brNuBpos,
"NuBpos[2]/F");
1894 rootracker_tree->Branch(
"NuBtilt", brNuBtilt,
"NuBtilt[2]/F");
1895 rootracker_tree->Branch(
"NuBrms", brNuBrms,
"NuBrms[2]/F");
1896 rootracker_tree->Branch(
"NuEmit", brNuEmit,
"NuEmit[2]/F");
1897 rootracker_tree->Branch(
"NuAlpha", brNuAlpha,
"NuAlpha[2]/F");
1898 rootracker_tree->Branch(
"NuHcur", brNuHcur,
"NuHcur[3]/F");
1899 rootracker_tree->Branch(
"NuRand", &brNuRand,
"NuRand/I");
1907 rootracker_tree->Branch(
"NumiFluxRun", &brNumiFluxRun,
"NumiFluxRun/I");
1908 rootracker_tree->Branch(
"NumiFluxEvtno", &brNumiFluxEvtno,
"NumiFluxEvtno/I");
1909 rootracker_tree->Branch(
"NumiFluxNdxdz", &brNumiFluxNdxdz,
"NumiFluxNdxdz/D");
1910 rootracker_tree->Branch(
"NumiFluxNdydz", &brNumiFluxNdydz,
"NumiFluxNdydz/D");
1911 rootracker_tree->Branch(
"NumiFluxNpz", &brNumiFluxNpz,
"NumiFluxNpz/D");
1912 rootracker_tree->Branch(
"NumiFluxNenergy", &brNumiFluxNenergy,
"NumiFluxNenergy/D");
1913 rootracker_tree->Branch(
"NumiFluxNdxdznea", &brNumiFluxNdxdznea,
"NumiFluxNdxdznea/D");
1914 rootracker_tree->Branch(
"NumiFluxNdydznea", &brNumiFluxNdydznea,
"NumiFluxNdydznea/D");
1915 rootracker_tree->Branch(
"NumiFluxNenergyn", &brNumiFluxNenergyn,
"NumiFluxNenergyn/D");
1916 rootracker_tree->Branch(
"NumiFluxNwtnear", &brNumiFluxNwtnear,
"NumiFluxNwtnear/D");
1917 rootracker_tree->Branch(
"NumiFluxNdxdzfar", &brNumiFluxNdxdzfar,
"NumiFluxNdxdzfar/D");
1918 rootracker_tree->Branch(
"NumiFluxNdydzfar", &brNumiFluxNdydzfar,
"NumiFluxNdydzfar/D");
1919 rootracker_tree->Branch(
"NumiFluxNenergyf", &brNumiFluxNenergyf,
"NumiFluxNenergyf/D");
1920 rootracker_tree->Branch(
"NumiFluxNwtfar", &brNumiFluxNwtfar,
"NumiFluxNwtfar/D");
1921 rootracker_tree->Branch(
"NumiFluxNorig", &brNumiFluxNorig,
"NumiFluxNorig/I");
1922 rootracker_tree->Branch(
"NumiFluxNdecay", &brNumiFluxNdecay,
"NumiFluxNdecay/I");
1923 rootracker_tree->Branch(
"NumiFluxNtype", &brNumiFluxNtype,
"NumiFluxNtype/I");
1924 rootracker_tree->Branch(
"NumiFluxVx", &brNumiFluxVx,
"NumiFluxVx/D");
1925 rootracker_tree->Branch(
"NumiFluxVy", &brNumiFluxVy,
"NumiFluxVy/D");
1926 rootracker_tree->Branch(
"NumiFluxVz", &brNumiFluxVz,
"NumiFluxVz/D");
1927 rootracker_tree->Branch(
"NumiFluxPdpx", &brNumiFluxPdpx,
"NumiFluxPdpx/D");
1928 rootracker_tree->Branch(
"NumiFluxPdpy", &brNumiFluxPdpy,
"NumiFluxPdpy/D");
1929 rootracker_tree->Branch(
"NumiFluxPdpz", &brNumiFluxPdpz,
"NumiFluxPdpz/D");
1930 rootracker_tree->Branch(
"NumiFluxPpdxdz", &brNumiFluxPpdxdz,
"NumiFluxPpdxdz/D");
1931 rootracker_tree->Branch(
"NumiFluxPpdydz", &brNumiFluxPpdydz,
"NumiFluxPpdydz/D");
1932 rootracker_tree->Branch(
"NumiFluxPppz", &brNumiFluxPppz,
"NumiFluxPppz/D");
1933 rootracker_tree->Branch(
"NumiFluxPpenergy", &brNumiFluxPpenergy,
"NumiFluxPpenergy/D");
1934 rootracker_tree->Branch(
"NumiFluxPpmedium", &brNumiFluxPpmedium,
"NumiFluxPpmedium/I");
1935 rootracker_tree->Branch(
"NumiFluxPtype", &brNumiFluxPtype,
"NumiFluxPtype/I");
1936 rootracker_tree->Branch(
"NumiFluxPpvx", &brNumiFluxPpvx,
"NumiFluxPpvx/D");
1937 rootracker_tree->Branch(
"NumiFluxPpvy", &brNumiFluxPpvy,
"NumiFluxPpvy/D");
1938 rootracker_tree->Branch(
"NumiFluxPpvz", &brNumiFluxPpvz,
"NumiFluxPpvz/D");
1939 rootracker_tree->Branch(
"NumiFluxMuparpx", &brNumiFluxMuparpx,
"NumiFluxMuparpx/D");
1940 rootracker_tree->Branch(
"NumiFluxMuparpy", &brNumiFluxMuparpy,
"NumiFluxMuparpy/D");
1941 rootracker_tree->Branch(
"NumiFluxMuparpz", &brNumiFluxMuparpz,
"NumiFluxMuparpz/D");
1942 rootracker_tree->Branch(
"NumiFluxMupare", &brNumiFluxMupare,
"NumiFluxMupare/D");
1943 rootracker_tree->Branch(
"NumiFluxNecm", &brNumiFluxNecm,
"NumiFluxNecm/D");
1944 rootracker_tree->Branch(
"NumiFluxNimpwt", &brNumiFluxNimpwt,
"NumiFluxNimpwt/D");
1945 rootracker_tree->Branch(
"NumiFluxXpoint", &brNumiFluxXpoint,
"NumiFluxXpoint/D");
1946 rootracker_tree->Branch(
"NumiFluxYpoint", &brNumiFluxYpoint,
"NumiFluxYpoint/D");
1947 rootracker_tree->Branch(
"NumiFluxZpoint", &brNumiFluxZpoint,
"NumiFluxZpoint/D");
1948 rootracker_tree->Branch(
"NumiFluxTvx", &brNumiFluxTvx,
"NumiFluxTvx/D");
1949 rootracker_tree->Branch(
"NumiFluxTvy", &brNumiFluxTvy,
"NumiFluxTvy/D");
1950 rootracker_tree->Branch(
"NumiFluxTvz", &brNumiFluxTvz,
"NumiFluxTvz/D");
1951 rootracker_tree->Branch(
"NumiFluxTpx", &brNumiFluxTpx,
"NumiFluxTpx/D");
1952 rootracker_tree->Branch(
"NumiFluxTpy", &brNumiFluxTpy,
"NumiFluxTpy/D");
1953 rootracker_tree->Branch(
"NumiFluxTpz", &brNumiFluxTpz,
"NumiFluxTpz/D");
1954 rootracker_tree->Branch(
"NumiFluxTptype", &brNumiFluxTptype,
"NumiFluxTptype/I");
1955 rootracker_tree->Branch(
"NumiFluxTgen", &brNumiFluxTgen,
"NumiFluxTgen/I");
1956 rootracker_tree->Branch(
"NumiFluxTgptype", &brNumiFluxTgptype,
"NumiFluxTgptype/I");
1957 rootracker_tree->Branch(
"NumiFluxTgppx", &brNumiFluxTgppx,
"NumiFluxTgppx/D");
1958 rootracker_tree->Branch(
"NumiFluxTgppy", &brNumiFluxTgppy,
"NumiFluxTgppy/D");
1959 rootracker_tree->Branch(
"NumiFluxTgppz", &brNumiFluxTgppz,
"NumiFluxTgppz/D");
1960 rootracker_tree->Branch(
"NumiFluxTprivx", &brNumiFluxTprivx,
"NumiFluxTprivx/D");
1961 rootracker_tree->Branch(
"NumiFluxTprivy", &brNumiFluxTprivy,
"NumiFluxTprivy/D");
1962 rootracker_tree->Branch(
"NumiFluxTprivz", &brNumiFluxTprivz,
"NumiFluxTprivz/D");
1963 rootracker_tree->Branch(
"NumiFluxBeamx", &brNumiFluxBeamx,
"NumiFluxBeamx/D");
1964 rootracker_tree->Branch(
"NumiFluxBeamy", &brNumiFluxBeamy,
"NumiFluxBeamy/D");
1965 rootracker_tree->Branch(
"NumiFluxBeamz", &brNumiFluxBeamz,
"NumiFluxBeamz/D");
1966 rootracker_tree->Branch(
"NumiFluxBeampx", &brNumiFluxBeampx,
"NumiFluxBeampx/D");
1967 rootracker_tree->Branch(
"NumiFluxBeampy", &brNumiFluxBeampy,
"NumiFluxBeampy/D");
1968 rootracker_tree->Branch(
"NumiFluxBeampz", &brNumiFluxBeampz,
"NumiFluxBeampz/D");
1975 gtree = dynamic_cast <TTree *> ( fin.Get(
"gtree") );
1978 LOG(
"gntpc",
pINFO) <<
"Input tree header: " << *thdr;
1982 gtree->SetBranchAddress(
"gmcrec", &mcrec);
1993 LOG(
"gntpc",
pINFO) <<
"Found T2KMetaData!";
1998 <<
"Could not find T2KMetaData attached to the event tree!";
2002 #ifdef __GENIE_FLUX_DRIVERS_ENABLED__ 2005 gtree->SetBranchAddress(
"flux", &jnubeam_flux_info);
2009 gtree->SetBranchAddress(
"flux", &gnumi_flux_info);
2013 <<
"\n Flux drivers are not enabled." 2014 <<
"\n No flux pass-through information will be written-out in the rootracker file" 2015 <<
"\n If this isn't what you are supposed to be doing then build GENIE by adding " 2016 <<
"--with-flux-drivers in the configuration step.";
2020 Long64_t nmax = (
gOptN<0) ?
2021 gtree->GetEntries() : TMath::Min(gtree->GetEntries(),
gOptN);
2023 LOG(
"gntpc",
pERROR) <<
"Number of events = 0";
2026 LOG(
"gntpc",
pNOTICE) <<
"*** Analyzing: " << nmax <<
" events";
2029 for(Long64_t iev = 0; iev < nmax; iev++) {
2030 gtree->GetEntry(iev);
2039 #ifdef __GENIE_FLUX_DRIVERS_ENABLED__ 2041 if(jnubeam_flux_info) {
2042 LOG(
"gntpc",
pINFO) << *jnubeam_flux_info;
2044 LOG(
"gntpc",
pINFO) <<
"No JNUBEAM flux info associated with this event";
2052 if(brEvtFlags)
delete brEvtFlags;
2054 if(brEvtCode)
delete brEvtCode;
2061 for(
int k=0;
k<4;
k++) {
2065 for(
int i=0; i<
kNPmax; i++) {
2066 brStdHepPdg [i] = 0;
2067 brStdHepStatus[i] = -1;
2068 brStdHepRescat[i] = -1;
2069 for(
int k=0;
k<4;
k++) {
2070 brStdHepX4 [i][
k] = 0;
2071 brStdHepP4 [i][
k] = 0;
2073 for(
int k=0;
k<3;
k++) {
2074 brStdHepPolz [i][
k] = 0;
2082 brNuParentDecMode = 0;
2083 for(
int k=0;
k<4;
k++) {
2084 brNuParentDecP4 [
k] = 0;
2085 brNuParentDecX4 [
k] = 0;
2086 brNuParentProP4 [
k] = 0;
2087 brNuParentProX4 [
k] = 0;
2089 brNuParentProNVtx = 0;
2093 brNuCospibm = -999999.;
2094 brNuCospi0bm = -999999.;
2096 brNuGamom0 = -999999.;
2097 for(
int k=0;
k< 3;
k++){
2098 brNuGvec0[
k] = -999999.;
2099 brNuGpos0[
k] = -999999.;
2102 for(
int k=0;
k<2;
k++) {
2103 brNuXnu[
k] = brNuBpos[
k] = brNuBtilt[
k] = brNuBrms[
k] = brNuEmit[
k] = brNuAlpha[
k] = -999999.;
2105 for(
int k=0;
k<3;
k++) brNuHcur[
k] = -999999.;
2107 for(
int k=0;
k<3;
k++){
2108 brNuGv[np][
k] = -999999.;
2109 brNuGp[np][
k] = -999999.;
2111 brNuGpid[np] = -999999;
2112 brNuGmec[np] = -999999;
2113 brNuGmat[np] = -999999;
2114 brNuGcosbm[np] = -999999.;
2115 brNuGdistc[np] = -999999.;
2116 brNuGdistal[np] = -999999.;
2117 brNuGdistti[np] = -999999.;
2118 brNuGdistfe[np] = -999999.;
2122 brNuNorm = -999999.;
2123 brNuEnusk = -999999.;
2124 brNuNormsk = -999999.;
2125 brNuAnorm = -999999.;
2126 brNuVersion= -999999.;
2127 brNuNtrig = -999999;
2128 brNuTuneid = -999999;
2131 if(brNuFileName)
delete brNuFileName;
2138 brEvtFlags =
new TBits(*
event.EventFlags());
2139 brEvtCode =
new TObjString(
event.Summary()->AsString().c_str());
2140 brEvtNum = (
int) iev;
2143 brEvtWght =
event.Weight();
2144 brEvtProb =
event.Probability();
2145 brEvtVtx[0] =
event.Vertex()->X();
2146 brEvtVtx[1] =
event.Vertex()->Y();
2147 brEvtVtx[2] =
event.Vertex()->Z();
2148 brEvtVtx[3] =
event.Vertex()->T();
2152 TIter event_iter(&
event);
2153 while ( (p = dynamic_cast<GHepParticle *>(event_iter.Next())) ) {
2157 if (iparticle == kNPmax){
2159 <<
"Event "<<brEvtNum
2160 <<
" has greater than kNPmax = "<< kNPmax
2161 <<
" number of particle entries in StdHep.";
2164 <<
"I will truncate the event to avoid" 2165 <<
" a static array overrun.";
2170 <<
"Dead in the H20!\n" 2171 <<
"Rerun with option -t to truncate these large events.\n" 2172 <<
"Or recompile to make static constant kNPmax larger.";
2181 brStdHepPdg [iparticle] = p->
Pdg();
2182 brStdHepStatus[iparticle] = (
int) p->
Status();
2184 brStdHepX4 [iparticle][0] = p->
X4()->X();
2185 brStdHepX4 [iparticle][1] = p->
X4()->Y();
2186 brStdHepX4 [iparticle][2] = p->
X4()->Z();
2187 brStdHepX4 [iparticle][3] = p->
X4()->T();
2188 brStdHepP4 [iparticle][0] = p->
P4()->Px();
2189 brStdHepP4 [iparticle][1] = p->
P4()->Py();
2190 brStdHepP4 [iparticle][2] = p->
P4()->Pz();
2191 brStdHepP4 [iparticle][3] = p->
P4()->E();
2205 brStdHepN = iparticle;
2215 #ifdef __GENIE_FLUX_DRIVERS_ENABLED__ 2219 PDGLibrary * pdglib = PDGLibrary::Instance();
2220 if(jnubeam_flux_info) {
2222 brNuParentDecMode = jnubeam_flux_info->
mode;
2224 brNuParentDecP4 [0] = jnubeam_flux_info->
ppi * jnubeam_flux_info->
npi[0];
2225 brNuParentDecP4 [1] = jnubeam_flux_info->
ppi * jnubeam_flux_info->
npi[1];
2226 brNuParentDecP4 [2] = jnubeam_flux_info->
ppi * jnubeam_flux_info->
npi[2];
2227 brNuParentDecP4 [3] = TMath::Sqrt(
2228 TMath::Power(pdglib->
Find(brNuParentPdg)->Mass(), 2.)
2229 + TMath::Power(jnubeam_flux_info->
ppi, 2.)
2231 brNuParentDecX4 [0] = jnubeam_flux_info->
xpi[0];
2232 brNuParentDecX4 [1] = jnubeam_flux_info->
xpi[1];
2233 brNuParentDecX4 [2] = jnubeam_flux_info->
xpi[2];
2234 brNuParentDecX4 [3] = 0;
2236 brNuParentProP4 [0] = jnubeam_flux_info->
ppi0 * jnubeam_flux_info->
npi0[0];
2237 brNuParentProP4 [1] = jnubeam_flux_info->
ppi0 * jnubeam_flux_info->
npi0[1];
2238 brNuParentProP4 [2] = jnubeam_flux_info->
ppi0 * jnubeam_flux_info->
npi0[2];
2239 brNuParentProP4 [3] = TMath::Sqrt(
2240 TMath::Power(pdglib->
Find(brNuParentPdg)->Mass(), 2.)
2241 + TMath::Power(jnubeam_flux_info->
ppi0, 2.)
2243 brNuParentProX4 [0] = jnubeam_flux_info->
xpi0[0];
2244 brNuParentProX4 [1] = jnubeam_flux_info->
xpi0[1];
2245 brNuParentProX4 [2] = jnubeam_flux_info->
xpi0[2];
2246 brNuParentProX4 [3] = 0;
2248 brNuParentProNVtx = jnubeam_flux_info->
nvtx0;
2251 brNuFluxEntry = jnubeam_flux_info->
fluxentry;
2252 brNuIdfd = jnubeam_flux_info->
idfd;
2253 brNuCospibm = jnubeam_flux_info->
cospibm;
2254 brNuCospi0bm = jnubeam_flux_info->
cospi0bm;
2255 brNuGipart = jnubeam_flux_info->
gipart;
2256 brNuGamom0 = jnubeam_flux_info->
gamom0;
2257 for(
int k=0;
k<3;
k++){
2258 brNuGpos0[
k] = (double) jnubeam_flux_info->
gpos0[
k];
2259 brNuGvec0[
k] = (
double) jnubeam_flux_info->
gvec0[
k];
2262 brNuXnu[0] = (double) jnubeam_flux_info->
xnu;
2263 brNuXnu[1] = (
double) jnubeam_flux_info->
ynu;
2264 brNuRnu = (double) jnubeam_flux_info->
rnu;
2265 for(
int k=0;
k<2;
k++){
2266 brNuBpos[
k] = (double) jnubeam_flux_info->
bpos[
k];
2267 brNuBtilt[
k] = (
double) jnubeam_flux_info->
btilt[
k];
2268 brNuBrms[
k] = (double) jnubeam_flux_info->
brms[
k];
2269 brNuEmit[
k] = (
double) jnubeam_flux_info->
emit[
k];
2270 brNuAlpha[
k] = (double) jnubeam_flux_info->
alpha[
k];
2272 for(
int k=0;
k<3;
k++) brNuHcur[
k] = jnubeam_flux_info->
hcur[
k];
2273 for(
int np = 0; np < flux::fNgmax; np++){
2274 brNuGv[np][0] = jnubeam_flux_info->
gvx[np];
2275 brNuGv[np][1] = jnubeam_flux_info->
gvy[np];
2276 brNuGv[np][2] = jnubeam_flux_info->
gvz[np];
2277 brNuGp[np][0] = jnubeam_flux_info->
gpx[np];
2278 brNuGp[np][1] = jnubeam_flux_info->
gpy[np];
2279 brNuGp[np][2] = jnubeam_flux_info->
gpz[np];
2280 brNuGpid[np] = jnubeam_flux_info->
gpid[np];
2281 brNuGmec[np] = jnubeam_flux_info->
gmec[np];
2282 brNuGcosbm[np] = jnubeam_flux_info->
gcosbm[np];
2283 brNuGmat[np] = jnubeam_flux_info->
gmat[np];
2284 brNuGdistc[np] = jnubeam_flux_info->
gdistc[np];
2285 brNuGdistal[np] = jnubeam_flux_info->
gdistal[np];
2286 brNuGdistti[np] = jnubeam_flux_info->
gdistti[np];
2287 brNuGdistfe[np] = jnubeam_flux_info->
gdistfe[np];
2289 brNuNg = jnubeam_flux_info->
ng;
2290 brNuNorm = jnubeam_flux_info->
norm;
2291 brNuEnusk = jnubeam_flux_info->
Enusk;
2292 brNuNormsk = jnubeam_flux_info->
normsk;
2293 brNuAnorm = jnubeam_flux_info->
anorm;
2294 brNuVersion= jnubeam_flux_info->
version;
2295 brNuNtrig = jnubeam_flux_info->
ntrig;
2296 brNuTuneid = jnubeam_flux_info->
tuneid;
2297 brNuPint = jnubeam_flux_info->
pint;
2298 brNuRand = jnubeam_flux_info->
rand;
2299 brNuFileName =
new TObjString(jnubeam_flux_info->
fluxfilename.c_str());
2308 #ifdef __GENIE_FLUX_DRIVERS_ENABLED__ 2310 if(gnumi_flux_info) {
2311 brNumiFluxRun = gnumi_flux_info->
run;
2312 brNumiFluxEvtno = gnumi_flux_info->
evtno;
2313 brNumiFluxNdxdz = gnumi_flux_info->
ndxdz;
2314 brNumiFluxNdydz = gnumi_flux_info->
ndydz;
2315 brNumiFluxNpz = gnumi_flux_info->
npz;
2316 brNumiFluxNenergy = gnumi_flux_info->
nenergy;
2317 brNumiFluxNdxdznea = gnumi_flux_info->
ndxdznea;
2318 brNumiFluxNdydznea = gnumi_flux_info->
ndydznea;
2319 brNumiFluxNenergyn = gnumi_flux_info->
nenergyn;
2320 brNumiFluxNwtnear = gnumi_flux_info->
nwtnear;
2321 brNumiFluxNdxdzfar = gnumi_flux_info->
ndxdzfar;
2322 brNumiFluxNdydzfar = gnumi_flux_info->
ndydzfar;
2323 brNumiFluxNenergyf = gnumi_flux_info->
nenergyf;
2324 brNumiFluxNwtfar = gnumi_flux_info->
nwtfar;
2325 brNumiFluxNorig = gnumi_flux_info->
norig;
2326 brNumiFluxNdecay = gnumi_flux_info->
ndecay;
2327 brNumiFluxNtype = gnumi_flux_info->
ntype;
2328 brNumiFluxVx = gnumi_flux_info->
vx;
2329 brNumiFluxVy = gnumi_flux_info->
vy;
2330 brNumiFluxVz = gnumi_flux_info->
vz;
2331 brNumiFluxPdpx = gnumi_flux_info->
pdpx;
2332 brNumiFluxPdpy = gnumi_flux_info->
pdpy;
2333 brNumiFluxPdpz = gnumi_flux_info->
pdpz;
2334 brNumiFluxPpdxdz = gnumi_flux_info->
ppdxdz;
2335 brNumiFluxPpdydz = gnumi_flux_info->
ppdydz;
2336 brNumiFluxPppz = gnumi_flux_info->
pppz;
2337 brNumiFluxPpenergy = gnumi_flux_info->
ppenergy;
2338 brNumiFluxPpmedium = gnumi_flux_info->
ppmedium;
2339 brNumiFluxPtype = gnumi_flux_info->
ptype;
2340 brNumiFluxPpvx = gnumi_flux_info->
ppvx;
2341 brNumiFluxPpvy = gnumi_flux_info->
ppvy;
2342 brNumiFluxPpvz = gnumi_flux_info->
ppvz;
2343 brNumiFluxMuparpx = gnumi_flux_info->
muparpx;
2344 brNumiFluxMuparpy = gnumi_flux_info->
muparpy;
2345 brNumiFluxMuparpz = gnumi_flux_info->
muparpz;
2346 brNumiFluxMupare = gnumi_flux_info->
mupare;
2347 brNumiFluxNecm = gnumi_flux_info->
necm;
2348 brNumiFluxNimpwt = gnumi_flux_info->
nimpwt;
2349 brNumiFluxXpoint = gnumi_flux_info->
xpoint;
2350 brNumiFluxYpoint = gnumi_flux_info->
ypoint;
2351 brNumiFluxZpoint = gnumi_flux_info->
zpoint;
2352 brNumiFluxTvx = gnumi_flux_info->
tvx;
2353 brNumiFluxTvy = gnumi_flux_info->
tvy;
2354 brNumiFluxTvz = gnumi_flux_info->
tvz;
2355 brNumiFluxTpx = gnumi_flux_info->
tpx;
2356 brNumiFluxTpy = gnumi_flux_info->
tpy;
2357 brNumiFluxTpz = gnumi_flux_info->
tpz;
2358 brNumiFluxTptype = gnumi_flux_info->
tptype;
2359 brNumiFluxTgen = gnumi_flux_info->
tgen;
2360 brNumiFluxTgptype = gnumi_flux_info->
tgptype;
2361 brNumiFluxTgppx = gnumi_flux_info->
tgppx;
2362 brNumiFluxTgppy = gnumi_flux_info->
tgppy;
2363 brNumiFluxTgppz = gnumi_flux_info->
tgppz;
2364 brNumiFluxTprivx = gnumi_flux_info->
tprivx;
2365 brNumiFluxTprivy = gnumi_flux_info->
tprivy;
2366 brNumiFluxTprivz = gnumi_flux_info->
tprivz;
2367 brNumiFluxBeamx = gnumi_flux_info->
beamx;
2368 brNumiFluxBeamy = gnumi_flux_info->
beamy;
2369 brNumiFluxBeamz = gnumi_flux_info->
beamz;
2370 brNumiFluxBeampx = gnumi_flux_info->
beampx;
2371 brNumiFluxBeampy = gnumi_flux_info->
beampy;
2372 brNumiFluxBeampz = gnumi_flux_info->
beampz;
2378 rootracker_tree->Fill();
2384 double pot = gtree->GetWeight();
2385 rootracker_tree->SetWeight(pot);
2389 TFolder * genv = (TFolder*) fin.Get(
"genv");
2390 TFolder * gconfig = (TFolder*) fin.Get(
"gconfig");
2392 genv ->
Write(
"genv");
2393 gconfig ->
Write(
"gconfig");
2401 LOG(
"gntpc",
pINFO) <<
"\nDone converting GENIE's GHEP ntuple";
int NeutReactionCode(const GHepRecord *evrec)
int RescatterCode(void) const
GNtpcFmt_t gOptOutFileFormat
output file format id
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 gOptTruncateBigEvents
For rooTracker output, truncate events with more entries than kNPmax? Otherwise throw an error to avo...
bool gOptCopyJobMeta
copy MC job metadata (gconfig, genv TFolders)
GHepStatus_t Status(void) const
int LastMother(void) const
int FirstMother(void) const
string gOptOutFileName
output file name
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
string gOptInpFileName
input file name
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
Long64_t gOptN
number of events to process
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.