Project

General

Profile

Manipulating GSimpleNtpFlux files

What's in the file?

One can use the command:
   $ genie -b -q 'dump_gsimple_file.C("gsimple_input.root")'
e.g.
   $ genie -b -q $GSIMPLE/scripts/dump_gsimple_file.C\(\"/nova/data/flux/gsimple/nova_v03/ndos/mn/fhc/*q00*.root\"\)
(actual script also available below, but also available to all in ~rhatcher/public) to dump:
  • the configuration of the GSimpleNtpFlux when initialized with the gsimple_input.root file
  • a handful of flux rays
  • the associated metadata

General GSimpleNtpFlux driver information

The is the state of the driver code before the first neutrino is generated by the driver.

  [...GENIE startup stuff...]
  NOTICE  : [n] <GSimpleNtpFlux.cxx::PrintConfig (1003)> : GSimpleNtpFlux Config:
   Enu_max 58.5128
   pdg-codes: -14 -12 12 14 [rejected:  ] 
   "flux" 12809 entries"meta" 1 entries (FilePOTs 2.50019e+11) in files like: 
   gsimple_input.root
   [  0] /Users/rhatcher/GENIE/gsimple2gsimple/gsimple_input.root
   wgt max=1
   Z0 pushback -3.4e+38
   used entry -1 9999999/1 times, in 0/0 cycles
   SumWeight 0 for 0 neutrinos
   EffPOTsPerNu 1.9519e+07 AccumPOTs 0
   GenWeighted "true" AlreadyUnwgt "true" AllFilesMeta "true" 

Individual flux ray entries

Individual rays have 3 branches associated with them on the tree. The basic entry branch contains the minimal information to define a neutrino ray. The aux branch is a means of extending the ntuple with extra information without modifying the compile class code. This branch consists of a vector of ints and doubles; to interpret the meaning of each element in the arrays the names should bin in corresponding entries in the metadata (in this example the two doubles represent the fgXYWgt and nimpwt values). The (optional) third branch, numi, carries information that has been used in previous efforts for beam reweighting and information that should help tie this ray back to the original flugg or g4numi ntuple entry.

  GSimpleNtpEntry  PDG 14 wgt 1 ( metakey 2046872385 )
     vtx [5.03497,2.24462,-2.20025e-08] dist 810396
     p4  [-0.00146721,0.0921011,1.75003,1.75246]
  GSimpleNtpAux 
     ints:  13 211 2
     doubles:  1.31747e-09 1.63807
  GSimpleNtpNuMI run 0 evtno 228956 entryno 1237311
     tptype 211 tp[xyz] [0.153647,0.0703811,18.1752]
     ndecay 13 ppmedium -39
     v[xyz] [21.5229,9.37083,24247]

Metadata

The metadata tree, for unconcatenated files, should have a single entry. This represents general information about how the file was generated (input files, configurations, resulting ranges, etc.).

   GSimpleNtpMeta 4 flavors:  -14 -12 12 14
    maxEnergy 58.5128 min/maxWgt 1/1 protons 2.50019e+11 metakey 2046872385
    windowBase [8.5,-12.5,0]
    windowDir1 [-17,0,0]
    windowDir2 [0,21,0]
    aux ints:     ndecay ptype tgen
    aux doubles:  fgXYWgt nimpwt
    14 input files: 
       <beamdir type="newxyz"> 
   [    0.999893763247317                    0  -0.0145760838059609 ]
   [ 0.000840795918367228    0.998334934986708   0.0576771241248098 ]
   [   0.0145518136789285  -0.0576832522067165    0.998228875125094 ]
       </beamdir>

       <beampos> (     686.841613827855      -42602.54118512     -809517.55316212 ) </beampos>

       srcpatt=/nova/data/flux/flugg/flugg_mn000z200i_20101117.gpcfgrid_lowth/Run???
       flux_pattern=/local/scratch/path/local_copies/flugg_mn000z200i_20101117.gpcfgrid_lowth_?01.root
       flux_infile=/local/scratch/path/local_copies/flugg_mn000z200i_20101117.gpcfgrid_lowth_001.root
       flux_infile=/local/scratch/path/local_copies/flugg_mn000z200i_20101117.gpcfgrid_lowth_101.root
       [...more input files...]

   [...more entries...]

Quick peek

Alternatively, you can do a quick peek at the meta data by hand with:

   $ genie gsimple_input.root
and then at the genie prompt type:
   genie::flux::GSimpleNtpMeta* metaobj = new genie::flux::GSimpleNtpMeta;
   meta->SetBranchAddress("meta",&metaobj);
   meta->GetEntry(0);
   metaobj->Print();

Creating new GSimpleNtpFlux files by modifying an existing one

One can create a new flux file by modifying entries between reading an entry and writing it to a new file.

  $ genie -b -q 'warp_gsimple.C+("gsimple_out.root","gsimple_in.root")'

The user needs to modify the script's warp_entry() and warp_meta() functions to do whatever manipulation of the entries they desire.

Example scripts