uproot.models.TH.Model_TH3C_v4
Defined in uproot.models.TH on line 3046.
Inheritance order: |
---|
- class uproot.models.TH.Model_TH3C_v4
A uproot.model.VersionedModel for
TH3C
version 4.
read_member_n
- Model_TH3C_v4.read_member_n(chunk, cursor, context, file, member_index)
to_numpy
Inherited from uproot.behaviors.TH3.TH3.
- Model_TH3C_v4.to_numpy(flow=False, dd=False)
- Parameters:
flow (bool) – If True, include underflow and overflow bins; otherwise, only normal (finite-width) bins are included.
dd (bool) – If True, the return type follows numpy.histogramdd; otherwise, it follows numpy.histogram and numpy.histogram2d.
Converts the histogram into a form like the ones produced by the NumPy histogram functions.
name
Inherited from uproot.behaviors.TH1.Histogram.
- Model_TH3C_v4.name
The name of the histogram.
title
Inherited from uproot.behaviors.TH1.Histogram.
- Model_TH3C_v4.title
The title of the histogram.
axes
Inherited from uproot.behaviors.TH1.Histogram.
- Model_TH3C_v4.axes
axis
Inherited from uproot.behaviors.TH1.Histogram.
- Model_TH3C_v4.axis(axis)
Returns a specified uproot.behaviors.TAxis.TAxis object.
The
axis
can be specified asa non-negative integer:
0
is the first axis,1
is the second, and2
is the third.a negative integer:
-1
is the last axis,-2
is the second-to-last, and-3
is the third-to-last.a string:
"x"
is the first axis,"y"
is the second, and"z"
is the third
(assuming that the histogram dimension supports a given
axis
).
weighted
Inherited from uproot.behaviors.TH1.Histogram.
- Model_TH3C_v4.weighted
True if the histogram has weights (
fSumw2
); False otherwise.
kind
Inherited from uproot.behaviors.TH1.Histogram.
- Model_TH3C_v4.kind
values
Inherited from uproot.behaviors.TH1.Histogram.
- Model_TH3C_v4.values(flow=False)
- Parameters:
flow (bool) – If True, include underflow and overflow bins before and after the normal (finite-width) bins.
Bin contents as a 1, 2, or 3 dimensional
numpy.ndarray
. Thenumpy.dtype
of this array depends on the histogram type.Setting
flow=True
increases the length of each dimension by two.
errors
Inherited from uproot.behaviors.TH1.Histogram.
- Model_TH3C_v4.errors(flow=False)
- Parameters:
flow (bool) – If True, include underflow and overflow bins before and after the normal (finite-width) bins.
Errors (uncertainties) in the values as a 1, 2, or 3 dimensional
numpy.ndarray
ofnumpy.float64
.If
fSumw2
(weights) are available, they will be used in the calculation of the errors. If not, errors are assumed to be the square root of the values.Setting
flow=True
increases the length of each dimension by two.
variances
Inherited from uproot.behaviors.TH1.Histogram.
- Model_TH3C_v4.variances(flow=False)
- Parameters:
flow (bool) – If True, include underflow and overflow bins before and after the normal (finite-width) bins.
Variances (uncertainties squared) in the values as a 1, 2, or 3 dimensional
numpy.ndarray
ofnumpy.float64
.If
fSumw2
(weights) are available, they will be used in the calculation of the variances. If not, variances are assumed to be equal to the values.Setting
flow=True
increases the length of each dimension by two.
counts
Inherited from uproot.behaviors.TH1.Histogram.
to_boost
Inherited from uproot.behaviors.TH1.Histogram.
- Model_TH3C_v4.to_boost(metadata=None, axis_metadata=None)
- Parameters:
metadata (dict of str → str) – Metadata to collect (keys) and their C++ class member names (values).
axis_metadata (dict of str → str) – Metadata to collect from each axis.
Converts the histogram into a
boost-histogram
object.
to_hist
Inherited from uproot.behaviors.TH1.Histogram.
- Model_TH3C_v4.to_hist(metadata=None, axis_metadata=None)
- Parameters:
metadata (dict of str → str) – Metadata to collect (keys) and their C++ class member names (values).
axis_metadata (dict of str → str) – Metadata to collect from each axis.
Converts the histogram into a
hist
object.
classname
Inherited from uproot.Model.
- Model_TH3C_v4.classname
The C++ (decoded) classname of the modeled class.
See uproot.classname_decode, uproot.classname_encode, and uproot.model.classname_version.
encoded_classname
Inherited from uproot.Model.
- Model_TH3C_v4.encoded_classname
The Python (encoded) classname of the modeled class. May or may not include version.
See uproot.classname_decode, uproot.classname_encode, and uproot.model.classname_version.
class_version
Inherited from uproot.Model.
- Model_TH3C_v4.class_version
The version number of the modeled class (int) if any; None otherwise.
See uproot.classname_decode, uproot.classname_encode, and uproot.model.classname_version.
cursor
Inherited from uproot.Model.
- Model_TH3C_v4.cursor
A cursor pointing to the start of this instance in the byte stream (before read_numbytes_version).
file
Inherited from uproot.Model.
- Model_TH3C_v4.file
A uproot.ReadOnlyFile, which may be open and readable, or a uproot.reading.DetachedFile, which only contains information about the original file (not an open file handle).
close
Inherited from uproot.Model.
- Model_TH3C_v4.close()
Closes the file from which this object is derived, if such a file is still attached (i.e. not uproot.reading.DetachedFile).
closed
Inherited from uproot.Model.
- Model_TH3C_v4.closed
True if the associated file is known to be closed; False if it is known to be open. If the associated file is detached (uproot.reading.DetachedFile), then the value is None.
parent
Inherited from uproot.Model.
- Model_TH3C_v4.parent
The object that was deserialized before this one in recursive descent, usually the containing object (or the container’s container).
concrete
Inherited from uproot.Model.
members
Inherited from uproot.Model.
- Model_TH3C_v4.members
A dict of C++ member data directly associated with this class (i.e. not its superclasses). For all members, see all_members.
all_members
Inherited from uproot.Model.
has_member
Inherited from uproot.Model.
member
Inherited from uproot.Model.
- Model_TH3C_v4.member(name, all=True, none_if_missing=False)
- Parameters:
name (str) – The name of the member datum to retrieve.
all (bool) – If True, recursively search all superclasses in bases. Otherwise, search the direct class only.
none_if_missing (bool) – If a member datum doesn’t exist in the search path,
none_if_missing=True
has this function return None, butnone_if_missing=False
would have it raise an exception. Note that None is a possible value for some member data.
Returns a C++ member datum by name.
bases
Inherited from uproot.Model.
- Model_TH3C_v4.bases
List of uproot.Model objects representing superclass data for this object in the order given in C++ (opposite method resolution order).
If this object has no superclasses,
bases
is empty.If it has one superclass, which itself might have superclasses,
bases
has length 1.Only if this object multiply inherits from more than one superclass at the same level does
bases
have length greater than 1.
Since multiple inheritance is usually avoided,
bases
rarely has length greater than 1. A linear chain of superclasses deriving from super-superclasses is represented bybases
containing an object whosebases
contains objects.
base
Inherited from uproot.Model.
is_instance
Inherited from uproot.Model.
- Model_TH3C_v4.is_instance(*cls)
Returns True if this object matches a given type in the C++ class hierarchy.
The
cls
arguments may be Python classes or C++ classname strings to match.
num_bytes
Inherited from uproot.Model.
- Model_TH3C_v4.num_bytes
Number of bytes expected in the (uncompressed) serialization of this instance.
This value may be None (unknown before reading) or an integer.
If the value is an integer and the object exists (no exceptions in read), then the expected number of bytes agreed with the actual number of bytes, and this numer is reliable.
If this object is re-serialized, it won’t necessarily occupy the same number of bytes.
instance_version
Inherited from uproot.Model.
- Model_TH3C_v4.instance_version
Version of this instance as read from the byte stream.
If this model is versioned (uproot.model.VersionedModel), the
instance_version
ought to be equal to the class_version.If this model is versionless, the
instance_version
contains new information about the actual version deserialized.
is_memberwise
Inherited from uproot.Model.
- Model_TH3C_v4.is_memberwise
True if the object was serialized in ROOT’s memberwise format; False otherwise.
awkward_form
Inherited from uproot.Model.
- classmethod Model_TH3C_v4.awkward_form(file, context)
- Parameters:
cls (subclass of uproot.Model) – This class.
file (uproot.ReadOnlyFile) – File to use to generate uproot.Model classes from its streamers and
file_path
for error messages.context (dict) – Context for the Form-generation; defaults are the remaining arguments below.
index_format (str) – Format to use for indexes of the
awkward.forms.Form
; may be"i32"
,"u32"
, or"i64"
.header (bool) – If True, include header fields of each C++ class.
tobject_header (bool) – If True, include header fields of each
TObject
base class.breadcrumbs (tuple of class objects) – Used to check for recursion. Types that contain themselves cannot be Awkward Arrays because the depth of instances is unknown.
The
awkward.forms.Form
to use to put objects of type type in an Awkward Array.
strided_interpretation
Inherited from uproot.Model.
- classmethod Model_TH3C_v4.strided_interpretation(file, header=False, tobject_header=True, breadcrumbs=(), original=None)
- Parameters:
cls (subclass of uproot.Model) – This class.
file (uproot.ReadOnlyFile) – File to use to generate uproot.Model classes from its streamers and
file_path
for error messages.header (bool) – If True, assume the outermost object has a header.
tobject_header (bool) – If True, assume that
TObjects
have headers.original (None, uproot.Model, or uproot.containers.Container) – The original, non-strided model or container.
breadcrumbs (tuple of class objects) – Used to check for recursion. Types that contain themselves cannot be strided because the depth of instances is unknown.
Returns a list of (str,
numpy.dtype
) pairs to build a uproot.AsStridedObjects interpretation.
tojson
Inherited from uproot.Model.
- Model_TH3C_v4.tojson()
Serializes this object in its ROOT JSON form (as Python lists and dicts, which can be passed to
json.dump
orjson.dumps
).
empty
Inherited from uproot.Model.
- classmethod Model_TH3C_v4.empty()
Creates a model instance (of subclass
cls
) with no data; all required attributes are None or empty.
read
Inherited from uproot.Model.
- classmethod Model_TH3C_v4.read(chunk, cursor, context, file, selffile, parent, concrete=None)
- Parameters:
cls (subclass of uproot.Model) – Class to instantiate.
chunk (uproot.source.chunk.Chunk) – Buffer of contiguous data from the file uproot.source.chunk.Source.
cursor (uproot.Cursor) – Current position in that
chunk
.context (dict) – Auxiliary data used in deserialization.
file (uproot.ReadOnlyFile) – An open file object, capable of generating new uproot.Model classes from its streamers.
selffile (uproot.reading.CommonFileMethods) – A possibly uproot.reading.DetachedFile associated with this object.
parent (None or calling object) – The previous
read
in the recursive descent.concrete (None or uproot.Model instance) – If None, this model corresponds to the concrete (instantiated) class in C++. Otherwise, this model represents a superclass part of the object, and
concrete
points to the concrete instance.
Creates a model instance by reading data from a file.
read_numbytes_version
Inherited from uproot.Model.
- Model_TH3C_v4.read_numbytes_version(chunk, cursor, context)
- Parameters:
chunk (uproot.source.chunk.Chunk) – Buffer of contiguous data from the file uproot.source.chunk.Source.
cursor (uproot.Cursor) – Current position in that
chunk
.context (dict) – Auxiliary data used in deserialization.
Reads the number of bytes and instance version from the byte stream, which is usually 6 bytes (4 + 2). Bits with special meanings are appropriately masked out.
Some types don’t have a 6-byte header or handle it differently; in those cases, this method should be overridden.
read_members
Inherited from uproot.Model.
- Model_TH3C_v4.read_members(chunk, cursor, context, file)
- Parameters:
chunk (uproot.source.chunk.Chunk) – Buffer of contiguous data from the file uproot.source.chunk.Source.
cursor (uproot.Cursor) – Current position in that
chunk
.context (dict) – Auxiliary data used in deserialization.
file (uproot.ReadOnlyFile) – An open file object, capable of generating new uproot.Model classes from its streamers.
Reads the member data for this class. The abstract class uproot.Model has an empty
read_members
method; this must be overridden by subclasses.
check_numbytes
Inherited from uproot.Model.
- Model_TH3C_v4.check_numbytes(chunk, cursor, context)
- Parameters:
chunk (uproot.source.chunk.Chunk) – Buffer of contiguous data from the file uproot.source.chunk.Source.
cursor (uproot.Cursor) – Current position in that
chunk
.context (dict) – Auxiliary data used in deserialization.
Reads nothing; checks the expected number of bytes against the actual movement of the
cursor
at the end of the object, possibly raising a uproot.DeserializationError exception.If num_bytes is None, this method does nothing.
It is possible that a subclass would override this method, but not likely.
postprocess
Inherited from uproot.Model.
- Model_TH3C_v4.postprocess(chunk, cursor, context, file)
- Parameters:
chunk (uproot.source.chunk.Chunk) – Buffer of contiguous data from the file uproot.source.chunk.Source.
cursor (uproot.Cursor) – Current position in that
chunk
.context (dict) – Auxiliary data used in deserialization.
file (uproot.ReadOnlyFile) – An open file object, capable of generating new uproot.Model classes from its streamers.
Called for any additional processing after the object has been fully read.
The return value from this method is the object that actually represents the ROOT data, which might be a different instance or even a different type from this class. The default in uproot.Model is to return
self
.Note that for versioned models, postprocess is called first, then postprocess is called on its output, allowing a uproot.model.DispatchByVersion to refine all data of its type, regardless of version.
hook_before_read
Inherited from uproot.Model.
hook_before_read_members
Inherited from uproot.Model.
- Model_TH3C_v4.hook_before_read_members(**kwargs)
Called in read, after read_numbytes_version and before read_members.
hook_after_read_members
Inherited from uproot.Model.
- Model_TH3C_v4.hook_after_read_members(**kwargs)
Called in read, after read_members and before check_numbytes.
hook_before_postprocess
Inherited from uproot.Model.
- Model_TH3C_v4.hook_before_postprocess(**kwargs)
Called in read, after check_numbytes and before postprocess.
to_writable
Inherited from uproot.Model.
- Model_TH3C_v4.to_writable()
- Parameters:
obj (uproot.Model instance of the same C++ class) – The object to convert to this class version.
Returns a writable version of this object or raises a NotImplementedError if no writable version exists.
serialize
Inherited from uproot.Model.
- Model_TH3C_v4.serialize(name=None)
Serialize a object (from num_bytes and version onward) for writing into an output ROOT file.
If a
name
is given, override the object’s current name.This method has not been implemented on all classes (raises NotImplementedError).
to_pyroot
Inherited from uproot.Model.
- Model_TH3C_v4.to_pyroot(name=None)
- Parameters:
name (str or None) – A name for the new PyROOT object.
Converts this uproot.Model into a PyROOT object if it is writable. A minority of Uproot models are writable, mostly just histograms. Writability is necessary for conversion to PyROOT because it is serialized through a ROOT TMessage.