icecube.genie_reader.I3GenieTracReader module¶
- class icecube.genie_reader.I3GenieTracReader.I3GenieTracReader(context)¶
Bases:
I3Module
I3GenieTracReader module.
- Parameters:
GenieFileGST (str, default='') – Name of the GENIE gst file to read events from.
GenieFileGRooTracker (str, default='') – Name of the GENIE gRooTracker file to read events from. Assumes that it is converted from the same GHEP file, as gst input file!
GenieInfo (I3GenieInfo (struct), default=None) – I3GenieInfo object with generation info (defined in simclasses).
IceDensity (float, default=0.93*I3Units.g/I3Units.cm3) – Ice density.
RandomService (default=None) – The I3RandomService we are going to use.
ResultDictName (str, default="I3GenieResult") – Name of the output I3GenieResult frame object.
MCTreeName (str, default="I3MCTree") – Name of the output I3MCTree frame object.
MCWeightDictName (str, default=I3MCWeightDict") – Name of the output I3MCWeightDict frame object.
OutputResultDict (bool, default=True) – Choose whether or not to output I3GenieResult.
GenVolCenter (dataclasses.I3Position, default=I3Position(0.,0.,0.)*I3Units.m) – I3Position of generation volume center.
- Configure()¶
Configures I3GenieTracReader:
First opens GenieFileGST and GenieFileGRooTracker, then sets ice density and probability scaling factor, then gets random service from context, then sets volume center, then sets frame index to zero.
- DAQ(frame)¶
If this is the first frame to process (frame index=0), writes I3GENIEInfo to I3Frame. Samples primary neutrino direction and vertex position, gets I3GenieResult, I3MCTree and I3MCWeightDict and writes them to DAQ frame.
- Finish()¶
Finish, check if number of processed frames matches to the number of events in I3GenieInfo.
- static calc_norm(px, py, pz)¶
Calculates Euclidean norm for 3D vector.
- calculate_prob_scaling(primary, resultdict)¶
Very roughly correct for bedrock by scaling interaction probabilities and include the cylinder height extension so we get the correct OneWeight. Note that this is inherently just a simplification since the GENIE xsec tables we’re using only include hydrogen and O16. This will mean that the hadronic physics is a bit wrong, but by less than us not handling the bedrock at all.
- static get_mctree(resultdict, primary)¶
Fills the I3MCTree object (mctree) using information from resultdict.
- get_muon_secondary_energy(primary, mctree)¶
- get_resultdict(gst, gtrac, primary)¶
Fills the I3GenieResult object (resultdict) with information from GST and gRooTracker files.
Sampled vertex position is used and all particles directions are rotated according to sampled direction. Interaction probability and global probability scale are scaled to match new maximum path length.
- get_weightdict(resultdict, primary)¶
Fills the I3MCWeightDict object (weightdict).
- static rotate(dir_pos, zenith, azimuth)¶
Rotates I3Direction/I3Position by provided zenith and azimuth angles.
- sample_position(primary, mctree, resultdict)¶
Sample an interaction position for this interaction using the defined cylinder and any cylinder height extension based on the most energetic secondary muon.
- sample_primary(gst)¶
Samples primary neutrino direction and vertex position.
- set_i3direction(px, py, pz, zenith, azimuth)¶
Sets I3Direction according to provided projections px, py and pz. Then rotates created I3Direction by provided zenith and azimuth angles using the I3GenieTracReader.rotate method.