xboa
Public Member Functions | Public Attributes | Private Member Functions | Static Private Attributes | List of all members
MausJsonHitFactory Class Reference

MausJsonHitFactory strips hits of a specified type from a json_document and returns to the user. More...

Inherits HitFactoryBase.

Public Member Functions

def __init__
 Initialise the hit factory. More...
 
def new_spill
 Read a new spill off the file handle. More...
 
def make_hit
 Return the next hit from the spill file_handle. More...
 
def hit_from_maus_object
 Convert a MAUS object into a Hit according to specified formats. More...
 
def file_types
 Return a list of file types that the factory can read. More...
 
def deprecated_file_types
 Return a list of deprecated file types (no longer used) More...
 

Public Attributes

 fin
 
 hits
 
 format
 
 spill
 

Private Member Functions

def _read_maus_spill
 Read a MAUS spill, converting to MAUS objects. More...
 
def _read_virtual_hits
 Read a virtual hits from the json_document. More...
 
def _read_primaries
 Read primaries from the json_document. More...
 

Static Private Attributes

dictionary _maus_three_vec_conversions
 
dictionary _maus_variable_conversions
 
dictionary _file_mass_shell
 

Detailed Description

MausJsonHitFactory strips hits of a specified type from a json_document and returns to the user.

Definition at line 28 of file _maus_json_hit_factory.py.

Constructor & Destructor Documentation

def __init__ (   self,
  file_handle,
  format 
)

Initialise the hit factory.

  • file_handle: a file handle containing a set of json documents, one per line
  • format: format of data to be extracted from the json document
  • spill_number: spill parameter that will be assigned to the hits

Definition at line 37 of file _maus_json_hit_factory.py.

References MausJsonHitFactory.deprecated_file_types(), BuiltinHitFactory.file_types(), MausJsonHitFactory.file_types(), and Hit.file_types.

Member Function Documentation

def new_spill (   self)
def make_hit (   self)

Return the next hit from the spill file_handle.

Definition at line 79 of file _maus_json_hit_factory.py.

References MausJsonHitFactory.hits, MausJsonHitFactory.new_spill(), and HitFactoryBase.new_spill().

def _read_maus_spill (   self)
private
def _read_virtual_hits (   self)
private

Read a virtual hits from the json_document.

Definition at line 103 of file _maus_json_hit_factory.py.

References MausJsonHitFactory.hit_from_maus_object(), and MausJsonHitFactory.spill.

Referenced by MausRootHitFactory._read_maus_spill(), and MausJsonHitFactory._read_maus_spill().

def _read_primaries (   self)
private
def hit_from_maus_object (   cls,
  format,
  maus_dict,
  event_number 
)

Convert a MAUS object into a Hit according to specified formats.

Definition at line 125 of file _maus_json_hit_factory.py.

Referenced by MausJsonHitFactory._read_primaries(), and MausJsonHitFactory._read_virtual_hits().

def file_types (   cls)

Return a list of file types that the factory can read.

Definition at line 154 of file _maus_json_hit_factory.py.

Referenced by MausJsonHitFactory.__init__(), and MausRootHitFactory.__init__().

def deprecated_file_types (   cls)

Return a list of deprecated file types (no longer used)

Definition at line 160 of file _maus_json_hit_factory.py.

Referenced by MausJsonHitFactory.__init__().

Member Data Documentation

dictionary _maus_three_vec_conversions
staticprivate
Initial value:
1 = { # maus three vectors are sub-dicts of virtual_hit
2  "virtual_hit":{"position":"", "momentum":"p", "b_field":"b", "e_field":"e"},
3  "primary":{"position":"", "momentum":"p"}
4  }

Definition at line 163 of file _maus_json_hit_factory.py.

dictionary _maus_variable_conversions
staticprivate
Initial value:
1 = {
2  "virtual_hit":{"station_id":"station", "particle_id":"pid", "track_id":"particle_number", "time":"t", "mass":"mass", "charge":"charge", "proper_time":"proper_time", "path_length":"path_length"},
3  "primary":{"particle_id":"pid", "time":"t", "energy":"energy"} # we also force "mass" from "pid"
4  }

Definition at line 168 of file _maus_json_hit_factory.py.

dictionary _file_mass_shell
staticprivate
Initial value:
1 = {
2  "virtual_hit":"energy",
3  "primary":"p"
4  }

Definition at line 173 of file _maus_json_hit_factory.py.

Referenced by MausRootHitFactory._read_primaries().

fin

Definition at line 46 of file _maus_json_hit_factory.py.

hits
format
spill

The documentation for this class was generated from the following file: